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

AbstractAdapter.php

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


 001  <?php
 002   
 003  /*
 004   * This file is part of the Symfony package.
 005   *
 006   * (c) Fabien Potencier <fabien@symfony.com>
 007   *
 008   * For the full copyright and license information, please view the LICENSE
 009   * file that was distributed with this source code.
 010   */
 011   
 012  namespace Symfony\Component\Finder\Adapter;
 013   
 014  @trigger_error('The '.__NAMESPACE__.'\AbstractAdapter class is deprecated since version 2.8 and will be removed in 3.0. Use directly the Finder class instead.', E_USER_DEPRECATED);
 015   
 016  /**
 017   * Interface for finder engine implementations.
 018   *
 019   * @author Jean-François Simon <contact@jfsimon.fr>
 020   *
 021   * @deprecated since 2.8, to be removed in 3.0. Use Finder instead.
 022   */
 023  abstract class AbstractAdapter implements AdapterInterface
 024  {
 025      protected $followLinks = false;
 026      protected $mode = 0;
 027      protected $minDepth = 0;
 028      protected $maxDepth = PHP_INT_MAX;
 029      protected $exclude = array();
 030      protected $names = array();
 031      protected $notNames = array();
 032      protected $contains = array();
 033      protected $notContains = array();
 034      protected $sizes = array();
 035      protected $dates = array();
 036      protected $filters = array();
 037      protected $sort = false;
 038      protected $paths = array();
 039      protected $notPaths = array();
 040      protected $ignoreUnreadableDirs = false;
 041   
 042      private static $areSupported = array();
 043   
 044      /**
 045       * {@inheritdoc}
 046       */
 047      public function isSupported()
 048      {
 049          $name = $this->getName();
 050   
 051          if (!array_key_exists($name, self::$areSupported)) {
 052              self::$areSupported[$name] = $this->canBeUsed();
 053          }
 054   
 055          return self::$areSupported[$name];
 056      }
 057   
 058      /**
 059       * {@inheritdoc}
 060       */
 061      public function setFollowLinks($followLinks)
 062      {
 063          $this->followLinks = $followLinks;
 064   
 065          return $this;
 066      }
 067   
 068      /**
 069       * {@inheritdoc}
 070       */
 071      public function setMode($mode)
 072      {
 073          $this->mode = $mode;
 074   
 075          return $this;
 076      }
 077   
 078      /**
 079       * {@inheritdoc}
 080       */
 081      public function setDepths(array $depths)
 082      {
 083          $this->minDepth = 0;
 084          $this->maxDepth = PHP_INT_MAX;
 085   
 086          foreach ($depths as $comparator) {
 087              switch ($comparator->getOperator()) {
 088                  case '>':
 089                      $this->minDepth = $comparator->getTarget() + 1;
 090                      break;
 091                  case '>=':
 092                      $this->minDepth = $comparator->getTarget();
 093                      break;
 094                  case '<':
 095                      $this->maxDepth = $comparator->getTarget() - 1;
 096                      break;
 097                  case '<=':
 098                      $this->maxDepth = $comparator->getTarget();
 099                      break;
 100                  default:
 101                      $this->minDepth = $this->maxDepth = $comparator->getTarget();
 102              }
 103          }
 104   
 105          return $this;
 106      }
 107   
 108      /**
 109       * {@inheritdoc}
 110       */
 111      public function setExclude(array $exclude)
 112      {
 113          $this->exclude = $exclude;
 114   
 115          return $this;
 116      }
 117   
 118      /**
 119       * {@inheritdoc}
 120       */
 121      public function setNames(array $names)
 122      {
 123          $this->names = $names;
 124   
 125          return $this;
 126      }
 127   
 128      /**
 129       * {@inheritdoc}
 130       */
 131      public function setNotNames(array $notNames)
 132      {
 133          $this->notNames = $notNames;
 134   
 135          return $this;
 136      }
 137   
 138      /**
 139       * {@inheritdoc}
 140       */
 141      public function setContains(array $contains)
 142      {
 143          $this->contains = $contains;
 144   
 145          return $this;
 146      }
 147   
 148      /**
 149       * {@inheritdoc}
 150       */
 151      public function setNotContains(array $notContains)
 152      {
 153          $this->notContains = $notContains;
 154   
 155          return $this;
 156      }
 157   
 158      /**
 159       * {@inheritdoc}
 160       */
 161      public function setSizes(array $sizes)
 162      {
 163          $this->sizes = $sizes;
 164   
 165          return $this;
 166      }
 167   
 168      /**
 169       * {@inheritdoc}
 170       */
 171      public function setDates(array $dates)
 172      {
 173          $this->dates = $dates;
 174   
 175          return $this;
 176      }
 177   
 178      /**
 179       * {@inheritdoc}
 180       */
 181      public function setFilters(array $filters)
 182      {
 183          $this->filters = $filters;
 184   
 185          return $this;
 186      }
 187   
 188      /**
 189       * {@inheritdoc}
 190       */
 191      public function setSort($sort)
 192      {
 193          $this->sort = $sort;
 194   
 195          return $this;
 196      }
 197   
 198      /**
 199       * {@inheritdoc}
 200       */
 201      public function setPath(array $paths)
 202      {
 203          $this->paths = $paths;
 204   
 205          return $this;
 206      }
 207   
 208      /**
 209       * {@inheritdoc}
 210       */
 211      public function setNotPath(array $notPaths)
 212      {
 213          $this->notPaths = $notPaths;
 214   
 215          return $this;
 216      }
 217   
 218      /**
 219       * {@inheritdoc}
 220       */
 221      public function ignoreUnreadableDirs($ignore = true)
 222      {
 223          $this->ignoreUnreadableDirs = (bool) $ignore;
 224   
 225          return $this;
 226      }
 227   
 228      /**
 229       * Returns whether the adapter is supported in the current environment.
 230       *
 231       * This method should be implemented in all adapters. Do not implement
 232       * isSupported in the adapters as the generic implementation provides a cache
 233       * layer.
 234       *
 235       * @see isSupported()
 236       *
 237       * @return bool Whether the adapter is supported
 238       */
 239      abstract protected function canBeUsed();
 240  }
 241