From df072471a7739e0bba30bf2d1687d6461354daf1 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Tue, 11 Jun 2019 16:08:26 +0200 Subject: Add extendedSupport to Subscription MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/public/Util.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'lib/public/Util.php') diff --git a/lib/public/Util.php b/lib/public/Util.php index 302eb8d035e..7e9f6b2efbc 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -89,7 +89,19 @@ class Util { public static function getVersion() { return \OC_Util::getVersion(); } - + + /** + * @since 17.0.0 + */ + public static function hasExtendedSupport(): bool { + try { + /** @var \OCP\Support\Subscription\IRegistry */ + $subscriptionRegistry = \OC::$server->query(\OCP\Support\Subscription\IRegistry::class); + return $subscriptionRegistry->delegateHasExtendedSupport(); + } catch (AppFramework\QueryException $e) {} + return \OC::$server->getConfig()->getSystemValueBool('extendedSupport', false); + } + /** * Set current update channel * @param string $channel @@ -98,7 +110,7 @@ class Util { public static function setChannel($channel) { \OC::$server->getConfig()->setSystemValue('updater.release.channel', $channel); } - + /** * Get current update channel * @return string @@ -501,7 +513,7 @@ class Util { public static function needUpgrade() { if (!isset(self::$needUpgradeCache)) { self::$needUpgradeCache=\OC_Util::needUpgrade(\OC::$server->getSystemConfig()); - } + } return self::$needUpgradeCache; } -- cgit v1.2.3