mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 05:53:13 +00:00
Fix #1661 : Use bin/setup for plugin manipulation to avoid plugin failures
This commit is contained in:
@@ -76,6 +76,13 @@ class CLI extends Application
|
||||
$app->run();
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
$this['console']->setDispatcher($this['dispatcher']);
|
||||
}
|
||||
|
||||
public function run(\Symfony\Component\HttpFoundation\Request $request = null)
|
||||
{
|
||||
if (null !== $request) {
|
||||
|
@@ -30,6 +30,19 @@ abstract class AbstractPluginCommand extends Command
|
||||
return $manifests;
|
||||
}
|
||||
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if (basename($_SERVER['PHP_SELF']) === 'console') {
|
||||
$output->writeln("");
|
||||
$output->writeln(sprintf('<error> /!\ </error> <comment>Warning</comment>, this command is deprecated and will be removed as of Phraseanet 3.9, please use <info>bin/setup %s</info> instead <error> /!\ </error>', $this->getName()));
|
||||
$output->writeln("");
|
||||
}
|
||||
|
||||
return $this->doExecutePluginAction($input, $output);
|
||||
}
|
||||
|
||||
abstract protected function doExecutePluginAction(InputInterface $input, OutputInterface $output);
|
||||
|
||||
protected function updateConfigFiles(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$manifests = $this->validatePlugins($input, $output);
|
||||
|
@@ -26,7 +26,7 @@ class AddPlugin extends AbstractPluginCommand
|
||||
->addArgument('source', InputArgument::REQUIRED, 'The source is a folder');
|
||||
}
|
||||
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecutePluginAction(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$source = $input->getArgument('source');
|
||||
|
||||
|
@@ -27,7 +27,7 @@ class ListPlugin extends AbstractPluginCommand
|
||||
->addOption('json', 'j', InputOption::VALUE_NONE, 'Output result in JSON');
|
||||
}
|
||||
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecutePluginAction(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$plugins = array_map(function (Plugin $plugin) use ($input) {
|
||||
if ($plugin->isErroneous()) {
|
||||
|
@@ -26,7 +26,7 @@ class RemovePlugin extends AbstractPluginCommand
|
||||
->addArgument('name', InputArgument::REQUIRED, 'The name of the plugin');
|
||||
}
|
||||
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecutePluginAction(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$name = $input->getArgument('name');
|
||||
|
||||
|
Reference in New Issue
Block a user