20        "copage" => array(
"class" => 
"ilCOPageDefReader")
 
   45        foreach ($this->readers as $k => 
$reader) {
 
   47            $this->readers[$k][
"reader"] = 
new $class($this->db);
 
   50        $this->name = $a_name;
 
   58        xml_set_object($a_xml_parser, $this);
 
   59        xml_set_element_handler($a_xml_parser, 
'handlerBeginTag', 
'handlerEndTag');
 
   60        xml_set_character_data_handler($a_xml_parser, 
'handlerCharacterData');
 
   68        $this->db->manipulate(
"DELETE FROM il_object_def");
 
   70        $this->db->manipulate(
"DELETE FROM il_object_subobj");
 
   72        $this->db->manipulate(
"DELETE FROM il_object_group");
 
   74        $this->db->manipulate(
"DELETE FROM il_pluginslot");
 
   76        $this->db->manipulate(
"DELETE FROM il_component");
 
   81        $this->db->manipulate(
"DELETE FROM il_event_handling WHERE component NOT LIKE 'Plugins/%'");
 
   83        $this->db->manipulate(
"DELETE FROM il_object_sub_type");
 
   85        foreach ($this->readers as $k => 
$reader) {
 
   86            $this->readers[$k][
"reader"]->clearTables();
 
   95        $this->db->manipulateF(
 
   96            "DELETE FROM il_object_def WHERE id = %s",
 
  101        $this->db->manipulateF(
 
  102            "DELETE FROM il_object_subobj WHERE parent = %s OR subobj = %s",
 
  103            array(
"text", 
"text"),
 
  117        $this->current_tag = $a_name;
 
  120        if (isset($this->readers[$a_name])) {
 
  121            $this->current_reader = $a_name;
 
  125        if ($this->current_reader != 
"") {
 
  130                $this->current_component
 
  138                    if (($a_attribs[
"repository"] ?? 
null) === 
null) {
 
  139                        $a_attribs[
"repository"] = 
true;
 
  141                    if (($a_attribs[
"workspace"] ?? 
null) === 
null) {
 
  142                        $a_attribs[
"workspace"] = 
false;
 
  145                    $this->current_object = $a_attribs[
"id"];
 
  146                    $this->db->manipulateF(
 
  147                        "INSERT INTO il_object_def (id, class_name, component,location," .
 
  148                        "checkbox,inherit,translate,devmode,allow_link,allow_copy,rbac,default_pos," .
 
  149                        "default_pres_pos,sideblock,grp," . $this->db->quoteIdentifier(
'system') . 
",export,repository,workspace,administration," .
 
  150                        "amet,orgunit_permissions,lti_provider,offline_handling) VALUES " .
 
  151                        "(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)",
 
  152                        array(
"text", 
"text", 
"text", 
"text", 
"integer", 
"integer", 
"text", 
"integer",
"integer",
"integer",
 
  153                            "integer",
"integer",
"integer",
"integer", 
"text", 
"integer", 
"integer", 
"integer", 
"integer",
 
  154                            'integer',
'integer',
'integer',
'integer',
'integer'),
 
  157                            $a_attribs[
"class_name"],
 
  158                            $this->current_component,
 
  159                            $this->current_component . 
"/" . $a_attribs[
"dir"],
 
  160                            (
int) ($a_attribs[
"checkbox"] ?? 
null),
 
  161                            (
int) ($a_attribs[
"inherit"] ?? 
null),
 
  162                            $a_attribs[
"translate"] ?? 
null,
 
  163                            (
int) ($a_attribs[
"devmode"] ?? 
null),
 
  164                            (
int) ($a_attribs[
"allow_link"] ?? 
null),
 
  165                            (
int) ($a_attribs[
"allow_copy"] ?? 
null),
 
  166                            (
int) ($a_attribs[
"rbac"] ?? 
null),
 
  167                            (
int) ($a_attribs[
"default_pos"] ?? 
null),
 
  168                            (
int) ($a_attribs[
"default_pres_pos"] ?? 
null),
 
  169                            (
int) ($a_attribs[
"sideblock"] ?? 
null),
 
  170                            $a_attribs[
"group"] ?? 
null,
 
  171                            (
int) ($a_attribs[
"system"] ?? 
null),
 
  172                            (
int) ($a_attribs[
"export"] ?? 
null),
 
  173                            (
int) ($a_attribs[
"repository"] ?? 
null),
 
  174                            (
int) ($a_attribs[
"workspace"] ?? 
null),
 
  175                            (
int) ($a_attribs[
'administration'] ?? 
null),
 
  176                            (
int) ($a_attribs[
'amet'] ?? 
null),
 
  177                            (
int) ($a_attribs[
'orgunit_permissions'] ?? 
null),
 
  178                            (
int) ($a_attribs[
'lti_provider'] ?? 
null),
 
  179                            (
int) ($a_attribs[
'offline_handling'] ?? 
null)
 
  185                    $this->db->manipulateF(
 
  186                        "INSERT INTO il_object_subobj (parent, subobj, mmax) VALUES (%s,%s,%s)",
 
  187                        array(
"text", 
"text", 
"integer"),
 
  188                        array($this->current_object, $a_attribs[
"id"], (
int) ($a_attribs[
"max"] ?? 
null))
 
  193                    $this->db->manipulateF(
 
  194                        "INSERT INTO il_object_subobj (parent, subobj, mmax) VALUES (%s,%s,%s)",
 
  195                        array(
"text", 
"text", 
"integer"),
 
  196                        array($a_attribs[
"id"], $this->current_object, (
int) ($a_attribs[
"max"] ?? 
null))
 
  201                    $this->db->manipulateF(
 
  202                        "INSERT INTO il_object_group (id, name, default_pres_pos) VALUES (%s,%s,%s)",
 
  203                        array(
"text", 
"text", 
"integer"),
 
  204                        array($a_attribs[
"id"], $a_attribs[
"name"], $a_attribs[
"default_pres_pos"])
 
  209                    $this->current_object = $a_attribs[
"id"];
 
  210                    $q = 
"INSERT INTO il_pluginslot (component, id, name) VALUES (" .
 
  211                        $this->db->quote($this->current_component, 
"text") . 
"," .
 
  212                        $this->db->quote($a_attribs[
"id"], 
"text") . 
"," .
 
  213                        $this->db->quote($a_attribs[
"name"], 
"text") . 
")";
 
  214                    $this->db->manipulate($q);
 
  218                    $component = $a_attribs[
"component"] ?? 
null;
 
  220                        $component = $this->current_component;
 
  222                    $q = 
"INSERT INTO il_event_handling (component, type, id) VALUES (" .
 
  223                        $this->db->quote($component, 
"text") . 
"," .
 
  224                        $this->db->quote($a_attribs[
"type"], 
"text") . 
"," .
 
  225                        $this->db->quote($a_attribs[
"id"], 
"text") . 
")";
 
  226                    $this->db->manipulate($q);
 
  230                    $component = $a_attribs[
"component"] ?? 
null;
 
  232                        $component = $this->current_component;
 
  235                    $this->has_cron[$component][] = $a_attribs[
"id"];
 
  238                case 'mailtemplates':
 
  239                    $this->in_mail_templates = 
true;
 
  243                    if (!$this->in_mail_templates) {
 
  247                    $component = $a_attribs[
'component'] ?? 
null;
 
  249                        $component = $this->current_component;
 
  256                        $a_attribs[
'path'] ?? 
null 
  258                    $this->mail_templates_by_component[$component][] = $a_attribs[
"id"];
 
  262                    $this->db->manipulate(
"INSERT INTO il_object_sub_type " .
 
  263                        "(obj_type, sub_type, amet) VALUES (" .
 
  264                        $this->db->quote($this->current_object, 
"text") . 
"," .
 
  265                        $this->db->quote($a_attribs[
"id"], 
"text") . 
"," .
 
  266                        $this->db->quote($a_attribs[
"amet"], 
"integer") .
 
  272                    include_once 
'./Services/SystemCheck/classes/class.ilSCGroups.php';
 
  276                case 'systemcheck_task':
 
  277                    include_once 
'./Services/SystemCheck/classes/class.ilSCGroups.php';
 
  280                    include_once 
'./Services/SystemCheck/classes/class.ilSCTasks.php';
 
  282                    $tasks->updateFromComponentDefinition($a_attribs[
'identifier']);
 
  286                    require_once(
'./Services/WebAccessChecker/classes/class.ilWACSecurePath.php');
 
  291                        $ilWACSecurePath->setPath($a_attribs[
"path"]);
 
  292                        $ilWACSecurePath->create();
 
  294                    $ilWACSecurePath->setCheckingClass($a_attribs[
"checking-class"]);
 
  295                    $ilWACSecurePath->setInSecFolder((
bool) ($a_attribs[
"in-sec-folder"] ?? 
null));
 
  296                    $ilWACSecurePath->setComponentDirectory(dirname($this->xml_file));
 
  297                    $ilWACSecurePath->update();
 
  301                    include_once 
'./Services/Logging/classes/class.ilLogComponentLevels.php';
 
  306                    include_once 
"Services/Badge/classes/class.ilBadgeHandler.php";
 
  312                    require_once 
'./Services/PDFGeneration/classes/class.ilPDFCompInstaller.php';
 
  328        if ($this->current_reader != 
"") {
 
  331            if ($a_name == 
"module" || $a_name == 
"service") {
 
  333                    $this->current_component,
 
  334                    ($this->has_cron[$this->current_component] ?? [])
 
  339                if (!in_array($this->
getComponentId(), ($this->has_badges ?? []))) {
 
  340                    include_once 
"Services/Badge/classes/class.ilBadgeHandler.php";
 
  347        if (isset($this->readers[$a_name])) {
 
  348            $this->current_reader = 
null;
 
  363        $a_data = preg_replace(
"/\n/", 
"", $a_data);
 
  364        $a_data = preg_replace(
"/\t+/", 
"", $a_data);
 
  366        if (!empty($a_data)) {
 
  367            switch ($this->current_tag) {
 
  378        $this->component_id = $a_component_id;
 
static findOrFail($primary_key, array $add_constructor_args=array())
Tries to find the object and throws an Exception if object is not found, instead of returning null.
An exception for terminatinating execution or to throw for unit testing.
static updateFromXML($a_component_id)
Import component definition.
static updateFromXML($a_component, $a_id, $a_class, $a_path=null)
Process data from module.xml/service.xml.
static clearFromXML($a_component, array $a_xml_job_ids)
Clear job data.
static updateFromXML($a_component_id)
@global type $ilDB
static clearFromXml($a_component, array $a_new_templates)
static insertFromXML($a_component, $a_id, $a_class, $a_path)
Component definition reader (reads common tags in module.xml and service.xml files) Name is misleadin...
__construct($a_path, $a_name, $a_type, \ilDBInterface $db=null)
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class @access private
handlerCharacterData($a_xml_parser, $a_data)
end tag handler
handlerEndTag($a_xml_parser, $a_name)
End tag handler.
getComponentId()
Get component id.
deleteObjectDefinition($a_id)
Delete an object definition (this is currently needed for test cases)
setComponentId($a_component_id)
Set from module or service reader.
$mail_templates_by_component
clearTables()
clear the tables
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
Start tag handler.
static updateFromXML($service, $purpose, $preferred)
static getInstance()
Get singleton instance.
static getInstanceByGroupId($a_group_id)
Get singleton instance.
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc