Tigran
Tigran

Reputation: 653

Symfony - upgrading from 2.7 to 3.0

I am trying to update my project from 2.7 to 3.0

I have updated composer.json from https://github.com/symfony/symfony-standard/blob/v3.0.0/composer.json and added extensions i use from my project

composer.json

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-4": { "": "src/" },
        "files": [ "app/AppKernel.php" ]
    },
    "autoload-dev": {
        "psr-4": { "Tests\\": "tests/" }
    },
    "require": {
        "php": ">=5.5.9",
        "symfony/symfony": "3.0.*",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "doctrine/doctrine-cache-bundle": "^1.2",
        "symfony/swiftmailer-bundle": "^2.3",
        "symfony/monolog-bundle": "^2.8",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0",
        "friendsofsymfony/user-bundle": "~2.0@dev",
        "imagine/imagine": "~0.5.0",
        "twig/extensions": "^1.3",
        "doctrine/doctrine-migrations-bundle": "^1.0"
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "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",
            "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::prepareDeploymentTarget"
        ]
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "3.0-dev"
        }
    }
}

I am getting next error while updating

Fatal error: Interface 'Symfony\Component\HttpKernel\HttpKernelInterface' not fo und in C:\OpenServer\domains\stereoshoots\app\bootstrap.php.cache on line 2450 Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handl ing the post-update-cmd event terminated with an exception

[RuntimeException] An error occurred when executing the ""cache:clear --no-warmup"" command: Fatal error: Interface 'Symfony\Component\HttpKernel\HttpKernelInterface' n ot found in C:\OpenServer\domains\stereoshoots\app\bootstrap.php.cache on l ine 2450 .

Whats the solution for this?

Upvotes: 0

Views: 493

Answers (1)

Marcos Labad
Marcos Labad

Reputation: 1191

There are some other things to update on top of the composer.json file. Regarding the console, which is the file returning the error, you need to replace

require_once __DIR__.'/../bootstrap.php.cache';

by

require __DIR__.'/../app/autoload.php';

There are more important changes to do in app/AppKernel.php and other files. More at:

https://knpuniversity.com/screencast/symfony3-upgrade/new-dir-structure

Upvotes: 1

Related Questions