* Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ * */ ?> Dolibarr Install
Installation de Dolibarr - Etape $etape/$etapes"; $conf = "../conf/conf.php"; if (file_exists($conf)) { include($conf); } require ($dolibarr_main_document_root . "/lib/mysql.lib.php"); require ($dolibarr_main_document_root . "/conf/conf.class.php"); if ($HTTP_POST_VARS["action"] == "set") { umask(0); print '

Base de donnée

'; print ''; $error=0; print ''; $conf = new Conf(); $conf->db->host = $dolibarr_main_db_host; $conf->db->name = $dolibarr_main_db_name; $conf->db->user = $dolibarr_main_db_user; $conf->db->pass = $dolibarr_main_db_pass; $db = new DoliDb(); $ok = 0; if ($db->connected == 1) { print ""; if($db->database_selected == 1) { print ""; $ok = 1 ; //$result = $db->list_tables($dolibarr_main_db_name); //if ($result) //{ // while ($row = $db->fetch_row()) // { // print "Table : $row[0]
\n"; // } //} // Création des tables $dir = "../../mysql/tables/"; $handle=opendir($dir); while (($file = readdir($handle))!==false) { if (substr($file, strlen($file) - 4) == '.sql' && substr($file,0,4) == 'llx_') { $name = substr($file, 0, strlen($file) - 4); print ""; $buffer = ''; $fp = fopen($dir.$file,"r"); if ($fp) { while (!feof ($fp)) { $buffer .= fgets($fp, 4096); } fclose($fp); } if ($db->query($buffer)) { print ""; } else { if ($db->errno() == 1050) { print ""; } else { print ""; $error++; } } } } closedir($handle); // // Données // $dir = "../../mysql/data/"; $file = "data.sql"; $fp = fopen($dir.$file,"r"); if ($fp) { while (!feof ($fp)) { $buffer = fgets($fp, 4096); if (strlen(trim(ereg_replace("--","",$buffer)))) { if ($db->query($buffer)) { $ok = 1; } else { $ok = 0; if ($db->errno() == 1062) { // print ""; } else { print "Erreur SQL ".$db->errno()." sur requete '$buffer'
"; } } } } fclose($fp); } print ""; if ($ok) { print ""; } else { $ok = 1 ; } } else { print ""; } } print '
Test de connexion à la base de données
Connexion réussie au serveur : $dolibarr_main_db_hostOK
Connexion réussie à la base : $dolibarr_main_db_nameOK
Création de la table $nameOK
Déjà existante
ERREUR ".$db->errno()."
Insertion ligne : $bufferDéja existante
Chargement des données de baseOK
Erreur lors de la création de : $dolibarr_main_db_nameERREUR
'; $db->close(); } ?>