我在使用 composer 安装 ZF2 组件时遇到了一些问题。
我确实知道如何使用 ZF2,但现在我想让 composer 的用户将模块放入我现有的项目中,而不是通过 zip 下载它们。
我通过作曲家了解了如何构建一个新项目:
composer create-project --repository-url="http://packages.zendframework.com" zendframework/skeleton-application --stability dev
在我将骨架应用程序重命名为我的项目名称之后。
好的,我的问题。我想通过 composer 安装 ZcfBase 模块,但遇到以下问题;
我将项目的作曲家值添加到我自己的作曲家中;
{
"name": "zendframework/skeleton-application",
"description": "Skeleton Application for ZF2",
"license": "BSD-3-Clause",
"keywords": [
"framework",
"zf2"
],
"homepage": "http://framework.zend.com/",
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.2.*"
},
"name": "zf-commons/zfc-base",
"description": "A set of genetic (abstract) classes which are commonly used across multiple modules.",
"type": "library",
"keywords": [
"zf2"
],
"homepage": "https://github.com/ZF-Commons/ZfcBase",
"authors": [
{
"name": "Evan Coury",
"email": "me@evancoury.com",
"homepage": "http://blog.evan.pro/"
},
{
"name": "Kyle Spraggs",
"email": "theman@spiffyjr.me",
"homepage": "http://www.spiffyjr.me/"
}
],
"require": {
"php": ">=5.3.3",
"zendframework/zend-db": "~2.1",
"zendframework/zend-eventmanager": "~2.1",
"zendframework/zend-loader": "~2.1",
"zendframework/zend-modulemanager": "~2.1",
"zendframework/zend-mvc": "~2.1",
"zendframework/zend-servicemanager": "~2.1",
"zendframework/zend-stdlib": "~2.1"
},
"autoload": {
"psr-0": {
"ZfcBase": "src/"
},
"classmap": [
"./Module.php"
]
}
}
我运行“作曲家更新”并在“作曲家安装”之后返回:
[RuntimeException]
Could not scan for classes inside "./Module.php" which does not appear to be a file nor a folder
在我看来,我的供应商结构也有点奇怪;
我习惯了这种结构(不使用作曲家)
希望有人可以通过如何以正确的方式配置它来给我一个正确的方式。
提前致谢!:)