Skip to content

Commit

Permalink
Merge branch '8.0' into 7.0_new_dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 29, 2018
2 parents 88044a3 + d40e1a0 commit a8bb55c
Show file tree
Hide file tree
Showing 5,171 changed files with 255,322 additions and 70,407 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -24,3 +24,4 @@ Thumbs.db
htdocs/includes/autoload.php
htdocs/includes/bin/
htdocs/includes/composer/
/.pydevproject
245 changes: 126 additions & 119 deletions .travis.yml
Expand Up @@ -2,8 +2,8 @@
# from Dolibarr GitHub repository.
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/

# We use dist: precise to have php 5.3 available
dist: precise
# We use dist: trusty to have php 5.4+ available
dist: trusty
sudo: required

language: php
Expand Down Expand Up @@ -31,7 +31,6 @@ addons:
- pgloader

php:
- '5.3'
- '5.4'
- '5.5'
- '5.6'
Expand Down Expand Up @@ -64,8 +63,6 @@ matrix:
- php: nightly
# We exclude some combinations not usefull to save Travis CPU
exclude:
- php: '5.4'
env: DB=postgresql
- php: '5.5'
env: DB=postgresql
- php: '5.6'
Expand Down Expand Up @@ -123,7 +120,7 @@ install:
- |
echo "Installing PHP Unit"
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
if [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
composer -n require phpunit/phpunit ^4
fi
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then
Expand All @@ -143,137 +140,143 @@ install:
echo "Adding path of binaries tools installed by composer to the PATH"
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
echo
before_script:
- |
echo Start travis
echo Current dir is `pwd`
echo Home dir is `echo ~`
echo TRAVIS_BUILD_DIR is $TRAVIS_BUILD_DIR
- |
echo "Re-enabling Xdebug for PHP CodeSniffer and PHP Unit"
phpenv config-add /tmp/xdebug.ini
echo
- |
echo "Setting up PHP"
echo
echo "Set timezone"
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
#echo
#echo "Enabling APC for PHP <= 5.4"
# Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
#echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
before_script:
- |
echo Start travis
echo Current dir is `pwd`
echo Home dir is `echo ~`
echo TRAVIS_BUILD_DIR is $TRAVIS_BUILD_DIR
- |
echo "Re-enabling Xdebug for PHP CodeSniffer and PHP Unit"
phpenv config-add /tmp/xdebug.ini
echo
echo "Enabling Memcached for PHP <= 5.4"
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1, 7.2 and nightly!
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
phpenv rehash
echo
- |
if [ "$DEBUG" = true ]; then
echo "Debugging informations"
- |
echo "Setting up PHP"
echo
echo "Set timezone"
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
#echo
#echo "Enabling APC for PHP <= 5.4"
# Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
#echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
echo
echo "Enabling Memcached for PHP <= 5.4"
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1, 7.2 and nightly!
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
phpenv rehash
echo
- |
echo "Versions information"
# Check PHP
php -i
echo "PHP version"
php -i | head -
# Check PHP CodeSniffer installation
echo "PHPCS version"
which phpcs
phpcs --version
phpcs -i
phpcs --version | head -
phpcs -i | head -
# Check PHPUnit installation
echo "PHPUnit version"
which phpunit
phpunit --version
# Check MySQL
mysql --version
mysql -e "SELECT VERSION();"
phpunit --version | head -
# Check Apache version
echo "Apache version"
apache2 -v | head -
# Check MariaDb
echo "MariaDb version"
mysql --version | head -
mysql -e "SELECT VERSION();" | head -
echo
fi
- |
echo "Setting up database"
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
echo "MySQL"
mysql -e 'DROP DATABASE IF EXISTS travis;'
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
mysql -e 'FLUSH PRIVILEGES;'
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
fi
if [ "$DB" = 'postgresql' ]; then
#pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
#pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr
pgloader mysql://root@127.0.0.1/travis postgresql:///travis
fi
# TODO: SQLite
echo
- |
echo "Setting up database"
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
echo "MySQL"
mysql -e 'DROP DATABASE IF EXISTS travis;'
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
mysql -e 'FLUSH PRIVILEGES;'
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
fi
if [ "$DB" = 'postgresql' ]; then
#pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
#pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr
pgloader mysql://root@127.0.0.1/travis postgresql:///travis
fi
# TODO: SQLite
echo
- |
export CONF_FILE=htdocs/conf/conf.php
echo "Setting up Dolibarr $CONF_FILE"
echo '<?php ' > $CONF_FILE
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE
echo '$'dolibarr_main_db_host=\'127.0.0.1\'';' >> $CONF_FILE
echo '$'dolibarr_main_db_name=\'travis\'';' >> $CONF_FILE
echo '$'dolibarr_main_db_user=\'travis\'';' >> $CONF_FILE
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE
fi
if [ "$DB" = 'postgresql' ]; then
echo '$'dolibarr_main_db_type=\'pgsql\'';' >> $CONF_FILE
fi
# TODO: SQLite
echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE
cat $CONF_FILE
echo
- |
export CONF_FILE=htdocs/conf/conf.php
echo "Setting up Dolibarr $CONF_FILE"
echo '<?php ' > $CONF_FILE
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE
echo '$'dolibarr_main_db_host=\'127.0.0.1\'';' >> $CONF_FILE
echo '$'dolibarr_main_db_name=\'travis\'';' >> $CONF_FILE
echo '$'dolibarr_main_db_user=\'travis\'';' >> $CONF_FILE
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE
fi
if [ "$DB" = 'postgresql' ]; then
echo '$'dolibarr_main_db_type=\'pgsql\'';' >> $CONF_FILE
fi
# TODO: SQLite
echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE
cat $CONF_FILE
echo
- |
echo "Create documents directory and set permissions"
# and admin/temp subdirectory needed for unit tests
mkdir -p documents/admin/temp
echo "first line" > documents/dolibarr.log
echo
- |
echo "Create documents directory and set permissions"
# and admin/temp subdirectory needed for unit tests
mkdir -p documents/admin/temp
echo "first line" > documents/dolibarr.log
echo
- |
echo "Setting up Apache + FPM"
- echo "Setting up Apache + FPM"
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi
# enable php-fpm
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
# Copy the included pool
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
fi
if [ "$DEBUG" = true ]; then
cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
fi
sudo a2enmod rewrite actions fastcgi alias
echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$DEBUG" = true ]; then
cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
fi
~/.phpenv/versions/$PHP_VERSION_NAME/sbin/php-fpm
# configure apache virtual hosts
sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/default
sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/apache2/sites-available/default
if [ "$DEBUG" = true ]; then
sudo cat /etc/apache2/sites-available/default
fi
sudo service apache2 restart
echo
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- |
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
# Copy the included pool
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
fi
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts for precise
#- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
#- sudo cat /etc/apache2/sites-available/default
# configure apache virtual hosts for trusty
- sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo cat /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart



script:
- |
echo "Checking webserver availability"
echo "Checking webserver availability by a wget -O - http://127.0.0.1"
# Ensure we catch errors
set -e
wget http://127.0.0.1
if [ "$DEBUG" = true ]; then
cat index.html
fi
# The wget should return a page with line '<meta name="generator" content="Dolibarr installer">
wget -O - http://127.0.0.1 > test.html
head test.html
set +e
echo
Expand All @@ -290,7 +293,8 @@ script:
# Ensure we catch errors
set -e
# Exclusions are defined in the ruleset.xml file
phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
#phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
phpcs -s -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
set +e
echo
Expand Down Expand Up @@ -327,18 +331,21 @@ script:
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade600700.log
php upgrade2.php 6.0.0 7.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade600700-2.log
php step5.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-3.log
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade700800.log
php upgrade2.php 7.0.0 8.0.0 MAIN_MODULE_TICKETSUP > $TRAVIS_BUILD_DIR/upgrade700800-2.log
php step5.php 7.0.0 8.0.0 > $TRAVIS_BUILD_DIR/upgrade700800-3.log
cd -
set +e
echo
#cat $TRAVIS_BUILD_DIR/upgrade400500-2.log
#cat $TRAVIS_BUILD_DIR/upgrade500600.log
#cat $TRAVIS_BUILD_DIR/upgrade500600-2.log
#cat $TRAVIS_BUILD_DIR/upgrade500600-3.log
#cat /tmp/dolibarr_install.log
#cat $TRAVIS_BUILD_DIR/upgrade600700-2.log
cat /tmp/dolibarr_install.log
- |
echo "Unit testing"
phpunit --version
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
set -e
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
Expand Down
18 changes: 12 additions & 6 deletions .tx/config
Expand Up @@ -20,6 +20,12 @@ source_file = htdocs/langs/en_US/agenda.lang
source_lang = en_US
type = MOZILLAPROPERTIES

[dolibarr.assets]
file_filter = htdocs/langs/<lang>/assets.lang
source_file = htdocs/langs/en_US/assets.lang
source_lang = en_US
type = MOZILLAPROPERTIES

[dolibarr.banks]
file_filter = htdocs/langs/<lang>/banks.lang
source_file = htdocs/langs/en_US/banks.lang
Expand Down Expand Up @@ -152,12 +158,6 @@ source_file = htdocs/langs/en_US/hrm.lang
source_lang = en_US
type = MOZILLAPROPERTIES

[dolibarr.incoterm]
file_filter = htdocs/langs/<lang>/incoterm.lang
source_file = htdocs/langs/en_US/incoterm.lang
source_lang = en_US
type = MOZILLAPROPERTIES

[dolibarr.install]
file_filter = htdocs/langs/<lang>/install.lang
source_file = htdocs/langs/en_US/install.lang
Expand Down Expand Up @@ -356,6 +356,12 @@ source_file = htdocs/langs/en_US/supplier_proposal.lang
source_lang = en_US
type = MOZILLAPROPERTIES

[dolibarr.ticket]
file_filter = htdocs/langs/<lang>/ticket.lang
source_file = htdocs/langs/en_US/ticket.lang
source_lang = en_US
type = MOZILLAPROPERTIES

[dolibarr.trips]
file_filter = htdocs/langs/<lang>/trips.lang
source_file = htdocs/langs/en_US/trips.lang
Expand Down

0 comments on commit a8bb55c

Please sign in to comment.