2017 © Pedro Peláez
 

symfony-bundle php-consul-api-bundle

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

image

dcarbone/php-consul-api-bundle

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  • Tuesday, July 11, 2017
  • by dcarbone
  • Repository
  • 1 Watchers
  • 2 Stars
  • 264 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 2 % Grown

The README.md

php-consul-api-bundle

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project, (*1)

Installation

In your composer.json file:, (*2)

{
    "require": {
        "dcarbone/php-consul-api-bundle": "0.6.*"
    }
}

In your AppKernel.php file:, (*3)

    public function registerBundles()
    {
        $bundles = [
            // --
            new \DCarbone\PHPConsulAPIBundle\PHPConsulAPIBundle(),
            // --
        ];

        // --

        return $bundles;
    }

Local Configuration

There will always be at least one registered Consul service using the standard Consul environment variables. If you wish to use this, at the very least CONSUL_HTTP_ADDR should be defined., (*4)

The service can be accessed using the consul_api.local service. This is also the default target of the consul_api.default alias., (*5)

Default Configuration

You may optionally override the default configuration with one of the named configurations you have specified as such:, (*6)

consul_api:
    default_configuration: nifty_name

Named Configurations

If you wish to connect to multiple Consul agents, or just want to have things named differently, you may optionally configure them under the consul_api configuration namespace., (*7)

The available configuration parameters are:, (*8)

  • addr
  • scheme
  • datacenter
  • wait_time
  • http_auth
  • token
  • ca_file
  • client_cert
  • client_key
  • insecure_skip_verify
  • token_in_header
  • http_client

As an example:, (*9)

consul_api:
    named_configurations:
        nifty_name:
            addr:                   hostname.domain.woot
            scheme:                 https
            insecure_skip_verify:   false
            http_client:            ~ # Enter service name of GuzzleHttp\ClientInterface compatible http client you wish to use

This will create a new service named consul_api.nifty_name with the specified configuration options., (*10)

Twig Integration

If you are using Twig and TwigBundle in your Symfony app, there are a few functions exposed to you. You can see the full list here: PHPConsulAPIExtension., (*11)

ConsulBag

If you have multiple named configurations present and want to be able to access them all, one possible way is to utilize the ConsulBag service. It is defined as consul_api.bag, (*12)

The Versions

11/07 2017

dev-master

9999999-dev

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Daniel Carbone

11/07 2017

0.6.0

0.6.0.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Daniel Carbone

21/09 2016

0.5.2

0.5.2.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Daniel Carbone

21/09 2016

0.5.1

0.5.1.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Daniel Carbone

23/08 2016

0.5.0

0.5.0.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Daniel Carbone

17/08 2016

0.4.1

0.4.1.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Daniel Carbone

16/08 2016

0.4.0

0.4.0.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Daniel Carbone

15/08 2016

0.3.4

0.3.4.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Daniel Carbone

15/08 2016

0.3.3

0.3.3.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Daniel Carbone

04/08 2016

0.3.2

0.3.2.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

by Daniel Carbone

01/08 2016

0.3.1

0.3.1.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

by Daniel Carbone

29/07 2016

0.3.0

0.3.0.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

by Daniel Carbone

28/07 2016

0.2.0

0.2.0.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

by Daniel Carbone

28/07 2016

0.1.0

0.1.0.0

Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project

  Sources   Download

Apache-2.0

The Requires

 

by Daniel Carbone