]> git.andy128k.dev Git - ipf.git/commitdiff
php 5.4 cli-server
authorAndrey Kutejko <andy128k@gmail.com>
Sun, 15 Jul 2012 18:55:55 +0000 (21:55 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sun, 15 Jul 2012 18:55:55 +0000 (21:55 +0300)
index.php
ipf/project.php

index e6e67e130a030b5f49ac713e1760d38ea17d9cc6..790368e7111eae79d15efae192461d3c5a6272a2 100644 (file)
--- a/index.php
+++ b/index.php
@@ -7,4 +7,4 @@ $project_path = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'
 set_include_path($ipf_path.PATH_SEPARATOR.$project_path);
 require 'ipf.php';
 IPF::boot($ipf_path, $project_path);
-IPF_Project::getInstance()->run();
+return IPF_Project::getInstance()->run();
index d25db8cc1393effdd6076527ed4642292481af36..15c221c7c27a07b51b5947e899680e3ab1bad39a 100644 (file)
@@ -127,11 +127,17 @@ final class IPF_Project{
         
         if (php_sapi_name()=='cli'){
             $this->cli();
-            return;
+            return true;
+        }
+        if (php_sapi_name()=='cli-server'){
+            $path = $_SERVER['DOCUMENT_ROOT'] . $_SERVER["REQUEST_URI"];
+            if (is_file($path))
+                return false;
         }
         $this->loadModels();
         IPF_ORM_Manager::getInstance()->setAttribute(IPF_ORM::ATTR_VALIDATE, IPF_ORM::VALIDATE_ALL);
         $this->router = new IPF_Router();
         $this->router->dispatch(IPF_HTTP_URL::getAction()); 
+        return true;
        }
 }