PHPackages                             krak/cargo - 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. krak/cargo

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

krak/cargo
==========

Small yet Powerful container library inspired by pimple

v0.2.4(9y ago)21.4k[5 issues](https://github.com/krakphp/cargo/issues)9MITPHP

Since Jan 30Pushed 8y ago1 watchersCompare

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

READMEChangelog (6)Dependencies (6)Versions (9)Used By (9)

Cargo
=====

[](#cargo)

Cargo is yet another container library. Its feature set and semantics closely follow [Pimple](http://pimple.sensiolabs.org); however, it's design is more modular so that it can be extended. It was designed to be compatible with Pimple; so you can easily use any Pimple service providers with Cargo.

Pimple is a great service container; however it suffers from one problem... extendability. Pimple was never designed to properly extended or decorated which makes it very hard to add features without modifying the core. Cargo is a container that manages to keep the simplicity of Pimple while allowing powerful extensions.

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

[](#installation)

Install with composer at `krak/cargo`

Usage
-----

[](#usage)

### Creating a Container

[](#creating-a-container)

There are several ways to create cargo containers. The easiest way is to just create the default container like so:

```
