]>
Commit | Line | Data |
---|---|---|
1d3a17c7 | 1 | <?php |
1025ad87 AD |
2 | require_once "functions.php"; |
3 | ||
bd6576f8 | 4 | define('EXPECTED_CONFIG_VERSION', 18); |
f574fec6 | 5 | define('SCHEMA_VERSION', 56); |
adf702d6 | 6 | |
66581886 | 7 | if (!file_exists("config.php")) { |
b5227ac0 AD |
8 | print "<b>Fatal Error</b>: You forgot to copy |
9 | <b>config.php-dist</b> to <b>config.php</b> and edit it.\n"; | |
66581886 AD |
10 | exit; |
11 | } | |
12 | ||
9d87df8f AD |
13 | require_once "config.php"; |
14 | ||
adf702d6 | 15 | if (CONFIG_VERSION != EXPECTED_CONFIG_VERSION) { |
b5227ac0 | 16 | $err_msg = "config: your config file version is incorrect. See config.php-dist.\n"; |
7c5a308d AD |
17 | } |
18 | ||
49f9c923 | 19 | if (defined('RSS_BACKEND_TYPE')) { |
b5227ac0 AD |
20 | print "<b>Fatal error</b>: RSS_BACKEND_TYPE is deprecated. Please remove this |
21 | option from config.php\n"; | |
7c5a308d AD |
22 | exit; |
23 | } | |
24 | ||
3f286c4c | 25 | if (file_exists("xml-export.php") || file_exists("xml-import.php")) { |
b5227ac0 | 26 | print "<b>Fatal Error</b>: XML Import/Export tools (<b>xml-export.php</b> |
3f286c4c | 27 | and <b>xml-import.php</b>) could be used maliciously. Please remove them |
b5227ac0 | 28 | from your TT-RSS instance.\n"; |
3f286c4c AD |
29 | exit; |
30 | } | |
51c04420 | 31 | |
07280718 | 32 | if (SINGLE_USER_MODE && DAEMON_UPDATE_LOGIN_LIMIT > 0) { |
b5227ac0 AD |
33 | print "<b>Fatal Error</b>: Please set DAEMON_UPDATE_LOGIN_LIMIT |
34 | to 0 in single user mode.\n"; | |
07280718 AD |
35 | exit; |
36 | } | |
c798704b AD |
37 | |
38 | if (USE_CURL_FOR_ICONS && ! function_exists("curl_init")) { | |
b5227ac0 AD |
39 | print "<b>Fatal Error</b>: You have enabled USE_CURL_FOR_ICONS, but your PHP |
40 | doesn't seem to support CURL functions."; | |
c798704b AD |
41 | exit; |
42 | } | |
ef8be8ea AD |
43 | |
44 | if (!defined('SESSION_EXPIRE_TIME')) { | |
b5227ac0 | 45 | $err_msg = "config: SESSION_EXPIRE_TIME is undefined"; |
ef8be8ea AD |
46 | } |
47 | ||
48 | if (SESSION_EXPIRE_TIME < 60) { | |
b5227ac0 | 49 | $err_msg = "config: SESSION_EXPIRE_TIME is too low (less than 60)"; |
ef8be8ea AD |
50 | } |
51 | ||
f7c390b8 | 52 | if (SESSION_EXPIRE_TIME < SESSION_COOKIE_LIFETIME) { |
b5227ac0 AD |
53 | $err_msg = "config: SESSION_EXPIRE_TIME should be greater or equal to" . |
54 | "SESSION_COOKIE_LIFETIME"; | |
ef8be8ea AD |
55 | } |
56 | ||
ec83ae9f | 57 | /* if (defined('DISABLE_SESSIONS')) { |
ef8be8ea | 58 | $err_msg = "config: you have enabled DISABLE_SESSIONS. Please disable this option."; |
ec83ae9f | 59 | } */ |
ef8be8ea AD |
60 | |
61 | if (DATABASE_BACKED_SESSIONS && SINGLE_USER_MODE) { | |
b5227ac0 | 62 | $err_msg = "config: DATABASE_BACKED_SESSIONS is incompatible with SINGLE_USER_MODE"; |
ef8be8ea AD |
63 | } |
64 | ||
333f0b2a | 65 | if (DATABASE_BACKED_SESSIONS && DB_TYPE == "mysql") { |
b5227ac0 | 66 | $err_msg = "config: DATABASE_BACKED_SESSIONS are currently broken with MySQL"; |
333f0b2a AD |
67 | } |
68 | ||
a8931123 | 69 | if (defined('MAIL_FROM')) { |
b5227ac0 | 70 | $err_msg = "config: MAIL_FROM has been split into DIGEST_FROM_NAME and DIGEST_FROM_ADDRESS"; |
a8931123 AD |
71 | } |
72 | ||
b03b2631 | 73 | if (!defined('COUNTERS_MAX_AGE')) { |
b5227ac0 | 74 | $err_msg = "config: option COUNTERS_MAX_AGE expected, but not defined"; |
b03b2631 AD |
75 | } |
76 | ||
55826adc | 77 | if (defined('DAEMON_REFRESH_ONLY')) { |
b5227ac0 | 78 | $err_msg = "config: option DAEMON_REFRESH_ONLY is obsolete. Please remove this option and read about other ways to update feeds on the <a href='http://tt-rss.spb.ru/trac/wiki/UpdatingFeeds'>wiki</a>."; |
17c0eeba AD |
79 | |
80 | } | |
81 | ||
ef8be8ea | 82 | if ($err_msg) { |
b5227ac0 | 83 | print "<b>Fatal Error</b>: $err_msg\n"; |
ef8be8ea AD |
84 | exit; |
85 | } | |
86 | ||
66581886 | 87 | ?> |