Exemple #1
0
 <ul>
 <?php 
     $table_prefix = $_POST['install_dbprefix'];
     if ($step == 'u7') {
         //before doing anything else, we'll have to convert data to UTF-8
         //required since 0.7dev (if we're upgrading, 'f course)
         $_to_ver = substr($_POST['install_type'], 8);
         if ((double) $_to_ver <= 0.7) {
             $zdb->convertToUTF($table_prefix);
         }
     }
     // begin : copyright (2002) the phpbb group (support@phpbb.com)
     // load in the sql parser
     include '../includes/sql_parse.php';
     if ($step == 'u7') {
         $update_scripts = Galette\Core\Db::getUpdateScripts('.', $_POST['install_dbtype'], substr($_POST['install_type'], 8));
     } else {
         $update_scripts['current'] = $_POST['install_dbtype'] . '.sql';
     }
     $sql_query = '';
     while (list($key, $val) = each($update_scripts)) {
         $sql_query .= @fread(@fopen('sql/' . $val, 'r'), @filesize('sql/' . $val)) . "\n";
     }
     $sql_query = preg_replace('/galette_/', $table_prefix, $sql_query);
     $sql_query = remove_remarks($sql_query);
     $sql_query = split_sql_file($sql_query, ';');
     $zdb->connection->beginTransaction();
     for ($i = 0; $i < sizeof($sql_query); $i++) {
         $query = trim($sql_query[$i]);
         if ($query != '' && $query[0] != '-') {
             //some output infos