我在使用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"
]
}
}我运行'composer更新‘和'composer install’之后,返回到:
[RuntimeException]
Could not scan for classes inside "./Module.php" which does not appear to be a file nor a folder 我的摊贩的结构在我看来也有点奇怪;

我习惯了这种结构(不使用作曲家)

希望有人能给我一个正确的方式,通过如何配置它在正确的方式。
谢谢!)
发布于 2013-09-24 11:57:10
在/var/www/中运行命令
composer create-project --repository-url="http://packages.zendframework.com" zendframework/skeleton-application --stability dev创建一个文件夹:/var/www/skeleton-application/
你要做的就是:
进入此文件夹:
cd /var/www/skeleton-application/并安装ZfcBase模块:
composer.phar require zf-commons/zfc-base:dev-master这相当于:[project_name]:branch。
为了找到其他模块的项目名称,进入它们的composer.json并检查' name ':https://github.com/ZF-Commons/ZfcBase/blob/master/composer.json
希望这能帮上忙!
https://stackoverflow.com/questions/18978315
复制相似问题