PHPackages                             dcarbone/php-consul-api-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dcarbone/php-consul-api-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

dcarbone/php-consul-api-bundle
==============================

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

0.6.1(7y ago)33171[1 PRs](https://github.com/dcarbone/php-consul-api-bundle/pulls)Apache-2.0PHPPHP &gt;=5.6.0

Since Jul 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/dcarbone/php-consul-api-bundle)[ Packagist](https://packagist.org/packages/dcarbone/php-consul-api-bundle)[ RSS](/packages/dcarbone-php-consul-api-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (5)Versions (15)Used By (0)

php-consul-api-bundle
=====================

[](#php-consul-api-bundle)

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

Installation
------------

[](#installation)

In your `composer.json` file:

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

In your `AppKernel.php` file:

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

        // --

        return $bundles;
    }
```

Local Configuration
-------------------

[](#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
---------------------

[](#default-configuration)

You may optionally override the default configuration with one of the named configurations you have specified as such:

```
consul_api:
    default_configuration: nifty_name
```

Named Configurations
--------------------

[](#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:

```
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.

Twig Integration
----------------

[](#twig-integration)

If you are using [Twig](http://twig.sensiolabs.org/) and [TwigBundle](https://packagist.org/packages/symfony/twig-bundle) in your Symfony app, there are a few functions exposed to you. You can see the full list here: [PHPConsulAPIExtension](./src/Twig/PHPConsulAPITwigExtension.php#L71).

ConsulBag
---------

[](#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](./src/Bag/ConsulBag.php) service. It is defined as `consul_api.bag`

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~61 days

Recently: every ~194 days

Total

14

Last Release

2822d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/385c0c0eae1b51f1e81ee464ff6bfb3cce32589ac252ca68cc3a8aec2e3ada14?d=identicon)[dcarbone](/maintainers/dcarbone)

---

Top Contributors

[![dcarbone](https://avatars.githubusercontent.com/u/1392439?v=4)](https://github.com/dcarbone "dcarbone (36 commits)")

### Embed Badge

![Health badge](/badges/dcarbone-php-consul-api-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/dcarbone-php-consul-api-bundle/health.svg)](https://phpackages.com/packages/dcarbone-php-consul-api-bundle)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k48](/packages/friendsoftypo3-content-blocks)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M552](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k59](/packages/open-dxp-opendxp)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

16126.1k1](/packages/symfony-ux-toolkit)[altis/local-server

Local Server module for Altis

18221.6k3](/packages/altis-local-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
