} throw new Exception(self::format_errno($errno) . ': ' . $errstr); } private static function format_errno($errno) { switch ($errno) { case E_WARNING: return 'E_WARNING'; case E_NOTICE: return 'E_NOTICE'; case E_USER_ERROR: return 'E_USER_ERROR'; case E_USER_WARNING: return 'E_USER_WARNING'; case E_USER_NOTICE: return 'E_USER_NOTICE'; case E_STRICT: return 'E_STRICT'; case E_RECOVERABLE_ERROR: return 'E_RECOVERABLE_ERROR'; case E_DEPRECATED: return 'E_DEPRECATED'; case E_USER_DEPRECATED: return 'E_USER_DEPRECATED'; default: return "Unknown error type [{$errno}]"; } } } ErrorHandler::install();
public static function create($mainScriptPath) { self::$instances[] = new self($mainScriptPath); ErrorHandler::install(); }