Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 protected function update()
 {
     if (!isset($this->store)) {
         throw new NotOpenException(tr('Session already closed.'));
     }
     if (!$this->updated) {
         return;
     }
     $this->store->write($this->data);
     $this->updated = false;
 }
Beispiel #2
0
 /**
  * Close, save (if mutable), and unlock state data.
  *
  * @throws NotOpenException If the state has already been closed.
  */
 public function close()
 {
     if (!isset($this->store)) {
         throw new NotOpenException('State already closed.');
     }
     if ($this->updated and $this->store->isMutable()) {
         $this->store->write($this->data);
     }
     $this->store->close();
     $this->store = null;
     $this->updated = false;
 }
Beispiel #3
0
 /**
  * Save configuration. If this is not the root configuration, the root
  * configuration will be saved instead.
  * @return boolean True if the configuration was saved.
  */
 public function save()
 {
     if ($this->root !== $this) {
         return $this->root->save();
     }
     if (!isset($this->store)) {
         return false;
     }
     if (!$this->updated) {
         return true;
     }
     $this->store->open(true);
     $this->store->write($this->data);
     $this->store->close();
     $this->updated = false;
     return true;
 }