Re: Phar as part of the include_path?

From: Date: Sun, 17 Feb 2008 17:51:54 +0000
Subject: Re: Phar as part of the include_path?
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-5117@lists.php.net to get a copy of this message
Sorry Markus, forgot to cc list. ----- Original Message ----- From: "Steph Fox" <steph@zend.com> To: "Markus Fischer" <markus@fischer.name> Sent: Sunday, February 17, 2008 5:49 PM Subject: Re: [PECL-DEV] Phar as part of the include_path?
Hi Markus, No... the only setup I've found that even looks happy with that idea is CGI *without* the phar extension enabled, and even then it ignores it - you have to include the phar itself: include 'nophar.phar'; // includes the (web) start page include 'b/c.php'; // successfully includes nophar.phar/b/c.php This is very different behaviour from all the other setups I have on board, and almost certainly shouldn't work that way at all! I'll clarify the expected behaviour with Greg when he gets back from his travels and fix as necessary - I'm not 100% sure the current include behaviour is correct for other setups. The idea, at least as I understand it, is that you access everything within the phar through the start page set during the build for Web and/or CLI environment. E.g. http://localhost/nophar.phar from the test suite files should (does) redirect to http://localhost/nophar.phar/web.php, whereas "php nophar.phar" on the commandline uses index.php as its startfile. Including a phar in a serverside PHP script when ext/phar is enabled currently makes it respond as if to CLI, everywhere except the maverick CGI-without-extension setup. Accessing the phar URI directly works everywhere we've tested, assuming the phar under test contains the default stub, and only if ext/phar is enabled otherwise. Likewise, accessing internal files from outside the archive generally needs a stream wrapper (phar:// or http://). By which I mean they're visible only via browser navigation, unless you have access to the phar:// stream wrapper. If you have that, you can specify files within a phar for inclusion in a script: include 'phar://nophar.phar/web.php'; and you can also use standard PHP functions and SPL to interrogate the files. Greg's latest endeavour is to allow external files to be mapped and mounted as if they were part of the archive, which would presumably go some way to addressing concerns about other software interacting with pharred-up applications - but he's only just started work on that. - Steph ----- Original Message ----- From: "Markus Fischer" <markus@fischer.name> To: <pecl-dev@lists.php.net> Sent: Sunday, February 17, 2008 7:28 AM Subject: [PECL-DEV] Phar as part of the include_path?
Hi, I've read through http://php.net/phar but I'm still not sure about this. It is mentioned that a phar archive has Java jar like behavior. Is it possible to use it as part of the include_path? E.g. include_path = .:/my/archive.phar:/other/paths thanks, - Markus -- PECL development discussion Mailing List (http://pecl.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pecl.dev (#5117) next »