Download the PHP package dcarbone/php-consul-api-bundle without Composer
On this page you can find all versions of the php package dcarbone/php-consul-api-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dcarbone/php-consul-api-bundle
More information about dcarbone/php-consul-api-bundle
Files in dcarbone/php-consul-api-bundle
Package php-consul-api-bundle
Short Description Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project
License Apache-2.0
Informations about the package php-consul-api-bundle
php-consul-api-bundle
Bundle to enable usage of dcarbone/php-consul-api inside of a Symfony 3 project
Installation
In your composer.json
file:
In your AppKernel.php
file:
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.
The service can be accessed using the consul_api.local
service. This is also the default target of the
consul_api.default
alias.
Default Configuration
You may optionally override the default configuration with one of the named configurations you have specified as such:
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.
The available configuration parameters are:
- 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:
This will create a new service named consul_api.nifty_name
with the specified configuration options.
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.
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
All versions of php-consul-api-bundle with dependencies
ext-json Version *
ext-curl Version *
dcarbone/php-consul-api Version 0.6.*
symfony/framework-bundle Version ~3.0
symfony/yaml Version ^3.0
symfony/console Version ~3.0