Skip to content

Commit 12a5214

Browse files
committed
fix(test): make php 5.3 consistent with others
1 parent 1322fa4 commit 12a5214

File tree

6 files changed

+98
-59
lines changed

6 files changed

+98
-59
lines changed

Diff for: .docker/php53/Dockerfile

+59-8
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ RUN set -eux; \
1212

1313
# php 5.3 needs older autoconf
1414
RUN set -eux; \
15+
\
16+
buildDeps=' \
17+
autoconf2.13 \
18+
'; \
1519
\
1620
apt-get update; \
1721
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
1822
curl \
19-
autoconf2.13 \
23+
$buildDeps \
2024
; \
2125
rm -r /var/lib/apt/lists/*; \
2226
\
@@ -37,36 +41,83 @@ RUN set -eux; \
3741
./buildconf --force; \
3842
./configure --disable-cgi \
3943
$(command -v apxs2 > /dev/null 2>&1 && echo '--with-apxs2' || true) \
44+
--with-config-file-path=/usr/local/etc/php \
45+
--with-config-file-scan-dir=/usr/local/etc/php/conf.d \
46+
--with-libdir=lib/x86_64-linux-gnu \
4047
--with-pdo-mysql \
4148
--with-zlib \
49+
--enable-zip \
4250
--enable-mbstring \
4351
--with-openssl=/usr \
44-
--with-libdir=lib/x86_64-linux-gnu \
52+
--enable-mysqlnd \
53+
--with-curl \
54+
--with-readline \
55+
--enable-ftp \
4556
; \
4657
make -j"$(nproc)"; \
4758
make install; \
59+
install -d /usr/local/etc/php/conf.d; \
4860
\
4961
dpkg -r \
5062
bison \
5163
libbison-dev \
5264
; \
53-
apt-get purge -y --force-yes --auto-remove \
54-
autoconf2.13 \
65+
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
66+
$buildDeps \
5567
; \
56-
rm -r /usr/src/php
68+
rm -r /usr/src/php; \
69+
apt-get clean; \
70+
rm -rf /var/lib/apt/lists/*; \
71+
rm -r /tmp/pear; \
72+
:;
73+
74+
RUN set -eux; \
75+
{ \
76+
echo '#! /bin/sh -eu'; \
77+
echo ''; \
78+
echo 'echo "extension=${1}.so" > "/usr/local/etc/php/conf.d/docker-php-ext-${1}.ini";'; \
79+
} | tee /usr/local/bin/docker-php-ext-enable; \
80+
\
81+
chmod +x /usr/local/bin/docker-php-ext-enable; \
82+
:;
5783

5884
CMD ["php", "-a"]
5985

6086
FROM php53
6187

6288
# Install APC PHP extension
6389
#
90+
ARG APC_VERSION
91+
RUN set -eux; \
92+
\
93+
test x"" = x"${APC_VERSION}" || { \
94+
pecl install "apc-${APC_VERSION}"; \
95+
docker-php-ext-enable apc; \
96+
\
97+
rm -r /tmp/pear; \
98+
}
99+
100+
# Install memcache PHP extension
101+
#
102+
ARG MEMCACHE_VERSION
64103
RUN set -eux; \
104+
buildDeps=' \
105+
libzip-dev \
106+
'; \
107+
apt-get update; \
108+
apt-get install -y --force-yes --no-upgrade --no-install-recommends \
109+
$buildDeps \
110+
; \
65111
\
66-
pecl install apc-3.1.13; \
67-
echo 'extension=apc.so' >> /usr/local/lib/php.ini; \
112+
pecl install "memcache-${MEMCACHE_VERSION}"; \
113+
docker-php-ext-enable memcache; \
68114
\
69-
rm -r /tmp/pear;
115+
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \
116+
$buildDeps \
117+
; \
118+
apt-get clean; \
119+
rm -rf /var/lib/apt/lists/*; \
120+
rm -r /tmp/pear
70121

71122
# Install composer
72123
#

Diff for: .docker/php54/Dockerfile

+9-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ RUN docker-php-ext-install mbstring
2424

2525
# Install APC PHP extension
2626
#
27+
ARG APC_VERSION
2728
RUN set -eux; \
28-
pecl install apc-3.1.13; \
29-
docker-php-ext-enable apc; \
30-
rm -r /tmp/pear;
29+
\
30+
test x"" = x"${APC_VERSION}" || { \
31+
pecl install "apc-${APC_VERSION}"; \
32+
docker-php-ext-enable apc; \
33+
\
34+
rm -r /tmp/pear; \
35+
}
3136

3237
# Install memcache PHP extension
3338
#
@@ -41,7 +46,7 @@ RUN set -eux; \
4146
$buildDeps \
4247
; \
4348
\
44-
pecl install memcache-${MEMCACHE_VERSION}; \
49+
pecl install "memcache-${MEMCACHE_VERSION}"; \
4550
docker-php-ext-enable memcache; \
4651
\
4752
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \

Diff for: .docker/php55_71/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ARG APCU_VERSION
2929
RUN set -eux; \
3030
\
3131
test x"" = x"${APCU_VERSION}" || { \
32-
pecl install apcu-${APCU_VERSION}; \
32+
pecl install "apcu-${APCU_VERSION}"; \
3333
docker-php-ext-enable apcu; \
3434
\
3535
rm -r /tmp/pear; \
@@ -47,7 +47,7 @@ RUN set -eux; \
4747
$buildDeps \
4848
; \
4949
\
50-
pecl install memcache-${MEMCACHE_VERSION}; \
50+
pecl install "memcache-${MEMCACHE_VERSION}"; \
5151
docker-php-ext-enable memcache; \
5252
\
5353
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \

Diff for: .docker/php72_73/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ARG APCU_VERSION
1111
RUN set -eux; \
1212
\
1313
test x"" = x"${APCU_VERSION}" || { \
14-
pecl install apcu-${APCU_VERSION}; \
14+
pecl install "apcu-${APCU_VERSION}"; \
1515
docker-php-ext-enable apcu; \
1616
\
1717
rm -r /tmp/pear; \
@@ -29,7 +29,7 @@ RUN set -eux; \
2929
$buildDeps \
3030
; \
3131
\
32-
pecl install memcache-${MEMCACHE_VERSION}; \
32+
pecl install "memcache-${MEMCACHE_VERSION}"; \
3333
docker-php-ext-enable memcache; \
3434
\
3535
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=true \

Diff for: .docker/php74_83/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ARG APCU_VERSION
2323
RUN set -eux; \
2424
\
2525
test x"" = x"${APCU_VERSION}" || { \
26-
pecl install apcu-${APCU_VERSION}; \
26+
pecl install "apcu-${APCU_VERSION}"; \
2727
docker-php-ext-enable apcu; \
2828
\
2929
rm -r /tmp/pear; \
@@ -41,7 +41,7 @@ RUN set -eux; \
4141
$buildDeps \
4242
; \
4343
\
44-
pecl install memcache-${MEMCACHE_VERSION}; \
44+
pecl install "memcache-${MEMCACHE_VERSION}"; \
4545
docker-php-ext-enable memcache; \
4646
\
4747
apt-get purge -y --force-yes --auto-remove -o APT::AutoRemove::RecommendsImportant=true \

Diff for: docker-compose.yml

+24-41
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ volumes:
44
db_socket:
55

66
services:
7-
php53:
8-
build: .docker/php53
7+
php53: &services_php
8+
build:
9+
context: .docker/php53
10+
args:
11+
MEMCACHE_VERSION: '3.0.8'
12+
APC_VERSION: '3.1.13'
913
working_dir: /app
1014
volumes:
1115
- .:/app
1216
- db_socket:/var/run/mysqld
1317
environment:
1418
COMPOSER_HOME: /app/var/cache/composer
19+
MEMCACHED_HOST: memcached
1520
entrypoint:
1621
- sh
1722
- -c
@@ -23,46 +28,24 @@ services:
2328
echo 'magic_quotes_gpc = off'
2429
echo 'date.timezone = "UTC"'
2530
echo 'apc.enable_cli = ${APC_ENABLE_CLI-off}'
26-
echo 'apc.use_request_time = 0'
27-
} | tee -a /usr/local/lib/php.ini
31+
echo 'apc.use_request_time = off'
32+
} | tee -a /usr/local/etc/php/php.ini
2833
2934
exec tail -f /dev/null
3035
depends_on:
3136
- db
37+
- memcached
3238

33-
php54: &services_php54
39+
php54:
40+
<<: *services_php
3441
build:
3542
context: .docker/php54
3643
args:
3744
MEMCACHE_VERSION: '3.0.8'
38-
environment:
39-
MEMCACHED_HOST: memcached
40-
COMPOSER_HOME: /app/var/cache/composer
41-
working_dir: /app
42-
volumes:
43-
- .:/app
44-
- db_socket:/var/run/mysqld
45-
entrypoint:
46-
- sh
47-
- -c
48-
- |
49-
{
50-
echo 'pdo_mysql.default_socket = /var/run/mysqld/mysql.sock'
51-
echo 'memory_limit = -1'
52-
echo 'short_open_tag = off'
53-
echo 'magic_quotes_gpc = off'
54-
echo 'date.timezone = "UTC"'
55-
echo 'apc.enable_cli = ${APC_ENABLE_CLI-off}'
56-
echo 'apc.use_request_time = 0'
57-
} | tee -a /usr/local/etc/php/php.ini
58-
59-
exec tail -f /dev/null
60-
depends_on:
61-
- db
62-
- memcached
45+
APC_VERSION: '3.1.13'
6346

6447
php55:
65-
<<: *services_php54
48+
<<: *services_php
6649
build:
6750
context: .docker/php55_71
6851
args:
@@ -71,7 +54,7 @@ services:
7154
APCU_VERSION: '4.0.11'
7255

7356
php56:
74-
<<: *services_php54
57+
<<: *services_php
7558
build:
7659
context: .docker/php55_71
7760
args:
@@ -80,7 +63,7 @@ services:
8063
APCU_VERSION: '4.0.11'
8164

8265
php70:
83-
<<: *services_php54
66+
<<: *services_php
8467
build:
8568
context: .docker/php55_71
8669
args:
@@ -89,7 +72,7 @@ services:
8972
APCU_VERSION: ''
9073

9174
php71:
92-
<<: *services_php54
75+
<<: *services_php
9376
build:
9477
context: .docker/php55_71
9578
args:
@@ -98,7 +81,7 @@ services:
9881
APCU_VERSION: ''
9982

10083
php72:
101-
<<: *services_php54
84+
<<: *services_php
10285
build:
10386
context: .docker/php72_73
10487
args:
@@ -107,7 +90,7 @@ services:
10790
APCU_VERSION: ''
10891

10992
php73:
110-
<<: *services_php54
93+
<<: *services_php
11194
build:
11295
context: .docker/php72_73
11396
args:
@@ -116,7 +99,7 @@ services:
11699
APCU_VERSION: ''
117100

118101
php74:
119-
<<: *services_php54
102+
<<: *services_php
120103
build:
121104
context: .docker/php74_83
122105
args:
@@ -125,7 +108,7 @@ services:
125108
APCU_VERSION: ''
126109

127110
php80:
128-
<<: *services_php54
111+
<<: *services_php
129112
build:
130113
context: .docker/php74_83
131114
args:
@@ -134,7 +117,7 @@ services:
134117
APCU_VERSION: ''
135118

136119
php81:
137-
<<: *services_php54
120+
<<: *services_php
138121
build:
139122
context: .docker/php74_83
140123
args:
@@ -143,7 +126,7 @@ services:
143126
APCU_VERSION: ''
144127

145128
php82:
146-
<<: *services_php54
129+
<<: *services_php
147130
build:
148131
context: .docker/php74_83
149132
args:
@@ -152,7 +135,7 @@ services:
152135
APCU_VERSION: ''
153136

154137
php83:
155-
<<: *services_php54
138+
<<: *services_php
156139
build:
157140
context: .docker/php74_83
158141
args:

0 commit comments

Comments
 (0)