예제 #1
0
파일: CASHSystem.php 프로젝트: nodots/DIY
 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
0
 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;
     }
 }