/**
* @var \OC\Config
*/
- public static $config = null;
+ private static $config = null;
/**
* @throws \RuntimeException when the 3rdparty directory is missing or
if (OC::$CLI) {
- OC::$WEBROOT = \OC::$config->getValue('overwritewebroot', '');
+ OC::$WEBROOT = self::$config->getValue('overwritewebroot', '');
} else {
if (substr($scriptName, 0 - strlen(OC::$SUBURI)) === OC::$SUBURI) {
OC::$WEBROOT = substr($scriptName, 0, 0 - strlen(OC::$SUBURI));
// This most likely means that we are calling from CLI.
// However some cron jobs still need to generate
// a web URL, so we use overwritewebroot as a fallback.
- OC::$WEBROOT = \OC::$config->getValue('overwritewebroot', '');
+ OC::$WEBROOT = self::$config->getValue('overwritewebroot', '');
}
// Resolve /owncloud to /owncloud/ to ensure to always have a trailing
}
// search the 3rdparty folder
- OC::$THIRDPARTYROOT = \OC::$config->getValue('3rdpartyroot', null);
- OC::$THIRDPARTYWEBROOT = \OC::$config->getValue('3rdpartyurl', null);
+ OC::$THIRDPARTYROOT = self::$config->getValue('3rdpartyroot', null);
+ OC::$THIRDPARTYWEBROOT = self::$config->getValue('3rdpartyurl', null);
if (empty(OC::$THIRDPARTYROOT) && empty(OC::$THIRDPARTYWEBROOT)) {
if (file_exists(OC::$SERVERROOT . '/3rdparty')) {
}
// search the apps folder
- $config_paths = \OC::$config->getValue('apps_paths', array());
+ $config_paths = self::$config->getValue('apps_paths', array());
if (!empty($config_paths)) {
foreach ($config_paths as $paths) {
if (isset($paths['url']) && isset($paths['path'])) {
* if $types is set, only apps of those types will be loaded
*/
public static function loadApps($types = null) {
- if (\OC::$config->getValue('maintenance', false)) {
+ if (\OC::$server->getSystemConfig()->getValue('maintenance', false)) {
return false;
}
// Load the enabled apps here
* @return string[]
*/
public static function getEnabledApps($forceRefresh = false, $all = false) {
- if (!\OC::$config->getValue('installed', false)) {
+ if (!\OC::$server->getSystemConfig()->getValue('installed', false)) {
return array();
}
// in incognito mode or when logged out, $user will be false,
$settings = array();
// by default, settings only contain the help menu
if (OC_Util::getEditionString() === '' &&
- \OC::$config->getValue('knowledgebaseenabled', true) == true
+ \OC::$server->getSystemConfig()->getValue('knowledgebaseenabled', true) == true
) {
$settings = array(
array(
* @return string|false
*/
public static function getInstallPath() {
- if (\OC::$config->getValue('appstoreenabled', true) == false) {
+ if (\OC::$server->getSystemConfig()->getValue('appstoreenabled', true) == false) {
return false;
}
*/
public static function getStorageInfo($path, $rootInfo = null) {
// return storage info without adding mount points
- $includeExtStorage = \OC::$config->getValue('quota_include_external_storage', false);
+ $includeExtStorage = \OC::$server->getSystemConfig()->getValue('quota_include_external_storage', false);
if (!$rootInfo) {
$rootInfo = \OC\Files\Filesystem::getFileInfo($path, false);
*/
public static function setupBackends() {
OC_App::loadApps(array('prelogin'));
- $backends = \OC::$config->getValue('user_backends', array());
+ $backends = \OC::$server->getSystemConfig()->getValue('user_backends', array());
foreach ($backends as $i => $config) {
$class = $config['class'];
$arguments = $config['arguments'];
if ($user) {
return $user->getHome();
} else {
- return \OC::$config->getValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $uid;
+ return \OC::$server->getSystemConfig()->getValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $uid;
}
}
private static function initLocalStorageRootFS() {
// mount local file backend as root
- $configDataDirectory = \OC::$config->getValue("datadirectory", OC::$SERVERROOT . "/data");
+ $configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT . "/data");
//first set up the local "root" storage
\OC\Files\Filesystem::initMountManager();
if (!self::$rootMounted) {
OC_Hook::emit('OC_Filesystem', 'preSetup', array('user' => $user));
//check if we are using an object storage
- $objectStore = \OC::$config->getValue('objectstore');
+ $objectStore = \OC::$server->getSystemConfig()->getValue('objectstore', null);
if (isset($objectStore)) {
self::initObjectStoreRootFS($objectStore);
} else {
public static function checkDatabaseVersion() {
$l = \OC::$server->getL10N('lib');
$errors = array();
- $dbType = \OC::$config->getValue('dbtype', 'sqlite');
+ $dbType = \OC::$server->getSystemConfig()->getValue('dbtype', 'sqlite');
if ($dbType === 'pgsql') {
// check PostgreSQL version
try {
* @return string
*/
public static function getInstanceId() {
- $id = \OC::$config->getValue('instanceid', null);
+ $id = \OC::$server->getSystemConfig()->getValue('instanceid', null);
if (is_null($id)) {
// We need to guarantee at least one letter in instanceid so it can be used as the session_name
$id = 'oc' . \OC::$server->getSecureRandom()->getLowStrengthGenerator()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS);
- \OC::$config->setValue('instanceid', $id);
+ \OC::$server->getSystemConfig()->setValue('instanceid', $id);
}
return $id;
}
* @return string the theme
*/
public static function getTheme() {
- $theme = \OC::$config->getValue("theme", '');
+ $theme = \OC::$server->getSystemConfig()->getValue("theme", '');
if ($theme === '') {
if (is_dir(OC::$SERVERROOT . '/themes/default')) {