]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - inc/config.php
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/');
17 define ('DOWNLOAD_PICTURES', TRUE);
20 include 'functions.php';
21 require_once 'Readability.php';
22 require_once 'Encoding.php';
23 require_once 'rain.tpl.class.php';
25 $db = new db(DB_PATH
);
27 # Initialisation de RainTPL
28 raintpl
::$tpl_dir = './tpl/';
29 raintpl
::$cache_dir = './cache/';
30 raintpl
::$base_url = get_poche_url();
31 raintpl
::configure('path_replace', false);
32 raintpl
::configure('debug', false);
35 # Démarrage session et initialisation du jeton de sécurité
38 if (!isset($_SESSION['token_poche'])) {
39 $token = md5(uniqid(rand(), TRUE));
40 $_SESSION['token_poche'] = $token;
41 $_SESSION['token_time_poche'] = time();
44 # Traitement des paramètres et déclenchement des actions
45 $view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index';
46 $action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : '';
47 $_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id';
48 $id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : '';
49 $url = (isset ($_GET['url'])) ? $_GET['url'] : '';
50 $token = (isset ($_REQUEST['token'])) ? $_REQUEST['token'] : '';
53 action_to_do($action, $id, $url, $token);