diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-02-06 13:31:03 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-02-06 13:31:03 +0100 |
commit | 1aa2b136656e42d8523d31f79e9cc1321c1dbba9 (patch) | |
tree | 35f87babbe2b95e6930b7c46058ef4a4634d362b /app | |
parent | f3bc327be7be8a1aeeb49c7f46c86628e5d52e77 (diff) | |
download | wcms-1aa2b136656e42d8523d31f79e9cc1321c1dbba9.tar.gz wcms-1aa2b136656e42d8523d31f79e9cc1321c1dbba9.zip |
BREACKING CHANGE : MOVE PAGES DB
Diffstat (limited to 'app')
-rw-r--r-- | app/class/Controllerpage.php | 2 | ||||
-rw-r--r-- | app/class/Model.php | 1 | ||||
-rw-r--r-- | app/class/Modeldb.php | 4 | ||||
-rw-r--r-- | app/class/Modelpage.php | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/app/class/Controllerpage.php b/app/class/Controllerpage.php index cfab5d3..b214eea 100644 --- a/app/class/Controllerpage.php +++ b/app/class/Controllerpage.php @@ -255,7 +255,7 @@ class Controllerpage extends Controller { if($this->user->isadmin()) { - $file = Model::DATABASE_DIR . Config::pagetable() . DIRECTORY_SEPARATOR . $id . '.json'; + $file = Model::PAGES_DIR . Config::pagetable() . DIRECTORY_SEPARATOR . $id . '.json'; if (file_exists($file)) { header('Content-Description: File Transfer'); diff --git a/app/class/Model.php b/app/class/Model.php index 9c0d500..67f50c9 100644 --- a/app/class/Model.php +++ b/app/class/Model.php @@ -19,6 +19,7 @@ abstract class Model const HTML_RENDER_DIR = 'render' . DIRECTORY_SEPARATOR; const GLOBAL_DIR = 'assets'. DIRECTORY_SEPARATOR . 'global' . DIRECTORY_SEPARATOR; const DATABASE_DIR = '.' . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR; + const PAGES_DIR = self::DATABASE_DIR . 'pages' . DIRECTORY_SEPARATOR; const MEDIA_EXT = [ 'jpg' => 'image', diff --git a/app/class/Modeldb.php b/app/class/Modeldb.php index 32e12cb..92f0d22 100644 --- a/app/class/Modeldb.php +++ b/app/class/Modeldb.php @@ -20,9 +20,9 @@ class Modeldb extends Model } - public function dbinit() + public function dbinit($dir = Model::DATABASE_DIR) { - $this->database = new Flywheel\Config(Model::DATABASE_DIR, [ + $this->database = new Flywheel\Config($dir , [ 'query_class' => Query::class, 'formatter' => new JSON, ]); diff --git a/app/class/Modelpage.php b/app/class/Modelpage.php index 1cc6b27..7a0facc 100644 --- a/app/class/Modelpage.php +++ b/app/class/Modelpage.php @@ -17,7 +17,7 @@ class Modelpage extends Modeldb public function __construct() { - parent::__construct(); + $this->dbinit(Model::PAGES_DIR); $this->storeinit(Config::pagetable()); if(!$this->dircheck(Model::HTML_RENDER_DIR)) { throw new Exception("Media error : Cant create /render folder"); |