Re: [PEPr] Comment on File Formats::File_CAB
| From: | David Sanders | Date: | Wed, 30 Jan 2008 00:04:23 +0000 |
| Subject: | Re: [PEPr] Comment on File Formats::File_CAB | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-49015@lists.php.net to get a copy of this message | ||
Christian Schmidt wrote:
Christian Schmidt (http://pear.php.net/user/schmidt) has commented on the proposal for File Formats::File_CAB. Comment: It's great to see CAB support in PEAR. You can use the constant OS_WINDOWS to check whether you are on Windows. It is defined in PEAR.php: http://pear.php.net/package/PEAR/docs/1.6.2/__filesource/fsource_PEAR__PEAR-1.6.2PEAR.php.html#a45 Instead of hardcoding C:\windows\system32, you should use one of the environment variables, probably %SYSTEMROOT%. If you don't need to require PHP 5.2.1 just because of sys_get_temp_dir(), you can use System::tmpdir() instead. You may consider using System::which() in case the cabextract binary is located elsewhere than /usr/bin. I suggest reporting the file size as an integer, and last_modified as a Unix timestamp (or a DateTime object). It is a shame that File_Archive (apparently?) has been abandoned. I hope that we can appoint a new maintainer - at least for the purpose of adding CAB support. It looks as if you can add CAB support without touching too many of the existing files. I think it would be preferable if all supported file archives are accessible through the same API. Even if you prefer to keep File_CAB a separate package, I suggest implementing the same API as File_Archive. Note that the File_Archive CVS repository does in fact have some CAB code in it. Proposal information: http://pear.php.net/pepr/pepr-proposal-show.php?id=525Thanks for the useful comments! :) I'd actually prefer to create a plugin package for File_Archive, but iirc the File_Archive class needed to be modified as well. Another issue was that they had a "rule" that the filename needed to have in a certain extension otherwise it would return an error. (See the commented-out bit checking for *.cab extension.) The only reason I wanted a CAB reader was to open *.xsn files ;) -- David Sanders shangxiao