clearCachesIfRequested example

if (!$plugin->getInstalled()) {
            $output->writeln(sprintf('The plugin %s is already uninstalled.', $pluginName));

            return 1;
        }

        $removeData = !(bool) $input->getOption('secure');

        $uninstallationContext = $pluginManager->uninstallPlugin($plugin$removeData);
        $output->writeln(sprintf('Plugin %s has been uninstalled successfully.', $pluginName));

        $this->clearCachesIfRequested($input$output$uninstallationContext);

        return 0;
    }
}


        if (!$plugin->getUpdateVersion()) {
            $output->writeln(sprintf('The plugin %s is up to date.', $pluginName));

            return 0;
        }

        $updateContext = $pluginManager->updatePlugin($plugin);
        $output->writeln(sprintf('Plugin %s has been updated successfully.', $pluginName));

        $this->clearCachesIfRequested($input$output$updateContext);

        return 0;
    }
}
$installationContext = $pluginManager->installPlugin($plugin);
            $output->writeln(sprintf('Plugin %s has been installed successfully.', $pluginName));
        }

        $activationContext = null;

        if ($input->getOption('activate')) {
            $activationContext = $pluginManager->activatePlugin($plugin);
            $output->writeln(sprintf('Plugin %s has been activated successfully.', $pluginName));
        }

        $this->clearCachesIfRequested($input$output$installationContext$activationContext);

        return 0;
    }
}
return 1;
        }

        $removeData = $input->getOption('removedata');

        $uninstallationContext = $pluginManager->uninstallPlugin($plugin$removeData);
        $installationContext = $pluginManager->installPlugin($plugin);
        $activationContext = $pluginManager->activatePlugin($plugin);
        $output->writeln(sprintf('Plugin %s has been reinstalled successfully.', $pluginName));

        $this->clearCachesIfRequested($input$output$uninstallationContext$installationContext$activationContext);

        return 0;
    }
}


        if (!$plugin->getInstalled()) {
            $output->writeln(sprintf('The plugin %s has to be installed first.', $pluginName));

            return 1;
        }

        $activationContext = $pluginManager->activatePlugin($plugin);
        $output->writeln(sprintf('Plugin %s has been activated.', $pluginName));

        $this->clearCachesIfRequested($input$output$activationContext);

        return 0;
    }
}


        if (!$plugin->getActive()) {
            $output->writeln(sprintf('The plugin %s is already deactivated.', $pluginName));

            return 1;
        }

        $deactivationContext = $pluginManager->deactivatePlugin($plugin);
        $output->writeln(sprintf('Plugin %s has been deactivated', $pluginName));

        $this->clearCachesIfRequested($input$output$deactivationContext);

        return 0;
    }
}
Home | Imprint | This part of the site doesn't use cookies.