]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - inc/config.php
a7904def07d304065518af692bf4d910dd94ea2e
3 * poche, a read it later open source system
6 * @author Nicolas Lœuillet <nicolas@loeuillet.org>
8 * @license http://www.wtfpl.net/ see COPYING file
15 define ('DB_PATH', 'sqlite:./db/poche.sqlite');
16 define ('ABS_PATH', 'assets/');
19 include 'functions.php';
20 require_once 'Readability.php';
21 require_once 'Encoding.php';
22 require_once 'rain.tpl.class.php';
24 $db = new db(DB_PATH
);
26 # Initialisation de RainTPL
27 raintpl
::$tpl_dir = './tpl/';
28 raintpl
::$cache_dir = './cache/';
29 raintpl
::$base_url = get_poche_url();
30 raintpl
::configure('path_replace', false);
31 raintpl
::configure('debug', false);
34 # Démarrage session et initialisation du jeton de sécurité
37 if (!isset($_SESSION['token_poche'])) {
38 $token = md5(uniqid(rand(), TRUE));
39 $_SESSION['token_poche'] = $token;
40 $_SESSION['token_time_poche'] = time();
43 # Traitement des paramètres et déclenchement des actions
44 $view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index';
45 $action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : '';
46 $_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id';
47 $id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : '';
48 $url = (isset ($_GET['url'])) ? $_GET['url'] : '';
49 $token = (isset ($_REQUEST['token'])) ? $_REQUEST['token'] : '';
52 action_to_do($action, $id, $url, $token);