diff --git a/PatchBase.php b/PatchBase.php index 931df2f..2fbfdbd 100644 --- a/PatchBase.php +++ b/PatchBase.php @@ -81,8 +81,8 @@ abstract class PatchBase { } return false; } - protected function parse(string $re, bool $last = false) : bool { - if ($str = $this->regex_str($re, $last)) { + protected function parse(string $re) : bool { + if ($str = $this->regex_str($re)) { $this->patch->setVersion($str, true); return true; } @@ -156,10 +156,10 @@ abstract class PatchBase { // TODO - add option: $m = array_reverse($m); return $m; } - private function regex_str(string $pattern, bool $last) { + private function regex_str(string $pattern) { $m = $this->regex($pattern); if ($m) - return $last ? end($m) : $m[0]; + return $m[0]; return false; } } diff --git a/modules/Blender.php b/modules/Blender.php new file mode 100644 index 0000000..b79d7df --- /dev/null +++ b/modules/Blender.php @@ -0,0 +1,14 @@ +fetch('https://www.blender.org/download/')) + return $this->parse('_//www\.blender\.org/download/release/Blender[\d\.]+/blender-([\d\.]+)-windows-x64\.msi_'); + return false; + } +} + +?> diff --git a/modules/Blender45.php b/modules/Blender45.php deleted file mode 100644 index 846ee0f..0000000 --- a/modules/Blender45.php +++ /dev/null @@ -1,15 +0,0 @@ -patch->setBranch('4.5'); - } - function check() : bool { - if ($this->fetch('https://download.blender.org/release/Blender4.5/')) - return $this->parse('/>blender-([\d\.]+)\.sha256