Verzeichnisstruktur phpBB-3.1.0
- Veröffentlicht
- 27.10.2014
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 |
Compiler.php
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 * @api
022 */
023 class Compiler
024 {
025 private $passConfig;
026 private $log;
027 private $loggingFormatter;
028 private $serviceReferenceGraph;
029
030 /**
031 * Constructor.
032 */
033 public function __construct()
034 {
035 $this->passConfig = new PassConfig();
036 $this->serviceReferenceGraph = new ServiceReferenceGraph();
037 $this->loggingFormatter = new LoggingFormatter();
038 $this->log = array();
039 }
040
041 /**
042 * Returns the PassConfig.
043 *
044 * @return PassConfig The PassConfig instance
045 *
046 * @api
047 */
048 public function getPassConfig()
049 {
050 return $this->passConfig;
051 }
052
053 /**
054 * Returns the ServiceReferenceGraph.
055 *
056 * @return ServiceReferenceGraph The ServiceReferenceGraph instance
057 *
058 * @api
059 */
060 public function getServiceReferenceGraph()
061 {
062 return $this->serviceReferenceGraph;
063 }
064
065 /**
066 * Returns the logging formatter which can be used by compilation passes.
067 *
068 * @return LoggingFormatter
069 */
070 public function getLoggingFormatter()
071 {
072 return $this->loggingFormatter;
073 }
074
075 /**
076 * Adds a pass to the PassConfig.
077 *
078 * @param CompilerPassInterface $pass A compiler pass
079 * @param string $type The type of the pass
080 *
081 * @api
082 */
083 public function addPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION)
084 {
085 $this->passConfig->addPass($pass, $type);
086 }
087
088 /**
089 * Adds a log message.
090 *
091 * @param string $string The log message
092 */
093 public function addLogMessage($string)
094 {
095 $this->log[] = $string;
096 }
097
098 /**
099 * Returns the log.
100 *
101 * @return array Log array
102 */
103 public function getLog()
104 {
105 return $this->log;
106 }
107
108 /**
109 * Run the Compiler and process all Passes.
110 *
111 * @param ContainerBuilder $container
112 *
113 * @api
114 */
115 public function compile(ContainerBuilder $container)
116 {
117 foreach ($this->passConfig->getPasses() as $pass) {
118 $pass->process($container);
119 }
120 }
121 }
122