Download the PHP package grithin/ioc-di without Composer

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

IoC DI

A small IoC Dependency Injector and Service Locator with experimental features, including a Data Locator.

Use

HEADER

For the code examples, use this header to run

Basic

Service Locator injection of "NameInterface" typed parameter into newly constructed "Creature"

Mixing Service Locator And Provided Parameters

Sometimes it is useful to allow the ServiceLocator to find one parameter, to but provide another parameter instead of using the ServiceLocator for it.

Defaults

If the DependencyInjector can't resolve a dependency, you can provide a fallback default for the parameter.

Because it may be undesirable to first instantiate a default prior to it being used, special classes are available to prevent pre-instantiation.

These special classes include

See the Special Types

Special Types

Using Grithin\IoC\SpecialTypeInterface

Service Object

Used by: SL, DI

Example of using Service for a default

Datum

Used by: SL, DI

Call

Used by: SL, DI, DL

Factory

Used by: SL, DI, DL

Whereas, with Call, a datum will be resolved by calling, with Factory, it will be resolved by calling every time the data is accessed from the DataLocator

Resolution Of Parameters

For some method definition, how does the injector resolve the injection values?

Parameter Name Based Resolution

As a shortcut for well-known frequently used expected parameters, injection can use the name alone so long as that name starts with a capital letter. And, in this case, both services and data are checked.

Static analysis and autocompletion within editors has made this usually a bad option.

ServiceLocator

Beyond The Basics

Singleton

For something like a Database, it is desirable that only one primary instance be created.

You can also just provide an existing singleton object to the ServiceLocator

Links

It may be useful to link one service id to another service

Special Types

It may be useful to resolve a service using a special type.

Here, a function is used to get a service

Using Service for special configuration

Data Locator

A service locator for data.

Notes

By default, SL does not check all classes to resolve an interface or abstract class, it only checks what is within the services (by id) or available without further file inclusion. You can make it check everything though:


All versions of ioc-di with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
psr/container Version ^2.0
grithin/phpbase Version ^5.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 grithin/ioc-di contains the following files

Loading the files please wait ....