sudo: false
language: php

php:
  - 7.2
  - 7.1
  - 7.0
  - 5.6
  - 5.5

env:
  - SYMFONY_VERSION=3.4.*
  - SYMFONY_VERSION=3.3.*
  - SYMFONY_VERSION=3.2.*
  - SYMFONY_VERSION=3.1.*
  - SYMFONY_VERSION=3.0.*
  - SYMFONY_VERSION=2.8.*

matrix:
  fast_finish: true
  include:
    - php: 7.2
      env: SYMFONY_VERSION=4.0.*
    - php: 5.4
      env: SYMFONY_VERSION=2.8.*

before_script:
  - git clone --depth=50 --branch=2018.07 git://github.com/aimeos/aimeos-core.git ../aimeos-core
  - cd ../aimeos-core
  - mv ../ai-symfony ext/
  - if [[ $TRAVIS_PHP_VERSION != "hhvm" ]]; then echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi
  - travis_retry composer require "symfony/symfony:${SYMFONY_VERSION}" "zendframework/zend-diactoros:~1.0"
  - mysql -e 'create database aimeos;'
  - echo "<?php return array( 'db' => array( 'adapter' => 'mysql', 'host' => '127.0.0.1', 'database' => 'aimeos', 'username' => 'root', 'password' => '', 'limit' => 2, 'opt-persistent' => false, 'stmt' => array( \"SET SESSIOn sort_buffer_size=2097144; SET NAMES 'utf8'; SET SESSION sql_mode='ANSI'\" ) ), 'mq' => array( 'adapter' => 'Standard', 'db' => 'db' ) );" > config/resource.php

script:
  - vendor/bin/phing -Ddir=ext/ai-symfony setup coverageext checkext

after_success:
  - php vendor/bin/coveralls -c ext/ai-symfony/.coveralls.yml
