本文整理汇总了PHP中CASHSystem::findReplaceInFile方法的典型用法代码示例。如果您正苦于以下问题:PHP CASHSystem::findReplaceInFile方法的具体用法?PHP CASHSystem::findReplaceInFile怎么用?PHP CASHSystem::findReplaceInFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASHSystem
的用法示例。
在下文中一共展示了CASHSystem::findReplaceInFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setSystemSetting
public static function setSystemSetting($setting_name = false, $value = '')
{
if ($setting_name) {
$cash_settings = parse_ini_file(CASH_PLATFORM_ROOT . '/settings/cashmusic.ini.php');
if (array_key_exists($setting_name, $cash_settings)) {
$success = CASHSystem::findReplaceInFile(CASH_PLATFORM_ROOT . '/settings/cashmusic.ini.php', $setting_name . ' = "' . $cash_settings[$setting_name], $setting_name . ' = "' . $value);
} else {
return false;
}
} else {
return false;
}
}
示例2: setSystemSetting
public static function setSystemSetting($setting_name = false, $value = '')
{
if ($setting_name) {
$cash_settings = CASHSystem::getSystemSettings();
// if ($cash_settings['instancetype'] != 'multi') { --- DISABLED SINGLE-USER ONLY BECAUSE WHY?
if (array_key_exists($setting_name, $cash_settings)) {
$success = CASHSystem::findReplaceInFile(CASH_PLATFORM_ROOT . '/settings/cashmusic.ini.php', $setting_name . ' = "' . $cash_settings[$setting_name], $setting_name . ' = "' . $value);
if ($success) {
$cash_settings[$setting_name] = $value;
$json_settings = json_encode($cash_settings);
putenv("cashmusic_platform_settings={$json_settings}");
return true;
}
}
//}
return false;
} else {
return false;
}
}