2017 © Pedro Peláez
 

library scabbia2-services

Scabbia2 Services Component

image

scabbiafw/scabbia2-services

Scabbia2 Services Component

  • Tuesday, September 22, 2015
  • by eserozvataf
  • Repository
  • 1 Watchers
  • 1 Stars
  • 114 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Scabbia2 Services Component

This component is a tiny dependency management container implementation allow you to share, produce and access instances/variables easily., (*1)

Build Status Scrutinizer Code Quality Total Downloads Latest Stable Version Latest Unstable Version Documentation Status, (*2)

Usage

Basic Key/Value Container

use Scabbia\Services;

$container = new Services();

$container['key'] = 'value';

echo $container['key'];

Singleton Access

use Scabbia\Services;

$container = Services::getCurrent();

$container['key'] = ['sample', 'array'];

var_dump($container['key']);

Setting a Factory

use Scabbia\Services;

$container = Services::getCurrent();

$container->setFactory('key', function () {
    return ['time' => microtime(true)];
});

var_dump($container['key']);
var_dump($container['key']); // will be different than previous one

Decorating

use Scabbia\Services;

$container = Services::getCurrent();

$container['key'] = 'test';

$container->decorate('key', function ($value) {
    return $value . 'ing';
});

$container->decorate('key', function ($value) {
    return strtoupper($value);
});

var_dump($container['key']); // returns 'TESTING'

Contributing

It is publicly open for any contribution. Bugfixes, new features and extra modules are welcome. All contributions should be filed on the eserozvataf/scabbia2-services repository., (*3)

  • To contribute to code: Fork the repo, push your changes to your fork, and submit a pull request.
  • To report a bug: If something does not work, please report it using GitHub issues.
  • To support: Donate

The Versions

22/09 2015

dev-master

9999999-dev http://www.scabbiafw.com/

Scabbia2 Services Component

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0

 

The Development Requires

services scabbia larukedi scabbia2 scabbiafw

16/09 2015

v0.1.2

0.1.2.0 http://www.scabbiafw.com/

Scabbia2 Services Component

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6.0

 

The Development Requires

services scabbia larukedi scabbia2 scabbiafw