我正在尝试安装一些外部JS库,这些库位于SF2项目中的composer.json中。
composer.json:
{
"name": "myproject",
"license": "my project",
"type": "project",
"description": "my project",
"autoload": {
"psr-0": { "": "src/" }
},
"repositories": {
"medium-editor" : {
"type": "package",
"package": {
"name": "daviferreira/medium-editor",
"type": "component",
"version": "master",
"source": {
"url": "git://github.com/daviferreira/medium-editor.git",
"type": "git",
"reference": "master"
},
"extra": {
"component": {
"scripts": [
"dist/js/medium-editor.min.js"
],
"styles": [
"dist/css/medium-editor.min.css",
"dist/css/themes/*.min.css"
]
}
},
"require": {
"robloach/component-installer": "*"
}
}
},
"classList" : {
"type": "package",
"package": {
"name": "eligrey/classList.js",
"type": "component",
"version": "master",
"source": {
"url": "git://github.com/eligrey/classList.js.git",
"type": "git",
"reference": "master"
},
"extra": {
"component": {
"scripts": [
"classList.min.js"
]
}
},
"require": {
"robloach/component-installer": "*"
}
}
}
},
"require": {
...
"daviferreira/medium-editor" : "dev-master",
"eligrey/classList.js" : "dev-master"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"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"
],
"post-update-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"
]
},
"config": {
"bin-dir": "bin",
"component-dir": "web/components"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "symlink",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}图书馆被下载了但是..。我希望composer将使用"robloach/component-installer“依赖项创建一个文件副本,该文件在"component”类型包的“附加”中指定到"web/component“目录,但没有。
我的配置怎么了?谢谢!
发布于 2014-12-29 14:26:48
在更仔细地阅读了robloach插件文档之后,我再次尝试并最终找到了解决方案。问题是,我可能已经做了许多“作曲家更新”与不同的信任,并有义务删除/重新安装包使其工作!所以问题中最初的配置帖子是good one.
我再说一遍是为了确定!
"medium-editor" : {
"type": "package",
"package": {
"require": {
"robloach/component-installer": "*"
},
"name": "daviferreira/medium-editor",
"type": "component",
"version": "master",
"source": {
"url": "git://github.com/daviferreira/medium-editor.git",
"type": "git",
"reference": "master"
},
"extra": {
"component": {
"scripts": [
"dist/js/medium-editor.min.js"
],
"styles": [
"dist/css/medium-editor.min.css",
"dist/css/themes/*.min.css"
]
}
}
}
},当然,不要忘记在"require“库中添加Robloach组件:
"robloach/component-installer": "dev-master",发布于 2014-11-14 21:44:41
我建议使用bower来获取前端库。Composer是为管理php依赖关系而创建的。分离这些层非常重要,因为这是最容易实现的解决方案。
发布于 2014-12-28 22:12:45
使用composer尝试资产管理器包,如果问题仍然存在,我认为您应该手动执行命令:
应用程序/控制台资产:安装。
https://stackoverflow.com/questions/26934071
复制相似问题