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

Use error suppression when triggering deprecation warnings

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      [~a.braun@voycer.com] brought this up in mongodb/mongo-php-library#533 (PHPLIB-346) after we added trigger_error() calls for deprecation notices. If we suppress those calls with the @ operator, we would avoid polluting stdout while still allowing custom handlers to be notified. Frameworks such as Symfony register custom handlers to capture warnings and notices for logging.

      Without suppressing our own trigger_error() calls, we leave users no way to suppress these errors without asking them to suppress the call into PHPLIB. Since our notices are emitted a few levels deeper than their entry point (e.g. collection method), that results in a fairly broad suppression.

      See symfony/symfony#14900 for additional discussion about this.

      If we decide to do this for PHPLIB, we should also consider if we can reach an equivalent approach in PHPC for PHPC-1137 and PHPC-1138.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jmikola Jeremy Mikola
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: