]> git.immae.eu Git - github/wallabag/wallabag.git/blame - inc/config.php
poche / pocket / bolsillo / Tasche & more
[github/wallabag/wallabag.git] / inc / config.php
CommitLineData
e46efced 1<?php
2/**
3 * poche, a read it later open source system
4 *
5 * @category poche
6 * @author Nicolas Lœuillet <nicolas@loeuillet.org>
7 * @copyright 2013
8 * @license http://www.wtfpl.net/ see COPYING file
9 */
1c182b6c 10
538cdfa8 11define ('POCHE_VERSION', '0.3');
bf18db78 12
d178419c 13if (!is_dir('db/')) {
14 @mkdir('db/',0705);
15}
16
4d8bcc0c 17define ('MODE_DEMO', FALSE);
d178419c 18define ('ABS_PATH', 'assets/');
d06f30ef 19define ('CONVERT_LINKS_FOOTNOTES', TRUE);
2987031b 20define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE);
64458521 21define ('DOWNLOAD_PICTURES', TRUE);
aa8c9f2a 22define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX');
2ee436ea
NL
23define ('LANG', 'fr_FR.UTF8');
24
25putenv("LC_ALL=".LANG);
26setlocale(LC_ALL, LANG);
27bindtextdomain(LANG, "./locale");
28textdomain(LANG);
29
14890de3 30$storage_type = 'sqlite'; # sqlite or file
e46efced 31
e46efced 32include 'functions.php';
33require_once 'Readability.php';
34require_once 'Encoding.php';
8046748b 35require_once 'rain.tpl.class.php';
e4d2565e 36require_once 'MyTool.class.php';
37require_once 'Session.class.php';
14890de3 38require_once 'store/store.class.php';
39require_once 'store/sqlite.class.php';
40require_once 'store/file.class.php';
f0070a15 41require_once 'class.messages.php';
8046748b 42
f0070a15 43Session::init();
44
aa8c9f2a 45$store = new $storage_type();
e4d2565e 46# initialisation de RainTPL
8046748b 47raintpl::$tpl_dir = './tpl/';
48raintpl::$cache_dir = './cache/';
49raintpl::$base_url = get_poche_url();
50raintpl::configure('path_replace', false);
51raintpl::configure('debug', false);
f0070a15 52$tpl = new raintpl();
aa8c9f2a
NL
53
54if(!$store->isInstalled())
55{
56 logm('poche still not installed');
57 $tpl->draw('install');
58 if (isset($_GET['install'])) {
59 if (($_POST['password'] == $_POST['password_repeat'])
60 && $_POST['password'] != "" && $_POST['login'] != "") {
61 $store->install($_POST['login'], encode_string($_POST['password'] . $_POST['login']));
62 Session::logout();
63 MyTool::redirect();
64 }
65 }
66 exit();
67}
68
69$_SESSION['login'] = (isset ($_SESSION['login'])) ? $_SESSION['login'] : $store->getLogin();
70$_SESSION['pass'] = (isset ($_SESSION['pass'])) ? $_SESSION['pass'] : $store->getPassword();
71
72$msg = new Messages();
f0070a15 73$tpl->assign('msg', $msg);