Skip to content

Commit

Permalink
Merged remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
akhumphrey committed Dec 10, 2024
2 parents c25e9f4 + 5ffcb73 commit f2797fb
Show file tree
Hide file tree
Showing 68 changed files with 537 additions and 414 deletions.
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; \
:;
2 changes: 2 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: "Continuous Integration"

on:
pull_request:
branches:
- master
paths:
- .github/workflows/continuous-integration.yml
- composer.*
Expand Down
33 changes: 33 additions & 0 deletions lib/Doctrine/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,39 @@ public function __serialize()
return $vars;
}

/**
* Unserializes a Doctrine_Collection instance for php 7.4+
*
* @param string $serialized A serialized Doctrine_Collection instance
*/
public function __unserialize($data)
{
$array = unserialize($serialized);

$this->__unserialize($array);
}

/**
* Serializes the current instance for php 7.4+
*
* @return array
*/
public function __serialize() {

$vars = get_object_vars($this);

unset($vars['reference']);
unset($vars['referenceField']);
unset($vars['relation']);
unset($vars['expandable']);
unset($vars['expanded']);
unset($vars['generator']);

$vars['_table'] = $vars['_table']->getComponentName();

return $vars;
}

/**
* Unserializes a Doctrine_Collection instance for php 7.4+
*
Expand Down
30 changes: 11 additions & 19 deletions lib/Doctrine/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* @version $Revision$
* @author Konsta Vesterinen <[email protected]>
* @author Lukas Smith <[email protected]> (MDB2 library)
*
* @property Doctrine_Export $export
*/
abstract class Doctrine_Connection extends Doctrine_Configurable implements Countable, IteratorAggregate, Serializable
{
Expand Down Expand Up @@ -241,41 +243,31 @@ public function isConnected()
}

/**
* getOptions
*
* Get array of all options
*
* @return void
* @return array<string, mixed>
*/
public function getOptions()
public function getOptions(): array
{
return $this->options;
}

/**
* getOption
*
* Retrieves option
*
* @param string $option
* @return void
* @return null|mixed
*/
public function getOption($option)
public function getOption(string $option)
{
if (isset($this->options[$option])) {
return $this->options[$option];
}
}

/**
* setOption
*
* Set option value
*
* @param string $option
* @return void
* @return mixed
*/
public function setOption($option, $value)
public function setOption(string $option, $value)
{
return $this->options[$option] = $value;
}
Expand Down Expand Up @@ -1545,8 +1537,8 @@ public function dropDatabase()
* which is always guaranteed to exist. Mysql: 'mysql', PostgreSQL: 'postgres', etc.
* This value is set in the Doctrine_Export_{DRIVER} classes if required
*
* @param string $info
* @return void
* @param array $info
* @return Doctrine_Connection
*/
public function getTmpConnection($info)
{
Expand All @@ -1569,7 +1561,7 @@ public function getTmpConnection($info)
$username = $this->getOption('username');
$password = $this->getOption('password');

$conn = $this->getManager()->openConnection(array($pdoDsn, $username, $password), 'doctrine_tmp_connection', false);
$conn = $this->getManager()->openConnection([$pdoDsn, $username, $password], 'doctrine_tmp_connection', false);
$conn->setOption('username', $username);
$conn->setOption('password', $password);

Expand Down
Loading

0 comments on commit f2797fb

Please sign in to comment.