ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ 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
p
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
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
q
r
s
t
u
v
w
x
z
+
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
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
▼
ILIAS
Test List
Todo List
Deprecated List
►
Modules
►
Namespaces
►
Data Structures
▼
Files
►
File List
►
Globals
►
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
RecursiveDirectoryIterator.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types=1);
3
4
namespace
ILIAS\Filesystem\Finder\Iterator
;
5
6
use
ILIAS\Filesystem\DTO\Metadata
;
7
use
ILIAS\Filesystem\Filesystem
;
8
14
class
RecursiveDirectoryIterator
implements
\RecursiveIterator
15
{
17
private
$filesystem
;
18
20
protected
$dir
;
21
23
protected
$files
= [];
24
30
public
function
__construct
(
Filesystem
$filesystem
,
string
$dir
)
31
{
32
$this->filesystem =
$filesystem
;
33
$this->dir =
$dir
;
34
}
35
39
public
function
key
()
40
{
41
return
key
($this->
files
);
42
}
43
47
public
function
next
()
48
{
49
next
($this->
files
);
50
}
51
56
public
function
current
()
57
{
58
return
current
($this->
files
);
59
}
60
64
public
function
valid
()
65
{
66
return
$this->
current
() instanceof
Metadata
;
67
}
68
72
public
function
rewind
()
73
{
74
$contents = $this->filesystem->listContents($this->dir,
false
);
75
$this->
files
= array_combine(array_map(
function
(
Metadata
$metadata) {
76
return
$metadata->
getPath
();
77
}, $contents), $contents);
78
}
79
83
public
function
hasChildren
()
84
{
85
return
$this->
current
()->isDir();
86
}
87
91
public
function
getChildren
()
92
{
93
return
new
self
(
$this->filesystem
, $this->
current
()->getPath());
94
}
95
}
Metadata
RecursiveIterator
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\__construct
__construct(Filesystem $filesystem, string $dir)
RecursiveDirectoryIterator constructor.
Definition:
RecursiveDirectoryIterator.php:30
Filesystem
ILIAS\Filesystem\DTO\Metadata\getPath
getPath()
The path to the file or directory.
Definition:
Metadata.php:53
ILIAS\Filesystem\Finder\Finder\files
files()
Definition:
Finder.php:71
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\current
current()
Definition:
RecursiveDirectoryIterator.php:56
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\next
next()
Definition:
RecursiveDirectoryIterator.php:47
ILIAS\Filesystem\DTO\Metadata
Class Metadata This class holds all default metadata send by the filesystem adapters.
Definition:
Metadata.php:16
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\getChildren
getChildren()
Definition:
RecursiveDirectoryIterator.php:91
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\$files
$files
Definition:
RecursiveDirectoryIterator.php:23
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\$filesystem
$filesystem
Definition:
RecursiveDirectoryIterator.php:17
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\hasChildren
hasChildren()
Definition:
RecursiveDirectoryIterator.php:83
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator
Definition:
RecursiveDirectoryIterator.php:14
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\rewind
rewind()
Definition:
RecursiveDirectoryIterator.php:72
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\$dir
$dir
Definition:
RecursiveDirectoryIterator.php:20
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\valid
valid()
Definition:
RecursiveDirectoryIterator.php:64
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\key
key()
Definition:
RecursiveDirectoryIterator.php:39
Filesystem
Class FlySystemFileAccessTest disabled disabled disabled.
ILIAS\Filesystem\Finder\Iterator
Definition:
DateRangeFilterIterator.php:4
src
Filesystem
Finder
Iterator
RecursiveDirectoryIterator.php
Generated on Thu Apr 3 2025 21:01:35 for ILIAS by
1.8.13 (using
Doxyfile
)