创建第三部分包并在项目之间共享

时间:2016-04-01 11:10:45

标签: symfony

当你想使用FosRestBundle和jmsSerializer在symfony2上创建一个restfull api时,我创建了一个小小的包,节省了很多时间。

我想在我的项目中共享此捆绑包,但是当我将其添加到目的地时,作曲家会返回“您的要求无法解析为可安装的一组包。”

我想我做错了但却找不到什么

{
    "name": "lenim/api-generic-bundle",
    "type": "symfony-bundle",
    "description": "Rest Api creation helper",
    "keywords": ["Api", "RestApi"],
    "homepage": "http://friendsofsymfony.github.com",
    "license": "MIT",
    "minimum-stability" : "dev",
    "target-dir": "LeniM/ApiGenericBundle",
    "authors": [
        {
            "name": "Martin Leni",
            "role" : "Developer"
        }
    ],
    "require": {
        "php": ">=5.3.3",
        "symfony/framework-bundle": "~2.3|~3.0",
        "doctrine/orm": "^2.5",
        "friendsofsymfony/rest-bundle": "^1.7",
        "jms/serializer-bundle": "^1.1"
    },
    "require-dev": {
        "symfony/console": "~2.3|~3.0",
        "symfony/phpunit-bridge": "~2.7|~3.0",
        "symfony/validator": "~2.3|~3.0",
        "symfony/yaml": "~2.3|~3.0",
        "willdurand/propel-typehintable-behavior": "~1.0"
    },
    "suggest": {
        "nelmio/NelmioApiDocBundle": "More than recommanded to keep your api well documentated"
    },
    "autoload": {
        "psr-4": { "LeniM\\ApiGenericBundle\\": "" }
    },
    "extra": {
        "branch-alias": {
            "dev-master": "1.0.x-dev"
        }
    },
    "support": {
        "docs": "https://github.com/LeniM/apiGenericBundle/readme.md"
    }
}
  • 需要它的名称:lenim / api-generic-bundle

还有别的办法可以将你的thrid part bundle注册到作曲家吗?

谢谢:)

1 个答案:

答案 0 :(得分:2)

您必须在packagist.org上发布此包,或在特定项目的composer.json文件中指定目标存储库路径:https://getcomposer.org/doc/05-repositories.md#vcs