TYPO3 8.7.16: класс из расширения недоступен - PullRequest
0 голосов
/ 24 июня 2019

Я пытаюсь загрузить собственные расширения через composer.json, но когда я запускаю приложение, я всегда получаю эту ошибку:

# 1411840171: Класс "Bm \ AhContentelements \ Rendering \ VideoTagRenderer", который вы пытаетесь регистрация недоступна

Я загружаю свое расширение для ах в json как:

{
  "repositories": [
    {
      "type": "composer",
      "url": "https://composer.typo3.org/"
    },
    {
      "type": "package",
      "package": {
        "name": "Bm/ah-content-api",
        "version": "0.0.1",
        "type": "typo3-cms-extension",
        "source": {
          "url": "https://user@bitbucket.org/u/ah_config_typo3.git",
          "type": "git",
          "reference": "master"
        }
      }
    },
    {
      "type": "package",
      "package": {
        "name": "Bm/ah-contentelements",
        "version": "0.0.1",
        "type": "typo3-cms-extension",
        "source": {
          "url": "https://user@bitbucket.org/u/ah_contentelements_typo3.git",
          "type": "git",
          "reference": "master"
        }
      }
    }
  ],
  "name": "typo3/cms-base-distribution",
  "description": "TYPO3 CMS Base Distribution",
  "license": "GPL-2.0-or-later",
  "require": {
    "helhum/typo3-console": "^4.9.3 || ^5.2",
    "typo3/cms-about": "^8.7.10",
    "typo3/cms-belog": "^8.7.10",
    "typo3/cms-beuser": "^8.7.10",
    "typo3/cms-context-help": "^8.7.10",
    "typo3/cms-documentation": "^8.7.10",
    "typo3/cms-felogin": "^8.7.10",
    "typo3/cms-fluid-styled-content": "^8.7.10",
    "typo3/cms-form": "^8.7.10",
    "typo3/cms-func": "^8.7.10",
    "typo3/cms-impexp": "^8.7.10",
    "typo3/cms-info": "^8.7.10",
    "typo3/cms-info-pagetsconfig": "^8.7.10",
    "typo3/cms-rte-ckeditor": "^8.7.10",
    "typo3/cms-setup": "^8.7.10",
    "typo3/cms-sys-note": "^8.7.10",
    "typo3/cms-t3editor": "^8.7.10",
    "typo3/cms-tstemplate": "^8.7.10",
    "typo3/cms-viewpage": "^8.7.10",
    "typo3/cms-wizard-crpages": "^8.7.10",
    "typo3/cms-wizard-sortpages": "^8.7.10",
    "typo3/cms": "^8.7",
    "dmitryd/typo3-realurl": "2.*",
    "GridElementsTeam/Gridelements": "8.2.*",
    "clickstorm/cs_seo": "3.*",
    "Bm/ah-content-api": "0.0.1",
    "Bm/ah-contentelements": "0.0.1"
  },
  "scripts": {
    "typo3-cms-scripts": [
      "typo3cms install:fixfolderstructure",
      "typo3cms install:generatepackagestates"
    ],
    "post-autoload-dump": [
      "@typo3-cms-scripts"
    ]
  },
  "extra": {
    "typo3/cms": {
      "web-dir": "public"
    },
    "helhum/typo3-console": {
      "comment": "This option is not needed ay more for helhum/typo3-console 5.x",
      "install-extension-dummy": false
    }
  },
  "autoload": {
    "psr-4": {
      "Bm\\AhContentelements\\": "public/typo3conf/ext/ah-contentelements/Classes",
      "Bm\\AhContentapi\\": "public/typo3conf/ext/ah-contentapi/Classes"
    }
  }
}

Что я не так, я борюсь с этим уже несколько дней ..

Ответы [ 2 ]

1 голос
/ 25 июня 2019

Я думаю, что путь неверный: вы должны использовать корень (каталог на том же уровне, что и ваш файл композитора и каталог поставщика), например, "web" или "html".

так вместо

"autoload": {
"psr-4": {
  "Bm\\AhContentelements\\": "typo3conf/ext/ah-contentelements/Classes",
  "Bm\\AhContentapi\\": "typo3conf/ext/ah-contentapi/Classes"
}

вы должны использовать что-то вроде

"autoload": {
"psr-4": {
  "Bm\\AhContentelements\\": "web/typo3conf/ext/ah-contentelements/Classes",
  "Bm\\AhContentapi\\": "web/typo3conf/ext/ah-contentapi/Classes"
}

После смены не забудьте composer dump-autoload

1 голос
/ 24 июня 2019

Я никогда не делал так, как ты. Я всегда включаю composer.json в каждое из моих расширений. Там часть autoload выглядит так:

"autoload": {
  "psr-4": {
    "Bm\\AhContentelements\\": "Classes"
  }
}

В разделе repositories моего основного composer.json у меня есть что-то вроде этого:

{
  "type": "path",
  "url": "./packages/*"
},

Затем мне нужно мое расширение с composer require Bm/ah-contentelements:"@dev". Затем Composer ищет в каталоге packages указанное расширение.

...