Example #1
0
 public function initPages()
 {
     ErrorSettings::setDisplayMode('cli');
     WrapHeader('Content-Type: application/json');
 }
Example #2
0
 *
 * @package app
 * @author Rick Gigger
 **/
error_reporting(E_ALL & ~E_STRICT);
class ErrorSettings
{
    private static $mode;
    // should be either web or cli
    public static function setDisplayMode($mode)
    {
        self::$mode = $mode;
    }
    public static function getDisplayMode()
    {
        return self::$mode;
    }
}
if (php_sapi_name() == "cli") {
    ErrorSettings::setDisplayMode('cli');
    include zoop_dir . '/boot/error/CliErrorHandler.php';
    set_error_handler(array("CliErrorHandler", "handleError"), E_ALL);
    // set_error_handler(array("CliErrorHandler", "throwException"), E_ALL);
    set_exception_handler(array("CliErrorHandler", "exceptionHandler"));
} else {
    ErrorSettings::setDisplayMode('web');
    include zoop_dir . '/boot/error/WebErrorHandler.php';
    // set_error_handler(array("WebErrorHandler", "throwException"), E_ALL);
    set_error_handler(array("WebErrorHandler", "handleError"), E_ALL);
    set_exception_handler(array("WebErrorHandler", "exceptionHandler"));
}