<commit_before>language: php

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

matrix:
  fast_finish: true
  allow_failures:
    - php: 7.0
    - php: hhvm

services:
  - mysql
  - postgresql

addons:
  postgresql: "9.3"

before_install:
  - sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
  - sudo add-apt-repository -y ppa:nginx/stable
  - sudo apt-get update
  - sudo apt-get --reinstall install -qq language-pack-en language-pack-fr && sudo locale-gen fr_FR
  - sudo apt-get install nginx postfix
  # Set up HHVM 
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then echo 'xdebug.enable = On' >> /etc/hhvm/php.ini ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then echo 'hhvm.jit = false' >> /etc/hhvm/php.ini ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then sudo sh -c 'echo RUN_AS_USER=\"travis\"  >> /etc/default/hhvm' ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then sudo sh -c 'echo RUN_AS_GROUP=\"travis\" >> /etc/default/hhvm' ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then sudo service hhvm restart ; sleep 1 ; fi
  # Set up PHP-FPM
  - if [[ $TRAVIS_PHP_VERSION =~ ^[57] ]]; then export PHP_BASE=~/.phpenv/versions/$(phpenv version-name) ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^[57] ]]; then echo "cgi.fix_pathinfo = 1" >> $PHP_BASE/etc/php.ini ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^[57] ]]; then sudo cp $PHP_BASE/etc/php-fpm.conf.default $PHP_BASE/etc/php-fpm.conf ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^5 ]]; then perl -p -i -e 's/nobody/travis/g' $PHP_BASE/etc/php-fpm.conf ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^7 ]]; then sudo cp $PHP_BASE/etc/php-fpm.d/www.conf.default $PHP_BASE/etc/php-fpm.d/www.conf ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^7 ]]; then perl -p -i -e 's/nobody/travis/g' $PHP_BASE/etc/php-fpm.d/www.conf ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^[57] ]]; then sudo $PHP_BASE/sbin/php-fpm ; fi
  # Set up Nginx
  - PWD=$(pwd) ; perl -p -i -e 's/%ROOTDIR%/$ENV{PWD}/g' tests/travis/nginx.conf
  - sudo cp tests/travis/nginx.conf /etc/nginx/nginx.conf
  - sudo service nginx restart
  # Start postfix
  - sudo service postfix restart
  
before_script:
  # Set up Composer
  - composer self-update || true
  - composer install --prefer-dist
  # Set up permissions
  - chmod -R 777 app/database/ app/cache/ app/config/ extensions/ files/ theme/
  # Set up MySQL
  - mysql -e "CREATE DATABASE IF NOT EXISTS bolt_travis;" -u root
  - mysql -e "CREATE USER 'bolt_travis'@'localhost' IDENTIFIED BY 'bolt_travis';" -u root
  - mysql -e "GRANT ALL PRIVILEGES ON bolt_travis.* TO 'bolt_travis'@'localhost';" -u root
  - mysql -e "FLUSH PRIVILEGES;" -u root
  # Set up PostgreSQL
  - psql -c "CREATE DATABASE bolt_travis;" -U postgres || true
  - psql -c "CREATE USER bolt_travis WITH PASSWORD '<PASSWORD>';" -U postgres
  - psql -c "GRANT ALL PRIVILEGES ON DATABASE bolt_travis TO bolt_travis;" -U postgres
  # Get the composer.json from our bolt/composer-install repo
  - git clone https://github.com/bolt/composer-install.git .tmp
  # - cd .tmp
  # Add requires
  - composer require --working-dir=.tmp/ --no-update bolt/bolt:dev-master phpunit/phpunit:^4.5 "codeception/codeception:*" lstrojny/phpunit-function-mocker:dev-master
  # Create the project
  - composer create-project --working-dir=.tmp/ --no-interaction --prefer-dist
  # Update the Composer Bolt install with the PR files
  - rsync -a --exclude="autoload*" vendor/ .tmp/vendor/
  - rsync -a --delete src/ .tmp/vendor/bolt/bolt/src/
  - rsync -a --delete app/ .tmp/vendor/bolt/bolt/app/
  - rsync -a --delete tests/ .tmp/vendor/bolt/bolt/tests/

script:
  ## Default install tests
  # PHPUnit
  - phpunit -c phpunit.xml.dist
  # Codeception set up (PHP >5.3)
  - if [[ $TRAVIS_PHP_VERSION =~ (^5.[456]|^7|^hhvm) ]]; then ./vendor/codeception/codeception/codecept build ; fi
  # Codeception Sqlite run (PHP >5.3)
  - if [[ $TRAVIS_PHP_VERSION =~ (^5.[456]|^7|^hhvm) ]]; then ./vendor/codeception/codeception/codecept run ; fi
  # Codeception MySQL run (PHP >5.3)
  - ./tests/travis/test-db-config mysql
  - if [[ $TRAVIS_PHP_VERSION =~ (^5.[456]|^7|^hhvm) ]]; then ./vendor/codeception/codeception/codecept run ; fi<commit_msg>[Travis] Require Guzzle for Composer based builds<commit_after>language: php

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

matrix:
  fast_finish: true
  allow_failures:
    - php: 7.0
    - php: hhvm

services:
  - mysql
  - postgresql

addons:
  postgresql: "9.3"

before_install:
  - sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
  - sudo add-apt-repository -y ppa:nginx/stable
  - sudo apt-get update
  - sudo apt-get --reinstall install -qq language-pack-en language-pack-fr && sudo locale-gen fr_FR
  - sudo apt-get install nginx postfix
  # Set up HHVM 
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then echo 'xdebug.enable = On' >> /etc/hhvm/php.ini ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then echo 'hhvm.jit = false' >> /etc/hhvm/php.ini ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then sudo sh -c 'echo RUN_AS_USER=\"travis\"  >> /etc/default/hhvm' ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then sudo sh -c 'echo RUN_AS_GROUP=\"travis\" >> /etc/default/hhvm' ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then sudo service hhvm restart ; sleep 1 ; fi
  # Set up PHP-FPM
  - if [[ $TRAVIS_PHP_VERSION =~ ^[57] ]]; then export PHP_BASE=~/.phpenv/versions/$(phpenv version-name) ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^[57] ]]; then echo "cgi.fix_pathinfo = 1" >> $PHP_BASE/etc/php.ini ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^[57] ]]; then sudo cp $PHP_BASE/etc/php-fpm.conf.default $PHP_BASE/etc/php-fpm.conf ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^5 ]]; then perl -p -i -e 's/nobody/travis/g' $PHP_BASE/etc/php-fpm.conf ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^7 ]]; then sudo cp $PHP_BASE/etc/php-fpm.d/www.conf.default $PHP_BASE/etc/php-fpm.d/www.conf ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^7 ]]; then perl -p -i -e 's/nobody/travis/g' $PHP_BASE/etc/php-fpm.d/www.conf ; fi
  - if [[ $TRAVIS_PHP_VERSION =~ ^[57] ]]; then sudo $PHP_BASE/sbin/php-fpm ; fi
  # Set up Nginx
  - PWD=$(pwd) ; perl -p -i -e 's/%ROOTDIR%/$ENV{PWD}/g' tests/travis/nginx.conf
  - sudo cp tests/travis/nginx.conf /etc/nginx/nginx.conf
  - sudo service nginx restart
  # Start postfix
  - sudo service postfix restart
  
before_script:
  # Set up Composer
  - composer self-update || true
  - composer install --prefer-dist
  # Set up permissions
  - chmod -R 777 app/database/ app/cache/ app/config/ extensions/ files/ theme/
  # Set up MySQL
  - mysql -e "CREATE DATABASE IF NOT EXISTS bolt_travis;" -u root
  - mysql -e "CREATE USER 'bolt_travis'@'localhost' IDENTIFIED BY 'bolt_travis';" -u root
  - mysql -e "GRANT ALL PRIVILEGES ON bolt_travis.* TO 'bolt_travis'@'localhost';" -u root
  - mysql -e "FLUSH PRIVILEGES;" -u root
  # Set up PostgreSQL
  - psql -c "CREATE DATABASE bolt_travis;" -U postgres || true
  - psql -c "CREATE USER bolt_travis WITH PASSWORD '<PASSWORD>';" -U postgres
  - psql -c "GRANT ALL PRIVILEGES ON DATABASE bolt_travis TO bolt_travis;" -U postgres
  # Get the composer.json from our bolt/composer-install repo
  - git clone https://github.com/bolt/composer-install.git .tmp
  # - cd .tmp
  # Add requires
  - composer require --working-dir=.tmp/ --no-update bolt/bolt:dev-master phpunit/phpunit:^4.5 codeception/codeception:^2.1 lstrojny/phpunit-function-mocker:dev-master guzzlehttp/guzzle:^5.3
  # Create the project
  - composer create-project --working-dir=.tmp/ --no-interaction --prefer-dist
  # Update the Composer Bolt install with the PR files
  - rsync -a --delete src/ .tmp/vendor/bolt/bolt/src/
  - rsync -a --delete app/ .tmp/vendor/bolt/bolt/app/
  - rsync -a --delete tests/ .tmp/vendor/bolt/bolt/tests/

script:
  ## Default install tests
  # PHPUnit
  - phpunit -c phpunit.xml.dist
  # Codeception set up (PHP >5.3)
  - if [[ $TRAVIS_PHP_VERSION =~ (^5.[456]|^7|^hhvm) ]]; then ./vendor/codeception/codeception/codecept build ; fi
  # Codeception Sqlite run (PHP >5.3)
  - if [[ $TRAVIS_PHP_VERSION =~ (^5.[456]|^7|^hhvm) ]]; then ./vendor/codeception/codeception/codecept run ; fi
  # Codeception MySQL run (PHP >5.3)
  - ./tests/travis/test-db-config mysql
  - if [[ $TRAVIS_PHP_VERSION =~ (^5.[456]|^7|^hhvm) ]]; then ./vendor/codeception/codeception/codecept run ; fi
{'fraction_non_alphanumeric': 0.16046848587297755, 'fraction_numerical': 0.014489253803429124, 'mean_word_length': 3.0903703703703704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 2, 'lorem ipsum': 0, 'www.': 6, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3158100', 'n_tokens_mistral': 3407, 'n_tokens_neox': 3281, 'n_words': 799}