mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-05 11:02:40 +00:00
Conditionally define constants in the CLI environment.
Only define constants if they don't already exist. Users can modify `app/Console/cake.php` and define constants before this code executes. Fixes #4000
This commit is contained in:
parent
675f828e16
commit
f7a81a9aee
1 changed files with 9 additions and 3 deletions
|
@ -119,9 +119,15 @@ class ShellDispatcher {
|
|||
* @return boolean Success.
|
||||
*/
|
||||
protected function _bootstrap() {
|
||||
define('ROOT', $this->params['root']);
|
||||
define('APP_DIR', $this->params['app']);
|
||||
define('APP', $this->params['working'] . DS);
|
||||
if (!defined('ROOT')) {
|
||||
define('ROOT', $this->params['root']);
|
||||
}
|
||||
if (!defined('APP_DIR')) {
|
||||
define('APP_DIR', $this->params['app']);
|
||||
}
|
||||
if (!defined('APP')) {
|
||||
define('APP', $this->params['working'] . DS);
|
||||
}
|
||||
if (!defined('WWW_ROOT')) {
|
||||
define('WWW_ROOT', APP . $this->params['webroot'] . DS);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue