Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
RuntimeInstantiator.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Bridge\ProxyManager\LazyProxy\Instantiator;
13
14 use ProxyManager\Configuration;
15 use ProxyManager\Factory\LazyLoadingValueHolderFactory;
16 use ProxyManager\GeneratorStrategy\EvaluatingGeneratorStrategy;
17 use ProxyManager\Proxy\LazyLoadingInterface;
18 use Symfony\Component\DependencyInjection\ContainerInterface;
19 use Symfony\Component\DependencyInjection\Definition;
20 use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface;
21
22 /**
23 * Runtime lazy loading proxy generator.
24 *
25 * @author Marco Pivetta <ocramius@gmail.com>
26 */
27 class RuntimeInstantiator implements InstantiatorInterface
28 {
29 /**
30 * @var LazyLoadingValueHolderFactory
31 */
32 private $factory;
33
34 public function __construct()
35 {
36 $config = new Configuration();
37 $config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
38
39 $this->factory = new LazyLoadingValueHolderFactory($config);
40 }
41
42 /**
43 * {@inheritdoc}
44 */
45 public function instantiateProxy(ContainerInterface $container, Definition $definition, $id, $realInstantiator)
46 {
47 return $this->factory->createProxy(
48 $definition->getClass(),
49 function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($realInstantiator) {
50 $wrappedInstance = call_user_func($realInstantiator);
51
52 $proxy->setProxyInitializer(null);
53
54 return true;
55 }
56 );
57 }
58 }
59