summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-09-18 14:25:12 +0200
committerThomas Tanghus <thomas@tanghus.net>2013-09-18 14:25:12 +0200
commit2ef0b58ff6434254510c8be9c940126883022d76 (patch)
tree5c07c5e1bd46124d49632b1df7cdad79da2dced9 /lib
parent442a2e074cea694ce0d361b5433eb5473be438e6 (diff)
downloadnextcloud-server-2ef0b58ff6434254510c8be9c940126883022d76.tar.gz
nextcloud-server-2ef0b58ff6434254510c8be9c940126883022d76.zip
Don't try to be clever
Diffstat (limited to 'lib')
-rw-r--r--lib/server.php33
1 files changed, 18 insertions, 15 deletions
diff --git a/lib/server.php b/lib/server.php
index 6b1cb9c38d2..3454622425a 100644
--- a/lib/server.php
+++ b/lib/server.php
@@ -56,17 +56,6 @@ class Server extends SimpleContainer implements IServerContainer {
$view = new View();
return new Root($manager, $view, $user);
});
- $this->registerService('CustomFolder', function($c) {
- $dir = $c['CustomFolderPath'];
- $root = $this->getRootFolder();
- $folder = null;
- if(!$root->nodeExists($dir)) {
- $folder = $root->newFolder($dir);
- } else {
- $folder = $root->get($dir);
- }
- return $folder;
- });
}
/**
@@ -112,8 +101,15 @@ class Server extends SimpleContainer implements IServerContainer {
*/
function getUserFolder() {
- $this->registerParameter('CustomFolderPath', '/files');
- return $this->query('CustomFolder');
+ $dir = '/files';
+ $root = $this->getRootFolder();
+ $folder = null;
+ if(!$root->nodeExists($dir)) {
+ $folder = $root->newFolder($dir);
+ } else {
+ $folder = $root->get($dir);
+ }
+ return $folder;
}
@@ -124,8 +120,15 @@ class Server extends SimpleContainer implements IServerContainer {
*/
function getAppFolder() {
- $this->registerParameter('CustomFolderPath', '/' . \OC_App::getCurrentApp());
- return $this->query('CustomFolder');
+ $dir = '/' . \OC_App::getCurrentApp();
+ $root = $this->getRootFolder();
+ $folder = null;
+ if(!$root->nodeExists($dir)) {
+ $folder = $root->newFolder($dir);
+ } else {
+ $folder = $root->get($dir);
+ }
+ return $folder;
}