4 include_once(
"./Services/Xml/classes/class.ilSaxParser.php");
17 public function __construct($a_path, $a_ctype, $a_cname, $a_slot_id, $a_pname)
19 parent::__construct($a_path);
21 $this->ctype = $a_ctype;
22 $this->cname = $a_cname;
23 $this->slot_id = $a_slot_id;
24 $this->pname = $a_pname;
33 $ilDB = $DIC->database();
35 $component =
"Plugins/" . $this->pname;
36 $ilDB->manipulate(
"DELETE FROM il_event_handling WHERE component = " .
$ilDB->quote($component,
'text'));
43 if (!file_exists($this->xml_file)) {
48 parent::startParsing();
53 xml_set_object($a_xml_parser, $this);
54 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
55 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
69 $ilDB = $DIC->database();
73 case 'plugin_tag_analyzed_in_future':
76 $q =
"SELECT * FROM il_plugin WHERE " .
77 " component_type = " .
$ilDB->quote($this->ctype,
"text") .
78 " AND component_name = " .
$ilDB->quote($this->cname,
"text") .
79 " AND slot_id = " .
$ilDB->quote($this->slot_id,
"text") .
80 " AND name = " .
$ilDB->quote($this->pname,
"text");
81 $set =
$ilDB->query($q);
82 if (
$ilDB->numRows($set) == 0) {
83 $q =
"INSERT INTO il_plugin (component_type,component_name,slot_id," .
84 "name, id, last_update_version, current_version, ilias_min_version," .
85 " ilias_max_version, active) VALUES " .
86 "(" .
$ilDB->quote($this->ctype,
"text") .
"," .
87 $ilDB->quote($this->cname,
"text") .
"," .
88 $ilDB->quote($this->slot_id,
"text") .
"," .
89 $ilDB->quote($this->pname,
"text") .
"," .
90 $ilDB->quote($a_attribs[
"id"],
"text") .
"," .
91 $ilDB->quote(
"0.0.0",
"text") .
"," .
92 $ilDB->quote($a_attribs[
"version"],
"text") .
"," .
93 $ilDB->quote($a_attribs[
"ilias_min_version"],
"text") .
"," .
94 $ilDB->quote($a_attribs[
"ilias_max_version"],
"text") .
"," .
95 $ilDB->quote(0,
"integer") .
")";
96 $ilDB->manipulate($q);
98 $q =
"UPDATE il_plugin SET " .
99 " id = " .
$ilDB->quote($a_attribs[
"id"],
"text") .
"," .
100 " current_version = " .
$ilDB->quote($a_attribs[
"version"],
"text") .
"," .
101 " ilias_min_version = " .
$ilDB->quote($a_attribs[
"ilias_min_version"],
"text") .
"," .
102 " ilias_max_version = " .
$ilDB->quote($a_attribs[
"ilias_max_version"],
"text") .
104 " component_type = " .
$ilDB->quote($this->ctype,
"text") .
105 " AND component_name = " .
$ilDB->quote($this->cname,
"text") .
106 " AND slot_id = " .
$ilDB->quote($this->slot_id,
"text") .
107 " AND name = " .
$ilDB->quote($this->pname,
"text");
108 $ilDB->manipulate($q);
113 $component =
"Plugins/" . $this->pname;
114 $q =
"INSERT INTO il_event_handling (component, type, id) VALUES (" .
115 $ilDB->quote($component,
"text") .
"," .
116 $ilDB->quote($a_attribs[
"type"],
"text") .
"," .
117 $ilDB->quote($a_attribs[
"id"],
"text") .
")";
118 $ilDB->manipulate($q);
145 $a_data = preg_replace(
"/\n/",
"", $a_data);
146 $a_data = preg_replace(
"/\t+/",
"", $a_data);
148 if (!empty($a_data)) {
149 switch ($this->current_tag) {
setHandlers($a_xml_parser)
__construct($a_path, $a_ctype, $a_cname, $a_slot_id, $a_pname)
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
handlerEndTag($a_xml_parser, $a_name)
end tag handler
clearEvents()
Delete the event listeneing information.
handlerCharacterData($a_xml_parser, $a_data)
end tag handler
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
start tag handler