The perfect service locator for PHP5 using __autoload?

Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.

Popular code excerpts may be moved to "Code Snippets" by the moderators.

Moderator: General Moderators

User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

This is freaking sweet... wow! Thanks a lot d11... this cleaned up a lot of messy code for me. Awesome idea!

BTW... I just got to use it for the first time on a new project so that's why I am revisiting this thread.
nameless1
Forum Newbie
Posts: 15
Joined: Sun Nov 05, 2006 1:14 pm

Post by nameless1 »

for those that dont know spl_autoload functions (multiple) allow you to change the __autoload function or create multiple autoload functions just thought this was worth noting it always annoyed me having to do

function __autoload($class_name) {

}

now i can name the function whatever i want and put it in whatever class i feel like.
Post Reply