Exemplo n.º 1
0
 /**
  * Remove a certain key/path from the cookie. Returns true if successful, else if failure.
  *
  * @access public
  * @param string $key
  * @param array $meta
  * @return boolean
  */
 public function remove($key, array $meta = array())
 {
     if (!empty($key)) {
         $paths = explode('.', $key);
         $index = array_shift($paths);
         if (isset($_COOKIE[$this->namespace][$index])) {
             $cookie = $this->__decrypt($_COOKIE[$this->namespace][$index]);
             $cookie = Set::remove($cookie, implode('.', $paths));
             return $this->set($index, $cookie, $meta);
         }
     }
     return false;
 }
Exemplo n.º 2
0
 /**
  * Remove a certain key/path from the session.
  *
  * @access public
  * @param string $key
  * @return boolean
  */
 public function remove($key)
 {
     $_SESSION = Set::remove($_SESSION, $key);
 }
Exemplo n.º 3
0
 /**
  * Delete an object from registry and remove its name from the mapping.
  * Returns true if object exists and was deleted, else returns false.
  *
  * @access public
  * @param string $slug
  * @return boolean
  * @static
  */
 public static function delete($slug)
 {
     if (isset(static::$__registered[$slug])) {
         unset(static::$__registered[$slug]);
         static::$__mapping = Set::remove(static::$__mapping, $slug);
         return true;
     }
     return false;
 }