aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/config.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/config.php')
-rw-r--r--inc/config.php79
1 files changed, 0 insertions, 79 deletions
diff --git a/inc/config.php b/inc/config.php
deleted file mode 100644
index 495dbb85..00000000
--- a/inc/config.php
+++ /dev/null
@@ -1,79 +0,0 @@
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 */
10
11define ('POCHE_VERSION', '0.3');
12define ('MODE_DEMO', FALSE);
13define ('DEBUG_POCHE', FALSE);
14define ('CONVERT_LINKS_FOOTNOTES', FALSE);
15define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE);
16define ('DOWNLOAD_PICTURES', FALSE);
17define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX');
18define ('ABS_PATH', 'assets/');
19define ('TPL', './tpl');
20define ('LOCALE', './locale');
21define ('CACHE', './cache');
22define ('LANG', 'fr_FR.UTF8');
23
24$storage_type = 'sqlite'; # sqlite, file
25
26# /!\ Be careful if you change the lines below /!\
27require_once 'poche/pocheTools.class.php';
28require_once 'poche/pocheCore.php';
29require_once '3rdparty/Readability.php';
30require_once '3rdparty/Encoding.php';
31require_once '3rdparty/Session.class.php';
32require_once 'store/store.class.php';
33require_once 'store/' . $storage_type . '.class.php';
34require_once './vendor/autoload.php';
35
36if (DOWNLOAD_PICTURES) {
37 require_once 'poche/pochePicture.php';
38}
39
40# i18n
41putenv('LC_ALL=' . LANG);
42setlocale(LC_ALL, LANG);
43bindtextdomain(LANG, LOCALE);
44textdomain(LANG);
45
46# template engine
47// Twig_Autoloader::register();
48$loader = new Twig_Loader_Filesystem(TPL);
49$twig = new Twig_Environment($loader, array(
50 'cache' => CACHE,
51));
52$twig->addExtension(new Twig_Extensions_Extension_I18n());
53
54Session::init();
55$store = new $storage_type();
56
57# installation
58if(!$store->isInstalled())
59{
60 pocheTools::logm('poche still not installed');
61 echo $twig->render('install.twig', array(
62 'token' => Session::getToken(),
63 ));
64 if (isset($_GET['install'])) {
65 if (($_POST['password'] == $_POST['password_repeat'])
66 && $_POST['password'] != "" && $_POST['login'] != "") {
67 # let's rock, install poche baby !
68 $store->install($_POST['login'], encode_string($_POST['password'] . $_POST['login']));
69 Session::logout();
70 pocheTools::redirect();
71 }
72 }
73 exit();
74}
75
76$_SESSION['login'] = (isset ($_SESSION['login'])) ? $_SESSION['login'] : $store->getLogin();
77$_SESSION['pass'] = (isset ($_SESSION['pass'])) ? $_SESSION['pass'] : $store->getPassword();
78
79pocheTools::initPhp(); \ No newline at end of file