sudo: false

addons:
  apt:
    packages:
      - unzip
      - unrar
      - p7zip-full
      - p7zip-rar
      - cabextract

cache:
  directories:
    - $HOME/.composer/cache/files

language: php

env:
  - COMPOSER_FLAGS="--prefer-source"

php:
  - 5.4
  - 5.5
  - 5.6
  - hhvm
  - 7.0

matrix:
  fast_finish: true
  include:
    - php: 5.4
      env: COMPOSER_FLAGS="--prefer-lowest"

before_script:
  - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then pecl install rar; fi;'
  - sh -c 'if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then echo "phar.readonly = 0" > travis.hhvm.ini; fi;'
  - composer self-update
  - composer update $COMPOSER_FLAGS

script:
  - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpunit --verbose; else hhvm -c travis.hhvm.ini ~/.phpenv/versions/$(phpenv version-name)/bin/phpunit; fi
