ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ 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
$this->parser =
new
EntriesYamlParser
();
29
$this->ef =
new
Exception\Factory
();
30
}
31
35
public
function
crawlFactory
($factoryPath,
Entry
\ComponentEntry $parent = null,$depth=0){
36
$depth++;
37
if
($depth > 30){
38
throw
$this->ef->exception(
Exception
\CrawlerException::CRAWL_MAX_NESTING_REACHED,
" Current Path: "
.$factoryPath.
" Parent: "
.$parent->getId());
39
}
40
$entries = $this->parser->parseEntriesFromFile($factoryPath);
41
42
$children =
new
Entry\ComponentEntries
();
43
44
foreach
($entries as $entry){
45
if
($entry->isAbstract()){
46
$children->addEntries($this->
crawlFactory
($entry->getPath().
".php"
,$entry,$depth));
47
}
48
if
($parent){
49
$entry->setParent($parent->getId());
50
$parent->addChild($entry->getId());
51
}
52
}
53
$entries->addEntries($children);
54
return
$entries;
55
}
56
57
58
}
59
?>
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:13
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:8
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:35
php
ILIAS\UI\Implementation\Crawler
Definition:
Crawler.php:5
Exception
src
UI
Implementation
Crawler
FactoriesCrawler.php
Generated on Fri Jan 17 2025 19:01:21 for ILIAS by
1.8.13 (using
Doxyfile
)