PLUG 5 is currently in development.


This page refers to the original PLUG framework for PHP 4 which is concidered obsolete, and no longer maintained.

The staging platform


Beyond the code library PLUG provides a specific way of developing and deploying web applications. The process can be described in two halves as outlined below.
  1. Configure & develop
    • A development server will run the PLUG library in its native form.
    • Multiple configurations will be managed by separate config directories.
  2. Compile & deploy
If you have source code which appears to be uneditable, you are looking at code that has been deployed. To make any amendments you must go back to the `original' development version and re-compile. This could be on the same server, but is more likely to have been built on a local network development server.
back to top

1. Configure & develop

- multiple site configs with PLUG

PLUG is designed to run in a sort of "development mode" on one host and provides a tool to then publish the code with an alternative configuration to another host where it will run in a sort of "optimised mode". These hosts may be on separate servers.

Let us suppose you have a local dev site where you work on a daily basis and a single remote server that will be your live site. You will set up two configuration folders directly under your virtual host directory:
[screenshot image]
The conf folder is the default configuration as used when running the development site, conf.live will be a config for another server. It can be called whatever you like and you can have as many as you want. Lets look at some example directives in PLUG.conf.php; Merely change the values for the other configurations to those applicable on the target host[s].
Obviously in some cases you could use predefined variables like $_SERVER['DOCUMENT_ROOT'] to set these values, but I have found this unreliable in some instances. I believe this method provides the most flexibility. You can place anything you want to be server-specific in this file, but other modules may have their own configuration file such as Auth.conf.php.

The PLUG folder is the standard library which you should not alter. httpdocs is your virtual root in which you should also find the web interface in a subfolder called plug_admin.
back to top

2. Compile & deploy

- publish to a target host

To compile to a target server you must have compiler.conf.php under the required config.
It will look something like this.
All other deployment options are handled by the html interface, which is installed in the plug admin area accessed though your dev site at a url like; http://somehost/plug/compiler/. The dialogue will look something like this:

[screenshot image]

You have complete control over what files you deploy by using the match & exclude options. Upload all web files by using a match pattern like \.(php|swf|html?|css|js|gif|jpe?g)$. Non-PHP files are deployed unaltered.

Warning

: Never download optimised files on top of your local files! I have never done it, but the danger is there if you get your configs mixed up.

More information about the compiling process here.

back to top