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(); } }