@@ -154,7 +154,7 @@ |
||
| 154 | 154 | * see http://php.net/manual/en/function.filetype.php |
| 155 | 155 | * |
| 156 | 156 | * @param string $path |
| 157 | - * @return bool |
|
| 157 | + * @return string|false |
|
| 158 | 158 | */ |
| 159 | 159 | public function filetype($path) { |
| 160 | 160 | return $this->storage->filetype($this->findPathToUse($path)); |
@@ -51,6 +51,9 @@ discard block |
||
| 51 | 51 | $this->rootPath = $arguments['root']; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | + /** |
|
| 55 | + * @param string $path |
|
| 56 | + */ |
|
| 54 | 57 | public function getSourcePath($path) { |
| 55 | 58 | if ($this->rootPath === null) { |
| 56 | 59 | throw new \InvalidArgumentException('Jail rootPath is null'); |
@@ -131,7 +134,7 @@ discard block |
||
| 131 | 134 | * see http://php.net/manual/en/function.filetype.php |
| 132 | 135 | * |
| 133 | 136 | * @param string $path |
| 134 | - * @return bool |
|
| 137 | + * @return string|false |
|
| 135 | 138 | */ |
| 136 | 139 | public function filetype($path) { |
| 137 | 140 | return $this->getWrapperStorage()->filetype($this->getSourcePath($path)); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | * see http://php.net/manual/en/function.filetype.php |
| 133 | 133 | * |
| 134 | 134 | * @param string $path |
| 135 | - * @return bool |
|
| 135 | + * @return string|false |
|
| 136 | 136 | */ |
| 137 | 137 | public function filetype($path) { |
| 138 | 138 | return $this->getWrapperStorage()->filetype($path); |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | /** |
| 462 | 462 | * Returns true |
| 463 | 463 | * |
| 464 | - * @return true |
|
| 464 | + * @return boolean |
|
| 465 | 465 | */ |
| 466 | 466 | public function test() { |
| 467 | 467 | return $this->getWrapperStorage()->test(); |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | * @param MetaVersionCollection $parent |
| 61 | 61 | * @param IRootFolder $root |
| 62 | 62 | * @param array $version |
| 63 | - * @param Storage $storage |
|
| 63 | + * @param Storage\IStorage $storage |
|
| 64 | 64 | * @param string $internalPath |
| 65 | 65 | */ |
| 66 | 66 | public function __construct(MetaVersionCollection $parent, |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * @param \OCP\Files\Mount\IMountPoint $mountPoint |
| 78 | 78 | * @param string $class |
| 79 | 79 | * @param array $arguments |
| 80 | - * @return \OCP\Files\Storage |
|
| 80 | + * @return IStorage |
|
| 81 | 81 | */ |
| 82 | 82 | public function getInstance(IMountPoint $mountPoint, $class, $arguments) { |
| 83 | 83 | return $this->wrap($mountPoint, new $class($arguments)); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | /** |
| 87 | 87 | * @param \OCP\Files\Mount\IMountPoint $mountPoint |
| 88 | 88 | * @param \OCP\Files\Storage\IStorage $storage |
| 89 | - * @return \OCP\Files\Storage |
|
| 89 | + * @return IStorage |
|
| 90 | 90 | */ |
| 91 | 91 | public function wrap(IMountPoint $mountPoint, $storage) { |
| 92 | 92 | $wrappers = \array_values($this->storageWrappers); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | * |
| 361 | 361 | * @param string $path |
| 362 | 362 | * @param string $mode |
| 363 | - * @return resource|bool |
|
| 363 | + * @return resource |
|
| 364 | 364 | * @throws GenericEncryptionException |
| 365 | 365 | * @throws ModuleDoesNotExistsException |
| 366 | 366 | */ |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | * Set the flag to true, so that the file would be |
| 645 | 645 | * in the decrypted state. |
| 646 | 646 | * |
| 647 | - * @param $isDisabled bool |
|
| 647 | + * @param boolean $isDisabled bool |
|
| 648 | 648 | */ |
| 649 | 649 | public static function setDisableWriteEncryption($isDisabled) { |
| 650 | 650 | self::$disableWriteEncryption = $isDisabled; |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | /** |
| 674 | 674 | * Update the encrypted cache version in the database |
| 675 | 675 | * |
| 676 | - * @param Storage $sourceStorage |
|
| 676 | + * @param Storage\IStorage $sourceStorage |
|
| 677 | 677 | * @param string $sourceInternalPath |
| 678 | 678 | * @param string $targetInternalPath |
| 679 | 679 | * @param bool $isRename |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | /** |
| 719 | 719 | * copy file between two storages |
| 720 | 720 | * |
| 721 | - * @param Storage $sourceStorage |
|
| 721 | + * @param Storage\IStorage $sourceStorage |
|
| 722 | 722 | * @param string $sourceInternalPath |
| 723 | 723 | * @param string $targetInternalPath |
| 724 | 724 | * @param bool $preserveMtime |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | /** |
| 903 | 903 | * return header size of given file |
| 904 | 904 | * |
| 905 | - * @param string|resource $path |
|
| 905 | + * @param string $path |
|
| 906 | 906 | * @return int |
| 907 | 907 | */ |
| 908 | 908 | protected function getHeaderSize($path) { |
@@ -953,7 +953,7 @@ discard block |
||
| 953 | 953 | /** |
| 954 | 954 | * read header from file |
| 955 | 955 | * |
| 956 | - * @param string|resource $path |
|
| 956 | + * @param string $path |
|
| 957 | 957 | * @return array |
| 958 | 958 | */ |
| 959 | 959 | protected function getHeader($path) { |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | /** |
| 1050 | 1050 | * check if path points to a files version |
| 1051 | 1051 | * |
| 1052 | - * @param $path |
|
| 1052 | + * @param string $path |
|
| 1053 | 1053 | * @return bool |
| 1054 | 1054 | */ |
| 1055 | 1055 | protected function isVersion($path) { |
@@ -34,7 +34,6 @@ |
||
| 34 | 34 | namespace OCA\Files_External\Lib\Storage; |
| 35 | 35 | use function GuzzleHttp\Psr7\stream_for; |
| 36 | 36 | use Icewind\Streams\IteratorDirectory; |
| 37 | -use Icewind\Streams\RetryWrapper; |
|
| 38 | 37 | use OCP\Files\Storage\StorageAdapter; |
| 39 | 38 | use phpseclib\Net\SFTP\Stream; |
| 40 | 39 | use Psr\Http\Message\StreamInterface; |
@@ -45,7 +45,6 @@ |
||
| 45 | 45 | use Icewind\SMB\ServerFactory; |
| 46 | 46 | use Icewind\SMB\System; |
| 47 | 47 | use Icewind\SMB\IShare; |
| 48 | -use Icewind\Streams\CallbackWrapper; |
|
| 49 | 48 | use Icewind\Streams\IteratorDirectory; |
| 50 | 49 | use OC\Cache\CappedMemoryCache; |
| 51 | 50 | use OC\Files\Filesystem; |
@@ -359,6 +359,10 @@ discard block |
||
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | + /** |
|
| 363 | + * @param string|boolean $user |
|
| 364 | + * @param string $root |
|
| 365 | + */ |
|
| 362 | 366 | public static function init($user, $root) { |
| 363 | 367 | if (self::$defaultInstance) { |
| 364 | 368 | return false; |
@@ -517,7 +521,7 @@ discard block |
||
| 517 | 521 | /** |
| 518 | 522 | * mount an \OC\Files\Storage\Storage in our virtual filesystem |
| 519 | 523 | * |
| 520 | - * @param \OC\Files\Storage\Storage|string $class |
|
| 524 | + * @param string $class |
|
| 521 | 525 | * @param array $arguments |
| 522 | 526 | * @param string $mountpoint |
| 523 | 527 | */ |
@@ -690,6 +694,9 @@ discard block |
||
| 690 | 694 | return self::$defaultInstance->is_dir($path); |
| 691 | 695 | } |
| 692 | 696 | |
| 697 | + /** |
|
| 698 | + * @param string $path |
|
| 699 | + */ |
|
| 693 | 700 | public static function is_file($path) { |
| 694 | 701 | return self::$defaultInstance->is_file($path); |
| 695 | 702 | } |
@@ -702,6 +709,9 @@ discard block |
||
| 702 | 709 | return self::$defaultInstance->filetype($path); |
| 703 | 710 | } |
| 704 | 711 | |
| 712 | + /** |
|
| 713 | + * @param string $path |
|
| 714 | + */ |
|
| 705 | 715 | public static function filesize($path) { |
| 706 | 716 | return self::$defaultInstance->filesize($path); |
| 707 | 717 | } |
@@ -714,6 +724,9 @@ discard block |
||
| 714 | 724 | return self::$defaultInstance->isCreatable($path); |
| 715 | 725 | } |
| 716 | 726 | |
| 727 | + /** |
|
| 728 | + * @param string $path |
|
| 729 | + */ |
|
| 717 | 730 | public static function isReadable($path) { |
| 718 | 731 | return self::$defaultInstance->isReadable($path); |
| 719 | 732 | } |
@@ -726,6 +739,9 @@ discard block |
||
| 726 | 739 | return self::$defaultInstance->isDeletable($path); |
| 727 | 740 | } |
| 728 | 741 | |
| 742 | + /** |
|
| 743 | + * @param string $path |
|
| 744 | + */ |
|
| 729 | 745 | public static function isSharable($path) { |
| 730 | 746 | return self::$defaultInstance->isSharable($path); |
| 731 | 747 | } |
@@ -743,6 +759,7 @@ discard block |
||
| 743 | 759 | } |
| 744 | 760 | |
| 745 | 761 | /** |
| 762 | + * @param string $path |
|
| 746 | 763 | * @return string |
| 747 | 764 | */ |
| 748 | 765 | public static function file_get_contents($path) { |
@@ -766,8 +783,8 @@ discard block |
||
| 766 | 783 | } |
| 767 | 784 | |
| 768 | 785 | /** |
| 769 | - * @param $path |
|
| 770 | - * @param $mode |
|
| 786 | + * @param string $path |
|
| 787 | + * @param string $mode |
|
| 771 | 788 | * @return resource |
| 772 | 789 | * @deprecated 11.0.0 |
| 773 | 790 | */ |
@@ -786,6 +803,9 @@ discard block |
||
| 786 | 803 | return self::$defaultInstance->fromTmpFile($tmpFile, $path); |
| 787 | 804 | } |
| 788 | 805 | |
| 806 | + /** |
|
| 807 | + * @param string $path |
|
| 808 | + */ |
|
| 789 | 809 | public static function getMimeType($path) { |
| 790 | 810 | return self::$defaultInstance->getMimeType($path); |
| 791 | 811 | } |
@@ -798,6 +818,9 @@ discard block |
||
| 798 | 818 | return self::$defaultInstance->free_space($path); |
| 799 | 819 | } |
| 800 | 820 | |
| 821 | + /** |
|
| 822 | + * @param string $query |
|
| 823 | + */ |
|
| 801 | 824 | public static function search($query) { |
| 802 | 825 | return self::$defaultInstance->search($query); |
| 803 | 826 | } |
@@ -907,7 +930,7 @@ discard block |
||
| 907 | 930 | * @param string $path |
| 908 | 931 | * @param boolean $includeMountPoints whether to add mountpoint sizes, |
| 909 | 932 | * defaults to true |
| 910 | - * @return \OC\Files\FileInfo|bool False if file does not exist |
|
| 933 | + * @return \OCP\Files\FileInfo|null False if file does not exist |
|
| 911 | 934 | */ |
| 912 | 935 | public static function getFileInfo($path, $includeMountPoints = true) { |
| 913 | 936 | return self::$defaultInstance->getFileInfo($path, $includeMountPoints); |