作曲家在错误的路径中安装了自己的TYPO3扩展 [英] composer installs own TYPO3 extension in wrong path

查看:54
本文介绍了作曲家在错误的路径中安装了自己的TYPO3扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Bitbucket上托管了自己的TYPO3扩展。通过composer可以获取此文件(请参阅此处输入)。该扩展名已下载到我的供应商文件夹中。在那里,我无法通过扩展管理器安装扩展。

I have a own TYPO3 extension hosted on bitbucket. Getting this via composer works (see here for input). The extension is downloaded into my vendor folder. Being there i cannot install the extension via extension-manager.

如何将我的ext放入typo3conf / ext中(确保自动加载有效)?

How can I getting my ext into typo3conf/ext (ensuring autoloading will work)?

扩展名通过

{
"type": "composer",
"url": "http://composer.typo3.org/"
}

(如预期的那样):

web/typo3config/ext 

这是我的项目composer.json:

here is my project composer.json:

{
  "repositories": [
        {
            "type": "composer",
            "url": "http://composer.typo3.org/"
        },
        {
            "type": "package",
            "package": {
                "name": "metaxos/exaibbrplus",
                "version": "dev-2016",
                "source": {
                    "url": "https://metaxos@bitbucket.org/metaxos/exaibbrplus.git",
                    "type": "git",
                    "reference": "release/2016"
                }
            }
        }
    ],
  "name": "Metaxos/ibbrating2016",
  "require": {
    "typo3/cms": "7.6.2",
    "bk2k/bootstrap-package" : "dev-master",
    "typo3-ter/compatibility6" : "7.6.0",
    "typo3-ter/extension-builder" : "7.6.0",
    "metaxos/exaibbrplus": "dev-2016"
  },
  "extra": {
    "typo3/cms": {
      "cms-package-dir": "{$vendor-dir}/typo3/cms",
      "web-dir": "web"
    }
  }
} 

这是我的扩展名composer.json:

here is my extension composer.json:

{
  "name": "metaxos/exaibbrplus",
  "description": "custom ext for typo3",
  "type": "typo3-cms-extension",
  "version": "0.0.1",
  "require": {
    "typo3/cms-core": ">=7.6.0,<8.0"
  },
  "replace": {
    "extkey": "self.version",
    "typo3-ter/extkey": "self.version"
  },
  "autoload": {
    "psr-4": {
      "Metaxos\\Exaibbrplus\\": "Classes/"
    }
  },
  "keywords": ["custom", "ext"],
  "homepage": "http://www.blah.ch"
}


推荐答案

您需要添加类型键,其值为 typo3-cms-extension 到根 composer.json 。这会将您的扩展程序放置在 web / typo3conf / ext 中,而不是 vendor / $ vendor / $ package

You need to add the type key with the value typo3-cms-extension to the root composer.json. This will place your extension in web/typo3conf/ext instead of vendor/$vendor/$package which in turn will make it available to the cms.

重要的是,要知道是否将根composer.json中的软件包重新定义为存储库类型 package 没有,来自扩展名的 composer.json 文件将被考虑在内,您需要在根 composer.json 根中定义对该软件包的任何关注。

It is important, to know that if you redefine the package in the root composer.json as repository type package, nothing from the extensions' composer.json file will be taken into account and you need to define any concerns about that package in the root composer.json.

因此,按照我上面提到的规则,您的根 composer.json 看起来像这样:

So-applying the rules I mentioned above, your root composer.json will look like that:


{
存储库:[
{
type: composer,
url: http://composer.typo3 .org /
},
{
type: package,
package:{
name: metaxos / exaibbrplus,
version: dev-2016,
type: typo3-cms-extension,
源:{
url: https://metaxos@bitbucket.org/metaxos/exaibbrplus.git,
type: git,
reference: release / 2016
},
autoload:{
psr-4:{
Metaxos\\Exaibbrplus\\:类/
}
},
}
}
],
名称: Metaxos / ibbrating2016,
要求:{
typo3 / cms: 7.6.2,
bk2k / bootstrap-package: dev- master,
typo3-ter / compatibility6: 7.6.0,
typo3-ter / extension-builder: 7.6.0,
metaxos / exaibbrplus : dev-2016
},
extra:{
typo3 / cms:{
cms-package-dir: {$ vendor-dir } / typo3 / cms,
web-dir: web
}
}
}

作为我@helmbert在上面提到,您要么完全重新定义了软件包,要么使用其他存储库类型。您可能要考虑使用satis或URL存储库。

As mentioned above by @helmbert, you are either left with completely redefining the package or using another repository type. You may want to consider using satis or a URL repository.

这篇关于作曲家在错误的路径中安装了自己的TYPO3扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆