@@ -18,8 +18,8 @@ |
||
| 18 | 18 | * it's instantiated in there |
| 19 | 19 | */ |
| 20 | 20 | return [ |
| 21 | - 'routes' => [ |
|
| 21 | + 'routes' => [ |
|
| 22 | 22 | ['name' => 'ocr#process', 'url' => '/process', 'verb' => 'GET'], |
| 23 | 23 | ['name' => 'ocr#languages', 'url' => '/languages', 'verb' => 'GET'], |
| 24 | - ] |
|
| 24 | + ] |
|
| 25 | 25 | ]; |
| 26 | 26 | \ No newline at end of file |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | /** |
| 39 | 39 | * Checks if a worker is active and registered at the Gearman Job Server. |
| 40 | 40 | * returns false if not. |
| 41 | - * @return bool |
|
| 41 | + * @return boolean|null |
|
| 42 | 42 | */ |
| 43 | 43 | public function workerExists(){ |
| 44 | 44 | try { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * Processes and prepares the files for ocr. |
| 131 | 131 | * Sends the stuff to the gearman client in order to ocr async. |
| 132 | 132 | * |
| 133 | - * @param $language |
|
| 133 | + * @param string $language |
|
| 134 | 134 | * @param array $files |
| 135 | 135 | * @return string |
| 136 | 136 | */ |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | * the gearman worker should call it automatically after each processing step. |
| 200 | 200 | * |
| 201 | 201 | * @param $statusId |
| 202 | - * @param $failed |
|
| 202 | + * @param boolean $failed |
|
| 203 | 203 | */ |
| 204 | 204 | public function complete($statusId, $failed){ |
| 205 | 205 | try{ |
@@ -334,12 +334,13 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | /** |
| 336 | 336 | * Inits the Gearman client and sends the task to the background worker (async) |
| 337 | - * @param $type |
|
| 337 | + * @param string $type |
|
| 338 | 338 | * @param $datadirectory |
| 339 | 339 | * @param $path |
| 340 | 340 | * @param $tempFile |
| 341 | 341 | * @param $language |
| 342 | 342 | * @param $statusId |
| 343 | + * @param OcrStatus $status |
|
| 343 | 344 | */ |
| 344 | 345 | private function sendGearmanJob($type, $datadirectory, $path, $tempFile, $language, $status, $occDir){ |
| 345 | 346 | try { |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | $worker->addServer('127.0.0.1',4730); |
| 5 | 5 | |
| 6 | 6 | $worker->addFunction(/** |
| 7 | - * @param GearmanJob $job |
|
| 8 | - */ |
|
| 7 | + * @param GearmanJob $job |
|
| 8 | + */ |
|
| 9 | 9 | "ocr", function(GearmanJob $job) { |
| 10 | 10 | $workload = json_decode($job->workload()); |
| 11 | 11 | if($workload->type == 'tess'){ |