Really nice class, thank you!!
The examples files do not work due to a typo in the main class (install.php)
var $stages = array('stage 1','stage 2','stage 3');
var $stages = array('stage_1','stage_2','stage_3'); (note the underscores) to ensure they match the file names built dynamically in
I know these are merely example files but stage_1.php presentation could be vastly improved by putting the input form into a table so the input text area's line up nicely.
Although this Class is for "install" ing, a lot of users would probably want to use it for updating their scripts (updating script versions) too and I think it would be a nice to to be able to specify the location of an existing file which contains DB connection information so the form (stage_1.php) could potentially be auto-populated with those fields.
Thanks again for this excellent Class. I will be using it regularly.
John Haywood - 2009-05-21 07:40:21 - In reply to message 5 from Bogdan Lupandin
My database connection file is a PHP file (config.php) that holds the connection variables.
$dhhost , $duser etc
So I just did
$inst->global_file = 'config.php';
Then I globalise the vars
$global $dbhost, $dbuser, ... ;
Then pass them to the form so the form is pre-populated but the user can change the values by typing in the form if they are not correct.
I am using your installer when I develop plug-in modules for a CMS
John Haywood - 2009-05-22 08:32:45 - In reply to message 8 from Bogdan Lupandin
Sorry that was a typo for me.
I just use
global $dbhost, $dbuser etc;
It is used like that throughout the content management system so that the connection details can be passed inside different functions.
I could be wrong (I'm a beginner with PHP) but using a super global like
$GLOBAL['dbhost'] might be a bad thing.
I prefer your way of using an XML file (object) or even using a CONSTANT for db connection but I am stuck with what the CMS maker has provided.