2017 © Pedro Peláez
 

library silex-private-scope

Private scope handling for Silex container

image

mlebkowski/silex-private-scope

Private scope handling for Silex container

  • Friday, February 27, 2015
  • by mlebkowski
  • Repository
  • 2 Watchers
  • 0 Stars
  • 238 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Private scope for Silex container

Create an instance of ScopedApplication to hide your services by default:, (*1)

$app = new Nassau\Silex\ScopedApplication([
    'version' => 1.0,
]);

$app['private-service'] = function () { };
$app['version']; // 1.0; services are registered as public if passed to constructor

$app['private-service']; // throws \Nassau\Silex\PrivateScopeViolationException

Create a public service by using publish() method. Private services will be available from inside the closure:, (*2)

$app = new Nassau\Silex\ScopedApplication;
$app['public-service'] = $app->publish(function (Silex\Application $app) { 
    return $app['private-service'];
});
$app['private-service'] = function () { return "private" }

$app['public-service']; // "private";

The Versions

27/02 2015

dev-master

9999999-dev

Private scope handling for Silex container

  Sources   Download

MIT

The Requires

 

The Development Requires

27/02 2015

0.1

0.1.0.0

Private scope handling for Silex container

  Sources   Download

MIT

The Requires

 

The Development Requires