[dev] Fwd: include vs include_once in Horde_Autoloader

Michael Rubinsky mrubinsk at horde.org
Tue Aug 4 21:23:12 UTC 2009


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

> Quoting Michael Rubinsky <mrubinsk at horde.org>:
>
>> Quoting Chuck Hagenbuch <chuck at horde.org>:
>>
>>> Anything being the same? Or when our classes aren't properly  
>>> namespaced yet? If the latter, we should just fix our classes. If  
>>> the former, well that sucks.
>>
>> It sucks.
>>
>> The specific issue is with classes located in the root of the lib/  
>> directory. i.e. Kronolith_Day is defined in the file  
>> kronolith/lib/Day.php. If kronolith was at any time pushed on the  
>> stack during the current request, then kronolith/lib is present in  
>> the include_path. The result of this is that something like:
>> <code>
>> if (class_exists('Day')) {
>> ...
>> }
>> </code>
>>
>> in an external library will result in kronolith/lib/Day.php being included.
>
> That should be simple enough to fix.  We should change this in Registry.php:
>
> Horde_Autoloader::addClassPath($app_lib);
> Horde_Autoloader::addClassPattern('/^' . $app . '_/i', $app_lib);
>
> to this:
>
> Horde_Autoloader::addClassPattern('/^' . $app . '[$_]/i', $app_lib);

This results in the application's base class not being loadable. i.e.  
Kronolith::



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