@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | |
15 | 15 | public static function uploadMaxSizeCheck ($value,$context){ |
16 | - return $value['error'] != UPLOAD_ERR_INI_SIZE; |
|
16 | + return $value['error'] != UPLOAD_ERR_INI_SIZE; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
@@ -76,6 +76,7 @@ |
||
76 | 76 | * normalResizeSet |
77 | 77 | * 通常のリサイズ処理 |
78 | 78 | * @author hagiwara |
79 | + * @param string $filepath |
|
79 | 80 | */ |
80 | 81 | private function normalResizeSet($filepath, $resize) |
81 | 82 | { |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $file = $filepath; |
62 | 62 | |
63 | 63 | header('Content-Length: ' . filesize($file)); |
64 | - if(!empty($fileExt)) { |
|
64 | + if (!empty($fileExt)) { |
|
65 | 65 | $fileContentType = $this->getFileType($fileExt); |
66 | 66 | header('Content-Type: ' . $fileContentType); |
67 | 67 | } else { |
@@ -73,6 +73,7 @@ |
||
73 | 73 | * s3ResizeSet |
74 | 74 | * S3のリサイズ処理 |
75 | 75 | * @author hagiwara |
76 | + * @param string $filepath |
|
76 | 77 | */ |
77 | 78 | private function s3ResizeSet($filepath, $resize) |
78 | 79 | { |
@@ -321,6 +321,8 @@ |
||
321 | 321 | * mkdir |
322 | 322 | * ディレクトリの作成(パーミッションの設定のため |
323 | 323 | * @author hagiwara |
324 | + * @param integer $permission |
|
325 | + * @param boolean $recursive |
|
324 | 326 | */ |
325 | 327 | private function mkdir($path, $permission, $recursive) |
326 | 328 | { |
@@ -283,8 +283,9 @@ |
||
283 | 283 | break; |
284 | 284 | } |
285 | 285 | } |
286 | - if (!isset($tp) || $tp !== null) |
|
287 | - break; |
|
286 | + if (!isset($tp) || $tp !== null) { |
|
287 | + break; |
|
288 | + } |
|
288 | 289 | } |
289 | 290 | // 透過GIF |
290 | 291 | if (isset($tp) && is_array($tp)) { |
@@ -85,6 +85,9 @@ |
||
85 | 85 | return true; |
86 | 86 | } |
87 | 87 | |
88 | + /** |
|
89 | + * @param string $newFilepath |
|
90 | + */ |
|
88 | 91 | private function normalImageResize($newFilepath, $resizeSettings) |
89 | 92 | { |
90 | 93 | return $this->imageResize($newFilepath, $resizeSettings); |
@@ -4,10 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Cake\Core\Configure; |
6 | 6 | use Cake\Filesystem\Folder; |
7 | -use Cake\I18n\Time; |
|
8 | 7 | use Cake\Network\Exception\InternalErrorException; |
9 | -use Cake\ORM\TableRegistry; |
|
10 | -use Cake\Utility\Security; |
|
11 | 8 | |
12 | 9 | /** |
13 | 10 | * NormalContentsFileBehaviorTrait |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $newFilepath = $newFiledir . $fileInfo['field_name']; |
42 | 42 | if ( |
43 | 43 | !$this->mkdir($newFiledir, 0777, true) || |
44 | - !rename(Configure::read('ContentsFile.Setting.Normal.tmpDir') . $fileInfo['tmp_file_name'] , $newFilepath) |
|
44 | + !rename(Configure::read('ContentsFile.Setting.Normal.tmpDir') . $fileInfo['tmp_file_name'], $newFilepath) |
|
45 | 45 | ) { |
46 | 46 | return false; |
47 | 47 | } |
@@ -94,6 +94,7 @@ |
||
94 | 94 | * s3ImageResize |
95 | 95 | * 画像のリサイズ処理(S3用) |
96 | 96 | * @author hagiwara |
97 | + * @param string $filepath |
|
97 | 98 | */ |
98 | 99 | public function s3ImageResize($filepath, $resize) |
99 | 100 | { |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use Cake\Filesystem\Folder; |
8 | 8 | use Cake\I18n\Time; |
9 | 9 | use Cake\Network\Exception\InternalErrorException; |
10 | -use Cake\ORM\TableRegistry; |
|
11 | 10 | use Cake\Utility\Security; |
12 | 11 | |
13 | 12 | /** |
@@ -159,6 +159,7 @@ |
||
159 | 159 | * tmpディレクトリへのアップロード |
160 | 160 | * |
161 | 161 | * @author hagiwara |
162 | + * @param string $tmpFileName |
|
162 | 163 | */ |
163 | 164 | private function tmpUpload($tmpName, $fieldSetting, $tmpFileName) |
164 | 165 | { |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $default = []; |
25 | 25 | //設定値はまとめる |
26 | 26 | $settings = $this->contentsFileConfig; |
27 | - $this->contentsFileSettings = array_merge($default,$settings); |
|
27 | + $this->contentsFileSettings = array_merge($default, $settings); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | !empty($this->id) && |
56 | 56 | //設定値に設定されているとき |
57 | 57 | preg_match('/^contents_file_(.*)$/', $property, $match) && |
58 | - array_key_exists($match[1] , $this->contentsFileSettings['fields']) |
|
58 | + array_key_exists($match[1], $this->contentsFileSettings['fields']) |
|
59 | 59 | ) { |
60 | 60 | //何もセットされていないとき |
61 | 61 | if (empty($this->_properties[$property])) { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if (!empty($fileInfo['tmp_name'])) { |
119 | 119 | $tmpFileName = Security::hash(rand() . Time::now()->i18nFormat('YYYY/MM/dd HH:ii:ss') . $fileInfo['name']); |
120 | 120 | |
121 | - if ($this->getExt($fileInfo['name']) !== null ) { |
|
121 | + if ($this->getExt($fileInfo['name']) !== null) { |
|
122 | 122 | $tmpFileName .= '.' . $this->getExt($fileInfo['name']); |
123 | 123 | } |
124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | private function getExt($file) |
148 | 148 | { |
149 | - $fileExplode = explode('.',$file); |
|
149 | + $fileExplode = explode('.', $file); |
|
150 | 150 | //この場合拡張子なし |
151 | 151 | if (count($fileExplode) == 1) { |
152 | 152 | return null; |
@@ -90,9 +90,9 @@ |
||
90 | 90 | |
91 | 91 | if (($pos = strrpos($filename, ".")) !== false) { |
92 | 92 | // 拡張子がある場合 |
93 | - $ext = strtolower(substr($filename, $pos+1)); |
|
93 | + $ext = strtolower(substr($filename, $pos + 1)); |
|
94 | 94 | if (strlen($ext)) { |
95 | - return $aContentTypes[$ext]?$aContentTypes[$ext]:$sContentType; |
|
95 | + return $aContentTypes[$ext] ? $aContentTypes[$ext] : $sContentType; |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | return $sContentType; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $fileInfo['resize'] = $options['resize']; |
50 | 50 | unset($options['resize']); |
51 | 51 | } |
52 | - return $this->Html->image($this->urlArray($fileInfo) ,$options); |
|
52 | + return $this->Html->image($this->urlArray($fileInfo), $options); |
|
53 | 53 | } |
54 | 54 | return ''; |
55 | 55 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | if (!isset($fileInfo['resize'])) { |
64 | 64 | $fileInfo['resize'] = false; |
65 | 65 | } |
66 | - return $this->Url->build($this->urlArray($fileInfo),$full); |
|
66 | + return $this->Url->build($this->urlArray($fileInfo), $full); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |