Skip to content

Commit

Permalink
Merge pull request heroku#185 from heroku/develop
Browse files Browse the repository at this point in the history
v113
  • Loading branch information
dzuelke authored Oct 19, 2016
2 parents 5de1d27 + 87e22bd commit af70895
Show file tree
Hide file tree
Showing 58 changed files with 232 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sudo: false
script: exit 0
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# heroku-buildpack-php CHANGELOG

## v113 (2016-10-19)

### ADD

- ext-newrelic/6.7.0 [David Zuelke]
- ext-blackfire/1.13.0 [David Zuelke]
- ext-apcu/5.1.6 [David Zuelke]
- PHP/5.6.27 [David Zuelke]
- PHP/7.0.12 [David Zuelke]
- ext-rdkafka/1.0.0 [David Zuelke]
- ext-rdkafka/2.0.0 [David Zuelke]

## v112 (2016-09-20)

### FIX
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Heroku buildpack: PHP
# Heroku buildpack: PHP [![Build Status](https://travis-ci.org/heroku/heroku-buildpack-php.svg?branch=master)](https://travis-ci.org/heroku/heroku-buildpack-php)

![php](https://cloud.githubusercontent.com/assets/51578/8882982/73ea501a-3219-11e5-8f87-311e6b8a86fc.jpg)

Expand Down
4 changes: 2 additions & 2 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fi
mkdir -p $build_dir/.heroku/php-min
ln -s $build_dir/.heroku/php-min /app/.heroku/php-min

curl_retry_on_18 --silent --location -o $build_dir/.heroku/php-min.tar.gz "${s3_url}php-min-7.0.11.tar.gz" || error "Failed to download minimal PHP for bootstrapping.
curl_retry_on_18 --silent --location -o $build_dir/.heroku/php-min.tar.gz "${s3_url}php-min-7.0.12.tar.gz" || error "Failed to download minimal PHP for bootstrapping.
Please try again, or contact support if this problem persists."
tar xzf $build_dir/.heroku/php-min.tar.gz -C $build_dir/.heroku/php-min
rm $build_dir/.heroku/php-min.tar.gz
Expand Down Expand Up @@ -223,7 +223,7 @@ This directory should not be under version control; only your
'$COMPOSER' and '$COMPOSER_LOCK' files should be added, which
will let Composer handle installation of dependencies on deploy.
To suppress this notice, first remove the folder from your index
by running 'git rm --cached $composer_vendordir/'.
by running 'git rm -r --cached $composer_vendordir/'.
Next, edit your project's '.gitignore' file and add the folder
'/$composer_vendordir/' to the list.$composer_warn_bindir
For more info, refer to the Composer FAQ: http://bit.ly/1rlCSZU"
Expand Down
2 changes: 1 addition & 1 deletion bin/heroku-hhvm-apache2
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ hhvm --php -r 'exit((int)version_compare(HHVM_VERSION, "3.0.1", "<"));' || { ech
composer() {
local composer_bin=$(which ./composer.phar composer | head -n1)
# check if we the composer binary is executable by PHP
if file --brief --dereference $composer_bin | grep "bash" > /dev/null ; then # newer versions of file return "data" for .phar
if file --brief --dereference $composer_bin | grep -e "shell" -e "bash" > /dev/null ; then # newer versions of file return "data" for .phar
# run it directly; it's probably a bash script or similar (homebrew-php does this)
$composer_bin "$@"
else
Expand Down
2 changes: 1 addition & 1 deletion bin/heroku-hhvm-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ hhvm --php -r 'exit((int)version_compare(HHVM_VERSION, "3.0.1", "<"));' || { ech
composer() {
local composer_bin=$(which ./composer.phar composer | head -n1)
# check if we the composer binary is executable by HHVM
if file --brief --dereference $composer_bin | grep "bash" > /dev/null ; then # newer versions of file return "data" for .phar
if file --brief --dereference $composer_bin | grep -e "shell" -e "bash" > /dev/null ; then # newer versions of file return "data" for .phar
# run it directly; it's probably a bash script or similar (homebrew-php does this)
$composer_bin "$@"
else
Expand Down
2 changes: 1 addition & 1 deletion bin/heroku-php-apache2
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ php -n -r 'exit((int)version_compare(PHP_VERSION, "5.5.11", "<"));' || { echo "T
composer() {
local composer_bin=$(which ./composer.phar composer | head -n1)
# check if we the composer binary is executable by PHP
if file --brief --dereference $composer_bin | grep "bash" > /dev/null ; then # newer versions of file return "data" for .phar
if file --brief --dereference $composer_bin | grep -e "shell" -e "bash" > /dev/null ; then # newer versions of file return "data" for .phar
# run it directly; it's probably a bash script or similar (homebrew-php does this)
$composer_bin "$@"
else
Expand Down
2 changes: 1 addition & 1 deletion bin/heroku-php-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ unset -f php-fpm # remove the alias we made earlier that would prevent newrelic
composer() {
local composer_bin=$(which ./composer.phar composer | head -n1)
# check if we the composer binary is executable by PHP
if file --brief --dereference $composer_bin | grep "bash" > /dev/null ; then # newer versions of file return "data" for .phar
if file --brief --dereference $composer_bin | grep -e "shell" -e "bash" > /dev/null ; then # newer versions of file return "data" for .phar
# run it directly; it's probably a bash script or similar (homebrew-php does this)
$composer_bin "$@"
else
Expand Down
5 changes: 3 additions & 2 deletions bin/util/platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function hasreq($require) { return isset($require["php"]) || isset($require["hhv
if(file_exists($COMPOSER_LOCK)) {
$lock = json_decode(file_get_contents($COMPOSER_LOCK), true);
// basic lock file validity check
if(!$lock || !isset($lock["platform"], $lock["packages"], $lock["hash"])) exit(1);
if(!$lock || !isset($lock["platform"], $lock["packages"])) exit(1);
if(!isset($lock["content-hash"]) && !isset($lock["hash"])) exit(1);
$have_runtime_req |= hasreq($lock["platform"]);
// for each package that has platform requirements we build a meta-package that we then depend on
// we cannot simply join all those requirements together with " " or "," because of the precedence of the "|" operator: requirements "5.*," and "^5.3.9|^7.0", which should lead to a PHP 5 install, would combine into "5.*,^5.3.9|^7.0" (there is no way to group requirements), and that would give PHP 7
Expand All @@ -40,7 +41,7 @@ function hasreq($require) { return isset($require["php"]) || isset($require["hhv
// if we do not do this, then a require for e.g. ext-curl or ext-mbstring in the main composer.json cannot be found by the installer plugin
$root = [
"name" => "$COMPOSER/$COMPOSER_LOCK",
"version" => "dev-".$lock["hash"],
"version" => "dev-".($lock["content-hash"] ?? $lock['hash']),
"require" => $lock["platform"],
];
if($root["require"]) {
Expand Down
9 changes: 5 additions & 4 deletions support/build/_docker/cedar-14.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ FROM heroku/cedar:14
WORKDIR /app
ENV WORKSPACE_DIR=/app/support/build

RUN apt-get update
RUN apt-get install -y python-pip
RUN apt-get update && apt-get install -y python-pip

RUN pip install 'bob-builder>=0.0.10' 's3cmd>=1.6.0'
COPY requirements.txt /app/requirements.txt

ADD . /app
RUN pip install -r /app/requirements.txt

COPY . /app
4 changes: 2 additions & 2 deletions support/build/_util/include/manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ print_or_export_manifest_cmd() {
}

generate_manifest_cmd() {
echo "s3cmd --ssl${AWS_ACCESS_KEY_ID+" --access_key=\$AWS_ACCESS_KEY_ID"}${AWS_SECRET_ACCESS_KEY+" --secret_key=\$AWS_SECRET_ACCESS_KEY"} --acl-public put $(pwd)/${1} s3://${S3_BUCKET}/${S3_PREFIX}${1}"
}
echo "s3cmd --ssl${AWS_ACCESS_KEY_ID+" --access_key=\$AWS_ACCESS_KEY_ID"}${AWS_SECRET_ACCESS_KEY+" --secret_key=\$AWS_SECRET_ACCESS_KEY"} --acl-public -m application/json put $(pwd)/${1} s3://${S3_BUCKET}/${S3_PREFIX}${1}"
}
2 changes: 1 addition & 1 deletion support/build/_util/mkrepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if $redir; then
exec 1>&3 3>&-
fi

cmd="s3cmd --ssl${AWS_ACCESS_KEY_ID+" --access_key=\$AWS_ACCESS_KEY_ID"}${AWS_SECRET_ACCESS_KEY+" --secret_key=\$AWS_SECRET_ACCESS_KEY"} --acl-public put packages.json s3://${S3_BUCKET}/${S3_PREFIX}packages.json"
cmd="s3cmd --ssl${AWS_ACCESS_KEY_ID+" --access_key=\$AWS_ACCESS_KEY_ID"}${AWS_SECRET_ACCESS_KEY+" --secret_key=\$AWS_SECRET_ACCESS_KEY"} --acl-public -m application/json put packages.json s3://${S3_BUCKET}/${S3_PREFIX}packages.json"
if $upload; then
echo "-----> Uploading packages.json..." >&2
eval "$cmd 1>&2"
Expand Down
2 changes: 1 addition & 1 deletion support/build/_util/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ for manifest in $add_manifests ${update_manifests[@]:-}; do
cp ${src_tmp}/${manifest} ${dst_tmp}/${manifest}
fi
echo -n " - copying manifest file '$manifest'... " >&2
out=$(s3cmd ${AWS_ACCESS_KEY_ID+"--access_key=$AWS_ACCESS_KEY_ID"} ${AWS_SECRET_ACCESS_KEY+"--secret_key=$AWS_SECRET_ACCESS_KEY"} --ssl --acl-public put ${dst_tmp}/${manifest} s3://${dst_bucket}/${dst_prefix}${manifest} 2>&1) || { echo -e "failed! Error:\n$out" >&2; exit 1; }
out=$(s3cmd ${AWS_ACCESS_KEY_ID+"--access_key=$AWS_ACCESS_KEY_ID"} ${AWS_SECRET_ACCESS_KEY+"--secret_key=$AWS_SECRET_ACCESS_KEY"} --ssl --acl-public -m application/json put ${dst_tmp}/${manifest} s3://${dst_bucket}/${dst_prefix}${manifest} 2>&1) || { echo -e "failed! Error:\n$out" >&2; exit 1; }
echo "done." >&2
done

Expand Down
2 changes: 1 addition & 1 deletion support/build/composer-1.2.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-min-7.0.11
# Build Deps: php-min-7.0.12

source $(dirname $0)/composer
41 changes: 41 additions & 0 deletions support/build/extensions/no-debug-non-zts-20121212/rdkafka
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/

# fail hard
set -o pipefail
# fail harder
set -eu

source $(dirname $BASH_SOURCE)/../../_util/include/manifest.sh

OUT_PREFIX=$1

ZEND_MODULE_API_VERSION=$(basename $(dirname $0))
ZEND_MODULE_API_VERSION=${ZEND_MODULE_API_VERSION#no-debug-non-zts-}

dep_formula=${0#$WORKSPACE_DIR/}
dep_name=$(basename $BASH_SOURCE)
dep_version=${dep_formula##*"/${dep_name}-"}
dep_package=ext-${dep_name}-${dep_version}
case ${ZEND_MODULE_API_VERSION} in
20121212)
series=5.5
;;
20131226)
series=5.6
;;
*)
series=7.0
esac
dep_manifest=${dep_package}_php-$series.composer.json

echo "-----> Merging dependencies..."

MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\"}"}"
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{\"heroku-sys/hhvm\":\"*\"}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{}"}"
MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"

python $(dirname $BASH_SOURCE)/../../_util/include/manifest.py "heroku-sys-php-extension" "heroku-sys/ext-${dep_name}" "$dep_version" "${dep_formula}.tar.gz" "$MANIFEST_REQUIRE" "$MANIFEST_CONFLICT" "$MANIFEST_REPLACE" "$MANIFEST_EXTRA" > $dep_manifest

print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: extensions/no-debug-non-zts-20121212/rdkafka-bare-1.0.0, libraries/librdkafka-0.9.2-RC1

source $(dirname $0)/rdkafka
47 changes: 47 additions & 0 deletions support/build/extensions/no-debug-non-zts-20121212/rdkafka-bare
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

# fail hard
set -o pipefail
# fail harder
set -eu

source $(dirname $BASH_SOURCE)/../../_util/include/manifest.sh

OUT_PREFIX=$1

export PATH=${OUT_PREFIX}/bin:${PATH}

dep_formula=${0#$WORKSPACE_DIR/}
dep_name=$(basename $BASH_SOURCE)
dep_version=${dep_formula##*"/${dep_name}-"}
dep_package=pkg-ext-${dep_name}-${dep_version}
dep_dirname=rdkafka-${dep_version}
dep_archive_name=${dep_dirname}.tgz
dep_url=http://pecl.php.net/get/${dep_archive_name}
series=$(php-config --version | cut -d. -f1,2) # get "5.5", "5.6", "7.0" etc for the php requirement in the manifest
dep_manifest=${dep_package}_php-$series.composer.json

echo "-----> Building ${dep_package} (from PECL)..."

curl -L ${dep_url} | tar xz

pushd ${dep_dirname}
phpize
./configure \
--prefix=${OUT_PREFIX} \
--with-rdkafka=${OUT_PREFIX}
make -s -j 9
# php was a build dep, and it's in $OUT_PREFIX. nuke that, then make install so all we're left with is the extension
rm -rf ${OUT_PREFIX}/*
make install -s
strip --strip-unneeded ${OUT_PREFIX}/lib/php/extensions/*/*.so
popd

MANIFEST_REQUIRE="${MANIFEST_REQUIRE:-"{\"heroku-sys/php\":\"${series}.*\"}"}"
MANIFEST_CONFLICT="${MANIFEST_CONFLICT:-"{\"heroku-sys/hhvm\":\"*\"}"}"
MANIFEST_EXTRA="${MANIFEST_EXTRA:-"{}"}"
MANIFEST_REPLACE="${MANIFEST_REPLACE:-"{}"}"

python $(dirname $BASH_SOURCE)/../../_util/include/manifest.py "heroku-sys-php-package" "heroku-sys/ext-${dep_name}" "$dep_version" "${dep_formula}.tar.gz" "$MANIFEST_REQUIRE" "$MANIFEST_CONFLICT" "$MANIFEST_REPLACE" "$MANIFEST_EXTRA" > $dep_manifest

print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.5.38, libraries/librdkafka-0.9.2-RC1

source $(dirname $0)/rdkafka-bare
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/apcu
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26, libraries/libcassandra-2.4.2
# Build Deps: php-5.6.27
, libraries/libcassandra-2.4.2

source $(dirname $0)/../no-debug-non-zts-20121212/cassandra-bare
3 changes: 2 additions & 1 deletion support/build/extensions/no-debug-non-zts-20131226/ev-1.0.3
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/ev
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/event
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/imagick
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26, libraries/libmemcached-1.0.18
# Build Deps: php-5.6.27
, libraries/libmemcached-1.0.18

source $(dirname $0)/../no-debug-non-zts-20121212/memcached-bare
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/mongo
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/mongodb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/oauth
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/phalcon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/phalcon
3 changes: 2 additions & 1 deletion support/build/extensions/no-debug-non-zts-20131226/pq-1.1.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26, extensions/no-debug-non-zts-20131226/raphf-1.1.2
# Build Deps: php-5.6.27
, extensions/no-debug-non-zts-20131226/raphf-1.1.2

source $(dirname $0)/../no-debug-non-zts-20121212/pq
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/raphf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: extensions/no-debug-non-zts-20131226/rdkafka-bare-1.0.0, libraries/librdkafka-0.9.2-RC1

source $(dirname $0)/../no-debug-non-zts-20121212/rdkafka
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.27, libraries/librdkafka-0.9.2-RC1

source $(dirname $0)/../no-debug-non-zts-20121212/rdkafka-bare
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-5.6.26
# Build Deps: php-5.6.27


source $(dirname $0)/../no-debug-non-zts-20121212/redis
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-7.0.11
# Build Deps: php-7.0.12

source $(dirname $0)/apcu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# Build Deps: php-7.0.11, libraries/libcassandra-2.4.2
# Build Deps: php-7.0.12, libraries/libcassandra-2.4.2

source $(dirname $0)/../no-debug-non-zts-20121212/cassandra-bare
Loading

0 comments on commit af70895

Please sign in to comment.