ILIAS
trunk Revision v11.0_alpha-1689-g66c127b4ae8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
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
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
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
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
RecursiveDirectoryIterator.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Filesystem\Finder\Iterator
;
22
23
use
ILIAS\Filesystem\DTO\Metadata
;
24
use
ILIAS\Filesystem\Filesystem
;
25
31
class
RecursiveDirectoryIterator
implements
\RecursiveIterator
32
{
34
protected
array
$files
= [];
35
39
public
function
__construct
(
private
Filesystem
$filesystem,
protected
string
$dir)
40
{
41
}
42
46
public
function
key
():
int
|string
47
{
48
return
key
($this->
files
);
49
}
50
54
public
function
next
(): void
55
{
56
next
($this->
files
);
57
}
58
62
public
function
current
(): bool|
Metadata
63
{
64
return
current
($this->
files
);
65
}
66
70
public
function
valid
(): bool
71
{
72
return
current
($this->
files
) instanceof
Metadata
;
73
}
74
78
public
function
rewind
(): void
79
{
80
$contents = $this->
filesystem
->listContents($this->dir,
false
);
81
$this->
files
= array_combine(
82
array_map
(
static
fn(
Metadata
$metadata):
string
=> $metadata->
getPath
(), $contents),
83
$contents
84
);
85
}
86
90
public
function
hasChildren
(): bool
91
{
92
return
$this->
current
()->isDir();
93
}
94
98
public
function
getChildren
(): \
ILIAS
\
Filesystem
\
Finder
\
Iterator
\
RecursiveDirectoryIterator
99
{
100
return
new
self
($this->filesystem, $this->
current
()->getPath());
101
}
102
}
Metadata
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\__construct
__construct(private Filesystem $filesystem, protected string $dir)
RecursiveDirectoryIterator constructor.
Definition:
RecursiveDirectoryIterator.php:39
Filesystem
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS
Interface Observer Contains several chained tasks and infos about them.
Definition:
AccessControl.php:21
array_map
ILIAS\Filesystem\DTO\Metadata\getPath
getPath()
The path to the file or directory.
Definition:
Metadata.php:62
ILIAS\Filesystem\Finder\Finder
Definition:
Finder.php:52
ILIAS\Filesystem\Finder\Finder\files
files()
Definition:
Finder.php:87
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\current
current()
Definition:
RecursiveDirectoryIterator.php:62
RecursiveDirectoryIterator
ILIAS\Repository\filesystem
filesystem()
Definition:
trait.GlobalDICDomainServices.php:81
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\next
next()
Definition:
RecursiveDirectoryIterator.php:54
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\$files
array $files
Definition:
RecursiveDirectoryIterator.php:34
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\getChildren
getChildren()
Definition:
RecursiveDirectoryIterator.php:98
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\hasChildren
hasChildren()
Definition:
RecursiveDirectoryIterator.php:90
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\rewind
rewind()
Definition:
RecursiveDirectoryIterator.php:78
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\valid
valid()
Definition:
RecursiveDirectoryIterator.php:70
ILIAS\Filesystem\Finder\Iterator\RecursiveDirectoryIterator\key
key()
Definition:
RecursiveDirectoryIterator.php:46
Iterator
ServicesInterface
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
Filesystem
ILIAS\Filesystem\Finder\Iterator
Definition:
DateRangeFilterIterator.php:21
components
ILIAS
Filesystem
src
Finder
Iterator
RecursiveDirectoryIterator.php
Generated on Wed Apr 2 2025 23:02:52 for ILIAS by
1.8.13 (using
Doxyfile
)