将旧版symfony项目升级到新版本(symfony 2.4到3.1.3)

时间:2016-08-30 20:03:02

标签: php symfony symfony-2.4

这是我以前的composer.json文件:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": {"": "src/"}
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "~2.4",
        "symfony/console": ">=2.2.3",
        "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": "~2.3",
        "sensio/framework-extra-bundle": "~3.0",
        "sensio/generator-bundle": "~2.3",
        "incenteev/composer-parameter-handler": "~2.0",
        "facebook/php-sdk-v4" : "4.0.*"
    },
    "scripts": {
        "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"
        ],
        "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"
        ]
    },
    "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.4-dev"
        }
    }
}

我的新人:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-4": {"": "src/"},
        "classmap": [
            "app/AppKernel.php",
            "app/AppCache.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "require": {
        "php": ">=5.5.9",
        "symfony/symfony": "3.1.3",
        "symfony/console": ">=2.2.3",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "~1.2",
        "doctrine/common": "~2.4",
        "twig/extensions": "~1.0",
        "twig/twig": "~1.23|~2.0",
        "psr/cache": "~1.0",
        "psr/log": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/polyfill-intl-icu": "~1.0",
        "symfony/polyfill-mbstring": "~1.0",
        "symfony/polyfill-php56": "~1.0",
        "symfony/polyfill-php70": "~1.0",
        "symfony/polyfill-util": "~1.0",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~5.0.8",
        "sensio/framework-extra-bundle": "~3.0",
        "symfony/framework-bundle": "~3.1.3",
        "sensio/generator-bundle": "~3.0.7",
        "incenteev/composer-parameter-handler": "~2.0",
        "facebook/php-sdk-v4" : "4.0.*"
    },
    "require-dev": {
        "cache/integration-tests": "~0.11.0",
        "doctrine/cache": "~1.6",
        "doctrine/data-fixtures": "1.0.*",
        "doctrine/dbal": "~2.4",
        "doctrine/orm": "~2.4,>=2.4.5",
        "doctrine/doctrine-bundle": "~1.4",
        "monolog/monolog": "~1.11",
        "ocramius/proxy-manager": "~0.4|~1.0|~2.0",
        "predis/predis": "~1.0",
        "egulias/email-validator": "~1.2,>=1.2.1",
        "symfony/polyfill-apcu": "~1.1",
        "symfony/security-acl": "~2.8|~3.0",
        "phpdocumentor/reflection-docblock": "^3.0",
        "sensio/generator-bundle": "^3.0.7",
        "symfony/phpunit-bridge": "^3.0"
    },
    "scripts": {
        "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"
        ],
        "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"
        ]
    },
    "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.4-dev"
        }
    }
}
问:我做了什么? 答:我决定使用以下方式升级此项目:

php composer.phar self-update
php compser.phar update

在主机中运行项目的结果:

  

警告:require(/home/tufoo/public_html/blog/vendor/symfony/symfony/src/Symfony/Component/Intl/Resources/stubs/functions.php):无法打开流:没有这样的文件或目录第54行/home/tufoo/public_html/blog/vendor/composer/autoload_real.php

     

致命错误:require():无法打开所需的'/home/tufoo/public_html/blog/vendor/symfony/symfony/src/Symfony/Component/Intl/Resources/stubs/functions.php'(include_path ='。 :/ usr / lib / php:/ usr / local / lib / php')位于第54行的/home/tufo/public_html/blog/vendor/composer/autoload_real.php

我在cpanel,php7,litespeed。

0 个答案:

没有答案