mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
refactor commands
This commit is contained in:
@@ -33,9 +33,7 @@ class module_console_aboutAuthors extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$output->writeln(file_get_contents(__DIR__ . '/../../../../AUTHORS'));
|
||||
|
||||
|
@@ -33,9 +33,7 @@ class module_console_aboutLicense extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$output->writeln(file_get_contents(__DIR__ . '/../../../../LICENSE'));
|
||||
|
||||
|
@@ -43,9 +43,7 @@ class module_console_checkExtension extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
if ( ! extension_loaded('phrasea2')) {
|
||||
$output->writeln("<error>Missing Extension php-phrasea.</error>");
|
||||
|
@@ -42,9 +42,7 @@ class module_console_fieldsDelete extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
try {
|
||||
$databox = \databox::get_instance((int) $input->getArgument('sbas_id'));
|
||||
|
@@ -38,9 +38,7 @@ class module_console_fieldsList extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||
|
||||
|
@@ -52,9 +52,7 @@ class module_console_fieldsMerge extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$output->writeln("");
|
||||
|
||||
|
@@ -43,9 +43,7 @@ class module_console_fieldsRename extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$new_name = $input->getArgument('name');
|
||||
|
||||
|
@@ -62,9 +62,7 @@ class module_console_fileEnsureDevSetting extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$specifications = new \Alchemy\Phrasea\Core\Configuration\ApplicationSpecification();
|
||||
|
||||
|
@@ -62,9 +62,7 @@ class module_console_fileEnsureProductionSetting extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$specifications = new \Alchemy\Phrasea\Core\Configuration\ApplicationSpecification();
|
||||
|
||||
|
@@ -41,9 +41,7 @@ class module_console_schedulerStart extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$logger = new Logger('Task logger');
|
||||
|
||||
|
@@ -56,8 +56,9 @@ class module_console_schedulerState extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
try{
|
||||
$this->checkSetup();
|
||||
} catch (\RuntimeException $e){
|
||||
return self::EXITCODE_SETUP_ERROR;
|
||||
}
|
||||
|
||||
|
@@ -38,10 +38,7 @@ class module_console_schedulerStop extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
require_once __DIR__ . '/../../../../lib/bootstrap.php';
|
||||
|
||||
|
@@ -39,10 +39,7 @@ class module_console_sphinxGenerateSuggestion extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
define('FREQ_THRESHOLD', 10);
|
||||
define('SUGGEST_DEBUG', 0);
|
||||
|
@@ -45,10 +45,7 @@ class module_console_systemBackupDB extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$output->write('Phraseanet is going to be backup...', true);
|
||||
|
||||
|
@@ -39,10 +39,7 @@ class module_console_systemClearCache extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$finder = new Finder();
|
||||
|
||||
|
@@ -39,10 +39,7 @@ class module_console_systemConfigCheck extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
if ( ! function_exists('_')) {
|
||||
$output->writeln('<error>YOU MUST ENABLE GETTEXT SUPPORT TO USE PHRASEANET</error>');
|
||||
|
@@ -78,10 +78,7 @@ class module_console_systemExport extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$core = \bootstrap::getCore();
|
||||
|
||||
|
@@ -44,10 +44,7 @@ class module_console_systemMailCheck extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
|
||||
|
@@ -38,10 +38,7 @@ class module_console_systemTemplateGenerator extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$tplDirs = array(
|
||||
realpath(__DIR__ . '/../../../../templates/web/'),
|
||||
|
@@ -39,10 +39,7 @@ class module_console_systemUpgrade extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
$this->checkSetup();
|
||||
|
||||
$Core = \bootstrap::getCore();
|
||||
|
||||
|
@@ -64,8 +64,9 @@ class module_console_taskState extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
try{
|
||||
$this->checkSetup();
|
||||
} catch (\RuntimeException $e){
|
||||
return self::EXITCODE_SETUP_ERROR;
|
||||
}
|
||||
|
||||
|
@@ -39,8 +39,9 @@ class module_console_tasklist extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
try{
|
||||
$this->checkSetup();
|
||||
} catch (\RuntimeException $e){
|
||||
return self::EXITCODE_SETUP_ERROR;
|
||||
}
|
||||
|
||||
|
@@ -72,8 +72,9 @@ class module_console_taskrun extends Command
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! $this->checkSetup($output)) {
|
||||
|
||||
try{
|
||||
$this->checkSetup();
|
||||
} catch (\RuntimeException $e){
|
||||
return self::EXITCODE_SETUP_ERROR;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user