forked from propelorm/Propel
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compatibility with php 7.4 and 8.x (#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]>
- Loading branch information
1 parent
7f42869
commit 73148f8
Showing
310 changed files
with
618 additions
and
687 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,10 @@ | ||
language: php | ||
dist: trusty | ||
|
||
branches: | ||
only: | ||
- 1.6 | ||
- master | ||
- gh-pages | ||
- php7.4 | ||
|
||
php: | ||
- 5.4 | ||
- 5.5 | ||
- hhvm | ||
services: docker | ||
|
||
env: | ||
- DB=mysql DB_USER=root | ||
|
||
before_script: | ||
# MySQL | ||
- 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" | ||
- 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" | ||
|
||
# Composer | ||
- wget http://getcomposer.org/composer.phar | ||
- php composer.phar install --prefer-source | ||
|
||
- ./test/reset_tests.sh | ||
|
||
script: vendor/bin/phpunit | ||
|
||
matrix: | ||
include: | ||
- php: 5.3 | ||
dist: precise | ||
allow_failures: | ||
- php: hhvm | ||
script: | ||
bash docker/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM thecodingmachine/php:8.0-v4-cli | ||
USER root | ||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales | ||
|
||
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ | ||
dpkg-reconfigure --frontend=noninteractive locales && \ | ||
update-locale LANG=en_US.UTF-8 | ||
|
||
USER docker | ||
ENV LANG en_US.UTF-8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: '3' | ||
services: | ||
php: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
working_dir: /usr/src/app | ||
command: phpunit | ||
volumes: | ||
- ../:/usr/src/app | ||
environment: | ||
- PHP_EXTENSIONS=intl pdo_sqlite sqlite3 xdebug | ||
- STARTUP_COMMAND_1=composer install | ||
- STARTUP_COMMAND_2=bash test/reset_tests.sh | ||
- PHP_IDE_CONFIG="serverName=propel" | ||
- XDEBUG_MODE=debug | ||
- XDEBUG_SESSION=1 | ||
|
||
db: | ||
image: percona | ||
command: > | ||
mysqld | ||
--sql-mode="NO_ENGINE_SUBSTITUTION" | ||
--character-set-server="utf8" | ||
--collation-server="utf8_unicode_ci" | ||
--default-authentication-plugin=mysql_native_password | ||
restart: always | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
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;' | ||
mysql -u root -e 'CREATE DATABASE test; CREATE SCHEMA bookstore_schemas; CREATE SCHEMA contest; CREATE SCHEMA second_hand_books; CREATE DATABASE reverse_bookstore;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
cd docker | ||
docker-compose up -d db | ||
sleep 20 | ||
docker-compose exec -T db bash < reset.sh | ||
docker-compose build | ||
docker-compose run php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/aggregate_column/templates/objectCompute.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Computes the value of the aggregate column <?php echo $column->getName() ?> | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/aggregate_column/templates/objectUpdate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Updates the aggregate column <?php echo $column->getName() ?> | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/aggregate_column/templates/objectUpdateRelated.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Update the aggregate column in the related <?php echo $relationName ?> object | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/aggregate_column/templates/queryFindRelated.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Finds the related <?php echo $foreignTable->getPhpName() ?> objects and keep them for later | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/aggregate_column/templates/queryUpdateRelated.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/archivable/templates/objectDeleteWithoutArchive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Removes the object from the database without archiving it. | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/archivable/templates/objectGetArchive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Get an archived version of the current object. | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/archivable/templates/objectPopulateFromArchive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Populates the the current object based on a $archiveTablePhpName archive object. | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/archivable/templates/objectRestoreFromArchive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/archivable/templates/objectSaveWithoutArchive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Persists the object to the database without archiving it. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/archivable/templates/queryDeleteWithoutArchive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Delete records matching the current query without archiving them. | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/archivable/templates/querySetArchiveOnDelete.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Enable/disable auto-archiving on delete for the next query. | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/archivable/templates/querySetArchiveOnUpdate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Enable/disable auto-archiving on update for the next query. | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/archivable/templates/queryUpdateWithoutArchive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Delete records matching the current query without archiving them. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Current locale | ||
* @var string | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/i18n/templates/objectGetCurrentTranslation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Returns the current translation | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Gets the locale for translations | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Gets the locale for translations. | ||
* Alias for getLocale(), for BC purpose. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Returns the current translation for a given locale | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/i18n/templates/objectRemoveTranslation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Remove the translation for a given locale | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Sets the locale for translations | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Sets the locale for translations. | ||
* Alias for setLocale(), for BC purpose. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Sets the translation for a given locale | ||
* | ||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/i18n/templates/objectTranslatedColumnGetter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
<?php echo $comment ?> | ||
<?php echo $functionStatement ?> | ||
|
||
|
1 change: 0 additions & 1 deletion
1
generator/lib/behavior/i18n/templates/objectTranslatedColumnSetter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Adds a JOIN clause to the query using the i18n relation | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
/** | ||
* Use the I18n relation query object | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.