在ZF2骨架应用程序中安装ZendSearch [英] Install ZendSearch in ZF2 skeleton application

查看:85
本文介绍了在ZF2骨架应用程序中安装ZendSearch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Lucene搜索添加到我的ZF2项目中.该软件包未在 ZF2软件包页面中列出.我试图通过从 GitHub 手动安装它来解决此问题.

I'm trying to add Lucene search to my ZF2 project. The package is not listed on the ZF2 packages page. I tried to workaround this by installing it manually from GitHub.

我将此添加到了composer.json:

I added this to my composer.json:

"repositories": [{
    "type": "package",
    "package": {
        "name": "zendframework/zendsearch",
        "version": "0.1",
        "source": {
            "url": "https://github.com/zendframework/ZendSearch.git",
            "type": "git",
            "reference": "master"
        }
    }
}]

并通过composer.phar安装了它:

and installed it via composer.phar:

$ ./composer.phar require zendframework/zendsearch:0.1

这安装了软件包,但是自动加载不起作用.有人让ZendSearch在ZF2骨架应用程序中工作吗?

This installed the package but the autoloading doesn't work. Did anyone get ZendSearch working within the ZF2 skeleton application?

推荐答案

这最终对我有用:

"repositories": [
    {
        "type": "composer",
        "url": "https://packages.zendframework.com/"
    },
    {
        "type": "package",
        "package": {
            "name": "zendframework/zendsearch",
            "version": "0.1",
            "source": {
                "url": "https://github.com/zendframework/ZendSearch.git",
                "type": "git",
                "reference": "master"
            }
        }
    }
],
"autoload": {
    "psr-0": {
        "ZendSearch\\": "vendor/zendframework/zendsearch/library/"
    }
}

这篇关于在ZF2骨架应用程序中安装ZendSearch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆