]> git.andy128k.dev Git - ipf.git/commitdiff
extract debug router
authorAndrey Kutejko <andy128k@gmail.com>
Mon, 12 Jan 2015 05:49:52 +0000 (07:49 +0200)
committerAndrey Kutejko <andy128k@gmail.com>
Mon, 12 Jan 2015 05:49:52 +0000 (07:49 +0200)
index.php
ipf/command/debugserver.php
ipf/debug_router.php [new file with mode: 0644]

index 9753a2498cd7c9d34cc1ebb417b9d23f73e6c1a3..a3b8e3a7c1583d15e3e0bef2f13aeccffc99a865 100644 (file)
--- 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';
index 07bc79e4a17815efea72d3fe50d32829f5c5144d..2d3c103a9768a2e46d0a7a5087cd84bc11d0a9b8 100644 (file)
@@ -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 (file)
index 0000000..1933a85
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+if (is_file($_SERVER['DOCUMENT_ROOT'] . urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))))
+    return false;
+
+require $_SERVER['DOCUMENT_ROOT'].'/index.php';
+