From 26f88e043ebedcadd337011ce527f6148350f0dc Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Wed, 31 Oct 2018 15:28:37 +0100 Subject: homemade very root database engine --- w/class/controllerdb.php | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'w/class/controllerdb.php') diff --git a/w/class/controllerdb.php b/w/class/controllerdb.php index 5d75d39..5952627 100644 --- a/w/class/controllerdb.php +++ b/w/class/controllerdb.php @@ -4,17 +4,47 @@ class Controllerdb extends Controller { protected $artmanager; + protected $database; + protected $artstore; - public function __construct() { + + public function __construct() + { parent::__construct(); + $this->artmanager = new Modelart(); + + } + + public function dbinit() + { + $this->database = new SleekDBw(__DIR__ . '/../../w_database', [ + 'auto_cache' => false + ]); + $this->artstore = $this->database->store(Config::arttable()); + + } + + + public function fetch() + { + $datas = $this->artstore->fetch(); + return $datas; + } + + public function desktop() + { - $this->artmanager = new Modelart(); + + $this->dbinit(); + var_dump( $this->fetch()); + } + // if (isset($_POST['actiondb'])) { // $app->setbdd($config); -- cgit v1.2.3