定制 thomasvargiu/proxy-manager-module 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thomasvargiu/proxy-manager-module

最新稳定版本:1.0.0

Composer 安装命令:

composer require thomasvargiu/proxy-manager-module

包简介

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

README 文档

README

Build Status Code Coverage Scrutinizer Code Quality Dependency Status Latest Stable Version Total Downloads Latest Unstable Version License

Status: development

ZF2 module that allows simplified use of Ocramius/ProxyManager registering factories in the service manager.

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:

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

/** @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.

统计信息

  • 总下载量: 1.51k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-18