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,12 +44,11 @@ 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) {
|
||||
return true;
|
||||
if ($mod['slug'] === $kernel_info['slug'] ) {
|
||||
if (Version::compare($kernel_info['version'], $mod['version']) >= 0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -185,7 +185,7 @@ class ModuleService
|
||||
if ($module_paths) {
|
||||
$path = json_decode($module_paths->value);
|
||||
foreach ($path->paths as $p) {
|
||||
if (!is_dir(getConst($p))){
|
||||
if (!is_dir(getConst($p))) {
|
||||
$old_mask = umask(0);
|
||||
mkdir(getConst($p), permissions: 0775, recursive: true);
|
||||
umask($old_mask);
|
||||
@@ -492,11 +492,13 @@ 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) {
|
||||
return true;
|
||||
$modVersion = $mod['version'];
|
||||
if ($mod['slug'] === $mod_info['slug']) {
|
||||
if (Version::compare($currentVersion, $modVersion) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user