Skip to content

Commit 722ad6b

Browse files
authored
Feature/php71 (#53)
- Removed: support for lesser then php7 - Added: strong and string types - Changed: ConfigFactory removed and method make form array moved to Config - Changed: MariaDbGtidLogDTO replaced getSequenceNumber with getMariaDbGtid - Fixed: Insert NULL in a boolean column returns no rows - Fixed: float problem about time field type - Fixed: column order - Changed: getFields and getMasterStatus returns no VO - Changed: Column to ColumnDTO and added ColumnDTOCollection - Changed: replaced getFields with getColumnDTOCollection in TableMap - Added: more compatibility for mysql 5.5, 5.6, 5.7, maria 10 and 8.0 - Removed: makeConfigFromArray
1 parent 966d858 commit 722ad6b

File tree

87 files changed

+2265
-3920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2265
-3920
lines changed

.travis.yml

+42-47
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,54 @@
1-
dist: trusty
1+
dist: xenial
22

33
language: php
44

5-
php:
6-
- 5.6
7-
- 7.0
8-
- 7.1
9-
- 7.2
10-
env:
11-
- DB=mysql57
12-
- DB=mysql56
13-
- DB=mariadb
14-
15-
cache:
16-
apt: true
5+
cache:
176
bundler: true
187
directories:
198
- $HOME/.composer/cache
209

2110
sudo: required
2211

23-
before_script:
24-
- "sudo /etc/init.d/mysql stop || true"
25-
- "sudo apt-get remove mysql* -y --purge"
26-
- "if [ $DB = 'mysql57' ]; then echo deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7 | sudo tee /etc/apt/sources.list.d/mysql.list; sudo apt-get update; sudo apt-get install mysql-server -y --allow-unauthenticated; fi"
27-
- "if [ $DB = 'mysql56' ]; then echo deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.6 | sudo tee /etc/apt/sources.list.d/mysql.list; sudo apt-get update; sudo apt-get install mysql-server -y --allow-unauthenticated; fi"
28-
- "if [ $DB = 'mariadb' ]; then sudo rm -rf /var/lib/mysql /etc/mysql; echo deb http://ftp.hosteurope.de/mirror/mariadb.org/repo/10.3/ubuntu trusty main | sudo tee /etc/apt/sources.list.d/mysql.list; sudo apt-get update; sudo apt-get install mariadb-server-10.3 -y --allow-unauthenticated; fi"
29-
- "sudo mysql_upgrade --force"
30-
31-
# Config
32-
- "echo '[mysqld]' | sudo tee /etc/mysql/conf.d/replication.cnf"
33-
- "echo 'log-bin=mysql-bin' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
34-
- "echo 'server-id=1' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
35-
- "echo 'binlog-format= row' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
36-
- "echo 'max_allowed_packet= 64M' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
37-
- "echo 'innodb_log_file_size= 250M' | sudo tee -a /etc/mysql/conf.d/replication.cnf"
38-
- "cat /etc/mysql/conf.d/replication.cnf"
39-
40-
# Enable GTID (only for mysql 5.*)
41-
- "if [ $DB != 'mariadb' ]; then echo '[mysqld]' | sudo tee /etc/mysql/conf.d/gtid.cnf; echo 'gtid_mode=ON' | sudo tee -a /etc/mysql/conf.d/gtid.cnf; echo 'enforce_gtid_consistency' | sudo tee -a /etc/mysql/conf.d/gtid.cnf; echo 'binlog_format=ROW' | sudo tee -a /etc/mysql/conf.d/gtid.cnf; echo 'log_slave_updates' | sudo tee -a /etc/mysql/conf.d/gtid.cnf; cat /etc/mysql/conf.d/gtid.cnf; fi"
12+
services:
13+
- docker
14+
15+
matrix:
16+
include:
17+
- env:
18+
- DB=mariadb:5.5
19+
php: "7.1"
20+
- env:
21+
- DB=mysql:5.5
22+
php: "7.1"
23+
- env:
24+
- DB=mysql:5.6
25+
php: "7.1"
26+
- env:
27+
- DB=mysql:5.7
28+
php: "7.1"
29+
- env:
30+
- DB=mysql:8.0
31+
- TEST_AUTH=yes
32+
php: "7.1"
33+
- env:
34+
- DB=mariadb:5.5
35+
php: "7.2"
36+
- env:
37+
- DB=mysql:5.5
38+
php: "7.2"
39+
- env:
40+
- DB=mysql:5.6
41+
php: "7.2"
42+
- env:
43+
- DB=mysql:5.7
44+
php: "7.2"
45+
- env:
46+
- DB=mysql:8.0
47+
- TEST_AUTH=yes
48+
php: "7.2"
4249

43-
# Start mysql (avoid errors to have logs)/var/lib/mysql
44-
- "sudo /etc/init.d/mysql restart || true"
45-
- "sudo tail -1000 /var/log/syslog"
46-
47-
- "mysql --version"
48-
- "mysql -u root -e 'SELECT VERSION();'"
49-
- "mysql -u root -e \"GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';\""
50-
- "mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql -u root mysql"
51-
52-
- if [ $DB = 'mysql56' ]; then echo "USE mysql;\nUPDATE user SET password=PASSWORD('root') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root; fi
53-
- if [ $DB = 'mysql57' ]; then echo "USE mysql;\nUPDATE user SET authentication_string=PASSWORD('root') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root; fi
54-
- if [ $DB = 'mariadb' ]; then echo "USE mysql;\nUPDATE user SET password=PASSWORD('root') WHERE User='root';\nFLUSH PRIVILEGES;\n" | mysql -u root; fi
50+
before_script:
51+
- ./.travis/initializedb.sh
5552

5653
install:
57-
travis_retry composer install --no-interaction --prefer-source;
58-
59-
script: vendor/bin/phpunit
54+
travis_retry composer install --no-interaction --prefer-source;

.travis/initializedb.sh

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
if [ $DB == 'mysql:8.0' ]; then
6+
docker run -p 0.0.0.0:3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ROOT_HOST=% --name=mysql -d ${DB} \
7+
mysqld \
8+
--datadir=/var/lib/mysql \
9+
--user=mysql \
10+
--server-id=1 \
11+
--log-bin=/var/lib/mysql/mysql-bin.log \
12+
--binlog-format=row \
13+
--max_allowed_packet=64M \
14+
--default_authentication_plugin=mysql_native_password
15+
else
16+
docker run -p 0.0.0.0:3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ROOT_HOST=% --name=mysql -d ${DB} \
17+
mysqld \
18+
--datadir=/var/lib/mysql \
19+
--user=mysql \
20+
--server-id=1 \
21+
--log-bin=/var/lib/mysql/mysql-bin.log \
22+
--binlog-format=row \
23+
--max_allowed_packet=64M
24+
fi
25+
26+
mysql() {
27+
docker exec mysql mysql -proot "${@}"
28+
}
29+
while :
30+
do
31+
sleep 3
32+
mysql --protocol=tcp -e 'select version()' && break
33+
done
34+
35+
docker logs mysql
36+

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Release Notes
22

3+
## v6.0.0 (2019-?????)
4+
- Removed: support for lesser then php7
5+
- Added: strong and string types
6+
- Changed: ConfigFactory removed and method make form array moved to Config
7+
- Changed: MariaDbGtidLogDTO replaced getSequenceNumber with getMariaDbGtid
8+
- Fixed: Insert NULL in a boolean column returns no rows
9+
- Fixed: float problem about time field type
10+
- Fixed: column order
11+
- Changed: getFields and getMasterStatus returns no VO
12+
- Changed: Column to ColumnDTO and added ColumnDTOCollection
13+
- Changed: replaced getFields with getColumnDTOCollection in TableMap
14+
- Added: more compatibility for mysql 5.5, 5.6, 5.7, maria 10 and 8.0
15+
- Removed: makeConfigFromArray
16+
317
## v5.0.6 (2019-02-05)
418
- Fixed json with slash (#48)
519
- Fixed disabling events that are needed (#46)

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ git clone https://github.com/krowinski/php-mysql-replication.git
2727
composer install -o
2828
```
2929

30+
Compatibility (based on integration tests)
31+
=========
32+
- mysql 5.5
33+
- mysql 5.6
34+
- mysql 5.7
35+
- mysql 8.0 (ONLY with mysql_native_password)
36+
- mariadb 5.5
37+
- mariadb 10.0 (partaily, problem with some cases of TIMESTAMP)
38+
- probably percona versions as is based on native mysql
39+
3040
MySQL server settings
3141
=========
3242

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"type": "library",
1515
"require": {
16-
"php": ">=5.6",
16+
"php": ">=7.1",
1717
"ext-sockets": "*",
1818
"ext-json": "*",
1919
"ext-bcmath": "*",
@@ -24,7 +24,7 @@
2424
"psr/simple-cache": "^1.0"
2525
},
2626
"require-dev": {
27-
"phpunit/phpunit": "^5.7"
27+
"phpunit/phpunit": "^7.0"
2828
},
2929
"license": "MIT",
3030
"authors": [

0 commit comments

Comments
 (0)