2017 © Pedro Peláez
 

library service-locator

Service locator component.

image

widi/service-locator

Service locator component.

  • Friday, July 28, 2017
  • by widi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Widi\Components\ServiceLocator

The service locator component will help you encapsulating your classes., (*1)

Usage

You can simple create an instance of the service loator or create a wrapper to use it as a singleton., (*2)

Code Sample

<?php
require_once __DIR__ . '/../vendor/autoload.php';

use Widi\Components\ServiceLocator\ServiceLocator;

$services = [
    InvokableService::class => [
        'instance' => InvokableService::class,
    ],
    AnotherInvokableService::class => [
        'instance' => InvokableService::class,
        'options' => [
            'factory'   => false,
            'shared'    => false,
            'parameter' => [],
        ],
    ],
    FactoryService::class   => [
        'instance' => ServiceFactory::class,
        'options' => [
            'factory'   => true,
            'parameter' => [],
        ],
    ],
];

$serviceLocator = new ServiceLocator();
$serviceLocator->setArray($services);

Files

Test Test/bootstrap.php Test/phpunit.xml Test/ServiceLocator Test/ServiceLocator/Factory.php Test/ServiceLocator/FactoryParameter.php Test/ServiceLocator/Service.php Test/ServiceLocator/ServiceLocatorTest.php composer.json composer.lock readme.md sample sample/sample.php src src/Exception src/Exception/CreateServiceException.php src/Exception/ServiceArrayBadFormatException.php src/Exception/ServiceFactoryIsNotCallableException.php src/Exception/ServiceKeyAlreadyInUseException.php src/Exception/ServiceLocatorException.php src/Exception/ServiceNotFoundException.php src/Exception/WrongParameterException.php src/ServiceLocator.php src/ServiceLocatorInterface.php, (*3)

The Versions

28/07 2017

dev-master

9999999-dev

Service locator component.

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by Dirk Winkhaus

28/07 2017

3.0.2

3.0.2.0

Service locator component.

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by Dirk Winkhaus

14/05 2017

3.0.1

3.0.1.0

Service locator component.

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by Dirk Winkhaus

19/04 2017

3.0.0

3.0.0.0

Service locator component.

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

by Dirk Winkhaus

15/10 2016

2.1.1

2.1.1.0

Service locator component.

  Sources   Download

LGPL-3.0

The Requires

  • php ^5.6

 

The Development Requires

by Dirk Winkhaus

15/10 2016

2.1.0

2.1.0.0

Service locator component.

  Sources   Download

LGPL-3.0

The Requires

  • php ^5.6

 

The Development Requires

by Dirk Winkhaus

15/10 2016

2.0.0

2.0.0.0

Service locator component.

  Sources   Download

LGPL-3.0

The Requires

  • php ^5.6

 

The Development Requires

by Dirk Winkhaus

10/10 2016

1.0.4

1.0.4.0

Service locator component.

  Sources   Download

LGPL-3.0

The Requires

  • php ^5.6

 

The Development Requires

by Dirk Winkhaus

25/09 2016

1.0.3

1.0.3.0

Service locator component.

  Sources   Download

LGPL-3.0

The Development Requires

by Dirk Winkhaus

25/09 2016

1.0.2

1.0.2.0

Service locator component.

  Sources   Download

LGPL-3.0

The Development Requires

by Dirk Winkhaus

25/09 2016

1.0.1

1.0.1.0

Service locator component.

  Sources   Download

LGPL-3.0

The Development Requires

by Dirk Winkhaus