diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-18 12:03:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-18 12:03:55 +0100 |
commit | d78a4daf7e6738d9e04cb7eeb3608d6a0e6069ab (patch) | |
tree | 9d53df04c77464de7445569887a06924998a6cae | |
parent | 4836a5e5367a190269cad2aa7d5fccc33d246599 (diff) | |
parent | 1e7b20f61585520b183a268662aa1b09c4f469b4 (diff) | |
download | nextcloud-server-d78a4daf7e6738d9e04cb7eeb3608d6a0e6069ab.tar.gz nextcloud-server-d78a4daf7e6738d9e04cb7eeb3608d6a0e6069ab.zip |
Merge pull request #7924 from nextcloud/dep_iappconfig
Remove deprecated function from IAppConfig
-rw-r--r-- | apps/files_sharing/tests/ApiTest.php | 22 | ||||
-rw-r--r-- | lib/private/AllConfig.php | 10 | ||||
-rw-r--r-- | lib/private/App/AppManager.php | 8 | ||||
-rw-r--r-- | lib/private/AppConfig.php | 5 | ||||
-rw-r--r-- | lib/private/Installer.php | 2 | ||||
-rw-r--r-- | lib/private/Server.php | 2 | ||||
-rw-r--r-- | lib/private/Share/Share.php | 12 | ||||
-rw-r--r-- | lib/private/legacy/app.php | 10 | ||||
-rw-r--r-- | lib/private/legacy/util.php | 5 | ||||
-rw-r--r-- | lib/public/IAppConfig.php | 60 | ||||
-rw-r--r-- | settings/ajax/setquota.php | 2 | ||||
-rw-r--r-- | tests/lib/App/AppManagerTest.php | 7 | ||||
-rw-r--r-- | tests/lib/AppTest.php | 2 | ||||
-rw-r--r-- | tests/lib/Files/ViewTest.php | 14 | ||||
-rw-r--r-- | tests/lib/Share/ShareTest.php | 6 |
15 files changed, 51 insertions, 116 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 2279155e914..8e2b5942d14 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -62,8 +62,8 @@ class ApiTest extends TestCase { protected function setUp() { parent::setUp(); - \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', 'no'); - \OC::$server->getAppConfig()->setValue('core', 'shareapi_expire_after_n_days', '7'); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups', 'no'); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_expire_after_n_days', '7'); $this->folder = self::TEST_FOLDER_NAME; $this->subfolder = '/subfolder_share_api_test'; @@ -239,8 +239,8 @@ class ApiTest extends TestCase { function testEnfoceLinkPassword() { $password = md5(time()); - $appConfig = \OC::$server->getAppConfig(); - $appConfig->setValue('core', 'shareapi_enforce_links_password', 'yes'); + $config = \OC::$server->getConfig(); + $config->setAppValue('core', 'shareapi_enforce_links_password', 'yes'); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); try { @@ -287,7 +287,7 @@ class ApiTest extends TestCase { $ocs->deleteShare($data['id']); $ocs->cleanup(); - $appConfig->setValue('core', 'shareapi_enforce_links_password', 'no'); + $config->setAppValue('core', 'shareapi_enforce_links_password', 'no'); } /** @@ -296,7 +296,7 @@ class ApiTest extends TestCase { function testSharePermissions() { // sharing file to a user should work if shareapi_exclude_groups is set // to no - \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', 'no'); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups', 'no'); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2); @@ -311,8 +311,8 @@ class ApiTest extends TestCase { $ocs->cleanup(); // exclude groups, but not the group the user belongs to. Sharing should still work - \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', 'yes'); - \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups_list', 'admin,group1,group2'); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups', 'yes'); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups_list', 'admin,group1,group2'); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2); @@ -327,15 +327,15 @@ class ApiTest extends TestCase { $ocs->cleanup(); // now we exclude the group the user belongs to ('group'), sharing should fail now - \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups_list', 'admin,group'); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups_list', 'admin,group'); $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2); $ocs->cleanup(); // cleanup - \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', 'no'); - \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups_list', ''); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups', 'no'); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups_list', ''); } diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php index f74a2f943d5..745bab367d3 100644 --- a/lib/private/AllConfig.php +++ b/lib/private/AllConfig.php @@ -152,7 +152,7 @@ class AllConfig implements \OCP\IConfig { * @return string[] the keys stored for the app */ public function getAppKeys($appName) { - return \OC::$server->getAppConfig()->getKeys($appName); + return \OC::$server->query(\OC\AppConfig::class)->getKeys($appName); } /** @@ -163,7 +163,7 @@ class AllConfig implements \OCP\IConfig { * @param string|float|int $value the value that should be stored */ public function setAppValue($appName, $key, $value) { - \OC::$server->getAppConfig()->setValue($appName, $key, $value); + \OC::$server->query(\OC\AppConfig::class)->setValue($appName, $key, $value); } /** @@ -175,7 +175,7 @@ class AllConfig implements \OCP\IConfig { * @return string the saved value */ public function getAppValue($appName, $key, $default = '') { - return \OC::$server->getAppConfig()->getValue($appName, $key, $default); + return \OC::$server->query(\OC\AppConfig::class)->getValue($appName, $key, $default); } /** @@ -185,7 +185,7 @@ class AllConfig implements \OCP\IConfig { * @param string $key the key of the value, under which it was saved */ public function deleteAppValue($appName, $key) { - \OC::$server->getAppConfig()->deleteKey($appName, $key); + \OC::$server->query(\OC\AppConfig::class)->deleteKey($appName, $key); } /** @@ -194,7 +194,7 @@ class AllConfig implements \OCP\IConfig { * @param string $appName the appName the configs are stored under */ public function deleteAppValues($appName) { - \OC::$server->getAppConfig()->deleteApp($appName); + \OC::$server->query(\OC\AppConfig::class)->deleteApp($appName); } diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index e7d4668931c..f2b396b29d0 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -32,10 +32,10 @@ namespace OC\App; +use OC\AppConfig; use OCP\App\AppPathNotFoundException; use OCP\App\IAppManager; use OCP\App\ManagerEvent; -use OCP\IAppConfig; use OCP\ICacheFactory; use OCP\IGroupManager; use OCP\IUser; @@ -59,7 +59,7 @@ class AppManager implements IAppManager { /** @var IUserSession */ private $userSession; - /** @var IAppConfig */ + /** @var AppConfig */ private $appConfig; /** @var IGroupManager */ @@ -82,13 +82,13 @@ class AppManager implements IAppManager { /** * @param IUserSession $userSession - * @param IAppConfig $appConfig + * @param AppConfig $appConfig * @param IGroupManager $groupManager * @param ICacheFactory $memCacheFactory * @param EventDispatcherInterface $dispatcher */ public function __construct(IUserSession $userSession, - IAppConfig $appConfig, + AppConfig $appConfig, IGroupManager $groupManager, ICacheFactory $memCacheFactory, EventDispatcherInterface $dispatcher) { diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index 4e102522550..59a340cb491 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -101,7 +101,6 @@ class AppConfig implements IAppConfig { * * @param string $app the app we are looking for * @return array an array of key names - * @deprecated 8.0.0 use method getAppKeys of \OCP\IConfig * * This function gets all keys of an app. Please note that the values are * not returned. @@ -129,7 +128,6 @@ class AppConfig implements IAppConfig { * @param string $key key * @param string $default = null, default value if the key does not exist * @return string the value or $default - * @deprecated 8.0.0 use method getAppValue of \OCP\IConfig * * This function gets a value from the appconfig table. If the key does * not exist the default value will be returned @@ -164,7 +162,6 @@ class AppConfig implements IAppConfig { * @param string $key key * @param string|float|int $value value * @return bool True if the value was inserted or updated, false if the value was the same - * @deprecated 8.0.0 use method setAppValue of \OCP\IConfig */ public function setValue($app, $key, $value) { if (!$this->hasKey($app, $key)) { @@ -220,7 +217,6 @@ class AppConfig implements IAppConfig { * @param string $app app * @param string $key key * @return boolean - * @deprecated 8.0.0 use method deleteAppValue of \OCP\IConfig */ public function deleteKey($app, $key) { $this->loadConfigValues(); @@ -242,7 +238,6 @@ class AppConfig implements IAppConfig { * * @param string $app app * @return boolean - * @deprecated 8.0.0 use method deleteAppValue of \OCP\IConfig * * Removes all keys in appconfig belonging to the app. */ diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 4dcf5a8dad9..1c6c3915b41 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -133,7 +133,7 @@ class Installer { //install the database if(is_file($basedir.'/appinfo/database.xml')) { - if (\OC::$server->getAppConfig()->getValue($info['id'], 'installed_version') === null) { + if (\OC::$server->getConfig()->getAppValue($info['id'], 'installed_version') === null) { OC_DB::createDbFromStructure($basedir.'/appinfo/database.xml'); } else { OC_DB::updateDbFromStructure($basedir.'/appinfo/database.xml'); diff --git a/lib/private/Server.php b/lib/private/Server.php index 380ab633b8c..fb4484c72af 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -677,7 +677,7 @@ class Server extends ServerContainer implements IServerContainer { $this->registerService(AppManager::class, function (Server $c) { return new \OC\App\AppManager( $c->getUserSession(), - $c->getAppConfig(), + $c->query(\OC\AppConfig::class), $c->getGroupManager(), $c->getMemCacheFactory(), $c->getEventDispatcher() diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 5a88f57fb14..f06a0998668 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -81,7 +81,7 @@ class Share extends Constants { * @return boolean true if backend is registered or false if error */ public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) { - if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_enabled', 'yes') == 'yes') { + if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_enabled', 'yes') == 'yes') { if (!isset(self::$backendTypes[$itemType])) { self::$backendTypes[$itemType] = array( 'class' => $class, @@ -540,7 +540,7 @@ class Share extends Constants { $shareWith['users'] = array_diff($userIds, array($uidOwner)); } else if ($shareType === self::SHARE_TYPE_LINK) { $updateExistingShare = false; - if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_links', 'yes') == 'yes') { + if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_allow_links', 'yes') == 'yes') { // IF the password is changed via the old ajax endpoint verify it before deleting the old share if ($passwordChanged === true) { @@ -977,7 +977,7 @@ class Share extends Constants { */ public static function isResharingAllowed() { if (!isset(self::$isResharingAllowed)) { - if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_resharing', 'yes') == 'yes') { + if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_allow_resharing', 'yes') == 'yes') { self::$isResharingAllowed = true; } else { self::$isResharingAllowed = false; @@ -1082,7 +1082,7 @@ class Share extends Constants { public static function getItems($itemType, $item = null, $shareType = null, $shareWith = null, $uidOwner = null, $format = self::FORMAT_NONE, $parameters = null, $limit = -1, $includeCollections = false, $itemShareWithBySource = false, $checkExpireDate = true) { - if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_enabled', 'yes') != 'yes') { + if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_enabled', 'yes') != 'yes') { return array(); } $backend = self::getBackend($itemType); @@ -1121,7 +1121,7 @@ class Share extends Constants { $queryArgs = array($itemType); } } - if (\OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_links', 'yes') !== 'yes') { + if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') { $where .= ' AND `share_type` != ?'; $queryArgs[] = self::SHARE_TYPE_LINK; } @@ -2144,7 +2144,7 @@ class Share extends Constants { * @return bool */ public static function shareWithGroupMembersOnly() { - $value = \OC::$server->getAppConfig()->getValue('core', 'shareapi_only_share_with_group_members', 'no'); + $value = \OC::$server->getConfig()->getAppValue('core', 'shareapi_only_share_with_group_members', 'no'); return ($value === 'yes') ? true : false; } diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index a20a88ac08f..ea44ac8a144 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -298,12 +298,12 @@ class OC_App { $appData['types'] = []; } - \OC::$server->getAppConfig()->setValue($app, 'types', $appTypes); + \OC::$server->getConfig()->setAppValue($app, 'types', $appTypes); if (\OC::$server->getAppManager()->hasProtectedAppType($appData['types'])) { - $enabled = \OC::$server->getAppConfig()->getValue($app, 'enabled', 'yes'); + $enabled = \OC::$server->getConfig()->getAppValue($app, 'enabled', 'yes'); if ($enabled !== 'yes' && $enabled !== 'no') { - \OC::$server->getAppConfig()->setValue($app, 'enabled', 'yes'); + \OC::$server->getConfig()->setAppValue($app, 'enabled', 'yes'); } } } @@ -803,7 +803,7 @@ class OC_App { continue; } - $enabled = \OC::$server->getAppConfig()->getValue($app, 'enabled', 'no'); + $enabled = \OC::$server->getConfig()->getAppValue($app, 'enabled', 'no'); $info['groups'] = null; if ($enabled === 'yes') { $active = true; @@ -1075,7 +1075,7 @@ class OC_App { self::setAppTypes($appId); $version = \OC_App::getAppVersion($appId); - \OC::$server->getAppConfig()->setValue($appId, 'installed_version', $version); + \OC::$server->getConfig()->setAppValue($appId, 'installed_version', $version); \OC::$server->getEventDispatcher()->dispatch(ManagerEvent::EVENT_APP_UPDATE, new ManagerEvent( ManagerEvent::EVENT_APP_UPDATE, $appId diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index ca7cc1dc5cf..776a879e731 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -300,8 +300,7 @@ class OC_Util { * @suppress PhanDeprecatedFunction */ public static function isPublicLinkPasswordRequired() { - $appConfig = \OC::$server->getAppConfig(); - $enforcePassword = $appConfig->getValue('core', 'shareapi_enforce_links_password', 'no'); + $enforcePassword = \OC::$server->getConfig()->getAppValue('core', 'shareapi_enforce_links_password', 'no'); return ($enforcePassword === 'yes') ? true : false; } @@ -1116,7 +1115,7 @@ class OC_Util { if (isset($_REQUEST['redirect_url']) && strpos($_REQUEST['redirect_url'], '@') === false) { $location = $urlGenerator->getAbsoluteURL(urldecode($_REQUEST['redirect_url'])); } else { - $defaultPage = \OC::$server->getAppConfig()->getValue('core', 'defaultpage'); + $defaultPage = \OC::$server->getConfig()->getAppValue('core', 'defaultpage'); if ($defaultPage) { $location = $urlGenerator->getAbsoluteURL($defaultPage); } else { diff --git a/lib/public/IAppConfig.php b/lib/public/IAppConfig.php index 4a92a224840..2f268185e62 100644 --- a/lib/public/IAppConfig.php +++ b/lib/public/IAppConfig.php @@ -41,42 +41,6 @@ interface IAppConfig { public function hasKey($app, $key); /** - * Gets the config value - * @param string $app app - * @param string $key key - * @param string $default = null, default value if the key does not exist - * @return string the value or $default - * @deprecated 8.0.0 use method getAppValue of \OCP\IConfig - * - * This function gets a value from the appconfig table. If the key does - * not exist the default value will be returned - * @since 7.0.0 - */ - public function getValue($app, $key, $default = null); - - /** - * Deletes a key - * @param string $app app - * @param string $key key - * @return bool - * @deprecated 8.0.0 use method deleteAppValue of \OCP\IConfig - * @since 7.0.0 - */ - public function deleteKey($app, $key); - - /** - * Get the available keys for an app - * @param string $app the app we are looking for - * @return array an array of key names - * @deprecated 8.0.0 use method getAppKeys of \OCP\IConfig - * - * This function gets all keys of an app. Please note that the values are - * not returned. - * @since 7.0.0 - */ - public function getKeys($app); - - /** * get multiply values, either the app or key can be used as wildcard by setting it to false * * @param string|false $key @@ -96,19 +60,6 @@ interface IAppConfig { public function getFilteredValues($app); /** - * sets a value in the appconfig - * @param string $app app - * @param string $key key - * @param string|float|int $value value - * @deprecated 8.0.0 use method setAppValue of \OCP\IConfig - * - * Sets a value. If the key did not exist before it will be created. - * @return void - * @since 7.0.0 - */ - public function setValue($app, $key, $value); - - /** * Get all apps using the config * @return array an array of app ids * @@ -117,15 +68,4 @@ interface IAppConfig { * @since 7.0.0 */ public function getApps(); - - /** - * Remove app from appconfig - * @param string $app app - * @return bool - * @deprecated 8.0.0 use method deleteAppValue of \OCP\IConfig - * - * Removes all keys in appconfig belonging to the app. - * @since 7.0.0 - */ - public function deleteApp($app); } diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index 481f0853f96..c3fde409c00 100644 --- a/settings/ajax/setquota.php +++ b/settings/ajax/setquota.php @@ -71,7 +71,7 @@ if($username) { if($quota === 'default') {//'default' as default quota makes no sense $quota='none'; } - \OC::$server->getAppConfig()->setValue('files', 'default_quota', $quota); + \OC::$server->getConfig()->setAppValue('files', 'default_quota', $quota); } OC_JSON::success(array("data" => array( "username" => $username , 'quota' => $quota))); diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php index c361db7b76b..35650054105 100644 --- a/tests/lib/App/AppManagerTest.php +++ b/tests/lib/App/AppManagerTest.php @@ -10,6 +10,7 @@ namespace Test\App; use OC\App\AppManager; +use OC\AppConfig; use OC\Group\Group; use OC\User\User; use OCP\App\AppPathNotFoundException; @@ -31,11 +32,11 @@ use Test\TestCase; */ class AppManagerTest extends TestCase { /** - * @return IAppConfig|\PHPUnit_Framework_MockObject_MockObject + * @return AppConfig|\PHPUnit_Framework_MockObject_MockObject */ protected function getAppConfig() { $appConfig = array(); - $config = $this->createMock(IAppConfig::class); + $config = $this->createMock(AppConfig::class); $config->expects($this->any()) ->method('getValue') @@ -75,7 +76,7 @@ class AppManagerTest extends TestCase { /** @var IGroupManager|\PHPUnit_Framework_MockObject_MockObject */ protected $groupManager; - /** @var IAppConfig|\PHPUnit_Framework_MockObject_MockObject */ + /** @var AppConfig|\PHPUnit_Framework_MockObject_MockObject */ protected $appConfig; /** @var ICache|\PHPUnit_Framework_MockObject_MockObject */ diff --git a/tests/lib/AppTest.php b/tests/lib/AppTest.php index 620e9344c43..d10ad387599 100644 --- a/tests/lib/AppTest.php +++ b/tests/lib/AppTest.php @@ -542,7 +542,7 @@ class AppTest extends \Test\TestCase { * * @param IAppConfig $appConfig app config mock */ - private function registerAppConfig(IAppConfig $appConfig) { + private function registerAppConfig(AppConfig $appConfig) { $this->overwriteService('AppConfig', $appConfig); $this->overwriteService('AppManager', new \OC\App\AppManager( \OC::$server->getUserSession(), diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 33d5cc0a8a6..627eb71d6bf 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -284,11 +284,11 @@ class ViewTest extends \Test\TestCase { // Reset sharing disabled for users cache self::invokePrivate(\OC::$server->getShareManager(), 'sharingDisabledForUsersCache', [new CappedMemoryCache()]); - $appConfig = \OC::$server->getAppConfig(); - $oldExcludeGroupsFlag = $appConfig->getValue('core', 'shareapi_exclude_groups', 'no'); - $oldExcludeGroupsList = $appConfig->getValue('core', 'shareapi_exclude_groups_list', ''); - $appConfig->setValue('core', 'shareapi_exclude_groups', $excludeGroups); - $appConfig->setValue('core', 'shareapi_exclude_groups_list', $excludeGroupsList); + $config = \OC::$server->getConfig(); + $oldExcludeGroupsFlag = $config->getAppValue('core', 'shareapi_exclude_groups', 'no'); + $oldExcludeGroupsList = $config->getAppValue('core', 'shareapi_exclude_groups_list', ''); + $config->setAppValue('core', 'shareapi_exclude_groups', $excludeGroups); + $config->setAppValue('core', 'shareapi_exclude_groups_list', $excludeGroupsList); $storage1 = $this->getTestStorage(); $storage2 = $this->getTestStorage(); @@ -303,8 +303,8 @@ class ViewTest extends \Test\TestCase { $folderContent = $view->getDirectoryContent('mount'); $this->assertEquals($expectedShareable, $folderContent[0]->isShareable()); - $appConfig->setValue('core', 'shareapi_exclude_groups', $oldExcludeGroupsFlag); - $appConfig->setValue('core', 'shareapi_exclude_groups_list', $oldExcludeGroupsList); + $config->setAppValue('core', 'shareapi_exclude_groups', $oldExcludeGroupsFlag); + $config->setAppValue('core', 'shareapi_exclude_groups_list', $oldExcludeGroupsList); // Reset sharing disabled for users cache self::invokePrivate(\OC::$server->getShareManager(), 'sharingDisabledForUsersCache', [new CappedMemoryCache()]); diff --git a/tests/lib/Share/ShareTest.php b/tests/lib/Share/ShareTest.php index e93b0f553cd..18d1944f193 100644 --- a/tests/lib/Share/ShareTest.php +++ b/tests/lib/Share/ShareTest.php @@ -103,8 +103,8 @@ class ShareTest extends \Test\TestCase { \OC\Share\Share::registerBackend('test', 'Test\Share\Backend'); \OC_Hook::clear('OCP\\Share'); \OC::registerShareHooks(); - $this->resharing = \OC::$server->getAppConfig()->getValue('core', 'shareapi_allow_resharing', 'yes'); - \OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', 'yes'); + $this->resharing = \OC::$server->getConfig()->getAppValue('core', 'shareapi_allow_resharing', 'yes'); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_allow_resharing', 'yes'); // 20 Minutes in the past, 20 minutes in the future. $now = time(); @@ -116,7 +116,7 @@ class ShareTest extends \Test\TestCase { protected function tearDown() { $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `item_type` = ?'); $query->execute(array('test')); - \OC::$server->getAppConfig()->setValue('core', 'shareapi_allow_resharing', $this->resharing); + \OC::$server->getConfig()->setAppValue('core', 'shareapi_allow_resharing', $this->resharing); $this->user1->delete(); $this->user2->delete(); |