Example #1
0
Load::config(['Config', 'Routing']);
// Set debug
Load::$config['debug'] = Load::$config['debug'] || in_array(Load::$config['client_ip'], (array) Load::$config['debug_ips']);
ini_set('error_reporting', !empty(Load::$config['debug']) ? E_ALL : E_ALL & ~E_DEPRECATED & ~E_STRICT);
ini_set('display_errors', (int) Load::$config['debug']);
// Autoload additional config files
if (!empty(Load::$config['autoload_configs'])) {
    foreach (Load::$config['autoload_configs'] as $item) {
        $tmp = explode('/', $item);
        $count = count($tmp);
        if ($count == 3) {
            Load::config($tmp[2], $tmp[1], $tmp[0]);
        } elseif ($count == 2) {
            Load::config($tmp[1], $tmp[0]);
        } else {
            Load::config($tmp[0]);
        }
    }
}
/**
 * StaticPHP's error handler. Turns errors into exceptions and passes on to sp_exception_handler().
 *
 * Stops on @ suppressed errors.
 *
 * @see sp_exception_handler()
 * @access public
 * @param mixed $errno
 * @param mixed $errstr
 * @param mixed $errfile
 * @param mixed $errline
 * @return bool Returns whether the error was handled or not.