updating DB_ACL and configure, fixes #3643 and fixes #3644

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6069 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-11-24 16:10:03 +00:00
parent be8acb877a
commit 1e6d7c971f
2 changed files with 15 additions and 12 deletions

View file

@ -588,14 +588,14 @@ class Configure extends Object {
$cache = Cache::settings();
if(empty($cache)) {
trigger_error('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', E_USER_WARNING);
Cache::config('default', array('engine' => 'File'));
$cache = Cache::settings();
list($engine, $cache) = Cache::config('default', array('engine' => 'File'));
}
$settings = array('prefix' => 'cake_core_', 'path' => CACHE . 'persistent' . DS);
if (Configure::read() > 1) {
$settings = array('prefix' => 'cake_core_', 'duration' => 10, 'path' => CACHE . 'persistent' . DS);
$cache['duration'] = 10;
}
Cache::config('_cake_core_' , array_merge($cache, $settings));
$settings = array('prefix' => 'cake_core_', 'path' => CACHE . 'persistent' . DS, 'serialize' => true);
$config = Cache::config('_cake_core_' , array_merge($cache, $settings));
}
}

View file

@ -125,15 +125,18 @@ class AclNode extends AppModel {
$ref = array('model' => $ref->alias, 'foreign_key' => $ref->id);
} elseif (is_array($ref) && !(isset($ref['model']) && isset($ref['foreign_key']))) {
$name = key($ref);
if (!ClassRegistry::isKeySet($name)) {
if (!App::import($name)) {
trigger_error("Model class '$name' not found in AclNode::node() when trying to bind {$this->alias} object", E_USER_WARNING);
return null;
}
$model =& ClassRegistry::init(array('class' => $name, 'alias' => $name));
if(PHP5) {
$model = ClassRegistry::init(array('class' => $name, 'alias' => $name));
} else {
$model =& ClassRegistry::getObject($name);
$model =& ClassRegistry::init(array('class' => $name, 'alias' => $name));
}
if (empty($model)) {
trigger_error("Model class '$name' not found in AclNode::node() when trying to bind {$this->alias} object", E_USER_WARNING);
return null;
}
$tmpRef = null;
if (method_exists($model, 'bindNode')) {
$tmpRef = $model->bindNode($ref);