X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=install%2Findex.php;h=46a0fdecdfa6d3f146c130cd2b182e71c0f55cb6;hb=09bc54c6901c5e4f6ec1d2a8b00fbf450aa258dd;hp=3deb7ad23575d14404871f5c46e9315d95661a30;hpb=a55857db5010ad53d5c2949937abceab1dd82bff;p=tt-rss.git diff --git a/install/index.php b/install/index.php old mode 100644 new mode 100755 index 3deb7ad2..46a0fdec --- a/install/index.php +++ b/install/index.php @@ -2,23 +2,44 @@ Tiny Tiny RSS - Installer - + - + - $msg"; + print "
$msg
"; } function print_notice($msg) { - print "
- $msg
"; + print "
$msg
"; } - function db_connect($host, $user, $pass, $db, $type) { + function db_connect($host, $user, $pass, $db, $type, $port = false) { if ($type == "pgsql") { $string = "dbname=$db user=$user"; @@ -90,8 +102,8 @@ $string .= " host=$host"; } - if (defined('DB_PORT')) { - $string = "$string port=" . DB_PORT; + if ($port) { + $string = "$string port=" . $port; } $link = pg_connect($string); @@ -99,11 +111,10 @@ return $link; } else if ($type == "mysql") { - $link = mysql_connect($host, $user, $pass); - if ($link) { - $result = mysql_select_db($db, $link); - if ($result) return $link; - } + if ($port) + return mysqli_connect($host, $user, $pass, $db, $port); + else + return mysqli_connect($host, $user, $pass, $db); } } @@ -154,19 +165,25 @@ } return $result; } else if ($type == "mysql") { - $result = mysql_query($query, $link); + + $result = mysqli_query($link, $query); + if (!$result) { $query = htmlspecialchars($query); if ($die_on_error) { - die("Query $query failed: " . ($link ? mysql_error($link) : "No connection")); + die("Query $query failed: " . ($link ? mysqli_error($link) : "No connection")); } } return $result; } } + function is_server_https() { + return (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off')) || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'; + } + function make_self_url_path() { - $url_path = ($_SERVER['HTTPS'] != "on" ? 'http://' : 'https://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); + $url_path = (is_server_https() ? 'https://' : 'http://') . $_SERVER["HTTP_HOST"] . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); return $url_path; } @@ -225,27 +242,29 @@
- +
- +
- +
- + + If needed
- + + Usually 3306 for MySQL or 5432 for PostgreSQL

Other settings

@@ -254,7 +273,7 @@
- +
@@ -289,6 +308,14 @@ array_push($notices, "It is highly recommended to enable support for CURL in PHP."); } + if (function_exists("curl_init") && ini_get("open_basedir")) { + array_push($notices, "CURL and open_basedir combination breaks support for HTTP redirects. See the FAQ for more information."); + } + + if (!function_exists("idn_to_ascii")) { + array_push($notices, "PHP support for Internationalization Functions is required to handle Internationalized Domain Names."); + } + if (count($notices) > 0) { print_notice("Configuration check succeeded with minor problems:"); @@ -308,7 +335,7 @@

Checking database

Before you can start using tt-rss, database needs to be initialized. Click on the button below to do that now.