From 736f10039dd1b494966f1214916dc62119478176 Mon Sep 17 00:00:00 2001 From: Florin Peter Date: Fri, 24 May 2013 20:36:20 +0200 Subject: changed builtin normalizer to \OC_Util::normalizeUnicode --- lib/files/filesystem.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/files/filesystem.php') diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index d60d430d77c..5d7565f0d83 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -616,9 +616,8 @@ class Filesystem { $path = substr($path, 0, -1); } //normalize unicode if possible - if (class_exists('Normalizer')) { - $path = \Normalizer::normalize($path); - } + $path = \OC_Util::normalizeUnicode($path); + return $path; } -- cgit v1.2.3 From b5e817d638afcbdb86f6f8ffd6e92348c2454d3e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 2 Jun 2013 21:44:24 +0200 Subject: fix clearing mounts when filesystem isn't initialized yet --- lib/files/filesystem.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/files/filesystem.php') diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index 02cce001b48..7e0bcfd1a27 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -359,7 +359,9 @@ class Filesystem { * clear all mounts and storage backends */ public static function clearMounts() { - self::$mounts->clear(); + if (self::$mounts) { + self::$mounts->clear(); + } } /** -- cgit v1.2.3 From 38bd234686d206013d1f402c89e310503a65a5a8 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 2 Jun 2013 22:09:44 +0200 Subject: make sure the filesystem is setup before doing mount operations --- lib/files/filesystem.php | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'lib/files/filesystem.php') diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index 7e0bcfd1a27..d3fddf8c421 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -152,6 +152,9 @@ class Filesystem { * @return string */ static public function getMountPoint($path) { + if (!self::$mounts) { + \OC_Util::setupFS(); + } $mount = self::$mounts->find($path); if ($mount) { return $mount->getMountPoint(); @@ -167,6 +170,9 @@ class Filesystem { * @return string[] */ static public function getMountPoints($path) { + if (!self::$mounts) { + \OC_Util::setupFS(); + } $result = array(); $mounts = self::$mounts->findIn($path); foreach ($mounts as $mount) { @@ -182,6 +188,9 @@ class Filesystem { * @return \OC\Files\Storage\Storage */ public static function getStorage($mountPoint) { + if (!self::$mounts) { + \OC_Util::setupFS(); + } $mount = self::$mounts->find($mountPoint); return $mount->getStorage(); } @@ -191,6 +200,9 @@ class Filesystem { * @return Mount\Mount[] */ public static function getMountByStorageId($id) { + if (!self::$mounts) { + \OC_Util::setupFS(); + } return self::$mounts->findByStorageId($id); } @@ -199,6 +211,9 @@ class Filesystem { * @return Mount\Mount[] */ public static function getMountByNumericId($id) { + if (!self::$mounts) { + \OC_Util::setupFS(); + } return self::$mounts->findByNumericId($id); } @@ -209,6 +224,9 @@ class Filesystem { * @return array consisting of the storage and the internal path */ static public function resolvePath($path) { + if (!self::$mounts) { + \OC_Util::setupFS(); + } $mount = self::$mounts->find($path); if ($mount) { return array($mount->getStorage(), $mount->getInternalPath($path)); @@ -223,7 +241,7 @@ class Filesystem { } self::$defaultInstance = new View($root); - if(!self::$mounts) { + if (!self::$mounts) { self::$mounts = new Mount\Manager(); } @@ -235,8 +253,8 @@ class Filesystem { return true; } - static public function initMounts(){ - if(!self::$mounts) { + static public function initMounts() { + if (!self::$mounts) { self::$mounts = new Mount\Manager(); } } @@ -372,6 +390,9 @@ class Filesystem { * @param string $mountpoint */ static public function mount($class, $arguments, $mountpoint) { + if (!self::$mounts) { + \OC_Util::setupFS(); + } $mount = new Mount\Mount($class, $mountpoint, $arguments); self::$mounts->addMount($mount); } -- cgit v1.2.3