运行“ composer update / install”后,如何正确更改作曲家或Symfony2的功能? [英] How to properly change what composer or Symfony2 does after running 'composer update/install'?
问题描述
运行composer之后,有一些脚本会执行。
There are some scripts that are executed after I run composer.
问题是它们会执行我不想要的事情,例如 php资产:安装
(不带--symlink)。
The problem is that they do things that I don't want, like php assets:install
(without --symlink).
所以我需要能够删除它,或者添加自己的脚本做 php资产:安装--symlink
。
So I need to either be able to remove that, or add my own script to do php assets:install --symlink
.
这样做的正确方法是什么?
What would be the correct way for doing this?
编辑
在 Sensio\Bundle\DistributionBundle中\Composer\ScriptHandler :: installAssets()
我可以看到符号链接的选项:
In Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets()
I can see an option for symlink:
if ($options['symfony-assets-install'] == 'symlink') {
$symlink = '--symlink ';
可以在某个地方配置吗?
Is that configurable somewhere?
推荐答案
要使用符号链接安装资产,请以这种方式编辑composer.json(最后)
To install assets with symlinks edit your composer.json (at the end) in this way
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "symlink"
}
然后以正常方式运行作曲家。
Then run composer as uusal.
这篇关于运行“ composer update / install”后,如何正确更改作曲家或Symfony2的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!