function clear($prefix_ = null) { if (null === $prefix_) { $prefix_ = COMPONENTS_CACHE_NAMESPACE; } else { $prefix_ = COMPONENTS_CACHE_NAMESPACE . "-{$prefix_}"; } $GLOBALS['libstd/cache'] = []; apc_delete(new \APCIterator('user', "/^{$prefix_}*/", APC_ITER_KEY)); if (function_exists('opcache_invalidate')) { $invalidate = function ($path_) { opcache_invalidate($path_, true); }; // FIXME Only if containerized. \io\pathApplyFiltered('/', '/\\.php$/', $invalidate); // \io\pathApplyFiltered(\Components\Environment::pathApplication(), '/\.php$/', $invalidate); // \io\pathApplyFiltered(\Components\Environment::pathComponents(), '/\.php$/', $invalidate); } else { if (function_exists('opcache_reset')) { opcache_reset(); } } }
/** * @see \Components\Cache_Backend::clear() clear */ public function clear($prefix_ = null) { if (null === $prefix_) { $prefix_ = COMPONENTS_CACHE_NAMESPACE; } else { $prefix_ = COMPONENTS_CACHE_NAMESPACE . "-{$prefix_}"; } apc_delete(new \APCIterator('user', "/^{$prefix_}*/", APC_ITER_KEY)); // FIXME Implement cache/backend/opcache or separate into opcache/zend & opcache/apc in independent of cache/backend/* userland caches. if (function_exists('opcache_invalidate')) { $invalidate = function ($path_) { opcache_invalidate($path_, true); }; // FIXME Only if containerized. \io\pathApplyFiltered('/', '/\\.php$/', $invalidate); // \io\pathApplyFiltered(\Components\Environment::pathApplication(), '/\.php$/', $invalidate); // \io\pathApplyFiltered(\Components\Environment::pathComponents(), '/\.php$/', $invalidate); } else { if (function_exists('opcache_reset')) { opcache_reset(); } } }