Пример #1
0
 /**
  * Create a new Illuminate HTTP request from server variables.
  *
  * @return static
  */
 public static function capture()
 {
     static::enableHttpMethodParameterOverride();
     return static::createFromBase(SymfonyRequest::createFromGlobals());
 }
Пример #2
0
Registry::set('application.request.method', $_SERVER['REQUEST_METHOD']);
/**
 * Require the config files and add those results to the Registry
 */
Registry::set('config', require APP . 'config' . DS . 'config.php');
/**
 * Setting up the events manager
 */
Registry::set('foundation.events', new Events());
Events::create(array('title' => 'application.boot', 'event' => function () {
}));
/**
 * Setting the current HTTP request to the events manager
 */
Events::create(array('title' => 'request.get', 'event' => function () {
    return SymfonyRequest::createFromGlobals();
}));
/**
 * Setting up the default error page
 */
Events::create(array('title' => 'application.error.404', 'event' => function () {
    return '<h2>Er is een fout opgetreden!</h2><p>De pagina waarop je gezocht op hebt, is helaas niet (meer) beschrikaar';
}));
/**
 * Creating all aliases for the original classes, they are specified in the config array
 */
foreach (Registry::get('config')['classAliases'] as $originalClass => $alias) {
    AliasLoader::create($originalClass, $alias);
}
/**
 * Attach all of the service providers (specified the config file) to the application