PHP multiple __autoload functions *without* the use of spl_register_autoload?

Posted by Keith Palmer on Stack Overflow See other posts from Stack Overflow or by Keith Palmer
Published on 2010-03-18T14:42:30Z Indexed on 2010/03/19 14:51 UTC
Read the original article Hit count: 186

Filed under:
|

I'm an author of a growing library of PHP + QuickBooks related code. I'd like to utilize PHPs __autoload() function, however my code is a library that other people can include() into their own applications, so I can't rely on __autoload() being not already defined.

Is there a way to have multiple __autoload() functions?

I saw spl_autoload_register() in the PHP manual, but not all of my users have the SPL extension installed, so I can't rely on that. If there was a way to fall-back to using this and use normal require/include statements by default, I might consider that.

Does anyone else have any other clever solutions to this issue? It seems like a glaring oversight to only be able to have a single __autoload() function...

© Stack Overflow or respective owner

Related posts about php

Related posts about autoload