]> git.wh0rd.org Git - tt-rss.git/commitdiff
add some basic "did I forget to create config.php" sanity checks
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 23 Nov 2005 17:20:17 +0000 (18:20 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 23 Nov 2005 17:20:17 +0000 (18:20 +0100)
backend.php
error.php
login.php
opml.php
prefs.php
sanity_check.php [new file with mode: 0644]
tt-rss.php

index 1a267805abd3af940aae44d846b5011898664e8c..cdad2083f8077fb8df6d9d9cc96bf2c1e0adeb8a 100644 (file)
@@ -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";
index 6a7b529724ab22d708df54ea5527bd0bd49f8e5a..4d5e06e2e8f401aa9895f1f2522f6ec2a4efad7b 100644 (file)
--- 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";
index 832931117a9ac536f9e08def48c609988ba4010a..18571204b3e04452034d570c97d1107d12850e50 100644 (file)
--- 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";
index 0e313d52bc819db626119630935df8cb09217350..9adeb4025ca99379d8df687e5ee78a50e6b36abc 100644 (file)
--- 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"];
index 0c036d99feea0c6df17ed108c6e584cb07669d77..75cf932c1a3cb480645cf3cdf168f6381619566a 100644 (file)
--- 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 (file)
index 0000000..322aa9b
--- /dev/null
@@ -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;
+       }
+?>
index f52a67d7323d8789879db6f20bc928f71a829552..3aa5d52c04945aeb727c2c939a4dc9adb940c560 100644 (file)
@@ -1,6 +1,7 @@
 <?
        session_start();
-       
+
+       require_once "sanity_check.php";
        require_once "version.php"; 
        require_once "config.php";
        require_once "db-prefs.php";