Set CI_ENVIRONMENT before return false if uri is /index.php

This commit is contained in:
Natan Felles 2017-11-23 19:08:45 -02:00
parent fc6bf768d8
commit fcce6ff40c
No known key found for this signature in database
GPG Key ID: 59CC6FA82E1E87FD

View File

@ -8,6 +8,10 @@
* functionality so the site will operate as normal.
*/
// If we're serving the site locally, then we need
// to let the application know that we're in development mode
$_SERVER['CI_ENVIRONMENT'] = 'development';
$uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
$path = __DIR__.'/public/'.ltrim($uri,'/');
@ -21,9 +25,4 @@ if ($uri !== '/' && (is_file($path) || is_dir($path)))
// Otherwise, we'll load the index file and let
// the framework handle the request from here.
// If we're serving the site locally, then we need
// to let the application know that we're in development mode
$_SERVER['CI_ENVIRONMENT'] = 'development';
require_once __DIR__.'/public/index.php';