TravisCI:如何根据 PHP 版本(~5.6 或 ~7.0)使用 xdebug 或 phpdbg

TravisCI: How to use xdebug or phpdbg according to PHP version (~5.6 or ~7.0)

我看到 XDebug 在 PHP 7 下抛出分段错误,我和其他许多人都遇到过这种情况。所以我得到了 运行ning phpdbg 的解决方案 PHP 7 而不是使用 XDebug。

我的问题是我应该如何配置 travis.yml 以根据我正在测试的 PHP 版本执行一个或另一个。

This is my current config file for PHP 7, also available here

language: php

php:
  - "5.6"
  - "7.0"

install:
  - composer self-update

before_script:
  - phpenv config-rm xdebug.ini
  - mv .env.travis .env
  - mv travis.phpunit.xml phpunit.xml
  - mysql -e 'create database test_timegrid;'
  - composer install --dev --no-interaction
  - php artisan config:clear
  - php artisan migrate
  - php artisan db:seed
  - php artisan geoip:update
  - php artisan config:cache

script:
  - phpdbg -qrr vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_success:
  - ./travis-codeclimate-report.sh

使用这些设置,我无法 运行 测试 PHP 5.6,而当使用 XDebug 时,PHP7 测试失败,所以我遇到了互斥问题。

有什么提示吗?

这是Travis builds history and the current project files for PHP 5.6

由于在这种情况下似乎有一些正在进行的工作,我决定继续使用 XDebug,直到我可以完全转向 PHPDebug 并将其用于 PHP7+ 和 PHP5。 6.

此时,使用 XDebug + PHP7.1 的构建进展顺利,但是 PHP7.0 抛出分段错误。不过,这对我来说暂时还可以。

构建日志:

https://travis-ci.org/timegridio/timegrid/builds/173947875