Contao incompatible with PEAR
I've just tried to use Contao with a PEAR class for XLS Writing (Which is LGPL and a requirement for the module I'm writing).
However PEAR has a class System, as does Contao.
Since it's not possible for either project to rename classes, it looks like namespaces will have to be the way forward. Any other ideas or suggestions for namespaces?
Regards
Re: Contao incompatible with PEAR
Hi,
Did you tried with PEAR's Spreadsheet_Excel_Writer?
What code did you tried?
Simply require PEAR.php dosen't defined class "System" as I tried:
Code:
<?php
require_once 'PEAR.php';
var_dump(class_exists('System'));
It outputs:
I recently realized with I18n_UnicodeNormalizer. In my case, I18n_UnicodeNormalizer badly tried to get data directory with calling a function of PEAR/Config.php. But I with my understanding, such PEAR/Config.php should be used with PEAR's command (really I'm not sure).
What is your case?
Best regards.
Re: Contao incompatible with PEAR
It's not the PEAR class itself that's the problem but the class 'System' within PEAR that other things will call upon.
Including PEAR.php is no problem, it's when other PEAR modules include System.
Re: Contao incompatible with PEAR
I don't know the detail of PEAR well, I don't beleive basic libraries (such as PEAR) use simple name "System". So I guess that it is for PEAR's commands itself only and if a package of PEAR use System would be a bug or wrong coded PEAR package.
Isn't it correct?
Re: Contao incompatible with PEAR
I found by myself.
http://pear.php.net/manual/en/core.pear.system.php:
Quote:
System provides an API for cross platform compatible commandline programs.
So, no command line programs should not use System and never load it?
Re: Contao incompatible with PEAR
It looks like it's the OLE package within PEAR that's calling on System:
http://pear.php.net/package/OLE/
The two files in OLE/PPS/Root.php /OLE/PPS/File.php just call a static method in System for the temporary directory name.
Are we to assume that the PEAR developer for OLE has incorrectly used System?
Re: Contao incompatible with PEAR
Quote:
Originally Posted by pbrooks
It looks like it's the OLE package within PEAR that's calling on System:
http://pear.php.net/package/OLE/
The two files in OLE/PPS/Root.php /OLE/PPS/File.php just call a static method in System for the temporary directory name.?
Where is the exact lines?
Re: Contao incompatible with PEAR
Oops, I found it. (I saw older version of OLE).
Hmmmm, I don't know the right answer as PEAR, the answer should be got from PEAR professional...