[英]composer not parsing composer.json
i have created a bundle. 我创建了一个捆绑包。 in bundle i am creating two tables in database.
在捆绑中,我正在数据库中创建两个表。 this is following my composer.json.
这是在我的composer.json之后。
{
"name": "xxxx/xxx-designer",
"description": "XXXX",
"license": "MIT",
"homepage": "https://github.com/giturl",
"autoload": {
"psr-0": {
"": "src/"
}
},
"authors": [
{
"name": "xxxx",
"email": "xxxx@gmail.com"
}
],
"minimum-stability": "dev",
"require": {
"php": ">=5.3.0",
},
"scripts": {
"post-install-cmd": [
"Acme\\Bundle\\DemoBundle\\Composer\\AcmeHandler::InstallTabs"
],
"post-update-cmd": [
"Acme\\Bundle\\DemoBundle\\Composer\\AcmeHandler::InstallTabs"
]
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}
Now problem is this when i perform php composer.phar update
then composer not execute post-update-cmd or post-install-cmd but if add following line into main composer.json 现在的问题是,当我执行
php composer.phar update
composer不会执行post-update-cmd或post-install-cmd,但是如果将以下行添加到主composer.json中
"scripts": {
"post-install-cmd": [
"Acme\\Bundle\\DemoBundle\\Composer\\AcmeHandler::InstallTabs"
],
"post-update-cmd": [
"Acme\\Bundle\\DemoBundle\\Composer\\AcmeHandler::InstallTabs"
]
},
then php composer.phar update
execute this command and my tables will be created i am wondering why composer not execute commands from my bundle's composer.json. 然后
php composer.phar update
执行此命令,我的表将被创建,我想知道为什么composer不执行我捆绑包的composer.json中的命令。 please help why composer not execute script from bundle's composer.json 请帮助为什么作曲家不执行捆绑软件的composer.json中的脚本
Unfortunately, you can not do that with a vendor post-instal/update-scripts. 不幸的是,您无法使用供应商的后安装/更新脚本来执行此操作。
BUT 但
See how it is resolved in BraincraftedBootstrapBundle: 查看如何在BraincraftedBootstrapBundle中解决该问题:
They have a separate command to copy the icons 他们有一个单独的命令来复制图标
I show that it can be added to composer.json. 我表明可以将其添加到composer.json中。 BraincraftedBootstrapBundle -> Installing Glyphicons
BraincraftedBootstrapBundle->安装Glyphicons
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.