ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
 
 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 18 of file class.ilPluginReader.php.

19  {
20  parent::__construct($a_path);
21 
22 die("Deprecated. Plugin information is stored in plugin.php");
23 
24  $this->ctype = $a_ctype;
25  $this->cname = $a_cname;
26  $this->slot_id = $a_slot_id;
27  $this->pname = $a_pname;
28  }

Member Function Documentation

◆ 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 50 of file class.ilPluginReader.php.

References $ilDB.

51  {
52  global $ilDB;
53 
54  switch ($a_name)
55  {
56  case 'plugin':
57 
58  // check whether record exists
59  $q = "SELECT * FROM il_plugin WHERE ".
60  " component_type = ".$ilDB->quote($this->ctype, "text").
61  " AND component_name = ".$ilDB->quote($this->cname, "text").
62  " AND slot_id = ".$ilDB->quote($this->slot_id, "text").
63  " AND name = ".$ilDB->quote($this->pname, "text");
64  $set = $ilDB->query($q);
65  if ($ilDB->numRows($set) == 0)
66  {
67  $q = "INSERT INTO il_plugin (component_type,component_name,slot_id,".
68  "name, id, last_update_version, current_version, ilias_min_version,".
69  " ilias_max_version, active) VALUES ".
70  "(".$ilDB->quote($this->ctype, "text").",".
71  $ilDB->quote($this->cname, "text").",".
72  $ilDB->quote($this->slot_id, "text").",".
73  $ilDB->quote($this->pname, "text").",".
74  $ilDB->quote($a_attribs["id"], "text").",".
75  $ilDB->quote("0.0.0", "text").",".
76  $ilDB->quote($a_attribs["version"], "text").",".
77  $ilDB->quote($a_attribs["ilias_min_version"], "text").",".
78  $ilDB->quote($a_attribs["ilias_max_version"], "text").",".
79  $ilDB->quote(0, "integer").")";
80  $ilDB->manipulate($q);
81  }
82  else
83  {
84  $q = "UPDATE il_plugin SET ".
85  " id = ".$ilDB->quote($a_attribs["id"], "text").",".
86  " current_version = ".$ilDB->quote($a_attribs["version"], "text").",".
87  " ilias_min_version = ".$ilDB->quote($a_attribs["ilias_min_version"], "text").",".
88  " ilias_max_version = ".$ilDB->quote($a_attribs["ilias_max_version"], "text").
89  " WHERE ".
90  " component_type = ".$ilDB->quote($this->ctype, "text").
91  " AND component_name = ".$ilDB->quote($this->cname, "text").
92  " AND slot_id = ".$ilDB->quote($this->slot_id, "text").
93  " AND name = ".$ilDB->quote($this->pname, "text");
94  $ilDB->manipulate($q);
95  }
96  break;
97  }
98  }
global $ilDB

◆ handlerCharacterData()

ilPluginReader::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

end tag handler

Parameters
ressouceinternal xml_parser_handler
stringdata private

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

121  {
122  // DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA
123  $a_data = preg_replace("/\n/","",$a_data);
124  $a_data = preg_replace("/\t+/","",$a_data);
125 
126  if (!empty($a_data))
127  {
128  switch ($this->current_tag)
129  {
130  case '':
131  }
132  }
133  }

◆ handlerEndTag()

ilPluginReader::handlerEndTag (   $a_xml_parser,
  $a_name 
)

end tag handler

Parameters
ressouceinternal xml_parser_handler
stringelement tag name private

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

108  {
109 
110  }

◆ setHandlers()

ilPluginReader::setHandlers (   $a_xml_parser)

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

36  {
37  xml_set_object($a_xml_parser,$this);
38  xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
39  xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
40  }

◆ startParsing()

ilPluginReader::startParsing ( )

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

31  {
32  parent::startParsing();
33  }

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