Skip to content

Commit 2b9f9bf

Browse files
committed
Added PHP8.5
1 parent 0142630 commit 2b9f9bf

3 files changed

Lines changed: 176 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
continue-on-error: true
1313
strategy:
1414
matrix:
15-
version: ['8.1', '8.2', '8.3', '8.4']
15+
version: ['8.1', '8.2', '8.3', '8.4', '8.5']
1616
steps:
1717
-
1818
name: Set up QEMU

php/8.5/Dockerfile

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
FROM php:8.5.0-cli
2+
3+
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
4+
5+
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
6+
bash \
7+
chromium \
8+
curl \
9+
ghostscript \
10+
libfreetype6-dev \
11+
g++ \
12+
gcc \
13+
libicu-dev \
14+
imagemagick \
15+
libc-dev \
16+
libzip-dev \
17+
make \
18+
mariadb-client \
19+
openssh-client \
20+
rsync \
21+
git \
22+
&& rm -rf /var/lib/apt/lists/*
23+
24+
RUN chmod +x /usr/local/bin/install-php-extensions && \
25+
install-php-extensions \
26+
@composer \
27+
bcmath \
28+
bz2 \
29+
calendar \
30+
exif \
31+
gd \
32+
gmp \
33+
imagick \
34+
intl \
35+
mongodb-stable \
36+
mysqli \
37+
opcache \
38+
pcntl \
39+
pdo_mysql \
40+
pdo_pgsql \
41+
pgsql \
42+
redis-stable \
43+
soap \
44+
sockets \
45+
xdebug \
46+
xsl \
47+
zip
48+
49+
COPY php/8.4/imagemagick-policy.xml .
50+
51+
RUN mv imagemagick-policy.xml /etc/ImageMagick-7/policy.xml
52+
53+
RUN echo 'memory_limit=-1' > /usr/local/etc/php/conf.d/zz-conf.ini
54+
55+
RUN echo 'xdebug.mode=coverage' > /usr/local/etc/php/conf.d/20-xdebug.ini
56+
57+
ENV PATH=./vendor/bin:/composer/vendor/bin:/root/.composer/vendor/bin:/usr/local/bin:$PATH
58+
59+
RUN composer global require "squizlabs/php_codesniffer=*"
60+
61+
# Node.js
62+
RUN curl -sL https://deb.nodesource.com/setup_24.x | bash -
63+
RUN apt-get install -y nodejs
64+
RUN npm install npm@10 -g
65+
RUN corepack enable && corepack prepare yarn@stable --activate
66+
RUN command -v yarn
67+
RUN command -v node
68+
RUN command -v npm
69+
70+
# Pre-install latest Playwright system deps (no browsers)
71+
RUN npx --yes playwright install-deps
72+
73+
RUN apt-get purge -y gcc g++ make && \
74+
apt-get -y autoremove && \
75+
apt-get -y clean && \
76+
rm -rf /var/lib/apt/lists/* && \
77+
rm -rf ~/.composer/cache/*
78+
79+
WORKDIR /var/www

php/8.5/imagemagick-policy.xml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE policymap [
3+
<!ELEMENT policymap (policy)+>
4+
<!ATTLIST policymap xmlns CDATA #FIXED ''>
5+
<!ELEMENT policy EMPTY>
6+
<!ATTLIST policy xmlns CDATA #FIXED '' domain NMTOKEN #REQUIRED
7+
name NMTOKEN #IMPLIED pattern CDATA #IMPLIED rights NMTOKEN #IMPLIED
8+
stealth NMTOKEN #IMPLIED value CDATA #IMPLIED>
9+
]>
10+
<!--
11+
Configure ImageMagick policies.
12+
13+
Domains include system, delegate, coder, filter, path, or resource.
14+
15+
Rights include none, read, write, execute and all. Use | to combine them,
16+
for example: "read | write" to permit read from, or write to, a path.
17+
18+
Use a glob expression as a pattern.
19+
20+
Suppose we do not want users to process MPEG video images:
21+
22+
<policy domain="delegate" rights="none" pattern="mpeg:decode" />
23+
24+
Here we do not want users reading images from HTTP:
25+
26+
<policy domain="coder" rights="none" pattern="HTTP" />
27+
28+
The /repository file system is restricted to read only. We use a glob
29+
expression to match all paths that start with /repository:
30+
31+
<policy domain="path" rights="read" pattern="/repository/*" />
32+
33+
Lets prevent users from executing any image filters:
34+
35+
<policy domain="filter" rights="none" pattern="*" />
36+
37+
Any large image is cached to disk rather than memory:
38+
39+
<policy domain="resource" name="area" value="1GP"/>
40+
41+
Define arguments for the memory, map, area, width, height and disk resources
42+
with SI prefixes (.e.g 100MB). In addition, resource policies are maximums
43+
for each instance of ImageMagick (e.g. policy memory limit 1GB, -limit 2GB
44+
exceeds policy maximum so memory limit is 1GB).
45+
46+
Rules are processed in order. Here we want to restrict ImageMagick to only
47+
read or write a small subset of proven web-safe image types:
48+
49+
<policy domain="delegate" rights="none" pattern="*" />
50+
<policy domain="filter" rights="none" pattern="*" />
51+
<policy domain="coder" rights="none" pattern="*" />
52+
<policy domain="coder" rights="read|write" pattern="{GIF,JPEG,PNG,WEBP}" />
53+
-->
54+
<policymap>
55+
<!-- <policy domain="system" name="shred" value="2"/> -->
56+
<!-- <policy domain="system" name="precision" value="6"/> -->
57+
<!-- <policy domain="system" name="memory-map" value="anonymous"/> -->
58+
<!-- <policy domain="system" name="max-memory-request" value="256MiB"/> -->
59+
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
60+
<policy domain="resource" name="memory" value="256MiB"/>
61+
<policy domain="resource" name="map" value="512MiB"/>
62+
<policy domain="resource" name="width" value="16KP"/>
63+
<policy domain="resource" name="height" value="16KP"/>
64+
<!-- <policy domain="resource" name="list-length" value="128"/> -->
65+
<policy domain="resource" name="area" value="128MB"/>
66+
<policy domain="resource" name="disk" value="1GiB"/>
67+
<!-- <policy domain="resource" name="file" value="768"/> -->
68+
<!-- <policy domain="resource" name="thread" value="4"/> -->
69+
<!-- <policy domain="resource" name="throttle" value="0"/> -->
70+
<!-- <policy domain="resource" name="time" value="3600"/> -->
71+
<!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
72+
<!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->
73+
<!-- <policy domain="delegate" rights="none" pattern="HTTPS" /> -->
74+
<!-- <policy domain="path" rights="none" pattern="@*" /> -->
75+
<!-- <policy domain="cache" name="memory-map" value="anonymous"/> -->
76+
<!-- <policy domain="cache" name="synchronize" value="True"/> -->
77+
<!-- <policy domain="cache" name="shared-secret" value="passphrase" stealth="true"/> -->
78+
<!-- <policy domain="system" name="pixel-cache-memory" value="anonymous"/> -->
79+
<!-- <policy domain="system" name="shred" value="2"/> -->
80+
<!-- <policy domain="system" name="precision" value="6"/> -->
81+
<!-- not needed due to the need to use explicitly by mvg: -->
82+
<!-- <policy domain="delegate" rights="none" pattern="MVG" /> -->
83+
<!-- use curl -->
84+
<policy domain="delegate" rights="none" pattern="URL" />
85+
<policy domain="delegate" rights="none" pattern="HTTPS" />
86+
<policy domain="delegate" rights="none" pattern="HTTP" />
87+
<!-- in order to avoid to get image with password text -->
88+
<policy domain="path" rights="none" pattern="@*"/>
89+
<!-- disable ghostscript format types -->
90+
<policy domain="coder" rights="none" pattern="PS" />
91+
<policy domain="coder" rights="none" pattern="PS2" />
92+
<policy domain="coder" rights="none" pattern="PS3" />
93+
<policy domain="coder" rights="none" pattern="EPS" />
94+
<policy domain="coder" rights="read|write" pattern="PDF" />
95+
<policy domain="coder" rights="none" pattern="XPS" />
96+
</policymap>

0 commit comments

Comments
 (0)