brightmachine/object-proxy
Composer 安装命令:
composer require brightmachine/object-proxy
包简介
A trait to simplify the creation of proxies or simple facades.
README 文档
README
What is Rapper?
This trait can help with writing facades where you want some methods to forward on to a target object or to create a proxy class, for example if you don't want to reference vendor code from within your domain.
Requirements
- PHP 5.4+
Installation
Install composer in your project:
curl -s http://getcomposer.org/installer | php
Create a composer.json file in your project root:
{
"require": {
"brightmachine/rapper": "*"
}
}
Install via composer:
php composer.phar install
License
Rapper is open-sourced software licensed under the MIT License - see the LICENSE file for details
Documentation
Currently this trait allows you to do the following:
- set the target object for proxying to
- define a map of different function names to use
Example:
<?php namespace Example; use Monolog\Logger; use BrightMachine\ObjectWrapper; /** * Class Logger * * Proxy requests to Monolog/Logger * * @method mixed logMessage($msg) add a debug message * @package Example\Logger */ class Logger { use ObjectWrapper; public function __construct () { $target = new Logger('dev', $this->app['events']); $this->setTargetObject($target) ->setProxyFunctionMap([ 'logMessage' => 'addDebug' ]); } }
Contributing
Checkout master source code from github:
hub clone brightmachine/rapper
Install development components via composer:
# If you don't have composer.phar
./scripts/bundle-devtools.sh .
# If you have composer.phar
composer.phar install --dev
Coding Standard
We follows coding standard PSR-2.
Check if your codes follows PSR-2 by phpcs:
./vendor/bin/phpcs --standard=PSR2 src/
Acknowledgement
Git repo skeleton by "Goodby Setup".
brightmachine/object-proxy 适用场景与选型建议
brightmachine/object-proxy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21 次下载、GitHub Stars 达 1, 最近一次更新时间为 2014 年 10 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「object」 「proxy」 「wrapper」 「facade」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 brightmachine/object-proxy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 brightmachine/object-proxy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 brightmachine/object-proxy 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Lazy loading for middleware and request handlers
A set of useful PHP classes.
Runn Me! Value Objects Library
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
Laravel SDK mapping data in object
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-30