ProxyManager

:rainbow: OOP Proxy wrappers utilities - generates and manages proxies of your objects

Github stars Tracking Chart

Proxy Manager

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

ProxyManager

Build Status
Code Coverage
Scrutinizer Quality Score
SensioLabsInsight

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
    }
);

$proxy->doFoo();

See the documentation for more supported proxy types and examples.

Overview

Name With OwnerOcramius/ProxyManager
Primary LanguagePHP
Program languagePHP (Language Count: 1)
Platform
License:MIT License
Release Count71
Last Release Name2.14.1 (Posted on 2022-03-05 18:43:44)
First Release Name0.1.0 (Posted on 2013-03-23 07:41:47)
Created At2013-03-19 09:43:22
Pushed At2024-05-11 02:32:39
Last Commit At
Stargazers Count4.9k
Watchers Count50
Fork Count196
Commits Count3k
Has Issues Enabled
Issues Count289
Issue Open Count36
Pull Requests Count355
Pull Requests Open Count15
Pull Requests Close Count128
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private
To the top