Skip to content

Commit d24a5c2

Browse files
jwong-dayspringmichalmagic42tworzeniewebmentalstring
authored andcommitted
compatibility with php 7.4 and 8.x (propelorm#4)
* Correct deprecated methods in PHP7.4 (propelorm#1079) * runtime/lib/query/Join.php implode() was used against the definition (wrong PHP documentation * runtime/lib/query/ModelCriteria.php count() was used on non-countable variable (non-array) * 7.4 and phpunit9 changes. Tests are passing * Compatibility changes * Added docker setup * updated travis * added correct path * 7.4 final travis setup * propelorm#1086: Code review suggestions applying * remove dependency on docker mysql * remove 5.6 and 7.2 from test matrix; add 8.0 and 8.1 * Upgraded PHP version and removed some deprecations * Migrated phpunit.xml.dist * Switched to PHP8.0 in Dockerfile * Removed usage of ReflectionClass->getClass in favor of ReflectionClass->getType * Changed order of arguments in ModelCriteriaTest.php and ModelCriteriaWithNamespaceTest.php * Fixed signatures of PropelOnDemandCollection::asort and PropelOnDemandCollection::ksort * Removed require_once from all the classes because we have autoloading via composer * Rector automated upgrade to PHP8 * Fixed invalid handling of resource type for binded value in DebugPDOStatement.php * Fixed invalid way of checking if method exists in delegated class via is_callable. Switched to method_exists * Replaced order of params because of failed tests * [STYLE]: Added simplified usage because of version support dropping * Fix use of abs() with string on PHP8.0 Can happen when using Yaml's multiline syntax * specify minimum version of phing for php8 * drop php 7.3 from test matrix * update to ubuntu-20.04 * fork propel/propel1 for versions >=1.8 Co-authored-by: Michal Drozd <[email protected]> Co-authored-by: Luke Adamczewski <[email protected]> Co-authored-by: Łukasz Adamczewski <[email protected]> Co-authored-by: Jeffrey Wong <[email protected]> Co-authored-by: Luke Adamczewski <[email protected]> Co-authored-by: Paulo Magalhaes <[email protected]>
1 parent 678736a commit d24a5c2

File tree

149 files changed

+176
-272
lines changed

Some content is hidden

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

149 files changed

+176
-272
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ jobs:
88
env:
99
DB: mysql
1010
DB_USER: root
11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-20.04
1212
strategy:
1313
fail-fast: false
1414
matrix:
1515
php:
16-
- '5.6'
17-
- '7.2'
18-
- '7.3'
1916
- '7.4'
20-
# - '8.0'
21-
# - '8.1'
17+
- '8.0'
18+
- '8.1'
2219
composer:
2320
- ''
2421
- '--prefer-lowest'

composer.json

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "propel/propel1",
2+
"name": "dayspring-tech/propel1",
33
"description": "Propel is an open-source Object-Relational Mapping (ORM) for PHP5.",
44
"keywords": ["orm", "active record", "mapping", "database", "persistence"],
55
"homepage": "http://www.propelorm.org/",
@@ -14,6 +14,7 @@
1414
},
1515
"include-path": ["runtime/lib", "generator/lib"],
1616
"require": {
17+
<<<<<<< HEAD
1718
"php": "^7.1",
1819
"phing/phing": "~2.4"
1920

@@ -23,18 +24,31 @@
2324
"phpunit/phpunit": "^9.0.0",
2425
"phpcompatibility/php-compatibility": "^9.3",
2526
"squizlabs/php_codesniffer": "^3.5"
27+
=======
28+
"php": "^8.0|^7.4",
29+
"phing/phing": "^2.17",
30+
"ext-pdo": "*"
2631
},
27-
"extra": {
28-
"branch-alias": {
29-
"dev-master": "1.7-dev"
30-
}
32+
"require-dev": {
33+
"phpunit/phpunit": "^9.0.0",
34+
"phpcompatibility/php-compatibility": "^9.3",
35+
"squizlabs/php_codesniffer": "^3.5",
36+
"ext-simplexml": "*",
37+
"ext-dom": "*"
38+
>>>>>>> 73148f83 (compatibility with php 7.4 and 8.x (#4))
39+
},
40+
"replace": {
41+
"propel/propel1": "^1.8"
3142
},
43+
<<<<<<< HEAD
3244
"repositories": [
3345
{
3446
"type": "pear",
3547
"url": "https://pear.php.net"
3648
}
3749
],
50+
=======
51+
>>>>>>> 73148f83 (compatibility with php 7.4 and 8.x (#4))
3852
"bin": ["generator/bin/propel-gen", "generator/bin/propel-gen.bat"],
3953
"scripts": {
4054
"post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM thecodingmachine/php:7.4-v3-cli
1+
FROM thecodingmachine/php:8.0-v4-cli
22
USER root
33
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
44

docker/docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ services:
99
volumes:
1010
- ../:/usr/src/app
1111
environment:
12+
<<<<<<< HEAD
1213
- PHP_EXTENSIONS=intl pdo_sqlite sqlite3
1314
- STARTUP_COMMAND_1=composer install
1415
- STARTUP_COMMAND_2=bash test/reset_tests.sh
16+
=======
17+
- PHP_EXTENSIONS=intl pdo_sqlite sqlite3 xdebug
18+
- STARTUP_COMMAND_1=composer install
19+
- STARTUP_COMMAND_2=bash test/reset_tests.sh
20+
- PHP_IDE_CONFIG="serverName=propel"
21+
- XDEBUG_MODE=debug
22+
- XDEBUG_SESSION=1
23+
>>>>>>> 73148f83 (compatibility with php 7.4 and 8.x (#4))
1524

1625
db:
1726
image: percona

generator/lib/behavior/DelegateBehavior.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function objectCall($builder)
111111
$relationName = $builder->getFKPhpNameAffix($fk);
112112
}
113113
$script .= "
114-
if (is_callable(array('$ARFQCN', \$name))) {
114+
if (method_exists('$ARFQCN', \$name)) {
115115
if (!\$delegate = \$this->get$relationName()) {
116116
\$delegate = new $ARClassName();
117117
\$this->set$relationName(\$delegate);

generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
* @license MIT License
99
*/
1010

11-
require_once 'AggregateColumnRelationBehavior.php';
12-
1311
/**
1412
* Keeps an aggregate column updated with related table
1513
*

generator/lib/behavior/aggregate_column/AggregateColumnRelationBehavior.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
* @license MIT License
99
*/
1010

11-
require_once 'AggregateColumnRelationBehavior.php';
12-
1311
/**
1412
* Keeps an aggregate column updated with related table
1513
*

generator/lib/behavior/aggregate_column/templates/objectCompute.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Computes the value of the aggregate column <?php echo $column->getName() ?>
43
*

generator/lib/behavior/aggregate_column/templates/objectUpdate.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Updates the aggregate column <?php echo $column->getName() ?>
43
*

generator/lib/behavior/aggregate_column/templates/objectUpdateRelated.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* Update the aggregate column in the related <?php echo $relationName ?> object
43
*

0 commit comments

Comments
 (0)