Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3780 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79636 invoked by uid 1007); 6 Aug 2003 16:19:23 -0000 Message-ID: <20030806161922.79635.qmail@pb1.pair.com> To: internals@lists.php.net Date: Wed, 06 Aug 2003 13:19:21 -0300 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030529 X-Accept-Language: en-us, en MIME-Version: 1.0 References: <20030806030041.20077.qmail@pb1.pair.com> <1532644772.20030806134438@newmail.ru> In-Reply-To: <1532644772.20030806134438@newmail.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 200.220.252.74 Subject: Re: [PHP-DEV] PHP archive From: cunha17@uol.com.br (Cristiano Duarte) Simeon Koptelov wrote: > Hello Cristiano, > > Wednesday, August 6, 2003, 9:00:41 AM, you wrote: > > CD> What was proposed is something like this: > > CD> File: application.php > CD> CD> include_once ("classes/MyClass.inc.php"); > CD> $f = fopen("files/test.txt", "r"); > CD> ... > ?>> > CD> The archive my_application.par (could be an .zip, etc) would have these > CD> three files inside: > CD> application.php > CD> classes/MyClass.inc.php > CD> files/test.txt > > CD> And this standalone application is executed with: > CD> php -p > > CD> php -p my_application.par application.php > > CD> Since PHP already have an ZIP file extension and now the filesystem > CD> functions have an improved abstraction layer, maybe it's time to think about > CD> adding transparent ZIP support on this abstraction layer. > > I think that should be great to have transparent ZIP layer at the > "include"/"require" level so one could write something like "require > './lib/some-arc.par/SomePath/MyClass.php'" but the command-line > interface imho should be similar to java i.e. > > php -par my-app.par I agree. > And concrete info about app should locate in meta data file like jar's > meta-inf/manifest.mf because user executes application, not the script > 'a.php' or 'b.php' ( application may consider this scripts are not for > execute by user ). Any info that he wants to provide to it should be > provided in command line. I agree. > But how will you differentiate between your par's dir and the dir where > archive is? I mean if you have par in directory > /home/me/php/my-app.par and in file > my-app.par/MyClass.php you write something like "require > './SomeClass.php'" what file should be included? The > /home/me/php/my-app.par/SomeClass.php or /home/me/php/SomeClass.php? > If the first one is expected behavior how will you address the > filesystem beyond your archive, will you write something like "require > '../SomeClass.php'" for /home/me/php/SomeClass.php? Importing scheme > like java's one could solve this problem but it does not exist in PHP :( The precedente must be cleary defined. We must know if we have to search inside the par file before or after searching the filesystem. IMHO the par file must be searched first (for security reasons). Maybe, we can store the par file structure in memory to speed the file seaching. Cristiano Duarte