PHP

配置Composer支持本地仓库

The official address:https://getcomposer.org/doc/05-repositories.md#path

When I want to require my project, the following errors shows up:

The requested package mvc-php/framework could not be found in any version, there may be a typo in the package name.

The “mvc-php/framework” is a git folder.

Require?instead of just the branch name, you must require branchName@dev

{
    "name": "mvc-php/app",
    "repositories": [
        {
            "type": "path",
            "url": "/Users/youri/Documents/Github/framework"
        }
    ],
    "require": {
        "php": ">=7.0",
        "mvc-php/framework": "master@dev"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        }
    }
}

Project i want to require:

{
    "name": "mvc-php/framework",
    "description": "PHP MVC framework",
    "autoload": {
        "psr-4": {
            "Mvc\\" : "src/"
        }
    },
    "require": {
        "php": ">=7.0"
    }
}

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

相关文章

开始在上面输入您的搜索词,然后按回车进行搜索。按ESC取消。

返回顶部