summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-02 17:47:38 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-10 23:30:04 +0200
commit3722928c46d0e4ec1935e4da4087b76aee24dd5d (patch)
tree16123a627f0375ca7ad3440104eb743dcd9f74b4
parentca1454ab1a9a20f51544d8822b4c16ef00c35264 (diff)
downloadnextcloud-server-3722928c46d0e4ec1935e4da4087b76aee24dd5d.tar.gz
nextcloud-server-3722928c46d0e4ec1935e4da4087b76aee24dd5d.zip
Change access to router object to getter function
-rw-r--r--lib/base.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/base.php b/lib/base.php
index 29a3502e352..43588944d04 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -62,14 +62,14 @@ class OC{
* requested file of app
*/
public static $REQUESTEDFILE = '';
- /*
- * OC router
- */
- public static $router = null;
/**
* check if owncloud runs in cli mode
*/
public static $CLI = false;
+ /*
+ * OC router
+ */
+ protected static $router = null;
/**
* SPL autoload
*/
@@ -275,6 +275,14 @@ class OC{
}
}
+ public static function getRouter() {
+ if (!isset(OC::$router)) {
+ OC::$router = new OC_Router();
+ }
+
+ return OC::$router;
+ }
+
public static function init(){
// register autoloader
spl_autoload_register(array('OC','autoload'));
@@ -358,8 +366,6 @@ class OC{
OC_User::useBackend(new OC_User_Database());
OC_Group::useBackend(new OC_Group_Database());
- OC::$router = new OC_Router();
-
// Load Apps
// This includes plugins for users and filesystems as well
global $RUNTIME_NOAPPS;