Skip to content

Commit

Permalink
Added check for MySQL extension in install.php
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Oct 30, 2013
1 parent a8927bb commit a91cc74
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
elseif (isset($action) && stristr($action, 'upgrade'))
{
$upgrading = true;

// load configuration
include_once(CONFIG_FILE);
include_once(CONFIG_FILE);

// begin of upgrade?
if (empty($step))
Expand Down Expand Up @@ -124,6 +124,12 @@

<?php

// check MySQL availability
if (!extension_loaded('mysql'))
{
error("Missing MySQL: extension not loaded.", true);
die;
}

// no messages yet
$message = '';
Expand All @@ -143,7 +149,7 @@
$step--;
break;
}

// check database existance
if (mysql_select_db($db_database, $dbh))
{
Expand Down Expand Up @@ -172,7 +178,7 @@
}
}
}

// check if tables with this prefix already exist
global $db_prefix;
$rs = mysql_query("SHOW TABLES FROM `".$db_database."` LIKE '".$db_prefix."%'" ) or trigger_error("Can't execute: ".mysql_error($dbh), E_USER_ERROR);
Expand All @@ -192,7 +198,7 @@

// continue with table installation
$step++;


case 4: /*
* continue installation by upgrading or installing tables and (re)moving files (upgrade only)
Expand Down Expand Up @@ -241,7 +247,7 @@
// upgrade
info("<br/>Upgrading tables...");
info("Old database version: $version");

$sql_array = array();
// select the relevant upgrades (> current version)
foreach ($upgrades as $ver => $value)
Expand Down Expand Up @@ -308,7 +314,6 @@
}

break;

}


Expand Down Expand Up @@ -502,7 +507,7 @@
</td></tr>
<?php break;

case 1:
case 1:
default: // start setup

?> <tr><td colspan="2">
Expand Down

0 comments on commit a91cc74

Please sign in to comment.