]> git.immae.eu Git - github/wallabag/wallabag.git/blob - inc/poche/global.inc.php
merge #224
[github/wallabag/wallabag.git] / inc / poche / global.inc.php
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
11 # the poche system root directory (/inc)
12 define('INCLUDES', dirname(__FILE__) . '/..');
13
14 # the poche root directory
15 define('ROOT', INCLUDES . '/..');
16
17 require_once INCLUDES . '/poche/Tools.class.php';
18 require_once INCLUDES . '/poche/User.class.php';
19 require_once INCLUDES . '/poche/Url.class.php';
20 require_once INCLUDES . '/3rdparty/class.messages.php';
21 require_once INCLUDES . '/poche/Poche.class.php';
22
23 require_once INCLUDES . '/3rdparty/Readability.php';
24 require_once INCLUDES . '/poche/PocheReadability.php';
25
26 require_once INCLUDES . '/3rdparty/Encoding.php';
27 require_once INCLUDES . '/poche/Database.class.php';
28 require_once INCLUDES . '/3rdparty/simple_html_dom.php';
29 require_once INCLUDES . '/3rdparty/paginator.php';
30 require_once INCLUDES . '/3rdparty/Session.class.php';
31
32 require_once INCLUDES . '/3rdparty/simplepie/SimplePieAutoloader.php';
33 require_once INCLUDES . '/3rdparty/simplepie/SimplePie/Core.php';
34 require_once INCLUDES . '/3rdparty/content-extractor/ContentExtractor.php';
35 require_once INCLUDES . '/3rdparty/content-extractor/SiteConfig.php';
36 require_once INCLUDES . '/3rdparty/humble-http-agent/HumbleHttpAgent.php';
37 require_once INCLUDES . '/3rdparty/humble-http-agent/SimplePie_HumbleHttpAgent.php';
38 require_once INCLUDES . '/3rdparty/humble-http-agent/CookieJar.php';
39 require_once INCLUDES . '/3rdparty/feedwriter/FeedItem.php';
40 require_once INCLUDES . '/3rdparty/feedwriter/FeedWriter.php';
41 require_once INCLUDES . '/3rdparty/feedwriter/DummySingleItemFeed.php';
42 require_once INCLUDES . '/3rdparty/FlattrItem.class.php';
43
44 # Composer its autoloader for automatically loading Twig
45 if (! file_exists(ROOT . '/vendor/autoload.php')) {
46 Poche::$canRenderTemplates = false;
47 } else {
48 require_once ROOT . '/vendor/autoload.php';
49 }
50
51 # system configuration; database credentials et cetera
52 if (! file_exists(INCLUDES . '/poche/config.inc.php')) {
53 Poche::$configFileAvailable = false;
54 } else {
55 require_once INCLUDES . '/poche/config.inc.php';
56 }
57
58 if (Poche::$configFileAvailable && DOWNLOAD_PICTURES) {
59 require_once INCLUDES . '/poche/pochePictures.php';
60 }
61
62 if (!ini_get('date.timezone') || !@date_default_timezone_set(ini_get('date.timezone'))) {
63 date_default_timezone_set('UTC');
64 }
65
66 #XSRF protection with token
67 if (!empty($_POST)) {
68 if (!Session::isToken($_POST['token'])) {
69 die(_('Wrong token'));
70 }
71 unset($_SESSION['token']);
72 }