matthimatiker / marshaller
marshaller 是一个 composer 安装器,它将包复制到可配置的位置。
0.1.2
2013-04-01 11:57 UTC
Requires (Dev)
- composer/composer: *@dev
This package is not auto-updated.
Last update: 2024-09-14 13:18:06 UTC
README
marshaller 是一个 composer 安装器,它将包复制到可配置的位置。
激活安装器
要激活安装器,必须声明包的类型为 marshaller-asset。此外,必须要求安装器包 matthimatiker/marshaller
{
"name": "my/package",
"description": "Package that can be copied to a configured location.",
"type": "marshaller-asset",
"require": {
"matthimatiker/marshaller": "*"
}
}
定义默认安装路径
使用 Marshaller 安装器的包可以定义其默认安装路径。该路径添加到 extra 配置中。
以下包使用 public/custom 作为安装路径
{
"name": "my/package",
"description": "Package that will be copied to public/custom.",
"type": "marshaller-asset",
"require": {
"matthimatiker/marshaller": "*"
},
"extra": {
"installation-path": "public/custom"
}
}
在根包中覆盖安装路径
根包可以覆盖通过 Marshaller 安装的依赖包的安装路径。
要更改路径,将新目标添加到位于 extra 配置部分中的 installation-paths 映射中
{
"name": "root/package",
"description": "Root package that overwrites an installation path.",
"type": "marshaller-asset",
"require": {
"matthimatiker/marshaller": "*"
},
"extra": {
"installation-paths": {
"my/package": "another/path"
}
}
}
上述示例强制将包 my/package 安装到目录 another/path 中。
如果所需包以及根包都定义了安装路径,则将使用根包中的配置。
后备行为
如果包使用 Marshaller 安装器,但包本身或根包都没有定义安装路径,则将执行 Composer 的默认行为,并将包复制到 vendor 目录。