On Fri, Feb 22, 2013 at 6:11 AM, Timothy Madden <[email protected]> wrote:
> On 02/21/2013 08:58 PM, Matthew Weier O'Phinney wrote:
>>
>> On Thu, Feb 21, 2013 at 11:19 AM, Timothy Madden <[email protected]>
>> wrote:
>>>
>>> Is there a way in Zend that allows me to turn php warnings and notices
>>> into
>>> exceptions ?
>>>
>>> In my application an undefined array index or a foreach() statement that
>>> tries to iterate a NULL variable is clearly an application error, not a
>>> notice or warning.
>>>
>>> Is there a way for the Zend Framework to do the equivalent of:
>>>
>>> function exception_error_handler($errno, $errstr, $errfile, $errline ) {
>>>      throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
>>> }
>>> set_error_handler("exception_error_handler");
>>
>>
>> As Marco pointed out, Zend\Stdlib\ErrorHandler. Additionally, you can
>> use Zend\Log\Logger's registerErrorHandler() and
>> registerExceptionHandler() methods.
>
>
> Thank you.
>
> Is there a way to achieve the same result on Zend 1.12 ?

$log = new Zend_Log();
$log->registerErrorHandler();

It doesn't have a registerExceptionHandler() method, however.


-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to