add some basic "did I forget to create config.php" sanity checks

This commit is contained in:
Andrew Dolgov 2005-11-23 18:20:17 +01:00
parent 74bff337da
commit 66581886f8
7 changed files with 23 additions and 1 deletions

View 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";

View File

@ -1,4 +1,5 @@
<?
require_once "sanity_check.php";
require_once "version.php";
require_once "config.php";
require_once "db-prefs.php";

View File

@ -1,6 +1,7 @@
<?
session_start();
require_once "sanity_check.php";
require_once "version.php";
require_once "config.php";
require_once "functions.php";

View File

@ -1,6 +1,8 @@
<?
session_start();
require_once "sanity_check.php";
// FIXME there are some brackets issues here
$op = $_REQUEST["op"];

View 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";

15
sanity_check.php Normal file
View File

@ -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;
}
?>

View 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";