page: rename page method to file
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 20 Dec 2020 00:56:50 +0000 (01:56 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 21 Dec 2020 16:46:33 +0000 (17:46 +0100)
More descriptive of requested file name, avoiding duplicate $Page->page.

article.inc.php

index 36639f2a222129d13cf632629a4ce5e7e6c88a95..f56b2bedd27439e40e001e2141fbbdf2e9d5ca80 100644 (file)
@@ -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;
        }