shopwarelabs / plugin-info
读取shopware插件的插件元数据
0.1.0
2021-07-14 06:52 UTC
Requires
- php: ^7.2 || ^8.0
- ext-dom: *
- ext-zip: *
- justinrainbow/json-schema: ~5.2.10
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0.0
- kubawerlos/php-cs-fixer-custom-fixers: ^2.5.0
- phpunit/phpunit: ^9.5.4
This package is auto-updated.
Last update: 2024-08-24 17:18:44 UTC
README
插件信息库允许您分析新插件.json元数据文件的shopware插件元数据。这样,您可以在不分析启动文件本身的情况下读取版本或更改日志。
安装
通过Composer
$ composer require shopwarelabs/plugin-info
使用方法
use Shopware\PluginInfo;
use Shopware\PluginInfo\Backend;
$info = new PluginInfo(new Zip());
$plugin = $info->get('plugin.zip');
$plugin->getCurrentVersion() // 2.4.0
$plugin->isCompatibleWith('4.3.0') // boolean
$plugin->getChangelogs() // array of changelogs
$plugin->getChangelog('2.4.0', 'en') // english changelog for version 2.4.0
plugin.json
plugin.json文件应放置在与Bootstrap.php相同的文件夹中。
它看起来像这样
{
"label": {
"de": "German label of the plugin",
"en": "English label of the plugin"
},
"copyright": "(c) by me",
"license": "MIT",
"link": "http://plugin-homepage-or-store-link.de",
"author": "Jon Doe",
"currentVersion": "1.0.6",
"changelogs": {
"de": {
"1.0.6": "German changelog"
},
"en": {
"1.0.6": "English changelog"
}
},
"compatibility": {
"minimumVersion": "4.1.3",
"maximumVersion": null,
"blacklist": [
"4.1.4"
]
}
}