language: php

php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6

env:
  - MONGODB_VERSION=alpha

services: mongodb

before_script:
  - mongo --eval 'tojson(db.runCommand({buildInfo:1}))'
  - pecl install -f mongodb-${MONGODB_VERSION}
  - php --ri mongodb
  - composer install --dev --no-interaction --prefer-source

language: php

php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6

env:
  global:
    - KEY_SERVER="hkp://keyserver.ubuntu.com:80"
    - MONGO_REPO_URI="http://repo.mongodb.com/apt/ubuntu"
    - MONGO_REPO_TYPE="precise/mongodb-enterprise/"
    - SOURCES_LOC="/etc/apt/sources.list.d/mongodb.list"
  matrix:
    - DRIVER_VERSION=alpha SERVER_VERSION=2.4
    - DRIVER_VERSION=alpha SERVER_VERSION=2.6
    - DRIVER_VERSION=alpha SERVER_VERSION=3.0

before_install:
  - sudo apt-key adv --keyserver ${KEY_SERVER} --recv 7F0CEB10
  - echo "deb ${MONGO_REPO_URI} ${MONGO_REPO_TYPE}${SERVER_VERSION} multiverse" | sudo tee ${SOURCES_LOC}
  - sudo apt-get update -qq

install:
  - if dpkg --compare-versions ${SERVER_VERSION} le "2.4"; then export SERVER_PACKAGE=mongodb-10gen-enterprise; else export SERVER_PACKAGE=mongodb-enterprise; fi
  - sudo apt-get install ${SERVER_PACKAGE}

before_script:
  - mongod --version
  - pecl install -f mongodb-${DRIVER_VERSION}
  - php --ri mongodb
  - composer install --dev --no-interaction --prefer-source

Add multiple server versions to Travis CI
PHPLIB-98: Add multiple server versions to Travis CI
