Remove key from cache file

@param string $key
@return mixed
196615
public function remove(string $key)
  {
    $file = $this->file;

    if (file_exists($file)) {
      $data = unserialize($this->decrypt(file_get_contents($file)));

      if (is_array($data) && isset($data[$key])) {
        unset($data[$key]);
        $data = $this->encrypt(serialize($data));
        return file_put_contents($file, $data);
      }
    }

    return false;
  }
229080
public function delete($key){
        $this->connection->where('keyCache = :key', array('key' => $key));
        return $this->connection->delete($this->table);
    }
1103233
public static function forget($key)
    {
        $path = Cache::path($key);

        if (file_exists($path)) {
            return unlink($path);
        }

        return false;
    }
1039272
private function deleteFile($key)
    {
        $file = $this->findFile($key);
        if ($file === false) {
            return false; // error
        }

        if ($file === 0) {
            return true; // nothing found
        }

        return unlink($file);
    }
354388
public function remove($key)
    {
        $this->initializeOnDemand();

        if ($this->has($key) && $this->cacheMapper->delete($key)) {
            unset($this->cache[$key]);
            return true;
        } else {
            return false;
        }
    }
210115
public function removeKey($key)
    {
        if (is_array($key))
        {
            $keyString = "(" . implode(',', $key) . ")";
        }
        else
        {
            $keyString = "`" . $key . "`";
        }
        
        $query = 
            "ALTER TABLE " . 
            '`' . $this->m_name . '` ' . 
            "DROP INDEX " . $keyString;
        
        $result = $this->m_mysqliConn->query($query);
        return $result;
    }
965554
public static function removeFromCache($key)
    {
        $fullKey = static::makeCacheKey($key);
        if (!Cache::forget($fullKey)) {
            return false;
        }

        static::removeKeys($key);

        return true;
    }
340242
public function remove($key)
    {
        $file=$this->getCacheDir().$key;
        if(file_exists($file))
            unlink($file);
    }
671797
public function delete($key = '')
    {
        try {
            if ($this->cacheInstance !== NULL && is_object($this->cacheInstance)) {
                /**
                 * @var $cache object
                 */
                if (is_array($key)) {
                    $result = $this->cacheInstance->deleteItems($key);
                } else {
                    $result = $this->cacheInstance->deleteItem($key);
                }
                $message = 'Final Delete Content from Key: ' . $key . ' => Output result: ' . json_encode($result);
                $this->debug->info(__FUNCTION__, $message);

                return $result;
            } else {
                $this->debug->error(__FUNCTION__, 'Unavailable cacheInstance');

                return NULL;
            }
        }
        catch (\Exception $e) {
            $message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            $this->debug->error(__FUNCTION__, $message);

            return $message;
        }
    }
334379
public static function getAndRemove(string $key)
    {
        static::startSessionIfNotHasStartedForceWrite();

        $value = static::get($key);
        static::remove($key);

        return $value;
    }
869400
public function remove($key){
        return ($this->memcache) ? $this->memcache->remove($this->prefix . '_' . $key) : false;
    }
740863
public function forget($key)
	{
		$key = $this->id($key);
		return $this->apcu ? apcu_delete($key) : apc_delete($key);
	}
1191341
public static function forget($key)
    {
        $filename = static::makeHashFilename($key);

        if (!file_exists($filename)) {
            return false;
        }

        $r = (bool) @unlink($filename);

        $parts = explode('/', $filename);

        array_pop($parts);

        $dirname = implode('/', $parts);

        if (is_dir($dirname)) {
            @rmdir($dirname);
        }

        return $r;
    }
956751
public function remove($key)
    {
        //~ Check if enabled
        if (!$this->isEnabled()) {
            return false;
        }

        $file = $this->directory . substr(md5($key), 0, 10) . '.dat';
        if (!file_exists($file)) {
            return false;
        }

        unlink($file);
        unset($this->cache[$key]);
        $this->save();

        return true;
    }
565663
public function remove($key)
    {
        $key = is_array($key) ? $key : [$key];
        $config = $this->data;
        $data = &$config;
        while ($key) {
            $k = array_shift($key);
            if (!$key) {
                unset($config[$k]);
                break;
            }
            $config[$k] = isset($config[$k]) ? $config[$k] : [];
            $config = &$config[$k];
        }
        $this->data = $data;
        return $this->save();
    }
397639
public function getAndRemove(string $key)
	{
		$storedValue = $this->get($key);

		if($storedValue !== false)
		{
			$this->remove($key);
		}

		return $storedValue;
	}
607052
public function deleteHasCache($key)
    {
        if ($this->isCachable()) {
            return Yii::$app->cache->delete($key);
        }
        
        return false;
    }