Completed
Pull Request — master (#131)
by Janis
04:50
created
lib/Service/RedisService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
                 throw new NotFoundException($this->l10n->t('Could not add files to the Redis OCR processing queue.'));
108 108
             }
109 109
         } catch (Exception $e) {
110
-            $this->fileUtil->execRemove($this->tempM->getTempBaseDir().'/'.$job->getTempFile().'.pdf');
110
+            $this->fileUtil->execRemove($this->tempM->getTempBaseDir() . '/' . $job->getTempFile() . '.pdf');
111 111
             $job->setStatus(OcrConstants::STATUS_FAILED);
112 112
             $job->setErrorLog($e->getMessage());
113 113
             $this->mapper->update($job);
Please login to merge, or discard this patch.
lib/Service/JobService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                 foreach ($fileInfo as $fInfo) {
157 157
                     // Check Shared
158 158
                     $shared = $this->fileService->checkSharedWithInitiator($fInfo);
159
-                    if($shared && $replace) {
159
+                    if ($shared && $replace) {
160 160
                         throw new NotFoundException($this->l10n->t('Cannot replace shared files.'));
161 161
                     }
162 162
                     $target = $this->fileService->buildTarget($fInfo, $shared, $replace);
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
             $this->logger->debug('Check if files were processed by ocr and if so, put them to the right dirs.');
275 275
             $processed = $this->jobMapper->findAllProcessed($this->userId);
276 276
             foreach ($processed as $job) {
277
-                if ($this->fileUtil->fileExists($this->tempM->getTempBaseDir().'/'.$job->getTempFile().'.pdf')) {
277
+                if ($this->fileUtil->fileExists($this->tempM->getTempBaseDir() . '/' . $job->getTempFile() . '.pdf')) {
278 278
                     // Save the tmp file with newname
279 279
                     $this->pullResult($job);
280 280
                     $this->jobMapper->delete($job);
281
-                    $this->fileUtil->execRemove($this->tempM->getTempBaseDir().'/'.$job->getTempFile().'.pdf');
281
+                    $this->fileUtil->execRemove($this->tempM->getTempBaseDir() . '/' . $job->getTempFile() . '.pdf');
282 282
                 } else {
283 283
                     $job->setStatus(OcrConstants::STATUS_FAILED);
284 284
                     $job->setErrorLog('Temp file does not exist.');
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
             $failed = $this->jobMapper->findAllFailed($this->userId);
303 303
             foreach ($failed as $job) {
304 304
                 // clean the tempfile
305
-                $this->fileUtil->execRemove($this->tempM->getTempBaseDir().'/'.$job->getTempFile().'.pdf');
305
+                $this->fileUtil->execRemove($this->tempM->getTempBaseDir() . '/' . $job->getTempFile() . '.pdf');
306 306
                 // set error displayed
307 307
                 $job->setErrorDisplayed(true);
308 308
                 $this->jobMapper->update($job);
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
         if ($job->getReplace()) {
327 327
             $this->view->unlink(str_replace($this->userId . '/files', '', $job->getSource()));
328 328
         }
329
-        $result = $this->view->file_put_contents($job->getTarget(), $this->fileUtil->getFileContents($this->tempM->getTempBaseDir().'/'.$job->getTempFile().'.pdf'));
329
+        $result = $this->view->file_put_contents($job->getTarget(), $this->fileUtil->getFileContents($this->tempM->getTempBaseDir() . '/' . $job->getTempFile() . '.pdf'));
330 330
         if (!$result) {
331 331
             throw new NotFoundException($this->l10n->t('OCR could not put processed file to the right target folder. If you selected the replace option, you can restore the file by using the trash bin.'));
332 332
         }
Please login to merge, or discard this patch.