Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 15, 2024 via composer

pimple/pimple v3.5.0

Pimple, a simple Dependency Injection Container
Package summary
Share
0
issues
1
license
2
MIT
Package created
29 Sep 2011
Version published
28 Oct 2021
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
pimple/pimple@v3.5.0
psr/container@2.0.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
ⓘ This is a list of pimple/pimple 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
psr/container2.0.23.55 kBMIT
prod

Visualizations

Frequently Asked Questions

What does pimple/pimple do?

Pimple is a light weight and simple Dependency Injection Container for PHP. Its main focus is to manage services and parameters for your PHP applications. Services are represented as global objects that have specific roles within a larger system, such as a database connection, templating engine, or a mailer, and are defined by anonymous functions returning an instance of the object. Parameters, on the other hand, help to customize the configuration of the container in relation to the portfolio and to store global values.

How do you use pimple/pimple?

To use Pimple in your PHP project, the first step is to add it to your composer.json file. This can be done using the following command:

$ ./composer.phar require pimple/pimple "^3.0"

This will install Pimple, providing you access to the Container class. You create a new Pimple container like so:

use Pimple\Container;

$container = new Container();

You can define a service as follows:

$container['session_storage'] = fn($c) => new SessionStorage('SESSION_ID');
$container['session'] = fn($c) => new Session($c['session_storage']);

To use a service, you can simply fetch it from the container:

$session = $container['session'];

Parameters are defined like so:

$container['cookie_name'] = 'SESSION_ID';
$container['session_storage_class'] = 'SessionStorage';

Pimple also provides the functionality to extend, modify or protect parameters and services as per your specific business requirements.

Where are the pimple/pimple docs?

Pimple’s documentation content can be found on the project’s Github page at https://github.com/silexphp/Pimple.git within the README file. This includes detailed examples and explanations of the core concepts involved in using Pimple, all aimed at helping to get you up and running with Pimple as quickly as possible.