]> source.dussan.org Git - nextcloud-server.git/commitdiff
Replace old config code with usage of proper APIs
authorMorris Jobke <hey@morrisjobke.de>
Wed, 2 Dec 2015 14:56:59 +0000 (15:56 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Wed, 2 Dec 2015 14:56:59 +0000 (15:56 +0100)
apps/files_trashbin/tests/trashbin.php
lib/private/installer.php
lib/private/setup.php

index 1b5e955d2b2172d5cc7e11b710c15e7b7435f31f..c53ed8d8a9bf9ef3c470dc12ee88a800e4066048 100644 (file)
@@ -71,9 +71,10 @@ class Test_Trashbin extends \Test\TestCase {
                //disable encryption
                \OC_App::disable('encryption');
 
+               $config = \OC::$server->getConfig();
                //configure trashbin
-               self::$rememberRetentionObligation = \OC_Config::getValue('trashbin_retention_obligation', Files_Trashbin\Expiration::DEFAULT_RETENTION_OBLIGATION);
-               \OC_Config::setValue('trashbin_retention_obligation', 'auto, 2');
+               self::$rememberRetentionObligation = $config->getSystemValue('trashbin_retention_obligation', Files_Trashbin\Expiration::DEFAULT_RETENTION_OBLIGATION);
+               $config->setSystemValue('trashbin_retention_obligation', 'auto, 2');
 
                // register hooks
                Files_Trashbin\Trashbin::registerHooks();
@@ -89,7 +90,7 @@ class Test_Trashbin extends \Test\TestCase {
                // cleanup test user
                \OC_User::deleteUser(self::TEST_TRASHBIN_USER1);
 
-               \OC_Config::setValue('trashbin_retention_obligation', self::$rememberRetentionObligation);
+               \OC::$server->getConfig()->setSystemValue('trashbin_retention_obligation', self::$rememberRetentionObligation);
 
                \OC_Hook::clear();
 
index 021e496392f2c25983533f659e58089be3afacc1..fa9fc6704dff2b842748e3987e4efc443cccaa1b 100644 (file)
@@ -538,17 +538,20 @@ class OC_Installer{
                if (is_null($info)) {
                        return false;
                }
-               \OC::$server->getAppConfig()->setValue($app, 'installed_version', OC_App::getAppVersion($app));
+
+               $config = \OC::$server->getConfig();
+
+               $config->setAppValue($app, 'installed_version', OC_App::getAppVersion($app));
                if (array_key_exists('ocsid', $info)) {
-                       \OC::$server->getAppConfig()->setValue($app, 'ocsid', $info['ocsid']);
+                       $config->setAppValue($app, 'ocsid', $info['ocsid']);
                }
 
                //set remote/public handlers
                foreach($info['remote'] as $name=>$path) {
-                       OCP\CONFIG::setAppValue('core', 'remote_'.$name, $app.'/'.$path);
+                       $config->setAppValue('core', 'remote_'.$name, $app.'/'.$path);
                }
                foreach($info['public'] as $name=>$path) {
-                       OCP\CONFIG::setAppValue('core', 'public_'.$name, $app.'/'.$path);
+                       $config->setAppValue('core', 'public_'.$name, $app.'/'.$path);
                }
 
                OC_App::setAppTypes($info['id']);
@@ -563,7 +566,7 @@ class OC_Installer{
         */
        public static function checkCode($folder) {
                // is the code checker enabled?
-               if(!OC_Config::getValue('appcodechecker', false)) {
+               if(!\OC::$server->getConfig()->getSystemValue('appcodechecker', false)) {
                        return true;
                }
 
index 2c959622cc7303f7e9c2fba081ae9b0d1cc34376..814d78679e276b2a50cd3638961e7bcc31306ac4 100644 (file)
@@ -463,7 +463,9 @@ class Setup {
                $content.= "</ifModule>\n\n";
                $content.= "# section for Apache 2.2 and 2.4\n";
                $content.= "IndexIgnore *\n";
-               file_put_contents(\OC_Config::getValue('datadirectory', \OC::$SERVERROOT.'/data').'/.htaccess', $content);
-               file_put_contents(\OC_Config::getValue('datadirectory', \OC::$SERVERROOT.'/data').'/index.html', '');
+
+               $baseDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data');
+               file_put_contents($baseDir . '/.htaccess', $content);
+               file_put_contents($baseDir . '/index.html', '');
        }
 }