changes asked on last pull requaest

This commit is contained in:
jygaulier
2012-05-22 18:50:45 +02:00
parent b6be659242
commit 1d58f89c36
15 changed files with 429 additions and 251 deletions

View File

@@ -61,14 +61,20 @@ class module_console_schedulerStart extends Command
return 1;
}
require_once __DIR__ . '/../../../../lib/bootstrap.php';
try {
$scheduler = new task_Scheduler();
$scheduler->run($input, $output);
} catch (\Exception $e) {
return $e->getCode();
switch($e->getCode())
{
case task_Scheduler::ERR_ALREADY_RUNNING: // 114 : aka EALREADY (Operation already in progress)
$exitCode = ERR_ALREADY_RUNNING;
break;
default:
$exitCode = 1; // default exit code (error)
break;
}
return $exitCode;
}
}
}

View File

@@ -72,8 +72,6 @@ class module_console_taskState extends Command
return self::EXITCODE_BAD_ARGUMENT;
}
require_once __DIR__ . '/../../../../lib/bootstrap.php';
$appbox = appbox::get_instance(\bootstrap::getCore());
$task_manager = new task_manager($appbox);

View File

@@ -12,7 +12,6 @@
/**
* @todo write tests
*
* @package KonsoleKomander
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
@@ -69,6 +68,7 @@ class module_console_taskrun extends Command
{
if ( ! setup::is_installed()) {
$output->writeln('Phraseanet is not set up');
return 1;
}
@@ -106,6 +106,7 @@ class module_console_taskrun extends Command
$this->task->run($runner, $input, $output);
} catch (Exception $e) {
$this->task->log(sprintf("taskrun : exception from 'run()', %s \n", $e->getMessage()));
return($e->getCode());
}