#sudo: false

language: php

php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6
  - hhvm
  - nightly

before_install:
  - sudo apt-get update
  - sudo apt-get install -qq php5-interbase firebird2.5-super
  - echo "extension = interbase.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  - echo "extension = firebird.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  - echo "zend_extension = interbase.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  - echo "zend_extension = firebird.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

install:
  - sudo chmod 777 tests/db_files/FB_TEST_DB.FDB
  #- sudo pecl install -f pdo_firebird-0.2

before_script:
  - sudo service firebird2.5-super start
  - psql -c 'DROP DATABASE IF EXISTS test;' -U postgres
  - psql -c 'create database test;' -U postgres
  - mysql -e 'create database IF NOT EXISTS test;'

script:
  - mkdir -p build/logs
  - phpunit --coverage-clover build/logs/clover.xml

after_script:
    - wget https://scrutinizer-ci.com/ocular.phar
    - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml

matrix:
  allow_failures:
    - php: 5.3
    - php: hhvm