]> git.wh0rd.org - tt-rss.git/blobdiff - install/index.php
implement upload-related support for open_basedir
[tt-rss.git] / install / index.php
index ba71bbdbaedbeb3d943a346e1796bd970938816a..3b6a1f544fadb3fbd765e853ddaf07a63b36efee 100644 (file)
@@ -9,7 +9,7 @@
 </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>