定制 brightmachine/object-proxy 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

brightmachine/object-proxy

最新稳定版本:1.0.0

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:

  1. set the target object for proxying to
  2. 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".

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固