Remove deprectaed feature

This commit is contained in:
Romain Neutron
2012-10-02 13:09:16 +02:00
parent 54428eed6d
commit ec40ce3d49
30 changed files with 118 additions and 578 deletions

View File

@@ -38,8 +38,4 @@ class module_console_aboutAuthors extends Command
return 0;
}
public function requireSetup()
{
return false;
}
}

View File

@@ -37,9 +37,4 @@ class module_console_aboutLicense extends Command
return 0;
}
public function requireSetup()
{
return false;
}
}

View File

@@ -36,11 +36,6 @@ class module_console_checkExtension extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
if ( ! extension_loaded('phrasea2')) {

View File

@@ -35,11 +35,6 @@ class module_console_fieldsDelete extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
try {

View File

@@ -31,11 +31,6 @@ class module_console_fieldsList extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
foreach ($this->getService('phraseanet.appbox')->get_databoxes() as $databox) {

View File

@@ -45,11 +45,6 @@ class module_console_fieldsMerge extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$output->writeln("");

View File

@@ -36,11 +36,6 @@ class module_console_fieldsRename extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$new_name = $input->getArgument('name');

View File

@@ -57,11 +57,6 @@ class module_console_fileEnsureDevSetting extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$this->configuration = $this->container['phraseanet.configuration'];

View File

@@ -57,11 +57,6 @@ class module_console_fileEnsureProductionSetting extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$this->configuration = $this->container['phraseanet.configuration'];

View File

@@ -34,11 +34,6 @@ class module_console_schedulerStart extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$logger = new Logger('Task logger');

View File

@@ -49,16 +49,9 @@ class module_console_schedulerState extends Command
return $this;
}
public function requireSetup()
{
return false;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
try {
$this->checkSetup();
} catch (\RuntimeException $e) {
if (!$this->container['phraseanet.configuration']->isInstalled()) {
return self::EXITCODE_SETUP_ERROR;
}

View File

@@ -31,11 +31,6 @@ class module_console_schedulerStop extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
try {

View File

@@ -31,11 +31,6 @@ class module_console_sphinxGenerateSuggestion extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
define('FREQ_THRESHOLD', 10);

View File

@@ -38,11 +38,6 @@ class module_console_systemBackupDB extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$output->write('Phraseanet is going to be backup...', true);

View File

@@ -32,11 +32,6 @@ class module_console_systemClearCache extends Command
return $this;
}
public function requireSetup()
{
return false;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$finder = new Finder();

View File

@@ -32,11 +32,6 @@ class module_console_systemConfigCheck extends Command
return $this;
}
public function requireSetup()
{
return false;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
if ( ! function_exists('_')) {

View File

@@ -71,11 +71,6 @@ class module_console_systemExport extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$docPerDir = max(1, (int) $input->getOption('docperdir'));

View File

@@ -37,11 +37,6 @@ class module_console_systemMailCheck extends Command
return $this;
}
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$output->writeln("Processing...");

View File

@@ -33,11 +33,6 @@ class module_console_systemTemplateGenerator extends Command
return $this;
}
public function requireSetup()
{
return false;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$tplDirs = array(

View File

@@ -36,51 +36,22 @@ class module_console_systemUpgrade extends Command
return $this;
}
public function requireSetup()
{
return false;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
require_once dirname(__FILE__) . '/../../../../lib/bootstrap.php';
$interactive = !$input->getOption('yes');
if (!$this->container['phraseanet.configuration']->isInstalled() && \setup::needUpgradeConfigurationFile()) {
if ($interactive) {
$output->writeln('This version of Phraseanet requires a config/config.yml, config/connexion.yml, config/service.yml');
$output->writeln('Would you like it to be created based on your settings ?');
$dialog = $this->getHelperSet()->get('dialog');
do {
$continue = mb_strtolower($dialog->ask($output, '<question>' . _('Create automatically') . ' (Y/n)</question>', 'y'));
} while (!in_array($continue, array('y', 'n')));
} else {
$continue = 'y';
}
if ($continue == 'y') {
try {
if (\setup::requireGVUpgrade()) {
setup::upgradeGV($this->container['phraseanet.registry']);
}
$connexionInc = new \SplFileInfo(__DIR__ . '/../../../../config/connexion.inc');
$configInc = new \SplFileInfo(__DIR__ . '/../../../../config/config.inc');
$this->getService('phraseanet.configuration')->upgradeFromOldConf($configInc, $connexionInc);
} catch (\Exception $e) {
throw new RuntimeException('Error while upgrading : ' . $e->getMessage());
}
} else {
throw new RuntimeException('Phraseanet is not set up');
while ($migrations = $this->container['phraseanet.configuration-tester']->getMigrations()) {
foreach ($migrations as $migration) {
echo get_class($migration) . "\n";
$migration->migrate();
echo get_class($migration) . " finished\n";
}
}
if ( ! $this->getService('phraseanet.configuration')->isInstalled()) {
throw new \RuntimeException('Phraseanet must be set-up (no connexion.inc / no config.inc)');
if (!$this->getService('phraseanet.configuration')->isInstalled()) {
throw new \RuntimeException('Phraseanet must be set-up');
}
$output->write('Phraseanet is going to be upgraded', true);

View File

@@ -57,16 +57,9 @@ class module_console_taskState extends Command
return $this;
}
public function requireSetup()
{
return false;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
try {
$this->checkSetup();
} catch (\RuntimeException $e) {
if (!$this->container['phraseanet.configuration']->isInstalled()) {
return self::EXITCODE_SETUP_ERROR;
}

View File

@@ -32,16 +32,9 @@ class module_console_tasklist extends Command
return $this;
}
public function requireSetup()
{
return false;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
try {
$this->checkSetup();
} catch (\RuntimeException $e) {
if (!$this->container['phraseanet.configuration']->isInstalled()) {
return self::EXITCODE_SETUP_ERROR;
}

View File

@@ -63,16 +63,9 @@ class module_console_taskrun extends Command
}
}
public function requireSetup()
{
return false;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
try {
$this->checkSetup();
} catch (\RuntimeException $e) {
if (!$this->container['phraseanet.configuration']->isInstalled()) {
return self::EXITCODE_SETUP_ERROR;
}