cakephp/cakephp — pull request #309 by challet (2011-11-08 11:44:38+00:00)
Title: change DataSource::listSources to Datasource::cachedListSources

I made this changes to avoid design errors when using a custom Datadsource (in my case forCouchDB) which doesn't have and doesn't need sources neither a schema :

When the *Model::setSource* method is called there is a test :
```php
if (method_exists($db, 'listSources')) {
$sources = $db->listSources();
// check that $tableName is a source
// reset the $this->_schema
}
```

In my case the *CouchdbDatasource* shouldn't have this **listSources** method, but it actually has it through the *Datasource* inheritence.

By looking at it, I saw its purpose is to cache results from "child calls", but it can't be used as replacement.
This is why I think inheritence is not the best choice here, and I renamed it.
Calls from Core Datasource have also been changed accordingly.
Unfortunately I'm aware it might affect other custom Datasources. So maybe it should go to a major release (?)

**Note :** The main reason to not implement *CouchdbDatasource::listSources* is because the previous *Model::setSource* reset the *Model::_schema* to null when *listSources* exists.
Which I don't want since CouchDb doesn't have any internal schema.
In order to stick to the Model mechanism (especially at save), the $_schema is defined into each specific model definition.