<?php if (!Install\Installer::is_complete()) { // Route for AJAX Requests Route::post('install/ajax/(:any?)/(:any?)', function ($method = 'index', $parameters = null) { return Controller::call("install::frontend.ajax@{$method}", array($parameters)); }); Route::any('install/(:any?)/(:any?)', function ($method = 'index', $parameters = null) { return Controller::call("install::frontend.install@{$method}", array($parameters)); }); Route::get('/', function () { return Redirect::to('install'); }); Event::listen('500', function ($message) { if (Request::ajax()) { $response['success'] = 'false'; $response['message'] = $message; echo Response::make(json_encode($response))->header('Cache-Control', 'no-cache, must-revalidate')->header('Expires', 'Mon, 01 Jan 2000 00:00:00 GMT')->header('Content-Type', 'application/json'); exit(1); } }); }
<?php Autoloader::namespaces(array('Install' => Bundle::path('install') . 'libraries')); if (!Session::has('adm_lang')) { Session::put('adm_lang', 'us'); } /* |-------------------------------------------------------------------------- | Set Application Security Key |-------------------------------------------------------------------------- | | The application security key is used by the encryption and cookie classes | to generate secure encrypted strings and hashes. At this poing we will | make sure that every installation contain an unique key with at least 32 | characters of random gibberish. | */ $app_installed = Config::get('application.installed'); $key_installed = Session::get('key_installed'); if (!$app_installed or !$key_installed) { Install\Installer::set_app_key(); Session::put('key_installed', true); } if (!defined('ADM_URI')) { define('ADM_URI', 'admin'); }