mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
Fix #1661 : Use bin/setup for plugin manipulation to avoid plugin failures
This commit is contained in:
@@ -20,6 +20,9 @@ use Alchemy\Phrasea\Core\Version;
|
|||||||
use Alchemy\Phrasea\Command\UpgradeDBDatas;
|
use Alchemy\Phrasea\Command\UpgradeDBDatas;
|
||||||
use Alchemy\Phrasea\Command\Setup\Install;
|
use Alchemy\Phrasea\Command\Setup\Install;
|
||||||
use Alchemy\Phrasea\Command\Setup\PluginsReset;
|
use Alchemy\Phrasea\Command\Setup\PluginsReset;
|
||||||
|
use Alchemy\Phrasea\Command\Plugin\ListPlugin;
|
||||||
|
use Alchemy\Phrasea\Command\Plugin\AddPlugin;
|
||||||
|
use Alchemy\Phrasea\Command\Plugin\RemovePlugin;
|
||||||
use Alchemy\Phrasea\CLI;
|
use Alchemy\Phrasea\CLI;
|
||||||
use Alchemy\Phrasea\Command\Setup\CheckEnvironment;
|
use Alchemy\Phrasea\Command\Setup\CheckEnvironment;
|
||||||
|
|
||||||
@@ -60,6 +63,9 @@ if ($app['phraseanet.configuration-tester']->isInstalled()) {
|
|||||||
$app->command(new UpgradeDBDatas('system:upgrade-datas'));
|
$app->command(new UpgradeDBDatas('system:upgrade-datas'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$app->command(new AddPlugin());
|
||||||
|
$app->command(new ListPlugin());
|
||||||
|
$app->command(new RemovePlugin());
|
||||||
$app->command(new PluginsReset());
|
$app->command(new PluginsReset());
|
||||||
$app->command(new CheckEnvironment('check:system'));
|
$app->command(new CheckEnvironment('check:system'));
|
||||||
$app->command(new Install('system:install'));
|
$app->command(new Install('system:install'));
|
||||||
|
@@ -76,6 +76,13 @@ class CLI extends Application
|
|||||||
$app->run();
|
$app->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
|
||||||
|
$this['console']->setDispatcher($this['dispatcher']);
|
||||||
|
}
|
||||||
|
|
||||||
public function run(\Symfony\Component\HttpFoundation\Request $request = null)
|
public function run(\Symfony\Component\HttpFoundation\Request $request = null)
|
||||||
{
|
{
|
||||||
if (null !== $request) {
|
if (null !== $request) {
|
||||||
|
@@ -30,6 +30,19 @@ abstract class AbstractPluginCommand extends Command
|
|||||||
return $manifests;
|
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)
|
protected function updateConfigFiles(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$manifests = $this->validatePlugins($input, $output);
|
$manifests = $this->validatePlugins($input, $output);
|
||||||
|
@@ -26,7 +26,7 @@ class AddPlugin extends AbstractPluginCommand
|
|||||||
->addArgument('source', InputArgument::REQUIRED, 'The source is a folder');
|
->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');
|
$source = $input->getArgument('source');
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@ class ListPlugin extends AbstractPluginCommand
|
|||||||
->addOption('json', 'j', InputOption::VALUE_NONE, 'Output result in JSON');
|
->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) {
|
$plugins = array_map(function (Plugin $plugin) use ($input) {
|
||||||
if ($plugin->isErroneous()) {
|
if ($plugin->isErroneous()) {
|
||||||
|
@@ -26,7 +26,7 @@ class RemovePlugin extends AbstractPluginCommand
|
|||||||
->addArgument('name', InputArgument::REQUIRED, 'The name of the plugin');
|
->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');
|
$name = $input->getArgument('name');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user