|
@@ 243-255 (lines=13) @@
|
| 240 |
|
* @param bool $showHidden = false |
| 241 |
|
* @return string[] an array with the files and directories in the current directory. |
| 242 |
|
*/ |
| 243 |
|
public function listAll($recursive = false, $showHidden = false) |
| 244 |
|
{ |
| 245 |
|
$result = []; |
| 246 |
|
|
| 247 |
|
foreach ($this->listAllIterator($recursive, $showHidden) as $element) { |
| 248 |
|
$result[] = $element->getFilename(); |
| 249 |
|
} |
| 250 |
|
|
| 251 |
|
return $result; |
| 252 |
|
} |
| 253 |
|
|
| 254 |
|
/** |
| 255 |
|
* Returns an array with the directories in the current directory. |
| 256 |
|
* |
| 257 |
|
* @param bool $recursive = false |
| 258 |
|
* @param bool $showHidden = false |
|
@@ 261-275 (lines=15) @@
|
| 258 |
|
* @param bool $showHidden = false |
| 259 |
|
* @return string[] an array with the directories in the current directory. |
| 260 |
|
*/ |
| 261 |
|
public function listDirectories($recursive = false, $showHidden = false) |
| 262 |
|
{ |
| 263 |
|
$result = []; |
| 264 |
|
|
| 265 |
|
foreach ($this->listAllIterator($recursive, $showHidden) as $element) { |
| 266 |
|
if ($element->isDir()) { |
| 267 |
|
$result[] = $element->getFilename(); |
| 268 |
|
} |
| 269 |
|
} |
| 270 |
|
|
| 271 |
|
return $result; |
| 272 |
|
} |
| 273 |
|
|
| 274 |
|
/** |
| 275 |
|
* Returns an array with the files in the current directory. |
| 276 |
|
* |
| 277 |
|
* @param bool $recursive = false |
| 278 |
|
* @param bool $showHidden = false |
|
@@ 281-295 (lines=15) @@
|
| 278 |
|
* @param bool $showHidden = false |
| 279 |
|
* @return string[] an array with the files in the current directory. |
| 280 |
|
*/ |
| 281 |
|
public function listFiles($recursive = false, $showHidden = false) |
| 282 |
|
{ |
| 283 |
|
$result = []; |
| 284 |
|
|
| 285 |
|
foreach ($this->listAllIterator($recursive, $showHidden) as $element) { |
| 286 |
|
if ($element->isFile()) { |
| 287 |
|
$result[] = $element->getFilename(); |
| 288 |
|
} |
| 289 |
|
} |
| 290 |
|
|
| 291 |
|
return $result; |
| 292 |
|
} |
| 293 |
|
|
| 294 |
|
/** |
| 295 |
|
* Returns true if the file has been created. |
| 296 |
|
* |
| 297 |
|
* @param bool $override = false |
| 298 |
|
* @return bool true if the file has been created. |