diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-03-10 16:30:13 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-07-15 13:57:53 +0200 |
commit | da951ba059209914849dd9a289ea3f398bbab70e (patch) | |
tree | a20b027f9cc6a51002984c79a49de64b6fd76316 /apps/files_external/lib | |
parent | 5581ae12a1c1e60a09108855d6f2bbfc620f7bf1 (diff) | |
download | nextcloud-server-da951ba059209914849dd9a289ea3f398bbab70e.tar.gz nextcloud-server-da951ba059209914849dd9a289ea3f398bbab70e.zip |
Use the new IteratorDirectory instead of the fakedir wrapper
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r-- | apps/files_external/lib/amazons3.php | 5 | ||||
-rw-r--r-- | apps/files_external/lib/dropbox.php | 5 | ||||
-rw-r--r-- | apps/files_external/lib/google.php | 5 | ||||
-rw-r--r-- | apps/files_external/lib/sftp.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/swift.php | 4 |
5 files changed, 12 insertions, 11 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 02a02710a14..b956a607eba 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -40,6 +40,7 @@ require 'aws-autoloader.php'; use Aws\S3\S3Client; use Aws\S3\Exception\S3Exception; +use Icewind\Streams\IteratorDirectory; class AmazonS3 extends \OC\Files\Storage\Common { @@ -284,9 +285,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { $files[] = $file; } - \OC\Files\Stream\Dir::register('amazons3' . $path, $files); - - return opendir('fakedir://amazons3' . $path); + return IteratorDirectory::wrap($files); } catch (S3Exception $e) { \OCP\Util::logException('files_external', $e); return false; diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php index 78219f8f06e..2d1aea1afc8 100644 --- a/apps/files_external/lib/dropbox.php +++ b/apps/files_external/lib/dropbox.php @@ -29,6 +29,8 @@ namespace OC\Files\Storage; +use Icewind\Streams\IteratorDirectory; + require_once __DIR__ . '/../3rdparty/Dropbox/autoload.php'; class Dropbox extends \OC\Files\Storage\Common { @@ -156,8 +158,7 @@ class Dropbox extends \OC\Files\Storage\Common { foreach ($contents as $file) { $files[] = basename($file['path']); } - \OC\Files\Stream\Dir::register('dropbox'.$path, $files); - return opendir('fakedir://dropbox'.$path); + return IteratorDirectory::wrap($files); } return false; } diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index 8199d97eacb..2ca550dfe7c 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -32,6 +32,8 @@ namespace OC\Files\Storage; +use Icewind\Streams\IteratorDirectory; + set_include_path(get_include_path().PATH_SEPARATOR. \OC_App::getAppPath('files_external').'/3rdparty/google-api-php-client/src'); require_once 'Google/Client.php'; @@ -291,8 +293,7 @@ class Google extends \OC\Files\Storage\Common { } $pageToken = $children->getNextPageToken(); } - \OC\Files\Stream\Dir::register('google'.$path, $files); - return opendir('fakedir://google'.$path); + return IteratorDirectory::wrap($files); } else { return false; } diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php index cbe090311a9..64bb52f3193 100644 --- a/apps/files_external/lib/sftp.php +++ b/apps/files_external/lib/sftp.php @@ -29,6 +29,7 @@ * */ namespace OC\Files\Storage; +use Icewind\Streams\IteratorDirectory; /** * Uses phpseclib's Net_SFTP class and the Net_SFTP_Stream stream wrapper to @@ -278,8 +279,7 @@ class SFTP extends \OC\Files\Storage\Common { $dirStream[] = $file; } } - \OC\Files\Stream\Dir::register($id, $dirStream); - return opendir('fakedir://' . $id); + return IteratorDirectory::wrap($dirStream); } catch(\Exception $e) { return false; } diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index 50f0d40805a..d8107e58fed 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -32,6 +32,7 @@ namespace OC\Files\Storage; use Guzzle\Http\Exception\ClientErrorResponseException; +use Icewind\Streams\IteratorDirectory; use OpenCloud; use OpenCloud\Common\Exceptions; use OpenCloud\OpenStack; @@ -222,8 +223,7 @@ class Swift extends \OC\Files\Storage\Common { } } - \OC\Files\Stream\Dir::register('swift' . $path, $files); - return opendir('fakedir://swift' . $path); + return IteratorDirectory::wrap($files); } catch (\Exception $e) { \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; |