Download the PHP package aeris/zf-di-config without Composer

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

ZfDiConfig

Configurable dependency injection for the ZF2 ServiceManager.

Installation

You can install ZfDiConfig using composer:

Then add the module to your application config:

Basic Usage

ZfDiConfig allows you to configure services, instead of using service factories. For example:

In this example, we:

Compare this to a typical ZF2 approach for creating services:

This approach works, but it can become very verbose, and it makes it difficult to see at a glance how your services are wired together.

ZfDiConfig takes a different approach, by allowing you to configure how your services are wired together:

Plugins

ZfDiConfig uses plugins to resolve configured references. A few plugins are provided to cover basic usage, though you can easily add your own plugins, too.

Most plugins allow either a short or long form of configuration. For example, the ServiceResolverPlugin can be referenced as $service or using the @ prefix:

Default Plugin

By default, ZfDiConfig uses the $factory plugin for configuring services, so that:

...is the same as...

If you do not want to define your service using the $factory plugin, there are a couple of options. For one, you can just use a different plugin, and DiConfig will be smart enough to figure it out.

You can also override the global default plugin, in the zf_di_config module config:

FactoryPlugin

This is the default plugin used when configuring a service. It allows you to create configured objects instances. You have already seen how this plugin is used in the basic usage examples.

One cool thing is that you can actually use this plugin 'inline' from within other plugin configuration. Let me demonstrate:

Configuration Reference

The FactoryPlugin can accept the following configurations:

Short Form:
Really Short Form:
Long Form:

ServiceResolverPlugin

The service resolver plugin resolves references to existing services.

Configuration Reference
Short Form:
Long Form:

ConfigParamPlugin

The ConfigParamPlugin allows you to access raw values from you application config.

Configuration Reference

Short Form
Long Form

ServiceManagerPlugin

The ServiceManagerPlugin allows you to create a service manager plugin on the fly. The created service manager may be configured with ZfDiConfig, just like your top level service manager.

Configuration reference

Extending ZfDiConfig

You can extend ZfDiConfig using custom plugins. Plugins must implement \Aeris\ZfDiConfig\ServiceManager\ConfigPlugin\ConfigPluginInterface, and be registered in your module config.

Example

Let's say you want to create a plugin to resolve Doctrine EntityRepository objects. We want to be able to use it like so:

First we implement the plugin logic:

Now we just need to register the plugin

And you're ready to go!


All versions of zf-di-config with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
zendframework/zendframework Version 2.3.*
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 aeris/zf-di-config contains the following files

Loading the files please wait ....