2 require_once "functions.php";
4 define('EXPECTED_CONFIG_VERSION', 19);
5 define('SCHEMA_VERSION', 67);
7 if (!file_exists("config.php")) {
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";
13 require_once "config.php";
15 if (CONFIG_VERSION
!= EXPECTED_CONFIG_VERSION
) {
16 $err_msg = "config: your config file version is incorrect. See config.php-dist.\n";
19 if (defined('RSS_BACKEND_TYPE')) {
20 print "<b>Fatal error</b>: RSS_BACKEND_TYPE is deprecated. Please remove this
21 option from config.php\n";
25 if (file_exists("xml-export.php") ||
file_exists("xml-import.php")) {
26 print "<b>Fatal Error</b>: XML Import/Export tools (<b>xml-export.php</b>
27 and <b>xml-import.php</b>) could be used maliciously. Please remove them
28 from your TT-RSS instance.\n";
32 if (SINGLE_USER_MODE
&& DAEMON_UPDATE_LOGIN_LIMIT
> 0) {
33 print "<b>Fatal Error</b>: Please set DAEMON_UPDATE_LOGIN_LIMIT
34 to 0 in single user mode.\n";
38 if (USE_CURL_FOR_ICONS
&& ! function_exists("curl_init")) {
39 print "<b>Fatal Error</b>: You have enabled USE_CURL_FOR_ICONS, but your PHP
40 doesn't seem to support CURL functions.";
44 if (!defined('SESSION_EXPIRE_TIME')) {
45 $err_msg = "config: SESSION_EXPIRE_TIME is undefined";
48 if (SESSION_EXPIRE_TIME
< 60) {
49 $err_msg = "config: SESSION_EXPIRE_TIME is too low (less than 60)";
52 if (SESSION_EXPIRE_TIME
< SESSION_COOKIE_LIFETIME
) {
53 $err_msg = "config: SESSION_EXPIRE_TIME should be greater or equal to" .
54 "SESSION_COOKIE_LIFETIME";
57 /* if (defined('DISABLE_SESSIONS')) {
58 $err_msg = "config: you have enabled DISABLE_SESSIONS. Please disable this option.";
61 if (DATABASE_BACKED_SESSIONS
&& SINGLE_USER_MODE
) {
62 $err_msg = "config: DATABASE_BACKED_SESSIONS is incompatible with SINGLE_USER_MODE";
65 if (DATABASE_BACKED_SESSIONS
&& DB_TYPE
== "mysql") {
66 $err_msg = "config: DATABASE_BACKED_SESSIONS are currently broken with MySQL";
69 if (SINGLE_USER_MODE
) {
70 $link = db_connect(DB_HOST
, DB_USER
, DB_PASS
, DB_NAME
);
73 $result = db_query($link, "SELECT id FROM ttrss_users WHERE id = 1");
75 if (db_num_rows($result) != 1) {
76 $err_msg = "config: SINGLE_USER_MODE is enabled but default admin account (UID=1) is not found.";
81 if (defined('MAIL_FROM')) {
82 $err_msg = "config: MAIL_FROM has been split into DIGEST_FROM_NAME and DIGEST_FROM_ADDRESS";
85 if (!defined('COUNTERS_MAX_AGE')) {
86 $err_msg = "config: option COUNTERS_MAX_AGE expected, but not defined";
89 if (defined('DAEMON_REFRESH_ONLY')) {
90 $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.org/wiki/UpdatingFeeds'>wiki</a>.";
94 if (defined('ENABLE_SIMPLEPIE')) {
95 $err_msg = "config: ENABLE_SIMPLEPIE is obsolete and replaced with DEFAULT_UPDATE_METHOD. Please adjust your config.php.";
98 if (!defined('DEFAULT_UPDATE_METHOD') ||
(DEFAULT_UPDATE_METHOD
!= 0 &&
99 DEFAULT_UPDATE_METHOD
!= 1)) {
100 $err_msg = "config: DEFAULT_UPDATE_METHOD should be either 0 or 1.";
103 if (!is_writable(ICONS_DIR
)) {
104 $err_msg = "config: your ICONS_DIR (" . ICONS_DIR
. ") is not writable.\n";
108 print "<b>Fatal Error</b>: $err_msg\n";