]> git.wh0rd.org - tt-rss.git/blame - sanity_check.php
change _() to __() (use php-gettext)
[tt-rss.git] / sanity_check.php
CommitLineData
1d3a17c7 1<?php
1e7f3b0c 2 define('EXPECTED_CONFIG_VERSION', 5);
adf702d6 3
66581886 4 if (!file_exists("config.php")) {
d1db26aa 5 print __("<b>Fatal Error</b>: You forgot to copy
dd34f155 6 <b>config.php-dist</b> to <b>config.php</b> and edit it.\n");
66581886
AD
7 exit;
8 }
9
9d87df8f
AD
10 require_once "config.php";
11
adf702d6 12 if (CONFIG_VERSION != EXPECTED_CONFIG_VERSION) {
d1db26aa 13 return __("config: your config file version is incorrect. See config.php-dist.\n");
7c5a308d
AD
14 }
15
49f9c923 16 if (defined('RSS_BACKEND_TYPE')) {
d1db26aa 17 print __("<b>Fatal error</b>: RSS_BACKEND_TYPE is deprecated. Please remove this
49f9c923 18 option from config.php\n");
7c5a308d
AD
19 exit;
20 }
21
3f286c4c 22 if (file_exists("xml-export.php") || file_exists("xml-import.php")) {
d1db26aa 23 print __("<b>Fatal Error</b>: XML Import/Export tools (<b>xml-export.php</b>
3f286c4c 24 and <b>xml-import.php</b>) could be used maliciously. Please remove them
dd34f155 25 from your TT-RSS instance.\n");
3f286c4c
AD
26 exit;
27 }
51c04420 28
07280718 29 if (SINGLE_USER_MODE && DAEMON_UPDATE_LOGIN_LIMIT > 0) {
d1db26aa 30 print __("<b>Fatal Error</b>: Please set DAEMON_UPDATE_LOGIN_LIMIT
dd34f155 31 to 0 in single user mode.\n");
07280718
AD
32 exit;
33 }
c798704b
AD
34
35 if (USE_CURL_FOR_ICONS && ! function_exists("curl_init")) {
d1db26aa 36 print __("<b>Fatal Error</b>: You have enabled USE_CURL_FOR_ICONS, but your PHP
dd34f155 37 doesn't seem to support CURL functions.");
c798704b
AD
38 exit;
39 }
ef8be8ea
AD
40
41 if (!defined('SESSION_EXPIRE_TIME')) {
d1db26aa 42 $err_msg = __("config: SESSION_EXPIRE_TIME is undefined");
ef8be8ea
AD
43 }
44
45 if (SESSION_EXPIRE_TIME < 60) {
d1db26aa 46 $err_msg = __("config: SESSION_EXPIRE_TIME is too low (less than 60)");
ef8be8ea
AD
47 }
48
f7c390b8 49 if (SESSION_EXPIRE_TIME < SESSION_COOKIE_LIFETIME) {
d1db26aa 50 $err_msg = __("config: SESSION_EXPIRE_TIME should be greater or equal to" .
f7c390b8 51 "SESSION_COOKIE_LIFETIME");
ef8be8ea
AD
52 }
53
ec83ae9f 54/* if (defined('DISABLE_SESSIONS')) {
ef8be8ea 55 $err_msg = "config: you have enabled DISABLE_SESSIONS. Please disable this option.";
ec83ae9f 56} */
ef8be8ea
AD
57
58 if (DATABASE_BACKED_SESSIONS && SINGLE_USER_MODE) {
d1db26aa 59 $err_msg = __("config: DATABASE_BACKED_SESSIONS is incompatible with SINGLE_USER_MODE");
ef8be8ea
AD
60 }
61
333f0b2a 62 if (DATABASE_BACKED_SESSIONS && DB_TYPE == "mysql") {
d1db26aa 63 $err_msg = __("config: DATABASE_BACKED_SESSIONS are currently broken with MySQL");
333f0b2a
AD
64 }
65
ef8be8ea 66 if ($err_msg) {
d1db26aa 67 print "<b>".__("Fatal Error")."</b>: $err_msg\n";
ef8be8ea
AD
68 exit;
69 }
70
66581886 71?>