我刚刚设置了Slim Framework for PHP
,很难通过composer.json
安装slim/views库
我的composer.json看起来像这样:
{
"name": "slim/slim",
"type": "library",
"description": "Slim Framework, a PHP micro framework",
"keywords": ["microframework","rest","router"],
"homepage": "http://github.com/codeguy/Slim",
"license": "MIT",
"authors": [
{
"name": "Josh Lockhart",
"email": "info@joshlockhart.com",
"homepage": "http://www.joshlockhart.com/"
}
],
"require": {
"php": ">=5.3.0",
"phing/phing": "2.*"
},
"suggest": {
"ext-mcrypt": "Required for HTTP cookie encryption"
},
"autoload": {
"psr-0": { "Slim": "." }
}
}
当我说composer require slim/views
,我收到了这个错误,我不确定它在说什么:
Problem 1
- slim/views 0.1.0 requires slim/slim >=2.0.0 -> satisfiable by slim/slim[2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.6.0, 2.6.1].
- slim/views 0.1.1 requires slim/slim >=2.4.0 -> satisfiable by slim/slim[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.6.0, 2.6.1].
- slim/views 0.1.2 requires slim/slim >=2.4.0 -> satisfiable by slim/slim[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.6.0, 2.6.1].
- slim/views 0.1.3 requires slim/slim >=2.4.0 -> satisfiable by slim/slim[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.6.0, 2.6.1].
- Can only install one of: slim/slim[2.0.0, 1.0.0].
- Can only install one of: slim/slim[2.1.0, 1.0.0].
- Can only install one of: slim/slim[2.2.0, 1.0.0].
- Can only install one of: slim/slim[2.3.0, 1.0.0].
- Can only install one of: slim/slim[2.3.1, 1.0.0].
- Can only install one of: slim/slim[2.3.2, 1.0.0].
- Can only install one of: slim/slim[2.3.3, 1.0.0].
- Can only install one of: slim/slim[2.3.4, 1.0.0].
- Can only install one of: slim/slim[2.3.5, 1.0.0].
- Can only install one of: slim/slim[2.4.0, 1.0.0].
- Can only install one of: slim/slim[2.4.1, 1.0.0].
- Can only install one of: slim/slim[2.4.2, 1.0.0].
- Can only install one of: slim/slim[2.4.3, 1.0.0].
- Can only install one of: slim/slim[2.5.0, 1.0.0].
- Can only install one of: slim/slim[2.6.0, 1.0.0].
- Can only install one of: slim/slim[2.6.1, 1.0.0].
- Installation request for slim/slim 1.0.0 -> satisfiable by slim/slim[1.0.0].
- Installation request for slim/views 0.1.* -> satisfiable by slim/views[0.1.0, 0.1.1, 0.1.2, 0.1.3].
我拥有的Slim Framework的当前版本是2.6.1
。我发现的一件事是,如果我在composer.json中指定"version":"2.6.1"
,在运行composer require slim/views
之前,在name
标记之后,composer require
运行良好,包就安装好了。不确定发生了什么;有人能帮我做这个吗?
谢谢!
正如ChrisForrence所暗示的,您的包名称slim/slim
与具有相同名称的库发生冲突将您的程序包名称更改为其他名称,slim将按预期安装。
"name": "sasanka/my-app"