Re:PHP Tips and Tricks - Codular
by jasonlotito on Sunday July 29, 2012 @08:38PM
(#4310359)
See __DIR__ if >= 5.3
[ Parent
| on HN ]
Re:PHP Tips and Tricks - Codular
by ChiperSoft on Sunday July 29, 2012 @08:50PM
(#4310381)
Which, since he's using an anonymous function, he would be.
Re:PHP Tips and Tricks - Codular
by nodesocket on Sunday July 29, 2012 @09:03PM
(#4310406)
Indeed, slightly cleaner I suppose:
spl_autoload_register(function($class_name) {
require(dirname(__DIR__) . "/classes/" . $class_name . ".php");
});