Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

RuntimeInstantiator.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.83 KiB


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          if (method_exists('ProxyManager\Version', 'getVersion')) {
40              $this->factory = new LazyLoadingValueHolderFactoryV2($config);
41          } else {
42              $this->factory = new LazyLoadingValueHolderFactoryV1($config);
43          }
44      }
45   
46      /**
47       * {@inheritdoc}
48       */
49      public function instantiateProxy(ContainerInterface $container, Definition $definition, $id, $realInstantiator)
50      {
51          return $this->factory->createProxy(
52              $definition->getClass(),
53              function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($realInstantiator) {
54                  $wrappedInstance = \call_user_func($realInstantiator);
55   
56                  $proxy->setProxyInitializer(null);
57   
58                  return true;
59              }
60          );
61      }
62  }
63