Home « Server software «
Documentation: scripts/stage.php
scripts/stage.php - Stage files from the reference server
As explained into scripts/index.php, the local staging store is built after a reference store.The reference store can be a remote server, usually, www.yetanothercommunitysystem.com. Server name can be changed from the configuration panel for scripts.
Or staging files can be provided in a local archive containing all files of some YACS release. The archive may be uploaded unattended, or it can have been put in the directory inbox/yacs.
Lastly, the staging store can be populated manually, through FTP for example. In this case just use the link at the bottom of the page to start the update process.
Content of the staging store is built as follows:
- if a file has been uploaded, its content is used
- else if a reference to a local archive has been provided, its content is used
- else if it is a POST, some remote server is contacted
To achieve staging, the signature file
footprints.php
is extracted from the reference store
and put in the scripts/staging
directory.Then every running script on the local server is checked against the signature file, and if a difference occurs the related reference script is extracted from the reference store and saved in the
scripts/staging
directory.Note that scripts that have to be executed only once will be transferred also only once. Because the script scripts/run_once.php adds the extension '.done' to executed scripts, an additional step has been added to the staging process.
Therefore, the algorithm used to transfer run once files to the staging repository involves following steps:
- ran script - if the script appears in the signature file, and if a local file has the same name plus the extension '.done', then skip the update
- new script - if the script appears in the signature file, but not in the running environment, it has to be transferred
- updated script - if the running script has a different signature, the reference script has to be transferred
At the end of the staging process a link is displayed to launch scripts/update.php, that will actually move the staging files to running directories. But this is another story.
This script is a reference file of this system.
Voir aussi:
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
Testeurs:
- Paddy
delete_all() - Delete a directory and all of its content
function delete_all($path)
- $path - string the directory to delete