@@ -1344,7 +1344,7 @@ |
||
| 1344 | 1344 | * |
| 1345 | 1345 | * @param string $str |
| 1346 | 1346 | * @param array $extTable |
| 1347 | - * @return array |
|
| 1347 | + * @return string[] |
|
| 1348 | 1348 | * @author Naoki Sawada |
| 1349 | 1349 | */ |
| 1350 | 1350 | protected function parse_data_scheme( $str, $extTable ) { |
@@ -1241,8 +1241,12 @@ discard block |
||
| 1241 | 1241 | |
| 1242 | 1242 | $query = $method.' '.$uri." HTTP/1.0\r\n"; |
| 1243 | 1243 | $query .= "Host: ".$arr['host']."\r\n"; |
| 1244 | - if (!empty($ua)) $query .= "User-Agent: ".$ua."\r\n"; |
|
| 1245 | - if (!is_null($getSize)) $query .= 'Range: bytes=0-' . ($getSize - 1) . "\r\n"; |
|
| 1244 | + if (!empty($ua)) { |
|
| 1245 | + $query .= "User-Agent: ".$ua."\r\n"; |
|
| 1246 | + } |
|
| 1247 | + if (!is_null($getSize)) { |
|
| 1248 | + $query .= 'Range: bytes=0-' . ($getSize - 1) . "\r\n"; |
|
| 1249 | + } |
|
| 1246 | 1250 | |
| 1247 | 1251 | $query .= $headers; |
| 1248 | 1252 | |
@@ -1257,7 +1261,9 @@ discard block |
||
| 1257 | 1261 | $arr['https'].$arr['host'], |
| 1258 | 1262 | $arr['port'], |
| 1259 | 1263 | $errno,$errstr,$connect_timeout); |
| 1260 | - if ($fp) break; |
|
| 1264 | + if ($fp) { |
|
| 1265 | + break; |
|
| 1266 | + } |
|
| 1261 | 1267 | $connect_try_count++; |
| 1262 | 1268 | if (connection_aborted()) { |
| 1263 | 1269 | exit(); |
@@ -1574,7 +1580,9 @@ discard block |
||
| 1574 | 1580 | $tempDir = ''; |
| 1575 | 1581 | $test = DIRECTORY_SEPARATOR . microtime(true); |
| 1576 | 1582 | foreach($testDirs as $testDir) { |
| 1577 | - if (!$testDir || !is_dir($testDir)) continue; |
|
| 1583 | + if (!$testDir || !is_dir($testDir)) { |
|
| 1584 | + continue; |
|
| 1585 | + } |
|
| 1578 | 1586 | $testFile = $testDir.$test; |
| 1579 | 1587 | if (touch($testFile)) { |
| 1580 | 1588 | unlink($testFile); |
@@ -1810,7 +1818,9 @@ discard block |
||
| 1810 | 1818 | $result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, self::ERROR_UPLOAD_TRANSFER); |
| 1811 | 1819 | $this->uploadDebug = 'Upload error: unable open tmp file'; |
| 1812 | 1820 | if (! is_uploaded_file($tmpname)) { |
| 1813 | - if (@ unlink($tmpname)) unset($GLOBALS['elFinderTempFiles'][$tmpfname]); |
|
| 1821 | + if (@ unlink($tmpname)) { |
|
| 1822 | + unset($GLOBALS['elFinderTempFiles'][$tmpfname]); |
|
| 1823 | + } |
|
| 1814 | 1824 | continue; |
| 1815 | 1825 | } |
| 1816 | 1826 | break; |
@@ -1824,7 +1834,10 @@ discard block |
||
| 1824 | 1834 | $result['warning'] = $this->error(self::ERROR_UPLOAD_FILE, $name, $volume->error()); |
| 1825 | 1835 | fclose($fp); |
| 1826 | 1836 | if (! is_uploaded_file($tmpname)) { |
| 1827 | - if (@ unlink($tmpname)) unset($GLOBALS['elFinderTempFiles'][$tmpname]);; |
|
| 1837 | + if (@ unlink($tmpname)) { |
|
| 1838 | + unset($GLOBALS['elFinderTempFiles'][$tmpname]); |
|
| 1839 | + } |
|
| 1840 | + ; |
|
| 1828 | 1841 | continue; |
| 1829 | 1842 | } |
| 1830 | 1843 | break; |
@@ -234,7 +234,6 @@ discard block |
||
| 234 | 234 | * process of on netunmount |
| 235 | 235 | * Drop table `dropbox` & rm thumbs |
| 236 | 236 | * |
| 237 | - * @param array $options |
|
| 238 | 237 | * @return boolean |
| 239 | 238 | */ |
| 240 | 239 | public function netunmount($netVolumes, $key) { |
@@ -431,7 +430,7 @@ discard block |
||
| 431 | 430 | /** |
| 432 | 431 | * Check DB for delta cache |
| 433 | 432 | * |
| 434 | - * @return void |
|
| 433 | + * @return boolean |
|
| 435 | 434 | */ |
| 436 | 435 | private function checkDB() { |
| 437 | 436 | $res = $this->query('SELECT * FROM sqlite_master WHERE type=\'table\' AND name=\''.$this->DB_TableName.'\''); |
@@ -685,7 +684,7 @@ discard block |
||
| 685 | 684 | * @param string $src source path |
| 686 | 685 | * @param string $dst destination dir path |
| 687 | 686 | * @param string $name new file name (optionaly) |
| 688 | - * @return string|false |
|
| 687 | + * @return string|boolean |
|
| 689 | 688 | * @author Dmitry (dio) Levashov |
| 690 | 689 | * @author Naoki Sawada |
| 691 | 690 | **/ |
@@ -739,10 +738,6 @@ discard block |
||
| 739 | 738 | * Create thumnbnail and return it's URL on success |
| 740 | 739 | * |
| 741 | 740 | * @param string $path file path |
| 742 | - * @param string $mime file mime type |
|
| 743 | - * @return string|false |
|
| 744 | - * @author Dmitry (dio) Levashov |
|
| 745 | - * @author Naoki Sawada |
|
| 746 | 741 | **/ |
| 747 | 742 | protected function createTmb($path, $stat) { |
| 748 | 743 | if (!$stat || !$this->canCreateTmb($path, $stat)) { |
@@ -1099,7 +1094,6 @@ discard block |
||
| 1099 | 1094 | * Open file and return file pointer |
| 1100 | 1095 | * |
| 1101 | 1096 | * @param string $path file path |
| 1102 | - * @param bool $write open file for writing |
|
| 1103 | 1097 | * @return resource|false |
| 1104 | 1098 | * @author Dmitry (dio) Levashov |
| 1105 | 1099 | **/ |
@@ -1141,7 +1135,7 @@ discard block |
||
| 1141 | 1135 | * Close opened file |
| 1142 | 1136 | * |
| 1143 | 1137 | * @param resource $fp file pointer |
| 1144 | - * @return bool |
|
| 1138 | + * @return boolean|null |
|
| 1145 | 1139 | * @author Dmitry (dio) Levashov |
| 1146 | 1140 | **/ |
| 1147 | 1141 | protected function _fclose($fp, $path='') { |
@@ -1225,7 +1219,7 @@ discard block |
||
| 1225 | 1219 | * Return new file path or false. |
| 1226 | 1220 | * |
| 1227 | 1221 | * @param string $source source file path |
| 1228 | - * @param string $target target dir path |
|
| 1222 | + * @param string $targetDir target dir path |
|
| 1229 | 1223 | * @param string $name file name |
| 1230 | 1224 | * @return string|bool |
| 1231 | 1225 | * @author Dmitry (dio) Levashov |
@@ -1274,7 +1268,6 @@ discard block |
||
| 1274 | 1268 | * Return new file path or false on error. |
| 1275 | 1269 | * |
| 1276 | 1270 | * @param resource $fp file pointer |
| 1277 | - * @param string $dir target dir path |
|
| 1278 | 1271 | * @param string $name file name |
| 1279 | 1272 | * @param array $stat file stat (required by some virtual fs) |
| 1280 | 1273 | * @return bool|string |
@@ -1320,7 +1313,7 @@ discard block |
||
| 1320 | 1313 | * |
| 1321 | 1314 | * @param string $path file path |
| 1322 | 1315 | * @param string $content new file content |
| 1323 | - * @return bool |
|
| 1316 | + * @return boolean|string |
|
| 1324 | 1317 | * @author Dmitry (dio) Levashov |
| 1325 | 1318 | **/ |
| 1326 | 1319 | protected function _filePutContents($path, $content) { |
@@ -132,8 +132,12 @@ discard block |
||
| 132 | 132 | * @author Naoki Sawada |
| 133 | 133 | **/ |
| 134 | 134 | public function netmountPrepare($options) { |
| 135 | - if (empty($options['consumerKey']) && defined('ELFINDER_DROPBOX_CONSUMERKEY')) $options['consumerKey'] = ELFINDER_DROPBOX_CONSUMERKEY; |
|
| 136 | - if (empty($options['consumerSecret']) && defined('ELFINDER_DROPBOX_CONSUMERSECRET')) $options['consumerSecret'] = ELFINDER_DROPBOX_CONSUMERSECRET; |
|
| 135 | + if (empty($options['consumerKey']) && defined('ELFINDER_DROPBOX_CONSUMERKEY')) { |
|
| 136 | + $options['consumerKey'] = ELFINDER_DROPBOX_CONSUMERKEY; |
|
| 137 | + } |
|
| 138 | + if (empty($options['consumerSecret']) && defined('ELFINDER_DROPBOX_CONSUMERSECRET')) { |
|
| 139 | + $options['consumerSecret'] = ELFINDER_DROPBOX_CONSUMERSECRET; |
|
| 140 | + } |
|
| 137 | 141 | |
| 138 | 142 | if ($options['user'] === 'init') { |
| 139 | 143 | |
@@ -616,8 +620,12 @@ discard block |
||
| 616 | 620 | } else { |
| 617 | 621 | $stat['url'] = '1'; |
| 618 | 622 | } |
| 619 | - if (isset($raw['width'])) $stat['width'] = $raw['width']; |
|
| 620 | - if (isset($raw['height'])) $stat['height'] = $raw['height']; |
|
| 623 | + if (isset($raw['width'])) { |
|
| 624 | + $stat['width'] = $raw['width']; |
|
| 625 | + } |
|
| 626 | + if (isset($raw['height'])) { |
|
| 627 | + $stat['height'] = $raw['height']; |
|
| 628 | + } |
|
| 621 | 629 | |
| 622 | 630 | return $stat; |
| 623 | 631 | } |
@@ -1061,7 +1069,9 @@ discard block |
||
| 1061 | 1069 | * @author Dmitry (dio) Levashov |
| 1062 | 1070 | **/ |
| 1063 | 1071 | protected function _dimensions($path, $mime) { |
| 1064 | - if (strpos($mime, 'image') !== 0) return ''; |
|
| 1072 | + if (strpos($mime, 'image') !== 0) { |
|
| 1073 | + return ''; |
|
| 1074 | + } |
|
| 1065 | 1075 | $cache = $this->getDBdat($path); |
| 1066 | 1076 | if (isset($cache['width']) && isset($cache['height'])) { |
| 1067 | 1077 | return $cache['width'].'x'.$cache['height']; |
@@ -1281,7 +1291,9 @@ discard block |
||
| 1281 | 1291 | * @author Dmitry (dio) Levashov |
| 1282 | 1292 | **/ |
| 1283 | 1293 | protected function _save($fp, $path, $name, $stat) { |
| 1284 | - if ($name) $path .= '/'.$name; |
|
| 1294 | + if ($name) { |
|
| 1295 | + $path .= '/'.$name; |
|
| 1296 | + } |
|
| 1285 | 1297 | $path = $this->_normpath($path); |
| 1286 | 1298 | try { |
| 1287 | 1299 | $this->dropbox->putFile($path, $fp); |
@@ -1291,8 +1303,12 @@ discard block |
||
| 1291 | 1303 | $this->deltaCheck(); |
| 1292 | 1304 | if (is_array($stat)) { |
| 1293 | 1305 | $raw = $this->getDBdat($path); |
| 1294 | - if (isset($stat['width'])) $raw['width'] = $stat['width']; |
|
| 1295 | - if (isset($stat['height'])) $raw['height'] = $stat['height']; |
|
| 1306 | + if (isset($stat['width'])) { |
|
| 1307 | + $raw['width'] = $stat['width']; |
|
| 1308 | + } |
|
| 1309 | + if (isset($stat['height'])) { |
|
| 1310 | + $raw['height'] = $stat['height']; |
|
| 1311 | + } |
|
| 1296 | 1312 | $this->updateDBdat($path, $raw); |
| 1297 | 1313 | } |
| 1298 | 1314 | return $path; |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | * Return ftp transfer mode for file |
| 478 | 478 | * |
| 479 | 479 | * @param string $path file path |
| 480 | - * @return string |
|
| 480 | + * @return integer |
|
| 481 | 481 | * @author Dmitry (dio) Levashov |
| 482 | 482 | **/ |
| 483 | 483 | protected function ftpMode($path) { |
@@ -841,7 +841,6 @@ discard block |
||
| 841 | 841 | * Open file and return file pointer |
| 842 | 842 | * |
| 843 | 843 | * @param string $path file path |
| 844 | - * @param bool $write open file for writing |
|
| 845 | 844 | * @return resource|false |
| 846 | 845 | * @author Dmitry (dio) Levashov |
| 847 | 846 | **/ |
@@ -866,7 +865,7 @@ discard block |
||
| 866 | 865 | * Close opened file |
| 867 | 866 | * |
| 868 | 867 | * @param resource $fp file pointer |
| 869 | - * @return bool |
|
| 868 | + * @return boolean|null |
|
| 870 | 869 | * @author Dmitry (dio) Levashov |
| 871 | 870 | **/ |
| 872 | 871 | protected function _fclose($fp, $path='') { |
@@ -883,7 +882,7 @@ discard block |
||
| 883 | 882 | * |
| 884 | 883 | * @param string $path parent dir path |
| 885 | 884 | * @param string $name new directory name |
| 886 | - * @return string|bool |
|
| 885 | + * @return false|string |
|
| 887 | 886 | * @author Dmitry (dio) Levashov |
| 888 | 887 | **/ |
| 889 | 888 | protected function _mkdir($path, $name) { |
@@ -901,7 +900,7 @@ discard block |
||
| 901 | 900 | * |
| 902 | 901 | * @param string $path parent dir path |
| 903 | 902 | * @param string $name new file name |
| 904 | - * @return string|bool |
|
| 903 | + * @return string|false |
|
| 905 | 904 | * @author Dmitry (dio) Levashov |
| 906 | 905 | **/ |
| 907 | 906 | protected function _mkfile($path, $name) { |
@@ -933,7 +932,7 @@ discard block |
||
| 933 | 932 | * @param string $source source file path |
| 934 | 933 | * @param string $targetDir target directory path |
| 935 | 934 | * @param string $name new file name |
| 936 | - * @return bool |
|
| 935 | + * @return string|false |
|
| 937 | 936 | * @author Dmitry (dio) Levashov |
| 938 | 937 | **/ |
| 939 | 938 | protected function _copy($source, $targetDir, $name) { |
@@ -958,9 +957,9 @@ discard block |
||
| 958 | 957 | * Return new file path or false. |
| 959 | 958 | * |
| 960 | 959 | * @param string $source source file path |
| 961 | - * @param string $target target dir path |
|
| 960 | + * @param string $targetDir target dir path |
|
| 962 | 961 | * @param string $name file name |
| 963 | - * @return string|bool |
|
| 962 | + * @return string|false |
|
| 964 | 963 | * @author Dmitry (dio) Levashov |
| 965 | 964 | **/ |
| 966 | 965 | protected function _move($source, $targetDir, $name) { |
@@ -998,7 +997,7 @@ discard block |
||
| 998 | 997 | * @param string $dir target dir path |
| 999 | 998 | * @param string $name file name |
| 1000 | 999 | * @param array $stat file stat (required by some virtual fs) |
| 1001 | - * @return bool|string |
|
| 1000 | + * @return string|false |
|
| 1002 | 1001 | * @author Dmitry (dio) Levashov |
| 1003 | 1002 | **/ |
| 1004 | 1003 | protected function _save($fp, $dir, $name, $stat) { |
@@ -1231,7 +1230,7 @@ discard block |
||
| 1231 | 1230 | * @param array $files files names list |
| 1232 | 1231 | * @param string $name archive name |
| 1233 | 1232 | * @param array $arc archiver options |
| 1234 | - * @return string|bool |
|
| 1233 | + * @return false|string |
|
| 1235 | 1234 | * @author Dmitry (dio) Levashov, |
| 1236 | 1235 | * @author Alexey Sukhotin |
| 1237 | 1236 | **/ |
@@ -1350,9 +1349,9 @@ discard block |
||
| 1350 | 1349 | * Downloads specified files from remote directory |
| 1351 | 1350 | * if there is a directory among files it is downloaded recursively (omitting symbolic links). |
| 1352 | 1351 | * |
| 1353 | - * @param $remote_directory string remote FTP path to a source directory to download from. |
|
| 1352 | + * @param string $remote_directory string remote FTP path to a source directory to download from. |
|
| 1354 | 1353 | * @param array $files list of files to download from remote directory. |
| 1355 | - * @param $dest_local_directory string destination folder to store downloaded files. |
|
| 1354 | + * @param string $dest_local_directory string destination folder to store downloaded files. |
|
| 1356 | 1355 | * @return bool true on success and false on failure. |
| 1357 | 1356 | */ |
| 1358 | 1357 | private function ftp_download_files($remote_directory, array $files, $dest_local_directory) |
@@ -1423,6 +1422,7 @@ discard block |
||
| 1423 | 1422 | * Returns array of strings containing all files and folders in the specified local directory. |
| 1424 | 1423 | * @param $dir |
| 1425 | 1424 | * @param string $prefix |
| 1425 | + * @param boolean $omitSymlinks |
|
| 1426 | 1426 | * @internal param string $path path to directory to scan. |
| 1427 | 1427 | * @return array array of files and folders names relative to the $path |
| 1428 | 1428 | * or an empty array if the directory $path is empty, |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | * Close opened file |
| 612 | 612 | * |
| 613 | 613 | * @param resource $fp file pointer |
| 614 | - * @return bool |
|
| 614 | + * @return boolean|null |
|
| 615 | 615 | * @author Dmitry (dio) Levashov |
| 616 | 616 | **/ |
| 617 | 617 | protected function _fclose($fp, $path='') { |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | * |
| 629 | 629 | * @param string $path parent dir path |
| 630 | 630 | * @param string $name new directory name |
| 631 | - * @return string|bool |
|
| 631 | + * @return string|false |
|
| 632 | 632 | * @author Dmitry (dio) Levashov |
| 633 | 633 | **/ |
| 634 | 634 | protected function _mkdir($path, $name) { |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | * |
| 641 | 641 | * @param string $path parent dir path |
| 642 | 642 | * @param string $name new file name |
| 643 | - * @return string|bool |
|
| 643 | + * @return string|false |
|
| 644 | 644 | * @author Dmitry (dio) Levashov |
| 645 | 645 | **/ |
| 646 | 646 | protected function _mkfile($path, $name) { |
@@ -684,9 +684,9 @@ discard block |
||
| 684 | 684 | * Return new file path or false. |
| 685 | 685 | * |
| 686 | 686 | * @param string $source source file path |
| 687 | - * @param string $target target dir path |
|
| 687 | + * @param string $targetDir target dir path |
|
| 688 | 688 | * @param string $name file name |
| 689 | - * @return string|bool |
|
| 689 | + * @return string|false |
|
| 690 | 690 | * @author Dmitry (dio) Levashov |
| 691 | 691 | **/ |
| 692 | 692 | protected function _move($source, $targetDir, $name) { |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | * |
| 870 | 870 | * @param string $path archive path |
| 871 | 871 | * @param array $arc archiver command and arguments (same as in $this->archivers) |
| 872 | - * @return true |
|
| 872 | + * @return boolean |
|
| 873 | 873 | * @author Dmitry (dio) Levashov, |
| 874 | 874 | * @author Alexey Sukhotin |
| 875 | 875 | **/ |
@@ -884,7 +884,7 @@ discard block |
||
| 884 | 884 | * @param array $files files names list |
| 885 | 885 | * @param string $name archive name |
| 886 | 886 | * @param array $arc archiver options |
| 887 | - * @return string|bool |
|
| 887 | + * @return boolean |
|
| 888 | 888 | * @author Dmitry (dio) Levashov, |
| 889 | 889 | * @author Alexey Sukhotin |
| 890 | 890 | **/ |
@@ -107,6 +107,10 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | + /** |
|
| 111 | + * @param double $width |
|
| 112 | + * @param double $height |
|
| 113 | + */ |
|
| 110 | 114 | private function resize_gd($src, $width, $height, $quality, $srcImgInfo) { |
| 111 | 115 | switch ($srcImgInfo['mime']) { |
| 112 | 116 | case 'image/gif': |
@@ -177,6 +181,10 @@ discard block |
||
| 177 | 181 | return false; |
| 178 | 182 | } |
| 179 | 183 | |
| 184 | + /** |
|
| 185 | + * @param double $width |
|
| 186 | + * @param double $height |
|
| 187 | + */ |
|
| 180 | 188 | private function resize_imagick($src, $width, $height, $quality) { |
| 181 | 189 | try { |
| 182 | 190 | $img = new imagick($src); |
@@ -212,8 +212,9 @@ |
||
| 212 | 212 | protected function input_filter($args) { |
| 213 | 213 | static $magic_quotes_gpc = NULL; |
| 214 | 214 | |
| 215 | - if ($magic_quotes_gpc === NULL) |
|
| 216 | - $magic_quotes_gpc = (version_compare(PHP_VERSION, '5.4', '<') && get_magic_quotes_gpc()); |
|
| 215 | + if ($magic_quotes_gpc === NULL) { |
|
| 216 | + $magic_quotes_gpc = (version_compare(PHP_VERSION, '5.4', '<') && get_magic_quotes_gpc()); |
|
| 217 | + } |
|
| 217 | 218 | |
| 218 | 219 | if (is_array($args)) { |
| 219 | 220 | return array_map(array(& $this, 'input_filter'), $args); |
@@ -859,7 +859,9 @@ discard block |
||
| 859 | 859 | |
| 860 | 860 | // This get's triggered if $this->root == '/' and alias is empty. |
| 861 | 861 | // Maybe modify _basename instead? |
| 862 | - if ($this->rootName === '') $this->rootName = $this->separator; |
|
| 862 | + if ($this->rootName === '') { |
|
| 863 | + $this->rootName = $this->separator; |
|
| 864 | + } |
|
| 863 | 865 | |
| 864 | 866 | $root = $this->stat($this->root); |
| 865 | 867 | |
@@ -2938,7 +2940,9 @@ discard block |
||
| 2938 | 2940 | if ($this->mimeDetect == 'finfo') { |
| 2939 | 2941 | if ($type = @finfo_file($this->finfo, $path)) { |
| 2940 | 2942 | if ($ext && preg_match('~^application/(?:octet-stream|(?:x-)?zip)~', $type)) { |
| 2941 | - if (isset(elFinderVolumeDriver::$mimetypes[$ext])) $type = elFinderVolumeDriver::$mimetypes[$ext]; |
|
| 2943 | + if (isset(elFinderVolumeDriver::$mimetypes[$ext])) { |
|
| 2944 | + $type = elFinderVolumeDriver::$mimetypes[$ext]; |
|
| 2945 | + } |
|
| 2942 | 2946 | } else if ($ext === 'js' && preg_match('~^text/~', $type)) { |
| 2943 | 2947 | $type = 'text/javascript'; |
| 2944 | 2948 | } |
@@ -4013,7 +4017,7 @@ discard block |
||
| 4013 | 4017 | imagesavealpha($image,true); |
| 4014 | 4018 | $bgcolor1 = imagecolorallocatealpha($image, 255, 255, 255, 127); |
| 4015 | 4019 | |
| 4016 | - }else{ |
|
| 4020 | + } else{ |
|
| 4017 | 4021 | list($r, $g, $b) = sscanf($bgcolor, "#%02x%02x%02x"); |
| 4018 | 4022 | $bgcolor1 = imagecolorallocate($image, $r, $g, $b); |
| 4019 | 4023 | } |
@@ -4203,7 +4207,9 @@ discard block |
||
| 4203 | 4207 | } |
| 4204 | 4208 | |
| 4205 | 4209 | // 'Here' |
| 4206 | - if ($path === '' || $path === '.' . $separator) return $base; |
|
| 4210 | + if ($path === '' || $path === '.' . $separator) { |
|
| 4211 | + return $base; |
|
| 4212 | + } |
|
| 4207 | 4213 | |
| 4208 | 4214 | // Absolute path |
| 4209 | 4215 | if ($path[0] === $separator || strpos($path, $systemroot) === 0) { |
@@ -1238,7 +1238,6 @@ discard block |
||
| 1238 | 1238 | * Return file info or false on error |
| 1239 | 1239 | * |
| 1240 | 1240 | * @param string $hash file hash |
| 1241 | - * @param bool $realpath add realpath field to file info |
|
| 1242 | 1241 | * @return array|false |
| 1243 | 1242 | * @author Dmitry (dio) Levashov |
| 1244 | 1243 | **/ |
@@ -1259,7 +1258,6 @@ discard block |
||
| 1259 | 1258 | * Return folder info |
| 1260 | 1259 | * |
| 1261 | 1260 | * @param string $hash folder hash |
| 1262 | - * @param bool $hidden return hidden file info |
|
| 1263 | 1261 | * @return array|false |
| 1264 | 1262 | * @author Dmitry (dio) Levashov |
| 1265 | 1263 | **/ |
@@ -1592,7 +1590,6 @@ discard block |
||
| 1592 | 1590 | * |
| 1593 | 1591 | * @param Resource $fp file pointer |
| 1594 | 1592 | * @param string $dst destination folder hash |
| 1595 | - * @param string $src file name |
|
| 1596 | 1593 | * @param string $tmpname file tmp name - required to detect mime type |
| 1597 | 1594 | * @return array|false |
| 1598 | 1595 | * @author Dmitry (dio) Levashov |
@@ -1678,7 +1675,6 @@ discard block |
||
| 1678 | 1675 | * Paste files |
| 1679 | 1676 | * |
| 1680 | 1677 | * @param Object $volume source volume |
| 1681 | - * @param string $source file hash |
|
| 1682 | 1678 | * @param string $dst destination dir hash |
| 1683 | 1679 | * @param bool $rmSrc remove source after copy? |
| 1684 | 1680 | * @return array|false |
@@ -2301,7 +2297,6 @@ discard block |
||
| 2301 | 2297 | * Open file and return file pointer (with convert encording) |
| 2302 | 2298 | * |
| 2303 | 2299 | * @param string $path file path |
| 2304 | - * @param bool $write open file for writing |
|
| 2305 | 2300 | * @return resource|false |
| 2306 | 2301 | * @author Naoki Sawada |
| 2307 | 2302 | **/ |
@@ -2432,7 +2427,8 @@ discard block |
||
| 2432 | 2427 | * Not implemented |
| 2433 | 2428 | * |
| 2434 | 2429 | * @param string path |
| 2435 | - * @return mixed |
|
| 2430 | + * @param string $path |
|
| 2431 | + * @return string |
|
| 2436 | 2432 | * @author Dmitry (dio) Levashov |
| 2437 | 2433 | **/ |
| 2438 | 2434 | protected function crypt($path) { |
@@ -2444,7 +2440,8 @@ discard block |
||
| 2444 | 2440 | * Not implemented |
| 2445 | 2441 | * |
| 2446 | 2442 | * @param mixed hash |
| 2447 | - * @return mixed |
|
| 2443 | + * @param string $hash |
|
| 2444 | + * @return string |
|
| 2448 | 2445 | * @author Dmitry (dio) Levashov |
| 2449 | 2446 | **/ |
| 2450 | 2447 | protected function uncrypt($hash) { |
@@ -2477,7 +2474,6 @@ discard block |
||
| 2477 | 2474 | /** |
| 2478 | 2475 | * Return new unique name based on file name and suffix |
| 2479 | 2476 | * |
| 2480 | - * @param string $path file path |
|
| 2481 | 2477 | * @param string $suffix suffix append to name |
| 2482 | 2478 | * @return string |
| 2483 | 2479 | * @author Dmitry (dio) Levashov |
@@ -2545,6 +2541,7 @@ discard block |
||
| 2545 | 2541 | * @param string $to to character encoding |
| 2546 | 2542 | * @param string $locale local locale |
| 2547 | 2543 | * @param string $unknown replaces character for unknown |
| 2544 | + * @param boolean $restoreLocale |
|
| 2548 | 2545 | * @return mixed |
| 2549 | 2546 | */ |
| 2550 | 2547 | protected function convEnc($var, $from, $to, $locale, $restoreLocale, $unknown = '_') { |
@@ -2726,6 +2723,7 @@ discard block |
||
| 2726 | 2723 | * |
| 2727 | 2724 | * @param string $dir parent dir path |
| 2728 | 2725 | * @param string $name new file name |
| 2726 | + * @param boolean $isDir |
|
| 2729 | 2727 | * @return bool |
| 2730 | 2728 | * @author Dmitry (dio) Levashov |
| 2731 | 2729 | **/ |
@@ -3279,7 +3277,7 @@ discard block |
||
| 3279 | 3277 | * @param string $src source path |
| 3280 | 3278 | * @param string $dst destination dir path |
| 3281 | 3279 | * @param string $name new file name (optionaly) |
| 3282 | - * @return string|false |
|
| 3280 | + * @return boolean|string |
|
| 3283 | 3281 | * @author Dmitry (dio) Levashov |
| 3284 | 3282 | **/ |
| 3285 | 3283 | protected function copy($src, $dst, $name) { |
@@ -3332,7 +3330,7 @@ discard block |
||
| 3332 | 3330 | * @param string $src source path |
| 3333 | 3331 | * @param string $dst destination dir path |
| 3334 | 3332 | * @param string $name new file name |
| 3335 | - * @return string|false |
|
| 3333 | + * @return string|boolean |
|
| 3336 | 3334 | * @author Dmitry (dio) Levashov |
| 3337 | 3335 | **/ |
| 3338 | 3336 | protected function move($src, $dst, $name) { |
@@ -3358,7 +3356,7 @@ discard block |
||
| 3358 | 3356 | * @param string $src source file hash |
| 3359 | 3357 | * @param string $destination destination dir path |
| 3360 | 3358 | * @param string $name file name |
| 3361 | - * @return string|false |
|
| 3359 | + * @return boolean|string |
|
| 3362 | 3360 | * @author Dmitry (dio) Levashov |
| 3363 | 3361 | **/ |
| 3364 | 3362 | protected function copyFrom($volume, $src, $destination, $name) { |
@@ -3506,7 +3504,7 @@ discard block |
||
| 3506 | 3504 | * @param string $path thumnbnail path |
| 3507 | 3505 | * @param array $stat file stat |
| 3508 | 3506 | * @param bool $checkTmbPath |
| 3509 | - * @return string|bool |
|
| 3507 | + * @return boolean |
|
| 3510 | 3508 | * @author Dmitry (dio) Levashov |
| 3511 | 3509 | **/ |
| 3512 | 3510 | protected function canCreateTmb($path, $stat, $checkTmbPath = true) { |
@@ -3523,7 +3521,7 @@ discard block |
||
| 3523 | 3521 | * |
| 3524 | 3522 | * @param string $path thumnbnail path |
| 3525 | 3523 | * @param array $stat file stat |
| 3526 | - * @return string|bool |
|
| 3524 | + * @return boolean |
|
| 3527 | 3525 | * @author Dmitry (dio) Levashov |
| 3528 | 3526 | **/ |
| 3529 | 3527 | protected function canResize($path, $stat) { |
@@ -3534,7 +3532,6 @@ discard block |
||
| 3534 | 3532 | * Create thumnbnail and return it's URL on success |
| 3535 | 3533 | * |
| 3536 | 3534 | * @param string $path file path |
| 3537 | - * @param string $mime file mime type |
|
| 3538 | 3535 | * @return string|false |
| 3539 | 3536 | * @author Dmitry (dio) Levashov |
| 3540 | 3537 | **/ |
@@ -4013,7 +4010,7 @@ discard block |
||
| 4013 | 4010 | * |
| 4014 | 4011 | * @param string $command command line |
| 4015 | 4012 | * @param array $output stdout strings |
| 4016 | - * @param array $return_var process exit code |
|
| 4013 | + * @param integer $return_var process exit code |
|
| 4017 | 4014 | * @param array $error_output stderr strings |
| 4018 | 4015 | * @return int exit code |
| 4019 | 4016 | * @author Alexey Sukhotin |
@@ -4225,7 +4222,7 @@ discard block |
||
| 4225 | 4222 | * @param string $haystack The string being checked. |
| 4226 | 4223 | * @param string $needle The string to find in haystack. |
| 4227 | 4224 | * @param int $offset The search offset. If it is not specified, 0 is used. |
| 4228 | - * @return int|bool |
|
| 4225 | + * @return integer |
|
| 4229 | 4226 | * @author Alexey Sukhotin |
| 4230 | 4227 | **/ |
| 4231 | 4228 | protected function stripos($haystack , $needle , $offset = 0) { |
@@ -4450,7 +4447,7 @@ discard block |
||
| 4450 | 4447 | * @param array $files files names list |
| 4451 | 4448 | * @param string $name archive name |
| 4452 | 4449 | * @param array $arc archiver options |
| 4453 | - * @return string|bool |
|
| 4450 | + * @return string|false |
|
| 4454 | 4451 | * @author Dmitry (dio) Levashov, |
| 4455 | 4452 | * @author Alexey Sukhotin |
| 4456 | 4453 | * @author Naoki Sawada |
@@ -4507,7 +4504,7 @@ discard block |
||
| 4507 | 4504 | * @param string $dir target dir |
| 4508 | 4505 | * @param array $files files names list |
| 4509 | 4506 | * @param string|object $zipPath Zip archive name |
| 4510 | - * @return void |
|
| 4507 | + * @return boolean |
|
| 4511 | 4508 | * @author Naoki Sawada |
| 4512 | 4509 | */ |
| 4513 | 4510 | protected static function zipArchiveZip($dir, $files, $zipPath) { |
@@ -4763,7 +4760,7 @@ discard block |
||
| 4763 | 4760 | * Copy file into another file (only inside one volume) |
| 4764 | 4761 | * |
| 4765 | 4762 | * @param string $source source file path |
| 4766 | - * @param string $target target dir path |
|
| 4763 | + * @param string $targetDir target dir path |
|
| 4767 | 4764 | * @param string $name file name |
| 4768 | 4765 | * @return bool |
| 4769 | 4766 | * @author Dmitry (dio) Levashov |
@@ -4775,7 +4772,7 @@ discard block |
||
| 4775 | 4772 | * Return new file path or false. |
| 4776 | 4773 | * |
| 4777 | 4774 | * @param string $source source file path |
| 4778 | - * @param string $target target dir path |
|
| 4775 | + * @param string $targetDir target dir path |
|
| 4779 | 4776 | * @param string $name file name |
| 4780 | 4777 | * @return string|bool |
| 4781 | 4778 | * @author Dmitry (dio) Levashov |
@@ -386,7 +386,7 @@ |
||
| 386 | 386 | |
| 387 | 387 | try {
|
| 388 | 388 | $obj = $this->s3->GetObject(array('Bucket' => $this->options['bucket'], 'Key' => $this->_normpath($path) , 'GetMetadata' => true, 'InlineData' => true, 'GetData' => true));
|
| 389 | - } catch (Exception $e) {
|
|
| 389 | + } catch (Exception $e) {
|
|
| 390 | 390 | |
| 391 | 391 | } |
| 392 | 392 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | * |
| 408 | 408 | * @param resource $fp file pointer |
| 409 | 409 | * @param string $path file path |
| 410 | - * @return bool |
|
| 410 | + * @return boolean|null |
|
| 411 | 411 | * @author Dmitry (dio) Levashov |
| 412 | 412 | **/ |
| 413 | 413 | protected function _fclose($fp, $path='') {
|
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | * @param string $source source file path |
| 509 | 509 | * @param string $targetDir target dir path |
| 510 | 510 | * @param string $name file name |
| 511 | - * @return string|bool |
|
| 511 | + * @return boolean |
|
| 512 | 512 | * @author Dmitry (dio) Levashov |
| 513 | 513 | **/ |
| 514 | 514 | protected function _move($source, $targetDir, $name) {
|
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | * @param string $dir target dir path |
| 575 | 575 | * @param string $name file name |
| 576 | 576 | * @param array $stat |
| 577 | - * @return bool|string |
|
| 577 | + * @return boolean |
|
| 578 | 578 | * @author Dmitry (dio) Levashov |
| 579 | 579 | */ |
| 580 | 580 | protected function _save($fp, $dir, $name, $stat) {
|
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | * Get file contents |
| 586 | 586 | * |
| 587 | 587 | * @param string $path file path |
| 588 | - * @return string|false |
|
| 588 | + * @return boolean |
|
| 589 | 589 | * @author Dmitry (dio) Levashov |
| 590 | 590 | **/ |
| 591 | 591 | protected function _getContents($path) {
|
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | * @param array $files files names list |
| 625 | 625 | * @param string $name archive name |
| 626 | 626 | * @param array $arc archiver options |
| 627 | - * @return string|bool |
|
| 627 | + * @return boolean |
|
| 628 | 628 | * @author Dmitry (dio) Levashov, |
| 629 | 629 | * @author Alexey Sukhotin |
| 630 | 630 | **/ |
@@ -104,20 +104,24 @@ |
||
| 104 | 104 | private function normalize($str, $opts) { |
| 105 | 105 | if ($opts['nfc'] || $opts['nfkc']) { |
| 106 | 106 | if (class_exists('Normalizer')) { |
| 107 | - if ($opts['nfc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_C)) |
|
| 108 | - $str = Normalizer::normalize($str, Normalizer::FORM_C); |
|
| 109 | - if ($opts['nfkc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_KC)) |
|
| 110 | - $str = Normalizer::normalize($str, Normalizer::FORM_KC); |
|
| 107 | + if ($opts['nfc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_C)) { |
|
| 108 | + $str = Normalizer::normalize($str, Normalizer::FORM_C); |
|
| 109 | + } |
|
| 110 | + if ($opts['nfkc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_KC)) { |
|
| 111 | + $str = Normalizer::normalize($str, Normalizer::FORM_KC); |
|
| 112 | + } |
|
| 111 | 113 | } else { |
| 112 | 114 | if (! class_exists('I18N_UnicodeNormalizer')) { |
| 113 | 115 | @ include_once 'I18N/UnicodeNormalizer.php'; |
| 114 | 116 | } |
| 115 | 117 | if (class_exists('I18N_UnicodeNormalizer')) { |
| 116 | 118 | $normalizer = new I18N_UnicodeNormalizer(); |
| 117 | - if ($opts['nfc']) |
|
| 118 | - $str = $normalizer->normalize($str, 'NFC'); |
|
| 119 | - if ($opts['nfkc']) |
|
| 120 | - $str = $normalizer->normalize($str, 'NFKC'); |
|
| 119 | + if ($opts['nfc']) { |
|
| 120 | + $str = $normalizer->normalize($str, 'NFC'); |
|
| 121 | + } |
|
| 122 | + if ($opts['nfkc']) { |
|
| 123 | + $str = $normalizer->normalize($str, 'NFKC'); |
|
| 124 | + } |
|
| 121 | 125 | } |
| 122 | 126 | } |
| 123 | 127 | } |