2017 © Pedro Peláez
 

bundle elastica-bundle

Really simple bundle to use Elastica within Symfony applications

image

gbprod/elastica-bundle

Really simple bundle to use Elastica within Symfony applications

  • Thursday, February 22, 2018
  • by gbprod
  • Repository
  • 2 Watchers
  • 6 Stars
  • 13,399 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 11 % Grown

The README.md

ElasticaBundle

Build Status codecov Scrutinizer Code Quality Dependency Status, (*1)

Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Really simple bundle to use elastica within Symfony applications. Allows you to create elastica service in Symfony application. The aim is to create a ligthweigth alternative to FOSElasticaBundle, because sometimes, we don't need all that stuffs., (*3)

Installation

Download bundle using composer :, (*4)

composer require gbprod/elastica-bundle

Declare in your app/AppKernel.php file:, (*5)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new GBProd\ElasticaBundle\ElasticaBundle(),
        // ...
    );
}

Configuration

Clients

# app/config/config.yml
elastica:
    clients:
        default:
            host: 127.0.0.1
            port: 9200
        other_client:
            host: 127.0.0.1
            port: 9201

If using a cluster:, (*6)

# app/config/config.yml
elastica:
    clients:
        default:
            connections:
                - { host: localhost, port: 9200 }
                - { host: localhost, port: 9201 }

Available options: host, port, path, url, proxy, transport, persistent, timeout and proxy, (*7)

Custom logger

By default, this bundle logs queries using the Symfony's default logger (@logger) into an elastica channel., (*8)

You can use a customized logger with the logger configuration option:, (*9)

# app/config/config.yml
elastica:
    logger: my_custom_logger_service_id
    clients:
        default:
            host: 127.0.0.1
            port: 9200

Usage

You can now use service elastica.default_client or elastica.my_other_client, (*10)

$client = $container->get('elastica.default_client');

Services autowiring support

Symfony 3.3 have introduced support for services autowiring. To be able to autowire Elastica connection into your services you need to setup your client configuration with a name default. In a case if you have multiple connections - only default connection will be enabled for autowiring because services autowiring is resolved by class names., (*11)

Autowiring support is enabled by default, but if you need to disable it for some reason - you can do it by set autowire: false parameter:, (*12)

# app/config/config.yml
elastica:
    autowire: false
    clients:
        default:
            host: 127.0.0.1
            port: 9200

Tests

Clone this repository (or a fork). You should have php>=5.6 and composer installed., (*13)

make test-unit

Contributing

Feel free to contribute, see CONTRIBUTING.md file for more informations., (*14)

The Versions

18/01 2018

v1.1.0

1.1.0.0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

08/08 2017

v1.0.1

1.0.1.0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

31/12 2016

v1.0.0

1.0.0.0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

30/12 2016

v1.0-beta.1

1.0.0.0-beta1

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

18/12 2016

v1.0-beta.0

1.0.0.0-beta0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

17/12 2016

v0.2.0

0.2.0.0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

10/05 2016

v0.1.2

0.1.2.0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

20/04 2016

v0.1.1

0.1.1.0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

11/04 2016

v0.1.0

0.1.0.0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

11/04 2016

v0.1-beta.0

0.1.0.0-beta0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod

10/04 2016

v0.1-alpha.0

0.1.0.0-alpha0

Really simple bundle to use Elastica within Symfony applications

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar gbprod