Installation
- >= _trst() ?>install_step_1= _trend($LANG) ?>
- >= _trst() ?>install_step_2= _trend($LANG) ?>
- >= _trst() ?>install_step_3= _trend($LANG) ?>
- >= _trst() ?>install_step_4= _trend($LANG) ?>
- >= _trst() ?>install_step_5= _trend($LANG) ?>
- >= _trst() ?>install_step_6= _trend($LANG) ?>
tr('install_check_syssettings'); ?>
- PHP < 5.4 () found, short_open_tag needs to be enabled: OK' : 'Fail'); ?>
- PHP >= 5.4 () found, short_open_tag is always enabled: OK
- magic_quotes_gpc should be disabled: OK' : 'Performance problem'); ?>
- magic_quotes_runtime should be disabled: OK' : 'Performance problem'); ?>
- file_uploads should be enabled: OK' : 'Fail'); ?>
- register_globals should be disabled: OK' : 'Security risk!'); ?>
tr('install_check_phpextensions'); ?>
- intl: OK' : 'Fail'); ?>
- pcre: OK' : 'Fail'); ?>
- SimpleXML: OK' : 'Fail'); ?>
- SPL: OK' : 'Fail'); ?>
tr('comn_check_syscfg'); ?>:
-
missing syscfg!
go back - syscfg found and loaded
- ERROR: No security system key defined! Define $cfg['syskey'] in your config file!
- ERROR: No security system key defined! Define $cfg['syskey'] in your config file!
= _trst() ?>install_step_1_next= _trend($LANG) ?>
- = _trst() ?>install_check_dbsettings= _trend($LANG) ?>
-
= _trst() ?>install_check_dbsettings_ok= _trend($LANG) ?>
= _trst() ?>install_used_db= _trend($LANG, [$db->getDatabase()]) ?>
-
= _trst() ?>install_check_dbsettings_ok= _trend($LANG) ?>
- = _trst() ?>install_systable_found= _trend($LANG,[MCMS]) ?>
- = _trst() ?>install_table_defined= _trend($LANG,[$tableInfo->getName(),$tableInfo->getColumnCount()]) ?>
tableExists($tableInfo->getName())) {
?>
= _trst() ?>install_table_exists= _trend($LANG) ?>
- = _trst() ?>install_table_defined= _trend($LANG,[$tableInfo->getName(),$tableInfo->getColumnCount()]) ?>
tableExists($tableInfo->getName())) {
?>
- = _trst() ?>install_systable_missing= _trend($LANG,[MCMS]) ?>
= _trst() ?>install_step_2_next= _trend($LANG) ?>
tr('install_check_dbsettings')."\n"; try { $db = DB::newInstance($cfg['db']['dsn'],$cfg['db']['user'],$cfg['db']['passwd']); if (file_exists($systablefile)) { $tablesdef = simplexml_load_file($systablefile); echo '
- ';
$tables = array();
foreach ($tablesdef as $tabledef) {
$tableInfo = TableInfo::fromXML($tabledef);
$tables[] = $tableInfo;
}
$tables = array_reverse($tables);
foreach ($tables as $tableInfo) {
if ($db->tableExists($tableInfo->getName())) {
try {
$fks = $db->table($tableInfo->getName())->getFKeyList();
foreach ($fks as $fk)
$db->table($tableInfo->getName())->removeFKey($fk);
}
catch (SQLException $e) {
echo "
- error!
".$e->getMessage()."
".$e->getQuery().' ';
}
}
}
foreach ($tables as $tableInfo) {
if ($db->tableExists($tableInfo->getName())) {
echo ' - ';
try {
echo $LANG->tr('install_preremove_table',[$tableInfo->getName()])." ";
$db->dropTable($tableInfo->getName());
echo " OK
"; } catch (SQLException $e) { echo " error!
".$e->getMessage()."
".$e->getQuery().'
'; } echo ' ';
}
}
// $tables = array_reverse($tables);
// foreach ($tables as $tableInfo) {
// if (in_array($tableInfo->getName(), $excludeTables))
// continue;
// echo ' - ';
// echo _trv('install_create_table',$tableInfo->getName())." ";
// try {
// $db->createTable($tableInfo);
// echo " OK
"; // } // catch (SQLException $e) { // echo " error!
".$e->getMessage()."
".$e->getQuery().'
'; // } // echo ' ';
// }
echo '
calling generated update script
'; $STEP = 2; $VERSION = MCMS_DB; require_once($installfile); $db->table('installinfos')->insert(array('type' =>'system', 'key' => 'mcms', 'version' => MCMS, 'attrib' => 0)); $db->table('installinfos')->insert(array('type' =>'system', 'key' => 'mcmsdb', 'version' => MCMS_DB, 'attrib' => 0)); } else { echo "- systables.xml missing
\n"; $valid = false; } } catch (DBException $e) { echo "- error: ".$e->getMessage(); $valid=false; } if ($valid) echo '
'.$LANG->tr('install_step_3_next').'
'; else echo ''.$LANG->tr('install_step_back').'
'; break; case 4: ?> tr('install_clearing_tables')."\n"; echo '
- ';
if ($db->getDialect() instanceof Mysql)
$db->query("SET FOREIGN_KEY_CHECKS=0");
foreach (array('websites','websitesettings','accounts','accountsettings') as $table) {
echo "
- {$table} "; $db->table($table)->delete(array()); } if ($db->getDialect() instanceof Mysql) $db->query("SET FOREIGN_KEY_CHECKS=1"); echo '
\n"; echo ' websites
'; $data = array( 'parent_id' => NULL, 'domain' => '*', 'online' => 'online' ); $db->table('websites')->insert($data); $siteId = $db->getInsertId(); echo $LANG->tr('install_generated_site_id',[$siteId])."
\n"; echo ' websitesettings
'; $data = array( 'site_id' => $siteId, 'instance' => '', 'key' => 'title', 'value' => $_POST['pagename'] ); $db->table('websitesettings')->insert($data); $data = array( 'site_id' => $siteId, 'instance' => '', 'key' => 'layout', 'value' => 'default' ); $db->table('websitesettings')->insert($data); $data = array( 'site_id' => $siteId, 'instance' => '', 'key' => 'startinstance', 'value' => 'home' ); $db->table('websitesettings')->insert($data); $data = array( 'site_id' => $siteId, 'instance' => '', 'key' => 'defaultlang', 'value' => trim($_POST['defaultlang']) ); $db->table('websitesettings')->insert($data); $data = array( 'site_id' => $siteId, 'instance' => '', 'key' => 'lang', 'value' => trim($_POST['defaultlang']) ); $db->table('websitesettings')->insert($data); echo ' accounts
'; $data = array( 'seed' => rand(1000,100000), 'login' => trim($_POST['alogin']), 'password' => sha1(trim($_POST['apasswd'])), 'email' => trim($_POST['aemail']), 'authtoken' => sha1($_POST['apasswd'].time()), 'state' => 0, 'failed_login_count' => 0, 'masteradmin' => true ); $db->table('accounts')->insert($data); if (isset($_REQUEST['createhome']) && $_REQUEST['createhome'] == 'y') { $db->table('moduleinstances')->delete(array('site_id' => $siteId,'instance' => 'home')); $data = array( 'site_id' => $siteId, 'base_menu_id' => 0, 'instance' => 'home', 'module' => '\\MCMS\\_\\Mod\\MCMS\\StaticBlock\\StaticBlock', 'visible' => 'all', 'publish_start' => NULL, 'publish_end' => NULL ); $db->table('moduleinstances')->insert($data); } echo '
'.$LANG->tr('install_finish').'
'; } catch (DBException $e) { echo "- error: ".$e->getMessage().''; if ($e instanceof SQLException) echo $e->getQuery(); echo '
'.$LANG->tr('install_step_back').'
'; } break; case '6': echo ''.$LANG->tr('install_finish_i1').'
'; echo ''.$LANG->tr('install_finish_i2').'
'; echo ''.$LANG->tr('install_finish_i3').'
'; break; } ?>