[Solar-talk] __autoload()
Rodrigo Moraes
rodrigo.moraes at gmail.com
Tue Jul 11 19:09:33 PDT 2006
As said in the Solar docs, one advantage to use a Pear-like naming
convention for classes is the handy loadClass() method. Even better is
to have it inside the function __autoload(), because it becomes
unnecessary to include *any* class file, ever. However, Solar makes
__autoload() impossible, at least using it with Solar::loadClass()
inside.
The problem resides in both Solar::loadClass() and Solar::run(), which
throw exceptions if the class is not loaded or the file is not found.
Without the exceptions, __autoload() would work fine. But perhaps
there is already another workaround to use __autoload() and get the
classes included magically? I don't mean to make Solar use
__autoload(), but instead to avoid to make its use impossible. This
would be an improvement, wouldn't it? I think __autoload() +
loadClass() is so useful, but perhaps there is a good reason to not
use it at all.
thanks,
rodrigo moraes / brazil
PS: I'm more and more amazed with Solar. ;)
More information about the solar-talk
mailing list