Skip to content

Commit

Permalink
Use a 2-step update process to install requirements
Browse files Browse the repository at this point in the history
The mongodb-adapter has to be installed while ignoring platform reqs,
then it can be ignored again, see https://github.com/alcaeus/mongo-php-adapter
  • Loading branch information
greg0ire committed Nov 8, 2017
1 parent 5554b88 commit 40c5bb3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
23 changes: 9 additions & 14 deletions .travis/before_install_test.sh
@@ -1,23 +1,18 @@
#!/usr/bin/env sh
set -ev

PHP_INI_DIR="$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/"
TRAVIS_INI_FILE="$PHP_INI_DIR/travis.ini"
if [ "$DOCTRINE_ODM" != "" ]
then
composer require "doctrine/mongodb-odm:$DOCTRINE_ODM" --no-update
echo "extension=mongodb.so" >> "$TRAVIS_INI_FILE"
fi

if [ "${TRAVIS_PHP_VERSION}" != "hhvm" ]; then
PHP_INI_DIR="$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/"
TRAVIS_INI_FILE="$PHP_INI_DIR/travis.ini"
echo "memory_limit=3072M" >> "$TRAVIS_INI_FILE"


if [ "$TRAVIS_PHP_VERSION" '<' '7.0' ]; then
echo "extension=mongo.so" >> "$TRAVIS_INI_FILE"
else
echo "extension=mongodb.so" >> "$TRAVIS_INI_FILE"

# Backwards compatibility with old mongo extension
composer require "alcaeus/mongo-php-adapter" --no-update
fi
fi
fi

sed --in-place "s/\"dev-master\":/\"dev-${TRAVIS_COMMIT}\":/" composer.json

if [ "$SYMFONY" != "" ]; then composer require "symfony/symfony:$SYMFONY" --no-update; fi;
if [ "$DOCTRINE_ODM" != "" ]; then composer require "doctrine/mongodb-odm:$DOCTRINE_ODM" --no-update; fi;
12 changes: 6 additions & 6 deletions .travis/install_test.sh
Expand Up @@ -4,12 +4,7 @@ set -ev
mkdir --parents "${HOME}/bin"

# PHPUnit install
if [ ${TRAVIS_PHP_VERSION} '<' '5.6' ]; then
PHPUNIT_PHAR=phpunit-4.8.phar
else
PHPUNIT_PHAR=phpunit-5.7.phar
fi
wget "https://phar.phpunit.de/${PHPUNIT_PHAR}" --output-document="${HOME}/bin/phpunit"
wget "https://phar.phpunit.de/phpunit-5.7.phar" --output-document="${HOME}/bin/phpunit"
chmod u+x "${HOME}/bin/phpunit"

# Coveralls client install
Expand All @@ -23,4 +18,9 @@ if [ "${COMPOSER_FLAGS}" = '--prefer-lowest' ]; then
composer update --prefer-dist --no-interaction --prefer-stable --quiet --ignore-platform-reqs
fi

if [ "$DOCTRINE_ODM" != "" ]
then
# Backwards compatibility with old mongo extension
composer require "alcaeus/mongo-php-adapter" --ignore-platform-reqs
fi
composer update --prefer-dist --no-interaction --prefer-stable ${COMPOSER_FLAGS}

0 comments on commit 40c5bb3

Please sign in to comment.