ILIAS
release_8 Revision v8.23
◀ ilDoc Overview
FactoriesCrawler.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
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\FactoriesCrawler\__construct
__construct()
Definition:
FactoriesCrawler.php:34
ILIAS\UI\Implementation\Crawler\FactoriesCrawler
Definition:
FactoriesCrawler.php:29
ILIAS\UI\Implementation\Crawler\EntriesYamlParser
Definition:
EntriesYamlParser.php:30
ILIAS\UI\Implementation\Crawler\Entry
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
AbstractEntryPart.php:21
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\Exception\Factory
Definition:
Factory.php:23
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\$ef
Exception Factory $ef
Definition:
FactoriesCrawler.php:32
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\$parser
EntriesYamlParser $parser
Definition:
FactoriesCrawler.php:31
ILIAS\UI\Implementation\Crawler
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
Crawler.php:21
Exception
src
UI
Implementation
Crawler
FactoriesCrawler.php
Generated on Sun Aug 31 2025 22:02:50 for ILIAS by
1.8.13 (using
Doxyfile
)