Skip to content

Commit

Permalink
Merge pull request #113 from semsol/2.4
Browse files Browse the repository at this point in the history
New release: 2.4
  • Loading branch information
semsol authored Aug 13, 2018
2 parents b385e70 + 2ee2941 commit e65a33d
Show file tree
Hide file tree
Showing 296 changed files with 12,370 additions and 8,100 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ return PhpCsFixer\Config::create()
->setFinder(
PhpCsFixer\Finder::create()
->files()
->in(__DIR__ . '/parsers')
->in(__DIR__ . '/serializers')
->in(__DIR__ . '/src')
->in(__DIR__ . '/store')
->name('*.php')
);
192 changes: 172 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,193 @@
sudo: required

language: php
dist: trusty

php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- nightly
services:
- docker

matrix:
fast_finish: true
include:
- php: hhvm
allow_failures:
- php: nightly
- php: hhvm
#
# Define versions of MySQL and MariaDB to test against.
#
# For each DB version also tests with different adapters are run (mysqli, PDO).
#
#
# mysql 5.5
#
- php: 5.6
env: DB=mysql:5.5 DB_ADAPTER=mysqli
- php: 5.6
env: DB=mysql:5.5 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.0
env: DB=mysql:5.5 DB_ADAPTER=mysqli
- php: 7.0
env: DB=mysql:5.5 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.1
env: DB=mysql:5.5 DB_ADAPTER=mysqli
- php: 7.1
env: DB=mysql:5.5 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.2
env: DB=mysql:5.5 DB_ADAPTER=mysqli
- php: 7.2
env: DB=mysql:5.5 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
#
# mysql 5.6
#
- php: 5.6
env: DB=mysql:5.6 DB_ADAPTER=mysqli
- php: 5.6
env: DB=mysql:5.6 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.0
env: DB=mysql:5.6 DB_ADAPTER=mysqli
- php: 7.0
env: DB=mysql:5.6 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.1
env: DB=mysql:5.6 DB_ADAPTER=mysqli
- php: 7.1
env: DB=mysql:5.6 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.2
env: DB=mysql:5.6 DB_ADAPTER=mysqli
- php: 7.2
env: DB=mysql:5.6 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
#
# mysql 5.7
#
- php: 5.6
env: DB=mysql:5.7 DB_ADAPTER=mysqli
- php: 5.6
env: DB=mysql:5.7 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 5.6
env: DB=mysql:5.7 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql CACHE_ENABLED=true
- php: 7.0
env: DB=mysql:5.7 DB_ADAPTER=mysqli
- php: 7.0
env: DB=mysql:5.7 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.0
env: DB=mysql:5.7 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql CACHE_ENABLED=true
- php: 7.1
env: DB=mysql:5.7 DB_ADAPTER=mysqli
- php: 7.1
env: DB=mysql:5.7 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.1
env: DB=mysql:5.7 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql CACHE_ENABLED=true
- php: 7.2
env: DB=mysql:5.7 DB_ADAPTER=mysqli
- php: 7.2
env: DB=mysql:5.7 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.2
env: DB=mysql:5.7 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql CACHE_ENABLED=true
#
# mariadb 10
#
- php: 5.6
env: DB=mariadb:10.0 DB_ADAPTER=mysqli
- php: 5.6
env: DB=mariadb:10.0 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.0
env: DB=mariadb:10.0 DB_ADAPTER=mysqli
- php: 7.0
env: DB=mariadb:10.0 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.1
env: DB=mariadb:10.0 DB_ADAPTER=mysqli
- php: 7.1
env: DB=mariadb:10.0 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.2
env: DB=mariadb:10.0 DB_ADAPTER=mysqli
- php: 7.2
env: DB=mariadb:10.0 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
#
# mariadb 10.1
#
- php: 5.6
env: DB=mariadb:10.1 DB_ADAPTER=mysqli
- php: 5.6
env: DB=mariadb:10.1 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.0
env: DB=mariadb:10.1 DB_ADAPTER=mysqli
- php: 7.0
env: DB=mariadb:10.1 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.1
env: DB=mariadb:10.1 DB_ADAPTER=mysqli
- php: 7.1
env: DB=mariadb:10.1 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.2
env: DB=mariadb:10.1 DB_ADAPTER=mysqli
- php: 7.2
env: DB=mariadb:10.1 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
#
# mariadb 10.2
#
- php: 5.6
env: DB=mariadb:10.2 DB_ADAPTER=mysqli
- php: 5.6
env: DB=mariadb:10.2 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.0
env: DB=mariadb:10.2 DB_ADAPTER=mysqli
- php: 7.0
env: DB=mariadb:10.2 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.1
env: DB=mariadb:10.2 DB_ADAPTER=mysqli
- php: 7.1
env: DB=mariadb:10.2 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.2
env: DB=mariadb:10.2 DB_ADAPTER=mysqli
- php: 7.2
env: DB=mariadb:10.2 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
#
# mariadb 10.3
#
- php: 5.6
env: DB=mariadb:10.3 DB_ADAPTER=mysqli
- php: 5.6
env: DB=mariadb:10.3 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 5.6
env: DB=mariadb:10.3 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql CACHE_ENABLED=true
- php: 7.0
env: DB=mariadb:10.3 DB_ADAPTER=mysqli
- php: 7.0
env: DB=mariadb:10.3 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.0
env: DB=mariadb:10.3 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql CACHE_ENABLED=true
- php: 7.1
env: DB=mariadb:10.3 DB_ADAPTER=mysqli
- php: 7.1
env: DB=mariadb:10.3 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.1
env: DB=mariadb:10.3 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql CACHE_ENABLED=true
- php: 7.2
env: DB=mariadb:10.3 DB_ADAPTER=mysqli
- php: 7.2
env: DB=mariadb:10.3 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql
- php: 7.2
env: DB=mariadb:10.3 DB_ADAPTER=pdo DB_PDO_PROTOCOL=mysql CACHE_ENABLED=true

git:
depth: 1

cache:
directories:
- $HOME/.composer
- $HOME/bin
directories:
- $HOME/.composer/cache/files

sudo: false
before_script:
#
# install and init database (see matrix => include => env)
#
- ./.travis/install-and-init-db.sh

before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS testdb;'
#
# setup and run tests
#
# Install composer packages, will also trigger dump-autoload
- travis_retry composer install --no-interaction
- travis_retry composer install --no-interaction --prefer-dist
# Install coveralls.phar
- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
- wget -c -nc --retry-connrefused --tries=0 https://github.com/satooshi/php-coveralls/releases/download/v1.1.0/coveralls.phar
- chmod +x coveralls.phar
- php coveralls.phar --version

script: vendor/bin/phpunit --coverage-clover gen/coverage/clover.xml
script:
- vendor/bin/phpunit --coverage-clover gen/coverage/clover.xml

after_success:
# Submit coverage report to Coveralls servers, see .coveralls.yml
Expand Down
55 changes: 55 additions & 0 deletions .travis/install-and-init-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

#
# acknowledgement:
# copied from https://github.com/PyMySQL/PyMySQL/blob/master/.travis/initializedb.sh
#

# debug
set -x
# verbose
set -v

if [ ! -z "${DB}" ]; then
# disable existing database server in case of accidential connection
sudo service mysql stop

docker pull ${DB}
docker run -it --name=mysqld -d -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -p 3306:3306 ${DB}
sleep 10

mysql() {
docker exec mysqld mysql "${@}"
}
while :
do
sleep 5
mysql -e 'select version()'
if [ $? = 0 ]; then
break
fi
echo "server logs"
docker logs --tail 5 mysqld
done

mysql -e 'select VERSION()'

if [ $DB == 'mysql:8.0' ]; then
WITH_PLUGIN='with mysql_native_password'
mysql -e 'SET GLOBAL local_infile=on'
docker cp mysqld:/var/lib/mysql/public_key.pem "${HOME}"
docker cp mysqld:/var/lib/mysql/ca.pem "${HOME}"
docker cp mysqld:/var/lib/mysql/server-cert.pem "${HOME}"
docker cp mysqld:/var/lib/mysql/client-key.pem "${HOME}"
docker cp mysqld:/var/lib/mysql/client-cert.pem "${HOME}"
else
WITH_PLUGIN=''
fi

mysql -uroot -e 'create database testdb DEFAULT CHARACTER SET utf8mb4'
else
cat ~/.my.cnf

mysql -e 'select VERSION()'
mysql -e 'create database testdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;'
fi
Loading

0 comments on commit e65a33d

Please sign in to comment.