-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: Add ability to switch seamlessly between PHP7 and PHP8 (#313)
- Loading branch information
1 parent
fa24517
commit cf97f64
Showing
6 changed files
with
82 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
PHP_MAJOR_VERSION=$(php -v | head -n 1 | awk '{print $2}' | cut -d. -f1) | ||
|
||
# Install build dependencies. | ||
pre_build() { | ||
apk add git g++ autoconf | ||
} | ||
|
||
# APCu: https://php.net/apcu | ||
apcu() { | ||
cd /tmp | ||
|
||
git clone --depth 1 --branch v5.1.19 https://github.com/krakjoe/apcu && cd apcu | ||
|
||
phpize | ||
./configure --with-php-config=/usr/local/bin/php-config | ||
|
||
make | ||
make install | ||
|
||
rm -rf /tmp/apcu | ||
} | ||
|
||
# Xdebug: https://xdebug.org | ||
xdebug() { | ||
cd /tmp | ||
|
||
branch="2.9.8" | ||
if [[ ${PHP_MAJOR_VERSION} == "8" ]]; then | ||
branch="3.0.0beta1" | ||
fi | ||
|
||
git clone --depth 1 --branch ${branch} https://github.com/xdebug/xdebug && cd xdebug | ||
|
||
phpize | ||
./configure --enable-xdebug | ||
|
||
make | ||
make install | ||
|
||
rm -rf /tmp/xdebug | ||
} | ||
|
||
# Remove build dependencies. | ||
post_build() { | ||
apk del git g++ autoconf | ||
} | ||
|
||
pre_build | ||
apcu | ||
xdebug | ||
post_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
zend_extension = xdebug.so | ||
xdebug.mode = develop,coverage | ||
xdebug.start_with_request = yes | ||
xdebug.client_host = host.docker.internal | ||
xdebug.client_port = 9999 | ||
xdebug.output_dir = /var/log/xdebug |