mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
Update console commands
This commit is contained in:
@@ -49,7 +49,6 @@ class module_console_checkExtension extends Command
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$Core = $this->getService('phraseanet.core');
|
|
||||||
$appbox = $this->getService('phraseanet.appbox');
|
$appbox = $this->getService('phraseanet.appbox');
|
||||||
|
|
||||||
$registry = $appbox->get_registry();
|
$registry = $appbox->get_registry();
|
||||||
@@ -57,7 +56,7 @@ class module_console_checkExtension extends Command
|
|||||||
$usrId = $input->getArgument('usr_id');
|
$usrId = $input->getArgument('usr_id');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$TestUser = \User_Adapter::getInstance($usrId, $appbox);
|
$TestUser = \User_Adapter::getInstance($usrId, $this->container);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$output->writeln("<error>Wrong user !</error>");
|
$output->writeln("<error>Wrong user !</error>");
|
||||||
|
|
||||||
@@ -78,7 +77,7 @@ class module_console_checkExtension extends Command
|
|||||||
$output->writeln("<info>$function</info>");
|
$output->writeln("<info>$function</info>");
|
||||||
}
|
}
|
||||||
|
|
||||||
$configuration = $Core->getConfiguration();
|
$configuration = $this->getService('phraseanet.configuration');
|
||||||
$choosenConnection = $configuration->getPhraseanet()->get('database');
|
$choosenConnection = $configuration->getPhraseanet()->get('database');
|
||||||
$connexion = $configuration->getConnexion($choosenConnection);
|
$connexion = $configuration->getConnexion($choosenConnection);
|
||||||
$hostname = $connexion->get('host');
|
$hostname = $connexion->get('host');
|
||||||
@@ -157,7 +156,7 @@ class module_console_checkExtension extends Command
|
|||||||
$tbases[$kbase]["searchcoll"] = $tcoll;
|
$tbases[$kbase]["searchcoll"] = $tcoll;
|
||||||
$tbases[$kbase]["mask_xor"] = $tbases[$kbase]["mask_and"] = 0;
|
$tbases[$kbase]["mask_xor"] = $tbases[$kbase]["mask_and"] = 0;
|
||||||
|
|
||||||
$qp = new searchEngine_adapter_phrasea_queryParser();
|
$qp = new searchEngine_adapter_phrasea_queryParser($this->container);
|
||||||
$treeq = $qp->parsequery($input->getOption('query'));
|
$treeq = $qp->parsequery($input->getOption('query'));
|
||||||
$arrayq = $qp->makequery($treeq);
|
$arrayq = $qp->makequery($treeq);
|
||||||
|
|
||||||
|
@@ -14,7 +14,8 @@ use Symfony\Component\Console\Input\InputArgument;
|
|||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Alchemy\Phrasea\Core;
|
use Alchemy\Phrasea\Application;
|
||||||
|
use Alchemy\Phrasea\Core\Service\Builder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo write tests
|
* @todo write tests
|
||||||
@@ -63,11 +64,7 @@ class module_console_fileEnsureDevSetting extends Command
|
|||||||
|
|
||||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$specifications = new \Alchemy\Phrasea\Core\Configuration\ApplicationSpecification();
|
$this->configuration = $this->container['phraseanet.configuration'];
|
||||||
|
|
||||||
$environnement = $input->getArgument('conf');
|
|
||||||
|
|
||||||
$this->configuration = \Alchemy\Phrasea\Core\Configuration::build($specifications, $environnement);
|
|
||||||
|
|
||||||
$this->checkParse($output);
|
$this->checkParse($output);
|
||||||
$output->writeln(sprintf("Will Ensure Development Settings on <info>%s</info>", $this->configuration->getEnvironnement()));
|
$output->writeln(sprintf("Will Ensure Development Settings on <info>%s</info>", $this->configuration->getEnvironnement()));
|
||||||
@@ -197,7 +194,7 @@ class module_console_fileEnsureDevSetting extends Command
|
|||||||
|
|
||||||
$listChecks = false;
|
$listChecks = false;
|
||||||
try {
|
try {
|
||||||
$service = Core\Service\Builder::create(\bootstrap::getCore(), $configuration);
|
$service = Builder::create($this->container, $configuration);
|
||||||
$work_message = '<info>Works !</info>';
|
$work_message = '<info>Works !</info>';
|
||||||
$listChecks = true;
|
$listChecks = true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -429,7 +426,7 @@ class module_console_fileEnsureDevSetting extends Command
|
|||||||
$configuration = $this->configuration->getService($templateEngineName);
|
$configuration = $this->configuration->getService($templateEngineName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Core\Service\Builder::create(\bootstrap::getCore(), $configuration);
|
Builder::create($this->container, $configuration);
|
||||||
$work_message = '<info>Works !</info>';
|
$work_message = '<info>Works !</info>';
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$work_message = '<error>Failed - could not load template engine !</error>';
|
$work_message = '<error>Failed - could not load template engine !</error>';
|
||||||
@@ -535,7 +532,7 @@ class module_console_fileEnsureDevSetting extends Command
|
|||||||
$configuration = $this->configuration->getService($ormName);
|
$configuration = $this->configuration->getService($ormName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$service = Core\Service\Builder::create(\bootstrap::getCore(), $configuration);
|
$service = Builder::create($this->container, $configuration);
|
||||||
$work_message = '<info>Works !</info>';
|
$work_message = '<info>Works !</info>';
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$work_message = '<error>Failed - could not connect !</error>';
|
$work_message = '<error>Failed - could not connect !</error>';
|
||||||
@@ -680,9 +677,7 @@ class module_console_fileEnsureDevSetting extends Command
|
|||||||
try {
|
try {
|
||||||
$conf = $this->configuration->getService($ServiceName);
|
$conf = $this->configuration->getService($ServiceName);
|
||||||
|
|
||||||
$Service = Core\Service\Builder::create(
|
$Service = Builder::create($this->container, $conf);
|
||||||
\bootstrap::getCore(), $conf
|
|
||||||
);
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -743,9 +738,7 @@ class module_console_fileEnsureDevSetting extends Command
|
|||||||
try {
|
try {
|
||||||
$originalConfiguration = $this->configuration->getService($ServiceName);
|
$originalConfiguration = $this->configuration->getService($ServiceName);
|
||||||
|
|
||||||
$Service = Core\Service\Builder::create(
|
$Service = Builder::create($this->container, $originalConfiguration);
|
||||||
\bootstrap::getCore(), $originalConfiguration
|
|
||||||
);
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -811,9 +804,7 @@ class module_console_fileEnsureDevSetting extends Command
|
|||||||
try {
|
try {
|
||||||
$originalConfiguration = $this->configuration->getService($ServiceName);
|
$originalConfiguration = $this->configuration->getService($ServiceName);
|
||||||
|
|
||||||
$Service = Core\Service\Builder::create(
|
$Service = Builder::create($this->container, $originalConfiguration);
|
||||||
\bootstrap::getCore(), $originalConfiguration
|
|
||||||
);
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,8 @@ use Symfony\Component\Console\Input\InputInterface;
|
|||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Alchemy\Phrasea\Command\Command;
|
use Alchemy\Phrasea\Command\Command;
|
||||||
use Alchemy\Phrasea\Core;
|
use Alchemy\Phrasea\Application;
|
||||||
|
use Alchemy\Phrasea\Core\Service\Builder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo write tests
|
* @todo write tests
|
||||||
@@ -63,11 +64,7 @@ class module_console_fileEnsureProductionSetting extends Command
|
|||||||
|
|
||||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$specifications = new \Alchemy\Phrasea\Core\Configuration\ApplicationSpecification();
|
$this->configuration = $this->container['phraseanet.configuration'];
|
||||||
|
|
||||||
$environnement = $input->getArgument('conf');
|
|
||||||
|
|
||||||
$this->configuration = \Alchemy\Phrasea\Core\Configuration::build($specifications, $environnement);
|
|
||||||
|
|
||||||
$this->checkParse($output);
|
$this->checkParse($output);
|
||||||
$output->writeln(sprintf("Will Ensure Production Settings on <info>%s</info>", $this->configuration->getEnvironnement()));
|
$output->writeln(sprintf("Will Ensure Production Settings on <info>%s</info>", $this->configuration->getEnvironnement()));
|
||||||
@@ -193,7 +190,8 @@ class module_console_fileEnsureProductionSetting extends Command
|
|||||||
|
|
||||||
$listChecks = false;
|
$listChecks = false;
|
||||||
try {
|
try {
|
||||||
$service = Core\Service\Builder::create(\bootstrap::getCore(), $configuration);
|
echo " at ".__FILE__."\n";
|
||||||
|
$service = Builder::create($this->container, $configuration);
|
||||||
$work_message = '<info>Works !</info>';
|
$work_message = '<info>Works !</info>';
|
||||||
$listChecks = true;
|
$listChecks = true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -418,7 +416,8 @@ class module_console_fileEnsureProductionSetting extends Command
|
|||||||
$configuration = $this->configuration->getService($templateEngineName);
|
$configuration = $this->configuration->getService($templateEngineName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Core\Service\Builder::create(\bootstrap::getCore(), $configuration);
|
echo " at ".__FILE__."\n";
|
||||||
|
Builder::create($this->container, $configuration);
|
||||||
$work_message = '<info>Works !</info>';
|
$work_message = '<info>Works !</info>';
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$work_message = '<error>Failed - could not load template engine !</error>';
|
$work_message = '<error>Failed - could not load template engine !</error>';
|
||||||
@@ -524,7 +523,8 @@ class module_console_fileEnsureProductionSetting extends Command
|
|||||||
$configuration = $this->configuration->getService($ormName);
|
$configuration = $this->configuration->getService($ormName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$service = Core\Service\Builder::create(\bootstrap::getCore(), $configuration);
|
echo " at ".__FILE__."\n";
|
||||||
|
$service = Builder::create($this->container, $configuration);
|
||||||
$work_message = '<info>Works !</info>';
|
$work_message = '<info>Works !</info>';
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$work_message = '<error>Failed - could not connect !</error>';
|
$work_message = '<error>Failed - could not connect !</error>';
|
||||||
@@ -678,9 +678,8 @@ class module_console_fileEnsureProductionSetting extends Command
|
|||||||
try {
|
try {
|
||||||
$conf = $this->configuration->getService($ServiceName);
|
$conf = $this->configuration->getService($ServiceName);
|
||||||
|
|
||||||
$Service = Core\Service\Builder::create(
|
echo " at ".__FILE__."\n";
|
||||||
\bootstrap::getCore(), $conf
|
$Service = Builder::create($this->container, $conf);
|
||||||
);
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -741,9 +740,8 @@ class module_console_fileEnsureProductionSetting extends Command
|
|||||||
try {
|
try {
|
||||||
$originalConfiguration = $this->configuration->getService($ServiceName);
|
$originalConfiguration = $this->configuration->getService($ServiceName);
|
||||||
|
|
||||||
$Service = Core\Service\Builder::create(
|
echo " at ".__FILE__."\n";
|
||||||
\bootstrap::getCore(), $originalConfiguration
|
$Service = Builder::create($this->container, $originalConfiguration);
|
||||||
);
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -809,9 +807,8 @@ class module_console_fileEnsureProductionSetting extends Command
|
|||||||
try {
|
try {
|
||||||
$originalConfiguration = $this->configuration->getService($ServiceName);
|
$originalConfiguration = $this->configuration->getService($ServiceName);
|
||||||
|
|
||||||
$Service = Core\Service\Builder::create(
|
echo " at ".__FILE__."\n";
|
||||||
\bootstrap::getCore(), $originalConfiguration
|
$Service = Builder::create($this->container, $originalConfiguration);
|
||||||
);
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -62,8 +62,7 @@ class module_console_schedulerState extends Command
|
|||||||
return self::EXITCODE_SETUP_ERROR;
|
return self::EXITCODE_SETUP_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
$appbox = $this->getService('phraseanet.appbox');
|
$task_manager = new task_manager($this->container);
|
||||||
$task_manager = new task_manager($appbox);
|
|
||||||
|
|
||||||
$exitCode = 0;
|
$exitCode = 0;
|
||||||
$state = $task_manager->getSchedulerState();
|
$state = $task_manager->getSchedulerState();
|
||||||
|
@@ -39,8 +39,7 @@ class module_console_schedulerStop extends Command
|
|||||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$appbox = $this->getService('phraseanet.appbox');
|
$task_manager = new task_manager($this->container);
|
||||||
$task_manager = new task_manager($appbox);
|
|
||||||
$task_manager->setSchedulerState(task_manager::STATE_TOSTOP);
|
$task_manager->setSchedulerState(task_manager::STATE_TOSTOP);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -44,7 +44,7 @@ class module_console_sphinxGenerateSuggestion extends Command
|
|||||||
$appbox = $this->getService('phraseanet.appbox');
|
$appbox = $this->getService('phraseanet.appbox');
|
||||||
$registry = $appbox->get_registry();
|
$registry = $appbox->get_registry();
|
||||||
|
|
||||||
$params = phrasea::sbas_params();
|
$params = phrasea::sbas_params($this->container);
|
||||||
|
|
||||||
foreach ($params as $sbas_id => $p) {
|
foreach ($params as $sbas_id => $p) {
|
||||||
$index = crc32(
|
$index = crc32(
|
||||||
@@ -77,7 +77,7 @@ class module_console_sphinxGenerateSuggestion extends Command
|
|||||||
exec($cmd);
|
exec($cmd);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$connbas = connection::getPDOConnection($sbas_id);
|
$connbas = connection::getPDOConnection($this->container, $sbas_id);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -54,8 +54,7 @@ class module_console_systemClearCache extends Command
|
|||||||
$filesystem->remove($finder);
|
$filesystem->remove($finder);
|
||||||
|
|
||||||
if (setup::is_installed()) {
|
if (setup::is_installed()) {
|
||||||
$Core = \bootstrap::getCore();
|
$this->getService('phraseanet.cache-service')->flushAll();
|
||||||
$Core['CacheService']->flushAll();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$output->write('Finished !', true);
|
$output->write('Finished !', true);
|
||||||
|
@@ -49,7 +49,7 @@ class module_console_systemConfigCheck extends Command
|
|||||||
$ok = true;
|
$ok = true;
|
||||||
|
|
||||||
if (setup::is_installed()) {
|
if (setup::is_installed()) {
|
||||||
$registry = registry::get_instance();
|
$registry = $this->container['phraseanet.registry'];
|
||||||
|
|
||||||
$output->writeln(_('*** CHECK BINARY CONFIGURATION ***'));
|
$output->writeln(_('*** CHECK BINARY CONFIGURATION ***'));
|
||||||
$ok = $this->processConstraints(setup::check_binaries($registry), $output) && $ok;
|
$ok = $this->processConstraints(setup::check_binaries($registry), $output) && $ok;
|
||||||
@@ -77,7 +77,7 @@ class module_console_systemConfigCheck extends Command
|
|||||||
$ok = $this->processConstraints(setup::check_phrasea(), $output) && $ok;
|
$ok = $this->processConstraints(setup::check_phrasea(), $output) && $ok;
|
||||||
$output->writeln("");
|
$output->writeln("");
|
||||||
$output->writeln(_('*** CHECK SYSTEM LOCALES ***'));
|
$output->writeln(_('*** CHECK SYSTEM LOCALES ***'));
|
||||||
$ok = $this->processConstraints(setup::check_system_locales(), $output) && $ok;
|
$ok = $this->processConstraints(setup::check_system_locales($this->container), $output) && $ok;
|
||||||
$output->writeln("");
|
$output->writeln("");
|
||||||
|
|
||||||
$output->write('Finished !', true);
|
$output->write('Finished !', true);
|
||||||
|
@@ -48,7 +48,7 @@ class module_console_systemMailCheck extends Command
|
|||||||
|
|
||||||
$output->writeln("Processing...");
|
$output->writeln("Processing...");
|
||||||
|
|
||||||
$bad_users = User_Adapter::get_wrong_email_users($appbox);
|
$bad_users = User_Adapter::get_wrong_email_users($this->container);
|
||||||
|
|
||||||
foreach ($bad_users as $email => $users) {
|
foreach ($bad_users as $email => $users) {
|
||||||
if ($input->getOption('list')) {
|
if ($input->getOption('list')) {
|
||||||
@@ -91,7 +91,7 @@ class module_console_systemMailCheck extends Command
|
|||||||
$id = $dialog->ask($output, '<question>Which id ?</question>', '');
|
$id = $dialog->ask($output, '<question>Which id ?</question>', '');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$tmp_user = User_Adapter::getInstance($id, $appbox);
|
$tmp_user = User_Adapter::getInstance($id, $this->container);
|
||||||
|
|
||||||
if ($tmp_user->get_email() != $email) {
|
if ($tmp_user->get_email() != $email) {
|
||||||
throw new Exception('Invalid user');
|
throw new Exception('Invalid user');
|
||||||
|
@@ -46,7 +46,6 @@ class module_console_systemUpgrade extends Command
|
|||||||
require_once dirname(__FILE__) . '/../../../../lib/bootstrap.php';
|
require_once dirname(__FILE__) . '/../../../../lib/bootstrap.php';
|
||||||
|
|
||||||
$interactive = !$input->getOption('yes');
|
$interactive = !$input->getOption('yes');
|
||||||
$Core = $this->getService('phraseanet.core');
|
|
||||||
|
|
||||||
if (!$Core->getConfiguration()->isInstalled() && \setup::needUpgradeConfigurationFile()) {
|
if (!$Core->getConfiguration()->isInstalled() && \setup::needUpgradeConfigurationFile()) {
|
||||||
|
|
||||||
@@ -71,7 +70,7 @@ class module_console_systemUpgrade extends Command
|
|||||||
$connexionInc = new \SplFileInfo(__DIR__ . '/../../../../config/connexion.inc');
|
$connexionInc = new \SplFileInfo(__DIR__ . '/../../../../config/connexion.inc');
|
||||||
$configInc = new \SplFileInfo(__DIR__ . '/../../../../config/config.inc');
|
$configInc = new \SplFileInfo(__DIR__ . '/../../../../config/config.inc');
|
||||||
|
|
||||||
$Core->getConfiguration()->upgradeFromOldConf($configInc, $connexionInc);
|
$this->getService('phraseanet.configuration')->upgradeFromOldConf($configInc, $connexionInc);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw new RuntimeException('Error while upgrading : ' . $e->getMessage());
|
throw new RuntimeException('Error while upgrading : ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
@@ -80,7 +79,7 @@ class module_console_systemUpgrade extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$Core->getConfiguration()->isInstalled()) {
|
if ( ! $this->getService('phraseanet.configuration')->isInstalled()) {
|
||||||
throw new \RuntimeException('Phraseanet must be set-up (no connexion.inc / no config.inc)');
|
throw new \RuntimeException('Phraseanet must be set-up (no connexion.inc / no config.inc)');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +100,7 @@ class module_console_systemUpgrade extends Command
|
|||||||
$output->write('<info>Upgrading...</info>', true);
|
$output->write('<info>Upgrading...</info>', true);
|
||||||
$appbox = $this->getService('phraseanet.appbox');
|
$appbox = $this->getService('phraseanet.appbox');
|
||||||
|
|
||||||
if (count(User_Adapter::get_wrong_email_users($appbox)) > 0) {
|
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>'));
|
return $output->writeln(sprintf('<error>You have to fix your database before upgrade with the system:mailCheck command </error>'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -77,15 +77,14 @@ class module_console_taskState extends Command
|
|||||||
return self::EXITCODE_BAD_ARGUMENT;
|
return self::EXITCODE_BAD_ARGUMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
$appbox = $this->getService('phraseanet.appbox');
|
$task_manager = new task_manager($this->container);
|
||||||
$task_manager = new task_manager($appbox);
|
|
||||||
|
|
||||||
$taskPID = $taskState = NULL;
|
$taskPID = $taskState = NULL;
|
||||||
$exitCode = 0;
|
$exitCode = 0;
|
||||||
|
|
||||||
$task = NULL;
|
$task = NULL;
|
||||||
try {
|
try {
|
||||||
$task = $task_manager->getTask($this->container, $task_id);
|
$task = $task_manager->getTask($task_id);
|
||||||
$taskPID = $task->getPID();
|
$taskPID = $task->getPID();
|
||||||
$taskState = $task->getState();
|
$taskState = $task->getState();
|
||||||
} catch (Exception_NotFound $e) {
|
} catch (Exception_NotFound $e) {
|
||||||
|
@@ -47,8 +47,8 @@ class module_console_tasklist extends Command
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$appbox = $this->getService('phraseanet.appbox');
|
$appbox = $this->getService('phraseanet.appbox');
|
||||||
$task_manager = new task_manager($appbox);
|
$task_manager = new task_manager($this->container);
|
||||||
$tasks = $task_manager->getTasks($this->container);
|
$tasks = $task_manager->getTasks();
|
||||||
|
|
||||||
if (count($tasks) === 0) {
|
if (count($tasks) === 0) {
|
||||||
$output->writeln('No tasks on your install !');
|
$output->writeln('No tasks on your install !');
|
||||||
|
@@ -82,7 +82,7 @@ class module_console_taskrun extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
$appbox = $this->getService('phraseanet.appbox');
|
$appbox = $this->getService('phraseanet.appbox');
|
||||||
$task_manager = new task_manager($appbox);
|
$task_manager = new task_manager($this->container);
|
||||||
|
|
||||||
if ($input->getOption('runner') === task_abstract::RUNNER_MANUAL) {
|
if ($input->getOption('runner') === task_abstract::RUNNER_MANUAL) {
|
||||||
$schedStatus = $task_manager->getSchedulerState();
|
$schedStatus = $task_manager->getSchedulerState();
|
||||||
@@ -107,9 +107,8 @@ class module_console_taskrun extends Command
|
|||||||
|
|
||||||
$logfile = __DIR__ . '/../../../../logs/task_' . $task_id . '.log';
|
$logfile = __DIR__ . '/../../../../logs/task_' . $task_id . '.log';
|
||||||
$handler = new Handler\RotatingFileHandler($logfile, 10);
|
$handler = new Handler\RotatingFileHandler($logfile, 10);
|
||||||
$this->container['phraseanet.core']['monolog']->pushHandler($handler);
|
$this->container['monolog']->pushHandler($handler);
|
||||||
$logger = $this->container['phraseanet.core']['monolog'];
|
$this->task = $task_manager->getTask($task_id, $this->container['monolog']);
|
||||||
$this->task = $task_manager->getTask($task_id, $logger);
|
|
||||||
|
|
||||||
register_tick_function(array($this, 'tick_handler'), true);
|
register_tick_function(array($this, 'tick_handler'), true);
|
||||||
declare(ticks = 1);
|
declare(ticks = 1);
|
||||||
|
Reference in New Issue
Block a user