Last active
August 29, 2015 14:13
-
-
Save nojimage/42710830aa28bfb31363 to your computer and use it in GitHub Desktop.
php-build after-install.d
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
#!/usr/bin/env bash | |
TMP="/var/tmp/php-build" | |
PHP="/usr/bin/env php" | |
download_timecop() { | |
local timecop_url="$1" | |
if [ -z "$timecop_url" ]; then | |
timecop_url="https://github.com/hnw/php-timecop.git" | |
fi | |
if [ ! -d "$TMP/source/php-timecop" ]; then | |
echo "php-timecop" "Downloading from $timecop_url" >&3 | |
git clone $timecop_url "$TMP/source/php-timecop" | |
else | |
echo "php-timecop" "self updating in $TMP/source/php-timecop" >&3 | |
cd "$TMP/source/php-timecop" && git pull origin master | |
fi | |
} | |
install_timecop() { | |
download_timecop | |
echo "php-timecop" "Build & Installing " >&3 | |
cd "$TMP/source/php-timecop" && "$PREFIX/bin/php" --ri timecop || ("$PREFIX/bin/phpize" && ./configure && make clean && make && make install) | |
echo "php-timecop" "Setup" >&3 | |
echo "extension=timecop.so" > "$PREFIX/etc/conf.d/timecop.ini" | |
} | |
install_timecop |
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
#!/bin/bash | |
set -e | |
if [ -n "$PHP_BUILD_DEBUG" ]; then | |
set -x | |
fi | |
composer="$PREFIX/bin/composer" | |
use_composer() { | |
"$composer" self-update | |
"$composer" global require squizlabs/php_codesniffer:"*" | |
if "$PREFIX/bin/php" -v | grep "PHP 5.3"; then | |
"$composer" global require apigen/apigen:"~2.8" | |
else | |
"$composer" global require apigen/apigen:"~4.0" | |
fi | |
} | |
if [ -f "$composer" ]; then | |
use_composer | |
else | |
echo "Neither composer found in $PREFIX/bin. Aborting" >&3 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
composerのインストールは、
https://github.com/rogeriopradoj/php-build-plugin-composer