本文整理匯總了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;
}
}