From: Andrey Kutejko Date: Sun, 15 Jul 2012 18:55:55 +0000 (+0300) Subject: php 5.4 cli-server X-Git-Tag: 0.5~316 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=11288a38099dab6ca1f2129227ad3bf301f1c21a;p=ipf.git php 5.4 cli-server --- diff --git a/index.php b/index.php index e6e67e1..790368e 100644 --- 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(); diff --git a/ipf/project.php b/ipf/project.php index d25db8c..15c221c 100644 --- a/ipf/project.php +++ b/ipf/project.php @@ -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; } }