1 | <?php |
||
9 | class FileSystem implements AdapterInterface |
||
10 | { |
||
11 | protected $adapter; |
||
12 | |||
13 | /** |
||
14 | * @param AdapterInterface $adapter |
||
15 | */ |
||
16 | public function __construct(AdapterInterface $adapter) |
||
20 | |||
21 | /** |
||
22 | * {@inheritDoc} |
||
23 | */ |
||
24 | public function read($path) |
||
34 | |||
35 | /** |
||
36 | * {@inheritDoc} |
||
37 | */ |
||
38 | public function write($path, $source) |
||
48 | |||
49 | /** |
||
50 | * {@inheritDoc} |
||
51 | */ |
||
52 | public function writeContent($path, $content) |
||
62 | |||
63 | /** |
||
64 | * {@inheritDoc} |
||
65 | */ |
||
66 | public function rename($sourcePath, $targetPath) |
||
80 | |||
81 | /** |
||
82 | * {@inheritDoc} |
||
83 | */ |
||
84 | public function delete($path) |
||
94 | |||
95 | /** |
||
96 | * {@inheritDoc} |
||
97 | */ |
||
98 | public function getFiles($directory = "") |
||
102 | |||
103 | /** |
||
104 | * {@inheritDoc} |
||
105 | */ |
||
106 | public function copyFiles($sourceDir, $targetDir) |
||
110 | |||
111 | /** |
||
112 | * {@inheritDoc} |
||
113 | */ |
||
114 | public function exists($path) |
||
118 | |||
119 | /** |
||
120 | * {@inheritDoc} |
||
121 | */ |
||
122 | public function isDirectory($path) |
||
126 | |||
127 | /** |
||
128 | * {@inheritDoc} |
||
129 | */ |
||
130 | public function getURL($path) |
||
134 | |||
135 | /** |
||
136 | * {@inheritDoc} |
||
137 | */ |
||
138 | public function getFileSize($path) |
||
142 | |||
143 | /** |
||
144 | * {@inheritDoc} |
||
145 | */ |
||
146 | public function copyToLocalTemporaryFile($path) |
||
150 | |||
151 | /** |
||
152 | * {@inheritDoc} |
||
153 | */ |
||
154 | public function getService() |
||
155 | { |
||
156 | return $this->adapter->getService(); |
||
157 | } |
||
158 | |||
159 | /** |
||
160 | * Checks if a file exists, throws an error if it doesn't. |
||
161 | * |
||
162 | * @param $path |
||
163 | * @throws FileDoesNotExistException |
||
164 | */ |
||
165 | private function assertHasFile($path) |
||
171 | } |
||
172 |