使用propel bundle升级Symfony 2.7到3.0(3.1)


Upgrade Symfony 2.7 to 3.0 (3.1) with propel bundle

我正在尝试将Symfony 2.7升级到Symfony 3.0或3.1。我在我的项目中使用推进,推进束。我读了很多关于Symfony升级步骤的页面。

通过composer完成。首先,我升级了我的作曲家。

更改编写器。Json文件内容:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The '"Symfony Standard Edition'" distribution",
    "autoload": {
        "psr-4": { 
            "": "src/", 
            "SymfonyStandard''": "app/SymfonyStandard/"
        },
        "files": [ "vendor/propel/propel-bundle/PropelBundle.php" ]
    },
    "require": {
        "symfony/symfony": "3.1.*",
        "php": ">=5.6.11",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "symfony/swiftmailer-bundle": "^2.3",
        "symfony/monolog-bundle": "^2.8",
        "sensio/distribution-bundle": "^5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "sensio/generator-bundle": "^3.0",
        "incenteev/composer-parameter-handler": "^2.0",
        "twig/extensions": "1.4.*,>=1.4",
        "symfony/assetic-bundle": "2.8.*,>=2.8",
        "propel/propel": "2.0.0-alpha6",
        "propel/propel-bundle": " 3.0.x-dev",
        "phpunit/phpunit": "5.6.*,>=5.6",
        "liuggio/excelbundle": "2.1.*,>=2.1"
    },
    "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::removeSymfonyStandardFiles",
            "Sensio''Bundle''DistributionBundle''Composer''ScriptHandler::prepareDeploymentTarget"
        ],
        "post-update-cmd": [
            "Sensio''Bundle''DistributionBundle''Composer''ScriptHandler::clearCache",
            "Sensio''Bundle''DistributionBundle''Composer''ScriptHandler::installAssets",
            "Sensio''Bundle''DistributionBundle''Composer''ScriptHandler::removeSymfonyStandardFiles",
            "Sensio''Bundle''DistributionBundle''Composer''ScriptHandler::installRequirementsFile",
            "Sensio''Bundle''DistributionBundle''Composer''ScriptHandler::prepareDeploymentTarget"
        ]
    },    
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",       
        "symfony-web-dir": "web",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "3.0-dev"
        }
    }
}

…我得到了升级过程的结束,推进/proepl-bundle/PropelBundle()类没有找到,但路径是正确的。

有人有过这样的经验吗?或者有什么建议吗?我试图找出哪个propelBundle版本可能是正确的。

最后,正确的解决方案是/was:你可以从这里下载PropelBundle的源代码:https://github.com/propelorm/PropelBundle

…然而,在这个页面上,作者为Symfony2编写了这个包,它可以与Symfony 3.0或3.1一起工作。我所做的:将源代码下载到我的计算机上。进入Symfony/vendor/propel/propel/src/propel 文件夹。创建一个新文件夹:Bundle,并在这里复制下载的PropelBundle文件夹。当然在我用composer安装Propel2之前:

"propel/propel": "~2.0@dev"

编辑AppKernel.php:

 public function registerBundles() {
        $bundles = array(
            ...
            new Propel'Bundle'PropelBundle'PropelBundle(),
            ...
        );
        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
            ...
        }
        return $bundles;
    }

添加新的推进。并将其包含到app/config/config中。yml文件。

…终于成功了!我来看看这是不是一个好的解决方案。目前它看起来像:它工作得很好!

最后但最不重要的是:我要非常感谢那些在我的第一个评论后面添加评论的家伙。