We have an app that includes a very very old class to connect to a proprietary database's API. This code is generating a large number of deprecation errors that then get logged, polluting our log files.
We'd like to essentially ignore the deprecation errors only for this vendor-provided class, but I am having trouble finding the best way to do this. Options that I've seen:
Supressing the warnings using @
. It looks like this does not work for includes, only for functions that return a value.
Creating a wrapper script that contains the include, and turn off the warnings prior to the include statement. As ini_set
acts globally, turning off all deprecation warnings, this is not a viable solution.
Updating the vendor-provided script. We'd rather not go down this path, given the extra work and maintenance should a new version arrive that does not fully address these errors, but adds new functionality, for example.
Any other options to disable warnings in this one particular vendor library that I am missing?