请教一个关于componse.json中request必须项的问题?
需求:要求安装GD或imagick,componse.json
如下
"require": {
"ext-gd": "to use the GD implementation",
"ext-imagick": "to use the Imagick implementation"
}
问题:这样必须要求安装GD和imagick,我需要在这两个任意安装一个即可,我看到有个属性是suggest
,如下:
"suggest": {
"ext-gd": "to use the GD implementation",
"ext-imagick": "to use the Imagick implementation"
}
问题:这是建议,有没有安装依赖都不影响,请问如何做到,要求需求方必须安装GD或imagick中任意一个呢?
getcomposer.org/doc/articles/scrip...
Laravel 的扩展的话,你可以直接加在 ServiceProvider 判断呗,如果没有就直接抛异常。
GPT 给出的曲线方案,可以试试看