From 7cbfb5d40d132b4a86b5088c49d0d770c4435aa8 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 5 Sep 2012 17:29:34 -0400 Subject: [PATCH] allow Airtime environment to be accessed from CLI --- airtime_mvc/public/index.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/public/index.php b/airtime_mvc/public/index.php index e496f133c..2827b3835 100644 --- a/airtime_mvc/public/index.php +++ b/airtime_mvc/public/index.php @@ -27,7 +27,7 @@ set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_pat set_include_path(APPLICATION_PATH . '/controllers/plugins' . PATH_SEPARATOR . get_include_path()); //Zend framework -if (file_exists('/usr/share/php/libzend-framework-php')){ +if (file_exists('/usr/share/php/libzend-framework-php')) { set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path()); } @@ -39,5 +39,13 @@ $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' ); -$application->bootstrap() + +if (substr($sapi_type, 0, 3) == 'cli') { + set_include_path(APPLICATION_PATH . PATH_SEPARATOR . get_include_path()); + require_once("Bootstrap.php"); +} else { + $application->bootstrap() ->run(); +} + +