将Symfony 2.5.10更新为2.7。*

时间:2015-07-09 15:57:31

标签: php symfony

您好我想将我的项目2.5.10更新到2.7但我不能这样做。我改变了Composer.json

...
"symfony/symfony": "2.7.*",
...

执行时,作曲家更新会显示此异常:

作曲家更新     使用包信息加载composer存储库     更新依赖项(包括require-dev)

  [RuntimeException]
  Could not load package monolog/monolog in http://packagist.org: [UnexpectedValueException] Could not parse version constraint >=0.90 <3.0: Invali
  d version string "0.90 <3.0"






  [UnexpectedValueException]
  Could not parse version constraint >=0.90 <3.0: Invalid version string "0.90 <3.0"



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] [packages1] ... [packagesN]

这是我的composer.json文件

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-4": { "": "src/", "SymfonyStandard\\": "app/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.7.*",
        "doctrine/orm": "~2.2,>=2.2.3,<2.5",
        "doctrine/dbal": "<2.5",
        "doctrine/doctrine-bundle": "~1.4",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~4.0",
        "sensio/framework-extra-bundle": "~3.0,>=3.0.2",
        "incenteev/composer-parameter-handler": "~2.0",
        "friendsofsymfony/user-bundle" : "~2.0@dev",
        "phpoffice/phpword": "dev-master",
        "phpoffice/phpexcel": "dev-master"
    },
    "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",
            "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.7-dev"
        }
    }
}

在此文件中,我们添加了一些更改,并且不知道是否正确100%

2 个答案:

答案 0 :(得分:0)

最近将我的网站更新为Symfony 2.7

首先,你缺少一个逗号,即&gt; = 0.90,&lt; 3.0这应该回答你的问题。

其次,升级的最佳方法是下载Symfony Standard Distribution软件包并比较composer.json值,因为Symfony版本可能不是您升级所需的唯一内容。

第三,可能只是一个副本,一旦我通过作曲家更新更新我的2.7 Symfony网站,我总是有一个白色屏幕,此后没有错误日志。我在Github上提出了这个问题,并且当你安装了APC缓存时显然升级了Sensio发行版捆绑包导致了这个问题。重新启动Apache以清除缓存解决了它。

快乐的编码!

答案 1 :(得分:-1)

您可以像这样更改json文件的require-dev部分

AuthProvider

它为我工作