Skip to content

Commit 87fddf2

Browse files
authored
Merge pull request #1 from tworzenieweb/php7.4
Php7.4
2 parents 88f04d7 + 47b2c5a commit 87fddf2

File tree

188 files changed

+492
-403
lines changed

Some content is hidden

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

188 files changed

+492
-403
lines changed

.travis.yml

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,10 @@
11
language: php
2-
dist: trusty
32

43
branches:
54
only:
6-
- 1.6
7-
- master
8-
- gh-pages
5+
- php7.4
96

10-
php:
11-
- 5.4
12-
- 5.5
13-
- hhvm
7+
services: docker
148

15-
env:
16-
- DB=mysql DB_USER=root
17-
18-
before_script:
19-
# MySQL
20-
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS test; DROP SCHEMA IF EXISTS second_hand_books; DROP SCHEMA IF EXISTS contest; DROP DATABASE IF EXISTS reverse_bookstore; DROP SCHEMA IF EXISTS bookstore_schemas; SET FOREIGN_KEY_CHECKS = 1;'; fi"
21-
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE test; CREATE SCHEMA bookstore_schemas; CREATE SCHEMA contest; CREATE SCHEMA second_hand_books; CREATE DATABASE reverse_bookstore;'; fi"
22-
23-
# Composer
24-
- wget http://getcomposer.org/composer.phar
25-
- php composer.phar install --prefer-source
26-
27-
- ./test/reset_tests.sh
28-
29-
script: vendor/bin/phpunit
30-
31-
matrix:
32-
include:
33-
- php: 5.3
34-
dist: precise
35-
allow_failures:
36-
- php: hhvm
9+
script:
10+
bash docker/run.sh

composer.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@
1414
},
1515
"include-path": ["runtime/lib", "generator/lib"],
1616
"require": {
17-
"php": ">=5.2.4",
17+
"php": "^7.1",
1818
"phing/phing": "~2.4"
19+
1920
},
2021
"require-dev": {
21-
"pear-pear.php.net/PEAR_PackageFileManager2": "@stable",
22-
"phpunit/phpunit": "~4.0||~5.0"
22+
"pear-pear.php.net/pear_packagefilemanager2": "@stable",
23+
"phpunit/phpunit": "^9.0.0",
24+
"phpcompatibility/php-compatibility": "^9.3",
25+
"squizlabs/php_codesniffer": "^3.5"
2326
},
2427
"extra": {
2528
"branch-alias": {
@@ -32,5 +35,9 @@
3235
"url": "https://pear.php.net"
3336
}
3437
],
35-
"bin": ["generator/bin/propel-gen", "generator/bin/propel-gen.bat"]
38+
"bin": ["generator/bin/propel-gen", "generator/bin/propel-gen.bat"],
39+
"scripts": {
40+
"post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",
41+
"post-update-cmd" : "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility"
42+
}
3643
}

docker/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM thecodingmachine/php:7.4-v3-cli
2+
USER root
3+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
4+
5+
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
6+
dpkg-reconfigure --frontend=noninteractive locales && \
7+
update-locale LANG=en_US.UTF-8
8+
9+
USER docker
10+
ENV LANG en_US.UTF-8
11+

docker/docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: '3'
2+
services:
3+
php:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
working_dir: /usr/src/app
8+
command: phpunit
9+
volumes:
10+
- ../:/usr/src/app
11+
environment:
12+
- PHP_EXTENSIONS=intl pdo_sqlite sqlite3
13+
- STARTUP_COMMAND_1=composer install
14+
- STARTUP_COMMAND_2=bash test/reset_tests.sh
15+
16+
db:
17+
image: percona
18+
command: >
19+
mysqld
20+
--sql-mode="NO_ENGINE_SUBSTITUTION"
21+
--character-set-server="utf8"
22+
--collation-server="utf8_unicode_ci"
23+
--default-authentication-plugin=mysql_native_password
24+
restart: always
25+
environment:
26+
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'

docker/reset.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
mysql -u root -e 'SET FOREIGN_KEY_CHECKS = 0; DROP DATABASE IF EXISTS test; DROP SCHEMA IF EXISTS second_hand_books; DROP SCHEMA IF EXISTS contest; DROP DATABASE IF EXISTS reverse_bookstore; DROP SCHEMA IF EXISTS bookstore_schemas; SET FOREIGN_KEY_CHECKS = 1;'
4+
mysql -u root -e 'CREATE DATABASE test; CREATE SCHEMA bookstore_schemas; CREATE SCHEMA contest; CREATE SCHEMA second_hand_books; CREATE DATABASE reverse_bookstore;'

docker/run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
cd docker
3+
docker-compose up -d db
4+
sleep 20
5+
docker-compose exec -T db bash < reset.sh
6+
docker-compose build
7+
docker-compose run php

generator/lib/builder/om/PHP5ObjectBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,9 @@ protected function addLazyLoaderBody(&$script, Column $col)
14111411
try {
14121412
\$stmt = " . $this->getPeerClassname() . "::doSelectStmt(\$c, \$con);
14131413
\$row = \$stmt->fetch(PDO::FETCH_NUM);
1414+
if (\$row === false) {
1415+
\$row = [null]; // for backward compatibility
1416+
}
14141417
\$stmt->closeCursor();";
14151418
}
14161419

generator/lib/builder/om/PHP5ObjectNoCollectionBuilder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ protected function addLazyLoaderBody(&$script, Column $col)
111111
try {
112112
\$stmt = " . $this->getPeerClassname() . "::doSelectStmt(\$c, \$con);
113113
\$row = \$stmt->fetch(PDO::FETCH_NUM);
114+
if (\$row === false) {
115+
\$row = [null]; // for backward compatibility
116+
}
114117
\$stmt->closeCursor();";
115118

116119
if ($col->getType() === PropelTypes::CLOB && $this->getPlatform() instanceof OraclePlatform) {

generator/lib/builder/om/PHP5PeerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ public static function getPrimaryKeyFromRow(\$row, \$startcol = 0)
12001200
if ($table->hasCompositePrimaryKey()) {
12011201
$script .= "
12021202
1203-
return array(" . implode($pks, ', ') . ");";
1203+
return array(" . implode(', ', $pks) . ");";
12041204
} else {
12051205
$script .= "
12061206

generator/lib/builder/om/QueryBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,10 @@ protected function addFindPk(&$script)
415415
}
416416
$pkType = 'array';
417417
$pkDescription = "
418-
A Primary key composition: " . '[' . join($colNames, ', ') . ']';
418+
A Primary key composition: " . '[' . join(', ', $colNames) . ']';
419419
$script .= "
420420
* <code>
421-
* \$obj = \$c->findPk(array(" . join($examplePk, ', ') . "), \$con);";
421+
* \$obj = \$c->findPk(array(" . join(', ', $examplePk) . "), \$con);";
422422
} else {
423423
$pkType = 'mixed';
424424
$script .= "

0 commit comments

Comments
 (0)