v0.1.11
This commit is contained in:
@@ -13,4 +13,9 @@ class Version
|
||||
3 => intval($version),
|
||||
};
|
||||
}
|
||||
|
||||
public static function compare($current, $version): bool|int
|
||||
{
|
||||
return version_compare($current, $version);
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Kernel",
|
||||
"version": "0.1.10",
|
||||
"version": "0.1.11",
|
||||
"author": "ITGuild",
|
||||
"slug": "kernel",
|
||||
"type": "kernel",
|
||||
|
@@ -44,15 +44,14 @@ class KernelService
|
||||
|
||||
$kernel_info = $this->getKernelInfo();
|
||||
|
||||
$kernelVersion = Version::getIntVersionByString($kernel_info['version']);
|
||||
|
||||
foreach ($modules_info as $mod) {
|
||||
$modVersion = Version::getIntVersionByString($mod['version']);
|
||||
if ($mod['slug'] === $kernel_info['slug'] && $modVersion <= $kernelVersion) {
|
||||
if ($mod['slug'] === $kernel_info['slug'] ) {
|
||||
if (Version::compare($kernel_info['version'], $mod['version']) >= 0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -492,14 +492,16 @@ class ModuleService
|
||||
|
||||
$mod_info = $this->getModuleInfoBySlug($slug);
|
||||
|
||||
$currentVersion = Version::getIntVersionByString($mod_info['version']);
|
||||
$currentVersion = $mod_info['version'];
|
||||
foreach ($modules_info as $mod) {
|
||||
$modVersion = Version::getIntVersionByString($mod['version']);
|
||||
if ($mod['slug'] === $mod_info['slug'] && $modVersion <= $currentVersion) {
|
||||
$modVersion = $mod['version'];
|
||||
if ($mod['slug'] === $mod_info['slug']) {
|
||||
if (Version::compare($currentVersion, $modVersion) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user