2017 © Pedro Peláez
 

library config

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

image

byjg/config

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  • Sunday, March 11, 2018
  • by byjg
  • Repository
  • 1 Watchers
  • 2 Stars
  • 574 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 13 % Grown

The README.md

Config: PSR-11 Container and Dependency Injection

Build Status Opensource ByJG GitHub source GitHub license GitHub release Scrutinizer Code Quality, (*1)

This is a basic and minimalist implementation of PSR-11 for config management and dependency injection., (*2)

Basics

PSR-11, or "PHP Standard Recommendation 11," is a PHP specification that outlines a common interface for implementing dependency injection containers in PHP applications. Dependency injection is a design pattern that allows objects to receive their dependencies from an external source, instead of creating them internally., (*3)

Here's a summary of PSR-11:, (*4)

  • Purpose: PSR-11 provides a standardized approach to implementing and using dependency injection containers in PHP applications., (*5)

  • Container Interface: PSR-11 defines the Psr\Container\ContainerInterface, which includes methods for retrieving instances of objects (dependencies) from the container., (*6)

  • Container Operations: The interface includes methods such as get($id) to retrieve an instance by its identifier (usually a string), has($id) to check if an instance exists in the container, and set($id, $value) to manually register an instance with the container., (*7)

  • Implementing Containers: Developers can create their own containers by implementing the ContainerInterface and providing the necessary methods for managing and retrieving instances., (*8)

  • Interoperability: PSR-11 promotes interoperability between different PHP frameworks and libraries by providing a common interface. Applications built using PSR-11 containers can switch between different containers without needing to modify the application code., (*9)

  • Autowiring: While PSR-11 does not explicitly define autowiring (automatic resolution of dependencies), containers implementing this specification can choose to include autowiring functionality if desired., (*10)

  • Extension: PSR-11 can be extended by other PSR specifications to provide additional features or standards related to dependency injection., (*11)

In summary, PSR-11 standardizes the way dependency injection containers are implemented and used in PHP, promoting code reusability, flexibility, and interoperability between different components of PHP applications., (*12)

How to Use This Component

Follow the steps below:, (*13)

Installation

composer require "byjg/config"

Tests

./vendor/bin/phpunit

Dependencies

flowchart TD
    byjg/config --> byjg/cache-engine

Open source ByJG, (*14)

The Versions

11/03 2018

dev-master

9999999-dev

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  Sources   Download

MIT

The Requires

 

The Development Requires

11/03 2018

3.0.2

3.0.2.0

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  Sources   Download

MIT

The Requires

 

The Development Requires

09/03 2018

3.0.1

3.0.1.0

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  Sources   Download

MIT

The Requires

 

The Development Requires

23/02 2018

3.0.0

3.0.0.0

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  Sources   Download

MIT

The Requires

 

The Development Requires

23/02 2018

3.0.x-dev

3.0.9999999.9999999-dev

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  Sources   Download

MIT

The Requires

 

The Development Requires

22/11 2017

2.0.1

2.0.1.0

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  Sources   Download

MIT

The Requires

 

The Development Requires

22/11 2017

2.0.1.x-dev

2.0.1.9999999-dev

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  Sources   Download

MIT

The Requires

 

The Development Requires

10/08 2017

2.0.0

2.0.0.0

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  Sources   Download

MIT

The Requires

 

The Development Requires

27/05 2017

2.0.x-dev

2.0.9999999.9999999-dev

A very basic and minimalist PSR-11 implementation for config management and dependency injection.

  Sources   Download

MIT

The Requires

 

The Development Requires

28/03 2017

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

  • php >=5.6

 

19/03 2017

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

  • php >=5.6

 

19/03 2017

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6