ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
FactoriesCrawler.php
Go to the documentation of this file.
1
<?
php
2
/***
3
* @author Timon Amstutz <timon.amstutz@ilub.unibe.ch>
4
* @version $Id$
5
*
6
*/
7
namespace
ILIAS\UI\Implementation\Crawler
;
8
9
use Symfony\Component\Yaml;
10
use
ILIAS\UI\Implementation\Crawler\Entry
as
Entry
;
11
12
class
FactoriesCrawler
implements
Crawler
13
{
17
protected
$parser
=
null
;
18
22
protected
$ef
=
null
;
23
27
public
function
__construct
()
28
{
29
$this->parser =
new
EntriesYamlParser
();
30
$this->ef =
new
Exception\Factory
();
31
}
32
36
public
function
crawlFactory
($factoryPath,
Entry
\ComponentEntry $parent =
null
, $depth = 0)
37
{
38
$depth++;
39
if
($depth > 30) {
40
throw
$this->ef->exception(Exception\CrawlerException::CRAWL_MAX_NESTING_REACHED,
" Current Path: "
. $factoryPath .
" Parent: "
. $parent->getId());
41
}
42
$entries = $this->parser->parseEntriesFromFile($factoryPath);
43
44
$children =
new
Entry\ComponentEntries
();
45
46
foreach
($entries as $entry) {
47
if
($entry->isAbstract()) {
48
$children->addEntries($this->
crawlFactory
($entry->getPath() .
".php"
, $entry, $depth));
49
}
50
if
($parent) {
51
$entry->setParent($parent->getId());
52
$parent->addChild($entry->getId());
53
}
54
}
55
$entries->addEntries($children);
56
return
$entries;
57
}
58
}
php
An exception for terminatinating execution or to throw for unit testing.
ILIAS\UI\Implementation\Crawler\EntriesYamlParser
Definition:
EntriesYamlParser.php:13
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:15
ILIAS\UI\Implementation\Crawler\Exception\Factory
Definition:
Factory.php:8
ILIAS\UI\Implementation\Crawler\FactoriesCrawler
Definition:
FactoriesCrawler.php:13
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\crawlFactory
crawlFactory($factoryPath, Entry\ComponentEntry $parent=null, $depth=0)
Starts with the factory indicated by factory path and crawles form this point all all subsequent fact...
Definition:
FactoriesCrawler.php:36
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\__construct
__construct()
FactoryCrawler constructor.
Definition:
FactoriesCrawler.php:27
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\$ef
$ef
Definition:
FactoriesCrawler.php:22
ILIAS\UI\Implementation\Crawler\FactoriesCrawler\$parser
$parser
Definition:
FactoriesCrawler.php:17
ILIAS\UI\Implementation\Crawler\Entry
Definition:
AbstractEntryPart.php:4
ILIAS\UI\Implementation\Crawler
Definition:
Crawler.php:5
src
UI
Implementation
Crawler
FactoriesCrawler.php
Generated on Sat Oct 4 2025 20:01:13 for ILIAS by
1.9.4 (using
Doxyfile
)