将github存储库添加到我的composer项目
我想创建一个新的作曲家项目。我将包括代码,这是不是在PackageGist。它是一个github存储库。具体地说,我喜欢包括这个版本 我希望通过这个将github存储库添加到我的composer项目,github,composer-php,Github,Composer Php,我想创建一个新的作曲家项目。我将包括代码,这是不是在PackageGist。它是一个github存储库。具体地说,我喜欢包括这个版本 我希望通过这个composer.json获取4.0.0-alpha12版本: { "name": "vendor/my_joomla_website", "description": "Testing to install joomla with extensions via composer", "type": "project",
composer.json
获取4.0.0-alpha12版本:
{
"name": "vendor/my_joomla_website",
"description": "Testing to install joomla with extensions via composer",
"type": "project",
"license": "GNU",
"authors": [
{
"name": "vendor",
"email": "myemail"
}
],
"repositories": [
{
"type": "git",
"url": "https://github.com/joomla/joomla-cms.git"
}
],
"require": {
"joomla/joomla-cms": "dev-4.0-dev#4.0.0-alpha12"
}
}
但是命令comoser install
没有运行到最后。这是我的留言
composer install
Loading composer repositories with package information
[Symfony\Component\Process\Exception\ProcessTimedOutException]
The process "git clone --mirror 'https://github.com/joomla/joomla-cms.git' '/home/astrid/.composer/cache/vcs/htt
ps---github.com-joomla-joomla-cms.git/'" exceeded the timeout of 300 seconds.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
现在我得到了这个错误
composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package joomla/joomla-cms dev-4.0-dev#4.0.0-alpha12 exists as joomla/joomla-cms[4.0.0-alpha12] but these are rejected by your constraint.
我做错了什么?我还没有指定任何依赖项或限制。我不确定究竟是什么原因导致了“被约束拒绝”异常,但我猜这是因为您使用的是
分支#ref
版本要求,而say没有得到积极支持。我认为您可以只使用4.0.0-alpha12
标记,因为标记没有绑定到分支
要解决第一个问题,请将存储库类型更改为vcs
(或github
)。Composer将检测存储库是否为Github存储库,然后使用Github API获取包的正确版本。克隆过程看起来非常大,因此克隆可能需要超过允许的300秒的时间
"repositories": [
{
"type": "vcs",
"url": "https://github.com/joomla/joomla-cms.git"
}
]
对于第二期,请将版本设置为4.0.0-alpha12
:
"require": {
"joomla/joomla-cms": "4.0.0-alpha12"
}
joomla cms的4.0.0-alpha12
版本需要一个joomla/application
(joomla/application[2.0.x-dev]
)的开发版本,因此您必须将包设置为dev
:
"minimum-stability": "dev",
"minimum-stability": "dev",