From: Mischa POSLAWSKY Date: Sun, 20 Dec 2020 00:56:50 +0000 (+0100) Subject: page: rename page method to file X-Git-Tag: v5.0~3 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/8f4f651e106516ebc1b67e820da748de8311f8d8 page: rename page method to file More descriptive of requested file name, avoiding duplicate $Page->page. --- diff --git a/article.inc.php b/article.inc.php index 36639f2..f56b2be 100644 --- a/article.inc.php +++ b/article.inc.php @@ -7,9 +7,9 @@ class ArchiveArticle function __construct($path) { - $this->page = preg_replace('{^\.(?:/|$)}', '', $path); - $this->link = preg_replace('{(?:(?:/|^)index)?\.html$}', '', $this->page); - $this->raw($this->page); + $this->file = preg_replace('{^\.(?:/|$)}', '', $path); + $this->link = preg_replace('{(?:(?:/|^)index)?\.html$}', '', $this->file); + $this->raw($this->file); } function raw($page) @@ -94,7 +94,7 @@ class ArchiveArticle function last() { - return filemtime($this->page); + return filemtime($this->file); } function lastiso() { @@ -103,7 +103,7 @@ class ArchiveArticle function dateparts() { - preg_match('< / (\d{4}) [/-] (\d{2}) (?:- (\d{2}) )? - >x', $this->page, $ymd); + preg_match('< / (\d{4}) [/-] (\d{2}) (?:- (\d{2}) )? - >x', $this->file, $ymd); array_shift($ymd); return $ymd; }