Yannick Warnier 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
..
doc-template 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
docs 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
src 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
CHANGELOG.md 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
LICENSE 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
README.md 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
STABILITY.md 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
UPGRADE.md 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
composer.json 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
couscous.yml 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
phpbench.json 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás
proxy-manager.svg 76a0eae5ea Add static resources and remove tests dir for beta release há 5 anos atrás

README.md

Proxy Manager

This library aims at providing abstraction for generating various kinds of proxy classes.

ProxyManager

Build Status Code Coverage Scrutinizer Quality Score SensioLabsInsight Dependency Status Reference Status HHVM Status

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, which are also compiled to HTML.

Help/Support

Gitter

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 HeavyComplexObject(); // instantiation logic here
        $initializer   = null; // turning off further lazy initialization
    }
);

$proxy->doFoo();

See the online documentation for more supported proxy types and examples.