summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-07-27 13:43:18 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-07-27 13:43:18 +0200
commitc27498db7103aebac323c361007e0d8a2da16a34 (patch)
treecfe7bbb7b4abb89936ba9d35a70ef4f50d0c9213
parent65ade4b6d5a942ff781dad5396387facc86a95ed (diff)
downloadnextcloud-server-c27498db7103aebac323c361007e0d8a2da16a34.tar.gz
nextcloud-server-c27498db7103aebac323c361007e0d8a2da16a34.zip
Use IConfig instead of static OCP\Config
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-rw-r--r--apps/files_versions/lib/Storage.php4
-rw-r--r--apps/user_ldap/appinfo/install.php5
-rw-r--r--apps/user_ldap/lib/Configuration.php2
-rw-r--r--lib/private/Files/Cache/Scanner.php2
-rw-r--r--lib/private/Preview/Office.php2
-rw-r--r--lib/private/legacy/util.php5
-rw-r--r--tests/lib/UtilTest.php2
7 files changed, 12 insertions, 10 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index 9aa9e6d5260..6e6b6aebb6d 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -161,7 +161,7 @@ class Storage {
* store a new version of a file.
*/
public static function store($filename) {
- if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ if(\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
// if the file gets streamed we need to remove the .part extension
// to get the right target
@@ -320,7 +320,7 @@ class Storage {
*/
public static function rollback($file, $revision) {
- if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ if(\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
// add expected leading slash
$file = '/' . ltrim($file, '/');
list($uid, $filename) = self::getUidAndFilename($file);
diff --git a/apps/user_ldap/appinfo/install.php b/apps/user_ldap/appinfo/install.php
index 43ec69a950b..09f9b412342 100644
--- a/apps/user_ldap/appinfo/install.php
+++ b/apps/user_ldap/appinfo/install.php
@@ -21,10 +21,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-$state = OCP\Config::getSystemValue('ldapIgnoreNamingRules', 'doSet');
+$config = \OC::$server->getConfig();
+$state = $config->getSystemValue('ldapIgnoreNamingRules', 'doSet');
if($state === 'doSet') {
OCP\Config::setSystemValue('ldapIgnoreNamingRules', false);
}
-$helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig());
+$helper = new \OCA\User_LDAP\Helper($config);
$helper->setLDAPProvider();
diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php
index 851ff03cbb4..c65e6e34e2c 100644
--- a/apps/user_ldap/lib/Configuration.php
+++ b/apps/user_ldap/lib/Configuration.php
@@ -349,7 +349,7 @@ class Configuration {
*/
protected function getSystemValue($varName) {
//FIXME: if another system value is added, softcode the default value
- return \OCP\Config::getSystemValue($varName, false);
+ return \OC::$server->getConfig()->getSystemValue($varName, false);
}
/**
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index 229c6fc7d66..a81c34c31fa 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -88,7 +88,7 @@ class Scanner extends BasicEmitter implements IScanner {
$this->storage = $storage;
$this->storageId = $this->storage->getId();
$this->cache = $storage->getCache();
- $this->cacheActive = !Config::getSystemValue('filesystem_cache_readonly', false);
+ $this->cacheActive = !\OC::$server->getConfig()->getSystemValue('filesystem_cache_readonly', false);
$this->lockingProvider = \OC::$server->getLockingProvider();
}
diff --git a/lib/private/Preview/Office.php b/lib/private/Preview/Office.php
index a05ffef9e9a..322b254e38e 100644
--- a/lib/private/Preview/Office.php
+++ b/lib/private/Preview/Office.php
@@ -42,7 +42,7 @@ abstract class Office extends Provider {
$tmpDir = \OC::$server->getTempManager()->getTempBaseDir();
$defaultParameters = ' -env:UserInstallation=file://' . escapeshellarg($tmpDir . '/owncloud-' . \OC_Util::getInstanceId() . '/') . ' --headless --nologo --nofirststartwizard --invisible --norestore --convert-to pdf --outdir ';
- $clParameters = \OCP\Config::getSystemValue('preview_office_cl_parameters', $defaultParameters);
+ $clParameters = \OC::$server->getConfig()->getSystemValue('preview_office_cl_parameters', $defaultParameters);
$exec = $this->cmd . $clParameters . escapeshellarg($tmpDir) . ' ' . escapeshellarg($absPath);
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 18ba44ac204..8fc880667e4 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -1081,7 +1081,8 @@ class OC_Util {
$location = $urlGenerator->getAbsoluteURL($defaultPage);
} else {
$appId = 'files';
- $defaultApps = explode(',', \OCP\Config::getSystemValue('defaultapp', 'files'));
+ $config = \OC::$server->getConfig();
+ $defaultApps = explode(',', $config->getSystemValue('defaultapp', 'files'));
// find the first app that is enabled for the current user
foreach ($defaultApps as $defaultApp) {
$defaultApp = OC_App::cleanAppId(strip_tags($defaultApp));
@@ -1091,7 +1092,7 @@ class OC_Util {
}
}
- if(\OC::$server->getConfig()->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') {
+ if($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') {
$location = $urlGenerator->getAbsoluteURL('/apps/' . $appId . '/');
} else {
$location = $urlGenerator->getAbsoluteURL('/index.php/apps/' . $appId . '/');
diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php
index 39a29742e4f..52d18571647 100644
--- a/tests/lib/UtilTest.php
+++ b/tests/lib/UtilTest.php
@@ -305,7 +305,7 @@ class UtilTest extends \Test\TestCase {
* @group DB
*/
function testDefaultApps($defaultAppConfig, $expectedPath, $enabledApps) {
- $oldDefaultApps = \OCP\Config::getSystemValue('defaultapp', '');
+ $oldDefaultApps = \OC::$server->getConfig()->getSystemValue('defaultapp', '');
// CLI is doing messy stuff with the webroot, so need to work it around
$oldWebRoot = \OC::$WEBROOT;
\OC::$WEBROOT = '';