在Shopware商店中上传插件(插件的基本composer.json文件不在预期的文件夹中)

时间:2020-11-11 12:23:22

标签: shopware

我想在Shopware商店中上传插件 上传并定义要求后,当我尝试提交插件进行代码审查时,我收到了错误

Basic plugin analysis failed.
The required composer.json file was not found
Context: [
 • reason: The essential composer.json file for the plugin was not in the expected folder
]
Documentation: https://docs.shopware.com/en/shopware-platform-dev-en/references-internals/plugins/plugin-base-class?category=shopware-platform-dev-en/references-internals/plugins

我在搜索该错误并发现了这个问题https://forum.shopware.com/discussion/69413/json-composer-file-nicht-gefunden-beim-upload-in-den-community-store

我在Shopware面板中的技术名称是:

xxx46AKGoogleMapPlugin

我的composer.json是

.
"name": "aks/google-map-plugin",
.
.
"license": "proprietary",
  "autoload": {
      "psr-4": {
        "Aks\\GoogleMapPlugin\\": "src/"
      }
  },
  "require": {
        "shopware/core": "6.*",
        "shopware/storefront": "6.*",
        "shopware/administration": "6.*"
  },
  "extra": {
        "shopware-plugin-class": "Aks\\GoogleMapPlugin\\AKGoogleMapPlugin",
.
.
.

这是我的基类插件。我在需要的地方使用了 Aks \ GoogleMapPlugin 命名空间

<?php declare(strict_types=1);

namespace Aks\GoogleMapPlugin;
.
.
.
class AKGoogleMapPlugin extends Plugin
{
.

我怎么了?我的文件夹名称为 AKGoogleMapPlugin ,我在Ubuntu中创建zip文件(AKGoogleMapPlugin-> composer.json,AKGoogleMapPlugin-> src-> AKGoogleMapPlugin.php)

1 个答案:

答案 0 :(得分:1)

如果您的技术名称为xxx46AKGoogleMapPlugin,那么您的shopware插件类和文件夹的名称应完全相同。

您还应该考虑将供应商前缀xxx46AK用作作曲家名称空间的一部分,这样,您的名称空间是唯一的。

请参考以下准则:ax.set_extent