Popularity
8.5
Stable
Activity
0.0
Declining
4,938
50
196

Description

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

Code Quality Rank: L5
Programming language: PHP
License: MIT License
Tags: Database     Aop     Proxy     Proxy Pattern     Service Proxies     Lazy Loading    
Latest version: v2.10.0

ProxyManager alternatives and similar libraries

Based on the "Database" category.
Alternatively, view ProxyManager alternatives based on common mentions on social networks and blogs.

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

Add another 'Database' Library

README

Proxy Manager

A message to Russian ๐Ÿ‡ท๐Ÿ‡บ people

If you currently live in Russia, please read [this message](./ToRussianPeople.md).

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](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 [email protected] 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](docs) for more supported proxy types and examples.