summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-29 09:08:57 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-29 09:08:57 -0700
commit5de6de6a133c6c906ee63b5a2ab1b08bc14ca17e (patch)
treea24bcd976499d9bf8c8738e72eea76490b847653
parent16d4922e3af7309c1a3747cd1c49f981a9066ee4 (diff)
parentb0bb107b7ebb5edbf3bec69ae2e716552eb1adf5 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
-rw-r--r--installer/index.php6
-rw-r--r--installer/installer.php52
2 files changed, 27 insertions, 31 deletions
diff --git a/installer/index.php b/installer/index.php
index 317f27b8..a11c0b02 100644
--- a/installer/index.php
+++ b/installer/index.php
@@ -30,10 +30,6 @@ require(DOCROOT . "installer/installer.php");
if (PHP_SAPI == "cli") {
include("cli.php");
} else {
- if (@$_GET["page"] == "check") {
- include("check.html.php");
- } else {
- include("web.php");
- }
+ include("web.php");
}
diff --git a/installer/installer.php b/installer/installer.php
index 9ba88bea..b0af561e 100644
--- a/installer/installer.php
+++ b/installer/installer.php
@@ -18,31 +18,6 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-// We know that we have either mysql or mysqli. By default we use mysql functions, so if they're
-// not defined then do the simplest thing which will work: remap them to their mysqli
-// counterparts.
-if (!function_exists("mysql_query")) {
- function mysql_connect($host, $user, $pass) {
- installer::$mysqli = new mysqli($host, $user, $pass);
- // http://php.net/manual/en/mysqli.connect.php says to use mysqli_connect_error() instead of
- // $mysqli->connect_error because of bugs before PHP 5.2.9
- $error = mysqli_connect_error();
- return empty($error);
- }
- function mysql_query($query) {
- return installer::$mysqli->query($query);
- }
- function mysql_num_rows($result) {
- return $result->num_rows;
- }
- function mysql_error() {
- return installer::$mysqli->error;
- }
- function mysql_select_db($db) {
- return installer::$mysqli->select_db($db);
- }
-}
-
class installer {
static $mysqli;
@@ -92,7 +67,32 @@ class installer {
}
static function connect($config) {
- return @mysql_connect($config["host"], $config["user"], $config["password"]);
+ // We know that we have either mysql or mysqli. By default we use mysql functions, so if
+ // they're not defined then do the simplest thing which will work: remap them to their mysqli
+ // counterparts.
+ if (!function_exists("mysql_query")) {
+ function mysql_connect($host, $user, $pass) {
+ installer::$mysqli = new mysqli($host, $user, $pass);
+ // http://php.net/manual/en/mysqli.connect.php says to use mysqli_connect_error() instead of
+ // $mysqli->connect_error because of bugs before PHP 5.2.9
+ $error = mysqli_connect_error();
+ return empty($error);
+ }
+ function mysql_query($query) {
+ return installer::$mysqli->query($query);
+ }
+ function mysql_num_rows($result) {
+ return $result->num_rows;
+ }
+ function mysql_error() {
+ return installer::$mysqli->error;
+ }
+ function mysql_select_db($db) {
+ return installer::$mysqli->select_db($db);
+ }
+ }
+
+ return mysql_connect($config["host"], $config["user"], $config["password"]);
}
static function select_db($config) {