| @@ 207-219 (lines=13) @@ | ||
| 204 | * @param bool $showHidden = false |
|
| 205 | * @return string[] an array with the files and directories in the current directory. |
|
| 206 | */ |
|
| 207 | public function listAll($recursive = false, $showHidden = false) |
|
| 208 | { |
|
| 209 | // Init |
|
| 210 | $result = []; |
|
| 211 | ||
| 212 | // List all |
|
| 213 | foreach ($this->listAllIterator($recursive, $showHidden) as $element) { |
|
| 214 | $result[] = $element->getFilename(); |
|
| 215 | } |
|
| 216 | ||
| 217 | // Return all |
|
| 218 | return $result; |
|
| 219 | } |
|
| 220 | ||
| 221 | /** |
|
| 222 | * Returns an array with the directories in the current directory. |
|
| @@ 228-242 (lines=15) @@ | ||
| 225 | * @param bool $showHidden = false |
|
| 226 | * @return string[] an array with the directories in the current directory. |
|
| 227 | */ |
|
| 228 | public function listDirectories($recursive = false, $showHidden = false) |
|
| 229 | { |
|
| 230 | // Init |
|
| 231 | $result = []; |
|
| 232 | ||
| 233 | // List directories |
|
| 234 | foreach ($this->listAllIterator($recursive, $showHidden) as $element) { |
|
| 235 | if ($element->isDir()) { |
|
| 236 | $result[] = $element->getFilename(); |
|
| 237 | } |
|
| 238 | } |
|
| 239 | ||
| 240 | // Return directories |
|
| 241 | return $result; |
|
| 242 | } |
|
| 243 | ||
| 244 | /** |
|
| 245 | * Returns an array with the files in the current directory. |
|
| @@ 251-265 (lines=15) @@ | ||
| 248 | * @param bool $showHidden = false |
|
| 249 | * @return string[] an array with the files in the current directory. |
|
| 250 | */ |
|
| 251 | public function listFiles($recursive = false, $showHidden = false) |
|
| 252 | { |
|
| 253 | // Init |
|
| 254 | $result = []; |
|
| 255 | ||
| 256 | // List files |
|
| 257 | foreach ($this->listAllIterator($recursive, $showHidden) as $element) { |
|
| 258 | if ($element->isFile()) { |
|
| 259 | $result[] = $element->getFilename(); |
|
| 260 | } |
|
| 261 | } |
|
| 262 | ||
| 263 | // Return files |
|
| 264 | return $result; |
|
| 265 | } |
|
| 266 | ||
| 267 | /** |
|
| 268 | * Returns true if the file has been created. |
|