我是Symfony2和composer.phar安装捆绑包的新手。
每次我想安装新捆绑包时,我都会出错。我不知道是我的composer.json坏了,还是我完整安装的Symfony
。# php composer.phar require friendsofsymfony/comment-bundle
Please provide a version constraint for the friendsofsymfony/comment-bundle requirement: dev-master
composer.json has been updated
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: remove symfony/symfony 2.1.x-dev
- Can only install one of: symfony/symfony dev-master, symfony/symfony 2.1.x-dev.
- Can only install one of: symfony/symfony 2.2.x-dev, symfony/symfony 2.1.x-dev.
- don't install symfony/class-loader dev-master|don't install symfony/symfony 2.1.x-dev
- Installation request for symfony/symfony == 2.1.9999999.9999999-dev -> satisfiable by symfony/symfony 2.1.x-dev.
- Installation request for symfony/class-loader dev-master -> satisfiable by symfony/class-loader dev-master, symfony/symfony dev-master, symfony/symfony 2.2.x-dev.
作曲家是否试图告诉我我需要再次安装symfony?
这是我的作曲家.json
{
"name": "symfony/framework-standard-edition",
"description": "The "Symfony Standard Edition" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.1.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.0.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.1.*",
"symfony/monolog-bundle": "2.1.*",
"sensio/distribution-bundle": "2.1.*",
"sensio/framework-extra-bundle": "2.1.*",
"sensio/generator-bundle": "2.1.*",
"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*",
"symfony/class-loader": "dev-master",
"friendsofsymfony/comment-bundle": "dev-master",
"knplabs/knp-paginator-bundle": "dev-master",
"facebook/php-sdk": "dev-master",
"friendsofsymfony/facebook-bundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
"Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
}
}
编辑:由于这些错误,我不得不手动安装捆绑包(例如 FOSFacebookBundle),所以我不得不更新供应商/作曲家/autoload_namespaces.php(是的,我知道这很糟糕)
编辑2:当我执行作曲家.phar 更新时
# php composer.phar update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: remove symfony/symfony 2.1.x-dev
- Conclusion: don't install symfony/symfony 2.1.x-dev
- Conclusion: don't install symfony/symfony v2.1.4
- Conclusion: don't install symfony/symfony v2.1.3
- Conclusion: don't install symfony/symfony v2.1.2
- Conclusion: don't install symfony/symfony v2.1.1
- Conclusion: don't install symfony/symfony v2.1.0
- Conclusion: don't install symfony/symfony v2.1.0-RC2
- Conclusion: don't install symfony/symfony v2.1.0-RC1
- Conclusion: don't install symfony/symfony v2.1.0-BETA4
- Installation request for friendsofsymfony/facebook-bundle dev-master -> satisfiable by friendsofsymfony/facebook-bundle dev-master.
- Conclusion: don't install symfony/symfony v2.1.0-BETA3
- Installation request for symfony/class-loader dev-master -> satisfiable by symfony/class-loader dev-master, symfony/symfony dev-master, symfony/symfony 2.2.x-dev.
- Conclusion: don't install symfony/symfony v2.1.0-BETA2
- friendsofsymfony/facebook-bundle dev-master requires symfony/twig-bundle >=2.1,<2.3-dev -> satisfiable by symfony/symfony 2.1.x-dev, symfony/symfony 2.1.x-dev, symfony/symfony 2.2.x-dev, symfony/symfony v2.1.0, symfony/symfony v2.1.1, symfony/symfony v2.1.2, symfony/symfony v2.1.3, symfony/symfony v2.1.4, symfony/twig-bundle 2.1.x-dev, symfony/twig-bundle 2.2.x-dev, symfony/twig-bundle v2.1.0, symfony/twig-bundle v2.1.1, symfony/twig-bundle v2.1.2, symfony/twig-bundle v2.1.3, symfony/twig-bundle v2.1.4.
- Can only install one of: symfony/symfony v2.1.0-BETA1, symfony/symfony 2.2.x-dev.
- don't install symfony/twig-bundle 2.1.x-dev|don't install symfony/symfony v2.1.0-BETA1
- don't install symfony/twig-bundle 2.2.x-dev|don't install symfony/symfony v2.1.0-BETA1
- don't install symfony/twig-bundle v2.1.0|don't install symfony/symfony v2.1.0-BETA1
- don't install symfony/twig-bundle v2.1.1|don't install symfony/symfony v2.1.0-BETA1
- don't install symfony/twig-bundle v2.1.2|don't install symfony/symfony v2.1.0-BETA1
- don't install symfony/twig-bundle v2.1.3|don't install symfony/symfony v2.1.0-BETA1
- don't install symfony/twig-bundle v2.1.4|don't install symfony/symfony v2.1.0-BETA1
- Installation request for symfony/symfony 2.1.* -> satisfiable by symfony/symfony 2.1.x-dev, symfony/symfony v2.1.0, symfony/symfony v2.1.0-BETA1, symfony/symfony v2.1.0-BETA2, symfony/symfony v2.1.0-BETA3, symfony/symfony v2.1.0-BETA4, symfony/symfony v2.1.0-RC1, symfony/symfony v2.1.0-RC2, symfony/symfony v2.1.1, symfony/symfony v2.1.2, symfony/symfony v2.1.3, symfony/symfony v2.1.4.
感谢您的帮助。
找到了答案!
尽管看起来很简单(不适合我),但依赖于没有引用正确版本的symfony/class-loader
。
所以我所要做的就是删除类加载器,一切都很好。