Download the PHP package gres/dim without Composer

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

Dim – PHP Dependency Injection Manager

Build Status Coverage Status Latest Version License

Dim is a small, simple and powerful Dependency Injection Container for PHP:

Dim works with PHP 5.3 or later.

Installation

You may install the Dim with Composer.

  1. Create a composer.json file in your project root and run the php composer.phar install command to install it:

  2. Add this line to your application’s index.php file:

  3. Instantiate the Container class:

Alternatively, you can download the archive and extract it.

Defining parameters

For objects you can omit the definition of names, in this case for names will be used class name of object, names of extended classes and interfaces and names of used traits.

Defining services

In first case for names will be used class name, names of extended classes and interfaces and names of used traits.

You can define arguments that will be passed to constructor of service class:

Keys should be identical to parameter names or their positions in constructor definition.

Defining aliases

If you need to add an additional name for defined parameter or service you can use alias method:

Retrieving data

Also you can pass additional arguments to constructor of service class, they overwrite arguments with same keys passed to Service constructor:

Scopes

If you wish to limit the scope for dependencies you can use scopes:

Also you can group actions in scope:

Kinds of services

Service

Class: Dim\Service

Creates and returns new instance of class:

$foo1 and $foo2 are different instances.

Singleton

Class: Dim\Service\Singleton

Once creates an instance of class and always returns the same instance for all calls:

$foo1 and $foo2 are the same.

Factory

Class: Dim\Service\Factory

Returns new instance of class created by function or factory method:

Extension

Class: Dim\Service\Extension

Extends creation of instance by other service:

Other actions

Get raw data from container:

Method: Dim\Container::raw

$foo will contains an instance of Service class.

Check that parameter or service is defined:

Methods:

$foo will contains true, $bar will contains false

Remove parameter or service from container:

Methods:

Remove all parameters and services from container:

Method: Dim\Container::clear

Tests

To run the test suite, you need PHPUnit:

License

Dim is licensed under the MIT license.


All versions of dim with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 gres/dim contains the following files

Loading the files please wait ....