]> git.wh0rd.org - tt-rss.git/blobdiff - include/sanity_check.php
fix various issues reported by static analysis
[tt-rss.git] / include / sanity_check.php
old mode 100644 (file)
new mode 100755 (executable)
index a9ba663..3b3e281
@@ -1,6 +1,5 @@
 <?php
-       /*
-        * WARNING!
+       /* WARNING!
         *
         * If you modify this file, you are ON YOUR OWN!
         *
@@ -21,6 +20,9 @@
                return $url_path;
        }
 
+       /**
+        * @SuppressWarnings(PHPMD.UnusedLocalVariable)
+        */
        function initial_sanity_check() {
 
                $errors = array();
@@ -43,8 +45,8 @@
                                array_push($errors, "Please don't run this script as root.");
                        }
 
-                       if (version_compare(PHP_VERSION, '5.3.0', '<')) {
-                               array_push($errors, "PHP version 5.3.0 or newer required.");
+                       if (version_compare(PHP_VERSION, '5.4.0', '<')) {
+                               array_push($errors, "PHP version 5.4.0 or newer required.");
                        }
 
                        if (CONFIG_VERSION != EXPECTED_CONFIG_VERSION) {
                                array_push($errors, "PHP support for JSON is required, but was not found.");
                        }
 
-                       if (DB_TYPE == "mysql" && !function_exists("mysql_connect") && !function_exists("mysqli_connect")) {
+                       if (DB_TYPE == "mysql" && !function_exists("mysqli_connect")) {
                                array_push($errors, "PHP support for MySQL is required for configured DB_TYPE in config.php.");
                        }
 
                                array_push($errors, "PHP support for hash() function is required but was not found.");
                        }
 
-                       if (!function_exists("ctype_lower")) {
-                               array_push($errors, "PHP support for ctype functions are required by HTMLPurifier.");
+                       if (ini_get("safe_mode")) {
+                               array_push($errors, "PHP safe mode setting is obsolete and not supported by tt-rss.");
                        }
 
-                       if (!function_exists("iconv")) {
-                               array_push($errors, "PHP support for iconv is required to handle multiple charsets.");
-                       }
-
-                       /* if (ini_get("safe_mode")) {
-                               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.");
                        }