diff options
Diffstat (limited to 'lib/private/files/mount')
-rw-r--r-- | lib/private/files/mount/manager.php | 16 | ||||
-rw-r--r-- | lib/private/files/mount/mountpoint.php (renamed from lib/private/files/mount/mount.php) | 22 |
2 files changed, 15 insertions, 23 deletions
diff --git a/lib/private/files/mount/manager.php b/lib/private/files/mount/manager.php index 0ccf42941de..8472ebc976a 100644 --- a/lib/private/files/mount/manager.php +++ b/lib/private/files/mount/manager.php @@ -12,14 +12,14 @@ use \OC\Files\Filesystem; class Manager { /** - * @var Mount[] + * @var MountPoint[] */ private $mounts = array(); /** - * @param Mount $mount + * @param MountPoint $mount */ - public function addMount(Mount $mount) { + public function addMount(MountPoint $mount) { $this->mounts[$mount->getMountPoint()] = $mount; } @@ -47,7 +47,7 @@ class Manager { * Find the mount for $path * * @param string $path - * @return Mount + * @return MountPoint */ public function find($path) { \OC_Util::setupFS(); @@ -75,7 +75,7 @@ class Manager { * Find all mounts in $path * * @param string $path - * @return Mount[] + * @return MountPoint[] */ public function findIn($path) { \OC_Util::setupFS(); @@ -99,7 +99,7 @@ class Manager { * Find mounts by storage id * * @param string $id - * @return Mount[] + * @return MountPoint[] */ public function findByStorageId($id) { \OC_Util::setupFS(); @@ -116,7 +116,7 @@ class Manager { } /** - * @return Mount[] + * @return MountPoint[] */ public function getAll() { return $this->mounts; @@ -126,7 +126,7 @@ class Manager { * Find mounts by numeric storage id * * @param int $id - * @return Mount[] + * @return MountPoint[] */ public function findByNumericId($id) { $storageId = \OC\Files\Cache\Storage::getStorageId($id); diff --git a/lib/private/files/mount/mount.php b/lib/private/files/mount/mountpoint.php index 48c9d88c23c..b2c50f9d881 100644 --- a/lib/private/files/mount/mount.php +++ b/lib/private/files/mount/mountpoint.php @@ -9,10 +9,11 @@ namespace OC\Files\Mount; use \OC\Files\Filesystem; -use OC\Files\Storage\Loader; +use OC\Files\Storage\StorageFactory; use OC\Files\Storage\Storage; +use OCP\Files\Mount\IMountPoint; -class Mount { +class MountPoint implements IMountPoint { /** * @var \OC\Files\Storage\Storage $storage */ @@ -23,7 +24,7 @@ class Mount { protected $mountPoint; /** - * @var \OC\Files\Storage\Loader $loader + * @var \OC\Files\Storage\StorageFactory $loader */ private $loader; @@ -31,14 +32,14 @@ class Mount { * @param string|\OC\Files\Storage\Storage $storage * @param string $mountpoint * @param array $arguments (optional)\ - * @param \OC\Files\Storage\Loader $loader + * @param \OCP\Files\Storage\IStorageFactory $loader */ public function __construct($storage, $mountpoint, $arguments = null, $loader = null) { if (is_null($arguments)) { $arguments = array(); } if (is_null($loader)) { - $this->loader = new Loader(); + $this->loader = new StorageFactory(); } else { $this->loader = $loader; } @@ -68,15 +69,6 @@ class Mount { } /** - * get name of the mount point - * - * @return string - */ - public function getMountPointName() { - return basename(rtrim($this->mountPoint, '/')); - } - - /** * @param string $mountPoint new mount point */ public function setMountPoint($mountPoint) { @@ -91,7 +83,7 @@ class Mount { private function createStorage() { if (class_exists($this->class)) { try { - return $this->loader->load($this->mountPoint, $this->class, $this->arguments); + return $this->loader->getInstance($this->mountPoint, $this->class, $this->arguments); } catch (\Exception $exception) { if ($this->mountPoint === '/') { // the root storage could not be initialized, show the user! |