2017 © Pedro Peláez
 

library zf-config-factories

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

image

reliv/zf-config-factories

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  • Thursday, June 14, 2018
  • by reliv
  • Repository
  • 7 Watchers
  • 4 Stars
  • 3,419 Installations
  • PHP
  • 25 Dependents
  • 1 Suggesters
  • 4 Forks
  • 0 Open issues
  • 30 Versions
  • 2 % Grown

The README.md

Build Status, (*1)

Zend Framework Config Factories

Factory classes are tedious. Factory closures have performance issues. Try this module to use factory config arrays instead. The config structure was modeled after Symfony 2 services.yml files. This package is a module for ZF2, ZF3, and Zend-Expressive., (*2)

// Example of constructor injection with the service name being the same as its class name:
'service_manager' => [
    'config_factories' => [
        'App\Email\EmailService' => [
            'arguments' => [
                'Name\Of\A\Service\I\Want\To\Inject',
                'Name\Of\A\AnotherService\I\Want\To\Inject'
            ],
        ]
    ]
]

Example usage with all options:, (*3)

// Use 'dependencies' instead of 'service_manager' here if using Zend Expressive
'service_manager' => [

    // This is a special config key that zf-config-factories reads.
    'config_factories' => [

        // This is the name of the service that we are defining.
        'EmailTemplateApi' => [

            /**
             * This is the service's class name.
             * Not required if the service's name is the same as its class name.
             */
            'class' => 'App\Controller\EmailTemplateApiController',

            /**
             * This is an array of service names that the class's constructor takes.
             * Not required if the service's constructor takes no arguments.
             * Not compatible with the 'factory' option (see below)
             */
            'arguments' => [
                'Name\Of\A\Service\I\Want\To\Inject',
                'Name\Of\A\Service\I\Want\To\Inject2',
                'Name\Of\A\Service\I\Want\To\Inject3',
                'Name\Of\A\Service\I\Want\To\Inject4',
                ['literal' => 'aLiteralValueNotAService'],
                ['from_config' => 'keyOfValueFromZfConfigIWantToReadAndInjectHere'],
                ['from_config' => ['path','to','a','deep','nested','zf','config','key']],
                'Name\Of\A\Service\I\Want\To\Inject5',
            ],

            /** 
             * This is an array of setters to call mapped to service names to inject into each setter.
             * Not required if your service has no setters.
             */ 
            'calls' => [
                ['setFunService', ['Name\Of\Another\Service\I\Want\To\Inject']],
                ['setAnotherFunService', ['Name\Of\Another\Service\I\Want\To\Inject']]
            ],

             /**
             * Zend-Expressive style factory which is an invokable class
             * 
             * Not required if your service has no factory.
             * Not compatible with the 'arguments' option (see above)
             */ 
            'factory' => 'FunModule\FactoryClassName',

            /** 
             * Symfony style factory that is a service itself.
             *
             * Not required if your service has no factory.
             * Not compatible with the 'arguments' option (see above)
             */ 
            'factory' => [
                ['FunModule\FactoryServiceName', 'createEmailTemplateApi']
            ]
        ]
    ],
]

The Versions

14/06 2018

dev-master

9999999-dev https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD BSD-3-Clause

The Requires

  • php >=5.6

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

14/06 2018

4.3.2

4.3.2.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

14/06 2018

4.3.1

4.3.1.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.6

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

13/06 2018

4.3.0

4.3.0.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

07/03 2018

4.2.2

4.2.2.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

12/07 2017

4.2.0

4.2.0.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

12/07 2017

4.2.1

4.2.1.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

23/03 2017

4.1.0

4.1.0.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

30/09 2016

4.0.4

4.0.4.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

30/09 2016

4.0.3

4.0.3.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

29/09 2016

4.0.2

4.0.2.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

26/09 2016

4.0.1

4.0.1.0 https://github.com/rodmcnew

Configurable DI for the ZF service manager. Modeled after Symfony 2's DI config files.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

26/09 2016

4.0.0

4.0.0.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

12/01 2016

3.0.0

3.0.0.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

07/11 2015

2.3.0

2.3.0.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

07/11 2015

2.2.0

2.2.0.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

04/11 2015

2.1.0

2.1.0.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.5

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

17/10 2015

2.0.2

2.0.2.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

17/10 2015

2.0.3

2.0.3.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

17/10 2015

2.0.4

2.0.4.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

17/10 2015

2.0.5

2.0.5.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

17/10 2015

2.0.1

2.0.1.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

17/10 2015

2.0.0

2.0.0.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in the ZF2 service manager. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

service framework container configuration config zf2 zend manager factories di injection closures dependancy

08/10 2015

1.0.7

1.0.7.0 https://github.com/rodmcnew

Wire up dependancies via config arrays in ZF2. Forget factory classes or closures.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

The Development Requires

service config zf2 manager factories injection dependancy

26/05 2015

1.0.6

1.0.6.0 https://github.com/rodmcnew

Inject dependencies into ZF2 services via configuration rather than factory classes.

  Sources   Download

BSD

The Requires

 

The Development Requires

service config zf2 manager factories

24/04 2015

1.0.5

1.0.5.0 https://github.com/rodmcnew

Inject dependencies into ZF2 services via configuration rather than factory classes.

  Sources   Download

BSD

The Requires

 

service config zf2 manager factories

24/04 2015

1.0.4

1.0.4.0 https://github.com/rodmcnew

Inject dependencies into ZF2 services via configuration rather than factory classes.

  Sources   Download

BSD

The Requires

  • php >=5.4

 

service config zf2 manager factories

24/04 2015

1.0.3

1.0.3.0 https://github.com/rodmcnew

Inject dependencies into ZF2 services via configuration rather than factory classes.

  Sources   Download

BSD

The Requires

  • php >=5.3.3

 

service config zf2 manager factories

24/04 2015

1.0.2

1.0.2.0 https://github.com/rodmcnew

Inject dependencies into ZF2 services via configuration rather than factory classes.

  Sources   Download

BSD

The Requires

  • php >=5.3.3

 

service config zf2 manager factories

27/03 2015

1.0.1

1.0.1.0 https://github.com/rodmcnew

Inject dependencies into ZF2 services via configuration rather than factory classes.

  Sources   Download

BSD

The Requires

  • php >=5.3.3

 

service config zf2 manager factories