Composer未定义变量:auth

时间:2014-12-23 16:12:14

标签: php capistrano composer-php

我收到了错误'未定义的变量:auth'通过Capistrano运行作曲家。 这里在运行cap deploy -d

时标识堆栈跟踪
--> Updating Composer dependencies..........................Preparing to execute     command: "sh -c 'cd /path/to/site/public_html/releases/20141223155437 && SYMFONY_ENV=livetest /usr/bin/php composer.phar update -vvv --prefer-dist'"
Execute ([Yes], No, Abort) ?  |y|  
✘
*** [err :: server] [ErrorException]
*** [err :: server] Undefined variable: auth
*** [err :: server] 
*** [err :: server] 
*** [err :: server] 
*** [err :: server] Exception trace:
*** [err :: server] () at phar:///path/to/site/public_html/releases/20141223155437   /composer.phar/src/Composer/Util/Git.php:133
*** [err :: server] Composer\Util\ErrorHandler::handle() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Util/Git.php:133
*** [err :: server] Composer\Util\Git->runCommand() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Repository/Vcs/GitDriver.php:80
*** [err :: server] Composer\Repository\Vcs\GitDriver->initialize() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Repository/VcsRepository.php:86
*** [err :: server] Composer\Repository\VcsRepository->getDriver() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Repository/VcsRepository.php:113
*** [err :: server] Composer\Repository\VcsRepository->initialize() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Repository/ArrayRepository.php:170
*** [err :: server] Composer\Repository\ArrayRepository->getPackages() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/DependencyResolver/Pool.php:100
*** [err :: server] Composer\DependencyResolver\Pool->addRepository() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Installer.php:387
*** [err :: server] Composer\Installer->doInstall() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Installer.php:224
*** [err :: server] Composer\Installer->run() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Command/UpdateCommand.php:134
*** [err :: server] Composer\Command\UpdateCommand->execute() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
*** [err :: server] Symfony\Component\Console\Command\Command->run() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:874
*** [err :: server] Symfony\Component\Console\Application->doRunCommand() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:195
*** [err :: server] Symfony\Component\Console\Application->doRun() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Console/Application.php:146
*** [err :: server] Composer\Console\Application->doRun() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:126
*** [err :: server] Symfony\Component\Console\Application->run() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/src/Composer/Console/Application.php:83
*** [err :: server] Composer\Console\Application->run() at phar:///path/to/site/public_html/releases/20141223155437/composer.phar/bin/composer:43
*** [err :: server] require() at /path/to/site/public_html/releases/20141223155437/composer.phar:25
*** [err :: server] 
*** [err :: server] 
*** [err :: server] update [--prefer-source] [--prefer-dist] [--dry-run] [--dev]     [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ... [packagesN]
*** [deploy:update_code] rolling back
Preparing to execute command: "rm -rf /path/to/site/public_html/releases/20141223155437; true"
Execute ([Yes], No, Abort) ?  |y|  
failed: "env PHP_PATH=/usr/bin/php sh -c 'sh -c '\\''cd /path/to/site/public_html/releases/20141223155437 && SYMFONY_ENV=livetest /usr/bin/php composer.phar update -vvv --prefer-dist'\\'''" on server

Capifony每次都会下载一个新的作曲家版本,因此这个错误将来自最新版本。 有谁知道这可能是什么?

编辑:作曲家文件:

{
"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.5.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "symfony/css-selector": "3.0.*@dev",
    "sensio/distribution-bundle": "~3.0",
    "sensio/framework-extra-bundle": "~3.0",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/user-bundle": "2.0.*@dev",
    "pagerfanta/pagerfanta": "1.0.*@dev",
    "white-october/pagerfanta-bundle": "1.0.*@dev",
    "gedmo/doctrine-extensions": "v2.3.7",
    "stof/doctrine-extensions-bundle":"1.1.*"
},
"require-dev": {
    "sensio/generator-bundle": "~2.3"
},
"scripts": {
},
"config": {
    "bin-dir": "bin"
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.5-dev"
    }
}
}

我已删除了一些私人回购

作曲家版本:

Composer version 1.0-dev (4569f528f66739ec0a3be1075e2c01d6062b0b41) 2014-12-22 11:50:02

1 个答案:

答案 0 :(得分:2)

它缺少私有存储库的凭据。 凭证需要像这样设置:

 :repository,     "https://username@example.com/path/to/repo"