language: php

php:
  - 5.2
  - 5.3
  - 5.4
  - 5.5

env:
  - CAKE_VERSION=2.3.8

matrix:
  include:
    - php: 5.5
      env: CAKE_VERSION=2.2.9
    - php: 5.5
      env: CAKE_VERSION=2.1.5
    - php: 5.5
      env: PHPCS=1
      git:
        submodules: false

before_install:
  - sh -c "if [ '$PHPCS' != '1' ]; then git submodule update --init --recursive; fi"

before_script:
  - sh -c "if [ '$PHPCS' != '1' ]; then \
      git clone https://github.com/cakephp/cakephp.git ../cakephp \
      cd ../cakephp \
      git checkout $CAKE_VERSION \
      cd app \
      mv ../../MustacheCake Plugin/MustacheCake \
      chmod -R 777 tmp \
      fi"
  - sh -c "if [ '$PHPCS' = '1' ]; then \
      pear channel-discover pear.cakephp.org \
      pear install --alldeps cakephp/CakePHP_CodeSniffer \
      phpenv rehash \
      fi"

script:
  - sh -c "if [ '$PHPCS' != '1' ]; then ./Console/cake test MustacheCake AllTests --stderr; fi"
  - sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP .; fi"

language: php

php:
  - 5.2
  - 5.3
  - 5.4
  - 5.5

env:
  - CAKE_VERSION=2.3.8

matrix:
  include:
    - php: 5.5
      env: CAKE_VERSION=2.2.9
    - php: 5.5
      env: CAKE_VERSION=2.1.5
    - php: 5.5
      env: PHPCS=1
      git:
        submodules: false

before_install:
  - sh -c "if [ '$PHPCS' != '1' ]; then git submodule update --init --recursive; fi"

before_script:
  - sh -c "if [ '$PHPCS' != '1' ]; then
      git clone https://github.com/cakephp/cakephp.git ../cakephp;
      cd ../cakephp;
      git checkout $CAKE_VERSION;
      cd app;
      mv ../../MustacheCake Plugin/MustacheCake;
      chmod -R 777 tmp;
      fi"
  - sh -c "if [ '$PHPCS' = '1' ]; then
      pear channel-discover pear.cakephp.org;
      pear install --alldeps cakephp/CakePHP_CodeSniffer;
      phpenv rehash;
      fi"

script:
  - sh -c "if [ '$PHPCS' != '1' ]; then ./Console/cake test MustacheCake AllTests --stderr; fi"
  - sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP .; fi"

Make Travis slightly quicker, take 3.
Make Travis slightly quicker, take 3.
