ID:              24809
 User updated by: lee at semel dot net
-Summary:         Packaging PHP Applications for Easy Distribution
 Reported By:     lee at semel dot net
 Status:          Wont fix
 Bug Type:        Feature/Change Request
 PHP Version:     Irrelevant
 New Comment:

Pear install isn't quite the same idea:

1) My suggestion is intended to overcome the problems of having a
common PHP.INI file -- you can't configure one application separately
from another

2) My suggestions is intended to be used for entire PHP applications
themselves, not modules, libraries or groups of classes.  

3) My suggestion is intended to separate the configuration of the
application from the code of the application itself, and set up a
standard way of doing this.  On most applications today, configuration
is nonstandard, usually involving manual edits to an include file,
searches and replaces, manually creating, editing or moving files. 
Configuration is often mixed up with the code, so if you want to deploy
your PHP app to both a development, test, and production environment,
you have the potential for trouble.

If this idea were implemented, installing or deploying a PHP
application becomes very easy.  Let's say you want to install
"myphpapp" on your account.  

1) Download the application (say "myphpapp.par"), stick it in your
document root, and view http://mydomain/myphpapp/.  It works, just as
if the files were decompressed there.

2) To customize your configuration, edit a file "myphpapp.ini" or
"myphpapp.xml" and put it in the same directory as the par file.  PHP
will know where to look for it.  Here you can keep settings speciifc to
this particular install: the database password, the color schemes,
etc.

3) If you want to maintain a development and production version of the
app, going live with a new version becomes as easy as copying one file
from your development server to your live server.  You can leave the
configuration file there so each server can maintain a separate
configuration, with its own database or debugging settings.

4) It would be possible to develop a web based tool to help you can
download, configure and install your app through your browser!  Some
Java application servers (such as BEA Weblogic) do just that:  You can
upload a file containing a Java web application, configure it via your
browser, and get it set up in about 2 minutes, with no manual editing
of files.  Unfortunately, Java has many other problems, which is why I
prefer PHP.

5) If myphpapp.par wants register_globals, magic_quotes_gpc, and
asp_tags, but someotherphpapp.par doesn't work with these settings,
they can both live side by side, because each one's got a private
PHP.INI file zipped up inside of it.

6) Making a PHP Archive file is easy - just use any standard zip
program.

All in all, I think this functionality would help make PHP applications
easier to install, configure and manage.  A standardized, easy way to
do this may even hasten PHP's adoption within corporations, which are
used to managing their Java web applications this way.


Previous Comments:
------------------------------------------------------------------------

[2003-07-27 15:07:35] cunha17 at uol dot com dot br

I don't think PEAR Install do what was proposed by Lee, IMHO.
I think that the package won't have to be decompressed to be used and
the
PHP engine will use the files inside the package as they were
decompressed
on the filesystem.

Correct me if I misunderstood something...

Cristiano Duarte

------------------------------------------------------------------------

[2003-07-27 14:19:03] [EMAIL PROTECTED]

We already have PEAR for this. (pear install)



------------------------------------------------------------------------

[2003-07-25 16:28:46] lee at semel dot net

Description:
------------
Since PHP is often used for distributing entire applications at once,
it would be great to have a mechanism (similar to Java's WAR files) to
make it easy to package, distribute, install, and configure them.

I propose implementing a system for easily packaging PHP applications. 
A .PAR file (PHP ARchive) file is a zipfile containing the following:
* All the images, includes, and php files that make up the PHP
application.
* a PHP.INI file configured specific to the application.  PHP would
ignore values from the master PHP.INI file and use the settings from
the PHP.INI file inside the archive. 
* a WEB.XML (or WEB.INI) file defining default configuration parameters
speicifc to the application.  Configuration parameters should be able
to be overridden by an external file, making them very easy to edit,
and to provide an easy way to set up server-specific configurations
when installing an application in multiple places.

The application would be accessed through the browser at
http://servername:port/nameofarchive/, or at another location specified
by the administrator.

Wioth this system, each application could have its own configuration,
include path, and libraries, and installing an application becomes a
matter of dropping the file into your document root.  If your ISP
doesn't let you change PHP.ini, simply installing the PAR file will set
everything perfectly for you.  No more having to worry if
magic_quotes_gpc or register_globals is set correctly.  No more having
to worry if PEAR is installed.

For more info on how Java does it:
http://access1.sun.com/techarticles/simple.WAR.html



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24809&edit=1

Reply via email to