我已经从github克隆了我的Zend 2的分支,因为我想在发现潜在的bug之后做一些测试,问题是我无法运行测试,因为Bootstrap无法在vendor文件夹中找到autoload.php。我发现我需要运行composer来使用packeges更新我的供应商,就像在其他Zend 2应用程序中一样。 Composer.phar是最新的。
问题是当我在这个composer.json上运行php composer.phar安装时:
{
"name": "zendframework/zendframework",
"description": "Zend Framework 2",
"type": "library",
"keywords": [
"framework",
"zf2"
],
"homepage": "http://framework.zend.com/",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.2.5"
},
"require-dev": {
"doctrine/annotations": ">=1.0",
"ircmaxell/random-lib": "dev-master",
"ircmaxell/security-lib": "dev-master",
"ocramius/proxy-manager": "0.4.*",
"fabpot/php-cs-fixer": "*@dev",
"phpunit/PHPUnit": "3.7.*"
},
"suggest": {
"ext-intl": "ext/intl for i18n features (included in default builds of PHP)",
"doctrine/annotations": "Doctrine Annotations >=1.0 for annotation features",
"ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable",
"ocramius/proxy-manager": "ProxyManager to handle lazy initialization of services",
"zendframework/zendpdf": "ZendPdf for creating PDF representations of barcodes",
"zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha for rendering ReCaptchas in Zend\\Captcha and/or Zend\\Form"
},
"autoload": {
"psr-0": {
"Zend\\": "library/"
}
},
"bin": [
"bin/classmap_generator.php",
"bin/pluginmap_generator.php",
"bin/templatemap_generator.php"
],
"replace": {
"zendframework/zend-authentication": "self.version",
"zendframework/zend-barcode": "self.version",
"zendframework/zend-cache": "self.version",
"zendframework/zend-captcha": "self.version",
"zendframework/zend-code": "self.version",
"zendframework/zend-config": "self.version",
"zendframework/zend-console": "self.version",
"zendframework/zend-crypt": "self.version",
"zendframework/zend-db": "self.version",
"zendframework/zend-debug": "self.version",
"zendframework/zend-di": "self.version",
"zendframework/zend-dom": "self.version",
"zendframework/zend-escaper": "self.version",
"zendframework/zend-eventmanager": "self.version",
"zendframework/zend-feed": "self.version",
"zendframework/zend-file": "self.version",
"zendframework/zend-filter": "self.version",
"zendframework/zend-form": "self.version",
"zendframework/zend-http": "self.version",
"zendframework/zend-i18n": "self.version",
"zendframework/zend-inputfilter": "self.version",
"zendframework/zend-json": "self.version",
"zendframework/zend-ldap": "self.version",
"zendframework/zend-loader": "self.version",
"zendframework/zend-log": "self.version",
"zendframework/zend-mail": "self.version",
"zendframework/zend-math": "self.version",
"zendframework/zend-memory": "self.version",
"zendframework/zend-mime": "self.version",
"zendframework/zend-modulemanager": "self.version",
"zendframework/zend-mvc": "self.version",
"zendframework/zend-navigation": "self.version",
"zendframework/zend-paginator": "self.version",
"zendframework/zend-permissions-acl": "self.version",
"zendframework/zend-permissions-rbac": "self.version",
"zendframework/zend-progressbar": "self.version",
"zendframework/zend-resources": "self.version",
"zendframework/zend-serializer": "self.version",
"zendframework/zend-server": "self.version",
"zendframework/zend-servicemanager": "self.version",
"zendframework/zend-session": "self.version",
"zendframework/zend-soap": "self.version",
"zendframework/zend-stdlib": "self.version",
"zendframework/zend-tag": "self.version",
"zendframework/zend-test": "self.version",
"zendframework/zend-text": "self.version",
"zendframework/zend-uri": "self.version",
"zendframework/zend-validator": "self.version",
"zendframework/zend-version": "self.version",
"zendframework/zend-view": "self.version",
"zendframework/zend-xmlrpc": "self.version"
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev",
"dev-develop": "2.3-dev"
}
}
}
我收到此错误消息:
安装依赖项(包括require-dev)
您的要求无法解析为可安装的软件包。
问题1
我尝试了不同的方法,给出了不同的zendframework版本但我得到了类似的错误。 有人可以向我解释我在这里缺少什么吗?
答案 0 :(得分:0)
你自己更改了composer.json,它的一个非常重要的一点是:你的版本声明这个软件被称为“zendframework / zendframework”(版本号来自你的版本控制的标签),而你明确声明您需要“zendframework / zendframework”2.2.5版。
此软件包不能同时是zendframework / zendframework“您的版本”和“2.2.5”。
您不能要求自己代表的软件。您应该更详细地解释一下您要做什么,但作为一个启动者:如果您克隆原始ZF2仓库,通过提交到您的克隆(在某个适当的分支中)修复一个错误,然后想要测试是否在其他一些需要zendframework / zendframework的软件中修复了这个bug,你只需在你的软件的composer.json中包含你的存储库,并需要类似“2.2.x@dev”的东西。更新应检查您的ZF2克隆的最新提交。