Skip to content
🌈 OOP Proxy wrappers utilities - generates and manages proxies of your objects
PHP Shell
Branch: master
Clone or download
Ocramius Merge pull request #497 from Ocramius/dependabot/composer/symfony/con…
…sole-tw-4.3.4

Update symfony/console requirement from ^4.3.3 to ^4.3.4
Latest commit 64482a9 Sep 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Corrected encoding of `/` for tidelift package URI May 23, 2019
docs Using newer (working) presentation link May 14, 2018
examples #463 included examples in statically analysed files Jun 2, 2019
src/ProxyManager Applied automatic CS fixes and fixing resulting static analysis issues Aug 10, 2019
tests
.gitattributes composer remove --dev couscous/couscous Aug 28, 2019
.gitignore composer remove --dev couscous/couscous Aug 28, 2019
.phpstorm.meta.php Added `PHPSTORM_META` to help with the various proxy factories inters… Jun 3, 2019
.scrutinizer.yml Remove php 7.x from allowed failure Apr 8, 2015
.travis.coverage.sh Uploading coverage when the PHP version matches 7.2 Nov 15, 2017
.travis.install.sh Run `composer update` with `--ignore-platform-reqs` when running on `… Feb 27, 2019
.travis.yml composer remove --dev couscous/couscous Aug 28, 2019
CHANGELOG.md ProxyManager 2.2.0 release notes Nov 16, 2017
CONTRIBUTING.md Tidied up contributing doc May 12, 2018
LICENSE EOF EOL Sep 23, 2014
README.md Removed unused badges from `README.md` Mar 16, 2019
STABILITY.md extend date for bug fixes and security fixes for 2.0.x version Jan 3, 2017
UPGRADE.md #272 - PHP 4 constructors are no longer supported Jan 28, 2016
composer.json Update symfony/console requirement from ^4.3.3 to ^4.3.4 Sep 1, 2019
infection.json.dist Infection no longer supports JSON logs Feb 27, 2019
phpbench.json Aggregate report is usually what is needed Jul 1, 2016
phpcs.xml.dist #463 excluding CS rules now made redundant by psalm type checks Jun 2, 2019
phpdox.xml.dist EOF EOL fixes Sep 23, 2014
phpmd.xml.dist EOF EOL fixes Sep 23, 2014
phpunit.xml.dist
proxy-manager.png Including rasterized version of the logo (renders on github) Nov 9, 2013
proxy-manager.svg Removing licence also from the logo Jul 31, 2017
psalm.xml Excluded remote object tests from type-checks, simplified configuration Jun 20, 2019

README.md

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, 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.

You can’t perform that action at this time.