Introduction

This Howto will describe how to create packages. Packages are zip files that contains a PHP application, with or without database ( MySQL / PostgreSQL ) or a web site design.

Once built the package can be made available to others for download or you can publish it on a package repository for a 1 click installation.

Requirements

To create packages you will need a working SiteManager. You can use DragDrop Sitecreator, WebFusion Studio or PAS, they all come with SiteManager.

You will need the following packages:

  • Content Administration (contentadmin)
  • Packag Builder (package_builder)

WebFusion Studio

Once setup click on the Site Manager tab to open the SiteManager and create a new project or open the project where you have the application or web site design you want to package.

In the Package manager install the Content Administration and Package Builder package.

DragDrop Sitecreator

Click on the Options tab, then select Software install / upgrade .

In the Package manager install the Content Administration and Package Builder package.

Package Builder

The package builder is a 5 steps wizard in the Content Administration to create packages with no technical knowledge.

Log into the Content Admin, the default username / password is admin / sqlfusion. In the left menu, select Create Package.

Name and Description

The first step of the wizard will ask you the name of the package and its version.

  • Package Name: Name of your package, we suggest the following guide lines
    1. All lower cases
    2. No space, _ are ok
    3. No special characters, only alpha numberical, A-Z and 0-9
    4. Design
  • Package version: that number is incremented each time you create a new package.If you create a package for an existing software, you need to have 2 versions numbers. The second version number is inserted in the package name and seperated by a _. The Package version needs to be with
 Package Name: phpxplorer_0.9.32
 Package Version: 0.5
  • Package Description: Anything you want to describe your package, what it does, what it contains, change logs. HTML tags are authorized.
  • Dependency Packages: Packages names separated with comas that are required before installing the package. The package name must include the version number.

Files

Select the files you want to add to your package.

Check the check box on the left of each file you want to include in the package an click Continue...

Database Tables

This step will be skip if you dont have a database setup on your project.

Select the Tables you want to add in the Package. You may use CTRL to select multiple tables.

Then choose if you want to also include the data in your package.

Then click Continue

Commands

During installation or transfer of a package you may need to setup some configuration files or setup file to make an application run in the user project.

You can run commands during 3 Events.

  1. When the Package is installed
  2. When its Uploaded / Synchronized over FTP
  3. When its removed

Environment Variables

They are variable taken from the PHP $_ENV or $_SERVER or from the setup. You can use them when executing the commands, to setup configuration files or setup default accounts.

During Install and Remove

To make the commands usefull the package manager as access to environmnet variables:

  • [absolute_http_path]: Absolute web url to the project: http://www.yourdomain.com/webfusion/projectname/
  • [relative_http_path]: Web path the project directory: /webfusion/projectname/
  • [absolute_file_path]: Absolute path to the project: /home/sitecreator/projectname/ files.
  • [relative_file_path]: Relative path to the project directory, ../projectname
  • [user_username]: Username, use the database connexion login or application username and fall back to “admin” if nothing is found.
  • [user_password]: Password, use the database connexion passowrd or application username and fall back to “sqlfusion” if nothing is found.
  • [user_password_md5]: “, md5($user_password), $command) ;
  • [domain_name]: Current Domain name
  • [projectdir]: Path to the project directory, ../projectname
  • [abs_projectdir]: Absolute path to the project directory, including subdirectory webfusion/projectname/
  • [web_dir]: Web friendly directory to the project directory: /webfusion/projectname/
  • [web_url]: Absolute web url to the project: http://www.yourdomain.com/webfusion/projectname/
  • [project_dir_fullpath]: Absolute path to the project: /home/sitecreator/projectname/
  • [project_name]: Name of the project
  • [server]: Hostname or IP of the database server
  • [login]: Database login
  • [password]: Database password
  • [database]: Database name
  • [curtime]: Current time stamp
  • [curdate]: Current date (Y-m-d)
  • [server_name]: Server Name / Domain name
  • [password_md5]: Database password encoded in md5
  • [database_type]: Type of database (mysql/pgsql/sqlite)
  • [uniqid]: Random uniq id
  • [refererkey]: Referer key for remote access authorization.

During upload

During the upload process a prob is sent to the live server to detect some of the remote server informations. All the install variables are also available during the upload.

  • [remote_absolute_file_path]: Absolute PATH to the project on the remote server
  • [remote_absolute_http_path]: Absolute web url to the project on the remote server.
  • [remote_relative_http_path]: Relative web url to the project on the remote server.
  • [remote_dir]: Relative path to the project on the remote server
  • [remote_php_self]: PHP_SELF value from the remote server
  • [remote_server_name]: Remote server name (domain name)
  • [remote_webdir]: Absolute Web Address of the remote project. (http://www.remotedomain.com/folder1/)

Installation Commands

The installation commands are executed after the files are copied in the project folder.

  • replace
  • sqlquery
  • mkdir
  • removefile
  • copyfile
  • mergefile

For all the commands all the files path are relative to the project directory.

replace

Will replace a string by an other in a file.

replace forums/config.php @databasehost [server]

This example will replace the string @databasehost with the database server hostname in the forums/config.php file.

sqlquery

Run an sql query in the project database.

 sqlquery "UPDATE phpbb_config SET config_value = '[server_name]' WHERE config_name = 'server_name'"

This example will set the server name in the phpbb_config table using an sql query.

mkdir

Creates a directory, the directory path is relative to the project directory.

 mkdir dokuwiki/data/cache
 mkdir dokuwiki/data/meta

removefile

Will just remove a file from the project

 removefile phpwiki/config.php.dist

copyfile

will create a copy of an existing file

 copyfile phpwiki/config.php.dist phpwiki/config.php

mergefile

Merge 2 files in one, it concatenate the content of the first file and the second one in the third one.

 mergefile file1 file2 finalfile3

Upload commands

When the web site or application is uploaded over FTP during the synchronization a set of commands can also be executed.

  • sqlquery
  • replace
  • setwritable

The sqlquery and replace work the same way as the Install commands.

setwritable

This will set a chmod 0777 on the remote file, meaning making it writable by everyone.

 setwriteable imagegallery/uploads

Remove/Uninstall commands

Commands executed when the package is removed. For now there is none. FIXME

 
howtos/createpackages.txt · Last modified: 2006/12/10 14:05 by 71.106.236.22
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki