I notice many CakePHP data source authors create th开发者_运维百科e method to always return true. Is this so that you can ask the data source if it is connected ( like in a MySQL or Oracle db) or does the CakePHP data source itself call that function at some point?
there is a connected property in DBO_* but no methods like is_connected. you can also find a connect() method in the DBO files.
The connect will be called when the model is called as that will call the datasource. The reason most datasources will just return true is that they do not connect to anything. If might just be a file (csv datasource etc)
精彩评论