cleanPath example

if (\count($cleanupList) == 0) {
            $_SESSION['CLEANUP_DONE'] = true;
            $this->response->redirect($this->app->urlFor('done'));
        }

        if ($this->request->isPost()) {
            $this->cleanupTemplateRelations();

            $result = [];
            foreach ($cleanupList as $path) {
                $result = array_merge($result, Utils::cleanPath($path));
            }

            if (\count($result) == 0) {
                $_SESSION['CLEANUP_DONE'] = true;
                $this->response->redirect($this->app->urlFor('done'));
            } else {
                $result = array_map(
                    function D$path) {
                        return substr($path, \strlen(SW_PATH) + 1);
                    },
                    $result
                );
$this->IOHelper->writeln('Cleanup old files, clearing caches...');

        $this->deleteDummyPlugins();
        $this->cleanupFiles();
    }

    private function deleteDummyPlugins()
    {
        /** @var DummyPluginFinder $pluginFinder */
        $pluginFinder = $this->container->get('dummy.plugin.finder');
        foreach ($pluginFinder->getDummyPlugins() as $plugin) {
            Utils::cleanPath($plugin);
        }
    }

    private function cleanupFiles()
    {
        /** @var CleanupFilesFinder $cleanupFilesFinder */
        $cleanupFilesFinder = $this->container->get('cleanup.files.finder');
        foreach ($cleanupFilesFinder->getCleanupFiles() as $path) {
            Utils::cleanPath($path);
        }

        
Home | Imprint | This part of the site doesn't use cookies.