aboutsummaryrefslogtreecommitdiff
path: root/app/class/modelart.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-10-18 14:20:55 +0200
committervincent-peugnet <v.peugnet@free.fr>2019-10-18 14:20:55 +0200
commit1d011471674ede030407c351abfbf2bfc93d8b7a (patch)
tree91bbe902de1d9c31eea09eb3961781f5886cf70c /app/class/modelart.php
parent8b6848dfb5d469076f05be226e862fab928cd53f (diff)
downloadwcms-1d011471674ede030407c351abfbf2bfc93d8b7a.tar.gz
wcms-1d011471674ede030407c351abfbf2bfc93d8b7a.zip
new page render system
create html files in `/render` folder
Diffstat (limited to 'app/class/modelart.php')
-rw-r--r--app/class/modelart.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/class/modelart.php b/app/class/modelart.php
index 8462675..8dee09c 100644
--- a/app/class/modelart.php
+++ b/app/class/modelart.php
@@ -11,6 +11,9 @@ class Modelart extends Modeldb
{
parent::__construct();
$this->storeinit(Config::arttable());
+ if(!$this->dircheck(Model::HTML_RENDER_DIR)) {
+ throw new Exception("Media error : Cant create /rendernew folder");
+ }
}
/**
@@ -50,7 +53,13 @@ class Modelart extends Modeldb
$this->repo->store($artdata);
}
-
+ /**
+ * Obtain a page object from the database
+ *
+ * @param Art2|string $id could be an Art2 object or a id string
+ *
+ * @return Art2|false The Art2 object or false if it does not exist.
+ */
public function get($id)
{
if ($id instanceof Art2) {
@@ -120,6 +129,9 @@ class Modelart extends Modeldb
unlink(Model::RENDER_DIR . $artid . $file);
}
}
+ if(file_exists(Model::HTML_RENDER_DIR . $artid . '.html')) {
+ unlink(Model::HTML_RENDER_DIR . $artid . '.html');
+ }
}
public function update(Art2 $art)