Esempio n. 1
0
    $file = explode('\\', $_class);
    if ($file[0] !== __NAMESPACE__) {
        return false;
    }
    array_shift($file);
    array_unshift($file, __DIR__, '..', 'libs');
    $file = implode(DIRECTORY_SEPARATOR, $file) . '.' . PHP_EXT;
    if (!is_file($file)) {
        $loaded[$_class] = false;
    } else {
        require $file;
        $loaded[$_class] = true;
    }
    return $loaded[$_class];
});
Debug::$start = $start;
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
    switch ($errno) {
        case E_RECOVERABLE_ERROR:
        case E_COMPILE_ERROR:
        case E_CORE_ERROR:
        case E_USER_ERROR:
        case E_ERROR:
        case E_PARSE:
            $err = Debug::LEVEL_FATAL;
            break;
        case E_COMPILE_WARNING:
        case E_CORE_WARNING:
        case E_USER_WARNING:
        case E_WARNING:
            $err = Debug::LEVEL_WARNING;