Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

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

FileExistenceResource.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.59 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   * FileExistenceResource represents a resource stored on the filesystem.
16   * Freshness is only evaluated against resource creation or deletion.
17   *
18   * The resource can be a file or a directory.
19   *
20   * @author Charles-Henri Bruyand <charleshenri.bruyand@gmail.com>
21   */
22  class FileExistenceResource implements SelfCheckingResourceInterface, \Serializable
23  {
24      private $resource;
25   
26      private $exists;
27   
28      /**
29       * @param string $resource The file path to the resource
30       */
31      public function __construct($resource)
32      {
33          $this->resource = (string) $resource;
34          $this->exists = file_exists($resource);
35      }
36   
37      /**
38       * {@inheritdoc}
39       */
40      public function __toString()
41      {
42          return $this->resource;
43      }
44   
45      /**
46       * @return string The file path to the resource
47       */
48      public function getResource()
49      {
50          return $this->resource;
51      }
52   
53      /**
54       * {@inheritdoc}
55       */
56      public function isFresh($timestamp)
57      {
58          return file_exists($this->resource) === $this->exists;
59      }
60   
61      /**
62       * @internal
63       */
64      public function serialize()
65      {
66          return serialize([$this->resource, $this->exists]);
67      }
68   
69      /**
70       * @internal
71       */
72      public function unserialize($serialized)
73      {
74          list($this->resource, $this->exists) = unserialize($serialized);
75      }
76  }
77