Cleanup namepaces, variables uses

This commit is contained in:
Romain Neutron
2012-09-28 16:06:28 +02:00
parent 372861deb4
commit 1700565862
232 changed files with 593 additions and 1446 deletions

View File

@@ -49,10 +49,6 @@ class module_console_checkExtension extends Command
return 1;
}
$appbox = $this->getService('phraseanet.appbox');
$registry = $this->container['phraseanet.registry'];
$usrId = $input->getArgument('usr_id');
try {
@@ -175,7 +171,7 @@ class module_console_checkExtension extends Command
, $base["sbas_id"]
, $base["searchcoll"]
, $base["arrayq"]
, $registry->get('GV_sit')
, $this->container['phraseanet.registry']->get('GV_sit')
, $usrId
, false
, PHRASEA_MULTIDOC_DOCONLY

View File

@@ -42,9 +42,8 @@ class module_console_fieldsDelete extends Command
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$appbox = $this->getService('phraseanet.appbox');
try {
$databox = $appbox->get_databox((int) $input->getArgument('sbas_id'));
$databox = $this->getService('phraseanet.appbox')->get_databox((int) $input->getArgument('sbas_id'));
} catch (\Exception $e) {
$output->writeln("<error>Invalid databox id </error>");

View File

@@ -38,9 +38,7 @@ class module_console_fieldsList extends Command
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$appbox = $this->getService('phraseanet.appbox');
foreach ($appbox->get_databoxes() as $databox) {
foreach ($this->getService('phraseanet.appbox')->get_databoxes() as $databox) {
/* @var $databox \databox */
$output->writeln(
sprintf(

View File

@@ -54,10 +54,8 @@ class module_console_fieldsMerge extends Command
{
$output->writeln("");
$appbox = $this->getService('phraseanet.appbox');
try {
$databox = $appbox->get_databox((int) $input->getArgument('sbas_id'));
$databox = $this->getService('phraseanet.appbox')->get_databox((int) $input->getArgument('sbas_id'));
} catch (\Exception $e) {
$output->writeln("<error>Invalid databox id </error>");

View File

@@ -45,9 +45,8 @@ class module_console_fieldsRename extends Command
{
$new_name = $input->getArgument('name');
$appbox = $this->getService('phraseanet.appbox');
try {
$databox = $appbox->get_databox((int) $input->getArgument('sbas_id'));
$databox = $this->getService('phraseanet.appbox')->get_databox((int) $input->getArgument('sbas_id'));
} catch (\Exception $e) {
$output->writeln("<error>Invalid databox id </error>");

View File

@@ -41,9 +41,6 @@ class module_console_sphinxGenerateSuggestion extends Command
define('FREQ_THRESHOLD', 10);
define('SUGGEST_DEBUG', 0);
$appbox = $this->getService('phraseanet.appbox');
$registry = $this->container['phraseanet.registry'];
$params = phrasea::sbas_params($this->container);
foreach ($params as $sbas_id => $p) {
@@ -55,9 +52,9 @@ class module_console_sphinxGenerateSuggestion extends Command
)
);
$tmp_file = $registry->get('GV_RootPath') . 'tmp/dict' . $index . '.txt';
$tmp_file = $this->container['phraseanet.registry']->get('GV_RootPath') . 'tmp/dict' . $index . '.txt';
$databox = $appbox->get_databox($sbas_id);
$databox = $this->getService('phraseanet.appbox')->get_databox($sbas_id);
$output->writeln("process Databox " . $databox->get_viewname() . " / $index\n");

View File

@@ -47,11 +47,9 @@ class module_console_systemBackupDB extends Command
{
$output->write('Phraseanet is going to be backup...', true);
$appbox = $this->getService('phraseanet.appbox');
$ok = $this->dump_base($this->getService('phraseanet.appbox'), $input, $output) && $ok;
$ok = $this->dump_base($appbox, $input, $output) && $ok;
foreach ($appbox->get_databoxes() as $databox) {
foreach ($this->getService('phraseanet.appbox')->get_databoxes() as $databox) {
$ok = $this->dump_base($databox, $input, $output) && $ok;
}

View File

@@ -52,7 +52,7 @@ class module_console_systemConfigCheck extends Command
$registry = $this->container['phraseanet.registry'];
$output->writeln(_('*** CHECK BINARY CONFIGURATION ***'));
$ok = $this->processConstraints(setup::check_binaries($registry), $output) && $ok;
$ok = $this->processConstraints(setup::check_binaries($this->container['phraseanet.registry']), $output) && $ok;
$output->writeln("");
} else {
$registry = new Setup_Registry();

View File

@@ -128,13 +128,11 @@ class module_console_systemExport extends Command
$output->writeln("Export datas from selected base_ids");
}
$appbox = $this->getService('phraseanet.appbox');
$total = $errors = 0;
$unicode = new \unicode();
foreach ($appbox->get_databoxes() as $databox) {
foreach ($this->getService('phraseanet.appbox')->get_databoxes() as $databox) {
$output->writeln(sprintf("Processing <info>%s</info>", $databox->get_viewname()));
if (count($restrictSbasIds) > 0 && ! in_array($databox->get_sbas_id(), $restrictSbasIds)) {

View File

@@ -44,16 +44,14 @@ class module_console_systemMailCheck extends Command
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$appbox = $this->getService('phraseanet.appbox');
$output->writeln("Processing...");
$bad_users = User_Adapter::get_wrong_email_users($this->container);
foreach ($bad_users as $email => $users) {
if ($input->getOption('list')) {
$this->write_infos($email, $users, $output, $appbox);
} elseif ($this->manage_group($email, $users, $output, $appbox) === false) {
$this->write_infos($email, $users, $output, $this->getService('phraseanet.appbox'));
} elseif ($this->manage_group($email, $users, $output, $this->getService('phraseanet.appbox')) === false) {
break;
}

View File

@@ -98,15 +98,14 @@ class module_console_systemUpgrade extends Command
if ($continue == 'y') {
try {
$output->write('<info>Upgrading...</info>', true);
$appbox = $this->getService('phraseanet.appbox');
if (count(User_Adapter::get_wrong_email_users($this->container)) > 0) {
return $output->writeln(sprintf('<error>You have to fix your database before upgrade with the system:mailCheck command </error>'));
}
$upgrader = new Setup_Upgrade($appbox, $input->getOption('force'));
$upgrader = new Setup_Upgrade($this->getService('phraseanet.appbox'), $input->getOption('force'));
$appbox->forceUpgrade($upgrader);
$this->getService('phraseanet.appbox')->forceUpgrade($upgrader);
foreach ($upgrader->getRecommendations() as $recommendation) {
list($message, $command) = $recommendation;

View File

@@ -46,7 +46,6 @@ class module_console_tasklist extends Command
}
try {
$appbox = $this->getService('phraseanet.appbox');
$task_manager = new task_manager($this->container);
$tasks = $task_manager->getTasks();

View File

@@ -81,7 +81,6 @@ class module_console_taskrun extends Command
throw new \RuntimeException('Argument must be an Id.');
}
$appbox = $this->getService('phraseanet.appbox');
$task_manager = new task_manager($this->container);
if ($input->getOption('runner') === task_abstract::RUNNER_MANUAL) {