From 370b20dce6ff8d26fb739c6c191a9e5f71507866 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 26 Sep 2008 00:46:53 +0000 Subject: [PATCH] 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 --- cake/libs/configure.php | 3 +-- cake/libs/model/model.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index f74258205..c70f97a4d 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -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'; diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index 50963123b..125667c9e 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -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.