mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
refactor command
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2012 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
{
|
||||
|
||||
/**
|
||||
* Tell whether the command requires Phraseanet to be set up to run
|
||||
* @return boolean
|
||||
*/
|
||||
abstract public function needPhraseaInstalled();
|
||||
|
||||
/**
|
||||
* Check if Phraseanet is set up and if the current commands requires
|
||||
* Phraseanet to be installed
|
||||
*
|
||||
* @param \Symfony\Component\Console\Output\OutputInterface $output
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkPhraseaInstall(OutputInterface $output)
|
||||
{
|
||||
if ($this->needPhraseaInstalled()) {
|
||||
$core = \bootstrap::getCore();
|
||||
|
||||
if ( ! $core->getConfiguration()->isInstalled()) {
|
||||
$output->writeln("<error>Phraseanet is not set up</error>");
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user