From: Trevor O. <tr...@gm...> - 2010-07-21 17:10:24
|
If you're talking about this line from my above code: require_once('CZ/ErrorHandler.php'); That is actually correct. Our libary has multiple folders, and we named our classes according the the library path so that it was easy to locate the code for each class, and each class would have a unique name. What way, when we have a Formatter class for phone numbers, and a Formatter class for email addresses, one can be Lib_Email_Formatter and the other can be Lib_Phone_Formatter nad we won't have conflicting Formatter class names. The include path I've posted is correct. On 21 July 2010 12:01, matt donohue <mm_...@ya...> wrote: > Hey Trevor, > > require_once('CZ/ErrorHandler.php'); > Should have an underscore. > > Also- you should look at PHP's autoload and get rid of that include junk. > > > Regards, > Matt > > > ________________________________ > From: Trevor Oldak <tr...@gm...> > To: Chicago PHP User Group <chi...@li...> > Sent: Wed, July 21, 2010 11:47:23 AM > Subject: [chiPHPug-discuss] Strange PEAR/include file error > > I set up our software platform where I work to email me whenever a serious > error occurs. I set up a class that handles errors: > <?php > class CZ_ErrorHandler{ > public static function handleError($errno, $errstr, $errfile, $errline, > $errcontext){ > ... > } > } > > set_error_handler(array('CZ_ErrorHandler','handleError')); > ?> > > set_error_handler does allow an array as an argument to handle all errors. > > I put this at the top of each php page: > <?php > require_once('CZ/ErrorHandler.php'); > ... > ?> > It's the first file included in each page, and it links to the code above. > > However, I get this error when exporting to XLS through pear: > > *Fatal error*: Class 'CZ_ErrorHandler' not found in * > /usr/share/pear/Spreadsheet/Excel/Writer/Workbook.php* on line *180 > > > *The ONLY place where set_error_handler is in the CZ/ErrorHandler.php file. > The script wouldn't know to use my error handler unless it had first > declared that class. > > So how the heck is this error happening? > > -Trevor > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first-- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > |