mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Creating optional boot variable that informs Configure if it should bootstrap the app. Changing how ShellDispatcher checks for app existence it sets the $boot var now and reuses the framework bootstrap file instead of a second custom one.
This commit is contained in:
parent
81e6ca2249
commit
034aaa7462
2 changed files with 4 additions and 26 deletions
|
@ -35,5 +35,5 @@ require LIBS . 'cache.php';
|
||||||
require LIBS . 'error_handler.php';
|
require LIBS . 'error_handler.php';
|
||||||
set_exception_handler(array('ErrorHandler', 'handleException'));
|
set_exception_handler(array('ErrorHandler', 'handleException'));
|
||||||
|
|
||||||
Configure::bootstrap();
|
Configure::bootstrap(isset($boot) ? $boot : true);
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,7 @@
|
||||||
* @since CakePHP(tm) v 1.2.0.5012
|
* @since CakePHP(tm) v 1.2.0.5012
|
||||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||||
*/
|
*/
|
||||||
if (!defined('E_DEPRECATED')) {
|
|
||||||
define('E_DEPRECATED', 8192);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Shell dispatcher
|
* Shell dispatcher
|
||||||
*
|
*
|
||||||
|
@ -172,7 +170,6 @@ class ShellDispatcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
require_once(CORE_PATH . 'cake' . DS . 'basics.php');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -258,27 +255,8 @@ class ShellDispatcher {
|
||||||
define('TMP', CORE_PATH . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'tmp' . DS);
|
define('TMP', CORE_PATH . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'tmp' . DS);
|
||||||
}
|
}
|
||||||
|
|
||||||
$includes = array(
|
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php');
|
||||||
CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php',
|
require CORE_PATH . 'cake' . DS . 'bootstrap.php';
|
||||||
CORE_PATH . 'cake' . DS . 'libs' . DS . 'exceptions.php',
|
|
||||||
CORE_PATH . 'cake' . DS . 'libs' . DS . 'object.php',
|
|
||||||
CORE_PATH . 'cake' . DS . 'libs' . DS . 'inflector.php',
|
|
||||||
CORE_PATH . 'cake' . DS . 'libs' . DS . 'configure.php',
|
|
||||||
CORE_PATH . 'cake' . DS . 'libs' . DS . 'file.php',
|
|
||||||
CORE_PATH . 'cake' . DS . 'libs' . DS . 'cache.php',
|
|
||||||
CORE_PATH . 'cake' . DS . 'libs' . DS . 'string.php',
|
|
||||||
CORE_PATH . 'cake' . DS . 'libs' . DS . 'class_registry.php',
|
|
||||||
CORE_PATH . 'cake' . DS . 'console' . DS . 'error.php'
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($includes as $inc) {
|
|
||||||
if (!require($inc)) {
|
|
||||||
$this->stderr("Failed to load Cake core file {$inc}");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Configure::bootstrap(file_exists(CONFIGS . 'bootstrap.php'));
|
|
||||||
|
|
||||||
if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) {
|
if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) {
|
||||||
include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
|
include_once CORE_PATH . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
|
||||||
|
|
Loading…
Reference in a new issue