Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-06-01 00:10:44 +0300
committerOlivier Paroz <github@oparoz.com>2015-06-01 00:10:44 +0300
commit833b519f984282e42e26e169601a35727d2e4dd0 (patch)
treea5871c185e6c7bce476b0c43e8c1894a073fd5f4 /environment
parent80c1016d8cd9bf2ab0e7e516f3074aea5c6a96a5 (diff)
Merge fixes
Diffstat (limited to 'environment')
-rw-r--r--environment/environment.php58
1 files changed, 29 insertions, 29 deletions
diff --git a/environment/environment.php b/environment/environment.php
index cc8a29dd..94f5180f 100644
--- a/environment/environment.php
+++ b/environment/environment.php
@@ -153,7 +153,34 @@ class Environment {
return $this->getResourceFromId($node->getId());
}
-
+
+ /**
+ * Returns the Node based on the current user's files folder and a given
+ * path
+ *
+ * @param string $path
+ *
+ * @return File|Folder
+ *
+ * @throws EnvironmentException
+ */
+ public function getNode($path) {
+ $node = false;
+ $folder = $this->userFolder;
+ if ($folder === null) {
+ $this->logAndThrowNotFound("Could not access the user's folder");
+ } else {
+ try {
+ $node = $folder->get($path);
+ } catch (NotFoundException $exception) {
+ $message = 'Could not find anything at: ' . $exception->getMessage();
+ $this->logAndThrowNotFound($message);
+ }
+ }
+
+ return $node;
+ }
+
/**
* Returns the resource identified by the given ID
*
@@ -297,33 +324,6 @@ class Environment {
}
/**
- * Returns the Node based on the current user's files folder and a given
- * path
- *
- * @param string $path
- *
- * @return File|Folder
- *
- * @throws EnvironmentException
- */
- private function getNode($path) {
- $node = false;
- $folder = $this->userFolder;
- if ($folder === null) {
- $this->logAndThrowNotFound("Could not access the user's folder");
- } else {
- try {
- $node = $folder->get($path);
- } catch (NotFoundException $exception) {
- $message = 'Could not find anything at: ' . $exception->getMessage();
- $this->logAndThrowNotFound($message);
- }
- }
-
- return $node;
- }
-
- /**
* Returns the path which goes from the file, up to the user folder, based on a path:
* parent_folder/current_folder/my_file
*
@@ -343,7 +343,7 @@ class Environment {
return $origShareRelPath;
}
-
+
/**
* Logs the error and raises an exception
*