From 14890de35a19b44df6537e601240fe38ff6a9ed9 Mon Sep 17 00:00:00 2001 From: nicosomb Date: Fri, 19 Apr 2013 15:46:04 +0200 Subject: =?UTF-8?q?cr=C3=A9ation=20d'une=20classe=20store()=20pour=20g?= =?UTF-8?q?=C3=A9rer=20tout=20type=20de=20stockage=20:=20sqlite,=20file,?= =?UTF-8?q?=20mysql,=20etc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/config.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'inc/config.php') diff --git a/inc/config.php b/inc/config.php index c63b07b9..cf3529cb 100644 --- a/inc/config.php +++ b/inc/config.php @@ -8,26 +8,28 @@ * @license http://www.wtfpl.net/ see COPYING file */ -define ('POCHE_VERSION', '0.11'); +define ('POCHE_VERSION', '0.2'); if (!is_dir('db/')) { @mkdir('db/',0705); } -define ('DB_PATH', 'sqlite:./db/poche.sqlite'); define ('ABS_PATH', 'assets/'); define ('CONVERT_LINKS_FOOTNOTES', TRUE); define ('DOWNLOAD_PICTURES', TRUE); +$storage_type = 'sqlite'; # sqlite or file -include 'db.php'; include 'functions.php'; require_once 'Readability.php'; require_once 'Encoding.php'; require_once 'rain.tpl.class.php'; require_once 'MyTool.class.php'; require_once 'Session.class.php'; +require_once 'store/store.class.php'; +require_once 'store/sqlite.class.php'; +require_once 'store/file.class.php'; -$db = new db(DB_PATH); +$store = new $storage_type(); # initialisation de RainTPL raintpl::$tpl_dir = './tpl/'; -- cgit v1.2.3 From f0070a15e4725255dad967bde76155a39d189631 Mon Sep 17 00:00:00 2001 From: nicosomb Date: Sun, 21 Apr 2013 19:32:19 +0200 Subject: =?UTF-8?q?flash=20messages=20pour=20indiquer=20qu'une=20action=20?= =?UTF-8?q?s'est=20bien=20effectu=C3=A9e=20ou=20qu'il=20y=20a=20eu=20une?= =?UTF-8?q?=20erreur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/config.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'inc/config.php') diff --git a/inc/config.php b/inc/config.php index cf3529cb..9d4b7fae 100644 --- a/inc/config.php +++ b/inc/config.php @@ -28,8 +28,12 @@ require_once 'Session.class.php'; require_once 'store/store.class.php'; require_once 'store/sqlite.class.php'; require_once 'store/file.class.php'; +require_once 'class.messages.php'; -$store = new $storage_type(); +Session::init(); + +$store = new $storage_type(); +$msg = new Messages(); # initialisation de RainTPL raintpl::$tpl_dir = './tpl/'; @@ -37,4 +41,5 @@ raintpl::$cache_dir = './cache/'; raintpl::$base_url = get_poche_url(); raintpl::configure('path_replace', false); raintpl::configure('debug', false); -$tpl = new raintpl(); \ No newline at end of file +$tpl = new raintpl(); +$tpl->assign('msg', $msg); \ No newline at end of file -- cgit v1.2.3