cakephp/cakephp — pull request #3495 by markstory (2014-05-14 15:41:07+00:00)
Title: 3.0 middleware events

This set of changes updates dispatcher filters. I explored the 'more robust' middleware implementation described in #2544 and decided it was a bad idea for a few reasons:

* The end result would be totally unlike everything else in CakePHP. The wrapping middleware approach while similar to other frameworks/tools would be totally unique in CakePHP.
* Event based middleware works well in symfony, and has worked well for us thus far.
* I couldn't come up with a use case that couldn't be implemented with the existing event based middleware.

So instead of throwing out the existing code, I've done a few incremental changes, mostly around making it easy for filters to only run on specific URL's or when specific conditions are met. I've also introduced what I think is a simpler/better way to manage filters with the `DispatcherFactory`.

I have a few todo's left, but I wanted to get some feedback on this before finishing everything.

## TODO

* [ ] Missing doc blocks and file headers.
* [ ] Clean up history.