diff --git a/.travis.yml b/.travis.yml
index 26d4c64fef2..70c20af872d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -56,7 +56,7 @@ before_script:
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
- - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
+ - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.4.0.sql; fi"
- echo Create config file htdocs/conf/conf.php
- echo ' htdocs/conf/conf.php
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
@@ -84,13 +84,14 @@ before_script:
script:
+ - cd htdocs/install; php upgrade.php 3.4.0 3.5.0
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php
# - phpcs --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php
- - phpcs --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ .
+# - phpcs --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ .
# - phpcs --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ .
- - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php
+# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php
after_script:
# - echo Output dolibarr log file; cat $(pwd)/htdocs/documents/dolibarr.log
diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php
index 904144cad66..ccb19aa352a 100644
--- a/htdocs/install/upgrade.php
+++ b/htdocs/install/upgrade.php
@@ -365,47 +365,54 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
}
}
- // Loop on each migrate files
- foreach($filelist as $file)
+ if (count($filelist) == 0)
{
- print '
|
';
- print '| '.$langs->trans("ChoosedMigrateScript").' | '.$file.' |
'."\n";
-
- // Run sql script
- $ok=run_sql($dir.$file, 0, '', 1);
-
- // Scan if there is migration scripts for modules htdocs/module/sql or htdocs/custom/module/sql
- $modulesfile = array();
- foreach ($conf->file->dol_document_root as $type => $dirroot)
- {
- $handlemodule=@opendir($dirroot); // $dirroot may be '..'
- if (is_resource($handlemodule))
- {
- while (($filemodule = readdir($handlemodule))!==false)
- {
- if (! preg_match('/\./',$filemodule) && is_dir($dirroot.'/'.$filemodule.'/sql')) // We exclude filemodule that contains . (are not directories) and are not directories.
- {
- //print "Scan for ".$dirroot . '/' . $filemodule . '/sql/'.$file;
- if (is_file($dirroot . '/' . $filemodule . '/sql/'.$file))
- {
- $modulesfile[$dirroot . '/' . $filemodule . '/sql/'.$file] = '/' . $filemodule . '/sql/'.$file;
- }
- }
- }
- closedir($handlemodule);
- }
- }
-
- foreach ($modulesfile as $modulefilelong => $modulefileshort)
- {
- print '
|
';
- print '| '.$langs->trans("ChoosedMigrateScript").' (external modules) | '.$modulefileshort.' |
'."\n";
+ print ''.$langs->trans("ErrorNoMigrationFilesFoundForParameters").'
';
+ }
+ else
+ {
+ // Loop on each migrate files
+ foreach($filelist as $file)
+ {
+ print '
|
';
+ print '| '.$langs->trans("ChoosedMigrateScript").' | '.$file.' |
'."\n";
// Run sql script
- $okmodule=run_sql($modulefilelong, 0, '', 1); // Note: Result of migration of external module should not decide if we continue migration of Dolibarr or not.
- }
+ $ok=run_sql($dir.$file, 0, '', 1);
- }
+ // Scan if there is migration scripts for modules htdocs/module/sql or htdocs/custom/module/sql
+ $modulesfile = array();
+ foreach ($conf->file->dol_document_root as $type => $dirroot)
+ {
+ $handlemodule=@opendir($dirroot); // $dirroot may be '..'
+ if (is_resource($handlemodule))
+ {
+ while (($filemodule = readdir($handlemodule))!==false)
+ {
+ if (! preg_match('/\./',$filemodule) && is_dir($dirroot.'/'.$filemodule.'/sql')) // We exclude filemodule that contains . (are not directories) and are not directories.
+ {
+ //print "Scan for ".$dirroot . '/' . $filemodule . '/sql/'.$file;
+ if (is_file($dirroot . '/' . $filemodule . '/sql/'.$file))
+ {
+ $modulesfile[$dirroot . '/' . $filemodule . '/sql/'.$file] = '/' . $filemodule . '/sql/'.$file;
+ }
+ }
+ }
+ closedir($handlemodule);
+ }
+ }
+
+ foreach ($modulesfile as $modulefilelong => $modulefileshort)
+ {
+ print '
|
';
+ print '| '.$langs->trans("ChoosedMigrateScript").' (external modules) | '.$modulefileshort.' |
'."\n";
+
+ // Run sql script
+ $okmodule=run_sql($modulefilelong, 0, '', 1); // Note: Result of migration of external module should not decide if we continue migration of Dolibarr or not.
+ }
+
+ }
+ }
}
print '';