public function writeSetting($name, $value) { $this->defines->checkSetting($name); if ($this->defines->isFileSetting($name)) { $file = $this->lock(LOCK_EX); try { $this->file->forceReload(); $this->saveFileSetting($name, $value, $file); } catch (Exception $e) { $this->unlock($file); throw $e; } $this->unlock($file); return; } if (array_key_exists($name, $this->cache) && $this->cache[$name] == $value) { Gpf_Log::debug($this->_('Setting %s have the same value %s, no change needed - skipping', $name, $value)); return; } //store setting also to settings cache $this->cache[$name] = $value; $this->saveDbSetting($name, $value); }