Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-592

Allow GridFS StreamWrapper to throw on error instead of emitting a PHP warning

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.11.0
    • Affects Version/s: None
    • Component/s: None
    • None

      The GridFS StreamWrapper's stream_read and stream_write methods currently catch exceptions from our stream classes and instead trigger PHP warnings and return false. While this complies with the suggested streamWrapper API, it may be more useful to expose users to the original exception instead.

      Before making this change, we should see if might cause adverse affects with PHP's own stream functions (e.g. stream_get_contents()).

      Implementing this would allow us to remove some special handling in our GridFS and unified spec test runners that currently check for PHP warnings instead of exceptions to detect certain GridFS errors.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: