将 Symfony2 从 2.4.1 降级到 2.3.9 [英] Downgrading Symfony2 from 2.4.1 to 2.3.9
问题描述
我已经开始在 Symfony2.4.1 上开发应用程序.但后来决定回到 Symfony2.3.9,因为它有长期支持.是否有任何降级程序(在 Google 上没有找到运气),或者我必须下载 2.3.9 并将我的所有代码推送到那里?
I have started an application development on Symfony2.4.1. But later decided to go back to Symfony2.3.9 as it has long term support. Is there any procedure to downgrade (Found no luck on Google), or I have to download 2.3.9 and push all my code there?
推荐答案
我刚刚设法将我的 Symfony 2.4.1 降级到 2.3.9.
I have just managed to downgrade my Symfony 2.4.1 to 2.3.9.
删除以下几行:
"symfony/symfony": "~2.4",
"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",
并添加以下内容:
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
2) 更新 monolog 配置
注释(用#)或删除 app/config/config_dev.yml 中的以下几行:
2) Update monolog config
Comment (with #) or remove the following lines in app/config/config_dev.yml:
console:
type: console
bubble: false
在 app/config/config_prod.yml 中做同样的事情:
And do the same in app/config/config_prod.yml:
console:
type: console
这些配置选项在 2.3.* 中不可用,因此如果不删除它们会导致错误.
Those configuration options were not available in 2.3.*, so they cause errors if not removed.
php composer.phar update
4) 清除缓存(老方法)
更新composer后,我无法通过app/console
清除缓存(返回异常).
4) Clear the cache (the old way)
After updating composer, I couldn't clear the cache through app/console
(it returned an exception).
相反,我不得不删除 app/cache/
中的 dev
和 prod
文件夹.
Instead, I had to delete both dev
and prod
folders inside app/cache/
.
长期支持总是好的:)
这篇关于将 Symfony2 从 2.4.1 降级到 2.3.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!