From: matt d. <mm_...@ya...> - 2010-07-21 17:01:16
|
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 |