使用Composer使用zendframework 3创建新项目时出现的问题



请允许我尝试学习Framework Zend 3,即使我知道它已经过时了,但我应该学习它,因为我必须在公司交替使用它。

我正在尝试遵循此处详细的安装说明(https://www.tutorialspoint.com/zend_framework/zend_framework_skeleton_application.htm),并使用命令:

composer create-project -n -sdev zendframework/skeleton-application myPremAppZEND

但在运行composer更新后,我得到了以下错误:

在此处输入图像描述这里的问题没有咨询图片:

Your requirements could not be resolved to an installable set of packages.

问题1

- Root composer.json requires zendframework/zend-skeleton-installer ^0.1.7 || ^1.0 -> satisfiable by zendframework/zend-skeleton-installer[0.1.7].
- zendframework/zend-skeleton-installer 0.1.7 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.1.0] but it does not match the constraint.

问题2

- zendframework/zend-component-installer[1.0.0, ..., 1.1.1, 2.1.0, ..., 2.1.2] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.1.0] but it does not match the constraint.
- Root composer.json requires zendframework/zend-component-installer ^1.0 || ^2.1 -> satisfiable by zendframework/zend-component-installer[1.0.0, 1.1.0, 1.1.1, 2.1.0, 2.1.1, 2.1.2].

在这里,我将发布composer.json:文件

{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for Zend Framework zend-mvc applications",
"type": "project",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"mvc",
"zf"
],
"homepage": "http://framework.zend.com/",
"require": {
"php": "^5.6 || ^7.0",
"zendframework/zend-component-installer": "^1.0 || ^2.1",
"zendframework/zend-skeleton-installer": "^0.1.7 || ^1.0",
"zendframework/zend-mvc": "^3.1.1",
"zfcampus/zf-development-mode": "^3.2"
},
"autoload": {
"psr-4": {
"Application\": "module/Application/src/"
}
},
"autoload-dev": {
"psr-4": {
"ApplicationTest\": "module/Application/test/"
}
},
"extra": {
"zend-skeleton-installer": [
{
"name": "zendframework/zend-developer-tools",
"constraint": "^1.2.3",
"prompt": "Would you like to install the developer toolbar?",
"module": true,
"dev": true
},
{
"name": "zendframework/zend-cache",
"constraint": "^2.9.0",
"prompt": "Would you like to install caching support?",
"module": true
},
{
"name": "zendframework/zend-db",
"constraint": "^2.10.0",
"prompt": "Would you like to install database support (installs zend-db)?",
"module": true
},
{
"name": "zendframework/zend-mvc-form",
"constraint": "^1.0",
"prompt": "Would you like to install forms support?",
"module": true
},
{
"name": "zendframework/zend-json",
"constraint": "^3.1.2",
"prompt": "Would you like to install JSON de/serialization support?"
},
{
"name": "zendframework/zend-log",
"constraint": "^2.11",
"prompt": "Would you like to install logging support?",
"module": true
},
{
"name": "zendframework/zend-mvc-console",
"constraint": "^1.2.0",
"prompt": "Would you like to install MVC-based console support? (We recommend migrating to zf-console, symfony/console, or Aura.CLI)",
"module": true
},
{
"name": "zendframework/zend-mvc-i18n",
"constraint": "^1.1.1",
"prompt": "Would you like to install i18n support?",
"module": true
},
{
"name": "zendframework/zend-mvc-plugins",
"constraint": "^1.0.1",
"prompt": "Would you like to install the official MVC plugins, including PRG support, identity, and flash messages?",
"module": true
},
{
"name": "zendframework/zend-psr7bridge",
"constraint": "^1.2.0",
"prompt": "Would you like to use the PSR-7 middleware dispatcher?"
},
{
"name": "zendframework/zend-session",
"constraint": "^2.9.1",
"prompt": "Would you like to install sessions support?",
"module": true
},
{
"name": "phpunit/phpunit",
"constraint": "^5.7.27 || ^6.5.14 || ^7.5.17",
"prompt": "Would you like to install testing support?",
"dev": true
},
{
"name": "zendframework/zend-test",
"constraint": "^3.3.0",
"prompt": "Would you like to install MVC testing tools for testing support?",
"dev": true
},
{
"name": "zendframework/zend-servicemanager-di",
"constraint": "^1.2.1",
"prompt": "Would you like to install the zend-di integration for zend-servicemanager?",
"module": true
}
]
},
"scripts": {
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"development-disable": "zf-development-mode disable",
"development-enable": "zf-development-mode enable",
"development-status": "zf-development-mode status",
"post-create-project-cmd": [
"@development-enable",
"php bin/update-gitignore.php"
],
"serve": "php -S 0.0.0.0:8080 -t public",
"test": "phpunit"
}

}

我被迫使用以下命令迁移到Composer的1.10版本:

composer self-update --1

然后我用以下命令正常创建了我的项目:

composer create-project zendframework/skeleton-application path/to/install

相关内容

  • 没有找到相关文章

最新更新