Fix running huge via php shell
This commit is contained in:
@@ -2,14 +2,13 @@
|
|||||||
|
|
||||||
class Config
|
class Config
|
||||||
{
|
{
|
||||||
// this is public to allow better Unit Testing
|
|
||||||
public static $config;
|
public static $config;
|
||||||
|
|
||||||
public static function get($key)
|
public static function get($key)
|
||||||
{
|
{
|
||||||
if (!self::$config) {
|
if (!self::$config) {
|
||||||
|
|
||||||
$config_file = '../application/config/config.' . Environment::get() . '.php';
|
$config_file = __DIR__ . '/../config/config.' . Environment::get() . '.php';
|
||||||
|
|
||||||
if (!file_exists($config_file)) {
|
if (!file_exists($config_file)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
// auto-loading the classes (currently only from application/libs) via Composer's PSR-4 auto-loader
|
// auto-loading the classes (currently only from application/libs) via Composer's PSR-4 auto-loader
|
||||||
// later it might be useful to use a namespace here, but for now let's keep it as simple as possible
|
// later it might be useful to use a namespace here, but for now let's keep it as simple as possible
|
||||||
require '../vendor/autoload.php';
|
require __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
// start our application
|
// start our application
|
||||||
new Application();
|
new Application();
|
||||||
|
|||||||
11
public/router.php
Normal file
11
public/router.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (php_sapi_name() === 'cli-server') {
|
||||||
|
$filePath = __DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||||
|
if (is_file($filePath)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$_GET['url'] = isset($_SERVER['PATH_INFO']) ? ltrim($_SERVER['PATH_INFO'], '/') : '';
|
||||||
|
require __DIR__ . '/index.php';
|
||||||
Reference in New Issue
Block a user