From 8150b89aba4e31041eb41c2dc201ea981ebfdb84 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sun, 11 Aug 2013 22:55:20 +0530 Subject: [PATCH] Allow setting path constants in app/Console/cake.php as you can in webroot/index.php --- lib/Cake/Console/ShellDispatcher.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Console/ShellDispatcher.php b/lib/Cake/Console/ShellDispatcher.php index 16523f357..b64f0abd2 100644 --- a/lib/Cake/Console/ShellDispatcher.php +++ b/lib/Cake/Console/ShellDispatcher.php @@ -122,8 +122,10 @@ class ShellDispatcher { define('ROOT', $this->params['root']); define('APP_DIR', $this->params['app']); define('APP', $this->params['working'] . DS); - define('WWW_ROOT', APP . $this->params['webroot'] . DS); - if (!is_dir(ROOT . DS . APP_DIR . DS . 'tmp')) { + if (!defined('WWW_ROOT')) { + define('WWW_ROOT', APP . $this->params['webroot'] . DS); + } + if (!defined('TMP') && !is_dir(APP . 'tmp')) { define('TMP', CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'tmp' . DS); } $boot = file_exists(ROOT . DS . APP_DIR . DS . 'Config' . DS . 'bootstrap.php');