Table of Contents

Introduction

This Howto will describe how to create packages with the Package Builder

Packages are zip files that contains a PHP application, with or without a 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 installation of Radria

You will need the following packages:

Radria

Once setup click on the Site Manager 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 step 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

In the first step the wizard asks you the name of the package and its version.

 Package Name: phpxplorer_0.9.32
 Package Version: 0.5

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 and click Continue…

Database Tables

Skip this step if you don't 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.

Decide if you want to include the data in your package.

Then click Continue.

Commands

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

This is just an overview; for more details on the commands see radria_application_package.

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 variables 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 useful the package manager provides access to environment variables:

During upload

During the upload process a probe is sent to the live server to detect some of the remote server information.

All of the install variables are also available during the upload.

Installation Commands

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

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

replace

Will replace one string by another 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

Removes a file from the project

 removefile phpwiki/config.php.dist

copyfile

Creates a copy of an existing file

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

mergefile

Merge 2 files into one, it concatenates the content of the first file and the second one into 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.

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

setwritable

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

 setwriteable imagegallery/uploads

Upload files

From that package you can select which files should be uploaded when the project is uploaded to the production or testing server.

You can enter generic keywords like none that will not upload any files or all that will upload all the files. If only a set of files is relevant in the production application list the relative path of each of those files.

There is a special option in the FTP upload that will convert all the PHP files HTML files before uploading them. This is only for publishing basic web sites on web servers with no PHP capabilities.

Application Link

To make your application appear in the SiteManager list of Tools (on the left box) you need to provide a relative URL. Optionally you can provide a label for the link and a second link if the application has a back end configuration area on a different URL.

If your application is a library or internal component you do not need to provide any URL.

Remove/Uninstall commands

Commands executed when the package is removed.

For now there are none.

FIXME

Additional information

If you want additional information on the packages you can check out the following articles: