Skip to content

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

License

Notifications You must be signed in to change notification settings

Ocramius/ProxyManager

Folders and files

Image for: Folders and files
NameName
Last commit message
Last commit date

Latest commit

Image for: Latest commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image for: Repository files navigation

Proxy Manager

A message to Russian πŸ‡·πŸ‡Ί people

Image for: A message to Russian πŸ‡·πŸ‡Ί people

If you currently live in Russia, please read this message.

Purpose

Image for: Purpose

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

Documentation

Image for: Documentation

You can learn about the proxy pattern and how to use the ProxyManager in the docs.

ocramius/proxy-manager for enterprise

Image for: 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

Image for: Installation

The suggested installation method is via composer:

php composer.phar require ocramius/proxy-manager

Proxy example

Image for: 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.

About

Image for: About

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

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

Image for: Packages 0
No packages published

Contributors 56

Image for: Contributors 56

Languages

Image for: Languages