开发者

When does CakePHP call the is_connect method in a data source?

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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜