mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
many renames to camelcase
This commit is contained in:
@@ -53,7 +53,7 @@ class module_console_schedulerStart extends Command
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function execute(InputInterface $zinput, OutputInterface $output)
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ( ! setup::is_installed()) {
|
||||
$output->writeln('Phraseanet is not set up');
|
||||
@@ -65,8 +65,9 @@ class module_console_schedulerStart extends Command
|
||||
|
||||
try {
|
||||
$scheduler = new task_Scheduler();
|
||||
$scheduler->run($zinput, $output);
|
||||
$scheduler->run($input, $output);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
return $e->getCode();
|
||||
}
|
||||
}
|
||||
|
@@ -47,10 +47,11 @@ class module_console_schedulerStop extends Command
|
||||
try {
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new task_manager($appbox);
|
||||
$task_manager->set_sched_status(task_manager::STATUS_SCHED_TOSTOP);
|
||||
$task_manager->setSchedulerState(task_manager::STATUS_SCHED_TOSTOP);
|
||||
|
||||
return 0;
|
||||
} catch (\Exception $e) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -48,14 +48,14 @@ class module_console_tasklist extends Command
|
||||
try {
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new task_manager($appbox);
|
||||
$tasks = $task_manager->get_tasks();
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
if (count($tasks) === 0) {
|
||||
$output->writeln('No tasks on your install !');
|
||||
}
|
||||
|
||||
foreach ($tasks as $task) {
|
||||
$this->print_task($task, $output);
|
||||
$this->printTask($task, $output);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -64,9 +64,9 @@ class module_console_tasklist extends Command
|
||||
}
|
||||
}
|
||||
|
||||
protected function print_task(task_abstract $task, OutputInterface &$output)
|
||||
protected function printTask(task_abstract $task, OutputInterface &$output)
|
||||
{
|
||||
$message = $task->get_task_id() . "\t" . ($task->get_status() ) . "\t" . $task->get_title();
|
||||
$message = $task->getID() . "\t" . ($task->getState() ) . "\t" . $task->getTitle();
|
||||
$output->writeln($message);
|
||||
|
||||
return $this;
|
||||
|
@@ -61,7 +61,7 @@ class module_console_taskrun extends Command
|
||||
if ($this->task) {
|
||||
$this->task->log(sprintf("signal %s received", $signo));
|
||||
if ($signo == SIGTERM)
|
||||
$this->task->set_running(false);
|
||||
$this->task->setRunning(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,11 +78,10 @@ class module_console_taskrun extends Command
|
||||
|
||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new task_manager($appbox);
|
||||
$this->task = $task_manager->get_task($task_id);
|
||||
$this->task = $task_manager->getTask($task_id);
|
||||
|
||||
if ($input->getOption('runner') === task_abstract::RUNNER_MANUAL) {
|
||||
$schedStatus = $task_manager->get_scheduler_state();
|
||||
// printf("%s (%d) schedStatus=%s \n", __FILE__, __LINE__, var_export($schedStatus, true));
|
||||
$schedStatus = $task_manager->getSchedulerState();
|
||||
|
||||
if ($schedStatus && $schedStatus['status'] == 'running' && $schedStatus['pid'])
|
||||
$this->shedulerPID = $schedStatus['pid'];
|
||||
@@ -90,7 +89,7 @@ class module_console_taskrun extends Command
|
||||
}
|
||||
else {
|
||||
$runner = task_abstract::RUNNER_SCHEDULER;
|
||||
$schedStatus = $task_manager->get_scheduler_state();
|
||||
$schedStatus = $task_manager->getSchedulerState();
|
||||
if ($schedStatus && $schedStatus['status'] == 'running' && $schedStatus['pid'])
|
||||
$this->shedulerPID = $schedStatus['pid'];
|
||||
}
|
||||
@@ -102,7 +101,6 @@ class module_console_taskrun extends Command
|
||||
|
||||
try {
|
||||
$this->task->run($runner, $input, $output);
|
||||
// $this->task->log(sprintf("%s [%d] taskrun : returned from 'run()', get_status()=%s \n", __FILE__, __LINE__, $this->task->get_status()));
|
||||
} catch (Exception $e) {
|
||||
$this->task->log(sprintf("taskrun : exception from 'run()', %s \n", $e->getMessage()));
|
||||
return($e->getCode());
|
||||
@@ -122,13 +120,12 @@ class module_console_taskrun extends Command
|
||||
}
|
||||
|
||||
if (time() - $start > 0) {
|
||||
// printf("%s (%d) : tick\n", __FILE__, __LINE__);
|
||||
if ($this->shedulerPID) {
|
||||
if ( ! posix_kill($this->shedulerPID, 0)) {
|
||||
if (method_exists($this->task, 'signal'))
|
||||
$this->task->signal('SIGNAL_SCHEDULER_DIED');
|
||||
else
|
||||
$this->task->set_status(task_abstract::STATUS_TOSTOP);
|
||||
$this->task->setState(task_abstract::STATUS_TOSTOP);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user