PDF rausgenommen
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bridge\ProxyManager\LazyProxy\Instantiator;
|
||||
|
||||
use ProxyManager\Factory\LazyLoadingValueHolderFactory as BaseFactory;
|
||||
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\LazyLoadingValueHolderGenerator;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class LazyLoadingValueHolderFactoryV1 extends BaseFactory
|
||||
{
|
||||
private $generatorV1;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getGenerator()
|
||||
{
|
||||
return $this->generatorV1 ?: $this->generatorV1 = new LazyLoadingValueHolderGenerator();
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bridge\ProxyManager\LazyProxy\Instantiator;
|
||||
|
||||
use ProxyManager\Factory\LazyLoadingValueHolderFactory as BaseFactory;
|
||||
use ProxyManager\ProxyGenerator\ProxyGeneratorInterface;
|
||||
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\LazyLoadingValueHolderGenerator;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class LazyLoadingValueHolderFactoryV2 extends BaseFactory
|
||||
{
|
||||
private $generator;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getGenerator(): ProxyGeneratorInterface
|
||||
{
|
||||
return $this->generator ?: $this->generator = new LazyLoadingValueHolderGenerator();
|
||||
}
|
||||
}
|
62
msd2/phpBB3/vendor/symfony/proxy-manager-bridge/LazyProxy/Instantiator/RuntimeInstantiator.php
vendored
Normal file
62
msd2/phpBB3/vendor/symfony/proxy-manager-bridge/LazyProxy/Instantiator/RuntimeInstantiator.php
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bridge\ProxyManager\LazyProxy\Instantiator;
|
||||
|
||||
use ProxyManager\Configuration;
|
||||
use ProxyManager\Factory\LazyLoadingValueHolderFactory;
|
||||
use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy;
|
||||
use ProxyManager\Proxy\LazyLoadingInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface;
|
||||
|
||||
/**
|
||||
* Runtime lazy loading proxy generator.
|
||||
*
|
||||
* @author Marco Pivetta <ocramius@gmail.com>
|
||||
*/
|
||||
class RuntimeInstantiator implements InstantiatorInterface
|
||||
{
|
||||
/**
|
||||
* @var LazyLoadingValueHolderFactory
|
||||
*/
|
||||
private $factory;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$config = new Configuration();
|
||||
$config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
|
||||
|
||||
if (method_exists('ProxyManager\Version', 'getVersion')) {
|
||||
$this->factory = new LazyLoadingValueHolderFactoryV2($config);
|
||||
} else {
|
||||
$this->factory = new LazyLoadingValueHolderFactoryV1($config);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function instantiateProxy(ContainerInterface $container, Definition $definition, $id, $realInstantiator)
|
||||
{
|
||||
return $this->factory->createProxy(
|
||||
$definition->getClass(),
|
||||
function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($realInstantiator) {
|
||||
$wrappedInstance = \call_user_func($realInstantiator);
|
||||
|
||||
$proxy->setProxyInitializer(null);
|
||||
|
||||
return true;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user