Compare commits
No commits in common. "8dc42740e0ee24894220793157ee7a58d1f302fc" and "753718cd01b0bc72f8f42bf2f0590cd3cdbee159" have entirely different histories.
8dc42740e0
...
753718cd01
3 changed files with 18 additions and 19 deletions
|
|
@ -81,8 +81,8 @@ abstract class PatchBase {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
protected function parse(string $re, bool $last = false) : bool {
|
protected function parse(string $re) : bool {
|
||||||
if ($str = $this->regex_str($re, $last)) {
|
if ($str = $this->regex_str($re)) {
|
||||||
$this->patch->setVersion($str, true);
|
$this->patch->setVersion($str, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -156,10 +156,10 @@ abstract class PatchBase {
|
||||||
// TODO - add option: $m = array_reverse($m);
|
// TODO - add option: $m = array_reverse($m);
|
||||||
return $m;
|
return $m;
|
||||||
}
|
}
|
||||||
private function regex_str(string $pattern, bool $last) {
|
private function regex_str(string $pattern) {
|
||||||
$m = $this->regex($pattern);
|
$m = $this->regex($pattern);
|
||||||
if ($m)
|
if ($m)
|
||||||
return $last ? end($m) : $m[0];
|
return $m[0];
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
modules/Blender.php
Normal file
14
modules/Blender.php
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Blender extends PatchBase {
|
||||||
|
function __construct() {
|
||||||
|
parent::__construct('Blender Foundation', 'Blender', 'https://www.blender.org/download/');
|
||||||
|
}
|
||||||
|
function check() : bool {
|
||||||
|
if ($this->fetch('https://www.blender.org/download/'))
|
||||||
|
return $this->parse('_//www\.blender\.org/download/release/Blender[\d\.]+/blender-([\d\.]+)-windows-x64\.msi_');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
class Blender45 extends PatchBase {
|
|
||||||
function __construct() {
|
|
||||||
parent::__construct('Blender Foundation', 'Blender', 'https://www.blender.org/download/');
|
|
||||||
$this->patch->setBranch('4.5');
|
|
||||||
}
|
|
||||||
function check() : bool {
|
|
||||||
if ($this->fetch('https://download.blender.org/release/Blender4.5/'))
|
|
||||||
return $this->parse('/>blender-([\d\.]+)\.sha256</', true);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue