diff --git a/cake/console/libs/bake.php b/cake/console/libs/bake.php index af35877b6..bc15e6360 100644 --- a/cake/console/libs/bake.php +++ b/cake/console/libs/bake.php @@ -157,7 +157,7 @@ class BakeShell extends Shell { $object = new $model(); $modelExists = true; } else { - App::import('Model'); + App::import('Model', 'Model', false); $object = new Model(array('name' => $name, 'ds' => $this->connection)); } diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 033c2a01c..60d959721 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -27,7 +27,7 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ App::import('File'); -App::import('Model', 'CakeSchema'); +App::import('Model', 'CakeSchema', false); /** * Schema is a command-line database management utility for automating programmer chores. diff --git a/cake/console/libs/tasks/fixture.php b/cake/console/libs/tasks/fixture.php index eca3b9da6..58a5455d0 100644 --- a/cake/console/libs/tasks/fixture.php +++ b/cake/console/libs/tasks/fixture.php @@ -74,7 +74,7 @@ class FixtureTask extends Shell { parent::__construct($dispatch); $this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS; if (!class_exists('CakeSchema')) { - App::import('Model', 'CakeSchema'); + App::import('Model', 'CakeSchema', false); } } @@ -384,7 +384,7 @@ class FixtureTask extends Shell { while (!$condition) { $condition = $this->in($prompt, null, 'WHERE 1=1 LIMIT 10'); } - App::import('Core', 'Model'); + App::import('Model', 'Model', false); $modelObject =& new Model(array('name' => $modelName, 'table' => $useTable, 'ds' => $this->connection)); $records = $modelObject->find('all', array( 'conditions' => $condition, diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index 8d3840158..f9d7937b2 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -20,7 +20,7 @@ * @since CakePHP(tm) v 1.2 * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -App::import('Model', 'ConnectionManager'); +App::import('Model', 'Model', false); /** * Task class for creating and updating model files. @@ -82,7 +82,6 @@ class ModelTask extends Shell { * @return void **/ function startup() { - App::import('Core', 'Model'); parent::startup(); } diff --git a/cake/console/libs/tasks/view.php b/cake/console/libs/tasks/view.php index 515d0e7a8..18e86b995 100644 --- a/cake/console/libs/tasks/view.php +++ b/cake/console/libs/tasks/view.php @@ -20,7 +20,7 @@ * @since CakePHP(tm) v 1.2 * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -App::import('Core', 'Controller'); +App::import('Controller', 'Controller', false); /** * Task class for creating and updating view files. diff --git a/cake/console/libs/templates/skel/app_helper.php b/cake/console/libs/templates/skel/app_helper.php index 05b94944d..66762cb58 100644 --- a/cake/console/libs/templates/skel/app_helper.php +++ b/cake/console/libs/templates/skel/app_helper.php @@ -26,7 +26,7 @@ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ -App::import('Core', 'Helper'); +App::import('Helper', 'Helper', false); /** * This is a placeholder class. diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 838151861..1d1dca562 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -226,7 +226,7 @@ class Dispatcher extends Object { if (!isset($methods[strtolower($params['action'])])) { if ($controller->scaffold !== false) { - App::import('Core', 'Scaffold'); + App::import('Controller', 'Scaffold', false); return new Scaffold($controller, $params); } return $this->cakeError('missingAction', array(array( diff --git a/cake/libs/configure.php b/cake/libs/configure.php index ccf6e4a48..37d5ceea2 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -844,7 +844,7 @@ class App extends Object { } } - if (!App::import($tempType, $plugin . $class)) { + if (!App::import($tempType, $plugin . $class, $parent)) { return false; } } @@ -866,7 +866,7 @@ class App extends Object { if ($name != null && !class_exists($name . $ext['class'])) { if ($load = $_this->__mapped($name . $ext['class'], $type, $plugin)) { if ($_this->__load($load)) { - $_this->__overload($type, $name . $ext['class']); + $_this->__overload($type, $name . $ext['class'], $parent); if ($_this->return) { $value = include $load; @@ -908,7 +908,7 @@ class App extends Object { if ($directory !== null) { $_this->__cache = true; $_this->__map($directory . $file, $name . $ext['class'], $type, $plugin); - $_this->__overload($type, $name . $ext['class']); + $_this->__overload($type, $name . $ext['class'], $parent); if ($_this->return) { $value = include $directory . $file; @@ -1058,8 +1058,8 @@ class App extends Object { * @param string $name Class name to overload * @access private */ - function __overload($type, $name) { - if (($type === 'Model' || $type === 'Helper') && strtolower($name) != 'schema') { + function __overload($type, $name, $parent) { + if (($type === 'Model' || $type === 'Helper') && $parent !== false) { Overloadable::overload($name); } } @@ -1088,10 +1088,10 @@ class App extends Object { switch ($load) { case 'model': if (!class_exists('Model')) { - App::import('Model', 'Model', false, App::core('models')); + require LIBS . 'model' . DS . 'model.php'; } if (!class_exists('AppModel')) { - App::import($type, 'AppModel', false, App::path('models')); + App::import($type, 'AppModel', false); } if ($plugin) { if (!class_exists($plugin . 'AppModel')) {