Download the PHP package mikemix/mxdi-module without Composer

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

mxdiModule

Build Status Build Status Scrutinizer Code Quality Code Coverage Dependency Status Latest Stable Version Total Downloads License

Configure dependency injection in Zend Framework 2 using annotations/yaml/xml.

Idea based on the JMSDiExtraBundle for the Symfony2 project.

  1. Installation
  2. Changing mapping driver
  3. Important notes
  4. Caching
  5. Debugging
  6. Console commands

Installation

  1. Install with Composer: composer require mikemix/mxdi-module:~3.0 (rules of semantic versioning apply).

  2. Enable the module via ZF2 config in appliation.config.php under modules key:

    This will enable the module and register the Abstract Factory in the ZF2's Service Manager.

  3. Copy the global config file cp vendor/mikemix/mxdi-module/resources/mxdimodule.global.php.dist config/autoload/mxdimodule.global.php if you want to override the default mapping driver.

  4. Copy the local config file cp vendor/mikemix/mxdi-module/resources/mxdimodule.local.php.dist config/autoload/mxdimodule.local.php if you want to override other settings, like caching etc.

Changing mapping driver

The default mapping driver is AnnotationExtractor as source of mapping information for the module. You can change it however to other. Available extractors are:

There's no difference between choosing annotation driver or YAML or XML driver, because the mapping information in the end is converted to plain php and stored inside the cache.

Important notes

Remember, the requested service must not be registered in the Service Manager. If you register it as factory or invokable, it won't go through the Abstract Factory and won't get injected. By the way, this allows you to create custom factory for the service in mention.

To speed up locate time you can request the service through the DiFactory invokable, for example:

Caching

Parsing mapping sources is very heavy. You should enable the cache on production servers.

You can set up caching easily with any custom or pre-existing ZF2 cache adapter. In the config/autoload/mxdimodule.local.php override the cache_adapter and cache_options keys for your needs. You can find more information about available out-of-the-box adapters at the ZF2 docs site.

Debugging

If you get ServiceNotCreated exception most probably one of your injections is not registered in the ZF2's Service Manager. In the exception stack you will see some more detailed information. For instance look for CannotGetValue exceptions.

Console commands


All versions of mxdi-module with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
doctrine/annotations Version ~1.2.4
symfony/yaml Version ~2.7.1
zendframework/zend-servicemanager Version ~2.5
zendframework/zend-modulemanager Version ~2.5
zendframework/zend-mvc Version ~2.5
zendframework/zend-cache Version ~2.5
zendframework/zend-console Version ~2.5
ocramius/proxy-manager Version ~1.0.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 mikemix/mxdi-module contains the following files

Loading the files please wait ....