Skip to content

Commit

Permalink
Upgrade PHP version
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed May 9, 2018
1 parent 7c11520 commit b5d4139
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
25 changes: 15 additions & 10 deletions bin/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,26 @@ WORKDIR /php-src-$PHP_VERSION
RUN ./buildconf --force

RUN ./configure \
# make sure invalid --configure-flags are fatal errors intead of just warnings
--enable-option-checking=fatal \
--enable-static=yes \
--enable-shared=no \
--disable-all \
--enable-hash \
--enable-json \
--enable-libxml \
--disable-cgi \
--disable-fpm \
--disable-phpdbg \
# --enable-ftp is included here because ftp_ssl_connect() needs ftp to be compiled statically (see https://github.com/docker-library/php/issues/236)
--enable-ftp \
# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
--enable-mbstring \
--enable-phar \
--enable-mysqlnd \
--enable-soap \
--enable-xml \
--enable-zip \
--with-curl \
--with-gd \
--with-zlib \
--with-openssl \
--without-pear \
--enable-ctype
--with-zlib \
--with-gd \
# https://github.com/docker-library/php/issues/439
--with-mhash \
--without-pear

RUN make -j 5
2 changes: 1 addition & 1 deletion bin/php/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

set -e

PHP_VERSION_GIT_BRANCH=php-7.2.2
PHP_VERSION_GIT_BRANCH=php-7.2.5

echo "Build PHP Binary from current branch '$PHP_VERSION_GIT_BRANCH' on https://github.com/php/php-src"

Expand Down
10 changes: 6 additions & 4 deletions bref
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Yaml\Yaml;

const PHP_VERSION = '7.2.5';

if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/../autoload.php')) {
Expand Down Expand Up @@ -75,18 +77,18 @@ $app->command('deploy', function (SymfonyStyle $io) {
}

// Cache PHP's binary in `.bref/bin/php`
if (!$fs->exists('.bref/bin/php/php-7.2.2.tar.gz')) {
if (!$fs->exists('.bref/bin/php/php-' . PHP_VERSION . '.tar.gz')) {
$io->writeln('Downloading PHP in the `.bref/bin/` directory');
$fs->mkdir('.bref/bin/php');
$defaultUrl = 'https://s3.amazonaws.com/bref-php/bin/php-7.2.2.tar.gz';
$defaultUrl = 'https://s3.amazonaws.com/bref-php/bin/php-' . PHP_VERSION . '.tar.gz';
// TODO document this option
$url = $projectConfig['php'] ?? $defaultUrl;
$commandRunner->run("curl -sSL $url -o .bref/bin/php/php-7.2.2.tar.gz");
$commandRunner->run("curl -sSL $url -o .bref/bin/php/php-' . PHP_VERSION . '.tar.gz");
}

$io->writeln('Installing the PHP binary');
$fs->mkdir('.bref/output/.bref/bin');
$commandRunner->run('tar -xzf .bref/bin/php/php-7.2.2.tar.gz -C .bref/output/.bref/bin');
$commandRunner->run('tar -xzf .bref/bin/php/php-' . PHP_VERSION . '.tar.gz -C .bref/output/.bref/bin');

$io->writeln('Installing `handler.js`');
$fs->copy(__DIR__ . '/template/handler.js', '.bref/output/handler.js');
Expand Down

0 comments on commit b5d4139

Please sign in to comment.