19declare(strict_types=1);
31 $this->processors = $processor;
40 foreach ($this->processors as $p) {
53 foreach ($this->processors as $processor) {
54 $processor->beginComponent($component,
$type);
57 foreach ($this->processors as $processor) {
58 $processor->endComponent($component,
$type);
65 if (!file_exists(
$path)) {
66 throw new \InvalidArgumentException(
67 "Cannot find file $path."
70 return file_get_contents(
$path);
77 $xml_parser = xml_parser_create(
"UTF-8");
78 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING,
false);
79 xml_set_object($xml_parser, $this);
80 xml_set_element_handler($xml_parser,
'beginTag',
'endTag');
81 if (!xml_parse($xml_parser,
$xml)) {
82 $code = xml_get_error_code($xml_parser);
83 $line = xml_get_current_line_number($xml_parser);
84 $col = xml_get_current_column_number($xml_parser);
85 $msg = xml_error_string($code);
86 throw new \InvalidArgumentException(
87 "Error $code component xml of $type/$component, on line $line in column $col: $msg"
92 xml_parser_free($xml_parser);
99 foreach ($this->processors as $processor) {
106 foreach ($this->processors as $processor) {
107 $processor->endTag(
$name);
129 $dir = __DIR__ .
"/../../../" .
$type;
134 realpath($dir .
"/" .
$c .
"/" .
$name)
144 $dir = opendir($root);
145 while ($sub = readdir($dir)) {
146 if ($sub ===
"." || $sub ===
"..") {
149 if (!is_dir($root .
"/" . $sub)) {
152 if (!is_file($root .
"/" . $sub .
"/" .
$name)) {
getComponentPaths(string $root, string $name)
beginTag($_, string $name, array $attributes)
readComponentDefinitions()
This reads the component.xml of all components in the core and processes them with the provided proce...
__construct(ilComponentDefinitionProcessor ... $processor)
getComponentInfo(string $type, string $name)
purge()
This methods is supposed to purge existing data in the registered processor.
parseComponentXML(string $type, string $component, string $xml)
An ilComponentDefinitionProcessor processes some attributes from a component.xml (i....