]> git.wh0rd.org - tt-rss.git/blobdiff - include/sanity_check.php
move stylesheets to css/, reference default tt-rss stylesheets from
[tt-rss.git] / include / sanity_check.php
index b4102d23492ac74214923ef505ec06d470b0d3b6..29e53fa336f29648f75c4186cd11cc8bca75386d 100644 (file)
@@ -21,7 +21,7 @@
                return $url_path;
        }
 
-       function initial_sanity_check($link) {
+       function initial_sanity_check() {
 
                $errors = array();
 
                                array_push($errors, "Javascript cache is not writable (chmod -R 777 ".CACHE_DIR."/js)");
                        }
 
-                       if (strlen(FEED_CRYPT_KEY) != 24) {
+                       if (strlen(FEED_CRYPT_KEY) > 0 && strlen(FEED_CRYPT_KEY) != 24) {
                                array_push($errors, "FEED_CRYPT_KEY should be exactly 24 characters in length.");
                        }
 
-                       if (strlen(FEED_CRYPT_KEY) != 0 && !function_exists("mcrypt_decrypt")) {
+                       if (strlen(FEED_CRYPT_KEY) > 0 && !function_exists("mcrypt_decrypt")) {
                                array_push($errors, "FEED_CRYPT_KEY requires mcrypt functions which are not found.");
                        }
 
                        }
 
                        if (SINGLE_USER_MODE) {
-                               $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
+                               $result = db_query("SELECT id FROM ttrss_users WHERE id = 1");
 
-                               if ($link) {
-                                       $result = db_query($link, "SELECT id FROM ttrss_users WHERE id = 1");
-
-                                       if (db_num_rows($result) != 1) {
-                                               array_push($errors, "SINGLE_USER_MODE is enabled in config.php but default admin account is not found.");
-                                       }
+                               if (db_num_rows($result) != 1) {
+                                       array_push($errors, "SINGLE_USER_MODE is enabled in config.php but default admin account is not found.");
                                }
                        }
 
                                array_push($errors, "PHP support for JSON is required, but was not found.");
                        }
 
-                       if (DB_TYPE == "mysql" && !function_exists("mysql_connect")) {
+                       if (DB_TYPE == "mysql" && !function_exists("mysql_connect") && !function_exists("mysqli_connect")) {
                                array_push($errors, "PHP support for MySQL is required for configured DB_TYPE in config.php.");
                        }
 
                        <head>
                        <title>Startup failed</title>
                                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-                               <link rel="stylesheet" type="text/css" href="utility.css">
+                               <link rel="stylesheet" type="text/css" href="css/utility.css">
                        </head>
                <body>
                <div class="floatingLogo"><img src="images/logo_small.png"></div>
                }
        }
 
-       initial_sanity_check($link);
+       initial_sanity_check();
 
 ?>