cakephp/cakephp — pull request #1517 by markstory (2013-08-14 03:06:57+00:00)
Title: 3.0 - Use registry objects in Cache & Log and remove Configure based configuration.

With the new registry objects complete, I thought Log and Cache could benefit from re-using this logic as well. LogEngineCollection uses ObjectCollection presently and inherits a pile of useless behavior. Converting this to a Registry saves some complexity and allows the removal of some seldom used features in Log.

I've also been thinking quite a bit about the changes I did to 'unify configuration' and I think they are a bad idea, and am proposing they be replaced with the code here. Not using Configure to setup caching has a couple benefits.

* Using Configure creates magic at a distance. Setting things in one class creates effects in another. This is the biggest problem.
* Cache engines are always configured the same way. Currently Log adapters have to be configured differently depending on when your code is executed. This is a big smell to me and indicates the whole idea is flawed. Either we shouldn't allow runtime configuration changes or we do. Having 2 separate ways to do things is silly.
* Dropped cache engines won't magically re-create themselves. This is pretty non-obvious and feels wrong to me.
* It is still simple to create cache adapters using configuration files, or inject instances directly.

I feel the new code is simpler, and has no drawbacks when compared to the old Configure based code.