Download the PHP package terrydjony/ion without Composer

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

ION Container

A minimalist inversion of control container using automatic dependency injection

Installation

To install ION Container, you need to add it to your composer.json file

Or, by using terminal

Usage

First, you need to instantiate the container

Instantiating Object

To instantiate any objects, you should use make($class, array $args = array()), instead of new keyword

Notice that the parameter two $args is optional For example, if you want to instantiate stdClass class.

Registering Service

You can register the way to instantiate some class via register($key, $closure) Here is an example of registering PDO class with some defined arguments

The above example will register PDO service. So, if you instantiate it via $ion->make('PDO'), you don't need to supply any arguments since all the arguments have been defined before.

However, it will be nice to have a database config.

Notice that if you register a service, it'll be a shared instance. If you want to register a factory, use registerFactory

Registering Factory Services

You can register a factory using registerFactory($key, $closure)

Registering Parameters

You can also register parameters using setParam($param, $value) and get the value via param($param_name)

Forcing New Instance

You can force a new instance using makeNew($key, $args=array()).

Defining Default Class For Interface

You can bind an interface to a class. So, if a class depends on that interface, that class will represent that interface

If the class must be instantiated with some arguments, you should register it first. Then, you give the key as the parameter two of bindInterface

But, if the class can be instantiated with no arguments, you can just specify the class name.

Automatic Dependency Injection

Suppose you want to instantiate a class A that needs class B which needs class C

I mean something like

And, to make a class A instance, you just need to:

And, voila! You get the class A instance!

If you have a dependency that needs some parameters, you can register the dependency first before making object that needs that dependency

And, if the class needs some arguments, you can supply an array of arguments as parameter two of make or makeNew method.

The class A instance is made automatically.


All versions of ion 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 terrydjony/ion contains the following files

Loading the files please wait ....