Skip to content
New issue

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

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

Already on GitHub? # to your account

NTO-180 PHP8.1 compatibility #5

Merged
merged 46 commits into from
Oct 30, 2022
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
cf9c897
Fix tests to be able to finish it without a fatal error
alquerci Sep 8, 2018
4cbd5dd
Fix tests for relationship fetch order when the order is not explicit…
alquerci Sep 1, 2019
88e169a
Fix PHP 7 compatibility about deep isset() on class that implement Ar…
alquerci Sep 1, 2019
8a6cc1b
Mark as known bug, integer validation with numbers greater than PHP_I…
alquerci Sep 1, 2019
915e841
Fix test for export to XML
alquerci Sep 1, 2019
9c88c98
Fix PHP 7.4 compatibility
alquerci Sep 1, 2019
4cb159f
Add zlib required PHP extension on composer configuration
alquerci Sep 1, 2019
6dd5096
Fix code structure about always close connections after each test
alquerci Jul 25, 2022
a81bdac
Add consistent local environment for testing with docker and docker-c…
alquerci Oct 5, 2022
a8afd0d
Update Builder.php for PHP8 compatibility (#82)
xNatek Oct 5, 2022
6e3f59f
imported double-quoting changes from https://github.com/zikula/doctri…
akhumphrey Dec 15, 2019
39e2c89
Applied patches from JSB-363 (#1)
Apr 23, 2020
3e0b059
JSB-363: Added missing calls to applyIndexes when considering subquer…
May 3, 2020
69bcdc7
PHP 8.1 > Automatic conversion of false to array is deprecated
Tybaze Jun 9, 2022
4e26963
PHP 8.1 > Serializable Phase Out
Tybaze Jun 9, 2022
6d15c95
PHP 8.0 > Typing of internal function parameters do not allow null va…
Tybaze Jun 9, 2022
8538247
PHP 8.1 > internal_method_return_types
Tybaze Jun 9, 2022
8f71aad
Update Travis to PHP up to 8.1
Tybaze Jun 10, 2022
233732b
PHP 8.0 > Doctrine_Query:36, uncaught TypeError: Unsupported operand …
Tybaze Jun 13, 2022
fdea9eb
PHP 8.1 fix last
Tybaze Jun 13, 2022
8f6c4c0
Fix test 1783 - 64bit compatibility
Tybaze Jun 14, 2022
b266642
PHP 8.1 PDO stringify is now disable by default.
Tybaze Jun 14, 2022
3126cae
PHP8.1 Fix: Warning: strtotime() : Epoch doesn't fit in a PHP integer…
Tybaze Jul 5, 2022
5071b3d
Annotate can return null
Tybaze Jul 10, 2022
2fc9ed9
Return annotation
Tybaze Jul 10, 2022
95a6baf
Return annotation
Tybaze Jul 10, 2022
edf9041
Coding style
Tybaze Jul 10, 2022
8a5298c
Fix annotation.
Tybaze Jul 10, 2022
420ec8c
Remove useless string cast by testing null before
Tybaze Jul 10, 2022
f3056b6
Fix SQLite Connect to return a boolean
Tybaze Aug 2, 2022
25636ee
Fix BC compatibility for any dev using fetch($currentOffset = null)
Tybaze Aug 2, 2022
8271826
Commit Suggestions - Fix phpDoc and yoda style
Tybaze Aug 2, 2022
c2c2440
Handle default taskName to null, to avoid triggering the strlen(null)…
Tybaze Aug 2, 2022
3b24dbe
Fix taskname empty length
Tybaze Aug 3, 2022
cc15b06
bumped min php version, bumped branch alias
akhumphrey Sep 6, 2022
6faa7f6
don't attempt `strtolower` on null values
akhumphrey Sep 9, 2022
6428aae
updated iterator method signatures to match upstream
akhumphrey Sep 16, 2022
08dbced
avoid returning any value from a `: void` hinted function
akhumphrey Sep 16, 2022
73c8411
PHP 8.0 > Typing of internal function parameters do not allow null va…
Tybaze Jun 9, 2022
c24fd43
PHP 8.1 > Compatibility
Tybaze Jun 9, 2022
04eebfe
PR Review - Small bug Fixes
Tybaze Aug 2, 2022
dcd918e
Fix Annotation and Coding Style
Tybaze Jul 10, 2022
6e75b75
Add proof tast name with empty task name property sets by child class
alquerci Oct 5, 2022
d92ff47
minor PSR fixes
akhumphrey Oct 18, 2022
3b62100
minor tidies suggested at code review
akhumphrey Oct 23, 2022
40b7484
removed docker environments for testing older php versions
akhumphrey Oct 26, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .docker/php53/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM buildpack-deps:jessie

ENV PHP_VERSION 5.3.29

# php 5.3 needs older autoconf
RUN set -eux; \
\
apt-get update; \
apt-get install -y \
curl \
autoconf2.13 \
; \
rm -r /var/lib/apt/lists/*; \
\
curl -sSLfO http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb; \
curl -sSLfO http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb; \
dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb; \
dpkg -i bison_2.7.1.dfsg-1_amd64.deb; \
rm *.deb; \
\
curl -sSLf "https://php.net/get/php-$PHP_VERSION.tar.bz2/from/this/mirror" -o php.tar.bz2; \
echo 'c4e1cf6972b2a9c7f2777a18497d83bf713cdbecabb65d3ff62ba441aebb0091 php.tar.bz2' | sha256sum -cw --status; \
\
mkdir -p /usr/src/php; \
tar -xf php.tar.bz2 -C /usr/src/php --strip-components=1; \
rm php.tar.bz2*; \
\
cd /usr/src/php; \
./buildconf --force; \
./configure --disable-cgi \
$(command -v apxs2 > /dev/null 2>&1 && echo '--with-apxs2' || true) \
--with-pdo-mysql \
--with-zlib \
--enable-mbstring \
; \
make -j"$(nproc)"; \
make install; \
\
dpkg -r \
bison \
libbison-dev \
; \
apt-get purge -y --auto-remove \
autoconf2.13 \
; \
rm -r /usr/src/php

CMD ["php", "-a"]
5 changes: 5 additions & 0 deletions .docker/php54/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM php:5.4-cli

RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mbstring
6 changes: 6 additions & 0 deletions .docker/php55_71/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG PHP_TAG
FROM php:${PHP_TAG}

RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mbstring
22 changes: 22 additions & 0 deletions .docker/php72_73/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG PHP_VERSION
FROM php:${PHP_VERSION}-cli

RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mbstring

# For consistent mime type file guesser
RUN set -eux; \
distFilePath=`which file`; \
\
mv ${distFilePath} ${distFilePath}.dist; \
{ \
echo '#! /bin/sh -eu'; \
echo ''; \
echo "${distFilePath}"'.dist "$@" | sed -e s,application/x-pie-executable,application/x-executable,g'; \
} | tee ${distFilePath}; \
\
chmod +x ${distFilePath}; \
\
file /bin/ls --mime | grep application/x-executable; \
:;
34 changes: 34 additions & 0 deletions .docker/php74_81/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ARG PHP_VERSION
FROM php:${PHP_VERSION}-cli

RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql

# Install mbstring PHP extension
#
RUN set -eux; \
apt-get update; \
apt-get install -y --no-upgrade --no-install-recommends \
libonig-dev \
; \
\
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
\
docker-php-ext-install mbstring

# For consistent mime type file guesser
RUN set -eux; \
distFilePath=`which file`; \
\
mv ${distFilePath} ${distFilePath}.dist; \
{ \
echo '#! /bin/sh -eu'; \
echo ''; \
echo "${distFilePath}"'.dist "$@" | sed -e s,application/x-pie-executable,application/x-executable,g'; \
} | tee ${distFilePath}; \
\
chmod +x ${distFilePath}; \
\
file /bin/ls --mime | grep application/x-executable; \
:;
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
tests/DoctrineTest/doctrine_tests/*
*TestCase.php
*TestCase.php
/composer.lock
/tests/tmp
/tests/foo.sq3
/vendor/
30 changes: 22 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
os: linux
dist: xenial
dist: focal
language: php

php:
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
- 8.1
- nightly

cache:
Expand All @@ -18,18 +16,34 @@ jobs:
fast_finish: true
allow_failures:
- php: nightly
- php: 5.3
include:
- php: 5.3
dist: precise
- php: 5.4
dist: precise
dist: trusty
- php: 5.5
dist: trusty
- php: 5.6
dist: trusty
- php: 7.0
dist: xenial
- php: 7.1
dist: xenial
- php: 7.2
dist: xenial
- php: 7.3
dist: xenial


services:
- mysql

before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'

install:
- composer install --prefer-dist --no-progress --no-suggest -o
- composer install --prefer-dist --no-progress --no-suggest -o

script:
- php -dshort_open_tag=Off -dmagic_quotes_gpc=Off tests/index.php
- "cd tests && php -dshort_open_tag=Off -dmagic_quotes_gpc=Off run.php"
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Doctrine1
=========

About this version
------------------

This is a community driven fork of doctrine 1, as official support has been interrupted long time ago.

**Do not use it for new projects: this version is great to improve existing symfony1 applications using doctrine1, but [Doctrine2](https://www.doctrine-project.org/projects/orm.html) is the way to go today.**


Requirements
------------

PHP 5.3 and up.


Installation
------------

Using [Composer](http://getcomposer.org/doc/00-intro.md) as dependency management:

composer require friendsofsymfony1/doctrine1 "1.5.*"
composer install



Tests
-----

### Prerequisites

* docker-engine version 17.12.0+
* docker-compose version 1.20.0+

### How to execute all tests on all supported PHP versions and dependencies?

tests/bin/test

### When you finish your work day, do not forget to clean up your desk

docker-compose down


Documentation
-------------

Read the official [doctrine1 documentation](https://web.archive.org/web/20171008235327/http://docs.doctrine-project.org:80/projects/doctrine1/en/latest/en/manual/index.html)


Contributing
------------

You can send pull requests or create an issue.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
],
"require": {
"php": ">=5.3",
"php": ">=8.1",
"ext-mbstring": "*",
"ext-pdo": "*"
},
Expand All @@ -35,7 +35,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
"dev-php81": "1.5-dev"
}
}
}
138 changes: 138 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
version: '3.5'

volumes:
db_socket:

services:
composer:
image: composer
working_dir: /app
volumes:
- .:/app
entrypoint:
- sh
- -c
- |
exec tail -f /dev/null

php53:
build: .docker/php53
working_dir: /app/tests
volumes:
- .:/app
- db_socket:/var/run/mysqld
entrypoint:
- sh
- -c
- |
{
echo 'pdo_mysql.default_socket = /var/run/mysqld/mysql.sock'
echo 'memory_limit = -1'
echo 'short_open_tag = off'
echo 'magic_quotes_gpc = off'
echo 'date.timezone = "UTC"'
} | tee -a /usr/local/lib/php.ini

exec tail -f /dev/null

php54: &services_php54
build:
context: .docker/php54
working_dir: /app/tests
volumes:
- .:/app
- db_socket:/var/run/mysqld
entrypoint:
- sh
- -c
- |
{
echo 'pdo_mysql.default_socket = /var/run/mysqld/mysql.sock'
echo 'memory_limit = -1'
echo 'short_open_tag = off'
echo 'magic_quotes_gpc = off'
echo 'date.timezone = "UTC"'
} | tee -a /usr/local/etc/php/php.ini

exec tail -f /dev/null
depends_on:
- db

php55:
<<: *services_php54
build:
context: .docker/php55_71
args:
PHP_TAG: '5.5-cli'

php56:
<<: *services_php54
build:
context: .docker/php55_71
args:
PHP_TAG: '5.6-cli-jessie'

php70:
<<: *services_php54
build:
context: .docker/php55_71
args:
PHP_TAG: '7.0-cli-jessie'

php71:
<<: *services_php54
build:
context: .docker/php55_71
args:
PHP_TAG: '7.1-cli-jessie'

php72:
<<: *services_php54
build:
context: .docker/php72_73
args:
PHP_VERSION: '7.2'

php73:
<<: *services_php54
build:
context: .docker/php72_73
args:
PHP_VERSION: '7.3'

php74:
<<: *services_php54
build:
context: .docker/php74_81
args:
PHP_VERSION: '7.4'

php80:
<<: *services_php54
build:
context: .docker/php74_81
args:
PHP_VERSION: '8.0'

php81:
<<: *services_php54
build:
context: .docker/php74_81
args:
PHP_VERSION: '8.1'

db:
image: mysql:5.5.62
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
volumes:
- db_socket:/tmp
entrypoint:
- bash
- -c
- |
{
echo "CREATE DATABASE IF NOT EXISTS test;"
} | tee /docker-entrypoint-initdb.d/init.sql

exec /usr/local/bin/docker-entrypoint.sh mysqld
Loading