I'm starting to write a module, and found some PEAR libraries that would be useful so as to not have to rewrite the wheel, so to speak. I was wondering though if this was considered a no-no by the Gallery 3 developers, and if so, if they knew of any ways of extracting PEAR extensions from PEAR.
Thanks,
Tomek!
Posts: 7940
PEAR libraries are fine with me. You could just rely on having the libraries installed on the system, and in your module's installer you can check to see if they're available. Here's an example check:
http://github.com/gallery/gallery3-contrib/blob/master/modules/ldap/helpers/ldap_installer.php#L21-30
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git
Posts: 201
Thanks bharat,
Here's another question: Isn't PEAR installed by default on all PHP 5+ installations? If so, could I just copy the non-default libraries I need (there are essentially three files), and then modify them to use the modules library path, since all they need is to inherit the PEAR.php class? Would something like that be possible and perhaps more user friendly?
(Edit: way to mispell bharat's name... sheesh. Sorry!)
Posts: 23886
You won't believe how it sounds in real life.
It was quite humorous when he introduced himself at the Gallery convention in 2005.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 7940
You're pretty much free to do this any way that you'd like. My preference is to keep the code small and require the system to have PEAR installed, and have your module require reasonable versions. But you can also just ship the PEAR libs with your module -- that works too.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git