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

FilterIterator.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 1.64 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   * This iterator just overrides the rewind method in order to correct a PHP bug,
 16   * which existed before version 5.5.23/5.6.7.
 17   *
 18   * @see https://bugs.php.net/68557
 19   *
 20   * @author Alex Bogomazov
 21   */
 22  abstract class FilterIterator extends \FilterIterator
 23  {
 24      /**
 25       * This is a workaround for the problem with \FilterIterator leaving inner \FilesystemIterator in wrong state after
 26       * rewind in some cases.
 27       *
 28       * @see FilterIterator::rewind()
 29       */
 30      public function rewind()
 31      {
 32          if (PHP_VERSION_ID > 50607 || (PHP_VERSION_ID > 50523 && PHP_VERSION_ID < 50600)) {
 33              parent::rewind();
 34   
 35              return;
 36          }
 37   
 38          $iterator = $this;
 39          while ($iterator instanceof \OuterIterator) {
 40              $innerIterator = $iterator->getInnerIterator();
 41   
 42              if ($innerIterator instanceof RecursiveDirectoryIterator) {
 43                  // this condition is necessary for iterators to work properly with non-local filesystems like ftp
 44                  if ($innerIterator->isRewindable()) {
 45                      $innerIterator->next();
 46                      $innerIterator->rewind();
 47                  }
 48              } elseif ($innerIterator instanceof \FilesystemIterator) {
 49                  $innerIterator->next();
 50                  $innerIterator->rewind();
 51              }
 52   
 53              $iterator = $innerIterator;
 54          }
 55   
 56          parent::rewind();
 57      }
 58  }
 59