Below are a few tips if you want to maintain or create packages for an existing PHP applications.
We are going to package the excellent wwwSQLDesigner Application package from Ondřej Žára.
Since the Radria packaging system is a One click install, you need to setup everything so the application is fully usable once it is installed. This means setting up the database configuration, the file path, default admin user.
Lets start by creating a new project:
The SiteManager creates the project tree and the database. In the radria folder there is now a new sqldesignerPkg/ folder.
Then we download at http://ondras.zarovi.cz/sql/ the latest version of wwwSQLDesigner. And unzip it under a subfolder in our new project.
We setup the mysql connection database in
define('SERVER','localhost'); define('USER','sqldlogin'); define('PASSWORD','sqldpassword'); define('DB','sqlddatabase'); define('TABLE','wwwsqldesigner'); $conn = mysql_connect(SERVER,USER,PASSWORD); mysql_select_db(DB);
In most PHP application the database configuration is in a config.php or db.inc.php files.
And execute the sql statement from
DROP TABLE IF EXISTS `wwwsqldesigner`; CREATE TABLE `wwwsqldesigner` ( `keyword` varchar(20) NOT NULL DEFAULT '', `data` mediumtext NOT NULL, `dt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`keyword`) );
in our sqldesignerdbx database, can use the phpMyAdmin or WebIDE to do this.
We need to test our work to see if the application is working properly.
Next we add some documentation in the /docs/ folder we create a sqldesigner sub folder.
We add in it an index.html file with some documentation and instruction on how to use the application.
To create the package we will use the Package Builder its a step-by-step wizard that automates most of the work.
Add the package builder to your project. With the SiteManager in the package list in the tools section install the following packages:
Now in the SiteManager Tools list you have the Package Builder open it. It will ask you for a password, it's the same as the database
Username: sqldlogin Password: sqldpassword
The first form on the wizard is the package information.
Important: in the package name we add the version of the application separated with a _.
The next screen lists all the files in your project. Check the box on the left of each file under the sqldesigner folder and in the docs/sqldesigner
This screen displays all the tables available in the database with the option to add them in the package with or without data.
Select the wwwsqldesigner table and check Store only structure
This last screen contains all the parameters needed to enable an auto installation.
For more detailed information on what each field means take a look at how_to_package_application_and_libraries
In the Install Commands
replace sqldesigner/io.php sqlddatabase [database] replace sqldesigner/io.php sqldlogin [user_username] replace sqldesigner/io.php sqldpassword [user_password]
In the PHP files to uploads
It's a tools for development only, we don't want it to be published on the live / production application.
In the HTML file to upload
This would not even work in an HTML only web server.
In the application starting url
In the Application starting link label
This will enable the link in the SiteManager Tools list.