mirror of
https://github.com/nextcloud/server.git
synced 2024-08-28 17:55:03 +02:00
Use IConfig instead of static OCP\Config
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
65ade4b6d5
commit
c27498db71
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 . '/');
|
||||
|
@ -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 = '';
|
||||
|
Loading…
Reference in New Issue
Block a user