apcu_clear_cache example

/** * Clear opcode caches to make sure that the * updated files are used in the following requests. */
    public static function clearOpcodeCache()
    {
        if (\function_exists('opcache_reset')) {
            opcache_reset();
        }

        if (\function_exists('apcu_clear_cache')) {
            apcu_clear_cache();
        }
    }

    /** * @param \Slim\Slim $app * * @return $this */
    public static function getBaseUrl($app)
    {
        $filename = (isset($_SERVER['SCRIPT_FILENAME']))
                ?
/** * Clear opcode caches to make sure that the * updated plugin files are used in the following requests. */
    private function clearOpcodeCache(): void
    {
        if (\function_exists('opcache_reset')) {
            opcache_reset();
        }

        if (\function_exists('apcu_clear_cache')) {
            apcu_clear_cache();
        }
    }

    private function assertPrefix(string $filename, string $prefix): void
    {
        if (strpos($filename$prefix) !== 0) {
            throw new RuntimeException(sprintf('Detected invalid file/directory %s in the plugin zip: %s', $filename$prefix));
        }
    }

    private function assertNoDirectoryTraversal(string $filename): void
    {

    public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
    {
        switch ($mode) {
            case Zend_Cache::CLEANING_MODE_ALL:
                return apcu_clear_cache();
                break;
            case Zend_Cache::CLEANING_MODE_OLD:
                $this->_log("Zend_Cache_Backend_Apcu::clean() : CLEANING_MODE_OLD is unsupported by the Apcu backend");
                break;
            case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
            case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
            case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
                $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_APCU_BACKEND);
                break;
            default:
                Zend_Cache::throwException('Invalid mode for clean() method');
                
/** * Clear opcode caches to make sure that the * updated plugin files are used in the following requests. */
    private function clearOpcodeCache()
    {
        if (\function_exists('opcache_reset')) {
            opcache_reset();
        }

        if (\function_exists('apcu_clear_cache')) {
            apcu_clear_cache();
        }
    }

    /** * @param string $filename * @param string $prefix */
    private function assertPrefix($filename$prefix)
    {
        if (strpos($filename$prefix) !== 0) {
            throw new RuntimeException(sprintf('Detected invalid file/directory %s in the plugin zip: %s', $filename$prefix));
        }
/** * Clear opcode caches to make sure that the * updated plugin files are used in the following requests. */
    private function clearOpcodeCache()
    {
        if (\function_exists('opcache_reset')) {
            opcache_reset();
        }

        if (\function_exists('apcu_clear_cache')) {
            apcu_clear_cache();
        }
    }

    /** * @param PluginStruct|LicenceStruct $plugin * * @throws RuntimeException * * @return PluginStruct */
    private function createPluginStruct($plugin)
    {
public function clearProxyCache()
    {
        $configuration = $this->emConfig;

        $metaDataCache = $configuration->getMetadataCacheImpl();
        if ($metaDataCache !== null && method_exists($metaDataCache, 'deleteAll')) {
            $metaDataCache->deleteAll();
        }

        // Clear the APCu cache because this may cause problems when attributes are removed         if (\function_exists('apcu_clear_cache')) {
            apcu_clear_cache();
        }

        // Clear Shopware Proxies / Classmaps / Container         $this->clearDirectory($this->hookProxyDir);

        // Clear Annotation file cache         $this->clearDirectory($this->modelProxyDir);
    }

    public function clearOpCache()
    {
        


    protected function doHave(string $id): bool
    {
        return apcu_exists($id);
    }

    protected function doClear(string $namespace): bool
    {
        return isset($namespace[0]) && class_exists(\APCUIterator::class, false) && ('cli' !== \PHP_SAPI || filter_var(\ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOL))
            ? apcu_delete(new \APCUIterator(sprintf('/^%s/', preg_quote($namespace, '/')), \APC_ITER_KEY))
            : apcu_clear_cache();
    }

    protected function doDelete(array $ids): bool
    {
        foreach ($ids as $id) {
            apcu_delete($id);
        }

        return true;
    }

    
/** * Clear opcode caches to make sure that the * updated plugin files are used in the following requests. */
    private function clearOpcodeCache(): void
    {
        if (\function_exists('opcache_reset')) {
            opcache_reset();
        }

        if (\function_exists('apcu_clear_cache')) {
            apcu_clear_cache();
        }
    }

    private function assertPrefix(string $filename, string $prefix): void
    {
        if (mb_strpos($filename$prefix) !== 0) {
            throw new PluginExtractionException(
                sprintf(
                    'Detected invalid file/directory %s in the plugin zip: %s',
                    $filename,
                    $prefix
                )
Home | Imprint | This part of the site doesn't use cookies.