Skip to content

Commit

Permalink
upgrade PHP to 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Spine authored and itismadness committed Aug 20, 2021
1 parent bec6976 commit 7ad18fd
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .docker/web/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ if [ ! -d /var/lib/gazelle/torrent ]; then
chown -R gazelle /var/lib/gazelle
fi

if [ ! -f /etc/php/7.3/cli/conf.d/99-boris.ini ]; then
if [ ! -f /etc/php/8.0/cli/conf.d/99-boris.ini ]; then
echo "Initialize Boris..."
grep '^disable_functions' /etc/php/7.3/cli/php.ini \
| sed -r 's/pcntl_(fork|signal|signal_dispatch|waitpid),//g' \
> /etc/php/7.3/cli/conf.d/99-boris.ini
> /etc/php/8.0/cli/conf.d/99-boris.ini
fi

echo "Start services..."

run_service cron
run_service nginx
run_service php7.3-fpm
run_service php8.0-fpm

crontab /var/www/.docker/web/crontab

Expand Down
45 changes: 28 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ WORKDIR /var/www

# Software package layer
# Nodesource setup comes after yarnpkg because it runs `apt-get update`
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
RUN apt update \
&& apt install -y --no-install-recommends \
apt-transport-https \
build-essential \
ca-certificates \
gnupg2 \
wget \
&& wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add - \
&& echo "deb https://packages.sury.org/php/ buster main" | tee /etc/apt/sources.list.d/php.list \
&& apt update \
&& apt install -y --no-install-recommends \
composer \
cron \
curl \
git \
gnupg \
imagemagick \
libboost-dev \
libbz2-dev \
Expand All @@ -23,14 +29,15 @@ RUN apt-get update \
mariadb-client \
netcat-openbsd \
nginx \
php7.3-cli \
php7.3-curl \
php7.3-fpm \
php7.3-gd \
php7.3-mbstring \
php7.3-mysql \
php7.3-xml \
php7.3-zip \
php8.0 \
php8.0-cli \
php8.0-curl \
php8.0-fpm \
php8.0-gd \
php8.0-mbstring \
php8.0-mysql \
php8.0-xml \
php8.0-zip \
php-apcu \
php-bcmath \
php-memcached \
Expand All @@ -48,14 +55,17 @@ RUN apt-get update \
&& curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y --no-install-recommends \
nodejs \
yarn
yarn \
&& apt autoremove \
&& rm -rf /var/lib/apt/lists/*

# Python tools layer
RUN pip3 install chardet eac-logchecker xld-logchecker

# Puppeteer layer
# This installs the necessary packages to run the bundled version of chromium for puppeteer
RUN apt-get install -y --no-install-recommends \
RUN apt update \
&& apt install -y --no-install-recommends \
gconf-service \
libasound2 \
libatk1.0-0 \
Expand Down Expand Up @@ -92,6 +102,7 @@ RUN apt-get install -y --no-install-recommends \
libnss3 \
lsb-release \
xdg-utils \
&& apt autoremove \
&& rm -rf /var/lib/apt/lists/*

# If running Docker >= 1.13.0 use docker run's --init arg to reap zombie processes, otherwise
Expand All @@ -110,10 +121,10 @@ COPY . /var/www
# Permissions and configuration layer
RUN useradd -ms /bin/bash gazelle \
&& chown -R gazelle:gazelle /var/www \
&& cp /var/www/.docker/web/php.ini /etc/php/7.3/cli/php.ini \
&& cp /var/www/.docker/web/php.ini /etc/php/7.3/fpm/php.ini \
&& cp /var/www/.docker/web/xdebug.ini /etc/php/7.3/mods-available/xdebug.ini \
&& cp /var/www/.docker/web/www.conf /etc/php/7.3/fpm/pool.d/www.conf \
&& cp /var/www/.docker/web/php.ini /etc/php/8.0/cli/php.ini \
&& cp /var/www/.docker/web/php.ini /etc/php/8.0/fpm/php.ini \
&& cp /var/www/.docker/web/xdebug.ini /etc/php/8.0/mods-available/xdebug.ini \
&& cp /var/www/.docker/web/www.conf /etc/php/8.0/fpm/pool.d/www.conf \
&& cp /var/www/.docker/web/nginx.conf /etc/nginx/sites-available/gazelle.conf \
&& ln -s /etc/nginx/sites-available/gazelle.conf /etc/nginx/sites-enabled/gazelle.conf \
&& rm -f /etc/nginx/sites-enabled/default
Expand Down
6 changes: 5 additions & 1 deletion sections/tools/managers/tags_official.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@
<td>&nbsp;</td>
<?php
}
if (count($list[$col]) <= $row) {
if (!isset($list[$col])) {
?>
<td colspan="3">&nbsp;</td>
<?php
} elseif (count($list[$col]) <= $row) {
?>
<td colspan="3">&nbsp;</td>
<?php } else { ?>
Expand Down
6 changes: 3 additions & 3 deletions sections/tools/misc/analysis.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
View::show_header('Case Analysis');
?>
<div class="header">
<h2>Case Analysis (<a href="<?=display_str($Analysis['url'])?>"><?=$_GET['case']?></a>)</h2>
<h2>Case Analysis (<a href="<?=display_str($Analysis['url'] ?? '-none-')?>"><?=$_GET['case']?></a>)</h2>
</div>
<div class="linkbox">
<a href="tools.php?action=analysis_list" class="brackets">Error list</a>
Expand All @@ -33,8 +33,8 @@
if (check_perms('admin_periodic_task_view') && array_key_exists('Script start', $Analysis['perf'])) {
echo $Twig->render('debug/task.twig', [
'list' => (new \Gazelle\Schedule\Scheduler)->getTaskSnapshot(
$Analysis['perf']['Script start'],
$Analysis['perf']['Script end']
(float)$Analysis['perf']['Script start'],
(float)$Analysis['perf']['Script end']
)
]);
}
Expand Down

0 comments on commit 7ad18fd

Please sign in to comment.