定制 ocramius/proxy-manager 二次开发

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

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

ocramius/proxy-manager

最新稳定版本:2.14.1

Composer 安装命令:

composer require ocramius/proxy-manager

包简介

A library providing utilities to generate, instantiate and generally operate with Object Proxies

README 文档

README

A message to Russian ???????? people

If you currently live in Russia, please read this message.

Purpose

This library aims to provide abstraction for generating various kinds of proxy classes.

ProxyManager

Mutation testing badge Type Coverage

Total Downloads Latest Stable Version Latest Unstable Version

Documentation

You can learn about the proxy pattern and how to use the ProxyManager in the docs.

ocramius/proxy-manager for enterprise

Available as part of the Tidelift Subscription.

The maintainer of ocramius/proxy-manager and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more..

You can also contact the maintainer at ocramius@gmail.com for looking into issues related to this package in your private projects.

Installation

The suggested installation method is via composer:

php composer.phar require ocramius/proxy-manager

Proxy example

Here's how you build a lazy loadable object with ProxyManager using a Virtual Proxy

$factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory();

$proxy = $factory->createProxy(
    \MyApp\HeavyComplexObject::class,
    function (& $wrappedObject, $proxy, $method, $parameters, & $initializer) {
        $wrappedObject = new \MyApp\HeavyComplexObject(); // instantiation logic here
        $initializer   = null; // turning off further lazy initialization

        return true; // report success
    }
);

$proxy->doFoo();

See the documentation for more supported proxy types and examples.

统计信息

  • 总下载量: 81.86M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4993
  • 点击次数: 2
  • 依赖项目数: 271
  • 推荐数: 36

GitHub 信息

  • Stars: 4974
  • Watchers: 43
  • Forks: 193
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04