MyGit

Ocramius/ProxyManager

Fork: 187 Star: 4954 (更新于 2024-11-04 07:15:30)

license: MIT

Language: PHP .

🎩✨🌈 OOP Proxy wrappers/utilities - generates and manages proxies of your objects

最后发布版本: 2.14.1 ( 2022-03-06 02:43:45)

GitHub网址

Proxy Manager

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.

最近版本更新:(数据更新于 2024-09-15 08:09:56)

2022-03-06 02:43:45 2.14.1

2022-03-06 02:42:41 2.13.1

2022-03-06 02:40:08 2.12.1

2022-03-06 02:39:05 2.11.2

2022-03-06 02:37:48 2.10.2

2022-03-06 02:36:31 2.9.2

2022-03-06 02:33:25 2.8.2

2022-03-06 02:30:58 2.7.2

2022-03-06 02:25:56 2.6.2

2022-03-06 02:24:38 2.5.3

主题(topics):

aop, lazy-loading, oop, proxy

Ocramius/ProxyManager同语言 PHP最近更新仓库

2024-11-20 23:58:25 laravel/framework

2024-11-20 18:39:23 danielmiessler/SecLists

2024-11-16 21:54:23 w7corp/easywechat

2024-11-16 04:49:03 coollabsio/coolify

2024-11-13 23:19:14 symfony/symfony

2024-11-13 22:53:21 symfony/var-dumper