Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to PHP 7.4 #1086

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

tworzenieweb
Copy link

A lot of small changes applied to ensure that code works with PHP7.4, any help and thoughts are highly appreciated.

michalmagic42 and others added 8 commits March 16, 2020 12:49
* 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)
@mentalstring
Copy link

The support for PHP 7.4 is very welcome - thank you for doing this!

But from what I can see, this approach breaks the support for older versions of PHP. Perhaps this only makes sense as a separate branch?

DavidGoodwin added a commit to DavidGoodwin/Propel that referenced this pull request Sep 18, 2020
DavidGoodwin added a commit to DavidGoodwin/Propel that referenced this pull request Sep 18, 2020
@teo1978
Copy link

teo1978 commented Nov 30, 2020

Does anyone know of a reliable fork that completely fixes php 7.4 compatibility without breaking compatibility with 5.x (or introducing lots of regressions)?

Right now the most disastrous bc-breaking change in PHP 7.4 that I'm observing that completely breaks Propel 1 is this:
https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.spl

@teo1978
Copy link

teo1978 commented Dec 3, 2020

This does NOT fix compatibility with PHP 7.4.

With 7.3 maybe, but this does not address https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.spl

@gevorgmargaryan
Copy link

gevorgmargaryan commented Dec 29, 2020

May it be merged as a separate version?
For my case its not relevant at all to have php 5.x support . I am not going to get back to it, but project is too big, and upgrading to propel2 is another big change that I am not ready yet.

@tworzenieweb
Copy link
Author

@teo1978 Tests for 7.4 are passing and I must admit this fork is running fine on a commercial project for almost a year without issues. We are doing a slow migration to Doctrine in the meantime.

I am planning to start migrating it towards 8.0 this month.

@DanielFortuyn
Copy link

Any news with regard to 8.0 support? I might consider helping out as I have a project running on propel as well.

@mentalstring
Copy link

We've been using @tworzenieweb changes for supporting for PHP 7.4 for a long while now and haven't had any issues. 👍

@tworzenieweb Did you do any progress on the support for PHP 8.0 since then? I might give a hand towards that if I find the time, but would be best to avoid duplicate work.

jwong-dayspring added a commit to dayspring-tech/Propel that referenced this pull request Dec 20, 2022
* 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]>
@jwong-dayspring
Copy link

@tworzenieweb Thanks for your work on this! We used this as the basis for our fork with PHP 8.0 support.

@mentalstring @DanielFortuyn We published https://packagist.org/packages/dayspring-tech/propel-bundle#1.8.0 as a drop-in replacement with PHP 8.0 compatibility.

DanielFortuyn pushed a commit to DanielFortuyn/Propel that referenced this pull request Feb 10, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants