@@ -8,7 +8,7 @@ |
||
8 | 8 | /** |
9 | 9 | * @param Core\Services\AuthService\AuthService |
10 | 10 | * @return AuthService |
11 | - */ |
|
11 | + */ |
|
12 | 12 | protected static function getFacadeAccessor() |
13 | 13 | { |
14 | 14 | return 'ImageService'; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | /** |
16 | 16 | * @param Core\Services\AuthService\AuthService |
17 | 17 | * @return AuthService |
18 | - */ |
|
18 | + */ |
|
19 | 19 | protected static function getFacadeAccessor() |
20 | 20 | { |
21 | 21 | return 'FileService'; |
@@ -6,17 +6,17 @@ |
||
6 | 6 | |
7 | 7 | class FileService extends _Service |
8 | 8 | { |
9 | - public function moveUploadedFile($directory,$fileName, UploadedFile $uploadedFile) |
|
10 | - { |
|
11 | - $extension = pathinfo($uploadedFile->getClientFilename(), PATHINFO_EXTENSION); |
|
12 | - $basename = bin2hex(random_bytes(8)); // see http://php.net/manual/en/function.random-bytes.php |
|
13 | - $filename = sprintf('%s.%0.8s', $fileName, $extension); |
|
14 | - $uploadedFile->moveTo($directory . DIRECTORY_SEPARATOR . $filename); |
|
15 | - return $directory . DIRECTORY_SEPARATOR . $filename; |
|
16 | - } |
|
17 | - public function delete($file) |
|
18 | - { |
|
19 | - @unlink($file); |
|
20 | - } |
|
9 | + public function moveUploadedFile($directory,$fileName, UploadedFile $uploadedFile) |
|
10 | + { |
|
11 | + $extension = pathinfo($uploadedFile->getClientFilename(), PATHINFO_EXTENSION); |
|
12 | + $basename = bin2hex(random_bytes(8)); // see http://php.net/manual/en/function.random-bytes.php |
|
13 | + $filename = sprintf('%s.%0.8s', $fileName, $extension); |
|
14 | + $uploadedFile->moveTo($directory . DIRECTORY_SEPARATOR . $filename); |
|
15 | + return $directory . DIRECTORY_SEPARATOR . $filename; |
|
16 | + } |
|
17 | + public function delete($file) |
|
18 | + { |
|
19 | + @unlink($file); |
|
20 | + } |
|
21 | 21 | |
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -17,12 +17,12 @@ |
||
17 | 17 | } |
18 | 18 | $i=0; |
19 | 19 | foreach($filesInConfig as $config_file){ |
20 | - if($config_file === 'phpmig.php'){continue;} |
|
21 | - $file[$i] = include_once __APP_ROOT__.'config/'.$config_file; |
|
22 | - if(is_array($file[$i])){ |
|
23 | - $configs = array_merge($configs, $file[$i]); |
|
24 | - $i++; |
|
25 | - } |
|
20 | + if($config_file === 'phpmig.php'){continue;} |
|
21 | + $file[$i] = include_once __APP_ROOT__.'config/'.$config_file; |
|
22 | + if(is_array($file[$i])){ |
|
23 | + $configs = array_merge($configs, $file[$i]); |
|
24 | + $i++; |
|
25 | + } |
|
26 | 26 | |
27 | 27 | } |
28 | 28 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | 'm' => [400,250,70], |
11 | 11 | 'l' => [800,600,80], |
12 | 12 | 'thumb' => [250, 250,80,true], |
13 | - ], |
|
13 | + ], |
|
14 | 14 | ], |
15 | 15 | 'minquality' => 200 // kamtar az in width va height nemigirim |
16 | 16 | ] |