安装 Typo3 扩展时出现扩展不可用错误。

huangapple go评论47阅读模式
英文:

Extension not available error when installing Typo3 Extension

问题

我是新手TYPO3用户,已成功安装TYPO3版本9.5。现在,我正在尝试开发自己的扩展,我已经尝试了TYPO3 Kickstart来简化流程。然而,无论我如何尝试,都似乎没有成功,因为每次尝试安装我的扩展时,我都会一直遇到以下错误消息:“扩展myExtensionName不可用”。该扩展位于目录typo3conf/ext/中。此外,我使用网站sitepackagebuilder.com创建了一个扩展,但不幸的是,每当我尝试安装任何扩展时,我仍然会遇到相同的错误消息。
我想使用Composer创建一个扩展。

ext_emconf.php:

<?php
$EM_CONF[$_EXTKEY] = [
    'title' => '我的扩展',
    'description' => 'Typo3计划任务的命令',
    'category' => '插件',
    "uploadfolder" => 0,
    "clearcacheonload" => true,
    'author_email' => '',
    'state' => 'alpha',
    'createDirs' => '',
    'clearCacheOnLoad' => 1,
    'version' => '1.0.0',
    'autoload' => [
        'psr-4' => [
            "Foo\\Bar\\" => "Classes/"
        ]
    ],
    'constraints' => [
        'depends' => [
            'typo3' => '9.5.0-9.5.99',
        ],
        'conflicts' => [],
        'suggests' => [],
    ],
];

composer.json:

{
  "name": "foo/my_extension",
  "description": "Typo3计划任务的命令",
  "type": "typo3-cms-extension",
  "version": "9.5.0",
  "prefer-stable": true,
  "keywords": [
    "TYPO3",
    "CMS",
    "扩展"
  ],
  "homepage": "https://example.com",
  "license": "MIT",
  "authors": [
    {
      "name": "示例",
      "email": "test@example.com"
    }
  ],
  "require": {
    "php": ">=7.2.0",
    "typo3/cms-core": "^9.5 || 10.2.0 - 10.4.99",
    "typo3/cms-backend": "~8.7.10 || ~9.5.0",
    "typo3/cms-extbase": "~8.7.10 || ~9.5.0",
    "typo3/cms-scheduler": "~8.7.10 || ~9.5.0"
  },
  "autoload": {
    "psr-4": {
      "Foo\\Bar\\": "Classes/"
    }
  },
  "replace": {
    "foo/my_extension": "self.version"
  }
}

(注意:我只翻译了代码部分,不包括您的问题或其他内容。)

英文:

I'm new to TYPO3 and have successfully installed TYPO3 version 9.5. Now, I'm attempting to develop my own extension, and I've already tried TYPO3 Kickstart to streamline the process. However, none of the attempts seem to have worked, as I consistently encounter the following error message when trying to install my extension: "Extension myExtensionName is not available." The extension is located in the directory typo3conf/ext/. Additionally, I've created a extension using the website sitepackagebuilder.com, but unfortunately, I continue to encounter the same error message whenever I attempt to install any extension.
I want to create a extension with composer.

ext_emconf.php:

    &lt;?php
$EM_CONF[$_EXTKEY] = [
    &#39;title&#39; =&gt; &#39;My extension&#39;,
    &#39;description&#39; =&gt; &#39;Typo3 Command for Scheduler&#39;,
    &#39;category&#39; =&gt; &#39;plugin&#39;,
    &quot;uploadfolder&quot; =&gt; 0,
    &quot;clearcacheonload&quot; =&gt; true,
    &#39;author_email&#39; =&gt; &#39;&#39;,
    &#39;state&#39; =&gt; &#39;alpha&#39;,
    &#39;createDirs&#39; =&gt; &#39;&#39;,
    &#39;clearCacheOnLoad&#39; =&gt; 1,
    &#39;version&#39; =&gt; &#39;1.0.0&#39;,
    &#39;autoload&#39; =&gt; [
        &#39;psr-4&#39; =&gt; [
      &quot;Foo\\Bar\\&quot;: &quot;Classes/&quot;
        ]
    ],
    &#39;constraints&#39; =&gt; [
        &#39;depends&#39; =&gt; [
            &#39;typo3&#39; =&gt; &#39;9.5.0-9.5.99&#39;,
        ],
        &#39;conflicts&#39; =&gt; [],
        &#39;suggests&#39; =&gt; [],
    ],
];

composer.json:

    {
  &quot;name&quot;: &quot;foo/my_extension&quot;,
  &quot;description&quot;: &quot;Typo3 Command for Scheduler&quot;,
  &quot;type&quot;: &quot;typo3-cms-extension&quot;,
  &quot;version&quot;: &quot;9.5.0&quot;,
  &quot;prefer-stable&quot;: true,
  &quot;keywords&quot;: [
    &quot;TYPO3&quot;,
    &quot;CMS&quot;,
    &quot;Extension&quot;
  ],
  &quot;homepage&quot;: &quot;https://example.com&quot;,
  &quot;license&quot;: &quot;MIT&quot;,
  &quot;authors&quot;: [
    {
      &quot;name&quot;: &quot;example&quot;,
      &quot;email&quot;: &quot;test@example.com&quot;
    }
  ],
  &quot;require&quot;: {
    &quot;php&quot;: &quot;&gt;=7.2.0&quot;,
    &quot;typo3/cms-core&quot;: &quot;^9.5 || 10.2.0 - 10.4.99&quot;,
    &quot;typo3/cms-backend&quot;: &quot;~8.7.10 || ~9.5.0&quot;,
    &quot;typo3/cms-extbase&quot;: &quot;~8.7.10 || ~9.5.0&quot;,
    &quot;typo3/cms-scheduler&quot;: &quot;~8.7.10 || ~9.5.0&quot;
  },
  &quot;autoload&quot;: {
    &quot;psr-4&quot;: {
      &quot;Foo\\Bar\\&quot;: &quot;Classes/&quot;
    }
  },
  &quot;replace&quot;: {
    &quot;foo/my_extension&quot;: &quot;self.version&quot;
  }
}

答案1

得分: 0

你的 ext_localconf.php 内容看起来应该放到 ext_emconf.php 中。

英文:

Your ext_localconf.php content looks like it belongs into ext_emconf.php

答案2

得分: 0

当您的扩展不按预期工作,但其他扩展正常时,请比较文件并尝试识别相关的差异。

如果您使用扩展生成器,请尝试创建一个应该正常工作的最小扩展,并与您的扩展进行比较。

请注意您使用的扩展(extensionbuilder,用于比较的扩展),因为TYPO3 9是一个旧版本,当前的扩展可能不再与其兼容。请使用与TYPO3 9匹配的扩展和文档。

英文:

when your extension doesn't work as expected, but others do, compare the files and try to identify the relevant difference.

If you use the extension builder try to create a minimal extension which should work and compare to yours.

Be careful what extensions you use (extensionbuilder, extensions to compare) as TYPO3 9 is an old version and current extensions might not working any more with it. Use extensions and documentation matching to TYPO3 9.

huangapple
  • 本文由 发表于 2023年7月23日 18:39:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76747793.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定