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

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

Compiler.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 2.43 KiB


 001  <?php
 002   
 003  /*
 004   * This file is part of the Symfony package.
 005   *
 006   * (c) Fabien Potencier <fabien@symfony.com>
 007   *
 008   * For the full copyright and license information, please view the LICENSE
 009   * file that was distributed with this source code.
 010   */
 011   
 012  namespace Symfony\Component\DependencyInjection\Compiler;
 013   
 014  use Symfony\Component\DependencyInjection\ContainerBuilder;
 015   
 016  /**
 017   * This class is used to remove circular dependencies between individual passes.
 018   *
 019   * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 020   */
 021  class Compiler
 022  {
 023      private $passConfig;
 024      private $log = array();
 025      private $loggingFormatter;
 026      private $serviceReferenceGraph;
 027   
 028      public function __construct()
 029      {
 030          $this->passConfig = new PassConfig();
 031          $this->serviceReferenceGraph = new ServiceReferenceGraph();
 032          $this->loggingFormatter = new LoggingFormatter();
 033      }
 034   
 035      /**
 036       * Returns the PassConfig.
 037       *
 038       * @return PassConfig The PassConfig instance
 039       */
 040      public function getPassConfig()
 041      {
 042          return $this->passConfig;
 043      }
 044   
 045      /**
 046       * Returns the ServiceReferenceGraph.
 047       *
 048       * @return ServiceReferenceGraph The ServiceReferenceGraph instance
 049       */
 050      public function getServiceReferenceGraph()
 051      {
 052          return $this->serviceReferenceGraph;
 053      }
 054   
 055      /**
 056       * Returns the logging formatter which can be used by compilation passes.
 057       *
 058       * @return LoggingFormatter
 059       */
 060      public function getLoggingFormatter()
 061      {
 062          return $this->loggingFormatter;
 063      }
 064   
 065      /**
 066       * Adds a pass to the PassConfig.
 067       *
 068       * @param CompilerPassInterface $pass A compiler pass
 069       * @param string                $type The type of the pass
 070       */
 071      public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION)
 072      {
 073          $this->passConfig->addPass($pass, $type);
 074      }
 075   
 076      /**
 077       * Adds a log message.
 078       *
 079       * @param string $string The log message
 080       */
 081      public function addLogMessage($string)
 082      {
 083          $this->log[] = $string;
 084      }
 085   
 086      /**
 087       * Returns the log.
 088       *
 089       * @return array Log array
 090       */
 091      public function getLog()
 092      {
 093          return $this->log;
 094      }
 095   
 096      /**
 097       * Run the Compiler and process all Passes.
 098       *
 099       * @param ContainerBuilder $container
 100       */
 101      public function compile(ContainerBuilder $container)
 102      {
 103          foreach ($this->passConfig->getPasses() as $pass) {
 104              $pass->process($container);
 105          }
 106      }
 107  }
 108