From 11288a38099dab6ca1f2129227ad3bf301f1c21a Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sun, 15 Jul 2012 21:55:55 +0300 Subject: [PATCH] php 5.4 cli-server --- index.php | 2 +- ipf/project.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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; } } -- 2.49.0