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