gobline/registrar
Composer 安装命令:
composer require gobline/registrar
包简介
Registrar component
README 文档
README
The Registrar component takes a Gobline container and allows you to add services to it defined in one or more configuration files. It loads the right configuration files based on the current environment (dev, prod, ...).
$container = new Gobline\Container(); $registrar = new Gobline\Registrar\Registrar($container, 'dev'); $registrar->register(getcwd().'/config/services.php');
In the above code, we set the environment to "dev", and the Registrar will attempt to add the services defined in the following files to the container:
- services.php (if exists)
- services.dev.php (if exists)
The services listed in the configuration file are defined in a PHP array, which its structure follows a convention. Below is an example of a configuration file:
return [ Pdo::class => [ 'construct' => [ 'arguments' => ['sqlite:db.sqlite'], ], ], Swift_SmtpTransport::class => [ 'alias' => Swift_Transport::class, 'construct' => [ 'arguments' => ['smtp.gmail.com', 465, 'ssl'], ], 'configure' => [ 'data' => [ 'username' => 'mdecaffmeyer@gmail.com', 'password' => '***', ], ], ], Gobline\Auth\Authenticator\Db\DbAuthenticator::class => [ 'alias' => Gobline\Auth\Authenticator\AuthenticatorInterface::class, ], Gobline\Auth\CurrentUser::class => [ 'alias' => Gobline\Auth\CurrentUserInterface::class, 'configure' => [ 'configurator' => Gobline\Auth\Provider\Gobline\CurrentUserConfigurator::class, 'data' => [ 'persistence' => 'session', 'roleUnauthenticated' => 'unauthenticated', ], ], ], Doctrine\ORM\EntityManager::class => [ 'construct' => [ 'factory' => App\Provider\EntityManagerFactory::class, ], ], ];
gobline/registrar 适用场景与选型建议
gobline/registrar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 117 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 12 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「dependency injection」 「registrar」 「gobline」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gobline/registrar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gobline/registrar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gobline/registrar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A High Level EPP (Extensible Provisioning Protocol) TCP/SSL Client for PHP
PHP library for communicating with EPP(Extensible Provisioning Protocol) servers
A fast and intuitive dependency injection container.
Laravel logicboxes package
Generic abstractions related to TODO Registrar
Dependency injection container for the Monolith framework.
统计信息
- 总下载量: 117
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-12-03