fixed 31 compability, close #177
This commit is contained in:
@@ -516,7 +516,9 @@ class Helper
|
|||||||
}
|
}
|
||||||
public static function getVersion(): array
|
public static function getVersion(): array
|
||||||
{
|
{
|
||||||
return \OC_Util::getVersion();
|
$config = \OC::$server->get(\OCP\IConfig::class);
|
||||||
|
$version = $config->getSystemValue('version');
|
||||||
|
return explode(".", $version);
|
||||||
}
|
}
|
||||||
public static function isLegacyVersion(): bool
|
public static function isLegacyVersion(): bool
|
||||||
{
|
{
|
||||||
@@ -634,8 +636,8 @@ class Helper
|
|||||||
$response = $client->request('GET', $downloadUrl);
|
$response = $client->request('GET', $downloadUrl);
|
||||||
if ($byte = file_put_contents($file, $response->getContent())) {
|
if ($byte = file_put_contents($file, $response->getContent())) {
|
||||||
return $byte;
|
return $byte;
|
||||||
}else {
|
} else {
|
||||||
throw new \Exception("Failed to download $downloadUrl");
|
throw new \Exception("Failed to download $downloadUrl");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user