我不明白我的作曲家或项目有什么问题。 如果我尝试通过作曲家下载一些,我会收到错误:
安装失败,将./composer.json恢复为原始内容。 我习惯了这段代码 php composer需要sonata-project / admin-bundle“2.3。*”
我的代码composer.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.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",
"sensio/distribution-bundle": "~3.0",
"sensio/framework-extra-bundle": "~3.0",
"incenteev/composer-parameter-handler": "~2.0",
"jms/security-extra-bundle": "1.5.*@dev",
"jms/di-extra-bundle": "1.4.*@dev",
"symfony/finder": "~2.1",
"doctrine/data-fixtures": "dev-master",
"stof/doctrine-extensions-bundle": "dev-master",
"friendsofsymfony/user-bundle": "~1.3"
},
"require-dev": {
"sensio/generator-bundle": "~2.3"
},
"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"
],
"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"
]
},
"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"
}
}
}
答案 0 :(得分:3)
如何尝试本文中的步骤?
http://www.dev-metal.com/composer-problems-try-full-reset/
所以
更新编辑器本身
composer self-update
运行诊断
composer diagnose
更新您的依赖项(注意:-v是详细参数,显示其他信息)
composer update -v
如果仍有问题:重新安装依赖项。删除供应商文件夹(手动)或通过rm命令(如果你在项目文件夹中,确定)在linux上删除:
rm -rf vendor/
composer update -v
答案 1 :(得分:1)
Composer需要安装来自composer.json
的特定包。就像你有bellow包,你想安装条纹:
"require": {
"chriskacerguis/codeigniter-restserver": "^3.0",
"firebase/php-jwt": "^5.0",
}
执行:
composer require stripe/stripe-php