@@ -27,7 +27,7 @@ |
||
| 27 | 27 | ) { |
| 28 | 28 | |
| 29 | 29 | // parsing configuration |
| 30 | - $this->configuration = new Configuration( DefaultConfiguration::get() ); |
|
| 30 | + $this->configuration = new Configuration(DefaultConfiguration::get()); |
|
| 31 | 31 | $this->configuration->merge($configuration); |
| 32 | 32 | |
| 33 | 33 | // fix the daemon start time |
@@ -14,24 +14,24 @@ |
||
| 14 | 14 | $chars = 60; |
| 15 | 15 | |
| 16 | 16 | // show the header |
| 17 | - $console->br()->border('-',$chars); |
|
| 17 | + $console->br()->border('-', $chars); |
|
| 18 | 18 | $console->bold()->flank('Extender execution summary'); |
| 19 | - $console->border('-',$chars); |
|
| 19 | + $console->border('-', $chars); |
|
| 20 | 20 | $console->out('Total run time: '.self::calculateRunTime($daemon->starttime)); |
| 21 | - $console->border('-',$chars); |
|
| 21 | + $console->border('-', $chars); |
|
| 22 | 22 | $padding = $console->padding(26); |
| 23 | - $padding->label('Total processed jobs')->result($daemon->completedjobs+$daemon->failedjobs); |
|
| 23 | + $padding->label('Total processed jobs')->result($daemon->completedjobs + $daemon->failedjobs); |
|
| 24 | 24 | $padding = $console->padding(30); |
| 25 | 25 | $padding->label('├─ Completed')->result('<light_green>'.$daemon->completedjobs.'</green>'); |
| 26 | 26 | $padding->label('└─ Failed')->result('<red>'.$daemon->failedjobs.'</red>'); |
| 27 | - $console->border('-',$chars); |
|
| 27 | + $console->border('-', $chars); |
|
| 28 | 28 | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | private static function calculateRunTime($starttime) { |
| 32 | 32 | |
| 33 | - $start_formatted = sprintf("%06d",($starttime - floor($starttime)) * 1000000); |
|
| 34 | - $start = new DateTime( date('Y-m-d H:i:s.'.$start_formatted, $starttime) ); |
|
| 33 | + $start_formatted = sprintf("%06d", ($starttime - floor($starttime)) * 1000000); |
|
| 34 | + $start = new DateTime(date('Y-m-d H:i:s.'.$start_formatted, $starttime)); |
|
| 35 | 35 | $end = new DateTime(); |
| 36 | 36 | |
| 37 | 37 | $diff = $end->diff($start); |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | |
| 10 | 10 | $daemon = $event->getDaemon(); |
| 11 | 11 | |
| 12 | - if ( $daemon->looplimit === $daemon->loopcount) { |
|
| 12 | + if ( $daemon->looplimit === $daemon->loopcount ) { |
|
| 13 | 13 | $daemon->logger->info('Stopping daemon due to loop limit ('.$daemon->looplimit.') reached'); |
| 14 | 14 | // $daemon->stop(); |
| 15 | 15 | $daemon->loopactive = false; |
@@ -14,10 +14,10 @@ |
||
| 14 | 14 | |
| 15 | 15 | if ( empty($jobs) ) return; |
| 16 | 16 | |
| 17 | - $console->border('-',30); |
|
| 17 | + $console->border('-', 30); |
|
| 18 | 18 | $console->bold()->green('Extender loop summary'); |
| 19 | 19 | $console->out("Loop duration: ".round($daemon->loopelapsed)); |
| 20 | - $console->border('-',30); |
|
| 20 | + $console->border('-', 30); |
|
| 21 | 21 | $console->out("Executed jobs: "); |
| 22 | 22 | $console->table($jobs); |
| 23 | 23 | |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - public static function filterNiceness($niceness=null) { |
|
| 82 | + public static function filterNiceness($niceness = null) { |
|
| 83 | 83 | |
| 84 | 84 | return filter_var($niceness, FILTER_VALIDATE_INT, array( |
| 85 | 85 | 'options' => array( |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | use DataAccessTrait; |
| 32 | 32 | |
| 33 | - public function __construct($name, $id, $task, $class, $parameters=array()) { |
|
| 33 | + public function __construct($name, $id, $task, $class, $parameters = array()) { |
|
| 34 | 34 | |
| 35 | 35 | $this->name = $name; |
| 36 | 36 | $this->id = $id; |
@@ -36,10 +36,7 @@ |
||
| 36 | 36 | * |
| 37 | 37 | * @param array $parameters Array of parameters (if any) |
| 38 | 38 | * @param \Monolog\Logger $logger |
| 39 | - * @param int $pid Task PID (if any) |
|
| 40 | 39 | * @param string $name Task Name |
| 41 | - * @param int $timestamp Start timestamp (if null will be retrieved directly) |
|
| 42 | - * @param bool $multithread Multithread switch |
|
| 43 | 40 | * |
| 44 | 41 | * @return Object $this |
| 45 | 42 | */ |
@@ -32,10 +32,7 @@ |
||
| 32 | 32 | * |
| 33 | 33 | * @param array $parameters Array of parameters (if any) |
| 34 | 34 | * @param \Monolog\Logger $logger |
| 35 | - * @param int $pid Task PID (if any) |
|
| 36 | 35 | * @param string $name Task Name |
| 37 | - * @param int $timestamp Start timestamp (if null will be retrieved directly) |
|
| 38 | - * @param bool $multithread Multithread switch |
|
| 39 | 36 | * |
| 40 | 37 | * @return Object $this |
| 41 | 38 | */ |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->dbh |
| 47 | 47 | ->createQueryBuilder() |
| 48 | 48 | ->insert($this->table) |
| 49 | - ->values(array ( |
|
| 49 | + ->values(array( |
|
| 50 | 50 | 'status' => 'RUNNING', |
| 51 | 51 | 'pid' => '?', |
| 52 | 52 | 'name' => '?', |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | ->createQueryBuilder() |
| 73 | 73 | ->update($this->table) |
| 74 | 74 | ->where("id = $wid") |
| 75 | - ->values(array ( |
|
| 75 | + ->values(array( |
|
| 76 | 76 | 'status' => 'FINISHED', |
| 77 | 77 | 'success' => '?', |
| 78 | 78 | 'result' => '?', |