mlebkowski/silex-private-scope
最新稳定版本:0.1
Composer 安装命令:
composer require mlebkowski/silex-private-scope
包简介
Private scope handling for Silex container
README 文档
README
Create an instance of ScopedApplication to hide your services by default:
$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:
$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";
统计信息
- 总下载量: 247
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-27