@@ -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 ) { |
@@ -1149,18 +1149,18 @@ discard block |
||
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | 1151 | /** |
| 1152 | - * Get remote contents |
|
| 1153 | - * |
|
| 1154 | - * @param string $url target url |
|
| 1155 | - * @param int $timeout timeout (sec) |
|
| 1156 | - * @param int $redirect_max redirect max count |
|
| 1157 | - * @param string $ua |
|
| 1158 | - * @param resource $fp |
|
| 1159 | - * @return string or bool(false) |
|
| 1160 | - * @retval string contents |
|
| 1161 | - * @retval false error |
|
| 1162 | - * @author Naoki Sawada |
|
| 1163 | - **/ |
|
| 1152 | + * Get remote contents |
|
| 1153 | + * |
|
| 1154 | + * @param string $url target url |
|
| 1155 | + * @param int $timeout timeout (sec) |
|
| 1156 | + * @param int $redirect_max redirect max count |
|
| 1157 | + * @param string $ua |
|
| 1158 | + * @param resource $fp |
|
| 1159 | + * @return string or bool(false) |
|
| 1160 | + * @retval string contents |
|
| 1161 | + * @retval false error |
|
| 1162 | + * @author Naoki Sawada |
|
| 1163 | + **/ |
|
| 1164 | 1164 | protected function get_remote_contents( &$url, $timeout = 30, $redirect_max = 5, $ua = 'Mozilla/5.0', $fp = null ) { |
| 1165 | 1165 | $method = (function_exists('curl_exec') && !ini_get('safe_mode'))? 'curl_get_contents' : 'fsock_get_contents'; |
| 1166 | 1166 | return $this->$method( $url, $timeout, $redirect_max, $ua, $fp ); |
@@ -2090,12 +2090,12 @@ discard block |
||
| 2090 | 2090 | } |
| 2091 | 2091 | |
| 2092 | 2092 | /** |
| 2093 | - * Return content URL |
|
| 2094 | - * |
|
| 2095 | - * @param array $args command arguments |
|
| 2096 | - * @return array |
|
| 2097 | - * @author Naoki Sawada |
|
| 2098 | - **/ |
|
| 2093 | + * Return content URL |
|
| 2094 | + * |
|
| 2095 | + * @param array $args command arguments |
|
| 2096 | + * @return array |
|
| 2097 | + * @author Naoki Sawada |
|
| 2098 | + **/ |
|
| 2099 | 2099 | protected function url($args) { |
| 2100 | 2100 | $target = $args['target']; |
| 2101 | 2101 | $options = isset($args['options'])? $args['options'] : array(); |
@@ -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) { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $options['url'] = $this->getConnectorUrl(); |
| 193 | 193 | } |
| 194 | 194 | $callback = $options['url'] |
| 195 | - . '?cmd=netmount&protocol=dropbox&host=dropbox.com&user=init&pass=return&node='.$options['id'].$cdata; |
|
| 195 | + . '?cmd=netmount&protocol=dropbox&host=dropbox.com&user=init&pass=return&node='.$options['id'].$cdata; |
|
| 196 | 196 | |
| 197 | 197 | try { |
| 198 | 198 | $tokens = $this->oauth->getRequestToken(); |
@@ -265,9 +265,9 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | private function getConnectorUrl() { |
| 267 | 267 | $url = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off')? 'https://' : 'http://') |
| 268 | - . $_SERVER['SERVER_NAME'] // host |
|
| 269 | - . ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . $_SERVER['SERVER_PORT']) // port |
|
| 270 | - . $_SERVER['REQUEST_URI']; // path & query |
|
| 268 | + . $_SERVER['SERVER_NAME'] // host |
|
| 269 | + . ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . $_SERVER['SERVER_PORT']) // port |
|
| 270 | + . $_SERVER['REQUEST_URI']; // path & query |
|
| 271 | 271 | list($url) = explode('?', $url); |
| 272 | 272 | return $url; |
| 273 | 273 | } |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $stat['mime'] = $raw['is_dir']? 'directory' : $raw['mime_type']; |
| 606 | 606 | $stat['size'] = $stat['mime'] == 'directory' ? 0 : $raw['bytes']; |
| 607 | 607 | $stat['ts'] = isset($raw['client_mtime'])? strtotime($raw['client_mtime']) : |
| 608 | - (isset($raw['modified'])? strtotime($raw['modified']) : $_SERVER['REQUEST_TIME']); |
|
| 608 | + (isset($raw['modified'])? strtotime($raw['modified']) : $_SERVER['REQUEST_TIME']); |
|
| 609 | 609 | $stat['dirs'] = 0; |
| 610 | 610 | if ($raw['is_dir']) { |
| 611 | 611 | $stat['dirs'] = (int)(bool)$this->query('select path from '.$this->DB_TableName.' where isdir=1 and path='.$this->DB->quote(strtolower($raw['path']))); |
@@ -648,14 +648,14 @@ discard block |
||
| 648 | 648 | } |
| 649 | 649 | |
| 650 | 650 | /** |
| 651 | - * Recursive files search |
|
| 652 | - * |
|
| 653 | - * @param string $path dir path |
|
| 654 | - * @param string $q search string |
|
| 655 | - * @param array $mimes |
|
| 656 | - * @return array |
|
| 657 | - * @author Naoki Sawada |
|
| 658 | - **/ |
|
| 651 | + * Recursive files search |
|
| 652 | + * |
|
| 653 | + * @param string $path dir path |
|
| 654 | + * @param string $q search string |
|
| 655 | + * @param array $mimes |
|
| 656 | + * @return array |
|
| 657 | + * @author Naoki Sawada |
|
| 658 | + **/ |
|
| 659 | 659 | protected function doSearch($path, $q, $mimes) { |
| 660 | 660 | $result = array(); |
| 661 | 661 | $sth = $this->DB->prepare('select dat from '.$this->DB_TableName.' WHERE path LIKE ? AND fname LIKE ?'); |
@@ -679,16 +679,16 @@ discard block |
||
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | /** |
| 682 | - * Copy file/recursive copy dir only in current volume. |
|
| 683 | - * Return new file path or false. |
|
| 684 | - * |
|
| 685 | - * @param string $src source path |
|
| 686 | - * @param string $dst destination dir path |
|
| 687 | - * @param string $name new file name (optionaly) |
|
| 688 | - * @return string|false |
|
| 689 | - * @author Dmitry (dio) Levashov |
|
| 690 | - * @author Naoki Sawada |
|
| 691 | - **/ |
|
| 682 | + * Copy file/recursive copy dir only in current volume. |
|
| 683 | + * Return new file path or false. |
|
| 684 | + * |
|
| 685 | + * @param string $src source path |
|
| 686 | + * @param string $dst destination dir path |
|
| 687 | + * @param string $name new file name (optionaly) |
|
| 688 | + * @return string|false |
|
| 689 | + * @author Dmitry (dio) Levashov |
|
| 690 | + * @author Naoki Sawada |
|
| 691 | + **/ |
|
| 692 | 692 | protected function copy($src, $dst, $name) { |
| 693 | 693 | |
| 694 | 694 | $this->clearcache(); |
@@ -699,14 +699,14 @@ discard block |
||
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | /** |
| 702 | - * Remove file/ recursive remove dir |
|
| 703 | - * |
|
| 704 | - * @param string $path file path |
|
| 705 | - * @param bool $force try to remove even if file locked |
|
| 706 | - * @return bool |
|
| 707 | - * @author Dmitry (dio) Levashov |
|
| 708 | - * @author Naoki Sawada |
|
| 709 | - **/ |
|
| 702 | + * Remove file/ recursive remove dir |
|
| 703 | + * |
|
| 704 | + * @param string $path file path |
|
| 705 | + * @param bool $force try to remove even if file locked |
|
| 706 | + * @return bool |
|
| 707 | + * @author Dmitry (dio) Levashov |
|
| 708 | + * @author Naoki Sawada |
|
| 709 | + **/ |
|
| 710 | 710 | protected function remove($path, $force = false, $recursive = false) { |
| 711 | 711 | $stat = $this->stat($path); |
| 712 | 712 | $stat['realpath'] = $path; |
@@ -736,14 +736,14 @@ discard block |
||
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | /** |
| 739 | - * Create thumnbnail and return it's URL on success |
|
| 740 | - * |
|
| 741 | - * @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 | - **/ |
|
| 739 | + * Create thumnbnail and return it's URL on success |
|
| 740 | + * |
|
| 741 | + * @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 | + **/ |
|
| 747 | 747 | protected function createTmb($path, $stat) { |
| 748 | 748 | if (!$stat || !$this->canCreateTmb($path, $stat)) { |
| 749 | 749 | return false; |
@@ -828,13 +828,13 @@ discard block |
||
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | /** |
| 831 | - * Return content URL |
|
| 832 | - * |
|
| 833 | - * @param string $hash file hash |
|
| 834 | - * @param array $options options |
|
| 835 | - * @return array |
|
| 836 | - * @author Naoki Sawada |
|
| 837 | - **/ |
|
| 831 | + * Return content URL |
|
| 832 | + * |
|
| 833 | + * @param string $hash file hash |
|
| 834 | + * @param array $options options |
|
| 835 | + * @return array |
|
| 836 | + * @author Naoki Sawada |
|
| 837 | + **/ |
|
| 838 | 838 | public function getContentUrl($hash, $options = array()) { |
| 839 | 839 | if (($file = $this->file($hash)) == false || !$file['url'] || $file['url'] == 1) { |
| 840 | 840 | $path = $this->decode($hash); |
@@ -897,9 +897,9 @@ discard block |
||
| 897 | 897 | try { |
| 898 | 898 | $request2 = new HTTP_Request2(); |
| 899 | 899 | $request2->setConfig(array( |
| 900 | - 'ssl_verify_peer' => false, |
|
| 901 | - 'ssl_verify_host' => false |
|
| 902 | - )); |
|
| 900 | + 'ssl_verify_peer' => false, |
|
| 901 | + 'ssl_verify_host' => false |
|
| 902 | + )); |
|
| 903 | 903 | $request2->setUrl($url); |
| 904 | 904 | $request2->setMethod(HTTP_Request2::METHOD_HEAD); |
| 905 | 905 | $result = $request2->send(); |
@@ -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); |
@@ -1,51 +1,51 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * elFinder Plugin AutoResize |
|
| 4 | - * |
|
| 5 | - * Auto resize on file upload. |
|
| 6 | - * |
|
| 7 | - * ex. binding, configure on connector options |
|
| 8 | - * $opts = array( |
|
| 9 | - * 'bind' => array( |
|
| 10 | - * 'upload.presave' => array( |
|
| 11 | - * 'Plugin.AutoResize.onUpLoadPreSave' |
|
| 12 | - * ) |
|
| 13 | - * ), |
|
| 14 | - * // global configure (optional) |
|
| 15 | - * 'plugin' => array( |
|
| 16 | - * 'AutoResize' => array( |
|
| 17 | - * 'enable' => true, // For control by volume driver |
|
| 18 | - * 'maxWidth' => 1024, // Path to Water mark image |
|
| 19 | - * 'maxHeight' => 1024, // Margin right pixel |
|
| 20 | - * 'quality' => 95, // JPEG image save quality |
|
| 21 | - * 'preserveExif' => false, // Preserve EXIF data (Imagick only) |
|
| 22 | - * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP // Target image formats ( bit-field ) |
|
| 23 | - * ) |
|
| 24 | - * ), |
|
| 25 | - * // each volume configure (optional) |
|
| 26 | - * 'roots' => array( |
|
| 27 | - * array( |
|
| 28 | - * 'driver' => 'LocalFileSystem', |
|
| 29 | - * 'path' => '/path/to/files/', |
|
| 30 | - * 'URL' => 'http://localhost/to/files/' |
|
| 31 | - * 'plugin' => array( |
|
| 32 | - * 'AutoResize' => array( |
|
| 33 | - * 'enable' => true, // For control by volume driver |
|
| 34 | - * 'maxWidth' => 1024, // Path to Water mark image |
|
| 35 | - * 'maxHeight' => 1024, // Margin right pixel |
|
| 36 | - * 'quality' => 95, // JPEG image save quality |
|
| 37 | - * 'preserveExif' => false, // Preserve EXIF data (Imagick only) |
|
| 38 | - * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP // Target image formats ( bit-field ) |
|
| 39 | - * ) |
|
| 40 | - * ) |
|
| 41 | - * ) |
|
| 42 | - * ) |
|
| 43 | - * ); |
|
| 44 | - * |
|
| 45 | - * @package elfinder |
|
| 46 | - * @author Naoki Sawada |
|
| 47 | - * @license New BSD |
|
| 48 | - */ |
|
| 3 | + * elFinder Plugin AutoResize |
|
| 4 | + * |
|
| 5 | + * Auto resize on file upload. |
|
| 6 | + * |
|
| 7 | + * ex. binding, configure on connector options |
|
| 8 | + * $opts = array( |
|
| 9 | + * 'bind' => array( |
|
| 10 | + * 'upload.presave' => array( |
|
| 11 | + * 'Plugin.AutoResize.onUpLoadPreSave' |
|
| 12 | + * ) |
|
| 13 | + * ), |
|
| 14 | + * // global configure (optional) |
|
| 15 | + * 'plugin' => array( |
|
| 16 | + * 'AutoResize' => array( |
|
| 17 | + * 'enable' => true, // For control by volume driver |
|
| 18 | + * 'maxWidth' => 1024, // Path to Water mark image |
|
| 19 | + * 'maxHeight' => 1024, // Margin right pixel |
|
| 20 | + * 'quality' => 95, // JPEG image save quality |
|
| 21 | + * 'preserveExif' => false, // Preserve EXIF data (Imagick only) |
|
| 22 | + * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP // Target image formats ( bit-field ) |
|
| 23 | + * ) |
|
| 24 | + * ), |
|
| 25 | + * // each volume configure (optional) |
|
| 26 | + * 'roots' => array( |
|
| 27 | + * array( |
|
| 28 | + * 'driver' => 'LocalFileSystem', |
|
| 29 | + * 'path' => '/path/to/files/', |
|
| 30 | + * 'URL' => 'http://localhost/to/files/' |
|
| 31 | + * 'plugin' => array( |
|
| 32 | + * 'AutoResize' => array( |
|
| 33 | + * 'enable' => true, // For control by volume driver |
|
| 34 | + * 'maxWidth' => 1024, // Path to Water mark image |
|
| 35 | + * 'maxHeight' => 1024, // Margin right pixel |
|
| 36 | + * 'quality' => 95, // JPEG image save quality |
|
| 37 | + * 'preserveExif' => false, // Preserve EXIF data (Imagick only) |
|
| 38 | + * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP // Target image formats ( bit-field ) |
|
| 39 | + * ) |
|
| 40 | + * ) |
|
| 41 | + * ) |
|
| 42 | + * ) |
|
| 43 | + * ); |
|
| 44 | + * |
|
| 45 | + * @package elfinder |
|
| 46 | + * @author Naoki Sawada |
|
| 47 | + * @license New BSD |
|
| 48 | + */ |
|
| 49 | 49 | class elFinderPluginAutoResize { |
| 50 | 50 | |
| 51 | 51 | private $opts = array(); |
@@ -1,48 +1,48 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * elFinder Plugin Sanitizer |
|
| 4 | - * |
|
| 5 | - * Sanitizer of file-name and file-path etc. |
|
| 6 | - * |
|
| 7 | - * ex. binding, configure on connector options |
|
| 8 | - * $opts = array( |
|
| 9 | - * 'bind' => array( |
|
| 10 | - * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre' => array( |
|
| 11 | - * 'Plugin.Sanitizer.cmdPreprocess' |
|
| 12 | - * ), |
|
| 13 | - * 'upload.presave' => array( |
|
| 14 | - * 'Plugin.Sanitizer.onUpLoadPreSave' |
|
| 15 | - * ) |
|
| 16 | - * ), |
|
| 17 | - * // global configure (optional) |
|
| 18 | - * 'plugin' => array( |
|
| 19 | - * 'Sanitizer' => array( |
|
| 20 | - * 'enable' => true, |
|
| 21 | - * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars |
|
| 22 | - * 'replace' => '_' // replace to this |
|
| 23 | - * ) |
|
| 24 | - * ), |
|
| 25 | - * // each volume configure (optional) |
|
| 26 | - * 'roots' => array( |
|
| 27 | - * array( |
|
| 28 | - * 'driver' => 'LocalFileSystem', |
|
| 29 | - * 'path' => '/path/to/files/', |
|
| 30 | - * 'URL' => 'http://localhost/to/files/' |
|
| 31 | - * 'plugin' => array( |
|
| 32 | - * 'Sanitizer' => array( |
|
| 33 | - * 'enable' => true, |
|
| 34 | - * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars |
|
| 35 | - * 'replace' => '_' // replace to this |
|
| 36 | - * ) |
|
| 37 | - * ) |
|
| 38 | - * ) |
|
| 39 | - * ) |
|
| 40 | - * ); |
|
| 41 | - * |
|
| 42 | - * @package elfinder |
|
| 43 | - * @author Naoki Sawada |
|
| 44 | - * @license New BSD |
|
| 45 | - */ |
|
| 3 | + * elFinder Plugin Sanitizer |
|
| 4 | + * |
|
| 5 | + * Sanitizer of file-name and file-path etc. |
|
| 6 | + * |
|
| 7 | + * ex. binding, configure on connector options |
|
| 8 | + * $opts = array( |
|
| 9 | + * 'bind' => array( |
|
| 10 | + * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre' => array( |
|
| 11 | + * 'Plugin.Sanitizer.cmdPreprocess' |
|
| 12 | + * ), |
|
| 13 | + * 'upload.presave' => array( |
|
| 14 | + * 'Plugin.Sanitizer.onUpLoadPreSave' |
|
| 15 | + * ) |
|
| 16 | + * ), |
|
| 17 | + * // global configure (optional) |
|
| 18 | + * 'plugin' => array( |
|
| 19 | + * 'Sanitizer' => array( |
|
| 20 | + * 'enable' => true, |
|
| 21 | + * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars |
|
| 22 | + * 'replace' => '_' // replace to this |
|
| 23 | + * ) |
|
| 24 | + * ), |
|
| 25 | + * // each volume configure (optional) |
|
| 26 | + * 'roots' => array( |
|
| 27 | + * array( |
|
| 28 | + * 'driver' => 'LocalFileSystem', |
|
| 29 | + * 'path' => '/path/to/files/', |
|
| 30 | + * 'URL' => 'http://localhost/to/files/' |
|
| 31 | + * 'plugin' => array( |
|
| 32 | + * 'Sanitizer' => array( |
|
| 33 | + * 'enable' => true, |
|
| 34 | + * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars |
|
| 35 | + * 'replace' => '_' // replace to this |
|
| 36 | + * ) |
|
| 37 | + * ) |
|
| 38 | + * ) |
|
| 39 | + * ) |
|
| 40 | + * ); |
|
| 41 | + * |
|
| 42 | + * @package elfinder |
|
| 43 | + * @author Naoki Sawada |
|
| 44 | + * @license New BSD |
|
| 45 | + */ |
|
| 46 | 46 | class elFinderPluginSanitizer |
| 47 | 47 | { |
| 48 | 48 | private $opts = array(); |
@@ -200,11 +200,11 @@ discard block |
||
| 200 | 200 | 'mimefile' => '', |
| 201 | 201 | // mime type normalize map : Array '[ext]:[detected mime type]' => '[normalized mime]' |
| 202 | 202 | 'mimeMap' => array( |
| 203 | - 'md:application/x-genesis-rom' => 'text/x-markdown', |
|
| 204 | - 'md:text/plain' => 'text/x-markdown', |
|
| 205 | - 'markdown:text/plain' => 'text/x-markdown', |
|
| 206 | - 'css:text/x-asm' => 'text/css' |
|
| 207 | - ), |
|
| 203 | + 'md:application/x-genesis-rom' => 'text/x-markdown', |
|
| 204 | + 'md:text/plain' => 'text/x-markdown', |
|
| 205 | + 'markdown:text/plain' => 'text/x-markdown', |
|
| 206 | + 'css:text/x-asm' => 'text/css' |
|
| 207 | + ), |
|
| 208 | 208 | // directory for thumbnails |
| 209 | 209 | 'tmbPath' => '.tmb', |
| 210 | 210 | // mode to create thumbnails dir |
@@ -4070,14 +4070,14 @@ discard block |
||
| 4070 | 4070 | // } |
| 4071 | 4071 | |
| 4072 | 4072 | /** |
| 4073 | - * Find position of first occurrence of string in a string with multibyte support |
|
| 4074 | - * |
|
| 4075 | - * @param string $haystack The string being checked. |
|
| 4076 | - * @param string $needle The string to find in haystack. |
|
| 4077 | - * @param int $offset The search offset. If it is not specified, 0 is used. |
|
| 4078 | - * @return int|bool |
|
| 4079 | - * @author Alexey Sukhotin |
|
| 4080 | - **/ |
|
| 4073 | + * Find position of first occurrence of string in a string with multibyte support |
|
| 4074 | + * |
|
| 4075 | + * @param string $haystack The string being checked. |
|
| 4076 | + * @param string $needle The string to find in haystack. |
|
| 4077 | + * @param int $offset The search offset. If it is not specified, 0 is used. |
|
| 4078 | + * @return int|bool |
|
| 4079 | + * @author Alexey Sukhotin |
|
| 4080 | + **/ |
|
| 4081 | 4081 | protected function stripos($haystack , $needle , $offset = 0) { |
| 4082 | 4082 | if (function_exists('mb_stripos')) { |
| 4083 | 4083 | return mb_stripos($haystack , $needle , $offset); |
@@ -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 |
@@ -1,57 +1,57 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * elFinder Plugin Normalizer |
|
| 4 | - * |
|
| 5 | - * UTF-8 Normalizer of file-name and file-path etc. |
|
| 6 | - * nfc(NFC): Canonical Decomposition followed by Canonical Composition |
|
| 7 | - * nfkc(NFKC): Compatibility Decomposition followed by Canonical |
|
| 8 | - * |
|
| 9 | - * This plugin require Class "Normalizer" (PHP 5 >= 5.3.0, PECL intl >= 1.0.0) |
|
| 10 | - * or PEAR package "I18N_UnicodeNormalizer" |
|
| 11 | - * |
|
| 12 | - * ex. binding, configure on connector options |
|
| 13 | - * $opts = array( |
|
| 14 | - * 'bind' => array( |
|
| 15 | - * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre' => array( |
|
| 16 | - * 'Plugin.Normalizer.cmdPreprocess' |
|
| 17 | - * ), |
|
| 18 | - * 'upload.presave' => array( |
|
| 19 | - * 'Plugin.Normalizer.onUpLoadPreSave' |
|
| 20 | - * ) |
|
| 21 | - * ), |
|
| 22 | - * // global configure (optional) |
|
| 23 | - * 'plugin' => array( |
|
| 24 | - * 'Normalizer' => array( |
|
| 25 | - * 'enable' => true, |
|
| 26 | - * 'nfc' => true, |
|
| 27 | - * 'nfkc' => true, |
|
| 28 | - * 'lowercase' => false, |
|
| 29 | - * 'convmap' => array() |
|
| 30 | - * ) |
|
| 31 | - * ), |
|
| 32 | - * // each volume configure (optional) |
|
| 33 | - * 'roots' => array( |
|
| 34 | - * array( |
|
| 35 | - * 'driver' => 'LocalFileSystem', |
|
| 36 | - * 'path' => '/path/to/files/', |
|
| 37 | - * 'URL' => 'http://localhost/to/files/' |
|
| 38 | - * 'plugin' => array( |
|
| 39 | - * 'Normalizer' => array( |
|
| 40 | - * 'enable' => true, |
|
| 41 | - * 'nfc' => true, |
|
| 42 | - * 'nfkc' => true, |
|
| 43 | - * 'lowercase' => false, |
|
| 44 | - * 'convmap' => array() |
|
| 45 | - * ) |
|
| 46 | - * ) |
|
| 47 | - * ) |
|
| 48 | - * ) |
|
| 49 | - * ); |
|
| 50 | - * |
|
| 51 | - * @package elfinder |
|
| 52 | - * @author Naoki Sawada |
|
| 53 | - * @license New BSD |
|
| 54 | - */ |
|
| 3 | + * elFinder Plugin Normalizer |
|
| 4 | + * |
|
| 5 | + * UTF-8 Normalizer of file-name and file-path etc. |
|
| 6 | + * nfc(NFC): Canonical Decomposition followed by Canonical Composition |
|
| 7 | + * nfkc(NFKC): Compatibility Decomposition followed by Canonical |
|
| 8 | + * |
|
| 9 | + * This plugin require Class "Normalizer" (PHP 5 >= 5.3.0, PECL intl >= 1.0.0) |
|
| 10 | + * or PEAR package "I18N_UnicodeNormalizer" |
|
| 11 | + * |
|
| 12 | + * ex. binding, configure on connector options |
|
| 13 | + * $opts = array( |
|
| 14 | + * 'bind' => array( |
|
| 15 | + * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre' => array( |
|
| 16 | + * 'Plugin.Normalizer.cmdPreprocess' |
|
| 17 | + * ), |
|
| 18 | + * 'upload.presave' => array( |
|
| 19 | + * 'Plugin.Normalizer.onUpLoadPreSave' |
|
| 20 | + * ) |
|
| 21 | + * ), |
|
| 22 | + * // global configure (optional) |
|
| 23 | + * 'plugin' => array( |
|
| 24 | + * 'Normalizer' => array( |
|
| 25 | + * 'enable' => true, |
|
| 26 | + * 'nfc' => true, |
|
| 27 | + * 'nfkc' => true, |
|
| 28 | + * 'lowercase' => false, |
|
| 29 | + * 'convmap' => array() |
|
| 30 | + * ) |
|
| 31 | + * ), |
|
| 32 | + * // each volume configure (optional) |
|
| 33 | + * 'roots' => array( |
|
| 34 | + * array( |
|
| 35 | + * 'driver' => 'LocalFileSystem', |
|
| 36 | + * 'path' => '/path/to/files/', |
|
| 37 | + * 'URL' => 'http://localhost/to/files/' |
|
| 38 | + * 'plugin' => array( |
|
| 39 | + * 'Normalizer' => array( |
|
| 40 | + * 'enable' => true, |
|
| 41 | + * 'nfc' => true, |
|
| 42 | + * 'nfkc' => true, |
|
| 43 | + * 'lowercase' => false, |
|
| 44 | + * 'convmap' => array() |
|
| 45 | + * ) |
|
| 46 | + * ) |
|
| 47 | + * ) |
|
| 48 | + * ) |
|
| 49 | + * ); |
|
| 50 | + * |
|
| 51 | + * @package elfinder |
|
| 52 | + * @author Naoki Sawada |
|
| 53 | + * @license New BSD |
|
| 54 | + */ |
|
| 55 | 55 | class elFinderPluginNormalizer |
| 56 | 56 | { |
| 57 | 57 | private $opts = array(); |
@@ -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 | **/ |