ILIAS
release_8 Revision v8.19
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
j
l
m
p
s
t
u
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
RecursiveDirectoryIterator.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
ILIAS\Filesystem\Finder\Iterator
;
6
7
use
ILIAS\Filesystem\DTO\Metadata
;
8
use
ILIAS\Filesystem\Filesystem
;
9
use
ReturnTypeWillChange
;
10
11
/******************************************************************************
12
*
13
* This file is part of ILIAS, a powerful learning management system.
14
*
15
* ILIAS is licensed with the GPL-3.0, you should have received a copy
16
* of said license along with the source code.
17
*
18
* If this is not the case or you just want to try ILIAS, you'll find
19
* us at:
20
* https://www.ilias.de
21
* https://github.com/ILIAS-eLearning
22
*
23
*****************************************************************************/
24
30
class
RecursiveDirectoryIterator
implements
\RecursiveIterator
31
{
32
private
Filesystem
$filesystem
;
33
protected
string
$dir
;
35
protected
array
$files
= [];
36
42
public
function
__construct
(
Filesystem
$filesystem,
string
$dir)
43
{
44
$this->
filesystem
=
$filesystem
;
45
$this->dir =
$dir
;
46
}
47
51
public
function
key
()
52
{
53
return
key
($this->
files
);
54
}
55
59
public
function
next
(): void
60
{
61
next
($this->
files
);
62
}
63
67
public
function
current
():
Metadata
68
{
69
return
current
($this->
files
);
70
}
71
75
public
function
valid
(): bool
76
{
77
return
current
($this->
files
) instanceof
Metadata
;
78
}
79
83
public
function
rewind
(): void
84
{
85
$contents = $this->
filesystem
->listContents($this->dir,
false
);
86
$this->
files
= array_combine(array_map(
static
fn (
Metadata
$metadata):
string
=> $metadata->
getPath
(), $contents), $contents);
87
}
88
92
public
function
hasChildren
(): bool
93
{
94
return
$this->
current
()->isDir();
95
}
96
100
public
function
getChildren
(): \
ILIAS
\
Filesystem
\
Finder
\
Iterator
\
RecursiveDirectoryIterator
101
{
102
return
new
self
(
$this->filesystem
, $this->
current
()->getPath());
103
}
104
}
Metadata
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\__construct
__construct(Filesystem $filesystem, string $dir)
RecursiveDirectoryIterator constructor.
Definition:
RecursiveDirectoryIterator.php:42
Filesystem
ILIAS
Class ChatMainBarProvider .
ILIAS\Filesystem\DTO\Metadata\getPath
getPath()
The path to the file or directory.
Definition:
Metadata.php:56
ILIAS\Filesystem\Finder\Finder
Definition:
Finder.php:44
ILIAS\Filesystem\Finder\Finder\files
files()
Definition:
Finder.php:76
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\current
current()
Definition:
RecursiveDirectoryIterator.php:67
RecursiveDirectoryIterator
ILIAS\Repository\filesystem
filesystem()
Definition:
trait.GlobalDICDomainServices.php:76
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\next
next()
Definition:
RecursiveDirectoryIterator.php:59
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\$files
array $files
Definition:
RecursiveDirectoryIterator.php:35
ILIAS\Filesystem\DTO\Metadata
Class Metadata.
Definition:
Metadata.php:19
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\getChildren
getChildren()
Definition:
RecursiveDirectoryIterator.php:100
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\hasChildren
hasChildren()
Definition:
RecursiveDirectoryIterator.php:92
ReturnTypeWillChange
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\rewind
rewind()
Definition:
RecursiveDirectoryIterator.php:83
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\valid
valid()
Definition:
RecursiveDirectoryIterator.php:75
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\key
key()
Definition:
RecursiveDirectoryIterator.php:51
Iterator
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\$filesystem
Filesystem $filesystem
Definition:
RecursiveDirectoryIterator.php:32
Filesystem
Class FlySystemFileAccessTest disabled disabled disabled.
ILIAS\Filesystem\Finder\Iterator
Definition:
DateRangeFilterIterator.php:5
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\$dir
string $dir
Definition:
RecursiveDirectoryIterator.php:33
src
Filesystem
Finder
Iterator
RecursiveDirectoryIterator.php
Generated on Fri Apr 4 2025 22:03:11 for ILIAS by
1.8.13 (using
Doxyfile
)