1 | <?php |
||
19 | abstract class Remote implements File |
||
20 | { |
||
21 | /** |
||
22 | * File size |
||
23 | * |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $size; |
||
27 | |||
28 | /** |
||
29 | * Filename |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $filename; |
||
34 | |||
35 | /** |
||
36 | * Full path with filename |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $pathname; |
||
41 | |||
42 | /** |
||
43 | * File's last modified unix timestamp |
||
44 | * |
||
45 | * @var int |
||
46 | */ |
||
47 | protected $lastModified; |
||
48 | |||
49 | /** |
||
50 | * Return the filesize. |
||
51 | * |
||
52 | * @return integer |
||
53 | */ |
||
54 | 4 | public function getSize(): int |
|
55 | { |
||
56 | 4 | return $this->size; |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * Return the filename. |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | 8 | public function getFilename(): string |
|
65 | { |
||
66 | 8 | return $this->filename; |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * Return the full path and filename. |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | 4 | public function getPathname(): string |
|
75 | { |
||
76 | 4 | return $this->pathname; |
|
77 | } |
||
78 | |||
79 | /** |
||
80 | * Return last modified date as unix timestamp. |
||
81 | * |
||
82 | * @return integer |
||
83 | */ |
||
84 | 4 | public function getMTime(): int |
|
85 | { |
||
86 | 4 | return $this->lastModified; |
|
87 | } |
||
88 | |||
89 | /** |
||
90 | * Return whether the file is writable or not. |
||
91 | * |
||
92 | * @return boolean |
||
93 | */ |
||
94 | public function isWritable(): bool |
||
95 | { |
||
96 | return true; |
||
97 | } |
||
98 | |||
99 | /** |
||
100 | * Deletes the file. |
||
101 | * |
||
102 | * @throws \phpbu\App\Exception |
||
103 | */ |
||
104 | abstract public function unlink(); |
||
105 | } |
||
106 |