Skip to content

Commit

Permalink
Refactor OC\Server::getAppConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
summersab committed Aug 29, 2023
1 parent 613cd16 commit 9304ae2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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)));
$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

0 comments on commit 9304ae2

Please sign in to comment.