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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
includenode.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * For full copyright and license information, please see
10 * the docs/CREDITS.txt file.
11 *
12 */
13
14 namespace phpbb\template\twig\node;
15
16 class includenode extends \Twig\Node\IncludeNode
17 {
18 /**
19 * Compiles the node to PHP.
20 *
21 * @param \Twig\Compiler A Twig\Compiler instance
22 */
23 public function compile(\Twig\Compiler $compiler)
24 {
25 $compiler->addDebugInfo($this);
26
27 $compiler
28 ->write("\$location = ")
29 ->subcompile($this->getNode('expr'))
30 ->raw(";\n")
31 ->write("\$namespace = false;\n")
32 ->write("if (strpos(\$location, '@') === 0) {\n")
33 ->indent()
34 ->write("\$namespace = substr(\$location, 1, strpos(\$location, '/') - 1);\n")
35 ->write("\$previous_look_up_order = \$this->env->getNamespaceLookUpOrder();\n")
36
37 // We set the namespace lookup order to be this namespace first, then the main path
38 ->write("\$this->env->setNamespaceLookUpOrder(array(\$namespace, '__main__'));\n")
39 ->outdent()
40 ->write("}\n")
41 ;
42
43 parent::compile($compiler);
44
45 $compiler
46 ->write("if (\$namespace) {\n")
47 ->indent()
48 ->write("\$this->env->setNamespaceLookUpOrder(\$previous_look_up_order);\n")
49 ->outdent()
50 ->write("}\n")
51 ;
52 }
53 }
54