diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/class/modelpage.php | 18 | ||||
-rw-r--r-- | app/class/page.php | 2 | ||||
-rw-r--r-- | app/fn/fn.php | 3 |
3 files changed, 18 insertions, 5 deletions
diff --git a/app/class/modelpage.php b/app/class/modelpage.php index a47ebdb..68ccf23 100644 --- a/app/class/modelpage.php +++ b/app/class/modelpage.php @@ -12,7 +12,7 @@ class Modelpage extends Modeldb parent::__construct(); $this->storeinit(Config::pagetable()); if(!$this->dircheck(Model::HTML_RENDER_DIR)) { - throw new Exception("Media error : Cant create /rendernew folder"); + throw new Exception("Media error : Cant create /render folder"); } } @@ -32,7 +32,14 @@ class Modelpage extends Modeldb } - public function getlisterid(array $idlist = []) + /** + * Scan database for specific pages IDs and return array of Pages objects + * + * @param array $idlist list of ID strings + * + * @return array of Page objects + */ + public function getlisterid(array $idlist = []) : array { $pagedatalist = $this->repo->query() ->where('__id', 'IN', $idlist) @@ -45,6 +52,11 @@ class Modelpage extends Modeldb return $pagelist; } + /** + * Store new page in the database + * + * @param Page $page object + */ public function add(Page $page) { @@ -194,6 +206,7 @@ class Modelpage extends Modeldb * @param array $pagelist List of Page * @param array $tagchecked list of tags * @param string $tagcompare string, can be 'OR' or 'AND', set the tag filter method + * * @return array $array */ @@ -280,6 +293,7 @@ class Modelpage extends Modeldb /** * @param array $taglist list of tags * @param array $pagelist list of Page + * * @return array list of tags each containing list of id */ diff --git a/app/class/page.php b/app/class/page.php index 299e448..a55e7cb 100644 --- a/app/class/page.php +++ b/app/class/page.php @@ -480,7 +480,7 @@ class Page { if (is_string($tag)) { - if (strlen($tag) < self::LEN and is_string($tag)) { + if (strlen($tag) < self::LEN) { $tag = strip_tags(trim(strtolower($tag))); $tag = str_replace('*', '', $tag); $tag = str_replace(' ', '', $tag); diff --git a/app/fn/fn.php b/app/fn/fn.php index f5068fa..9c011ef 100644 --- a/app/fn/fn.php +++ b/app/fn/fn.php @@ -85,8 +85,7 @@ function idclean(string $input) function getversion() { if(file_exists('VERSION')) { - $composer = file_get_contents('VERSION'); - $version = $composer['version']; + $version = file_get_contents('VERSION'); } else { $version = 'unknown'; } |