Re: [suspicious - maybe spam] Re: [PEAR] How to use PHP_Archive package. using .phar files
| From: | Greg Beaver | Date: | Fri, 03 Jun 2005 21:01:11 +0000 |
| Subject: | Re: [suspicious - maybe spam] Re: [PEAR] How to use PHP_Archive package. using .phar files | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19452@lists.php.net to get a copy of this message | ||
Klaus Guenther wrote:
All you have to do is associate the .phar extension with the php interpreter. I suppose you could theoretically even rename a .phar to .php and you could run it.First off, sorry for the lack of docs, docs will come soon. In terms of creating a .phar, simply make it and then: $ php blah.phar to use it, or you can associate it with php if on a GUI environment as Klaus said. Actually, renaming it to .php has 1 major problem: currently, the phar will stop working. When including something like: phar://blah.php or phar://blah.phar/blah.php the code that sets up the archive has to locate itself somehow. Currently, it searches get_included_files() and matches up the last .phar included - so file extension matters. There may be ways to work around this, but they are not trivial. The main problem is that PHP_Archive can be located in PHP/Archive.php or in the bundled version found inside the .phar. If it is in PHP/Archive.php, well then __FILE__ will simply be PHP/Archive.php and not the .phar. The only way to detect the filename is through the .phar extension. Actually, if there is some obvious way around that, I'd love to hear about it. Greg