diff --git a/lib/classes/module/console/PhraseanetCommand.class.php b/lib/Alchemy/Phrasea/Command/Command.php similarity index 56% rename from lib/classes/module/console/PhraseanetCommand.class.php rename to lib/Alchemy/Phrasea/Command/Command.php index 8c6d9dfc29..04855c249c 100644 --- a/lib/classes/module/console/PhraseanetCommand.class.php +++ b/lib/Alchemy/Phrasea/Command/Command.php @@ -9,33 +9,36 @@ * file that was distributed with this source code. */ +namespace Alchemy\Phrasea\Command; + +use Symfony\Component\Console\Command\Command as SymfoCommand; +use Symfony\Component\Console\Output\OutputInterface; + /** + * Abstract command which represents a Phraseanet base command * * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Output\OutputInterface; - -abstract class module_console_PhraseanetCommand extends Command +abstract class Command extends SymfoCommand { - /** - * Tell whether the command requires Phraseanet to be set up to run - * @return boolean + * Tell whether the command requires Phraseanet to be set-up or not + * + * @return Boolean */ - abstract public function needPhraseaInstalled(); + abstract public function requireSetup(); /** - * Check if Phraseanet is set up and if the current commands requires - * Phraseanet to be installed + * Check if Phraseanet is set-up and if the current command requires + * Phraseanet to be set-up * * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return boolean + * @return Boolean */ - public function checkPhraseaInstall(OutputInterface $output) + public function checkSetup(OutputInterface $output) { - if ($this->needPhraseaInstalled()) { + if ($this->requireSetup()) { $core = \bootstrap::getCore(); if ( ! $core->getConfiguration()->isInstalled()) { @@ -47,5 +50,4 @@ abstract class module_console_PhraseanetCommand extends Command return true; } - -} \ No newline at end of file +} diff --git a/lib/classes/module/console/aboutAuthors.class.php b/lib/classes/module/console/aboutAuthors.class.php index 0ce73bc5d0..5f730a94fe 100644 --- a/lib/classes/module/console/aboutAuthors.class.php +++ b/lib/classes/module/console/aboutAuthors.class.php @@ -17,8 +17,9 @@ */ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Alchemy\Phrasea\Command\Command; -class module_console_aboutAuthors extends module_console_PhraseanetCommand +class module_console_aboutAuthors extends Command { public function __construct($name = null) @@ -32,7 +33,7 @@ class module_console_aboutAuthors extends module_console_PhraseanetCommand public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } @@ -41,7 +42,7 @@ class module_console_aboutAuthors extends module_console_PhraseanetCommand return 0; } - public function needPhraseaInstalled() + public function requireSetup() { return false; } diff --git a/lib/classes/module/console/aboutLicense.class.php b/lib/classes/module/console/aboutLicense.class.php index 8c7a17f73e..5dcd6f11b8 100644 --- a/lib/classes/module/console/aboutLicense.class.php +++ b/lib/classes/module/console/aboutLicense.class.php @@ -17,8 +17,9 @@ */ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Alchemy\Phrasea\Command\Command; -class module_console_aboutLicense extends module_console_PhraseanetCommand +class module_console_aboutLicense extends Command { public function __construct($name = null) @@ -32,7 +33,7 @@ class module_console_aboutLicense extends module_console_PhraseanetCommand public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } @@ -41,7 +42,7 @@ class module_console_aboutLicense extends module_console_PhraseanetCommand return 0; } - public function needPhraseaInstalled() + public function requireSetup() { return false; } diff --git a/lib/classes/module/console/checkExtension.class.php b/lib/classes/module/console/checkExtension.class.php index 3cd48e12c6..10d0926207 100644 --- a/lib/classes/module/console/checkExtension.class.php +++ b/lib/classes/module/console/checkExtension.class.php @@ -18,8 +18,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Alchemy\Phrasea\Command\Command; -class module_console_checkExtension extends module_console_PhraseanetCommand +class module_console_checkExtension extends Command { public function __construct($name = null) @@ -35,14 +36,14 @@ class module_console_checkExtension extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/fieldsDelete.class.php b/lib/classes/module/console/fieldsDelete.class.php index 0ed2acd42f..cb5489d5bc 100644 --- a/lib/classes/module/console/fieldsDelete.class.php +++ b/lib/classes/module/console/fieldsDelete.class.php @@ -18,8 +18,9 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Alchemy\Phrasea\Command\Command; -class module_console_fieldsDelete extends module_console_PhraseanetCommand +class module_console_fieldsDelete extends Command { public function __construct($name = null) @@ -34,14 +35,14 @@ class module_console_fieldsDelete extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/fieldsList.class.php b/lib/classes/module/console/fieldsList.class.php index 85df883018..95f5dfe109 100644 --- a/lib/classes/module/console/fieldsList.class.php +++ b/lib/classes/module/console/fieldsList.class.php @@ -17,8 +17,9 @@ */ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Alchemy\Phrasea\Command\Command; -class module_console_fieldsList extends module_console_PhraseanetCommand +class module_console_fieldsList extends Command { public function __construct($name = null) @@ -30,14 +31,14 @@ class module_console_fieldsList extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/fieldsMerge.class.php b/lib/classes/module/console/fieldsMerge.class.php index db5eddca84..71bcffaeed 100644 --- a/lib/classes/module/console/fieldsMerge.class.php +++ b/lib/classes/module/console/fieldsMerge.class.php @@ -19,8 +19,9 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Alchemy\Phrasea\Command\Command; -class module_console_fieldsMerge extends module_console_PhraseanetCommand +class module_console_fieldsMerge extends Command { public function __construct($name = null) @@ -44,14 +45,14 @@ class module_console_fieldsMerge extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/fieldsRename.class.php b/lib/classes/module/console/fieldsRename.class.php index f0b298c13c..5decdd85de 100644 --- a/lib/classes/module/console/fieldsRename.class.php +++ b/lib/classes/module/console/fieldsRename.class.php @@ -18,8 +18,9 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Alchemy\Phrasea\Command\Command; -class module_console_fieldsRename extends module_console_PhraseanetCommand +class module_console_fieldsRename extends Command { public function __construct($name = null) @@ -35,14 +36,14 @@ class module_console_fieldsRename extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/fileEnsureDevSetting.class.php b/lib/classes/module/console/fileEnsureDevSetting.class.php index a29541855d..5f48cbdf75 100644 --- a/lib/classes/module/console/fileEnsureDevSetting.class.php +++ b/lib/classes/module/console/fileEnsureDevSetting.class.php @@ -9,6 +9,7 @@ * file that was distributed with this source code. */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -21,7 +22,7 @@ use Alchemy\Phrasea\Core; * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -class module_console_fileEnsureDevSetting extends module_console_PhraseanetCommand +class module_console_fileEnsureDevSetting extends Command { const ALERT = 1; const ERROR = 0; @@ -54,14 +55,14 @@ class module_console_fileEnsureDevSetting extends module_console_PhraseanetComma return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/fileEnsureProductionSetting.class.php b/lib/classes/module/console/fileEnsureProductionSetting.class.php index 4fdfa99f96..6f29c3e6db 100644 --- a/lib/classes/module/console/fileEnsureProductionSetting.class.php +++ b/lib/classes/module/console/fileEnsureProductionSetting.class.php @@ -13,6 +13,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Alchemy\Phrasea\Command\Command; use Alchemy\Phrasea\Core; /** @@ -21,7 +22,7 @@ use Alchemy\Phrasea\Core; * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -class module_console_fileEnsureProductionSetting extends module_console_PhraseanetCommand +class module_console_fileEnsureProductionSetting extends Command { const ALERT = 1; const ERROR = 0; @@ -54,14 +55,14 @@ class module_console_fileEnsureProductionSetting extends module_console_Phrasean return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/schedulerStart.class.php b/lib/classes/module/console/schedulerStart.class.php index a239025fbc..bc02bcad5e 100644 --- a/lib/classes/module/console/schedulerStart.class.php +++ b/lib/classes/module/console/schedulerStart.class.php @@ -15,12 +15,14 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ + +use Alchemy\Phrasea\Command\Command; use Monolog\Handler; use Monolog\Logger; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_schedulerStart extends module_console_PhraseanetCommand +class module_console_schedulerStart extends Command { public function __construct($name = null) @@ -32,14 +34,14 @@ class module_console_schedulerStart extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/schedulerState.class.php b/lib/classes/module/console/schedulerState.class.php index 529f29af4c..fb898f3251 100644 --- a/lib/classes/module/console/schedulerState.class.php +++ b/lib/classes/module/console/schedulerState.class.php @@ -15,11 +15,12 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -class module_console_schedulerState extends module_console_PhraseanetCommand +class module_console_schedulerState extends Command { const EXITCODE_SETUP_ERROR = 1; const EXITCODE_STATE_UNKNOWN = 21; @@ -48,14 +49,14 @@ class module_console_schedulerState extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return self::EXITCODE_SETUP_ERROR; } diff --git a/lib/classes/module/console/schedulerStop.class.php b/lib/classes/module/console/schedulerStop.class.php index d37ebf7556..8d2f3655d5 100644 --- a/lib/classes/module/console/schedulerStop.class.php +++ b/lib/classes/module/console/schedulerStop.class.php @@ -15,10 +15,11 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_schedulerStop extends module_console_PhraseanetCommand +class module_console_schedulerStop extends Command { public function __construct($name = null) @@ -30,14 +31,14 @@ class module_console_schedulerStop extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/sphinxGenerateSuggestion.class.php b/lib/classes/module/console/sphinxGenerateSuggestion.class.php index dce2f9eb95..925349e6e0 100644 --- a/lib/classes/module/console/sphinxGenerateSuggestion.class.php +++ b/lib/classes/module/console/sphinxGenerateSuggestion.class.php @@ -15,10 +15,11 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_sphinxGenerateSuggestion extends module_console_PhraseanetCommand +class module_console_sphinxGenerateSuggestion extends Command { public function __construct($name = null) @@ -31,14 +32,14 @@ class module_console_sphinxGenerateSuggestion extends module_console_PhraseanetC return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/systemBackupDB.class.php b/lib/classes/module/console/systemBackupDB.class.php index 20dab4a57f..a1aac0e640 100644 --- a/lib/classes/module/console/systemBackupDB.class.php +++ b/lib/classes/module/console/systemBackupDB.class.php @@ -15,10 +15,11 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_systemBackupDB extends module_console_PhraseanetCommand +class module_console_systemBackupDB extends Command { public function __construct($name = null) @@ -37,14 +38,14 @@ class module_console_systemBackupDB extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/systemClearCache.class.php b/lib/classes/module/console/systemClearCache.class.php index fc2cc258b9..da3ef4ba08 100644 --- a/lib/classes/module/console/systemClearCache.class.php +++ b/lib/classes/module/console/systemClearCache.class.php @@ -14,12 +14,13 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Finder\Finder; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_systemClearCache extends module_console_PhraseanetCommand +class module_console_systemClearCache extends Command { public function __construct($name = null) @@ -31,14 +32,14 @@ class module_console_systemClearCache extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return false; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/systemConfigCheck.class.php b/lib/classes/module/console/systemConfigCheck.class.php index 47c2225b90..f96f6ac5e5 100644 --- a/lib/classes/module/console/systemConfigCheck.class.php +++ b/lib/classes/module/console/systemConfigCheck.class.php @@ -16,10 +16,11 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_systemConfigCheck extends module_console_PhraseanetCommand +class module_console_systemConfigCheck extends Command { public function __construct($name = null) @@ -31,14 +32,14 @@ class module_console_systemConfigCheck extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return false; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/systemExport.class.php b/lib/classes/module/console/systemExport.class.php index 1059027d4d..b9cb3a7907 100644 --- a/lib/classes/module/console/systemExport.class.php +++ b/lib/classes/module/console/systemExport.class.php @@ -15,11 +15,12 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -class module_console_systemExport extends module_console_PhraseanetCommand +class module_console_systemExport extends Command { public function __construct($name = null) @@ -70,14 +71,14 @@ class module_console_systemExport extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/systemMailCheck.class.php b/lib/classes/module/console/systemMailCheck.class.php index ccf621077d..68a0e79504 100644 --- a/lib/classes/module/console/systemMailCheck.class.php +++ b/lib/classes/module/console/systemMailCheck.class.php @@ -16,10 +16,11 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_systemMailCheck extends module_console_PhraseanetCommand +class module_console_systemMailCheck extends Command { public function __construct($name = null) @@ -36,14 +37,14 @@ class module_console_systemMailCheck extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/systemTemplateGenerator.class.php b/lib/classes/module/console/systemTemplateGenerator.class.php index ea1528fe9e..056c1b9876 100644 --- a/lib/classes/module/console/systemTemplateGenerator.class.php +++ b/lib/classes/module/console/systemTemplateGenerator.class.php @@ -15,10 +15,11 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_systemTemplateGenerator extends module_console_PhraseanetCommand +class module_console_systemTemplateGenerator extends Command { public function __construct($name = null) @@ -30,14 +31,14 @@ class module_console_systemTemplateGenerator extends module_console_PhraseanetCo return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return false; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/systemUpgrade.class.php b/lib/classes/module/console/systemUpgrade.class.php index 224f262fe2..5804d515d2 100644 --- a/lib/classes/module/console/systemUpgrade.class.php +++ b/lib/classes/module/console/systemUpgrade.class.php @@ -16,10 +16,11 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_systemUpgrade extends module_console_PhraseanetCommand +class module_console_systemUpgrade extends Command { public function __construct($name = null) @@ -31,14 +32,14 @@ class module_console_systemUpgrade extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return false; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return 1; } diff --git a/lib/classes/module/console/taskState.class.php b/lib/classes/module/console/taskState.class.php index 33988f188e..3b65d68473 100644 --- a/lib/classes/module/console/taskState.class.php +++ b/lib/classes/module/console/taskState.class.php @@ -15,12 +15,13 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; 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 module_console_taskState extends module_console_PhraseanetCommand +class module_console_taskState extends Command { const EXITCODE_SETUP_ERROR = 1; const EXITCODE_BAD_ARGUMENT = 2; @@ -56,14 +57,14 @@ class module_console_taskState extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return self::EXITCODE_SETUP_ERROR; } diff --git a/lib/classes/module/console/tasklist.class.php b/lib/classes/module/console/tasklist.class.php index 823d5d52a4..9be3ba0761 100644 --- a/lib/classes/module/console/tasklist.class.php +++ b/lib/classes/module/console/tasklist.class.php @@ -16,10 +16,11 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ +use Alchemy\Phrasea\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -class module_console_tasklist extends module_console_PhraseanetCommand +class module_console_tasklist extends Command { public function __construct($name = null) @@ -31,14 +32,14 @@ class module_console_tasklist extends module_console_PhraseanetCommand return $this; } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return self::EXITCODE_SETUP_ERROR; } diff --git a/lib/classes/module/console/taskrun.class.php b/lib/classes/module/console/taskrun.class.php index 873f702573..dccff2f907 100644 --- a/lib/classes/module/console/taskrun.class.php +++ b/lib/classes/module/console/taskrun.class.php @@ -9,6 +9,7 @@ * file that was distributed with this source code. */ +use Alchemy\Phrasea\Command\Command; use Monolog\Handler; use Monolog\Logger; use Symfony\Component\Console\Input\InputArgument; @@ -22,7 +23,7 @@ use Symfony\Component\Console\Output\OutputInterface; * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -class module_console_taskrun extends module_console_PhraseanetCommand +class module_console_taskrun extends Command { private $task; private $shedulerPID; @@ -64,14 +65,14 @@ class module_console_taskrun extends module_console_PhraseanetCommand } } - public function needPhraseaInstalled() + public function requireSetup() { return true; } public function execute(InputInterface $input, OutputInterface $output) { - if ( ! $this->checkPhraseaInstall($output)) { + if ( ! $this->checkSetup($output)) { return self::EXITCODE_SETUP_ERROR; }