mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Refactor Commands
This commit is contained in:
@@ -31,10 +31,8 @@ class module_console_aboutAuthors extends Command
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$output->writeln(file_get_contents(__DIR__ . '/../../../../AUTHORS'));
|
||||
|
||||
return 0;
|
||||
|
@@ -31,10 +31,8 @@ class module_console_aboutLicense extends Command
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$output->writeln(file_get_contents(__DIR__ . '/../../../../LICENSE'));
|
||||
|
||||
return 0;
|
||||
|
@@ -41,10 +41,8 @@ class module_console_checkExtension extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
if ( ! extension_loaded('phrasea2')) {
|
||||
$output->writeln("<error>Missing Extension php-phrasea.</error>");
|
||||
|
||||
|
@@ -40,10 +40,8 @@ class module_console_fieldsDelete extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
try {
|
||||
$databox = \databox::get_instance((int) $input->getArgument('sbas_id'));
|
||||
} catch (\Exception $e) {
|
||||
|
@@ -36,10 +36,8 @@ class module_console_fieldsList extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||
|
||||
foreach ($appbox->get_databoxes() as $databox) {
|
||||
|
@@ -50,10 +50,8 @@ class module_console_fieldsMerge extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$output->writeln("");
|
||||
|
||||
try {
|
||||
|
@@ -41,10 +41,8 @@ class module_console_fieldsRename extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$new_name = $input->getArgument('name');
|
||||
|
||||
try {
|
||||
|
@@ -61,10 +61,8 @@ class module_console_fileEnsureDevSetting extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$specifications = new \Alchemy\Phrasea\Core\Configuration\ApplicationSpecification();
|
||||
|
||||
$environnement = $input->getArgument('conf');
|
||||
|
@@ -61,10 +61,8 @@ class module_console_fileEnsureProductionSetting extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$specifications = new \Alchemy\Phrasea\Core\Configuration\ApplicationSpecification();
|
||||
|
||||
$environnement = $input->getArgument('conf');
|
||||
|
@@ -39,13 +39,11 @@ class module_console_schedulerStart extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$logger = new Logger('Task logger');
|
||||
|
||||
$streamHandler = new Handler\StreamHandler(fopen('php://stdout', 'a'), $input->getOption('verbose') ? Logger::DEBUG : Logger::WARNING);
|
||||
$streamHandler = new Handler\StreamHandler('php://stdout', $input->getOption('verbose') ? Logger::DEBUG : Logger::WARNING);
|
||||
$logger->pushHandler($streamHandler);
|
||||
|
||||
$logfile = __DIR__ . '/../../../../logs/scheduler.log';
|
||||
|
@@ -51,10 +51,10 @@ class module_console_schedulerState extends Command
|
||||
|
||||
public function requireSetup()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
try {
|
||||
$this->checkSetup();
|
||||
|
@@ -36,10 +36,8 @@ class module_console_schedulerStop extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
try {
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new task_manager($appbox);
|
||||
|
@@ -36,10 +36,8 @@ class module_console_sphinxGenerateSuggestion extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
define('FREQ_THRESHOLD', 10);
|
||||
define('SUGGEST_DEBUG', 0);
|
||||
|
||||
|
@@ -43,10 +43,8 @@ class module_console_systemBackupDB extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$output->write('Phraseanet is going to be backup...', true);
|
||||
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
|
@@ -37,10 +37,8 @@ class module_console_systemClearCache extends Command
|
||||
return false;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$finder = new Finder();
|
||||
|
||||
$finder
|
||||
|
@@ -37,10 +37,8 @@ class module_console_systemConfigCheck extends Command
|
||||
return false;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
if ( ! function_exists('_')) {
|
||||
$output->writeln('<error>YOU MUST ENABLE GETTEXT SUPPORT TO USE PHRASEANET</error>');
|
||||
$output->writeln('Canceled');
|
||||
|
@@ -76,10 +76,8 @@ class module_console_systemExport extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$core = \bootstrap::getCore();
|
||||
|
||||
$docPerDir = max(1, (int) $input->getOption('docperdir'));
|
||||
|
@@ -42,10 +42,8 @@ class module_console_systemMailCheck extends Command
|
||||
return true;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
|
||||
$output->writeln("Processing...");
|
||||
|
@@ -36,10 +36,8 @@ class module_console_systemTemplateGenerator extends Command
|
||||
return false;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->checkSetup();
|
||||
|
||||
$tplDirs = array(
|
||||
realpath(__DIR__ . '/../../../../templates/web/'),
|
||||
realpath(__DIR__ . '/../../../../templates/mobile/')
|
||||
|
@@ -37,7 +37,7 @@ class module_console_systemUpgrade extends Command
|
||||
return false;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$old_connexion_file = __DIR__ . '/../../../../config/connexion.inc';
|
||||
$old_config_file = __DIR__ . '/../../../../config/config.inc';
|
||||
|
@@ -59,10 +59,10 @@ class module_console_taskState extends Command
|
||||
|
||||
public function requireSetup()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
try {
|
||||
$this->checkSetup();
|
||||
|
@@ -34,10 +34,10 @@ class module_console_tasklist extends Command
|
||||
|
||||
public function requireSetup()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
try {
|
||||
$this->checkSetup();
|
||||
|
@@ -65,10 +65,10 @@ class module_console_taskrun extends Command
|
||||
|
||||
public function requireSetup()
|
||||
{
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
try {
|
||||
$this->checkSetup();
|
||||
|
Reference in New Issue
Block a user