talira

laminas-servicemanager

A factory-driven dependency injection container for PHP from the Laminas Project

open sourceBSD-3-Clausefree

laminas-servicemanager is the Laminas Project's factory-driven dependency injection container for PHP: it implements the service locator pattern, building and returning objects from factories configured for each service. Version 4 supports versions 1.1 and 2 of PSR-11's container interface, and the component offers delegators, lazy services, plugin managers, abstract factories, reflection-based and configuration-based autowiring factories, and CLI commands that generate factories and ahead-of-time factory code. It's part of the same component family as laminas-diactoros.

Problems it solves

  • wire up dependencies in a PHP application with a container
  • build objects from factories instead of creating them by hand
  • use a PSR-11 container in a Laminas or Mezzio app

Features

  • factory-driven service container implementing PSR-11 (versions 1.1 and 2)
  • delegators and lazy services
  • plugin managers and abstract factories
  • reflection-based and configuration-based autowiring factories
  • CLI commands that generate factories and ahead-of-time factory code

Alternatives

The same job

These do what laminas-servicemanager does.

  1. PHP-DI The dependency injection container for humans
  2. Pimple Small dependency injection container for PHP

Compare laminas-servicemanager with the top 3