clearOpcodeCache example

foreach ($systemCheckPathResults as $value) {
            if (!$value['result']) {
                $hasErrors = true;
            }
        }

        $directoriesToDelete = [
            'engine/Library/Mpdf/tmp' => false,
            'engine/Library/Mpdf/ttfontdata' => false,
        ];

        CommonUtils::clearOpcodeCache();

        $results = [];
        foreach ($directoriesToDelete as $directory => $deleteDirecory) {
            $result = true;
            $filePath = SW_PATH . '/' . $directory;

            Utils::deleteDir($filePath$deleteDirecory);
            if ($deleteDirecory && is_dir($filePath)) {
                $result = false;
                $hasErrors = true;
            }

            


            if ($delete) {
                unlink($archive->filename);
            }
        } catch (\Exception $e) {
            $this->filesystem->rename($backupFile$oldFile);

            throw $e;
        }

        $this->clearOpcodeCache();

        $archive->close();
    }

    /** * Iterates all files of the provided zip archive * path and validates the plugin namespace, directory traversal * and multiple plugin directories. */
    private function validatePluginZip(string $prefix, \ZipArchive $archive): void
    {
        
default:
                    $this->handleLicenceInstall($plugin$domain$version$token);
                    break;
            }
        } catch (Exception $e) {
            $io->error('An error occured: ' . $e->getMessage());
            exit(1);
        }

        try {
            $this->clearOpcodeCache();
            $this->container->get(InstallerService::class)->refreshPluginList();

            $this->io->success('Process completed successfully.');
        } catch (Exception $e) {
        }

        return 0;
    }

    /** * @param string $domain * @param string $version * * @throws Exception */

    public function extract($archive$destination)
    {
        if (!is_writable($destination)) {
            throw new Exception(sprintf('Destination directory "%s" is not writable', $destination));
        }

        $this->validatePluginZip($archive);

        $archive->extractTo($destination);

        $this->clearOpcodeCache();
    }

    /** * Iterates all files of the provided zip archive * path and validates the plugin namespace, directory traversal * and multiple plugin directories. * * @throws Exception */
    private function validatePluginZip(ZipArchive $archive)
    {
        
$this->toJson(200, $this->resultMapper->toExtJs($result));
    }

    /** * @throws RuntimeException */
    public function unpack()
    {
        // Manual updates do not contain files to overwrite         if (UPDATE_IS_MANUAL) {
            Utils::clearOpcodeCache();
            $this->toJson(200, $this->resultMapper->toExtJs(new FinishResult(0, 0)));

            return;
        }

        $offset = $this->request->get('offset');
        $total = $this->request->get('total');

        /** @var FilesystemFactory $factory */
        $factory = $this->container->get('filesystem.factory');

        
$this->filesystem->remove($backupFile);
            }

            unlink($archive->filename);
        } catch (Exception $e) {
            if ($oldFile !== false) {
                $this->filesystem->rename($backupFile$oldFile);
            }
            throw $e;
        }

        $this->clearOpcodeCache();
    }

    /** * Iterates all files of the provided zip archive * path and validates the plugin namespace, directory traversal * and multiple plugin directories. */
    private function validatePluginZip(string $prefix, ZipArchive $archive): void
    {
        for ($i = 2; $i < $archive->numFiles; ++$i) {
            $stat = $archive->statIndex($i);
            
Home | Imprint | This part of the site doesn't use cookies.