Download the PHP package ronanchilvers/container without Composer

On this page you can find all versions of the php package ronanchilvers/container. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package container

container

Build Status codecov

A simple, small PSR-11 compliant container for PHP 7+. It has the following features:

Installation

The easiest way to install is via composer:

Usage

Basic usage is simple:

By default services added to the container are factory services - you'll get a new one every time. If you want to define a shared service you can do:

You can also register primitives with the container:

Aliases

Sometimes its useful to be able to alias a service. For example if you want to register a service with a simple string name but also refer to it by an interface name. To do this you can use a Symfony style prefix on the definition to indicate that its a reference to another service.

Here's an example:

Extending services

The container allows services to be extended (just like Pimple) using the extend() method. You can extend both factory and shared services. Call extend() with the service id and a callable. The callable will recieve the service instance as its first argument and the container as the second. You can extend a service as many times as you like.

Autowiring

The container supports basic autowiring. This means that you can supply a fully qualified class name as a service definition and the container will attempt to instantiate it for you.

Constructor injection is also supported for type hinted parameters.

The injected objects do not have to be registered with the container to be injected. If the container encounters a dependency that is not defined as a service it will attempt to create a new instance with no constructor parameters.

Service Providers

The container supports pimple style service providers. Your provider must implement .

Testing

The container is quite simple and has 100% test coverage. You can run the tests by doing:

The default phpunit.xml.dist file creates coverage information in a build/coverage subdirectory.

Contributing

If anyone has any patches they want to contribute I'd be more than happy to review them. Please raise a PR. You should:

License

This software is licensed under the MIT license. Please see the License File for more information.


All versions of container with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
psr/container Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ronanchilvers/container contains the following files

Loading the files please wait ....