mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Patching Configure to bootstrap without an app
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4564 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
4e7538d333
commit
f4172f0de3
1 changed files with 7 additions and 5 deletions
|
@ -90,11 +90,11 @@ class Configure extends Object {
|
|||
* @return Configure instance
|
||||
* @access public
|
||||
*/
|
||||
function &getInstance() {
|
||||
function &getInstance($boot = true) {
|
||||
static $instance = array();
|
||||
if (!$instance) {
|
||||
$instance[0] =& new Configure;
|
||||
$instance[0]->__loadBootstrap();
|
||||
$instance[0]->__loadBootstrap($boot);
|
||||
}
|
||||
return $instance[0];
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ class Configure extends Object {
|
|||
*/
|
||||
function version() {
|
||||
$_this =& Configure::getInstance();
|
||||
if(!isset($_this->Cake['version'])){
|
||||
if(!isset($_this->Cake['version'])) {
|
||||
require(CORE_PATH . 'cake' . DS . 'config' . DS . 'config.php');
|
||||
$_this->write($config);
|
||||
}
|
||||
|
@ -425,7 +425,7 @@ class Configure extends Object {
|
|||
*
|
||||
* @access private
|
||||
*/
|
||||
function __loadBootstrap() {
|
||||
function __loadBootstrap($boot) {
|
||||
$_this =& Configure::getInstance();
|
||||
$modelPaths = null;
|
||||
$viewPaths = null;
|
||||
|
@ -433,7 +433,9 @@ class Configure extends Object {
|
|||
$helperPaths = null;
|
||||
$componentPaths = null;
|
||||
$behaviorPaths = null;
|
||||
require APP_PATH . 'config' . DS . 'bootstrap.php';
|
||||
if ($boot) {
|
||||
require APP_PATH . 'config' . DS . 'bootstrap.php';
|
||||
}
|
||||
$_this->__buildModelPaths($modelPaths);
|
||||
$_this->__buildViewPaths($viewPaths);
|
||||
$_this->__buildControllerPaths($controllerPaths);
|
||||
|
|
Loading…
Reference in a new issue