install-extension.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. # This file was copied from the MongoDB library at https://github.com/mongodb/mongo-php-library.
  3. # Copyright is (c) MongoDB, Inc.
  4. INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  5. if [ "x${DRIVER_BRANCH}" != "x" ] || [ "x${DRIVER_REPO}" != "x" ]; then
  6. CLONE_REPO=${DRIVER_REPO:-https://github.com/mongodb/mongo-php-driver}
  7. CHECKOUT_BRANCH=${DRIVER_BRANCH:-master}
  8. echo "Compiling driver branch ${CHECKOUT_BRANCH} from repository ${CLONE_REPO}"
  9. mkdir -p /tmp/compile
  10. git clone ${CLONE_REPO} /tmp/compile/mongo-php-driver
  11. cd /tmp/compile/mongo-php-driver
  12. git checkout ${CHECKOUT_BRANCH}
  13. git submodule update --init
  14. phpize
  15. ./configure --enable-mongodb-developer-flags
  16. make all -j20 > /dev/null
  17. make install
  18. echo "extension=mongodb.so" >> `php --ini | grep "Scan for additional .ini files in" | sed -e "s|.*:\s*||"`/mongodb.ini
  19. elif [ "x${DRIVER_VERSION}" != "x" ]; then
  20. echo "Installing driver version ${DRIVER_VERSION} from PECL"
  21. pecl install -f mongodb-${DRIVER_VERSION}
  22. else
  23. echo "Installing latest driver version from PECL"
  24. pecl install -f mongodb
  25. fi