Hello Cristiano,I agree.
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 <package-file> <startup-script>
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.
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).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 :(
Maybe, we can store the par file structure in memory to speed the file seaching.
Cristiano Duarte
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php