Amélioration gestion erreur
This commit is contained in:
parent
22a8f302cd
commit
136e5cfc3f
@ -21,7 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/install/etape1.php
|
\file htdocs/install/etape0.php
|
||||||
\brief Permet d'afficher et de confirmer le charset par rapport aux informations précédentes -> sélection suite à connexion'
|
\brief Permet d'afficher et de confirmer le charset par rapport aux informations précédentes -> sélection suite à connexion'
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
*/
|
*/
|
||||||
@ -113,8 +113,8 @@ if (! $error && (isset($_POST["db_create_database"]) && $_POST["db_create_databa
|
|||||||
|
|
||||||
if ($db->connected)
|
if ($db->connected)
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<table border="0" cellpadding="1" cellspacing="0">
|
<table border="0" cellpadding="1" cellspacing="0">
|
||||||
|
|
||||||
<tr><td align="center" class="label" colspan="3"><h3><?php echo $langs->trans("CharsetChoice");?></h3></td></tr>
|
<tr><td align="center" class="label" colspan="3"><h3><?php echo $langs->trans("CharsetChoice");?></h3></td></tr>
|
||||||
|
|
||||||
@ -221,6 +221,9 @@ if ($db->connected)
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -241,9 +244,6 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
pFooter($error,$setuplang);
|
pFooter($error,$setuplang);
|
||||||
?>
|
?>
|
||||||
@ -85,6 +85,7 @@ class DoliDb
|
|||||||
1007 => 'DB_ERROR_ALREADY_EXISTS',
|
1007 => 'DB_ERROR_ALREADY_EXISTS',
|
||||||
1008 => 'DB_ERROR_CANNOT_DROP',
|
1008 => 'DB_ERROR_CANNOT_DROP',
|
||||||
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
|
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
|
||||||
|
1044 => 'DB_ERROR_ACCESSDENIED',
|
||||||
1046 => 'DB_ERROR_NODBSELECTED',
|
1046 => 'DB_ERROR_NODBSELECTED',
|
||||||
1048 => 'DB_ERROR_CONSTRAINT',
|
1048 => 'DB_ERROR_CONSTRAINT',
|
||||||
1050 => 'DB_ERROR_TABLE_ALREADY_EXISTS',
|
1050 => 'DB_ERROR_TABLE_ALREADY_EXISTS',
|
||||||
@ -237,8 +238,11 @@ class DoliDb
|
|||||||
//force les enregistrement en latin1 si la base est en utf8 par défaut
|
//force les enregistrement en latin1 si la base est en utf8 par défaut
|
||||||
// Supprimé car plante sur mon PHP-Mysql. De plus, la base est forcement en latin1 avec
|
// Supprimé car plante sur mon PHP-Mysql. De plus, la base est forcement en latin1 avec
|
||||||
// les nouvelles version de Dolibarr car forcé par l'install Dolibarr.
|
// les nouvelles version de Dolibarr car forcé par l'install Dolibarr.
|
||||||
|
if ($this->db)
|
||||||
|
{
|
||||||
$this->query("SET NAMES '".$this->forcecharset."'", $this->db);
|
$this->query("SET NAMES '".$this->forcecharset."'", $this->db);
|
||||||
$this->query("SET CHARACTER SET '".$this->forcecharset."'", $this->db);
|
$this->query("SET CHARACTER SET '".$this->forcecharset."'", $this->db);
|
||||||
|
}
|
||||||
//print "Resultat fonction connect: ".$this->db;
|
//print "Resultat fonction connect: ".$this->db;
|
||||||
return $this->db;
|
return $this->db;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,6 +84,7 @@ class DoliDb
|
|||||||
1007 => 'DB_ERROR_ALREADY_EXISTS',
|
1007 => 'DB_ERROR_ALREADY_EXISTS',
|
||||||
1008 => 'DB_ERROR_CANNOT_DROP',
|
1008 => 'DB_ERROR_CANNOT_DROP',
|
||||||
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
|
1025 => 'DB_ERROR_NO_FOREIGN_KEY_TO_DROP',
|
||||||
|
1044 => 'DB_ERROR_ACCESSDENIED',
|
||||||
1046 => 'DB_ERROR_NODBSELECTED',
|
1046 => 'DB_ERROR_NODBSELECTED',
|
||||||
1048 => 'DB_ERROR_CONSTRAINT',
|
1048 => 'DB_ERROR_CONSTRAINT',
|
||||||
1050 => 'DB_ERROR_TABLE_ALREADY_EXISTS',
|
1050 => 'DB_ERROR_TABLE_ALREADY_EXISTS',
|
||||||
@ -241,8 +242,11 @@ class DoliDb
|
|||||||
// les nouvelles version de Dolibarr car forcé par l'install Dolibarr.
|
// les nouvelles version de Dolibarr car forcé par l'install Dolibarr.
|
||||||
//$this->query('SET NAMES '.$this->forcecharset);
|
//$this->query('SET NAMES '.$this->forcecharset);
|
||||||
//print "Resultat fonction connect: ".$this->db;
|
//print "Resultat fonction connect: ".$this->db;
|
||||||
|
if ($this->db)
|
||||||
|
{
|
||||||
$this->query("SET NAMES '".$this->forcecharset."'", $this->db);
|
$this->query("SET NAMES '".$this->forcecharset."'", $this->db);
|
||||||
$this->query("SET CHARACTER SET '".$this->forcecharset."'", $this->db);
|
$this->query("SET CHARACTER SET '".$this->forcecharset."'", $this->db);
|
||||||
|
}
|
||||||
return $this->db;
|
return $this->db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,8 @@ if (! defined('NOREQUIRETRAN'))
|
|||||||
if (! defined('NOREQUIREDB'))
|
if (! defined('NOREQUIREDB'))
|
||||||
{
|
{
|
||||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||||
if (! $db->connected)
|
|
||||||
|
if ($db->error)
|
||||||
{
|
{
|
||||||
dolibarr_print_error($db,"host=".$conf->db->host.", user=".$conf->db->user.", databasename=".$conf->db->name.", ".$db->error);
|
dolibarr_print_error($db,"host=".$conf->db->host.", user=".$conf->db->user.", databasename=".$conf->db->name.", ".$db->error);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user