From 833b519f984282e42e26e169601a35727d2e4dd0 Mon Sep 17 00:00:00 2001 From: Olivier Paroz Date: Sun, 31 May 2015 23:10:44 +0200 Subject: Merge fixes --- environment/environment.php | 58 ++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'environment') 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 * @@ -296,33 +323,6 @@ class Environment { return $fromRootToFolder; } - /** - * 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 * -- cgit v1.2.3