Freeplane: parse changelog file
This commit is contained in:
parent
fe0303bcbb
commit
fef3a414b5
2 changed files with 9 additions and 2 deletions
|
|
@ -125,6 +125,11 @@ abstract class PatchBase {
|
||||||
$this->data = $str;
|
$this->data = $str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
protected function str_extract(int $n) {
|
||||||
|
$lines = explode("\r\n", $this->data);
|
||||||
|
if (count($lines) > $n)
|
||||||
|
$this->data = $lines[$n];
|
||||||
|
}
|
||||||
private function curl(string $url, array $opts) {
|
private function curl(string $url, array $opts) {
|
||||||
if ($ch = curl_init()) {
|
if ($ch = curl_init()) {
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ class Freeplane extends PatchBase {
|
||||||
parent::__construct('Freeplane Team', 'Freeplane', 'https://docs.freeplane.org/');
|
parent::__construct('Freeplane Team', 'Freeplane', 'https://docs.freeplane.org/');
|
||||||
}
|
}
|
||||||
function check() : bool {
|
function check() : bool {
|
||||||
if ($this->fetch_json('https://sourceforge.net/projects/freeplane/best_release.json'))
|
if ($this->fetch('https://www.freeplane.org/info/history/history_en.txt')) {
|
||||||
return $this->parse_json('filename', '/-([\d\.]+[u\d]*)\.[a-z]+$/');
|
$this->str_extract(1);
|
||||||
|
return $this->parse('/^([\d\.]+)/m');
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue