Esempio n. 1
0
$env = $app->detectEnvironment(function () use($app) {
    return require_once __DIR__ . '/environment.php';
});
/*
|--------------------------------------------------------------------------
| Load The Application
|--------------------------------------------------------------------------
|
| Here we will load this Illuminate application. We will keep this in a
| separate location so we can isolate the creation of an application
| from the actual running of the application with a given request.
|
*/
$framework = $app['path.base'] . '/vendor/laravel/framework/src';
require $framework . '/Illuminate/Foundation/start.php';
if (!$app->runningInConsole()) {
    $setupFilePath = $app['path.base'] . '/app/bfacp/setup.php';
    $jsBuildsPath = $app['path.public'] . '/js/builds';
    if (version_compare(phpversion(), '5.5.0', '<') || !extension_loaded('mcrypt') || !extension_loaded('pdo')) {
        die(View::make('system.requirements', ['required_php_version' => '5.5.0']));
    }
    if (file_exists($setupFilePath) && !in_array(App::environment(), ['local', 'testing'])) {
        require_once $setupFilePath;
        if (!unlink($setupFilePath)) {
            die(sprintf('Please delete installer located at "%s"', $setupFilePath));
        }
    }
    $_SERVER['REMOTE_ADDR'] = isset($_SERVER['HTTP_CF_CONNECTING_IP']) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : $_SERVER['REMOTE_ADDR'];
} else {
    $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
}