From 0a639cd7f54ad8566099816c1ff3e24f21d142e0 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 22 Jan 2014 03:26:42 +0100 Subject: [PATCH 1/2] Add a folder for travis. --- .travis.yml | 4 ++-- {tests => travis}/code_coverage_id_rsa | 0 .../code_coverage_upload.sh => travis/upload-code-coverage.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename {tests => travis}/code_coverage_id_rsa (100%) rename tests/code_coverage_upload.sh => travis/upload-code-coverage.sh (93%) diff --git a/.travis.yml b/.travis.yml index d028aa13..e662d686 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ php: env: global: # Defines CODE_COVERAGE_PASSPHRASE which is the passphrase for unlocking - # the tests/code_coverage_id_rsa RSA private key. + # the travis/code_coverage_id_rsa RSA private key. - secure: "jtQTZKQBnzUlp/jz7NlM6470ZDnLGVAs53sgvIm4tcYqf9TWSXSXjIYvFsrS\nKPR2eyZaAevYysUkIGRFTUXTlG6tC36YngMp9+6FPxASl8mnGXsTbKcm613B\n59vD3242pgIgqhhmgFQ0c8gbvnE8PuF2aS4/hluP3r+AxhWN56E=" before_script: @@ -23,4 +23,4 @@ script: - phpunit --verbose --coverage-text --coverage-html code_coverage/ after_success: - - sh -c "if $TRAVIS_SECURE_ENV_VARS; then tests/code_coverage_upload.sh; fi" + - sh -c "if $TRAVIS_SECURE_ENV_VARS; then travis/upload-code-coverage.sh; fi" diff --git a/tests/code_coverage_id_rsa b/travis/code_coverage_id_rsa similarity index 100% rename from tests/code_coverage_id_rsa rename to travis/code_coverage_id_rsa diff --git a/tests/code_coverage_upload.sh b/travis/upload-code-coverage.sh similarity index 93% rename from tests/code_coverage_upload.sh rename to travis/upload-code-coverage.sh index 3231d9a5..668fb6a2 100755 --- a/tests/code_coverage_upload.sh +++ b/travis/upload-code-coverage.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# This file is part of the phpseclib test suite. +# This file is part of the phpseclib project. # # (c) Andreas Fischer # @@ -13,7 +13,7 @@ HOSTNAME='phpseclib.bantux.org' HOSTRSAF='09:40:96:14:6a:cd:67:46:17:e5:b4:39:24:24:6e:9d' LDIRNAME='code_coverage' RDIRNAME='code_coverage' -ID_RSA='tests/code_coverage_id_rsa' +ID_RSA='travis/code_coverage_id_rsa' # Install expect if necessary if ! which expect > /dev/null From 3084a30615dc625a60c2e73a11924f2e4f673002 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 22 Jan 2014 03:38:41 +0100 Subject: [PATCH 2/2] Put PHP extension installation into a shell script. --- .travis.yml | 3 +-- travis/install-php-extensions.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 travis/install-php-extensions.sh diff --git a/.travis.yml b/.travis.yml index e662d686..afe251b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,7 @@ env: - secure: "jtQTZKQBnzUlp/jz7NlM6470ZDnLGVAs53sgvIm4tcYqf9TWSXSXjIYvFsrS\nKPR2eyZaAevYysUkIGRFTUXTlG6tC36YngMp9+6FPxASl8mnGXsTbKcm613B\n59vD3242pgIgqhhmgFQ0c8gbvnE8PuF2aS4/hluP3r+AxhWN56E=" before_script: - - git clone git://github.com/zenovich/runkit.git && cd runkit && phpize && ./configure && make && make install && cd .. - - echo "extension=runkit.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` + - travis/install-php-extensions.sh - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' ]; then composer install --dev --no-interaction; fi" script: diff --git a/travis/install-php-extensions.sh b/travis/install-php-extensions.sh new file mode 100755 index 00000000..86715703 --- /dev/null +++ b/travis/install-php-extensions.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# +# This file is part of the phpseclib project. +# +# (c) Andreas Fischer +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +set -e + +function install_php_extension +{ + cd "$1" + phpize + ./configure + make + make install + cd .. + echo "extension=$1.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` +} + +# runkit +git clone git://github.com/zenovich/runkit.git +install_php_extension 'runkit'