Symfony2 - github - 发布包商
Symfony2 - github - publishing packagist
一个主要问题是在 composer require 包上触发错误。
我正在尝试使用 packagist 发布 Symfony 包。我已经承诺 composer.json:
{
"name" : "vendor/package",
"description" : "Some description",
"type" : "symfony-bundle",
"authors" : [{
"name" : "Name",
"email" : "example@example.com"
}],
"keywords" : [
"keywords"
],
"license" : [
"MIT"
],
"require": {
"php": ">=5.2.0",
"twig": "~1.18"
},
"autoload" : {
"psr-0" : {
"Vendor\Package" : ""
}
},
"minimum-stability": "dev",
"target-dir" : "Vendor/Package",
"repositories" : [{
}]
}
关于 packagist 绑定并成功显示包 vendor/package,所以我只有 dev-master:
"vendor/package": "dev-master"
在 Symfony 2.6 中尝试 require 包时出现问题并抛出:
composer require "vendor/package": "dev-master"
[InvalidArgumentException]
Could not find package dev-master at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability
修复此 composer.json 并添加到 Github 标签和分支版本,例如 1.0.0,然后需要版本 1.0.* 或 dev-master。
{
"name" : "vendor/package",
"description" : "Description",
"type" : "symfony-bundle",
"authors" : [{
"name" : "Name",
"email" : "example@example.com"
}],
"keywords" : [
"keywords"
],
"license" : [
"MIT"
],
"require": {
"php": ">=5.2.0",
"symfony/console": "~2.0"
},
"autoload" : {
"psr-0" : {
"vendor\package" : ""
}
},
"target-dir" : "vendor/package"
}
一个主要问题是在 composer require 包上触发错误。
我正在尝试使用 packagist 发布 Symfony 包。我已经承诺 composer.json:
{
"name" : "vendor/package",
"description" : "Some description",
"type" : "symfony-bundle",
"authors" : [{
"name" : "Name",
"email" : "example@example.com"
}],
"keywords" : [
"keywords"
],
"license" : [
"MIT"
],
"require": {
"php": ">=5.2.0",
"twig": "~1.18"
},
"autoload" : {
"psr-0" : {
"Vendor\Package" : ""
}
},
"minimum-stability": "dev",
"target-dir" : "Vendor/Package",
"repositories" : [{
}]
}
关于 packagist 绑定并成功显示包 vendor/package,所以我只有 dev-master:
"vendor/package": "dev-master"
在 Symfony 2.6 中尝试 require 包时出现问题并抛出:
composer require "vendor/package": "dev-master"
[InvalidArgumentException]
Could not find package dev-master at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability
修复此 composer.json 并添加到 Github 标签和分支版本,例如 1.0.0,然后需要版本 1.0.* 或 dev-master。
{
"name" : "vendor/package",
"description" : "Description",
"type" : "symfony-bundle",
"authors" : [{
"name" : "Name",
"email" : "example@example.com"
}],
"keywords" : [
"keywords"
],
"license" : [
"MIT"
],
"require": {
"php": ">=5.2.0",
"symfony/console": "~2.0"
},
"autoload" : {
"psr-0" : {
"vendor\package" : ""
}
},
"target-dir" : "vendor/package"
}