Minor optimizations

Closes #5249 and #5282

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7664 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mark_story 2008-09-26 00:46:53 +00:00
parent c416b5d241
commit 370b20dce6
2 changed files with 2 additions and 3 deletions

View file

@ -627,14 +627,13 @@ class Configure extends Object {
trigger_error('Cache not configured properly. Please check Cache::config(); in APP/config/core.php', E_USER_WARNING);
$cache = Cache::config('default', array('engine' => 'File'));
}
$path = $prefix = null;
$path = $prefix = $duration = null;
if (!empty($cache['settings']['path'])) {
$path = realpath($cache['settings']['path']);
} else {
$prefix = $cache['settings']['prefix'];
}
$duration = $cache['settings']['duration'];
if (Configure::read() >= 1) {
$duration = '+10 seconds';

View file

@ -2133,7 +2133,7 @@ class Model extends Overloadable {
if (!empty($this->id)) {
$fields[$this->alias . '.' . $this->primaryKey . ' !='] = $this->id;
}
return ($this->find('count', array('conditions' => $fields)) == 0);
return ($this->find('count', array('conditions' => $fields, 'recursive' => -1)) == 0);
}
/**
* Returns a resultset for given SQL statement. Generic SQL queries should be made with this method.