summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-23 18:20:17 +0100
committerAndrew Dolgov <[email protected]>2005-11-23 18:20:17 +0100
commit66581886f8ace4076d2c08431904974d3f1a4f7a (patch)
tree4429b78db9b4ac3118d1e06ee1220e00be287a87
parent74bff337daccf62e402388990faa840dcec766a1 (diff)
add some basic "did I forget to create config.php" sanity checks
-rw-r--r--backend.php1
-rw-r--r--error.php1
-rw-r--r--login.php1
-rw-r--r--opml.php2
-rw-r--r--prefs.php1
-rw-r--r--sanity_check.php15
-rw-r--r--tt-rss.php3
7 files changed, 23 insertions, 1 deletions
diff --git a/backend.php b/backend.php
index 1a267805a..cdad2083f 100644
--- a/backend.php
+++ b/backend.php
@@ -22,6 +22,7 @@
define(SCHEMA_VERSION, 2);
+ require_once "sanity_check.php";
require_once "config.php";
require_once "db.php";
require_once "db-prefs.php";
diff --git a/error.php b/error.php
index 6a7b52972..4d5e06e2e 100644
--- a/error.php
+++ b/error.php
@@ -1,4 +1,5 @@
<?
+ require_once "sanity_check.php";
require_once "version.php";
require_once "config.php";
require_once "db-prefs.php";
diff --git a/login.php b/login.php
index 832931117..18571204b 100644
--- a/login.php
+++ b/login.php
@@ -1,6 +1,7 @@
<?
session_start();
+ require_once "sanity_check.php";
require_once "version.php";
require_once "config.php";
require_once "functions.php";
diff --git a/opml.php b/opml.php
index 0e313d52b..9adeb4025 100644
--- a/opml.php
+++ b/opml.php
@@ -1,6 +1,8 @@
<?
session_start();
+ require_once "sanity_check.php";
+
// FIXME there are some brackets issues here
$op = $_REQUEST["op"];
diff --git a/prefs.php b/prefs.php
index 0c036d99f..75cf932c1 100644
--- a/prefs.php
+++ b/prefs.php
@@ -1,6 +1,7 @@
<?
session_start();
+ require_once "sanity_check.php";
require_once "version.php";
require_once "config.php";
require_once "db-prefs.php";
diff --git a/sanity_check.php b/sanity_check.php
new file mode 100644
index 000000000..322aa9bf1
--- /dev/null
+++ b/sanity_check.php
@@ -0,0 +1,15 @@
+<?
+ if (!file_exists("config.php")) {
+ print "<b>Fatal Error</b>: You forgot to copy
+ <b>config.php-dist</b> to <b>config.php</b> and edit it.";
+ exit;
+ }
+
+ if (!file_exists("magpierss/rss_fetch.inc")) {
+ print "<b>Fatal Error</b>: You forgot to place
+ <a href=\"http://magpierss.sourceforge.net\">MagpieRSS</a>
+ distribution in <b>magpierss/</b>
+ subdirectory of TT-RSS tree.";
+ exit;
+ }
+?>
diff --git a/tt-rss.php b/tt-rss.php
index f52a67d73..3aa5d52c0 100644
--- a/tt-rss.php
+++ b/tt-rss.php
@@ -1,6 +1,7 @@
<?
session_start();
-
+
+ require_once "sanity_check.php";
require_once "version.php";
require_once "config.php";
require_once "db-prefs.php";