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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
FileExistenceResource.php
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 * Constructor.
30 *
31 * @param string $resource The file path to the resource
32 */
33 public function __construct($resource)
34 {
35 $this->resource = (string) $resource;
36 $this->exists = file_exists($resource);
37 }
38
39 /**
40 * {@inheritdoc}
41 */
42 public function __toString()
43 {
44 return $this->resource;
45 }
46
47 /**
48 * {@inheritdoc}
49 */
50 public function getResource()
51 {
52 return $this->resource;
53 }
54
55 /**
56 * {@inheritdoc}
57 */
58 public function isFresh($timestamp)
59 {
60 return file_exists($this->resource) === $this->exists;
61 }
62
63 /**
64 * {@inheritdoc}
65 */
66 public function serialize()
67 {
68 return serialize(array($this->resource, $this->exists));
69 }
70
71 /**
72 * {@inheritdoc}
73 */
74 public function unserialize($serialized)
75 {
76 list($this->resource, $this->exists) = unserialize($serialized);
77 }
78 }
79