Adding new methods to Configure class that is used to created a cached version of config files.

Adding Configure::store() method call to bootstrap.php to create a cached file for class paths.
Adding Configure::read() to load class paths into Configure instance.
Adding check in loadModel() to get the class path from Configure::read('Models'); if set, if values are not set, the correct file is found and added to the cache file for faster loading.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4274 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-01-09 22:32:48 +00:00
parent 246028e89f
commit e64de54a51
3 changed files with 69 additions and 5 deletions

View file

@ -154,10 +154,19 @@
if (!is_null($name) && !class_exists($name)) {
$className = $name;
$name = Inflector::underscore($name);
$paths = Configure::getInstance();
$models = Configure::read('Models');
if(is_array($models)) {
if(array_key_exists($className, $models)) {
require($models[$className]['path'] . $name . '.php');
Overloadable::overload($className);
return true;
}
}
$paths = Configure::getInstance();
foreach($paths->modelPaths as $path) {
if (file_exists($path . $name . '.php')) {
Configure::store('Models', 'class.paths', array($className => array('path' => $path)));
require($path . $name . '.php');
Overloadable::overload($className);
return true;