也许你可以帮助我,我正在尝试设置 Travic-ci 帐户,但在构建中,我在作曲家安装时出现错误:
Generating autoload files
Updating the "app/config/parameters.yml" file
[SymfonyComponentDependencyInjectionExceptionParameterCircularReferenceException]
Circular reference detected for parameter "database_driver" ("database_driver" > "database_driver").
Script SensioBundleDistributionBundleComposerScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
我的特拉维斯:
language: php
php:
- 5.5
before_script:
- cp app/config/parameters.yml.dist app/config/parameters.yml
- composer install
script:
- phpunit -c app
作曲家.json:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The "Symfony Standard Edition" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.6.*",
"doctrine/orm": "~2.2,>=2.2.3,<2.5",
"doctrine/dbal": "<2.5",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~3.0,>=3.0.12",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"twbs/bootstrap": "3.3.*@dev",
"components/jquery": "2.1.*",
"doctrine/doctrine-fixtures-bundle": "2.2.*",
"friendsofsymfony/user-bundle": "~2.0@dev"
},
"require-dev": {
"sensio/generator-bundle": "~2.3",
"ongr/ongr-strict-standard": "~1.0",
"squizlabs/php_codesniffer": "~1",
"phpmd/phpmd": "@stable",
"phpunit/phpunit": "4.6.*"
},
"scripts": {
"post-root-package-install": [
"SymfonyStandard\Composer::hookRootPackageInstall"
],
"post-install-cmd": [
"Incenteev\ParameterHandler\ScriptHandler::buildParameters",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
],
"post-update-cmd": [
"Incenteev\ParameterHandler\ScriptHandler::buildParameters",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.6-dev"
}
}
}
parameters.yml.dist:
此文件是参数.yml文件应具有参数外观的"模板":
database_driver: "%database_driver%"
database_host: "%database_host%"
database_port: "%database_port%"
database_name: "%database_name%"
database_user: "%database_user%"
database_password: "%database_password%"
# You should uncomment this if you want use pdo_sqlite
# database_path: "%kernel.root_dir%/data.db3"
mailer_transport: ~
mailer_host: ~
mailer_user: ~
mailer_password: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ~
#keys for GoodReads and Amazon API
goodreads_key: ~
amazon_key: ~
amazon_secret_key: ~
amazon_tag: ~
所有变量(以 %% 表示)都应设置为环境变量,而您的 travis 构建/用户环境缺乏这些变量。