Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

change DataSource::listSources to Datasource::cachedListSources

  • Loading branch information...
commit 288b682b1ec32e391e8c2c6fe588e05283aad164 1 parent 606c30b
Clément Hallet authored
2  lib/Cake/Model/Datasource/DataSource.php
@@ -90,7 +90,7 @@ public function __construct($config = array()) {
90 90 * @param mixed $data
91 91 * @return array Array of sources available in this datasource.
92 92 */
93   - public function listSources($data = null) {
  93 + public function cachedListSources($data = null) {
94 94 if ($this->cacheSources === false) {
95 95 return null;
96 96 }
4 lib/Cake/Model/Datasource/Database/Mysql.php
@@ -184,7 +184,7 @@ public function enabled() {
184 184 * @return array Array of tablenames in the database
185 185 */
186 186 public function listSources($data = null) {
187   - $cache = parent::listSources();
  187 + $cache = $this->cachedListSources();
188 188 if ($cache != null) {
189 189 return $cache;
190 190 }
@@ -201,7 +201,7 @@ public function listSources($data = null) {
201 201 }
202 202
203 203 $result->closeCursor();
204   - parent::listSources($tables);
  204 + $this->cachedListSources($tables);
205 205 return $tables;
206 206 }
207 207 }
4 lib/Cake/Model/Datasource/Database/Postgres.php
@@ -156,7 +156,7 @@ public function enabled() {
156 156 * @return array Array of tablenames in the database
157 157 */
158 158 public function listSources($data = null) {
159   - $cache = parent::listSources();
  159 + $cache = $this->cachedListSources();
160 160
161 161 if ($cache != null) {
162 162 return $cache;
@@ -176,7 +176,7 @@ public function listSources($data = null) {
176 176 }
177 177
178 178 $result->closeCursor();
179   - parent::listSources($tables);
  179 + $this->cachedListSources($tables);
180 180 return $tables;
181 181 }
182 182 }
4 lib/Cake/Model/Datasource/Database/Sqlite.php
@@ -134,7 +134,7 @@ public function enabled() {
134 134 * @return array Array of tablenames in the database
135 135 */
136 136 public function listSources($data = null) {
137   - $cache = parent::listSources();
  137 + $cache = $this->cachedListSources();
138 138 if ($cache != null) {
139 139 return $cache;
140 140 }
@@ -148,7 +148,7 @@ public function listSources($data = null) {
148 148 foreach ($result as $table) {
149 149 $tables[] = $table[0]['name'];
150 150 }
151   - parent::listSources($tables);
  151 + $this->cachedListSources($tables);
152 152 return $tables;
153 153 }
154 154 return array();
4 lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -170,7 +170,7 @@ public function enabled() {
170 170 * @return array Array of tablenames in the database
171 171 */
172 172 public function listSources($data = null) {
173   - $cache = parent::listSources();
  173 + $cache = $this->cachedListSources();
174 174 if ($cache !== null) {
175 175 return $cache;
176 176 }
@@ -187,7 +187,7 @@ public function listSources($data = null) {
187 187 }
188 188
189 189 $result->closeCursor();
190   - parent::listSources($tables);
  190 + $this->cachedListSources($tables);
191 191 return $tables;
192 192 }
193 193 }
1  lib/Cake/Test/Case/Core/AppTest.php
@@ -346,6 +346,7 @@ public function testListObjectsIgnoreDotDirectories() {
346 346 App::build(array(
347 347 'plugins' => array($path)
348 348 ), App::RESET);
  349 + var_dump($path . '.svn');
349 350 mkdir($path . '.svn');
350 351 $result = App::objects('plugin', null, false);
351 352 rmdir($path . '.svn');

0 comments on commit 288b682

Please sign in to comment.
Something went wrong with that request. Please try again.