Popularity
8.2
Growing
Activity
8.6
Growing
2,963
46
121

Description

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

Code Quality Rank: L5
Monthly Downloads: 1,039,187
Programming language: PHP
License: MIT License
Tags: Database     Aop     Proxy     Proxy Pattern     Service Proxies     Lazy Loading    
Latest version: v2.5.0

ProxyManager alternatives and similar libraries

Based on the "Database" category

Do you think we are missing an alternative of ProxyManager or a related project?

Add another 'Database' Library

README

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

Professional Support

Professionally supported ocramius/proxy-manager is available through Tidelift .

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 online documentation for more supported proxy types and examples.