Need help with ProxyManager?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

Ocramius
4.5K Stars 177 Forks MIT License 2.9K Commits 25 Opened issues

Description

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

Services available

!
?

Need anything else?

Contributors list

# 12,470
PHP
Compose...
php7
PHPUnit
2065 commits
# 141,721
PHP
Symfony
aop
lazy-lo...
83 commits
# 205,608
oop
PHP
lazy-lo...
C++
29 commits
# 144,350
PHP
HTML
excel
webfram...
15 commits
# 41,403
PHP
zend-fr...
oauth2
laminas
10 commits
# 1,910
PHP
Symfony
Compose...
symfony...
10 commits
# 18,763
PHP
Symfony
sonata
php7
6 commits
# 8,500
PHP
Symfony
symfony...
Compose...
6 commits
# 65,355
PHP
PHPUnit
TeX
coding-...
6 commits
# 73,079
PHP
rabbitm...
slugify
twig-ex...
5 commits
# 159,149
PHP
Shell
phpstan
php7
5 commits
# 186,941
Laravel
PHP
Vue.js
photosh...
5 commits
# 12,689
PHP
Compose...
taint-a...
securit...
5 commits
# 8,985
Compose...
github-...
php7
errors
5 commits
# 392,893
oop
PHP
lazy-lo...
4 commits
# 7,917
Compose...
PHP
PHPUnit
Nette
4 commits
# 50,468
PHP
zend-fr...
TeX
psr-11
3 commits
# 14,204
PHP
Symfony
PHPUnit
iterm2
3 commits
# 156,780
jupyter
lazy-lo...
Shell
thrift
3 commits
# 63,783
PHP
intelli...
phpstor...
php7
3 commits

Proxy Manager

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.

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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.