From 8613dcd26ece6841e2b71f96aff5558f0ec7bdc1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Sep 2012 19:15:08 +0200 Subject: [PATCH 1/2] Add specific README.md for DoliWamp directory of sourceforge. --- build/exe/doliwamp/README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 build/exe/doliwamp/README.md diff --git a/build/exe/doliwamp/README.md b/build/exe/doliwamp/README.md new file mode 100644 index 00000000000..ca3aaa6aece --- /dev/null +++ b/build/exe/doliwamp/README.md @@ -0,0 +1,7 @@ +# DOLIWAMP, THE DOLIBARR INSTALLER FOR WINDOWS + +DoliWamp is a special all in one package installer for Windows (Dolibarr+Mysql+Apache+PHP). +It's a dedicated Dolibarr version for Windows newbies with no technical knowledge. This package will install or upgrade Dolibarr but also and all prerequisites like the web server, and the database in one autoinstall process. + +If you have technical knowledge in web administration and plan to share your server instance (Apache, Mysql or PHP) with other projects than Dolibarr or want to use Dolibarr other components (PostgreSQL), you should not use this assistant and make a manual installation of Dolibarr on your existing server by downloading the standard package (.tgz or .zip file). + From 1ccb8f33630fb70cc9ad633579847fb87c11852f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Sep 2012 01:47:21 +0200 Subject: [PATCH 2/2] New: Add a test during upgrade if database version is too low. --- htdocs/install/upgrade.php | 142 ++++++++++++++++++-------------- htdocs/langs/en_US/install.lang | 1 + htdocs/langs/fr_FR/install.lang | 1 + 3 files changed, 82 insertions(+), 62 deletions(-) diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 7f3d3be9bc9..8c6c16c7bb5 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -48,7 +48,8 @@ $versionfrom=GETPOST("versionfrom",'',3)?GETPOST("versionfrom",'',3):(empty($arg $versionto=GETPOST("versionto",'',3)?GETPOST("versionto",'',3):(empty($argv[2])?'':$argv[2]); $langs->load("admin"); -$langs->load("install"); +$langs->load("install"); +$langs->load("errors"); if ($dolibarr_main_db_type == "mysql") $choix=1; if ($dolibarr_main_db_type == "mysqli") $choix=1; @@ -152,79 +153,96 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) print ''.$langs->trans("ServerVersion").''; print ''.$version.''; dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ServerVersion")." : $version"); - //print ''.join('.',$versionarray).''; + + // Test database version + $versionmindb=getStaticMember(get_class($db),'versionmin'); + //print join('.',$versionarray).' - '.join('.',$versionmindb); + if (count($versionmindb) && count($versionarray) + && versioncompare($versionarray,$versionmindb) < 0) + { + // Warning: database version too low. + print "".$langs->trans("ErrorDatabaseVersionTooLow",join('.',$versionarray),join('.',$versionmindb))."".$langs->trans("Error")."\n"; + dolibarr_install_syslog("upgrade: ".$langs->transnoentities("ErrorDatabaseVersionTooLow",join('.',$versionarray),join('.',$versionmindb))); + $ok=0; + } + } // Force l'affichage de la progression - print ''.$langs->trans("PleaseBePatient").''; - flush(); - + if ($ok) + { + print ''.$langs->trans("PleaseBePatient").''; + flush(); + } /* * Delete duplicates in table categorie_association */ - $couples=array(); - $filles=array(); - $sql = "SELECT fk_categorie_mere, fk_categorie_fille"; - $sql.= " FROM ".MAIN_DB_PREFIX."categorie_association"; - dolibarr_install_syslog("upgrade: search duplicate sql=".$sql); - $resql = $db->query($sql); - if ($resql) + if ($ok) { - $num=$db->num_rows($resql); - while ($obj=$db->fetch_object($resql)) - { - if (! isset($filles[$obj->fk_categorie_fille])) // Only one record as child (a child has only on parent). - { - if ($obj->fk_categorie_mere != $obj->fk_categorie_fille) - { - $filles[$obj->fk_categorie_fille]=1; // Set record for this child - $couples[$obj->fk_categorie_mere.'_'.$obj->fk_categorie_fille]=array('mere'=>$obj->fk_categorie_mere, 'fille'=>$obj->fk_categorie_fille); - } - } - } + $couples=array(); + $filles=array(); + $sql = "SELECT fk_categorie_mere, fk_categorie_fille"; + $sql.= " FROM ".MAIN_DB_PREFIX."categorie_association"; + dolibarr_install_syslog("upgrade: search duplicate sql=".$sql); + $resql = $db->query($sql); + if ($resql) + { + $num=$db->num_rows($resql); + while ($obj=$db->fetch_object($resql)) + { + if (! isset($filles[$obj->fk_categorie_fille])) // Only one record as child (a child has only on parent). + { + if ($obj->fk_categorie_mere != $obj->fk_categorie_fille) + { + $filles[$obj->fk_categorie_fille]=1; // Set record for this child + $couples[$obj->fk_categorie_mere.'_'.$obj->fk_categorie_fille]=array('mere'=>$obj->fk_categorie_mere, 'fille'=>$obj->fk_categorie_fille); + } + } + } - dolibarr_install_syslog("upgrade: result is num=".$num." count(couples)=".count($couples)); + dolibarr_install_syslog("upgrade: result is num=".$num." count(couples)=".count($couples)); - // If there is duplicates couples or child with two parents - if (count($couples) > 0 && $num > count($couples)) - { - $error=0; + // If there is duplicates couples or child with two parents + if (count($couples) > 0 && $num > count($couples)) + { + $error=0; - $db->begin(); + $db->begin(); - $sql="DELETE FROM ".MAIN_DB_PREFIX."categorie_association"; - dolibarr_install_syslog("upgrade: delete association sql=".$sql); - $resqld=$db->query($sql); - if ($resqld) - { - foreach($couples as $key => $val) - { - $sql ="INSERT INTO ".MAIN_DB_PREFIX."categorie_association(fk_categorie_mere,fk_categorie_fille)"; - $sql.=" VALUES(".$val['mere'].", ".$val['fille'].")"; - dolibarr_install_syslog("upgrade: insert association sql=".$sql); - $resqli=$db->query($sql); - if (! $resqli) $error++; - } - } + $sql="DELETE FROM ".MAIN_DB_PREFIX."categorie_association"; + dolibarr_install_syslog("upgrade: delete association sql=".$sql); + $resqld=$db->query($sql); + if ($resqld) + { + foreach($couples as $key => $val) + { + $sql ="INSERT INTO ".MAIN_DB_PREFIX."categorie_association(fk_categorie_mere,fk_categorie_fille)"; + $sql.=" VALUES(".$val['mere'].", ".$val['fille'].")"; + dolibarr_install_syslog("upgrade: insert association sql=".$sql); + $resqli=$db->query($sql); + if (! $resqli) $error++; + } + } - if (! $error) - { - print ''.$langs->trans("RemoveDuplicates").''; - print ''.$langs->trans("Success").' ('.$num.'=>'.count($couples).')'; - $db->commit(); - } - else - { - print ''.$langs->trans("RemoveDuplicates").''; - print ''.$langs->trans("Failed").''; - $db->rollback(); - } - } - } - else - { - print '
'.$langs->trans("Error").'
'; + if (! $error) + { + print ''.$langs->trans("RemoveDuplicates").''; + print ''.$langs->trans("Success").' ('.$num.'=>'.count($couples).')'; + $db->commit(); + } + else + { + print ''.$langs->trans("RemoveDuplicates").''; + print ''.$langs->trans("Failed").''; + $db->rollback(); + } + } + } + else + { + print '
'.$langs->trans("Error").'
'; + } } /* @@ -232,7 +250,7 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) */ if ($ok && preg_match('/mysql/',$db->type)) { - $versioncommande=explode('.','4.0'); + $versioncommande=array(4,0,0); if (count($versioncommande) && count($versionarray) && versioncompare($versioncommande,$versionarray) <= 0) // Si mysql >= 4.0 { diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 8b078507d7c..cd43be5c0af 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -26,6 +26,7 @@ ErrorGoBackAndCorrectParameters=Go backward and correct wrong parameters. ErrorWrongValueForParameter=You may have typed a wrong value for parameter '%s'. ErrorFailedToCreateDatabase=Failed to create database '%s'. ErrorFailedToConnectToDatabase=Failed to connect to database '%s'. +ErrorDatabaseVersionTooLow=Database version (%s) too old. Version %s or higher is required. ErrorPHPVersionTooLow=PHP version too old. Version %s is required. WarningPHPVersionTooLow=PHP version too old. Version %s or more is expected. This version should allow install but is not supported. ErrorConnectedButDatabaseNotFound=Connection to server successfull but database '%s' not found. diff --git a/htdocs/langs/fr_FR/install.lang b/htdocs/langs/fr_FR/install.lang index 83553a53b5b..2dd0216fbc8 100644 --- a/htdocs/langs/fr_FR/install.lang +++ b/htdocs/langs/fr_FR/install.lang @@ -26,6 +26,7 @@ ErrorGoBackAndCorrectParameters=Revenez en arrière et corrigez les paramètres ErrorWrongValueForParameter=Vous avez peut-être saisi une mauvaise valeur pour le paramètre '%s'. ErrorFailedToCreateDatabase=Echec de création de la base '%s'. ErrorFailedToConnectToDatabase=Echec de connexion à la base '%s'. +ErrorDatabaseVersionTooLow=Version de base de donnée (%s) trop ancienne. La version %s ou supérieure est requise. ErrorPHPVersionTooLow=Version de PHP trop ancienne. La version %s est requise. WarningPHPVersionTooLow=Version de PHP trop ancienne. La version %s ou plus est recommandée. Cette version reste utilisable mais n'est pas supportée. ErrorConnectedButDatabaseNotFound=Connexion au serveur réussi mais base '%s' introuvable.