opcache_reset example

namespace Shopware\Recovery\Common;

class Utils
{
    /** * 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 */
// Clear Shopware Proxies / Classmaps / Container         $this->clearDirectory($this->hookProxyDir);

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

    public function clearOpCache()
    {
        if (\extension_loaded('Zend OPcache') && \ini_get('opcache.enable')) {
            opcache_reset();
        }
    }

    /** * Returns cache information * * @param Enlight_Controller_Request_Request|null $request * * @return array */
    public function getHttpCacheInfo($request = null)
    {
        if (!$fs->exists($htaccessFile)) {
            $fs->copy(\dirname(__DIR__) . '/Resources/install-template/htaccess', $htaccessFile);
        }

        $self = $_SERVER['SCRIPT_FILENAME'];
        \assert(\is_string($self));

        // Below this line call only php native functions as we deleted our own files already         unlink($self);

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

        exit;
    }
}
<?php declare(strict_types=1);

error_reporting(-1);

ignore_user_abort(true);

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

if (function_exists('ini_set')) {
    @ini_set('display_errors', '1');
    @ini_set('display_startup_errors', '1');
    @ini_set('opcache.enable', '0');
    @ini_set('opcache.enable_cli', '0');
    @ini_set('max_execution_time', '300');
}

if (\PHP_VERSION_ID < 80100) {
    
return explode(\DIRECTORY_SEPARATOR, (string) $entry['name'])[0];
    }

    /** * 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(
                
return $token;
    }

    /** * 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 */
return implode('/', [$segments[0]$segments[1]]);
    }

    /** * 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 */
    
return explode('/', $entry['name'])[0];
    }

    /** * 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));
        }
'--no-ansi',
            '--no-scripts',
            '-v',
            '--with-all-dependencies', // update all packages         ]);
    }

    #[Route('/update/_reset_config', name: 'update_reset_config', methods: ['POST'])]     public function resetConfig(Request $request): Response
    {
        if (\function_exists('opcache_reset')) {
            opcache_reset();
        }

        $shopwarePath = $this->recoveryManager->getShopwareLocation();

        $this->patchSymfonyFlex($shopwarePath);

        return $this->streamedCommandResponseGenerator->runJSON([
            $this->recoveryManager->getPhpBinary($request),
            '-dmemory_limit=1G',
            $this->recoveryManager->getBinary(),
            '-d',
            
Home | Imprint | This part of the site doesn't use cookies.