Re: PEAR_Warning proof of concept

From: Date: Sat, 10 Jul 2004 10:40:54 +0000
Subject: Re: PEAR_Warning proof of concept
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-31824@lists.php.net to get a copy of this message
Alan Knowles wrote:
Following the exception extends thread: I'm not sure you need errortypes or codes - if there is a really a need to diferenciate errors, then doing custom package warning classes, with the same extension trick that exceptions do, may prove more effective. I'm not sure you need the $myclass in the warning - require_once 'DB/Warning.php'; new DB_Warning("some warning"); is alot clearer than require_once 'DB/Warning.php'; require_once 'PEAR/Warning.php'; PEAR_Warning::newWarning($msg,null,null,1, 'DB_Warning');
Either way warnings need to be written to a stack (IIRC ErrorStack got the ability to limit the size of its stack). Returning warnings or throwing them obviously makes no sense, since you should easily be able to ignore them. At the same time it should be easy to promote a warning to become an error. regards, Lukas

« previous php.pear.dev (#31824) next »