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

SiteDefinitionCollection.php

Zuletzt modifiziert: 09.10.2024, 12:59 - Dateigröße: 1.09 KiB


01  <?php
02   
03  /*
04  * @package   s9e\TextFormatter
05  * @copyright Copyright (c) 2010-2016 The s9e Authors
06  * @license   http://www.opensource.org/licenses/mit-license.php The MIT License
07  */
08  namespace s9e\TextFormatter\Plugins\MediaEmbed\Configurator\Collections;
09  use InvalidArgumentException;
10  use RuntimeException;
11  use s9e\TextFormatter\Configurator\Collections\NormalizedCollection;
12  class SiteDefinitionCollection extends NormalizedCollection
13  {
14      protected $onDuplicateAction = 'replace';
15      protected function getAlreadyExistsException($key)
16      {
17          return new RuntimeException("Media site '" . $key . "' already exists");
18      }
19      protected function getNotExistException($key)
20      {
21          return new RuntimeException("Media site '" . $key . "' does not exist");
22      }
23      public function normalizeKey($siteId)
24      {
25          $siteId = \strtolower($siteId);
26          if (!\preg_match('(^[a-z0-9]+$)', $siteId))
27              throw new InvalidArgumentException('Invalid site ID');
28          return $siteId;
29      }
30      public function normalizeValue($siteConfig)
31      {
32          if (!\is_array($siteConfig))
33              throw new InvalidArgumentException('Invalid site definition type');
34          return $siteConfig;
35      }
36  }