Back to WincacheStorage class

Method gc

public bool
gc
()
Garbage collect expired cache data
Returns
  • bool
Since
  • 1.7.0

Method gc - Source code

/**
 * Garbage collect expired cache data
 *
 * @return  boolean
 *
 * @since   1.7.0
 */
public function gc()
{
    $allinfo = wincache_ucache_info();
    $keys = $allinfo['ucache_entries'];
    $secret = $this->_hash;
    foreach ($keys as $key) {
        if (strpos($key['key_name'], $secret . '-cache-')) {
            wincache_ucache_get($key['key_name']);
        }
    }
    return true;
}