PHPackages                             phalette/pidic - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. phalette/pidic

AbandonedArchivedLibrary[PSR &amp; Standards](/categories/psr-standards)

phalette/pidic
==============

Nette Dependency Injection/Container for Phalcon

0.1(10y ago)356.9kBSD-3-ClausePHPPHP &gt;= 5.5.0

Since Sep 27Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/contributte/pidic)[ Packagist](https://packagist.org/packages/phalette/pidic)[ Docs](https://github.com/phalette/pidic)[ Fund](https://contributte.org/partners.html)[ GitHub Sponsors](https://github.com/f3l1x)[ RSS](/packages/phalette-pidic/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

[![](https://camo.githubusercontent.com/ef64f3008ea29f35aa132c58c8a7d94c48f66ac7da4ea217ffc1aeb00338e9ad/68747470733a2f2f686561746261646765722e76657263656c2e6170702f6769746875622f726561646d652f636f6e74726962757474652f70696469632f3f646570726563617465643d31)](https://camo.githubusercontent.com/ef64f3008ea29f35aa132c58c8a7d94c48f66ac7da4ea217ffc1aeb00338e9ad/68747470733a2f2f686561746261646765722e76657263656c2e6170702f6769746875622f726561646d652f636f6e74726962757474652f70696469632f3f646570726563617465643d31)

 [![](https://camo.githubusercontent.com/a8b1cd856d7d396fdebbe46947cc3507490acc267a02361e5e53bb7b820c95c3/68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f6769747465722f6379616e)](https://bit.ly/ctteg) [![](https://camo.githubusercontent.com/86d6416fc04f8bcc3daa7bf881526b9953b9726b1164d05c157c8713e3a73418/68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f666f72756d2f79656c6c6f77)](https://bit.ly/cttfo) [![](https://camo.githubusercontent.com/5d170ab94e6d594609561e16fe0f9e4293968fbd4dfcfafc5e11efc1415ef09c/68747470733a2f2f62616467656e2e6e65742f62616467652f73706f6e736f722f646f6e6174696f6e732f463936383534)](https://contributte.org/partners.html)

 Website 🚀 [contributte.org](https://contributte.org) | Contact 👨🏻‍💻 [f3l1x.io](https://f3l1x.io) | Twitter 🐦 [@contributte](https://twitter.com/contributte)

Disclaimer
----------

[](#disclaimer)

⚠️This project is no longer being maintained.Composer[`phalette/pidic`](https://packagist.org/packages/phalette/pidic)Version[![](https://camo.githubusercontent.com/3cb0191027c5c7eac105dacb45503534b4fddffca01b44fc2fe773c7bbd6dabe/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f7068616c657474652f7069646963)](https://camo.githubusercontent.com/3cb0191027c5c7eac105dacb45503534b4fddffca01b44fc2fe773c7bbd6dabe/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f7068616c657474652f7069646963)PHP[![](https://camo.githubusercontent.com/e79fe0c3660d5af6e08861ff552b68c03741d54036785f80669373b267480e0b/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f7068616c657474652f7069646963)](https://camo.githubusercontent.com/e79fe0c3660d5af6e08861ff552b68c03741d54036785f80669373b267480e0b/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f7068616c657474652f7069646963)License[![](https://camo.githubusercontent.com/5e3f28a3ce0c8b52b111530589e9f269e84af48a8ba0b1880b1b196af5e76cfa/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f636f6e74726962757474652f7069646963)](https://camo.githubusercontent.com/5e3f28a3ce0c8b52b111530589e9f269e84af48a8ba0b1880b1b196af5e76cfa/68747470733a2f2f62616467656e2e6e65742f6769746875622f6c6963656e73652f636f6e74726962757474652f7069646963)About
-----

[](#about)

PiDiC is an adapter over [Nette\\Di\\Container](https://api.nette.org/2.3/Nette.DI.Container.html).

Install
-------

[](#install)

```
$ composer require phalette/pidic:dev-master
```

### Dependencies

[](#dependencies)

- **PHP &gt;= 5.5.0**
- [Nette\\Di &gt;= 2.3.0](https://github.com/nette/di)
- [Phalcon &gt;= 2.0.0](https://github.com/phalcon/cphalcon/)

Configuration
-------------

[](#configuration)

```
use Nette\DI\Compiler;
use Phalette\Pidic\Configurator;
use Phalette\Pidic\Environment;
use Phalette\Pidic\Extensions\PhalconDefaultsExtension;
use Phalette\Pidic\Extensions\PhalconExtension;
use Phalette\Pidic\PiDi;

$configurator = new Configurator();
$configurator->setMode(Environment::DEVELOPMENT);
$configurator->setCacheDir(__DIR__ . '/cache');
$configurator->onCompile[] = function (Compiler $compiler) {
    $compiler->addExtension('phalcon', new PhalconExtension());
    $compiler->addExtension('phalconDefaults', new PhalconDefaultsExtension());
};

$container = $configurator->createContainer();
$pidi = $container->getService('pidi');
```

### Learn by working example

[](#learn-by-working-example)

This is based on [official tutorial](https://docs.phalconphp.com/en/latest/reference/tutorial.html).

```
use Nette\DI\Compiler;
use Phalette\Pidic\Configurator;
use Phalette\Pidic\Environment;
use Phalette\Pidic\Extensions\PhalconDefaultsExtension;
use Phalette\Pidic\Extensions\PhalconExtension;
use Phalette\Pidic\PiDi;

use Phalcon\Loader;
use Phalcon\Mvc\View;
use Phalcon\Mvc\Application;
use Phalcon\DI\FactoryDefault;
use Phalcon\Mvc\Url as UrlProvider;
use Phalcon\Db\Adapter\Pdo\Mysql as DbAdapter;

try {

    // Register an autoloader
    $loader = new Loader();
    $loader->registerDirs(array(
        '../app/controllers/',
        '../app/models/'
    ))->register();

    // Create a DI
    $configurator = new Configurator();
    $configurator->setMode(Environment::DEVELOPMENT);
    $configurator->setCacheDir(__DIR__ . '/cache');
    $configurator->onCompile[] = function (Compiler $compiler) {
        $compiler->addExtension('phalcon', new PhalconExtension());
        $compiler->addExtension('phalconDefaults', new PhalconDefaultsExtension());
    };
    $container = $configurator->createContainer();
    $di = $container->getService('pidi');

    // Setup the view component
    $di->set('view', function () {
        $view = new View();
        $view->setViewsDir('../app/views/');
        return $view;
    });

    // Setup a base URI so that all generated URIs include the "tutorial" folder
    $di->set('url', function () {
        $url = new UrlProvider();
        $url->setBaseUri('/tutorial/');
        return $url;
    });

    // Handle the request
    $application = new Application($di);

    echo $application->handle()->getContent();

} catch (\Exception $e) {
     echo "PhalconException: ", $e->getMessage();
}
```

### PhalconExtension

[](#phalconextension)

It sets self-instance over static `Phalcon\Di::setDefault()`. Every object extending from `Phalcon\Di\InjectionAwareInterface` can access **PiDiC** from `$this->getDI()`.

### PhalconDefaultsExtension

[](#phalcondefaultsextension)

This extension replace `Phalcon\DI\FactoryDefault`. It register to the container 22 base services ([more in docs](https://docs.phalconphp.com/en/latest/reference/di.html#service-name-conventions)).

Phalcon\\Di
-----------

[](#phalcondi)

**PiDiC** implements [Phalcon\\DiInterface](https://docs.phalconphp.com/en/latest/api/Phalcon_DI.html) and then you can change DI without any changes.

How to work with DI in Phalcon, you can [read here](https://docs.phalconphp.com/en/latest/reference/di.html).

Nette\\DI
---------

[](#nettedi)

Please read articles at Nette documentation:

- [Configuration](https://doc.nette.org/en/2.3/configuring)
- [Dependency Injection](https://doc.nette.org/en/2.3/dependency-injection)
- [Di usage](https://doc.nette.org/en/2.3/di-usage)

But the main article is:

- [Extensions](https://doc.nette.org/en/2.3/di-extensions)

Development
-----------

[](#development)

This package was maintained by these authors.

[ ![](https://avatars2.githubusercontent.com/u/538058?v=3&s=80)](https://github.com/f3l1x)---

Consider to [support](https://contributte.org/partners.html) **contributte** development team. Also thank you for using this package.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance49

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3886d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/538058?v=4)[Milan Šulc](/maintainers/f3l1x)[@f3l1x](https://github.com/f3l1x)

---

Top Contributors

[![f3l1x](https://avatars.githubusercontent.com/u/538058?v=4)](https://github.com/f3l1x "f3l1x (7 commits)")

---

Tags

dependency-injectionphalconcontainernettedependencyinjectionphalcon

### Embed Badge

![Health badge](/badges/phalette-pidic/health.svg)

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

###  Alternatives

[league/container

A fast and intuitive dependency injection container.

86787.8M343](/packages/league-container)[capsule/di

A PSR-11 compliant autowiring dependency injection container.

2857.5k2](/packages/capsule-di)[miladrahimi/phpcontainer

Dependency injection (IoC) container for PHP projects

1322.7k2](/packages/miladrahimi-phpcontainer)

PHPackages © 2026

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