travis-init.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. set -e
  3. set -o pipefail
  4. if [[ "$TRAVIS_PHP_VERSION" != "hhvm" &&
  5. "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]]; then
  6. # install 'event' PHP extension
  7. echo "yes" | pecl install event
  8. # install 'libevent' PHP extension (does not support php 7)
  9. if [[ "$TRAVIS_PHP_VERSION" != "7.0" &&
  10. "$TRAVIS_PHP_VERSION" != "7.1" ]]; then
  11. curl http://pecl.php.net/get/libevent-0.1.0.tgz | tar -xz
  12. pushd libevent-0.1.0
  13. phpize
  14. ./configure
  15. make
  16. make install
  17. popd
  18. echo "extension=libevent.so" >> "$(php -r 'echo php_ini_loaded_file();')"
  19. fi
  20. # install 'libev' PHP extension (does not support php 7)
  21. if [[ "$TRAVIS_PHP_VERSION" != "7.0" &&
  22. "$TRAVIS_PHP_VERSION" != "7.1" ]]; then
  23. git clone --recursive https://github.com/m4rw3r/php-libev
  24. pushd php-libev
  25. phpize
  26. ./configure --with-libev
  27. make
  28. make install
  29. popd
  30. echo "extension=libev.so" >> "$(php -r 'echo php_ini_loaded_file();')"
  31. fi
  32. fi