Download the PHP package mmdm/sim-container without Composer

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

Simplicity Container

A library for dependency injection management.

Features

Install

composer

Or you can simply download zip file from github and extract it, then put file to your project library and use it like other libraries.

Just add line below to autoload files:

and you are good to go.

How to use

Available functions

Container

set($abstract, $concrete = null, ?string $method_name = null, array $method_parameters = []): Container

This method store a $concrete with alias of $abstract like class name or any other name.

Version >= 1.2.0: Also you can pass the method to be inject as $method_name and parameters of the method as $method_parameters. Parameters can be the actual parameter or an abstract to get by container.

Note: You can pass $concrete as $abstract

Note: Parameters are a key value pair like below:


get($abstract, ?string $method_name = null, array $method_parameters = [])

This method return a $concrete that stored with alias of $abstract. If it was not exists, it will simply store it first and then resolve that.

Version >= 1.2.0: Also you can pass the method to be inject as $method_name and parameters of the method as $method_parameters. Parameters can be the actual parameter or an abstract to get by container.

Note: If a stored $concrete has been resolved, it will not resolve again, just return previous resolved $concrete.

Note: Parameters are a key value pair like below:


make($abstract, ?string $method_name = null, array $method_parameters = [])

This method return a $concrete that stored with alias of $abstract. If it was not exists, it will simply store it first and then resolve that.

Parameters are same as get method

has($abstract, string $method_name = null): bool

This method check if a specific alias $abstract is stored or not. Also you can pass the $method_name to check if specific $abstract's method is registered.

unset($abstract, string $method_name = null): Container

This method remove a stored $abstract. Also you can pass the $method_name to remove specific $abstract's method.

Singleton accessing

If you need to access container in singleton manner, use getInstance static method.

Container Inheritance

If you want to inherit Container (to customize maybe), you can inherit like normal way but if you have multiple class to inherit, then use ContainerTrait inside your class and inherit other class as well.

Note: After a trait using, you should type hint Container to YourOtherClass in closures.

Array accessing

You can use array accessing instead of method accessing:

Accepts $offset as below:

OR

OR

OR


Accepts $offset as below:

OR

OR

OR


Accepts $offset as below:

OR

OR

OR


Accepts $offset as below:

OR

OR

OR

License

Under MIT license.


All versions of sim-container with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-json Version *
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 mmdm/sim-container contains the following files

Loading the files please wait ....