Disable drivers when functions not available
This commit is contained in:
parent
840d2d8ec5
commit
ab93c3f86c
@ -170,7 +170,6 @@ $dolibarr_main_db_host = "localhost";
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="label">
|
<td class="label">
|
||||||
<select name='db_type'>
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$defaultype=isset($dolibarr_main_db_type)?$dolibarr_main_db_type:'mysql';
|
$defaultype=isset($dolibarr_main_db_type)?$dolibarr_main_db_type:'mysql';
|
||||||
@ -180,6 +179,7 @@ $dir=DOL_DOCUMENT_ROOT.'/lib/databases';
|
|||||||
$handle=opendir($dir);
|
$handle=opendir($dir);
|
||||||
$modules = array();
|
$modules = array();
|
||||||
$nbok = $nbko = 0;
|
$nbok = $nbko = 0;
|
||||||
|
$option='';
|
||||||
|
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
@ -187,37 +187,42 @@ while (($file = readdir($handle))!==false)
|
|||||||
{
|
{
|
||||||
$type=$reg[1];
|
$type=$reg[1];
|
||||||
$modName = 'DoliDb';
|
$modName = 'DoliDb';
|
||||||
//print "file=$file "; print "type=$type "; print "modName=$modName";
|
|
||||||
|
# print "file=$file type=$type modName=$modName<br>\n";
|
||||||
|
|
||||||
/*
|
# include_once($dir."/".$file);
|
||||||
include_once($dir."/".$file);
|
# $objMod = new $modName();
|
||||||
$objMod = new $modName();
|
# if ($objMod)
|
||||||
if ($objMod)
|
# {
|
||||||
{
|
|
||||||
|
# }
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// Version min de la base
|
// Version min de la base
|
||||||
$versionmin=array();
|
$versionbasemin=array();
|
||||||
if ($type=='mysql') $versionmin=array(3,1,0);
|
if ($type=='mysql') { $versionbasemin=array(3,1,0); $testfunction='mysql_connect'; }
|
||||||
if ($type=='mysqli') $versionmin=array(4,1,0);
|
if ($type=='mysqli') { $versionbasemin=array(4,1,0); $testfunction='mysqli_connect'; }
|
||||||
if ($type=='pgsql') $versionmin=array(8,1,0);
|
if ($type=='pgsql') { $versionbasemin=array(8,1,0); $testfunction='pg_connect'; }
|
||||||
|
|
||||||
// Remarques
|
// Remarques
|
||||||
$note='';
|
$note='';
|
||||||
if ($type=='mysql') $note='(Mysql >= '.versiontostring($versionmin).')';
|
if ($type=='mysql') $note='(Mysql >= '.versiontostring($versionbasemin).')';
|
||||||
if ($type=='mysqli') $note='(Mysql >= '.versiontostring($versionmin).')';
|
if ($type=='mysqli') $note='(Mysql >= '.versiontostring($versionbasemin).')';
|
||||||
if ($type=='pgsql') $note='(Postgresql >= '.versiontostring($versionmin).')';
|
if ($type=='pgsql') $note='(Postgresql >= '.versiontostring($versionbasemin).')';
|
||||||
|
|
||||||
// Affiche ligne dans liste
|
// Affiche ligne dans liste
|
||||||
print '<option value="'.$type.'" '.($defaultype==$type?" selected":"").'>';
|
$option.='<option value="'.$type.'" '.($defaultype==$type?" selected":"");
|
||||||
print $type;
|
if (! function_exists($testfunction)) $option.=' disabled="disabled"';
|
||||||
if ($note) print ' '.$note;
|
$option.='>';
|
||||||
print '</option>';
|
$option.=$type.' ';
|
||||||
|
if ($note) $option.=' '.$note;
|
||||||
|
if (! function_exists($testfunction)) $option.=' - '.$langs->trans("FunctionNotAvailableInThisPHP");
|
||||||
|
$option.='</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<select name='db_type'>
|
||||||
|
<?php echo $option ?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -80,6 +80,7 @@ AdminLoginAlreadyExists=Dolibarr administrator account '%s' already exists.
|
|||||||
WarningRemoveInstallDir=Warning, for security reasons, once install or upgrade is finished, you have to remove the install directory.
|
WarningRemoveInstallDir=Warning, for security reasons, once install or upgrade is finished, you have to remove the install directory.
|
||||||
ThisPHPDoesNotSupportTypeBase=This PHP system does not support interfaces to access database type %s
|
ThisPHPDoesNotSupportTypeBase=This PHP system does not support interfaces to access database type %s
|
||||||
MigrateScript=Migrate script
|
MigrateScript=Migrate script
|
||||||
|
FunctionNotAvailableInThisPHP=Not available on this PHP
|
||||||
ChoosedMigrateScript=Choosed migrate script
|
ChoosedMigrateScript=Choosed migrate script
|
||||||
DataMigration=Data migration
|
DataMigration=Data migration
|
||||||
DatabaseMigration=Structure database migration
|
DatabaseMigration=Structure database migration
|
||||||
|
|||||||
@ -79,7 +79,8 @@ DolibarrAdminLogin=Login de l'utilisateur administrateur de Dolibarr
|
|||||||
FailedToCreateAdminLogin=Echec de la création du compte administrateur Dolibarr.
|
FailedToCreateAdminLogin=Echec de la création du compte administrateur Dolibarr.
|
||||||
AdminLoginAlreadyExists=Compte administrateur Dolibarr '%s' déjà existant.
|
AdminLoginAlreadyExists=Compte administrateur Dolibarr '%s' déjà existant.
|
||||||
WarningRemoveInstallDir=Attention, pour des raisons de sécurité, une fois l'installation terminée, il est nécessaire de supprimer le répertoire install.
|
WarningRemoveInstallDir=Attention, pour des raisons de sécurité, une fois l'installation terminée, il est nécessaire de supprimer le répertoire install.
|
||||||
ThisPHPDoesNotSupportTypeBase=Le système PHP ne supporta pas les interfaces d'accès pour les base %s
|
ThisPHPDoesNotSupportTypeBase=Le système PHP ne supporta pas les interfaces d'accès pour les bases %s
|
||||||
|
FunctionNotAvailableInThisPHP=Non disponible sur ce PHP
|
||||||
MigrateScript=Script de migration
|
MigrateScript=Script de migration
|
||||||
ChoosedMigrateScript=Choix du script de migration
|
ChoosedMigrateScript=Choix du script de migration
|
||||||
DatabaseMigration=Migration du format de la base de données
|
DatabaseMigration=Migration du format de la base de données
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user