From 7b51feb89c19b2271ddbf54156e8cd7f29ba2bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez=20Urdaneta?= Date: Wed, 7 Jul 2010 22:58:48 -0430 Subject: [PATCH] Fixing constant declaration as it was not consistent in web runner and cli runner --- cake/console/cake.php | 8 +++++++- cake/tests/cases/console/libs/api.test.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cake/console/cake.php b/cake/console/cake.php index 9324f7ffd..db62dc9f1 100644 --- a/cake/console/cake.php +++ b/cake/console/cake.php @@ -155,9 +155,15 @@ class ShellDispatcher { if (!defined('CAKE_CORE_INCLUDE_PATH')) { define('DS', DIRECTORY_SEPARATOR); define('CAKE_CORE_INCLUDE_PATH', dirname(dirname(dirname(__FILE__)))); - define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); define('DISABLE_DEFAULT_ERROR_HANDLING', false); define('CAKEPHP_SHELL', true); + if (!defined('CORE_PATH')) { + if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'))) { + define('CORE_PATH', null); + } else { + define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); + } + } } require_once(CORE_PATH . 'cake' . DS . 'basics.php'); } diff --git a/cake/tests/cases/console/libs/api.test.php b/cake/tests/cases/console/libs/api.test.php index fe4f896e0..aeea6c737 100644 --- a/cake/tests/cases/console/libs/api.test.php +++ b/cake/tests/cases/console/libs/api.test.php @@ -103,7 +103,7 @@ class ApiShellTest extends CakeTestCase { $this->Shell->expects($this->at(2))->method('out')->with($expected); $this->Shell->args = array('controller'); - $this->Shell->paths['controller'] = LIBS . 'controller' . DS; + $this->Shell->paths['controller'] = CAKE_CORE_INCLUDE_PATH . DS . LIBS . 'controller' . DS; $this->Shell->main(); } }