Re: [PEPr] +1 for File Formats::File_CAB
| From: | David Sanders | Date: | Thu, 07 Feb 2008 05:34:13 +0000 |
| Subject: | Re: [PEPr] +1 for File Formats::File_CAB | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-49102@lists.php.net to get a copy of this message | ||
David Jean Louis wrote:
True, maybe @bin_dir@ is not the right solution, I was just pointing that cabextract was not necessary installed in /usr/bin, and that your package should handle this better, atm there's *no* way to override the hardcoded path.File_CAB::$command = '/usr/local/bin/cabextract'; $cab = new File_CAB; ... On my laptop it's under /opt/local/bin... /usr/bin is the just the first trusted directory to look in.
Oh btw, I installed the pkg (http://www.assessments.com.au/pear/File_CAB/File_CAB-0.1.0.tgz) and did a simple test: <?php require_once 'File/CAB.php'; $cab = new File_CAB('tmp.cab'); $cab->listFiles(); ?> $ php test.php PHP Notice: Use of undefined constant OS_WINDOWS - assumed 'OS_WINDOWS' in /usr/local/lib/php/File/CAB.php on line 109 Notice: Use of undefined constant OS_WINDOWS - assumed 'OS_WINDOWS' in /usr/local/lib/php/File/CAB.php on line 109 PHP Notice: Use of undefined constant OS_WINDOWS - assumed 'OS_WINDOWS' in /usr/local/lib/php/File/CAB.php on line 110 Notice: Use of undefined constant OS_WINDOWS - assumed 'OS_WINDOWS' in /usr/local/lib/php/File/CAB.php on line 110 PHP Fatal error: Uncaught File_CAB_Exception: Cabinet extraction command not available in /home/izi/test.php on line 5 #0 /home/izi/test.php(5): File_CAB->__construct('tmp.cab') #1 {main} thrown in /usr/local/lib/php/File/CAB.php on line 118 Fatal error: Uncaught File_CAB_Exception: Cabinet extraction command not available in /home/izi/test.php on line 5 #0 /home/izi/test.php(5): File_CAB->__construct('tmp.cab') #1 {main} thrown in /usr/local/lib/php/File/CAB.php on line 118 but I guess you had already fixed the missing require_once 'PEAR.php'...Nope. I didn't want to require pear.php. The less dependencies the better. I just forgot to use a string with defined() and define(). I've uploaded a fixed package. I worked on this stuff when I was quite tired late at night in my spare time. In this case I'd forgotten to do --force when I tested it on a local installation, saw that it worked and called for votes before getting some sleep. -- David Sanders shangxiao