I'm trying to develop an application that does not use a database, but that still has some models.
First problem: Cake look however for the configuration of the database (APP/Lib/Cake/Model/ConnectionManager.php, line 69), it tries to include the file Config/database.php.
If the file doesn't exist, I get 2 warnings. If it exists (even if it is completely empty) all ok. I want to clarify that this takes place even in the absence of models.
Second problem: if I try to use a model, I get the error:
Missing Datasource Configuration
Error: The datasource configuration default was not found in database.php.
This happens whether the Config/database.php file exists, whether the file is not present.
Finally, I specify that models (including the AppModel) have the property $useTable set to false, but it seems that it makes no difference.
But I have noticed that everything works correctly when in an application that uses a database there are only a few models that do not use it (but the app as a whole uses it).
I found this which proposes a solution, which then is the solution that is found on the web.
But below, in the comments, I read that Lorenzo says:
This does not make any sense at all, CakePHP 2.0 will not try to perform any datbase connection unless you request it to do so
It seems to me that it has not, maybe CakePHP does not perform any query but still want a database is configured. Is that so? Or I missed something?
Thank you.
public $useTable => false
there. – mark