Beispiel #1
0
<?php

/* Create application instance and set it as default container */
$app = new Ape\Application();
$app->instance('app', $app);
$app->alias('app', 'Illuminate\\Container\\Container');
Ape\Facades\Facade::setFacadeApplication($app);
$app->instance('config', 'Ape\\Facades\\Config', true);
$app->buildEnvironment(function () {
    if (isset($_ENV['DEVZ'])) {
        // development environment
        return array('dev', 'dev/' . $_ENV['DEVZ']);
    }
    if ($_SERVER['SERVER_ADDR'] == '10.0.0.13') {
        return 'pi';
    }
    return 'prod';
});
// a.
//  load generic config
//  detect environment
//  load environment-specific config
//
// or
//
// b.
//  detect environment
//  try to load pre-cached config
//  if fail load generic config and environment-specific, then write down compiled one
if (Config::get('debug', false)) {
    // register whoops handler
Beispiel #2
0
 /**
  * Register a new resolving callback.
  *
  * @param  Closure $callback
  *
  * @return void
  */
 public static function resolving(Closure $callback)
 {
     return Ape\Application::resolving($callback);
 }