diff --git a/.ht.router.php b/.ht.router.php new file mode 100644 index 000000000..77d3951da --- /dev/null +++ b/.ht.router.php @@ -0,0 +1,117 @@ +'open', 'WINNT'=>'explorer'][PHP_OS] ?? 'xdg-open').' '.escapeshellarg('http://localhost:8080'));\"", + "php -S localhost:8080 index.php" + ] + }, + "require": { "php": "^7.1.3", "ext-json": "*", diff --git a/index.php b/index.php index ee357e1de..f9f9a028a 100644 --- a/index.php +++ b/index.php @@ -14,7 +14,7 @@ date_default_timezone_set('UTC'); // handle php webserver -if (PHP_SAPI == 'cli-server' && is_file(__DIR__.parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) { +if (PHP_SAPI == 'cli-server' && false===include_once(__DIR__.'/.ht.router.php')) { return false; }