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:
Mark Story 2010-09-02 17:16:57 -04:00
parent 81e6ca2249
commit 034aaa7462
2 changed files with 4 additions and 26 deletions

View file

@ -35,5 +35,5 @@ require LIBS . 'cache.php';
require LIBS . 'error_handler.php';
set_exception_handler(array('ErrorHandler', 'handleException'));
Configure::bootstrap();
Configure::bootstrap(isset($boot) ? $boot : true);

View file

@ -20,9 +20,7 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
if (!defined('E_DEPRECATED')) {
define('E_DEPRECATED', 8192);
}
/**
* 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);
}
$includes = array(
CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.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'));
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php');
require CORE_PATH . 'cake' . DS . 'bootstrap.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';