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

FileResource.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 1.51 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\Config\Resource;
 13   
 14  /**
 15   * FileResource represents a resource stored on the filesystem.
 16   *
 17   * The resource can be a file or a directory.
 18   *
 19   * @author Fabien Potencier <fabien@symfony.com>
 20   */
 21  class FileResource implements SelfCheckingResourceInterface, \Serializable
 22  {
 23      /**
 24       * @var string|false
 25       */
 26      private $resource;
 27   
 28      /**
 29       * Constructor.
 30       *
 31       * @param string $resource The file path to the resource
 32       */
 33      public function __construct($resource)
 34      {
 35          $this->resource = realpath($resource) ?: (file_exists($resource) ? $resource : false);
 36      }
 37   
 38      /**
 39       * {@inheritdoc}
 40       */
 41      public function __toString()
 42      {
 43          return (string) $this->resource;
 44      }
 45   
 46      /**
 47       * {@inheritdoc}
 48       */
 49      public function getResource()
 50      {
 51          return $this->resource;
 52      }
 53   
 54      /**
 55       * {@inheritdoc}
 56       */
 57      public function isFresh($timestamp)
 58      {
 59          if (false === $this->resource || !file_exists($this->resource)) {
 60              return false;
 61          }
 62   
 63          return filemtime($this->resource) <= $timestamp;
 64      }
 65   
 66      public function serialize()
 67      {
 68          return serialize($this->resource);
 69      }
 70   
 71      public function unserialize($serialized)
 72      {
 73          $this->resource = unserialize($serialized);
 74      }
 75  }
 76