A brief introduction to the HadSkyInstallerPHP program installation system:
1. Suitable for PHP+MySQL websites;
2. Check whether the program is installed, and install it if not;
3. The installation can write MySQL configuration files and import MySQL data files;
4. Custom code can be expanded to add more installation information.
HadSkyInstallerPHP program installation system detailed configuration:
This is open source software and the author authorizes you to make any modifications to it.
1. First unzip HadSkyInstaller and put the install folder into the root directory of your PHP program;
2. Add code at the head of your program’s entry script (for example, index.php):
if(!file_exists(dirname(__FILE__)."/install/install.locked")){header("Location:install");exit();}
3. Configure the installer:
(1) Modify the install/php script/install.php file as follows:
Line 19: Fill in the MySQL configuration file path of your program;
$configflie=fopen(dirname(__FILE__)."/../config.php","w");
Lines 25-32: Fill in the contents of the MySQL configuration file of your program;
$mysql_config="
$_G['MYSQL']['LOCATION']='{$mysql_location}';
$_G['MYSQL']['USERNAME']='{$mysql_username}';
$_G['MYSQL']['PASSWORD']='{$mysql_password}';
$_G['MYSQL']['DATABASE']='{$mysql_database}';
$_G['MYSQL']['CHARSET']='{$mysql_charset}';
$_G['MYSQL']['PREFIX']='{$mysql_prefix}';
";
Line 61: Please modify pk_ to the table prefix of your initial installation data.
(2) Please store the installation data file to be imported into MySQL in install/mysqldata/data.sql. The file is in UTF-8 format and does not contain BOM.
4. Modify the corresponding template information under install/template;
5. After the configuration is completed, install and test.