mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 10:34:34 +00:00
Update bin/console to bin/setup
This commit is contained in:
7
lib/Alchemy/Phrasea/Command/Plugin/DisablePlugin.php
Normal file
7
lib/Alchemy/Phrasea/Command/Plugin/DisablePlugin.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: romain
|
||||
* Date: 21/02/2014
|
||||
* Time: 16:00
|
||||
*/
|
50
lib/Alchemy/Phrasea/Command/Plugin/EnablePlugin.php
Normal file
50
lib/Alchemy/Phrasea/Command/Plugin/EnablePlugin.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Command\Plugin;
|
||||
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class EnablePlugin extends AbstractPluginCommand
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('plugins:enable');
|
||||
|
||||
$this->setDescription('Enables a plugin')
|
||||
->addArgument('name', InputArgument::REQUIRED, 'The name of the plugin');
|
||||
}
|
||||
|
||||
protected function doExecutePluginAction(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$name = $input->getArgument('name');
|
||||
|
||||
if (!$this->container['plugins.manager']->hasPlugin($name)) {
|
||||
$output->writeln(sprintf('There is no plugin named <comment>%s</comment>, aborting', $name));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($this->container['plugins.manager']->isEnabled($name)) {
|
||||
$output->writeln(sprintf('Plugin named <comment>%s</comment> is already enabled, aborting', $name));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->container['plugins.manager']->enable($name);
|
||||
$output->writeln(sprintf('Plugin named <info>%s</info> is now enabled', $name));
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
// This file is automatically generated, please do not edit it.
|
||||
// To update configuration, use bin/console plugins:* commands.
|
||||
// To update configuration, use bin/setup plugins:* commands.
|
||||
|
||||
return call_user_func(function () {
|
||||
$loader = require __DIR__ . '/../vendor/autoload.php';
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
// This file is automatically generated, please do not edit it.
|
||||
// To update configuration, use bin/console plugins:* commands.
|
||||
// To update configuration, use bin/setup plugins:* commands.
|
||||
|
||||
use Alchemy\Phrasea\CLI;
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
// This file is automatically generated, please do not edit it.
|
||||
// To update configuration, use bin/console plugins:* commands.
|
||||
// To update configuration, use bin/setup plugins:* commands.
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
// This file is automatically generated, please do not edit it.
|
||||
// To update configuration, use bin/console plugins:* commands.
|
||||
// To update configuration, use bin/setup plugins:* commands.
|
||||
|
||||
return [];
|
||||
|
Reference in New Issue
Block a user