function clear($key) {
		// Normalize array literal
		$cache=Cache::instance();
		$parts=$this->cut($key);
		if ($key=='CACHE')
			// Clear cache contents
			$cache->reset();
		elseif (preg_match('/^(GET|POST|COOKIE)\b(.+)/',$key,$expr)) {
			$this->clear('REQUEST'.$expr[2]);
			if ($expr[1]=='COOKIE') {
				$parts=$this->cut($key);
				$jar=$this->hive['JAR'];
				unset($jar['lifetime']);
				$jar['expire']=0;
				call_user_func_array('setcookie',
					array_merge([$parts[1],NULL],$jar));
				unset($_COOKIE[$parts[1]]);
			}
		}
		elseif ($parts[0]=='SESSION') {
			if (!headers_sent() && session_status()!=PHP_SESSION_ACTIVE)
				session_start();
			if (empty($parts[1])) {
				// End session
				session_unset();
				session_destroy();
				$this->clear('COOKIE.'.session_name());
			}
			$this->sync('SESSION');
		}
		if (!isset($parts[1]) && array_key_exists($parts[0],$this->init))
			// Reset global to default value
			$this->hive[$parts[0]]=$this->init[$parts[0]];
		else {
			eval('unset('.$this->compile('@this->hive.'.$key).');');
			if ($parts[0]=='SESSION') {
				session_commit();
				session_start();
			}
			if ($cache->exists($hash=$this->hash($key).'.var'))
				// Remove from cache
				$cache->clear($hash);
		}
	}
function clear($key) {
		// Normalize array literal
		$cache=Cache::instance();
		$parts=$this->cut($key);
		if ($key=='CACHE')
			// Clear cache contents
			$cache->reset();
		elseif (preg_match('/^(GET|POST|COOKIE)\b(.+)/',$key,$expr)) {
			$this->clear('REQUEST'.$expr[2]);
			if ($expr[1]=='COOKIE') {
				$parts=$this->cut($key);
				$jar=$this->hive['JAR'];
				unset($jar['lifetime']);
				$jar['expire']=0;
				call_user_func_array('setcookie',
					array_merge([$parts[1],NULL],$jar));
				unset($_COOKIE[$parts[1]]);
			}
		}
		elseif ($parts[0]=='SESSION') {
			if (!headers_sent() && session_status()!=PHP_SESSION_ACTIVE)
				session_start();
			if (empty($parts[1])) {
				// End session
				session_unset();
				session_destroy();
				$this->clear('COOKIE.'.session_name());
			}
			$this->sync('SESSION');
		}
		if (!isset($parts[1]) && array_key_exists($parts[0],$this->init))
			// Reset global to default value
			$this->hive[$parts[0]]=$this->init[$parts[0]];
		else {
			eval('unset('.$this->compile('@this->hive.'.$key).');');
			if ($parts[0]=='SESSION') {
				session_commit();
				session_start();
			}
			if ($cache->exists($hash=$this->hash($key).'.var'))
				// Remove from cache
				$cache->clear($hash);
		}
	}
function clear ( $ key ) { // Normalize array literal $ cache = Cache :: instance ( ) ; $ parts = $ this -> cut ( $ key ) ; if ( $ key == 'CACHE' ) // Clear cache contents $ cache -> reset ( ) ; elseif ( preg_match ( '/^(GET|POST|COOKIE)\b(.+)/' , $ key , $ expr ) ) { $ this -> clear ( 'REQUEST' . $ expr [ 2 ] ) ; if ( $ expr [ 1 ] == 'COOKIE' ) { $ parts = $ this -> cut ( $ key ) ; $ jar = $ this -> hive [ 'JAR' ] ; unset ( $ jar [ 'lifetime' ] ) ; $ jar [ 'expire' ] = 0 ; call_user_func_array ( 'setcookie' , array_merge ( [ $ parts [ 1 ] , NULL ] , $ jar ) ) ; unset ( $ _COOKIE [ $ parts [ 1 ] ] ) ; } } elseif ( $ parts [ 0 ] == 'SESSION' ) { if ( ! headers_sent ( ) && session_status ( ) != PHP_SESSION_ACTIVE ) session_start ( ) ; if ( empty ( $ parts [ 1 ] ) ) { // End session session_unset ( ) ; session_destroy ( ) ; $ this -> clear ( 'COOKIE.' . session_name ( ) ) ; } $ this -> sync ( 'SESSION' ) ; } if ( ! isset ( $ parts [ 1 ] ) && array_key_exists ( $ parts [ 0 ] , $ this -> init ) ) // Reset global to default value $ this -> hive [ $ parts [ 0 ] ] = $ this -> init [ $ parts [ 0 ] ] ; else { eval ( 'unset(' . $ this -> compile ( '@this->hive.' . $ key ) . ');' ) ; if ( $ parts [ 0 ] == 'SESSION' ) { session_commit ( ) ; session_start ( ) ; } if ( $ cache -> exists ( $ hash = $ this -> hash ( $ key ) . '.var' ) ) // Remove from cache $ cache -> clear ( $ hash ) ; } }
Unset hive key
@param $key string
Unset hive key