v0.1.11
This commit is contained in:
@@ -13,4 +13,9 @@ class Version
|
|||||||
3 => intval($version),
|
3 => intval($version),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function compare($current, $version): bool|int
|
||||||
|
{
|
||||||
|
return version_compare($current, $version);
|
||||||
|
}
|
||||||
}
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Kernel",
|
"name": "Kernel",
|
||||||
"version": "0.1.10",
|
"version": "0.1.11",
|
||||||
"author": "ITGuild",
|
"author": "ITGuild",
|
||||||
"slug": "kernel",
|
"slug": "kernel",
|
||||||
"type": "kernel",
|
"type": "kernel",
|
||||||
|
@@ -44,12 +44,11 @@ class KernelService
|
|||||||
|
|
||||||
$kernel_info = $this->getKernelInfo();
|
$kernel_info = $this->getKernelInfo();
|
||||||
|
|
||||||
$kernelVersion = Version::getIntVersionByString($kernel_info['version']);
|
|
||||||
|
|
||||||
foreach ($modules_info as $mod) {
|
foreach ($modules_info as $mod) {
|
||||||
$modVersion = Version::getIntVersionByString($mod['version']);
|
if ($mod['slug'] === $kernel_info['slug'] ) {
|
||||||
if ($mod['slug'] === $kernel_info['slug'] && $modVersion <= $kernelVersion) {
|
if (Version::compare($kernel_info['version'], $mod['version']) >= 0){
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -185,7 +185,7 @@ class ModuleService
|
|||||||
if ($module_paths) {
|
if ($module_paths) {
|
||||||
$path = json_decode($module_paths->value);
|
$path = json_decode($module_paths->value);
|
||||||
foreach ($path->paths as $p) {
|
foreach ($path->paths as $p) {
|
||||||
if (!is_dir(getConst($p))){
|
if (!is_dir(getConst($p))) {
|
||||||
$old_mask = umask(0);
|
$old_mask = umask(0);
|
||||||
mkdir(getConst($p), permissions: 0775, recursive: true);
|
mkdir(getConst($p), permissions: 0775, recursive: true);
|
||||||
umask($old_mask);
|
umask($old_mask);
|
||||||
@@ -492,11 +492,13 @@ class ModuleService
|
|||||||
|
|
||||||
$mod_info = $this->getModuleInfoBySlug($slug);
|
$mod_info = $this->getModuleInfoBySlug($slug);
|
||||||
|
|
||||||
$currentVersion = Version::getIntVersionByString($mod_info['version']);
|
$currentVersion = $mod_info['version'];
|
||||||
foreach ($modules_info as $mod) {
|
foreach ($modules_info as $mod) {
|
||||||
$modVersion = Version::getIntVersionByString($mod['version']);
|
$modVersion = $mod['version'];
|
||||||
if ($mod['slug'] === $mod_info['slug'] && $modVersion <= $currentVersion) {
|
if ($mod['slug'] === $mod_info['slug']) {
|
||||||
return true;
|
if (Version::compare($currentVersion, $modVersion) >= 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user