1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
<?php /** * */ class Loco_fs_Link extends Loco_fs_File {
/** * @var Loco_fs_File */ private ?Loco_fs_File $real = null;
/** * {@inheritdoc} */ public function __construct( $path ){ parent::__construct($path); $real = realpath( $this->getPath() ); if( is_string($real) ){ if( is_dir($real) ){ $this->real = new Loco_fs_Directory($real); } else { $this->real = new Loco_fs_File($real); } } } /** * @return Loco_fs_File|null */ public function resolve():?Loco_fs_File { return $this->real; }
/** * {@inheritdoc} */ public function isDirectory():bool { return $this->real instanceof Loco_fs_Directory; } }
|