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

FileGeneratorRegistry.php

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


01  <?php
02  /**
03   * Zend Framework (http://framework.zend.com/)
04   *
05   * @link      http://github.com/zendframework/zf2 for the canonical source repository
06   * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
07   * @license   http://framework.zend.com/license/new-bsd New BSD License
08   */
09   
10  namespace Zend\Code\Generator;
11   
12  use Zend\Code\Generator\Exception\RuntimeException;
13   
14  use function str_replace;
15   
16  class FileGeneratorRegistry
17  {
18      /**
19       * @var array $fileCodeGenerators
20       */
21      private static $fileCodeGenerators = [];
22   
23      /**
24       * Registry for the Zend\Code package.
25       *
26       * @param  FileGenerator $fileCodeGenerator
27       * @param  string $fileName
28       * @throws RuntimeException
29       */
30      public static function registerFileCodeGenerator(FileGenerator $fileCodeGenerator, $fileName = null)
31      {
32          if ($fileName === null) {
33              $fileName = $fileCodeGenerator->getFilename();
34          }
35   
36          if ($fileName == '') {
37              throw new RuntimeException('FileName does not exist.');
38          }
39   
40          // cannot use realpath since the file might not exist, but we do need to have the index
41          // in the same DIRECTORY_SEPARATOR that realpath would use:
42          $fileName = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $fileName);
43   
44          static::$fileCodeGenerators[$fileName] = $fileCodeGenerator;
45      }
46  }
47