本文整理匯總了PHP中gcms::saveConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP gcms::saveConfig方法的具體用法?PHP gcms::saveConfig怎麽用?PHP gcms::saveConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gcms
的用法示例。
在下文中一共展示了gcms::saveConfig方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$save[$lang] = $detail;
$db->edit(DB_LANGUAGE, $search['id'], $save);
}
// โหลด config ใหม่
$config = array();
if (is_file(CONFIG)) {
include CONFIG;
}
if (isset($_POST['intro']) && $_POST['intro'] == 1) {
// intro page
$config['show_intro'] = gcms::getVars($_POST, 'write_mode', 0);
} else {
// maintenance page
$config['maintenance_mode'] = gcms::getVars($_POST, 'write_mode', 0);
}
// save config
if (gcms::saveConfig(CONFIG, $config)) {
// อ่านไฟล์ภาษาใหม่
gcms::saveLanguage();
// คืนค่า
$ret['error'] = 'SAVE_COMPLETE';
$ret['location'] = 'reload';
} else {
$ret['error'] = 'DO_NOT_SAVE';
}
}
} else {
$ret['error'] = 'ACTION_ERROR';
}
// คืนค่าเป็น JSON
echo gcms::array2json($ret);
示例2: fwrite
$f = @fopen(ROOT_PATH . '.htaccess', 'wb');
if ($f) {
fwrite($f, implode("\n", $datas));
fclose($f);
}
echo '<li class=' . ($f ? 'correct' : 'incorrect') . '>Update file <b>.htaccess</b> ...</li>';
ob_flush();
flush();
$config = array();
include ROOT_PATH . 'bin/config.php';
// update config
$config['mimeTypes']['swf'] = 'application/x-shockwave-flash';
$config['mimeTypes']['gif'] = 'image/gif';
$config['mimeTypes']['jpg'] = 'image/jpeg';
$config['mimeTypes']['png'] = 'image/png';
// บันทึก config
gcms::saveConfig(ROOT_PATH . 'bin/config.php', $config);
echo '<li class=correct>Update <strong>config</strong> <i>complete...</i></li>';
ob_flush();
flush();
// บันทึกไฟล์ภาษา
gcms::saveLanguage();
echo '<li class=correct>Update <strong>languages</strong> <i>complete...</i></li>';
ob_flush();
flush();
// update tb_user
$db->query("ALTER TABLE `" . PREFIX . "_user` ADD `fb` TINYINT(1)UNSIGNED NOT NULL");
echo '<li class=correct>Update <strong>' . PREFIX . '_user</strong> <i> table complete...</i></li>';
ob_flush();
flush();
}