aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/Command/Status.php7
-rw-r--r--core/Controller/OCJSController.php3
-rw-r--r--core/Controller/OCSController.php11
-rw-r--r--core/Controller/WhatsNewController.php4
-rw-r--r--core/ajax/update.php1
5 files changed, 17 insertions, 9 deletions
diff --git a/core/Command/Status.php b/core/Command/Status.php
index 1f6d5705137..a00d4a94658 100644
--- a/core/Command/Status.php
+++ b/core/Command/Status.php
@@ -7,9 +7,9 @@
*/
namespace OC\Core\Command;
-use OC_Util;
use OCP\Defaults;
use OCP\IConfig;
+use OCP\ServerVersion;
use OCP\Util;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -19,6 +19,7 @@ class Status extends Base {
public function __construct(
private IConfig $config,
private Defaults $themingDefaults,
+ private ServerVersion $serverVersion,
) {
parent::__construct('status');
}
@@ -41,8 +42,8 @@ class Status extends Base {
$needUpgrade = Util::needUpgrade();
$values = [
'installed' => $this->config->getSystemValueBool('installed', false),
- 'version' => implode('.', Util::getVersion()),
- 'versionstring' => OC_Util::getVersionString(),
+ 'version' => implode('.', $this->serverVersion->getVersion()),
+ 'versionstring' => $this->serverVersion->getVersionString(),
'edition' => '',
'maintenance' => $maintenanceMode,
'needsDbUpgrade' => $needUpgrade,
diff --git a/core/Controller/OCJSController.php b/core/Controller/OCJSController.php
index 3a0922c9344..176558b013d 100644
--- a/core/Controller/OCJSController.php
+++ b/core/Controller/OCJSController.php
@@ -27,6 +27,7 @@ use OCP\ISession;
use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\L10N\IFactory;
+use OCP\ServerVersion;
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
class OCJSController extends Controller {
@@ -48,10 +49,12 @@ class OCJSController extends Controller {
IInitialStateService $initialStateService,
IProvider $tokenProvider,
FilenameValidator $filenameValidator,
+ ServerVersion $serverVersion,
) {
parent::__construct($appName, $request);
$this->helper = new JSConfigHelper(
+ $serverVersion,
$l10nFactory->get('lib'),
$defaults,
$appManager,
diff --git a/core/Controller/OCSController.php b/core/Controller/OCSController.php
index 743a71622da..65ce55b8606 100644
--- a/core/Controller/OCSController.php
+++ b/core/Controller/OCSController.php
@@ -16,6 +16,7 @@ use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
use OCP\IUserManager;
use OCP\IUserSession;
+use OCP\ServerVersion;
class OCSController extends \OCP\AppFramework\OCSController {
public function __construct(
@@ -25,6 +26,7 @@ class OCSController extends \OCP\AppFramework\OCSController {
private IUserSession $userSession,
private IUserManager $userManager,
private Manager $keyManager,
+ private ServerVersion $serverVersion,
) {
parent::__construct($appName, $request);
}
@@ -55,12 +57,11 @@ class OCSController extends \OCP\AppFramework\OCSController {
#[ApiRoute(verb: 'GET', url: '/capabilities', root: '/cloud')]
public function getCapabilities(): DataResponse {
$result = [];
- [$major, $minor, $micro] = \OCP\Util::getVersion();
$result['version'] = [
- 'major' => (int)$major,
- 'minor' => (int)$minor,
- 'micro' => (int)$micro,
- 'string' => \OC_Util::getVersionString(),
+ 'major' => $this->serverVersion->getMajorVersion(),
+ 'minor' => $this->serverVersion->getMinorVersion(),
+ 'micro' => $this->serverVersion->getPatchVersion(),
+ 'string' => $this->serverVersion->getVersionString(),
'edition' => '',
'extendedSupport' => \OCP\Util::hasExtendedSupport()
];
diff --git a/core/Controller/WhatsNewController.php b/core/Controller/WhatsNewController.php
index 58cb70c863a..98c5e77964b 100644
--- a/core/Controller/WhatsNewController.php
+++ b/core/Controller/WhatsNewController.php
@@ -19,6 +19,7 @@ use OCP\IRequest;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\L10N\IFactory;
+use OCP\ServerVersion;
class WhatsNewController extends OCSController {
public function __construct(
@@ -28,12 +29,13 @@ class WhatsNewController extends OCSController {
private IUserSession $userSession,
IUserManager $userManager,
Manager $keyManager,
+ ServerVersion $serverVersion,
private IConfig $config,
private ChangesCheck $whatsNewService,
private IFactory $langFactory,
private Defaults $defaults,
) {
- parent::__construct($appName, $request, $capabilitiesManager, $userSession, $userManager, $keyManager);
+ parent::__construct($appName, $request, $capabilitiesManager, $userSession, $userManager, $keyManager, $serverVersion);
}
/**
diff --git a/core/ajax/update.php b/core/ajax/update.php
index 575a1f159e5..0868eff72b4 100644
--- a/core/ajax/update.php
+++ b/core/ajax/update.php
@@ -91,6 +91,7 @@ if (\OCP\Util::needUpgrade()) {
$config = Server::get(IConfig::class);
$updater = new \OC\Updater(
+ Server::get(\OCP\ServerVersion::class),
$config,
Server::get(IAppConfig::class),
\OC::$server->getIntegrityCodeChecker(),