Download the PHP package burriko/cake-container without Composer

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

CakePHP Container

An easy way to add a good dependency injection container to Cakephp 2 applications.

This installs League's Container, injects it into controllers, and adds it into CakeRegistry so you can access it as a singleton from anywhere else you may need it.

Why?

I support a number of legacy CakePHP applications, and the lack of a container or a nice way to do DI was annoying.

Installation

Install with composer.

Load the plugin in Config/bootstrap.php. Bootstrap needs to be set to true.

Usage

Create a file at Config/container.php to contain your container config. In here you can specify anything from the League Container docs. For example, to load a service provider your config file would contain something like:

Check the League Container docs for more useful examples.

Change AppController so that it implements League\Container\ContainerAwareInterface and uses the League\Container\ContainerAwareTrait trait.

Usage within Controllers

You can access the container from within a controller by calling $this->getContainer(). So to get an instance of a class named DocumentManagement that was set up by your service provider you could do this in your controller.

Usage within Shells

You can access the container in a shell the same way you'd use it in a controller by extending ContainerAwareShell. The easiest way to do this is to change AppShell to extend ContainerAwareShell.

Usage from other places

If you really need to use the container outside of a controller you can get an instance of it from the ClassRegistry.


All versions of cake-container with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
composer/installers Version *
league/container Version 1.*
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 burriko/cake-container contains the following files

Loading the files please wait ....