PHPackages                             clearbooks/dilex - 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. [Framework](/categories/framework)
4. /
5. clearbooks/dilex

ActiveLibrary[Framework](/categories/framework)

clearbooks/dilex
================

Symfony with enhanced DI and a Silex-like interface

2.0.0(6y ago)33.0k11LGPL-3.0PHPPHP &gt;=7.2CI passing

Since Sep 17Pushed 6mo ago20 watchersCompare

[ Source](https://github.com/clearbooks/dilex)[ Packagist](https://packagist.org/packages/clearbooks/dilex)[ RSS](/packages/clearbooks-dilex/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (12)Used By (1)

Dilex
=====

[](#dilex)

Rationale
---------

[](#rationale)

Dilex is an extension of Symfony to provide custom ContainerInterop compatibility and a Silex-like interface. You can specify a custom fallback container, which will be used when an entry cannot be resolved by Symfony's container.

Usage
-----

[](#usage)

```
$environment = 'dev';
$debug = true;
$container = new DependencyInjectionContainer(); // replace with your real DI initialisation code
$application = new \Clearbooks\Dilex\Dilex( $environment, $debug, $container );
```

Once the application has been instantiated you can create `Endpoint` classes to be executed for a given API route. Here's a simple example.

```
namespace Your\Organisation\Endpoint;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Clearbooks\Dilex\Endpoint;

class ExampleEndpoint implements Endpoint
{
    public function execute( Request $request )
    {
        return new JsonResponse( ['hello' => 'world'] );
    }
}
```

While the above example has no constructor the main benefit of Dilex is that the endpoint will be instantiated through your DI container of choice, so you can inject dependencies into the constructor of the Endpoint per your DI container documentation.

You can then associate your `Endpoint` implementation with an API route using Dilex's `get` method.

```
use Your\Organisation\Endpoint\ExampleEndpoint;
/*
 * Initialisation code above skipped
 */
$application->get( '/', ExampleEndpoint::class );
```

Credits
-------

[](#credits)

[![stamp_small](https://cloud.githubusercontent.com/assets/980959/9278343/27074a4c-42a8-11e5-8262-89c1d6f2217e.png)](https://cloud.githubusercontent.com/assets/980959/9278343/27074a4c-42a8-11e5-8262-89c1d6f2217e.png)

Disclaimer
----------

[](#disclaimer)

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance47

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~411 days

Recently: every ~867 days

Total

10

Last Release

190d ago

Major Versions

1.0.4 → 2.0.02019-11-08

2.0.0 → 3.0.0-alpha.12020-10-28

3.1.0-alpha → 4.0.0-alpha2025-11-10

PHP version history (2 changes)2.0.0PHP &gt;=7.2

4.0.0-alphaPHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a99fa755e3e4428d6b6608189c6b2835541ed3dc57d4e2f8c7dbfaef6cfb6b2?d=identicon)[clearbooks-ci](/maintainers/clearbooks-ci)

![](https://www.gravatar.com/avatar/12b988861b78ed642fd1f9ab024882af749975adcaecae579669975643ab760f?d=identicon)[craigjbass](/maintainers/craigjbass)

---

Top Contributors

[![peter-horvath](https://avatars.githubusercontent.com/u/3007129?v=4)](https://github.com/peter-horvath "peter-horvath (28 commits)")[![patrick-clearbooks](https://avatars.githubusercontent.com/u/980974?v=4)](https://github.com/patrick-clearbooks "patrick-clearbooks (25 commits)")[![Clearbooks-Tom](https://avatars.githubusercontent.com/u/980959?v=4)](https://github.com/Clearbooks-Tom "Clearbooks-Tom (7 commits)")[![zuzsso](https://avatars.githubusercontent.com/u/1922280?v=4)](https://github.com/zuzsso "zuzsso (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/clearbooks-dilex/health.svg)

```
[![Health](https://phpackages.com/badges/clearbooks-dilex/health.svg)](https://phpackages.com/packages/clearbooks-dilex)
```

###  Alternatives

[flint/flint

Enhanced Silex

12167.5k](/packages/flint-flint)[ddesrosiers/silex-annotation-provider

A silex service provider that allows the use of annotations in ServiceControllers.

25246.7k3](/packages/ddesrosiers-silex-annotation-provider)[tobiassjosten/responsible-service-provider

A Silex ServiceProvider for automagic response formatting.

3490.8k](/packages/tobiassjosten-responsible-service-provider)[php-di/silex-bridge

PHP-DI integration in Silex

2465.4k1](/packages/php-di-silex-bridge)[propel/propel-service-provider

Propel integrationfor Silex.

2625.2k3](/packages/propel-propel-service-provider)[stikmanw/silex-newrelic

Integrate the NewRelic PHP API into Silex framework

2014.7k](/packages/stikmanw-silex-newrelic)

PHPackages © 2026

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