diff --git a/.gitignore b/.gitignore index fe34379a88..8025a1d7e0 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ # Others # ########## *.swp +/composer.lock Thumbs.db config.php html/plugins/* @@ -20,4 +21,4 @@ logs nbproject patches rrd - +/vendor diff --git a/.travis.yml b/.travis.yml index a3ea97cf9e..d1746dfa3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,18 +2,32 @@ language: php matrix: fast_finish: true include: - - php: 5.3 - script: find . -path './lib/influxdb-php' -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1 - - php: 5.4 - script: find . -path './lib/influxdb-php' -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1 - - php: 5.5 - script: find . -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1 - - php: 5.6 - script: find . -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1 - php: 7.0 - script: find . -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1 + env: PHP_L=1 + - php: 5.3 + env: PHP_L_OLD=1 + - php: 5.4 + env: PHP_L_OLD=1 + - php: 5.5 + env: PHP_L=1 + - php: 5.6 + env: PHP_L=1 PHPCS=0 - php: hhvm - script: find . -path './lib/influxdb-php' -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1 + env: PHP_L_OLD=1 + allow_failures: - php: 7.0 - php: hhvm + +cache: + directories: + - vendor + - $HOME/.composer/cache + +before_script: + - composer install --prefer-dist --no-interaction + +script: + - if [[ $PHP_L == 1 ]]; then find . -path './vendor' -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1; fi + - if [[ $PHP_L_OLD == 1 ]]; then find . -regextype posix-extended -regex "\./(lib/influxdb-php|vendor)" -prune -o -name "*.php" -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected' ; test $? -eq 1; fi + - if [[ $PHP_CS == 1 ]]; then vendor/bin/phpcs -n -p --colors --extensions=php --standard=PSR2 --ignore=html/lib/* .; fi diff --git a/composer.json b/composer.json new file mode 100644 index 0000000000..2dd4acf45c --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "squizlabs/php_codesniffer": "*" + } +}