コード例 #1
0
 /**
  * Handles execution errors on shutdown
  *
  * @return void
  *
  * @access public
  *
  * @static
  */
 public static function handleShutdown()
 {
     $last_error = error_get_last();
     if ($last_error !== null && $last_error['type'] != E_DEPRECATED && $last_error['type'] != E_NOTICE) {
         ErrorException::handleError($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']);
     }
 }
コード例 #2
0
 * Dependency container
 */
$container = new Container($dependency);
/**
 * Shutdown register
 */
register_shutdown_function(array('ToucaNine\\Exception\\ErrorException', 'handleShutdown'));
/**
 * Error handler
 */
set_error_handler(array('ToucaNine\\Exception\\ErrorException', 'handleError'), E_ALL ^ E_DEPRECATED ^ E_NOTICE | E_STRICT);
/**
 * Exception handler
 */
set_exception_handler(array('ToucaNine\\Exception\\ErrorException', 'handleException'));
/**
 * Dependency setter
 */
Exception\ErrorException::setHttp($container->get('ToucaNine\\Http\\Http'));
Exception\ErrorException::setView($container->get('ToucaNine\\View\\View'));
/**
 * Application configuration
 */
include APP_PATH . DS . 'Config' . EXT;
/**
 * Application execution
 */
$app = $container->get('ToucaNine\\Application\\Application');
/**
 * END ToucaNine/Bootstrapper.php
 */