@@ -11,13 +11,10 @@ |
||
| 11 | 11 | |
| 12 | 12 | namespace Icybee\Modules\Files\Block; |
| 13 | 13 | |
| 14 | -use ICanBoogie\I18n; |
|
| 15 | 14 | use ICanBoogie\Operation; |
| 16 | - |
|
| 17 | 15 | use Brickrouge\Element; |
| 18 | 16 | use Brickrouge\Document; |
| 19 | 17 | use Brickrouge\Form; |
| 20 | - |
|
| 21 | 18 | use Icybee\Modules\Files as Root; |
| 22 | 19 | use Icybee\Modules\Files\File; |
| 23 | 20 | |
@@ -75,8 +75,7 @@ |
||
| 75 | 75 | try |
| 76 | 76 | { |
| 77 | 77 | $path = $this->record->pathname->relative; |
| 78 | - } |
|
| 79 | - catch (\Exception $e) |
|
| 78 | + } catch (\Exception $e) |
|
| 80 | 79 | { |
| 81 | 80 | # |
| 82 | 81 | # the associated file might have disappeared |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use ICanBoogie\Errors; |
| 15 | 15 | use ICanBoogie\HTTP\Request; |
| 16 | 16 | use ICanBoogie\HTTP\File as HTTPFile; |
| 17 | - |
|
| 18 | 17 | use Icybee\Modules\Files\File; |
| 19 | 18 | use Icybee\Modules\Files\Module; |
| 20 | 19 | |
@@ -114,8 +114,7 @@ discard block |
||
| 114 | 114 | $pathname = \ICanBoogie\REPOSITORY . 'tmp' . DIRECTORY_SEPARATOR . $filename; |
| 115 | 115 | |
| 116 | 116 | $file->move($pathname); |
| 117 | - } |
|
| 118 | - else if ($path && strpos($path, \ICanBoogie\strip_root(\ICanBoogie\REPOSITORY . "files")) !== 0) |
|
| 117 | + } else if ($path && strpos($path, \ICanBoogie\strip_root(\ICanBoogie\REPOSITORY . "files")) !== 0) |
|
| 119 | 118 | { |
| 120 | 119 | $file = $this->resolve_request_file_from_pathname($path); |
| 121 | 120 | |
@@ -175,8 +174,7 @@ discard block |
||
| 175 | 174 | |
| 176 | 175 | ]); |
| 177 | 176 | } |
| 178 | - } |
|
| 179 | - else if (!$this->key) |
|
| 177 | + } else if (!$this->key) |
|
| 180 | 178 | { |
| 181 | 179 | $errors->add(File::HTTP_FILE, "File is required."); |
| 182 | 180 | } |
@@ -12,12 +12,10 @@ |
||
| 12 | 12 | namespace Icybee\Modules\Files\Routing; |
| 13 | 13 | |
| 14 | 14 | use ICanBoogie\HTTP\FileResponse; |
| 15 | -use ICanBoogie\HTTP\Request; |
|
| 16 | 15 | use ICanBoogie\Routing\Controller; |
| 17 | 16 | use ICanBoogie\Binding\Routing\ControllerBindings; |
| 18 | 17 | use ICanBoogie\Binding\Routing\ForwardUndefinedPropertiesToApplication; |
| 19 | 18 | use ICanBoogie\Module\ControllerBindings as ModuleBindings; |
| 20 | - |
|
| 21 | 19 | use Icybee\Modules\Files\Binding\CoreBindings; |
| 22 | 20 | use Icybee\Modules\Files\File; |
| 23 | 21 | |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | if (in_array($value, [ 'l', 'm', 's' ])) |
| 33 | 33 | { |
| 34 | 34 | $filters['size'] = $value; |
| 35 | - } |
|
| 36 | - else |
|
| 35 | + } else |
|
| 37 | 36 | { |
| 38 | 37 | unset($filters['size']); |
| 39 | 38 | } |
@@ -45,8 +45,7 @@ discard block |
||
| 45 | 45 | mkdir($path); |
| 46 | 46 | |
| 47 | 47 | file_put_contents($path . DIRECTORY_SEPARATOR . '.htaccess', 'Deny from all'); |
| 48 | - } |
|
| 49 | - else |
|
| 48 | + } else |
|
| 50 | 49 | { |
| 51 | 50 | $errors->add($this->id, "Unable to create %directory directory, its parent is not writable.", [ '%directory' => $path ]); |
| 52 | 51 | } |
@@ -67,8 +66,7 @@ discard block |
||
| 67 | 66 | mkdir($path); |
| 68 | 67 | |
| 69 | 68 | file_put_contents($path . DIRECTORY_SEPARATOR . '.htaccess', 'Allow from all'); |
| 70 | - } |
|
| 71 | - else |
|
| 69 | + } else |
|
| 72 | 70 | { |
| 73 | 71 | $errors->add($this->id, "Unable to create %directory directory, its parent is not writable", [ '%directory' => $path ]); |
| 74 | 72 | } |
@@ -89,8 +87,7 @@ discard block |
||
| 89 | 87 | mkdir($path); |
| 90 | 88 | |
| 91 | 89 | file_put_contents($path . DIRECTORY_SEPARATOR . '.htaccess', 'Deny from all'); |
| 92 | - } |
|
| 93 | - else |
|
| 90 | + } else |
|
| 94 | 91 | { |
| 95 | 92 | $errors->add($this->id, 'Unable to create %directory directory, its parent is not writable', [ '%directory' => $path ]); |
| 96 | 93 | } |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | namespace Icybee\Modules\Files; |
| 13 | 13 | |
| 14 | 14 | use Brickrouge\Element; |
| 15 | -use ICanBoogie\I18n; |
|
| 16 | 15 | |
| 17 | 16 | class FileUpload extends \Brickrouge\File |
| 18 | 17 | { |
@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use ICanBoogie\Errors; |
| 15 | 15 | use ICanBoogie\HTTP\Request; |
| 16 | 16 | use ICanBoogie\HTTP\File as HTTPFile; |
| 17 | - |
|
| 18 | 17 | use Icybee\Modules\Files\File; |
| 19 | 18 | use Icybee\Modules\Files\Module; |
| 20 | 19 | |
@@ -12,12 +12,10 @@ |
||
| 12 | 12 | namespace Icybee\Modules\Files\Routing; |
| 13 | 13 | |
| 14 | 14 | use ICanBoogie\HTTP\FileResponse; |
| 15 | -use ICanBoogie\HTTP\Request; |
|
| 16 | 15 | use ICanBoogie\Routing\Controller; |
| 17 | 16 | use ICanBoogie\Binding\Routing\ControllerBindings; |
| 18 | 17 | use ICanBoogie\Binding\Routing\ForwardUndefinedPropertiesToApplication; |
| 19 | 18 | use ICanBoogie\Module\ControllerBindings as ModuleBindings; |
| 20 | - |
|
| 21 | 19 | use Icybee\Modules\Files\Binding\CoreBindings; |
| 22 | 20 | use Icybee\Modules\Files\File; |
| 23 | 21 | |