Results 1 to 8 of 8

Thread: Contao incompatible with PEAR

  1. #1
    User
    Join Date
    08-07-09.
    Location
    Kent, United Kingdom
    Posts
    92

    Default 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

  2. #2
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default 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:
    Code:
    bool(false)
    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.
    --
    Takahiro Kambe

  3. #3
    User
    Join Date
    08-07-09.
    Location
    Kent, United Kingdom
    Posts
    92

    Default 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.

  4. #4
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default 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?
    --
    Takahiro Kambe

  5. #5
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: Contao incompatible with PEAR

    I found by myself.

    http://pear.php.net/manual/en/core.pear.system.php:
    System provides an API for cross platform compatible commandline programs.
    So, no command line programs should not use System and never load it?
    --
    Takahiro Kambe

  6. #6
    User
    Join Date
    08-07-09.
    Location
    Kent, United Kingdom
    Posts
    92

    Default 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?

  7. #7
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default 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?
    --
    Takahiro Kambe

  8. #8
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default 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...
    --
    Takahiro Kambe

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •