[dev] Fwd: include vs include_once in Horde_Autoloader

Michael Rubinsky mrubinsk at horde.org
Tue Aug 4 21:43:42 UTC 2009


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

> Quoting Michael Rubinsky <mrubinsk at horde.org>:
>
>>> Horde_Autoloader::addClassPattern('/^' . $app . '[$_]/i', $app_lib);
>>
>> This results in the application's base class not being loadable.  
>> i.e. Kronolith::
>
> Why not?  Oh, square brackets only match characters, not special  
> pattern.  D'oh.  This should be correct:
>
> Horde_Autoloader::addClassPattern('/^' . $app . '(?:$|_)/i', $app_lib);
>
> Sure enough, it works:
>
> preg_match('/^kronolith(?:$|_)/i', 'Kronolith_Test', $matches);
> print_r($matches);
> Array
> (
>     [0] => Kronolith_
> )
>
>
> preg_match('/^kronolith(?:$|_)/i', 'Kronolith', $matches);
> print_r($matches);
> Array
> (
>     [0] => Kronolith
> )

Nope. Still broken. The issue is that kronolith/lib is never put on  
the include path if the addClassPath() call is removed. If it's left  
in, then the original problem still exists.


Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org

"Time just hates me. That's why it made me an adult." - Josh Joplin


More information about the dev mailing list