diff --git a/dist/php/5.3.1.sql b/dist/php/5.3.1.php similarity index 51% rename from dist/php/5.3.1.sql rename to dist/php/5.3.1.php index 90b0866dca..79125572bf 100644 --- a/dist/php/5.3.1.sql +++ b/dist/php/5.3.1.php @@ -1,3 +1,21 @@ +getOption("SQL_DRIVER"); + if (!isSet($test["driver"])) { + $test = AJXP_Utils::cleanDibiDriverParameters($confDriver->getOption("SQL_DRIVER")); + } + if (is_array($test) && isSet($test["driver"])) { + + $parts = array_map("trim", explode("/* SEPARATOR */", $dbInst)); + $results = array(); + $errors = array(); + + require_once(AJXP_BIN_FOLDER."/dibi.compact.php"); + dibi::connect($test); + dibi::begin(); + foreach ($parts as $sqlPart) { + if(empty($sqlPart)) continue; + try { + dibi::nativeQuery($sqlPart); + echo "
$sqlPart ... OK
"; + } catch (DibiException $e) { + $errors[] = $e->getMessage(); + echo "
$sqlPart ... FAILED (".$e->getMessage().")
"; + } + } + dibi::commit(); + dibi::disconnect(); + + } else { + echo "Nothing to do for the DB"; + } + +} else { + echo "Nothing to do for the DB"; +}