Permalink
Browse files

change DataSource::listSources to Datasource::cachedListSources

  • Loading branch information...
1 parent 606c30b commit 288b682b1ec32e391e8c2c6fe588e05283aad164 Clément Hallet committed Nov 8, 2011
View
2 lib/Cake/Model/Datasource/DataSource.php
@@ -90,7 +90,7 @@ public function __construct($config = array()) {
* @param mixed $data
* @return array Array of sources available in this datasource.
*/
- public function listSources($data = null) {
+ public function cachedListSources($data = null) {
if ($this->cacheSources === false) {
return null;
}
View
4 lib/Cake/Model/Datasource/Database/Mysql.php
@@ -184,7 +184,7 @@ public function enabled() {
* @return array Array of tablenames in the database
*/
public function listSources($data = null) {
- $cache = parent::listSources();
+ $cache = $this->cachedListSources();
if ($cache != null) {
return $cache;
}
@@ -201,7 +201,7 @@ public function listSources($data = null) {
}
$result->closeCursor();
- parent::listSources($tables);
+ $this->cachedListSources($tables);
return $tables;
}
}
View
4 lib/Cake/Model/Datasource/Database/Postgres.php
@@ -156,7 +156,7 @@ public function enabled() {
* @return array Array of tablenames in the database
*/
public function listSources($data = null) {
- $cache = parent::listSources();
+ $cache = $this->cachedListSources();
if ($cache != null) {
return $cache;
@@ -176,7 +176,7 @@ public function listSources($data = null) {
}
$result->closeCursor();
- parent::listSources($tables);
+ $this->cachedListSources($tables);
return $tables;
}
}
View
4 lib/Cake/Model/Datasource/Database/Sqlite.php
@@ -134,7 +134,7 @@ public function enabled() {
* @return array Array of tablenames in the database
*/
public function listSources($data = null) {
- $cache = parent::listSources();
+ $cache = $this->cachedListSources();
if ($cache != null) {
return $cache;
}
@@ -148,7 +148,7 @@ public function listSources($data = null) {
foreach ($result as $table) {
$tables[] = $table[0]['name'];
}
- parent::listSources($tables);
+ $this->cachedListSources($tables);
return $tables;
}
return array();
View
4 lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -170,7 +170,7 @@ public function enabled() {
* @return array Array of tablenames in the database
*/
public function listSources($data = null) {
- $cache = parent::listSources();
+ $cache = $this->cachedListSources();
if ($cache !== null) {
return $cache;
}
@@ -187,7 +187,7 @@ public function listSources($data = null) {
}
$result->closeCursor();
- parent::listSources($tables);
+ $this->cachedListSources($tables);
return $tables;
}
}
View
1 lib/Cake/Test/Case/Core/AppTest.php
@@ -346,6 +346,7 @@ public function testListObjectsIgnoreDotDirectories() {
App::build(array(
'plugins' => array($path)
), App::RESET);
+ var_dump($path . '.svn');
mkdir($path . '.svn');
$result = App::objects('plugin', null, false);
rmdir($path . '.svn');

0 comments on commit 288b682

Please sign in to comment.