最近,我从symfony.com上的BETA版本开始了Symfony2的一个项目
过了一会儿,我需要升级到master分支,所以我从github中检索了最新的并在vendor/symfony中切换了它.
但是,我的bootstrap.php.cache和bootstrap_cache.php.cache未升级,这会产生错误.
我尝试清除symfony缓存,但无济于事.
如何更新这些文件以与我的项目相对应?
mog*_*man 67
在2.0版本中,原始文件位于:
./vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
Run Code Online (Sandbox Code Playgroud)
编辑:在2.3版本中,文件在这里
vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
Run Code Online (Sandbox Code Playgroud)
Fra*_*ula 60
如果运行该composer update命令,您还将更新项目依赖项,这不是此处所需的行为.如果你这样做,你将不得不测试新的更改,看看它们是否确实会以某种方式影响你的应用程序.
因此,如果您只想重建引导缓存文件,那么我建议您运行post-update-cmd命令.
因此你应该使用:
composer run-script post-update-cmd
Run Code Online (Sandbox Code Playgroud)
在我的例子中执行以下脚本(请参阅composer.json):
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrapSass"
]
}
Run Code Online (Sandbox Code Playgroud)
请考虑您还可以在其中创建一组新脚本来重建引导程序文件并清除缓存而不安装资产等等:
"scripts": {
"reset-bootstrap-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache"
]
}
Run Code Online (Sandbox Code Playgroud)
然后... composer run-script reset-bootstrap-cmd
Gre*_*ire 27
在最新的2.1.0-DEV中,实际的脚本在这里:
./vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
seb*_*seb 22
我正在使用Symfony Standard 2.0.9(没有供应商).
要更新bootstrap.php.cache,只需运行
php bin/vendors update
这将更新所有供应商(包括Symfony本身)并始终build_bootstrap.php为您调用该脚本.
d.s*_*.3r 17
你试过跑步了吗:
php bin/build_bootstrap.php
Run Code Online (Sandbox Code Playgroud)
这将重新生成引导程序文件
小智 11
您可能更喜欢使用composer install哪个"重新安装"系统到composer.lock文件中定义的状态并生成自动加载和bootstrap.php.cache.使用composer update更新所有包并更改系统的状态.
| 归档时间: |
|
| 查看次数: |
75422 次 |
| 最近记录: |