承接 happyr/elastica-dsn 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

happyr/elastica-dsn

Composer 安装命令:

composer require happyr/elastica-dsn

包简介

DSN support to ruflin/Elastica

README 文档

README

Latest Version Software License Build Status Code Coverage Quality Score Total Downloads

This package contains a factory method to create a Elasticsearch client from ruflin/elastica. The factory supports DSN to ease config with a dependency injection container.

Install

composer require happyr/elastica-dsn

Examples

use Happyr\ElasticaDsn\ClientFactory;

$client = ClientFactory::create('elasticsearch://localhost');
$client = ClientFactory::create('elasticsearch:?host[localhost]&host[localhost:9201]&host[127.0.0.1:9202]');
$client = ClientFactory::create('elasticsearch://foo:bar@localhost:1234');
$client = ClientFactory::create('elasticsearch://localhost:9201', ['username' => 'foo', 'password' => 'bar']);

If you use Symfony service config:

services:
    Elastica\Client:
        factory: 'Happyr\ElasticaDsn\ClientFactory::create'
        arguments: ['elasticsearch://localhost']

If you want to configure the client even more, you may just get the config array from the ClientFactory and instantiate the client yourself.

use Elastica\Client;
use Happyr\ElasticaDsn\ClientFactory;

$config = ClientFactory::getConfig('elasticsearch://localhost');

// Add more stuff to $config array
$client = new Client($config);

统计信息

  • 总下载量: 889
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固