Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor OC\Server::getAppConfig #40112

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/register_command.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

use OCP\IAppConfig;
use Psr\Log\LoggerInterface;

$application->add(new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand());
Expand Down Expand Up @@ -98,7 +100,7 @@
$application->add(new OC\Core\Command\Config\App\GetConfig(\OC::$server->getConfig()));
$application->add(new OC\Core\Command\Config\App\SetConfig(\OC::$server->getConfig()));
$application->add(new OC\Core\Command\Config\Import(\OC::$server->getConfig()));
$application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->getAppConfig()));
$application->add(new OC\Core\Command\Config\ListConfigs(\OC::$server->getSystemConfig(), \OC::$server->get(IAppConfig::class)));

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getSystemConfig has been marked as deprecated
$application->add(new OC\Core\Command\Config\System\DeleteConfig(\OC::$server->getSystemConfig()));
$application->add(new OC\Core\Command\Config\System\GetConfig(\OC::$server->getSystemConfig()));
$application->add(new OC\Core\Command\Config\System\SetConfig(\OC::$server->getSystemConfig()));
Expand Down
3 changes: 2 additions & 1 deletion lib/private/legacy/OC_App.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
use OCP\App\ManagerEvent;
use OCP\Authentication\IAlternativeLogin;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IAppConfig;
use OCP\ILogger;
use OC\AppFramework\Bootstrap\Coordinator;
use OC\App\DependencyAnalyzer;
Expand Down Expand Up @@ -731,7 +732,7 @@ public static function getAppVersions() {
static $versions;

if (!$versions) {
$appConfig = \OC::$server->getAppConfig();
$appConfig = \OC::$server->get(IAppConfig::class);
$versions = $appConfig->getValues(false, 'installed_version');
}
return $versions;
Expand Down