summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-08-07 22:16:47 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-08-07 22:16:47 +0100
commit214729a5524e2c406415985717c174bedc810954 (patch)
treeb1b27273ef8f951e1cdba1aa60eb334843dee418
parentca8f7fd69c63a8149e73df98d77e489b319f37e4 (diff)
parentda951ba059209914849dd9a289ea3f398bbab70e (diff)
downloadnextcloud-server-214729a5524e2c406415985717c174bedc810954.tar.gz
nextcloud-server-214729a5524e2c406415985717c174bedc810954.zip
Merge pull request #14779 from owncloud/use-iterator-directory
Use the new IteratorDirectory instead of the fakedir wrapper
-rw-r--r--apps/files_external/lib/amazons3.php5
-rw-r--r--apps/files_external/lib/dropbox.php5
-rw-r--r--apps/files_external/lib/google.php5
-rw-r--r--apps/files_external/lib/sftp.php4
-rw-r--r--apps/files_external/lib/swift.php4
-rw-r--r--lib/private/files/objectstore/objectstorestorage.php5
-rw-r--r--lib/private/files/storage/dav.php5
-rw-r--r--lib/private/files/storage/local.php1
8 files changed, 16 insertions, 18 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 03620cfffe2..7f921b5342f 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;
use phpseclib\Net\SFTP\Stream;
@@ -280,8 +281,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;
diff --git a/lib/private/files/objectstore/objectstorestorage.php b/lib/private/files/objectstore/objectstorestorage.php
index 24398649727..a85553186ae 100644
--- a/lib/private/files/objectstore/objectstorestorage.php
+++ b/lib/private/files/objectstore/objectstorestorage.php
@@ -24,6 +24,7 @@
namespace OC\Files\ObjectStore;
+use Icewind\Streams\IteratorDirectory;
use OCP\Files\ObjectStore\IObjectStore;
class ObjectStoreStorage extends \OC\Files\Storage\Common {
@@ -216,9 +217,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common {
$files[] = $file['name'];
}
- \OC\Files\Stream\Dir::register('objectstore' . $path . '/', $files);
-
- return opendir('fakedir://objectstore' . $path . '/');
+ return IteratorDirectory::wrap($files);
} catch (\Exception $e) {
\OCP\Util::writeLog('objectstore', $e->getMessage(), \OCP\Util::ERROR);
return false;
diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php
index 24cf3c29209..6e89dcccbcd 100644
--- a/lib/private/files/storage/dav.php
+++ b/lib/private/files/storage/dav.php
@@ -38,7 +38,7 @@ namespace OC\Files\Storage;
use Exception;
use OC\Files\Filesystem;
use OC\Files\Stream\Close;
-use OC\Files\Stream\Dir;
+use Icewind\Streams\IteratorDirectory;
use OC\MemCache\ArrayCache;
use OCP\Constants;
use OCP\Files;
@@ -211,8 +211,7 @@ class DAV extends Common {
$file = basename($file);
$content[] = $file;
}
- Dir::register($id, $content);
- return opendir('fakedir://' . $id);
+ return IteratorDirectory::wrap($content);
} catch (ClientHttpException $e) {
if ($e->getHttpStatus() === 404) {
$this->statCache->clear($path . '/');
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php
index b7272b7d1f0..3676fe69131 100644
--- a/lib/private/files/storage/local.php
+++ b/lib/private/files/storage/local.php
@@ -35,7 +35,6 @@
*/
namespace OC\Files\Storage;
-
/**
* for local filestore, we only have to map the paths
*/