ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
FactoriesCrawler.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\UI\Implementation\Crawler
;
22
23
use
ILIAS\UI\Implementation\Crawler\Entry
as
Entry
;
24
25
/***
26
* @author Timon Amstutz <timon.amstutz@ilub.unibe.ch>
27
* @version $Id$
28
*/
29
class
FactoriesCrawler
implements
Crawler
30
{
31
protected
?
EntriesYamlParser
$parser
=
null
;
32
protected
?
Exception\Factory
$ef
=
null
;
33
34
public
function
__construct
()
35
{
36
$this->parser =
new
EntriesYamlParser
();
37
$this->ef =
new
Exception\Factory
();
38
}
39
43
public
function
crawlFactory
(
44
string
$factoryPath,
45
?
Entry
\ComponentEntry $parent =
null
,
46
int
$depth = 0
47
):
Entry
\ComponentEntries {
48
$depth++;
49
if
($depth > 30) {
50
throw
$this->ef->exception(Exception\CrawlerException::CRAWL_MAX_NESTING_REACHED,
" Current Path: "
. $factoryPath .
" Parent: "
. $parent->getId());
51
}
52
$entries = $this->parser->parseEntriesFromFile($factoryPath);
53
54
$children =
new
Entry\ComponentEntries
();
55
56
foreach
($entries as $entry) {
57
if
($entry->isAbstract()) {
58
$children->addEntries($this->
crawlFactory
($entry->getPath() .
".php"
, $entry, $depth));
59
}
60
if
($parent) {
61
$entry->setParent($parent->getId());
62
$parent->addChild($entry->getId());
63
}
64
}
65
$entries->addEntries($children);
66
return
$entries;
67
}
68
}
ILIAS\UI\Implementation\Crawler\EntriesYamlParser
Definition:
EntriesYamlParser.php:31
ILIAS\UI\Implementation\Crawler\Entry\ComponentEntries
Container storing a list of UI Component Entries, can act as Iterator, countable and is serializable.
Definition:
ComponentEntries.php:35
ILIAS\UI\Implementation\Crawler\Exception\Factory
Definition:
Factory.php:24
ILIAS\UI\Implementation\Crawler\FactoriesCrawler
Definition:
FactoriesCrawler.php:30
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\__construct
__construct()
Definition:
FactoriesCrawler.php:34
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\$parser
EntriesYamlParser $parser
Definition:
FactoriesCrawler.php:31
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\crawlFactory
crawlFactory(string $factoryPath, ?Entry\ComponentEntry $parent=null, int $depth=0)
Starts with the factory indicated by factory path and crawles form this point all subsequent factorie...
Definition:
FactoriesCrawler.php:43
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\$ef
Exception Factory $ef
Definition:
FactoriesCrawler.php:32
ILIAS\UI\Implementation\Crawler\Entry
Definition:
AbstractEntryPart.php:21
ILIAS\UI\Implementation\Crawler
Definition:
Crawler.php:21
components
ILIAS
UI
src
Implementation
Crawler
FactoriesCrawler.php
Generated on Sat Oct 18 2025 23:04:41 for ILIAS by
1.9.4 (using
Doxyfile
)