@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Base class for elFinder volume. |
|
| 4 | - * Provide 2 layers: |
|
| 5 | - * 1. Public API (commands) |
|
| 6 | - * 2. abstract fs API |
|
| 7 | - * |
|
| 8 | - * All abstract methods begin with "_" |
|
| 9 | - * |
|
| 10 | - * @author Dmitry (dio) Levashov |
|
| 11 | - * @author Troex Nevelin |
|
| 12 | - * @author Alexey Sukhotin |
|
| 13 | - **/ |
|
| 3 | + * Base class for elFinder volume. |
|
| 4 | + * Provide 2 layers: |
|
| 5 | + * 1. Public API (commands) |
|
| 6 | + * 2. abstract fs API |
|
| 7 | + * |
|
| 8 | + * All abstract methods begin with "_" |
|
| 9 | + * |
|
| 10 | + * @author Dmitry (dio) Levashov |
|
| 11 | + * @author Troex Nevelin |
|
| 12 | + * @author Alexey Sukhotin |
|
| 13 | + **/ |
|
| 14 | 14 | abstract class elFinderVolumeDriver { |
| 15 | 15 | |
| 16 | 16 | /** |
@@ -192,11 +192,11 @@ discard block |
||
| 192 | 192 | 'mimefile' => '', |
| 193 | 193 | // mime type normalize map : Array '[ext]:[detected mime type]' => '[normalized mime]' |
| 194 | 194 | 'mimeMap' => array( |
| 195 | - 'md:application/x-genesis-rom' => 'text/x-markdown', |
|
| 196 | - 'md:text/plain' => 'text/x-markdown', |
|
| 197 | - 'markdown:text/plain' => 'text/x-markdown', |
|
| 198 | - 'css:text/x-asm' => 'text/css' |
|
| 199 | - ), |
|
| 195 | + 'md:application/x-genesis-rom' => 'text/x-markdown', |
|
| 196 | + 'md:text/plain' => 'text/x-markdown', |
|
| 197 | + 'markdown:text/plain' => 'text/x-markdown', |
|
| 198 | + 'css:text/x-asm' => 'text/css' |
|
| 199 | + ), |
|
| 200 | 200 | // directory for thumbnails |
| 201 | 201 | 'tmbPath' => '.tmb', |
| 202 | 202 | // mode to create thumbnails dir |
@@ -4043,14 +4043,14 @@ discard block |
||
| 4043 | 4043 | // } |
| 4044 | 4044 | |
| 4045 | 4045 | /** |
| 4046 | - * Find position of first occurrence of string in a string with multibyte support |
|
| 4047 | - * |
|
| 4048 | - * @param string $haystack The string being checked. |
|
| 4049 | - * @param string $needle The string to find in haystack. |
|
| 4050 | - * @param int $offset The search offset. If it is not specified, 0 is used. |
|
| 4051 | - * @return int|bool |
|
| 4052 | - * @author Alexey Sukhotin |
|
| 4053 | - **/ |
|
| 4046 | + * Find position of first occurrence of string in a string with multibyte support |
|
| 4047 | + * |
|
| 4048 | + * @param string $haystack The string being checked. |
|
| 4049 | + * @param string $needle The string to find in haystack. |
|
| 4050 | + * @param int $offset The search offset. If it is not specified, 0 is used. |
|
| 4051 | + * @return int|bool |
|
| 4052 | + * @author Alexey Sukhotin |
|
| 4053 | + **/ |
|
| 4054 | 4054 | protected function stripos($haystack , $needle , $offset = 0) { |
| 4055 | 4055 | if (function_exists('mb_stripos')) { |
| 4056 | 4056 | 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 |
@@ -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 | **/ |