Deletes the cache record(s).

@param string  $key         Cache key name or pattern
@param boolean $prefix_mode Enable it to clear all keys starting
with prefix specified in $key
760926
private function remove_record($key=null, $prefix_mode=false)
    {
        if (!$this->db) {
            return;
        }

        if ($this->type != 'db') {
            $this->load_index();

            // Remove all keys
            if ($key === null) {
                foreach ($this->index as $key) {
                    $this->delete_record($this->ckey($key));
                }

                $this->index = array();
            }
            // Remove keys by name prefix
            else if ($prefix_mode) {
                foreach ($this->index as $idx => $k) {
                    if (strpos($k, $key) === 0) {
                        $this->delete_record($this->ckey($k));
                        unset($this->index[$idx]);
                    }
                }
            }
            // Remove one key by name
            else {
                $this->delete_record($this->ckey($key));
                if (($idx = array_search($key, $this->index)) !== false) {
                    unset($this->index[$idx]);
                }
            }

            $this->index_changed = true;

            return;
        }

        // Remove all keys (in specified cache)
        if ($key === null) {
            $where = " AND `cache_key` LIKE " . $this->db->quote($this->prefix.'.%');
        }
        // Remove keys by name prefix
        else if ($prefix_mode) {
            $where = " AND `cache_key` LIKE " . $this->db->quote($this->prefix.'.'.$key.'%');
        }
        // Remove one key by name
        else {
            $where = " AND `cache_key` = " . $this->db->quote($this->prefix.'.'.$key);
        }

        $this->db->query(
            "DELETE FROM {$this->table} WHERE `user_id` = ?" . $where,
            $this->userid);
    }
372468
public function forget($key)
    {
        $this->table()->where('key', '=', $this->prefix.$key)->delete();

        return true;
    }
1005555
public function delete($key) 
    {
        $this->stats['execTimes'] ++;
        unset($this->temp[$key]);
        
        $file = $this->getCachePath($key);
        
        clearstatcache();
        if(is_file($file)) {
            $this->waitUnlock($key);
            $this->lock($key);
            @unlink($file);
            $this->unlock($key);
        }
    }
531153
public function delete($key)
	{
		$this->validateKey($key);
		$this->namespace && $this->prefixValue($key);

		return $this->doDelete($key);
	}
1328528
function clearModule(CacheKey $key) {

		if (isset ( $this->elements [$key->getModule()] )) {
			unset ( $this->elements [$key->getModule()] );
			$this->changed = true;
		}

	}
913826
public function clear(CacheKey $key) {
		if (isset ( $this->elements [$key->getModule()] [$key->getProperty()] )) {
			unset ( $this->elements [$key->getModule()] [$key->getProperty()] );
			$this->changed = true;
		}
	}
70446
public function delete(string $key, string $hash = '')
    {
        if (!$key && $hash) {
            $wp_using_ext_object_cache            = wp_using_ext_object_cache(false);
            $key                                  = $this->hashToKey($hash);
            $do_restore_wp_using_ext_object_cache = true; // See below.
        }
        if ($this->App->Config->§specs['§is_network_wide'] && $this->Wp->is_multisite) {
            delete_site_transient($this->App->Config->©brand['©var'].'_'.$key);
        } else {
            delete_transient($this->App->Config->©brand['©var'].'_'.$key);
        }
        if (!empty($do_restore_wp_using_ext_object_cache)) {
            wp_using_ext_object_cache($wp_using_ext_object_cache);
        }
    }
772277
public function forget(string $key)
    {
        $cacheKey = $this->cacheKeys[$key] ?? null;
        if (!empty($cacheKey)) {
            Cache::forget($cacheKey);
        }
    }
163757
def delete(key)
      deleted = @store.delete(key)
      @on_write_failure.call(key) if !deleted && @on_write_failure
      RecordCache::Base.logger.debug{ "Version Store: deleted #{key}" }
      deleted
    end
293802
public static function delete($key)
    {
        empty(self::$prefix) && self::$prefix = Config::get('session_prefix');
        if (is_array($key)) {
            foreach ($key as $k) {
                if (isset($_SESSION[self::$prefix . $k])) unset($_SESSION[self::$prefix . $k]);
            }
        } else {
            if (isset($_SESSION[self::$prefix . $key])) unset($_SESSION[self::$prefix . $key]);
        }
        return true;
    }
311734
public function delete($key)
    {
        if ($this->redis->hDel($this->prefix, $key) > 0) {
            return true;
        }
        return false;
    }
903439
public function delete( $key )
    {
        $cache_file = new File($key.self::CACHE_FILE_EXT, $this->config->getCacheRoot());
        
        if (!$cache_file->exists()) {
            throw( new CacheFileNotFoundException($cache_file) );
        }
        $cache_file->delete();
    }
882330
public function deleteFromList($key_array = array())
    {

        if (empty($key_array)) return false;

        foreach ($key_array as $key_del) {
            if (empty($this->cacheListing)) break;
            foreach ($this->cacheListing as $key) {
                if (mb_strpos(mb_strtolower($key), mb_strtolower($key_del)) !== false) $this->delete($key);
            }
        }

        return true;
    }
1145327
public function forget($key)
    {
        $this->database->table($this->config['db_table'])->where('setting_key', $key)->delete();
        $this->cache->forget($key);
    }
194659
public function delete($key): bool
    {
        if ($this->enabled) {
            $realKey = $this->adjustKey($key);
            return $this->cacheDelete($realKey);
        }
        return false;
    }
409336
public static function delete( $key ) {

		if ( isset( self::$config[ strtolower( $key ) ] ) ) {
			unset( self::$config[ strtolower( $key ) ] );
		}

	}
1170278
public function clear_cache($item, $mode): self
  {
    $cache_name = $this->_cache_name($item, $mode);
    if ( $this->cache_has($cache_name) ){
      $this->cache_delete($cache_name);
    }
    return $this;
  }