@@ -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 { |
@@ -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; |
@@ -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; |
@@ -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 | } |
@@ -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 | /** |