从git repositroy安装依赖项目

时间:2016-06-30 08:33:06

标签: php json git yii2 composer-php

我对作曲家的依赖有些麻烦。我的基本项目有以下json文件:

"require": {
    "klabs/side-menu-widget": "dev-master"
},
"repositories": [
    {
        "type": "git",
        "url": "git@bitbucket.org:klabsers/side-menu-widget.git"
    }
]

klabs / side-menu-widget 包含以下composer.json文件:

{
    "name": "klabs/side-menu-widget",
    "description": "Responsive side menu widget for Yii 2 framework",
    "type": "yii2-extension",
    "keywords": [
        "yii",
        "extension",
        "widget",
        "yii2",
        "yii 2",
        "menu",
        "bootstrap"
    ],
    "homepage": "https://bitbucket.org/klabsers/side-menu-widget/overview",
    "license": "BSD-3-Clause",
    "authors": [
    {
        "name": "Urmat Zhenaliev",
        "email": "sonkei@ya.ru",
        "homepage": "http://prosoft.kg",
        "role": "Developer"
    }
    ],
    "support": {
        "issues": "https://bitbucket.org/klabsers/side-menu-widget/issues",
        "source": "https://bitbucket.org/klabsers/side-menu-widget"
    },
    "require": {
        "yiisoft/yii2": "*",
        "klabs/font-awesome-asset": "dev-master"
    },
    "autoload": {
        "psr-4": {
            "klabs\\widgets\\menu\\side\\": ""
        }
    },
    "repositories": [
    {
        "type": "git",
        "url": "git@bitbucket.org:klabsers/font-awesome-asset.git"
    }
    ]
}

不要

"require": {
    "yiisoft/yii2": "*",
    "klabs/font-awesome-asset": "dev-master"
},

这个项目(klabs / side-menu-widget)需要另一个名为 klabs / font-awesome-asset 的git存储库,它具有以下composer.json文件:

{
    "name": "klabs/font-awesome-asset",
    "description": "Font Awesome css framework asset manager for Yii 2 framework",
    "type": "yii2-extension",
    "keywords": [
        "yii",
        "extension",
        "widget",
        "asset",
        "assets",
        "yii2",
        "yii 2",
        "menu",
        "font",
        "font-awesome",
        "awesome"
    ],
    "homepage": "https://bitbucket.org/klabsers/font-awesome-asset/overview",
    "license": "BSD-3-Clause",
    "authors": [
    {
        "name": "Urmat Zhenaliev",
        "email": "sonkei@ya.ru",
        "homepage": "http://prosoft.kg",
        "role": "Developer"
    }
    ],
    "support": {
        "issues": "https://bitbucket.org/klabsers/font-awesome-asset/issues",
        "source": "https://bitbucket.org/klabsers/font-awesome-asset"
    },
    "require": {
        "yiisoft/yii2": "*"
    },
    "autoload": {
        "psr-4": {
            "klabs\\assets\\font_awesome\\": ""
        }
    }
}

但是当我尝试安装 klabs / side-menu-widget 时,我收到错误:

enter image description here 我的不安是 - 它是否可用于autoload git respository依赖,而不包括在我的基本项目中,如果是,我做错了什么?

1 个答案:

答案 0 :(得分:1)

似乎忽略了儿童作曲家文件 this answer

  

未以递归方式解析存储库。您只能将它们添加到主composer.json