Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

BR-11851: Make Shadow and basefdir compatible with PHP84 #57

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
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
57 changes: 29 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
FROM amazonlinux:2
FROM rockylinux:9

# Set arguments for directory paths
ARG PHP_BUILD_DIR=/var/task
ARG PHP_CONF_DIR=/etc/php.d
ARG PHP_EXT_DIR=/usr/lib64/php/modules

RUN yum install -y amazon-linux-extras
RUN amazon-linux-extras enable php8.2
RUN amazon-linux-extras install -y php8.2
RUN yum clean all && \
yum -y upgrade && \
yum -y install ilibzip-dev libonig-dev putils gcc make \
yum -y re2c \
yum-utils
# Enable CRB and install required tools, resolving conflicts
RUN dnf -y update && \
dnf -y install dnf-plugins-core && \
dnf config-manager --set-enabled crb && \
dnf -y install curl --allowerasing && \
dnf -y install dnf-utils wget tar gcc make libxml2-devel \
bzip2 bzip2-devel libpng-devel libjpeg-devel \
freetype-devel oniguruma-devel libzip-devel zlib-devel

RUN yum -y install php-cli php-common php-devel && \
yum clean all
# Enable Remi repository for PHP 8.4
RUN dnf -y install https://rpms.remirepo.net/enterprise/remi-release-9.rpm && \
dnf module reset php -y && \
dnf module enable php:remi-8.4 -y && \
dnf -y install php php-cli php-devel php-pear

#Extension install
RUN mkdir -p ${PHP_EXT_DIR} && mkdir -p ${PHP_CONF_DIR}
# Prepare directories for building the PHP extension
RUN mkdir -p ${PHP_BUILD_DIR}/shadow

#shadow
RUN mkdir -p ${PHP_BUILD_DIR}
RUN cd ${PHP_BUILD_DIR} && \
mkdir shadow
COPY shadow.c shadow/
COPY php_shadow.h shadow/
COPY shadow_cache.c shadow/
COPY shadow_cache.h shadow/
COPY config.m4 shadow/
COPY shadow_diff.php shadow/
COPY tests shadow/
COPY sugarcrm shadow/
RUN cd shadow && \
# Copy extension source files
COPY shadow.c php_shadow.h shadow_cache.c shadow_cache.h config.m4 ${PHP_BUILD_DIR}/shadow/
COPY tests ${PHP_BUILD_DIR}/shadow/tests/
COPY shadow_diff.php ${PHP_BUILD_DIR}/shadow/
COPY sugarcrm ${PHP_BUILD_DIR}/shadow/sugarcrm/

# Build and install the PHP extension
RUN cd ${PHP_BUILD_DIR}/shadow && \
phpize && \
./configure && \
make && \
make install && \
echo "extension=${PHP_EXT_DIR}/shadow.so" > ${PHP_CONF_DIR}/shadow.ini
RUN cd shadow && \
echo "extension=shadow.so" > ${PHP_CONF_DIR}/shadow.ini

# Run tests for the PHP extension
RUN cd ${PHP_BUILD_DIR}/shadow && \
php run-tests.php --show-diff .
Loading