@@ -67,19 +67,19 @@ |
||
67 | 67 | $originFileName = $fileName; |
68 | 68 | $counter = 0; |
69 | 69 | |
70 | - while (file_exists($this->uploadDir .'/'. $fileName .'.'. $pathinfo['extension'])) { |
|
70 | + while (file_exists($this->uploadDir.'/'.$fileName.'.'.$pathinfo['extension'])) { |
|
71 | 71 | $counter++; |
72 | - $fileName = $originFileName .'-'. $counter; |
|
72 | + $fileName = $originFileName.'-'.$counter; |
|
73 | 73 | } |
74 | 74 | |
75 | - $filePath = $this->uploadDir .'/'. $fileName .'.'. $pathinfo['extension']; |
|
75 | + $filePath = $this->uploadDir.'/'.$fileName.'.'.$pathinfo['extension']; |
|
76 | 76 | |
77 | 77 | // Setup new name and move to user directory |
78 | 78 | $file->moveTo($filePath); |
79 | 79 | |
80 | 80 | $publicDir = substr($this->uploadDir, strlen(PATH_PUBLIC) + 1); |
81 | 81 | |
82 | - $data['file'] = $publicDir .'/'. $fileName .'.'. $pathinfo['extension']; |
|
82 | + $data['file'] = $publicDir.'/'.$fileName.'.'.$pathinfo['extension']; |
|
83 | 83 | $data['type'] = $file->getClientMediaType(); |
84 | 84 | |
85 | 85 | $row = $this->getTable()->create(); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | public function createThumbnail() |
59 | 59 | { |
60 | 60 | // set full path |
61 | - $image = new Thumbnail(PATH_PUBLIC .'/'. $this->file); |
|
61 | + $image = new Thumbnail(PATH_PUBLIC.'/'.$this->file); |
|
62 | 62 | $image->setHeight(self::THUMB_HEIGHT); |
63 | 63 | $image->setWidth(self::THUMB_WIDTH); |
64 | 64 | $thumb = $image->generate(); |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function deleteFiles() |
78 | 78 | { |
79 | - if ($this->file && is_file(PATH_PUBLIC .'/'. $this->file)) { |
|
80 | - @unlink(PATH_PUBLIC .'/'. $this->file); |
|
79 | + if ($this->file && is_file(PATH_PUBLIC.'/'.$this->file)) { |
|
80 | + @unlink(PATH_PUBLIC.'/'.$this->file); |
|
81 | 81 | } |
82 | - if ($this->thumb && is_file(PATH_PUBLIC .'/'. $this->thumb)) { |
|
83 | - @unlink(PATH_PUBLIC .'/'. $this->thumb); |
|
82 | + if ($this->thumb && is_file(PATH_PUBLIC.'/'.$this->thumb)) { |
|
83 | + @unlink(PATH_PUBLIC.'/'.$this->thumb); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * |
21 | 21 | * @return array |
22 | 22 | */ |
23 | -return function () { |
|
23 | +return function() { |
|
24 | 24 | /** |
25 | 25 | * @var Controller $this |
26 | 26 | */ |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * @throws \Bluz\Application\Exception\ForbiddenException |
30 | 30 | * @throws \Bluz\Application\Exception\NotImplementedException |
31 | 31 | */ |
32 | -return function () { |
|
32 | +return function() { |
|
33 | 33 | /** |
34 | 34 | * @var Controller $this |
35 | 35 | */ |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @throws ConfigException |
26 | 26 | * @throws Exception |
27 | 27 | */ |
28 | -return function () { |
|
28 | +return function() { |
|
29 | 29 | /** |
30 | 30 | * @var Controller $this |
31 | 31 | * @var UploadedFile $file |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $original = pathinfo($file->getClientFilename(), PATHINFO_FILENAME); |
41 | 41 | |
42 | 42 | // rename file to date/time stamp |
43 | - $filename = date('Ymd_Hi') .'.'. pathinfo($file->getClientFilename(), PATHINFO_EXTENSION); |
|
43 | + $filename = date('Ymd_Hi').'.'.pathinfo($file->getClientFilename(), PATHINFO_EXTENSION); |
|
44 | 44 | |
45 | 45 | // switch to JSON response |
46 | 46 | $this->useJson(); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * @return array |
20 | 20 | * @throws Exception |
21 | 21 | */ |
22 | -return function () { |
|
22 | +return function() { |
|
23 | 23 | /** |
24 | 24 | * @var Controller $this |
25 | 25 | */ |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @return string |
19 | 19 | * @throws Exception |
20 | 20 | */ |
21 | -return function ($file) { |
|
21 | +return function($file) { |
|
22 | 22 | /** |
23 | 23 | * @var Controller $this |
24 | 24 | */ |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | session_start(); |
29 | 29 | } |
30 | 30 | |
31 | - $key = ini_get("session.upload_progress.prefix") . $file; |
|
31 | + $key = ini_get("session.upload_progress.prefix").$file; |
|
32 | 32 | |
33 | 33 | if (!isset($_SESSION[$key])) { |
34 | 34 | throw new Exception("Invalid file identity"); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | /** |
17 | 17 | * @return void |
18 | 18 | */ |
19 | -return function () { |
|
19 | +return function() { |
|
20 | 20 | /** |
21 | 21 | * @var Controller $this |
22 | 22 | */ |