shopware-ag/plugin-info

此包已被废弃,不再维护。作者建议使用shopwarelabs/plugin-info包。

读取shopware插件的元数据

0.1.0 2021-07-14 06:52 UTC

This package is auto-updated.

Last update: 2022-10-24 13:37:24 UTC


README

Software License

插件信息库允许您分析shopware插件的新plugin.json元数据文件。这样,您可以在不分析bootstrap文件本身的情况下,读取版本或变更日志。

安装

通过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"
        ]
    }
}