ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ 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
}
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\FactoriesCrawler
Definition:
FactoriesCrawler.php:12
Symfony\Component\Yaml
Definition:
Dumper.php:12
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:14
ILIAS\UI\Implementation\Crawler\EntriesYamlParser
Definition:
EntriesYamlParser.php:12
ILIAS\UI\Implementation\Crawler\Entry
Definition:
AbstractEntryPart.php:4
ILIAS\UI\Implementation\Crawler\Exception\Factory
Definition:
Factory.php:7
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
php
ILIAS\UI\Implementation\Crawler
Definition:
Crawler.php:5
Exception
src
UI
Implementation
Crawler
FactoriesCrawler.php
Generated on Thu Jan 16 2025 19:02:38 for ILIAS by
1.8.13 (using
Doxyfile
)