Example #1
0
$base_path = realpath(dirname(__FILE__) . '/../');
$versions = new VersionSet();
$versions->collectData('db_user', 'Database Username', 'text', 'root');
$versions->collectData('db_password', 'Database Password', 'text', '');
$versions->collectData('db_server', 'Database Server', 'text', 'localhost');
$versions->collectData('db_port', 'Database Port', 'text', '3306');
$versions->collectData('db_database', 'Database Name', 'text', '');
// 0.0 Release (All Required Tests and Actions)
$version_0_0 = new Version('0.0');
$version_0_0->addTest('PHPVersionOver', array('4.3.0'));
$version_0_0->addTest('PHPExtension', array('mysql', 'curl'));
$version_0_0->addTest('WritableLocation', array($base_path . '/includes/global_config.php', $base_path . '/installer/tmp'));
$version_0_0->addTest('MysqlVersionOver', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'version' => '4.1.0'));
$version_0_0->addAction('AcceptText', array($base_path . '/LICENSE'));
$version_0_0->addAction('ReplaceString', array('message' => "Saved database configuration information!", 'files' => array($base_path . '/includes/global_config.php.dist' => $base_path . '/includes/global_config.php'), 'fields' => array('INSTALL_DB_DATABASE' => 'db_database', 'INSTALL_DB_SERVER' => 'db_server', 'INSTALL_DB_USERNAME' => 'db_user', 'INSTALL_DB_PASSWORD' => 'db_password')));
$versions->add($version_0_0);
// 0.2 Release
$version_0_2 = new Version('0.2');
$version_0_2->addAction('SQLFile', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'db_field' => 'db_database', 'files' => array($base_path . '/setup/sureinvoice.sql')));
$versions->add($version_0_2);
// 0.3 Release
$version_0_3 = new Version('0.3');
$version_0_3->addAction('SQLFile', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'db_field' => 'db_database', 'files' => array($base_path . '/setup/update-0.2-0.3.sql')));
$versions->add($version_0_3);
// 0.4 Release
$version_0_4 = new Version('0.4');
$version_0_4->addAction('SQLFile', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'db_field' => 'db_database', 'files' => array($base_path . '/setup/update-0.3-0.4.sql')));
$versions->add($version_0_4);
// 1.0 Release
$version_1_0 = new Version('1.0');
$version_1_0->addAction('SQLFile', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'db_field' => 'db_database', 'files' => array($base_path . '/setup/update-0.4-0.5.sql')));
Example #2
0
$version->addTest('WritableLocation', array(APP_PATH . '/pharma'));
$version->addTest('WritableLocation', array(APP_PATH . '/pharma/img'));
$version->addTest('WritableLocation', array(APP_PATH . '/med_depot'));
$version->addTest('WritableLocation', array(APP_PATH . '/med_depot/img'));
$version->addTest('WritableLocation', array(APP_PATH . '/radiology'));
$version->addTest('WritableLocation', array(APP_PATH . '/radiology/dicom_img'));
$version->addTest('WritableLocation', array(APP_PATH . '/gui'));
$version->addTest('WritableLocation', array(APP_PATH . '/gui/img'));
$version->addTest('WritableLocation', array(APP_PATH . '/gui/img/logos_dept'));
$version->addTest('WritableLocation', array(APP_PATH . '/gui/smarty_template/templates_c'));
$version->addTest('WritableLocation', array(APP_PATH . '/include'));
$version->addTest('WritableLocation', array(APP_PATH . '/include/inc_init_main.php'));
$version->addTest('WritableLocation', array(APP_PATH . '/installer'));
$version->addTest('WritableLocation', array(APP_PATH . '/installer/install.php'));
$version->addAction('AcceptText', 'License Agreement', array(dirname(__FILE__) . '/LICENSE'));
/*$version->addAction('SQLSchema', array(
	'username_field' => 'db_user',
	'password_field' => 'db_password',
	'server_field' => 'db_server',
	'type_field' => 'db_type',
	'db_field' => 'db_database',
	'schema' => dirname(__FILE__).'/db/schema.xml'));*/
$version->addAction('SQLFile', 'Install Database Schema', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'type_field' => 'db_type', 'db_field' => 'db_database', 'files' => array(dirname(__FILE__) . '/db/sql/%type%_dump.sql')));
$version->addAction('CreateAdmin', 'Create Administrator User', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'type_field' => 'db_type', 'db_field' => 'db_database', 'adminuser_field' => 'admin_user', 'adminpass_field' => 'admin_password'));
$version->addAction('ReplaceString', 'Save System Configuration', array('message' => "Configuration information saved", 'files' => array(dirname(__FILE__) . '/inc_init_main.php.dist' => APP_PATH . '/include/inc_init_main.php'), 'fields' => array('INSTALL_DB_USERNAME' => 'db_user', 'INSTALL_DB_PASSWORD' => 'db_password', 'INSTALL_DB_DATABASE' => 'db_database', 'INSTALL_DB_SERVER' => 'db_server', 'INSTALL_DB_TYPE' => 'db_type', 'INSTALL_ADDRESS' => 'care2x_address', 'INSTALL_PROTOCOL' => 'transfer_protocol', 'INSTALL_KEY_1' => '1st_key', 'INSTALL_KEY_2' => '2nd_key', 'INSTALL_KEY_3' => '3rd_key')));
$version->addAction('CSVOptions', 'Install Optional DB Tables', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'type_field' => 'db_type', 'db_field' => 'db_database', 'files' => array(dirname(__FILE__) . '/db/icd10', dirname(__FILE__) . '/db/ops301')));
$version->addFinalAction('RenameFile', 'Rename Critical Installation Files', array('message' => "Critical installation files renamed", 'files' => array(APP_PATH . '/installer/install.php' => APP_PATH . '/installer/install_' . rand(1, $rmax) . '.php'), APP_PATH . '/install/install.php' => APP_PATH . '/install/install_' . rand(1, $rmax) . '.php', APP_PATH . '/install/encode_pw_md5.php' => APP_PATH . '/install/encode_pw_md5_' . rand(1, $rmax) . '.php', APP_PATH . '/install/initialize.php' => APP_PATH . '/install/initialize_' . rand(1, $rmax) . '.php', APP_PATH . '/create_admin.php' => APP_PATH . '/create_admin_' . rand(1, $rmax) . '.php'));
$versions->add($version);
?>