[horde] How to move forward with foreign code in wicked? (Text_Wiki, Text_Figlet)
Ralf Lang
ralf.lang at ralf-lang.de
Thu May 15 15:05:44 UTC 2025
Hello,
recently T. Dannhauer approached me with a loading issue regarding the
Text_Wiki components in Horde's wicked application.
Turns out we have three different problems
- File in two places: The class loader finds the same class twice in
/vendor/ and in /web/ because of the symlinking we do. This can be
solved by not including /web/ in the class loader and further be solved
by upgrading the way we deliver the /web/ dir. I am still working on
this but we will move away from symlinking whole apps into the web
readable folder and instead create stubs which forward requests to the
actual code in /vendor dir. More on this when it's ready and tested.
- Repeated class names across different text_wiki styles. This is
something we need to address and which really does not look like horde
heritage.
Warning: Ambiguous class resolution, "Text_Wiki_Parse_Wikilink2" was
found 5x: in
"/var/www/horde-dev/vendor/horde/wicked/lib/Text_Wiki/Text/Wiki/Parse/Creole/Wikilink2.php"
and
"/var/www/horde-dev/vendor/horde/wicked/lib/Text_Wiki/Text/Wiki/Parse/Tiki/Wikilink2.php",
"/var/www/horde-dev/vendor/horde/wicked/lib/Text_Wiki/Text/Wiki/Parse/Mediawiki/Wikilink2.php",
"/var/www/horde-dev/vendor/horde/wicked/lib/Text_Wiki/Text/Wiki/Parse/Cowiki/Wikilink2.php",
"/var/www/horde-dev/vendor/horde/wicked/lib/Text_Wiki/Text/Wiki/Parse/Default/Wikilink2.php",
the first will be used.
- Internalized library code: Text_Wiki, Text_Wiki_* exist as separate
composer packages pear/text_wiki, pear/text_wiki_* but we also have them
in our application's code base. I personally would much prefer moving
them out and either consuming them from upstream or give them a facelift
as a separate package. We have the same issue with text_figlet. I am not
sure how responsive upstream is and if they actually would appreciate a
namespaced, php8.4 ready implementation. In the best case scenario we
can reduce technical debt.
We have a slightly similar issue with Text_Figlet: pear/Text_Figlet
exists in github but not on packagist. Multiple clones of
pear/text_figlet exist, often missing attribution to the original author
(which I think is not only an unnecessary legal risk but also bad
style). I really don't feel like we should adopt any random dependency
into our own code base.
Does anybody have a favorite battle tested figlet library which we can
just consume instead?
More information about the horde
mailing list