[cvs] commit: framework/Imap_Client/lib/Horde/Imap Client.php

Chuck Hagenbuch chuck at horde.org
Wed Oct 29 04:01:54 UTC 2008


Quoting Michael M Slusarz <slusarz at horde.org>:

> Again, though, what is the alternative if Horde_Imap_Client is meant  
> to be used completely separate of Horde (I've already had several  
> inquiries for using the client lib without using any of the optional  
> Horde libs)?  And using this autoload stuff breaks the previous  
> behavior for some of these require/includes, which is if the library  
> is not available disable that feature (I'm guessing autoload wasn't  
> really designed for this purpose).  Now if the library is not  
> available, the entire script dies, which isn't very helpful.

if (class_exists('Auth_SASL')) ...

etc. This will trigger autoload but not fail if autoload fails.

If you want others to have to do _no_ work to use the library, you can  
create a bootstrap.php (or whatever name sounds good) that includes  
all of the files in the library and checks for external dependencies.  
Then people can just include that (kind of like __init__.py files)  
files. I briefly considered this for all Horde 4 lib, and decided that  
it was pretty hokey and hard to maintain. But you could do it  
separately for this if you really want.

> That is why, playing with autoload stuff today, I've come to the  
> realization it is kind of worthless.  It causes just as many  
> problems as it fixes.

I disagree on this pretty strongly. I can get into it more at some  
point but right now I'm too tired to make a good argument, so I won't  
fake it. :)

-chuck


More information about the cvs mailing list