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:
        - CAKE_VERSION=2.3.8
        - PHPCS=1

before_install:
  - git submodule update --init --recursive

before_script:
  - sh -c "if [ '$PHPCS' = '1' ]; then pear channel-discover pear.cakephp.org; fi"
  - sh -c "if [ '$PHPCS' = '1' ]; then pear install --alldeps cakephp/CakePHP_CodeSniffer; fi"
  - phpenv rehash
  - 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

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 ./Plugin/MustacheCake; 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:
        - CAKE_VERSION=2.3.8
        - 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 pear channel-discover pear.cakephp.org; fi"
  - sh -c "if [ '$PHPCS' = '1' ]; then pear install --alldeps cakephp/CakePHP_CodeSniffer; fi"
  - phpenv rehash
  - 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

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 ./Plugin/MustacheCake; fi"

Disable submodule pulling if doing PHPCS test.
Disable submodule pulling if doing PHPCS test.
