]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - inc/config.php
51a25d369ef87abbfde3756b5452ea8a56041bbc
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
11 if(!is_dir('db/')){mkdir('db/',0705);}
12 define ('DB_PATH', 'sqlite:./db/poche.sqlite');
13 define ('ABS_PATH', 'archiveImg/');
16 include 'functions.php';
17 require_once 'Readability.php';
18 require_once 'Encoding.php';
19 require_once 'rain.tpl.class.php';
21 $db = new db(DB_PATH
);
23 # Initialisation de RainTPL
24 raintpl
::$tpl_dir = './tpl/';
25 raintpl
::$cache_dir = './cache/';
26 raintpl
::$base_url = get_poche_url();
27 raintpl
::configure('path_replace', false);
28 raintpl
::configure('debug', false);
31 # Démarrage session et initialisation du jeton de sécurité
34 if (!isset($_SESSION['token_poche'])) {
35 $token = md5(uniqid(rand(), TRUE));
36 $_SESSION['token_poche'] = $token;
37 $_SESSION['token_time_poche'] = time();
40 # Traitement des paramètres et déclenchement des actions
41 $view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index';
42 $action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['action']) : '';
43 $_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id';
44 $id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : '';
45 $url = (isset ($_GET['url'])) ? $_GET['url'] : '';
46 $token = (isset ($_REQUEST['token'])) ? $_REQUEST['token'] : '';
49 action_to_do($action, $id, $url, $token);