summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-10-23 17:11:16 +0200
committerGitHub <noreply@github.com>2018-10-23 17:11:16 +0200
commit4ad27260a92961e9893d8351f607e1714f73007f (patch)
treefb5a6aa474e30e83b779ba9cf92100bd6432f78e /lib
parente0f9257be933ae8605424aaf5a08860cfd4359ff (diff)
parent9e0ebf183044f00d7e1e3b30c9a01e84d051dd78 (diff)
downloadnextcloud-server-4ad27260a92961e9893d8351f607e1714f73007f.tar.gz
nextcloud-server-4ad27260a92961e9893d8351f607e1714f73007f.zip
Merge pull request #11439 from nextcloud/trash-modular-api
Modular trashbin api
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheWrapper.php6
-rw-r--r--lib/private/Files/FileInfo.php2
-rw-r--r--lib/private/Files/Filesystem.php5
-rw-r--r--lib/private/Server.php13
-rw-r--r--lib/public/IServerContainer.php6
5 files changed, 29 insertions, 3 deletions
diff --git a/lib/private/Files/Cache/Wrapper/CacheWrapper.php b/lib/private/Files/Cache/Wrapper/CacheWrapper.php
index bf0d12ba2ea..da0a1b54e7f 100644
--- a/lib/private/Files/Cache/Wrapper/CacheWrapper.php
+++ b/lib/private/Files/Cache/Wrapper/CacheWrapper.php
@@ -187,6 +187,12 @@ class CacheWrapper extends Cache {
$this->getCache()->move($source, $target);
}
+ protected function getMoveInfo($path) {
+ /** @var Cache $cache */
+ $cache = $this->getCache();
+ return $cache->getMoveInfo($path);
+ }
+
public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
$this->getCache()->moveFromCache($sourceCache, $sourcePath, $targetPath);
}
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php
index 4c38ba769d3..53f73f0f95d 100644
--- a/lib/private/Files/FileInfo.php
+++ b/lib/private/Files/FileInfo.php
@@ -175,7 +175,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
* @return string
*/
public function getName() {
- return basename($this->getPath());
+ return isset($this->data['name']) ? $this->data['name'] : basename($this->getPath());
}
/**
diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php
index ba9c85deeee..404ea4ed804 100644
--- a/lib/private/Files/Filesystem.php
+++ b/lib/private/Files/Filesystem.php
@@ -65,6 +65,7 @@ use OC\Files\Storage\StorageFactory;
use OC\Lockdown\Filesystem\NullStorage;
use OCP\Files\Config\IMountProvider;
use OCP\Files\NotFoundException;
+use OCP\Files\Storage\IStorageFactory;
use OCP\ILogger;
use OCP\IUserManager;
@@ -246,11 +247,11 @@ class Filesystem {
/**
* Returns the storage factory
*
- * @return \OCP\Files\Storage\IStorageFactory
+ * @return IStorageFactory
*/
public static function getLoader() {
if (!self::$loader) {
- self::$loader = new StorageFactory();
+ self::$loader = \OC::$server->query(IStorageFactory::class);
}
return self::$loader;
}
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 5ea1b697391..e0bd8084282 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -80,6 +80,7 @@ use OC\Files\Mount\ObjectHomeMountProvider;
use OC\Files\Node\HookConnector;
use OC\Files\Node\LazyRoot;
use OC\Files\Node\Root;
+use OC\Files\Storage\StorageFactory;
use OC\Files\View;
use OC\Http\Client\ClientService;
use OC\IntegrityCheck\Checker;
@@ -135,6 +136,7 @@ use OCP\Federation\ICloudFederationProviderManager;
use OCP\Federation\ICloudIdManager;
use OCP\Authentication\LoginCredentials\IStore;
use OCP\Files\NotFoundException;
+use OCP\Files\Storage\IStorageFactory;
use OCP\GlobalScale\IConfig;
use OCP\ICacheFactory;
use OCP\IDBConnection;
@@ -1174,6 +1176,10 @@ class Server extends ServerContainer implements IServerContainer {
});
$this->registerAlias(IContactsStore::class, ContactsStore::class);
+ $this->registerService(IStorageFactory::class, function() {
+ return new StorageFactory();
+ });
+
$this->registerAlias(IDashboardManager::class, Dashboard\DashboardManager::class);
$this->connectDispatcher();
@@ -2024,4 +2030,11 @@ class Server extends ServerContainer implements IServerContainer {
public function getRemoteInstanceFactory() {
return $this->query(IInstanceFactory::class);
}
+
+ /**
+ * @return IStorageFactory
+ */
+ public function getStorageFactory() {
+ return $this->query(IStorageFactory::class);
+ }
}
diff --git a/lib/public/IServerContainer.php b/lib/public/IServerContainer.php
index 639487660b6..a3e494479b7 100644
--- a/lib/public/IServerContainer.php
+++ b/lib/public/IServerContainer.php
@@ -584,4 +584,10 @@ interface IServerContainer extends IContainer {
* @since 13.0.0
*/
public function getRemoteInstanceFactory();
+
+ /**
+ * @return \OCP\Files\Storage\IStorageFactory
+ * @since 15.0.0
+ */
+ public function getStorageFactory();
}