2017 © Pedro Peláez
 

library proxy-manager-module

A ZF module which allows to configure and use Ocramius/ProxyManager via ServiceManager

image

thomasvargiu/proxy-manager-module

A ZF module which allows to configure and use Ocramius/ProxyManager via ServiceManager

  • Sunday, April 17, 2016
  • by thomasvargiu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,499 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

ProxyManagerModule

Build Status Code Coverage Scrutinizer Code Quality Dependency Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Status: development, (*2)

ZF2 module that allows simplified use of Ocramius/ProxyManager registering factories in the service manager., (*3)

Configuration

return [
    'proxy_manager_module' => [
        'configuration' => [
            /*
             * Proxies namespace
             *
             * A namespace for proxies
             */
            // 'proxies_namespace' => '',

            /*
             * Proxies Target Directory
             *
             * Where to save proxies
             */
            // 'proxies_target_dir' => './data/ProxyManager',

            /*
             * Generator Strategy
             *
             * An instance of ProxyManager\GeneratorStrategy\GeneratorStrategyInterface
             * or a service name in the service locator
             */
            // 'generator_strategy' => '',

            /*
             * Proxy autoloader
             *
             * An instance of ProxyManager\Autoloader\AutoloaderInterface
             * or a service name in the service locator
             */
            // 'proxy_autoloader' => '',

            /*
             * Class name inflector
             *
             * An instance of ProxyManager\Inflector\ClassNameInflectorInterface
             * or a service name in the service locator
             */
            // 'class_name_inflector' => '',
        ],
    ],
];

Registered Factories

return [
    'service_manager' => [
        'factories' => [
            'ProxyManager\\Configuration' => 'ProxyManagerModule\\Factory\\ConfigurationFactory',
            'ProxyManager\\Factory\\AccessInterceptorScopeLocalizerFactory' => 'ProxyManagerModule\\Factory\\AccessInterceptorScopeLocalizerFactoryFactory',
            'ProxyManager\\Factory\\AccessInterceptorValueHolderFactory' => 'ProxyManagerModule\\Factory\\AccessInterceptorValueHolderFactoryFactory',
            'ProxyManager\\Factory\\LazyLoadingGhostFactory' => 'ProxyManagerModule\\Factory\\LazyLoadingGhostFactoryFactory',
            'ProxyManager\\Factory\\LazyLoadingValueHolderFactory' => 'ProxyManagerModule\\Factory\\LazyLoadingValueHolderFactoryFactory',
            'ProxyManager\\Factory\\NullObjectFactory' => 'ProxyManagerModule\\Factory\\NullObjectFactoryFactory',
        ],
    ],
];

Configuration

  • ProxyManager\Configuration: Create the ProxyManager configuration from config

Factories

These are factories created using configuration created by ProxyManager\Configuration service factory:, (*4)

  • ProxyManager\Factory\AccessInterceptorScopeLocalizerFactory
  • ProxyManager\Factory\AccessInterceptorValueHolderFactory
  • ProxyManager\Factory\LazyLoadingGhostFactory
  • ProxyManager\Factory\LazyLoadingValueHolderFactory
  • ProxyManager\Factory\NullObjectFactory

How to use

You can request a Proxy Factory by getting the factory via service manager., (*5)

/** @var \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator */
$serviceLocator = $this->getServiceLocator();
/** @var \ProxyManager\Factory\LazyLoadingGhostFactory $proxyFactory */
$proxyFactory = $serviceLocator->get('ProxyManager\\Factory\\LazyLoadingGhostFactory');

Of course, you can register alias names in the service_manager config key., (*6)

The Versions

17/04 2016

2.0.0.x-dev

2.0.0.9999999-dev https://github.com/thomasvargiu/ProxyManagerModule

A ZF module which allows to configure and use Ocramius/ProxyManager via ServiceManager

  Sources   Download

MIT

The Requires

 

The Development Requires

zf2 zend framework proxy zf3 aop lazy loading proxy pattern service proxies

07/05 2015
23/02 2015

v0.1.0

0.1.0.0 https://github.com/thomasvargiu/ProxyManagerModule

A ZF2 which allows to configure and use Ocramius/ProxyManager via ServiceManager

  Sources   Download

MIT

The Requires

 

The Development Requires

zf2 zend framework proxy aop lazy loading proxy pattern service proxies