From e2d0d7e5c5be91fc05670f2027084e2f6fec36a7 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Mon, 12 Jan 2015 07:49:52 +0200 Subject: [PATCH] extract debug router --- index.php | 3 --- ipf/command/debugserver.php | 3 ++- ipf/debug_router.php | 7 +++++++ 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 ipf/debug_router.php diff --git a/index.php b/index.php index 9753a24..a3b8e3a 100644 --- a/index.php +++ b/index.php @@ -2,9 +2,6 @@ // This is a index stub for a IPF Projects -if (php_sapi_name() === 'cli-server' && is_file($_SERVER['DOCUMENT_ROOT'] . urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)))) - return false; - $here = dirname(__FILE__); $project_root = $here . '/..'; require_once $project_root . '/vendor/autoload.php'; diff --git a/ipf/command/debugserver.php b/ipf/command/debugserver.php index 07bc79e..2d3c103 100644 --- a/ipf/command/debugserver.php +++ b/ipf/command/debugserver.php @@ -8,7 +8,8 @@ class IPF_Command_DebugServer public function run($args=null) { $root = IPF::get('document_root'); - IPF_Shell::call('php', '-S', '0.0.0.0:8000', '-t', $root, $root . '/index.php'); + $router = dirname(__FILE__).'/../debug_router.php'; + IPF_Shell::call('php', '-S', '0.0.0.0:8000', '-t', $root, $router); } } diff --git a/ipf/debug_router.php b/ipf/debug_router.php new file mode 100644 index 0000000..1933a85 --- /dev/null +++ b/ipf/debug_router.php @@ -0,0 +1,7 @@ +