在Apigility驱动的应用程序中,我的composer.json
如下所示:
{
"name": "misc - myproject-api",
"description": "Skeleton Application for Apigility",
"require": {
"php": ">=5.3.23",
"zendframework/zendframework": ">=2.3.2,<3.0.0",
"zfcampus/zf-apigility": "~1.0",
"zfcampus/zf-apigility-documentation": "~1.0",
"zfcampus/zf-development-mode": "~2.0",
"zfcampus/zf-rest": "~1.0-dev",
"zf-commons/zfc-base": "dev-master",
"zendframework/zend-developer-tools": "dev-master",
"doctrine/doctrine-orm-module": "0.8.*"
},
"require-dev": {
"zendframework/zftool": "dev-master",
"zfcampus/zf-apigility-admin": "~1.0",
"zfcampus/zf-apigility-welcome": "~1.0",
"zfcampus/zf-deploy": "~1.0",
"zfr/zfr-cors": "~1.0",
"zend/zend-studio-development-mode": "~1.0"
},
"keywords": [
"api",
"apigility",
"framework",
"zf2"
],
"support": {
"email": "apigility-users@zend.com",
"irc": "irc://irc.freenode.net/apigility",
"source": "https://github.com/zfcampus/zf-apigility-skeleton",
"issues": "https://github.com/zfcampus/zf-apigility-skeleton/issues"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev",
"dev-develop": "1.1-dev"
}
},
"config": {
"process-timeout": 5000
},
"type": "library",
"license": "BSD-3-Clause",
"homepage": "http://apigility.org/"
}
存在ZF2问题(导致以下错误:Fatal error: Cannot use object of type ZendDbResultSetResultSet as array
)。它已被修复,但尚未合并到master
分支。
由于我现在需要它工作,我尝试切换到develop
分支——更新了我的composer.json
{
"name": "misc - myproject-api",
"description": "Skeleton Application for Apigility",
"require": {
"php": ">=5.3.23",
"zendframework/zendframework": "dev-develop as dev-master"
...
}
...
}
并执行composer update
:
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Updating zendframework/zendframework (dev-master de98f63 => dev-develop be0b349)
Checking out be0b3496b73a61a255d05e945b75f6fdf0995c31
Writing lock file
Generating autoload files
问题:我没有观察到任何更改,代码似乎仍然是从ZF2 master
分支加载的(例如,我的本地ZendPaginatorAdapterDbSelect
与master
分支中相应类的状态完全相同)。
如何加载ZF2 develop
分支
更新
我已经从Zend Framework的Packagist页面中检索了develop
分支(2.4.*@dev
)的composer require
方向值。结果与dev-develop
或dev-develop as dev-master
相同——控制台显示下载的正确分支(或更好的是正确提交be0b349
)
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing zendframework/zendframework (2.3.4)
- Installing zendframework/zendframework (dev-develop be0b349)
Cloning be0b3496b73a61a255d05e945b75f6fdf0995c31
Writing lock file
Generating autoload files
但是更新后的代码仍然像master
分支中的代码。
更新
$ cd [project root directory]/vendor/zendframework/zendframework
$ git status
# On branch develop
nothing to commit (working directory clean)
也就是说,分支是正确的。而且它也是最新的,自上次提交以来,git log
显示的是2月3日的be0b3496b73a61a255d05e945b75f6fdf0995c31
——这实际上是当前的HEAD版本。
所以,分支是正确的,修订是正确的。。。为什么代码是过期的?
"develop"分支有一个版本2.4的别名。你可能需要"2.4.*@dev"才能得到它。
如果这破坏了你的一些依赖关系,你可以用2.3版本来别名。
"zendframework/zendframework": "dev-develop as 2.3.4.1"