【发布时间】:2020-08-10 13:27:08
【问题描述】:
我正在尝试将我的 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"
}
}
}
...升级过程结束了,没有找到 propel/proepl-bundle/PropelBundle() 类,但是路径是正确的。
有没有人有这方面的经验...或任何建议? 我正在尝试找出哪个 propelBundle 版本可能是正确的。
【问题讨论】:
-
KNPLabs knpuniversity.com/screencast/symfony3-upgrade 提供了一个非常好的演练,虽然您可能没有订阅,但他们仍然在视频下方提供所有截屏视频。
-
谢谢帕夫洛维奇!我马上检查!
-
我所做的是安装一个全新的 Symfony 3x 项目,然后使用 composer 添加 3rd 方的东西。大多数情况下,这会导致加载正确的依赖项。然后我要么将旧代码合并到新项目中,要么将 composer.json 复制到旧项目中,删除供应商,然后重新安装。
-
感谢塞拉德!另一个好主意!实际上,我正在准备 pavlovich 提到的页面。这真的很好,真的很有帮助!
-
巴甫洛维奇!您推荐的页面非常棒!我学到了很多......但不幸的是我没有找到解决方案。实际上,正如我所见,Symfony 3 不支持 Propel 包……但是我在 Propel 或 Symfony 网页上没有找到任何有关它的信息……所以问题更进一步:Symfony 3 是否支持 Propel 包?