Esempio n. 1
0
require $framework . '/Illuminate/Foundation/start.php';
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
// if(!defined('STDIN')) {
// 	define('STDIN', fopen('php://stdin', 'r'));
// 	stream_set_blocking(STDIN, false);
// }
Config::set('admin_location', 'admin');
App::error(function (\PDOException $e, $code) {
    $message = explode(' ', $e->getMessage());
    $dbCode = rtrim($message[1], ']');
    $dbCode = trim($dbCode, '[');
    //  1049: database name
    //  2002: database server
    if ($dbCode == 1049 or $dbCode == 2002) {
        return Redirect::to('install');
    }
});
//  We need to make sure the admin path is consistent
$app->booted(function () use($app) {
    require $app['path'] . '/routes.php';
});
return $app;