[dev] Horde_Imap_Client and Horde_Pack

Jan Schneider jan at horde.org
Wed Mar 12 07:46:08 UTC 2014


Zitat von Michael M Slusarz <slusarz at horde.org>:

> Quoting Jan Schneider <jan at horde.org>:
>
>> Zitat von Remi Collet <remi at fedoraproject.org>:
>>
>>> Hi,
>>>
>>> According to packahe.xml, Horde_Imap_Client have an optional dependency
>>> on Horde_Pack.
>>>
>>> But test suite fails without Horde_Pack:
>>>
>>> PHP Fatal error:  Class 'Horde_Pack' not found in ...
>>>
>>>
>>> Shouldn't those tests be skiped when Horde_Pack not available ?
>>>
>>>
>>> Remi.
>>>
>>> P.S. really a minor minor issue.
>>
>> We have other optional dependencies that are required for running  
>> unit test, most important Horde_Test. Even if not written down,  
>> this can be considered our policy, especially since unit tests are  
>> mostly for developers' purposes.
>
> I'm wondering if Horde_Pack should not be listed as "required"  
> (Horde_Hashtable as well).
>
> Not sure if we are considering "optional" to be:
>
> + Used if available, but code still runs without it

That's definitely an optional dependency.

> + A non-required optional component uses it (but is required for  
> that component).

We do this in many places, like requiring Horde_Db or Horde_Ldap  
optionally for libraries that have several backends. This is of course  
a bit dangerous because code may fatally fail if using such a feature  
without meeting the dep.

> Horde_Hashtable/Horde_Pack falls into the latter, rather than the  
> former.  Thinking it probably makes more sense to err on the side of  
> caution and install more packages rather than less.

I'm really torn on this one. Making those optional may lead to fatal  
errors. OTOH we want our libraries to be used individually by 3rd  
party developers. Pulling in a phalanx of dependencies is not well  
received in such cases.
We may be more careful by catching unfulfilled dependencies in the  
code and raising useful error messages, but this only so much  
possible. Think of type hints.
-- 
Jan Schneider
The Horde Project
http://www.horde.org/
https://www.facebook.com/hordeproject



More information about the dev mailing list