本文整理汇总了PHP中config::saveConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP config::saveConfig方法的具体用法?PHP config::saveConfig怎么用?PHP config::saveConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config
的用法示例。
在下文中一共展示了config::saveConfig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveConfig
/**
* Init config of the module
*/
public function saveConfig()
{
$configObj = new \config(PROFILE_PATH . '/' . $this->name . '/config.php', TRUE);
$config = array();
include $this->name . '/config.php';
$config = array_intersect_key(\app::$config, $config);
$configObj->saveConfig($config);
}
示例2: saveConfigAction
/**
* Save configuration in the file
* @param string $file
* @param string $config
* @return string
*/
protected function saveConfigAction($file, $config)
{
$configObj = new \config($file, TRUE);
$action = 'ParsimonyAdmin.loadBlock(\'modules\');';
if ($_SESSION['permissions'] & 2) {
if (isset($config['sitename']) && $config['sitename'] != \app::$config['sitename']) {
$action = 'top.window.location.reload()';
}
} else {
if (isset($config['sitename']) && $config['sitename'] != \app::$config['sitename']) {
$action = 'top.window.location.reload()';
}
$config = array('sitename' => $config['sitename']);
}
$configObj->saveConfig($config);
return $this->returnResult(array('eval' => $action, 'notification' => t('The Config has been saved'), 'notificationType' => 'positive'));
}
示例3: determineLocale
/**
* Detetermine Locale from current HTTP request
*/
protected function determineLocale()
{
if (isset($_COOKIE['locale']) && isset(self::$locales[$_COOKIE['locale']])) {
$this->locale = $_COOKIE['locale'];
} else {
$this->locale = app::$config['localization']['default_language'];
}
setlocale(LC_ALL, $this->locale);
date_default_timezone_set(app::$config['localization']['timezone']);
$pathCache = 'var/cache/' . $this->locale . '-lang';
$lang = '';
if (is_file($pathCache . '.php')) {
include $pathCache . '.php';
} else {
foreach (app::$activeModules as $moduleName => $type) {
if (is_file('modules/' . $moduleName . '/locale/' . $this->locale . '.php')) {
include 'modules/' . $moduleName . '/locale/' . $this->locale . '.php';
}
}
$config = new \config($pathCache . '.php', TRUE);
$config->setVariable('lang');
$config->saveConfig($lang);
\tools::file_put_contents($pathCache . '.js', substr($config->getContent(), 5, false));
}
app::$lang = $lang;
}