Example #1
0
 /**
  * Removes a stored option.
  *
  * @param  string $name The name of the option to be removed.
  * @throws \InvalidArgumentException
  */
 public function remove($name)
 {
     $name = trim($name);
     if (in_array($name, $this->protected)) {
         throw new \InvalidArgumentException(sprintf('"%s" is a protected option and may not be modified.', $name));
     }
     if (!$this->connection->isConnected()) {
         throw new \RuntimeException('Database is not connected.');
     }
     $this->initialize(true);
     if ($this->connection->delete($this->table, ['name' => $name])) {
         unset($this->options[$name]);
         $this->cache->delete($this->prefix . (isset($this->autoload[$name]) ? 'Autoload' : $name));
     }
 }
Example #2
0
 /**
  * Clears the cache.
  */
 public function clearCache()
 {
     $this->cache->delete($this->cacheKey);
     $this->cacheEntries = false;
 }