Purpose
Almost all PHP software includes a configuration file (usually called 'config.php'). This steps generates this configuration file through a combination of a template, field names, and a filename. The generated configuration file will be placed on the server or downloaded by the user (to be uploaded to the server later).
Field Breakdown
Step Name - This title will be displayed at the top of this screen during the installation process.
Description - In the content area of the installation screen, this text will be displayed. The form for the user to enter his configuration information will follow this. You must format using HTML. For newlines, you should use '<br />' for HTML breaks.
File Name - This is the filename of the configuration file. Most configuration files are called 'config.php'. No path information is necessary at this point.
Relative File Location - This the directory where this configuration should be placed. It is relative the location of this installation script. For example, if you plan to place this installer in /install/ of your product's package and you want the configuration file in /includes/, this field would be '../includes/'. Remember to include the trailing slash!
Upload Instructions - If BuildExec cannot upload the file to the relative file location itself, it will allow the user to download the file. These upload instructions are sent to the user on this screen and should tell the user where to upload the file.
Fields - Each field is a piece of data that you want the user to enter. There are four components to each field: Type, Name, Default Value, and Help. The Type is either "text" (one line of data) or "textarea" (multiple lines of data - a textbox). The Name is a name of your choice and it will be displayed to the user. This Name will also be used in the template of your configuration file. The Default Value is optional and is the default value of the field. For Example, most database hostnames are localhost so your Database Host default value may be 'localhost'. The Help is displayed beside the field to assist the user and it is optional.
File Template - This is the template of the configuration file that will be produced. It usually consists of PHP code and tags which will be replaced with the data entered by the user into the fields. Tags follow this style: {field_[FIELDNAME]}. For example, if I have a field called 'License Number', the tag for that field is {field_License Number}. Below is an example File Template:
<?php
/* This is a basic configuration file containing
database connection information.
For this to work properly, I have added 4 Fields
in this step called Database Hostname, Database
Username, Database Password, and Database Name */
$db['hostname'] = '{field_Database Hostname}';
$db['username'] = '{field_Database Username}';
$db['password'] = '{field_Database Password}';
$db['name'] = '{field_Database Name}';
?>
Frequently Asked Questions
How does this step work?
First, your Fields are used to display a form to the user. They complete the form and click "Proceed with Installation". Then, the file is generated and an attempt to upload the file is made. If that fails, the user downloads the file and is instructed as to where to upload it manually.