1 | <?php |
||
21 | class Filesystem extends \Symfony\Component\Filesystem\Filesystem |
||
22 | { |
||
23 | /** |
||
24 | * Build an absolute file or directory path separated by the OS specific directory separator. |
||
25 | * |
||
26 | * @param string ...$pathFragments |
||
27 | * |
||
28 | * @return string |
||
29 | */ |
||
30 | 185 | public function absolutePath($pathFragments) |
|
42 | |||
43 | /** |
||
44 | * Build a file or directory path separated by the OS specific directory separator. |
||
45 | * |
||
46 | * @param string ...$pathFragments |
||
47 | * |
||
48 | * @return string |
||
49 | */ |
||
50 | 58 | public function appendPath($pathFragments) |
|
54 | |||
55 | /** |
||
56 | * Copy a file or folder recursively. |
||
57 | * |
||
58 | * @param string $originFile The original filename |
||
59 | * @param string $targetFile The target filename |
||
60 | * @param bool $overwriteNewerFiles If true, target files newer than origin files are overwritten |
||
61 | * |
||
62 | * @throws FileNotFoundException When originFile doesn't exist |
||
63 | * @throws IOException When copy fails |
||
64 | */ |
||
65 | public function copy($originFile, $targetFile, $overwriteNewerFiles = false) |
||
94 | |||
95 | /** |
||
96 | * Create an instance of stakx's File object with relative path information. |
||
97 | * |
||
98 | * @param string $filePath |
||
99 | * |
||
100 | * @return File |
||
101 | */ |
||
102 | public function createFileObject($filePath) |
||
110 | |||
111 | /** |
||
112 | * Strip the current working directory from an absolute path. |
||
113 | * |
||
114 | * @param string $path An absolute path |
||
115 | * |
||
116 | * @return string |
||
117 | */ |
||
118 | 115 | public function getRelativePath($path) |
|
122 | |||
123 | /** |
||
124 | * Get the name of a given file without the extension. |
||
125 | * |
||
126 | * @param string $filePath A file path |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | 55 | public function getBaseName($filePath) |
|
134 | |||
135 | /** |
||
136 | * Get the name of a given file. |
||
137 | * |
||
138 | * @param string $filePath A file path |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | 63 | public function getFileName($filePath) |
|
146 | |||
147 | /** |
||
148 | * Get the parent directory of a given file. |
||
149 | * |
||
150 | * @param string $filePath A file path |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | 135 | public function getFolderPath($filePath) |
|
158 | |||
159 | /** |
||
160 | * Get the extension of a given file. |
||
161 | * |
||
162 | * @param string $filename A file path |
||
163 | * |
||
164 | * @return string The extension of the file |
||
165 | */ |
||
166 | 158 | public function getExtension($filename) |
|
170 | |||
171 | /** |
||
172 | * Check whether or not if a given path is a directory. |
||
173 | * |
||
174 | * @param string $folderPath |
||
175 | * |
||
176 | * @return bool |
||
177 | */ |
||
178 | 12 | public function isDir($folderPath) |
|
182 | |||
183 | /** |
||
184 | * Check whether or not a given path is a file. |
||
185 | * |
||
186 | * @param string $filePath |
||
187 | * |
||
188 | * @return bool |
||
189 | */ |
||
190 | public function isFile($filePath) |
||
194 | |||
195 | /** |
||
196 | * Check whether a given file path is a symlink |
||
197 | * |
||
198 | * @param string $filePath |
||
199 | * |
||
200 | * @return bool |
||
201 | */ |
||
202 | 11 | public function isSymlink($filePath) |
|
206 | |||
207 | /** |
||
208 | * Only read a file's contents if it's within the current working directory |
||
209 | * |
||
210 | * @param string $filePath |
||
211 | * |
||
212 | * @return bool|string |
||
213 | */ |
||
214 | 36 | public function safeReadFile($filePath) |
|
236 | |||
237 | /** |
||
238 | * Get the full path to the file without the extension. |
||
239 | * |
||
240 | * @param string $filename A file path |
||
241 | * |
||
242 | * @return string |
||
243 | */ |
||
244 | 4 | public function removeExtension($filename) |
|
251 | |||
252 | public function path($path) |
||
256 | } |
||
257 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.