ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPluginReader Class Reference

Class ilPluginReader. More...

+ Inheritance diagram for ilPluginReader:
+ Collaboration diagram for ilPluginReader:

Public Member Functions

 __construct ($a_path, $a_ctype, $a_cname, $a_slot_id, $a_pname)
 
 clearEvents ()
 Delete the event listeneing information. More...
 
 startParsing ()
 
 setHandlers ($a_xml_parser)
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 start tag handler More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 end tag handler More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 end tag handler More...
 
- Public Member Functions inherited from ilSaxParser
 __construct ($a_xml_file='', $throwException=false)
 Constructor setup ILIAS global object public. More...
 
 setXMLContent ($a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 create parser More...
 
 setOptions ($a_xml_parser)
 set parser options More...
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private More...
 
 openXMLFile ()
 open xml file More...
 
 parse ($a_xml_parser, $a_fp=null)
 parse xml file More...
 
 freeParser ($a_xml_parser)
 free xml parser handle More...
 
 setThrowException ($throwException)
 set error handling More...
 
- Public Member Functions inherited from PEAR
 __construct ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes. More...
 
 isError ($data, $code=null)
 Tell whether a value is a PEAR error. More...
 
 expectError ($code=' *')
 This method is used to tell which errors you expect to get. More...
 
 popExpect ()
 This method pops one element off the expected error codes stack. More...
 
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available. More...
 
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack. More...
 
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. More...
 
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options. More...
 
 staticPushErrorHandling ($mode, $options=null)
 
 staticPopErrorHandling ()
 
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack. More...
 
 popErrorHandling ()
 Pop the last error handler used. More...
 
 loadExtension ($ext)
 OS independant PHP extension load. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PEAR
static & getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. More...
 
static setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. More...
 
- Data Fields inherited from ilSaxParser
 $input_type = null
 
 $xml_content = ''
 
 $ilias
 
 $lng
 
 $xml_file
 
 $throwException = false
 
- Data Fields inherited from PEAR
 $_debug = false
 
 $_default_error_mode = null
 
 $_default_error_options = null
 
 $_default_error_handler = ''
 
 $_error_class = 'PEAR_Error'
 
 $_expected_errors = array()
 
- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle More...
 

Detailed Description

Class ilPluginReader.

Reads plugin information of plugin.xml files into db

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilPluginReader.php.

Constructor & Destructor Documentation

◆ __construct()

ilPluginReader::__construct (   $a_path,
  $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Definition at line 17 of file class.ilPluginReader.php.

18  {
19  parent::__construct($a_path);
20 
21  $this->ctype = $a_ctype;
22  $this->cname = $a_cname;
23  $this->slot_id = $a_slot_id;
24  $this->pname = $a_pname;
25  }

Member Function Documentation

◆ clearEvents()

ilPluginReader::clearEvents ( )

Delete the event listeneing information.

Definition at line 30 of file class.ilPluginReader.php.

References $DIC, and $ilDB.

31  {
32  global $DIC;
33  $ilDB = $DIC->database();
34 
35  $component = "Plugins/" . $this->pname;
36  $ilDB->manipulate("DELETE FROM il_event_handling WHERE component = " . $ilDB->quote($component, 'text'));
37  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ handlerBeginTag()

ilPluginReader::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

start tag handler

Parameters
ressouceinternal xml_parser_handler
stringelement tag name
arrayelement attributes private

Definition at line 66 of file class.ilPluginReader.php.

References $DIC, and $ilDB.

67  {
68  global $DIC;
69  $ilDB = $DIC->database();
70 
71  switch ($a_name) {
72  // base plugin info is still read from the plugin.php
73  case 'plugin_tag_analyzed_in_future':
74 
75  // check whether record exists
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);
97  } else {
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") .
103  " WHERE " .
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);
109  }
110  break;
111 
112  case "event":
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);
119  break;
120  }
121  }
global $DIC
Definition: saml.php:7
global $ilDB

◆ handlerCharacterData()

ilPluginReader::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

end tag handler

Parameters
ressouceinternal xml_parser_handler
stringdata private

Definition at line 142 of file class.ilPluginReader.php.

143  {
144  // DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA
145  $a_data = preg_replace("/\n/", "", $a_data);
146  $a_data = preg_replace("/\t+/", "", $a_data);
147 
148  if (!empty($a_data)) {
149  switch ($this->current_tag) {
150  case '':
151  }
152  }
153  }

◆ handlerEndTag()

ilPluginReader::handlerEndTag (   $a_xml_parser,
  $a_name 
)

end tag handler

Parameters
ressouceinternal xml_parser_handler
stringelement tag name private

Definition at line 130 of file class.ilPluginReader.php.

131  {
132  }

◆ setHandlers()

ilPluginReader::setHandlers (   $a_xml_parser)

Definition at line 51 of file class.ilPluginReader.php.

52  {
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');
56  }

◆ startParsing()

ilPluginReader::startParsing ( )

Definition at line 40 of file class.ilPluginReader.php.

References ilSaxParser\getInputType().

41  {
42  if ($this->getInputType() == 'file') {
43  if (!file_exists($this->xml_file)) {
44  // not every plugin has a plugin.xml yet
45  return;
46  }
47  }
48  parent::startParsing();
49  }
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: