使用 Composer 添加软件包(通过 SVN)
我为我的个人PHP库创建了一个SVN存储库,并在根级别添加了一个composer.json文件:
{
"name": "myPersonalLibrary/lib",
"type": "library",
"description": "Light MVC framework for PHP 5.4",
"keywords": ["database","mvc"],
"homepage": "http://mysite.com",
"license": "MIT",
"require": {
"php": ">=5.3.0",
"mustache/mustache": "dev-master"
},
"autoload": {
"psr-0": {
"bbn": "src"
}
}
}
然后,我使用以下 composer.json 创建了一个项目:
{
"require": {
"monolog/monolog": "1.0.*",
"zerkalica/php-code-sniffer": "dev-master",
"mustache/mustache": "dev-master",
"myPersonalLibrary/lib": "*"
},
"repositories": [
{
"type": "svn",
"url": "https://mysite.com/svn/myPersonalLibrary",
"branches-path": false,
"tags-path": false,
"trunk-path": "src"
}
]
}
当我尝试更新我的项目时,我得到:No valid composer.json was found in any branch or tag of https...
我认为问题来自我的文件结构,但我无法找到有关此的任何文档:
/my_repo
/src
/lib
/api
/db
/file
/html
....
/mvc.php
/obj.php
/composer.json
我试图在 packagist.org 上发布我的URL,并得到了No valid/supported repository was found at the given URL