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

PathFilterIterator.php

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


 01  <?php
 02   
 03  /*
 04   * This file is part of the Symfony package.
 05   *
 06   * (c) Fabien Potencier <fabien@symfony.com>
 07   *
 08   * For the full copyright and license information, please view the LICENSE
 09   * file that was distributed with this source code.
 10   */
 11   
 12  namespace Symfony\Component\Finder\Iterator;
 13   
 14  /**
 15   * PathFilterIterator filters files by path patterns (e.g. some/special/dir).
 16   *
 17   * @author Fabien Potencier  <fabien@symfony.com>
 18   * @author Włodzimierz Gajda <gajdaw@gajdaw.pl>
 19   */
 20  class PathFilterIterator extends MultiplePcreFilterIterator
 21  {
 22      /**
 23       * Filters the iterator values.
 24       *
 25       * @return bool true if the value should be kept, false otherwise
 26       */
 27      public function accept()
 28      {
 29          $filename = $this->current()->getRelativePathname();
 30   
 31          if ('\\' === DIRECTORY_SEPARATOR) {
 32              $filename = str_replace('\\', '/', $filename);
 33          }
 34   
 35          return $this->isAccepted($filename);
 36      }
 37   
 38      /**
 39       * Converts strings to regexp.
 40       *
 41       * PCRE patterns are left unchanged.
 42       *
 43       * Default conversion:
 44       *     'lorem/ipsum/dolor' ==>  'lorem\/ipsum\/dolor/'
 45       *
 46       * Use only / as directory separator (on Windows also).
 47       *
 48       * @param string $str Pattern: regexp or dirname
 49       *
 50       * @return string regexp corresponding to a given string or regexp
 51       */
 52      protected function toRegex($str)
 53      {
 54          return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/';
 55      }
 56  }
 57