</head>
<body>
-<?
+<?php
function sanity_check($db_type) {
$errors = array();
array_push($errors, "PHP version 5.3.0 or newer required.");
}
- if (ini_get("open_basedir")) {
- array_push($errors, "PHP configuration option open_basedir is not supported. Please disable this in PHP settings file (php.ini).");
- }
-
if (!function_exists("curl_init") && !ini_get("allow_url_fopen")) {
array_push($errors, "PHP configuration option allow_url_fopen is disabled, and CURL functions are not present. Either enable allow_url_fopen or install PHP extension for CURL.");
}
array_push($errors, "PHP safe mode setting is not supported.");
} */
- if ((PUBSUBHUBBUB_HUB || PUBSUBHUBBUB_ENABLED) && !function_exists("curl_init")) {
- array_push($errors, "PHP support for CURL is required for PubSubHubbub.");
- }
-
if (!class_exists("DOMDocument")) {
array_push($errors, "PHP support for DOMDocument is required, but was not found.");
}
$rv = "";
+ $finished = false;
+
foreach ($data as $line) {
if (preg_match("/define\('DB_TYPE'/", $line)) {
$rv .= "\tdefine('DB_TYPE', '$DB_TYPE');\n";
$rv .= "\tdefine('DB_PORT', '$DB_PORT');\n";
} else if (preg_match("/define\('SELF_URL_PATH'/", $line)) {
$rv .= "\tdefine('SELF_URL_PATH', '$SELF_URL_PATH');\n";
- } else {
+ } else if (!$finished) {
$rv .= "$line\n";
}
+
+ if (preg_match("/\?\>/", $line)) {
+ $finished = true;
+ }
}
return $rv;
exit;
}
- ?>
+ $notices = array();
- <?php print_notice("Configuration check succeeded."); ?>
+ if (!function_exists("curl_init")) {
+ array_push($notices, "It is highly recommended to enable support for CURL in PHP.");
+ }
+
+ if (count($notices) > 0) {
+ print_notice("Configuration check succeeded with minor problems:");
+
+ print "<ul>";
+
+ foreach ($notices as $notice) {
+ print "<li>$notice</li>";
+ }
+
+ print "</ul>";
+ } else {
+ print_notice("Configuration check succeeded.");
+ }
+
+ ?>
<h2>Checking database</h2>