Change access to router object to getter function
This commit is contained in:
parent
ca1454ab1a
commit
3722928c46
18
lib/base.php
18
lib/base.php
|
@ -62,14 +62,14 @@ class OC{
|
||||||
* requested file of app
|
* requested file of app
|
||||||
*/
|
*/
|
||||||
public static $REQUESTEDFILE = '';
|
public static $REQUESTEDFILE = '';
|
||||||
/*
|
|
||||||
* OC router
|
|
||||||
*/
|
|
||||||
public static $router = null;
|
|
||||||
/**
|
/**
|
||||||
* check if owncloud runs in cli mode
|
* check if owncloud runs in cli mode
|
||||||
*/
|
*/
|
||||||
public static $CLI = false;
|
public static $CLI = false;
|
||||||
|
/*
|
||||||
|
* OC router
|
||||||
|
*/
|
||||||
|
protected static $router = null;
|
||||||
/**
|
/**
|
||||||
* SPL autoload
|
* 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(){
|
public static function init(){
|
||||||
// register autoloader
|
// register autoloader
|
||||||
spl_autoload_register(array('OC','autoload'));
|
spl_autoload_register(array('OC','autoload'));
|
||||||
|
@ -358,8 +366,6 @@ class OC{
|
||||||
OC_User::useBackend(new OC_User_Database());
|
OC_User::useBackend(new OC_User_Database());
|
||||||
OC_Group::useBackend(new OC_Group_Database());
|
OC_Group::useBackend(new OC_Group_Database());
|
||||||
|
|
||||||
OC::$router = new OC_Router();
|
|
||||||
|
|
||||||
// Load Apps
|
// Load Apps
|
||||||
// This includes plugins for users and filesystems as well
|
// This includes plugins for users and filesystems as well
|
||||||
global $RUNTIME_NOAPPS;
|
global $RUNTIME_NOAPPS;
|
||||||
|
|
Loading…
Reference in New Issue