Download the PHP package codeburner/container without Composer

On this page you can find all versions of the php package codeburner/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

Codeburner Container

Build Status Code Coverage Quality Score

SensioLabsInsight

The faster IoC container package for you build blazing fast applications for the web.

Thanks to Tom Butler for motivate me with this announce of dice, a fast dependency injection container.

Instalation

Add codeburner/container to your composer.json file, and update or install composer dependencies.

or via CLI:

Usage

Introduction

Welcome to the Codeburner blazing fast container docs! Before starting the usage is recommended understand the main goal and mission of all parts of this package.

Performance

Codeburner project create packages with performance in focus, and the benchmarks are comming!

Concepts

The container is responsable to automatilly instantiate new objects, resolving all class dependencies and storing these objects over aliases. This enable a greater flexibility removing hard-coded class dependencies, and instead, making the dependencies be dinacally injected at run-time.

Usage

After you have the classes ready to be instantiate, you only need to register the bindings and call then.

Examples

Usage examples are comming soon.

Bindings

Bindings are the objects stored in the container. The container implements the PSR-11 providing the get($id) and has($id) methods to access the bindings, and define the set($id, $concrete) to store objects.

Binding Types

Resolvable Bindings

Resolvable bindings will return a new instance in every access.

Resolved Bindings

Resolved bindings are no more than singletons, every access will return the same instance.

Binding Ways

Strings

The simplest way to define a binding, you only need to give a class name as string.

Closures

Some times you need to set some attributes or make some initial logic on objects, you can do it with a closure binding.

Instances

If you need to attach an existent instance, you should use the set or instance method.

Resolving Bindings

The great goal of the container is to automatically inject all class dependencies, if you only need to create an instance of a class without binding then into container use the make method.

Setting Dependencies Manually

Sometimes you want to define that some class will receive a specific object of another class on instantiation.

make($abstract, $parameters = [], $force = false) accepts a second parameter to defined resolved dependencies, and a third to ensure that a new object will be created.

Executing Closures

If you have a closure with dependencies you can use the call($closure, $parameters = []) method to resolve then.

And as well as make, you can pass an array of resolved dependencies.

Extending Bindings

Some times you need to modify a binding, to do that use the extend method. They receive the old binding object and a container reference.

Exceptions

The Codeburner Container implements PSR-11 providing two types of exceptions, the Psr\Container\Exception\NotFoundException and Psr\Container\Exception\ContainerException.

API


All versions of container with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
psr/container Version 1.0.x-dev
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 codeburner/container contains the following files

Loading the files please wait ....