Shackle - disable error_reporting changes
| From: | Sean Coates | Date: | Wed, 02 Dec 2009 18:34:56 +0000 |
| Subject: | Shackle - disable error_reporting changes | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-6872@lists.php.net to get a copy of this message | ||
Hi.
I've been testing a bunch of third-party PHP apps lately. A lot of them change the
error_reporting level in userspace. This drives me crazy. Almost as crazy as @function(). Luckily
Scream has fixed the @ problem, but the error_reporting problem continued to plague my testing.
Often, these apps will change the error_reporting in their initialization code, which is often
before sending headers.
I tried using disabled_functions for error_reporting, but this causes its own warnings. This causes
output before headers, and its own set of problems. This also leaves the ini_set() hole open.
I wrote an extension that overrides error_reporting() and ini_set('error_reporting', ...).
Attempted changes to the reporting level are logged, but are otherwise silent, to be as transparent
as possible to the code (which is why I couldn't, for example, change error_reporting to
PHP_INI_SYSTEM).
Here's the code: http://caedmon.net/shackle-0.1.1.tgz
If there are no objections, I'll push it into SVN and make a PECL package.
If there are objections, please speak up. Gwynne has graciously indicated the main problems in my
original code, so hopefully there are no remaining glaring errors.
Thanks.
S