Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16264 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48358 invoked by uid 1010); 17 May 2005 12:11:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 31195 invoked from network); 17 May 2005 12:03:14 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 17 May 2005 12:03:14 -0000 X-Host-Fingerprint: 69.93.155.18 brian.3gupload.com Received: from ([69.93.155.18:46789] helo=brian.3gupload.com) by pb1.pair.com (ecelerity 1.2 r(5656M)) with SMTP id 66/EA-01538-28DD9824 for ; Tue, 17 May 2005 08:03:14 -0400 Received: from [192.168.1.26] (internal.3gupload.com [68.253.30.206]) by brian.3gupload.com (Postfix) with ESMTP id 232334F0BBE; Tue, 17 May 2005 05:03:09 -0700 (PDT) Message-ID: <4289DDBA.8020809@3gupload.com> Date: Tue, 17 May 2005 07:04:10 -0500 Organization: 3GUpload.com, Inc. User-Agent: Mozilla Thunderbird 1.0 (X11/20041207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derick Rethans Cc: George Schlossnagle , PHP Developers Mailing List References: <4288F183.7010804@3gupload.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Patch for php_error_cb From: bmatheny@3gupload.com (Blake Matheny) Is there anything incorrect/wrong with the solution I proposed? I realize that a custom extension would also work, but there are several advantages to doing it the way I implemented it - No need to add an extension every time you upgrade PHP - No additional patching (which an extension essentially requires) - Only adds a couple of extra operations (no performance hit) - Backwards compatible with existing php.ini - Possibility for other prefixes (script:,file:,socket:,etc) Obviously I'd like this included in the tree, and if it won't be possible in the current implementation how should it be done? Ultimately having something like this that is just part of PHP is ideal from a maintenance standpoint. Thanks for the input. - Blake Derick Rethans wrote: > On Mon, 16 May 2005, George Schlossnagle wrote: > >>On May 16, 2005, at 3:16 PM, Blake Matheny wrote: >> >>>Attached is a small patch that allows for a custom error handler to be used >>>instead of php_log_err. This is useful for custom logging of error types >>>that can't be handled with a user-space error handler (such as E_ERROR, >>>E_PARSE, etc.). >>> >>>In order to use a custom error handler set error_log to so:/path/to/so in >>>the php.ini file, where the shared object has a function called >>>error_handler with the following prototype: >>> >>This is already possible without your patch: just write a php extension and >>change the zend_error_cb function pointer to your custom C function in MINIT. > > But make sure you call the original one after that... otherwise you > might break other extensions that modify the error_cb (like Xdebug). > > Derick -- Blake Matheny 3GUpload.com, Inc. Director of Technology 317-472-4962 (W) 317-201-2840 (C) bmatheny@3gupload.com