codeguy/Slim — pull request #761 by davestewart (2014-02-20 19:09:19+00:00)
Title: Improved functionality and performance when adding class:method routes

The current routing setup, in order to check for is_callable(), instantiates and caches class instances when adding class:method routes. This has the negative side-effect of firing class (controller) constructors each and every time a route is added, as well as caching redundant instances.

@see http://help.slimframework.com/discussions/problems/6304-slims-classmethod-routing-syntax-instantiates-a-new-class-for-each-and-every-route-added

This PR checks for callable methods using reflection, and only instantiates a class instance on the first getCallable() call, usually from dispatch();