diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index dc42472d0..76312ed7b 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -208,7 +208,7 @@ class Shell extends Object { 'model'.DS.'datasources'.DS.'dbo_source', 'model'.DS.'model' ); - if ($this->uses === true && loadModel()) { + if ($this->uses === true && App::import('Model', 'AppModel')) { $this->AppModel = & new AppModel(false, false, false); return true; } @@ -221,7 +221,7 @@ class Shell extends Object { $modelKey = Inflector::underscore($modelClass); if (!class_exists($modelClass)) { - loadModel($modelClass); + App::import('Model', $modelClass); } if (class_exists($modelClass)) { $model =& new $modelClass(); diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 0f7677d70..cb1804015 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -238,7 +238,7 @@ class ControllerTask extends Shell { */ function __bakeActions($controllerName, $admin = null, $wannaUseSession = true) { $currentModelName = $this->_modelName($controllerName); - if (!loadModel($currentModelName)) { + if (!App::import('Model', $currentModelName)) { $this->err('You must have a model for this class to build scaffold methods. Please try again.'); exit; } diff --git a/cake/console/libs/tasks/model.php b/cake/console/libs/tasks/model.php index fb635bd10..0e94fb578 100644 --- a/cake/console/libs/tasks/model.php +++ b/cake/console/libs/tasks/model.php @@ -95,7 +95,7 @@ class ModelTask extends Shell { $wannaDoValidation = $this->in('Would you like to supply validation criteria for the fields in your model?', array('y','n'), 'y'); if (in_array($useTable, $this->__tables)) { - loadModel(); + App::import('Model'); $tempModel = new Model(false, $useTable); $modelFields = $db->describe($tempModel); @@ -576,7 +576,7 @@ class ModelTask extends Shell { */ function __bakeTest($className) { $out = 'TestObject = new {$className}();\n";