Public Member Functions

ilServiceReader Class Reference

Inheritance diagram for ilServiceReader:
Collaboration diagram for ilServiceReader:

Public Member Functions

 ilServiceReader ()
 getServices ()
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private
 clearTables ()
 clear the tables
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 start tag handler
 handlerEndTag ($a_xml_parser, $a_name)
 end tag handler
 handlerCharacterData ($a_xml_parser, $a_data)
 end tag handler

Detailed Description

Definition at line 34 of file class.ilServiceReader.php.


Member Function Documentation

ilServiceReader::clearTables (  ) 

clear the tables

Definition at line 65 of file class.ilServiceReader.php.

References $q.

Referenced by getServices().

        {
                global $ilDB;

                $q = "DELETE FROM service";;
                $ilDB->query($q);

                $q = "DELETE FROM service_class";;
                $ilDB->query($q);

        }

Here is the caller graph for this function:

ilServiceReader::getServices (  ) 

Definition at line 43 of file class.ilServiceReader.php.

References clearTables(), and ilSaxParser::startParsing().

        {
                if (!$this->executed)
                {
                        $this->clearTables();
                        $this->startParsing();
                        $this->executed = true;
                }
        }

Here is the call graph for this function:

ilServiceReader::handlerBeginTag ( a_xml_parser,
a_name,
a_attribs 
)

start tag handler

Parameters:
ressouce internal xml_parser_handler
string element tag name
array element attributes private

Definition at line 86 of file class.ilServiceReader.php.

References $q.

        {
                global $ilDB;

                $this->current_tag = $a_name;
                
                switch ($a_name)
                {
                        case 'service':
                                $this->current_module = $a_attribs["name"];
                                $q = "INSERT INTO service (name, dir) VALUES ".
                                        "(".$ilDB->quote($a_attribs["name"]).",".
                                        $ilDB->quote($a_attribs["dir"]).")";
                                $ilDB->query($q);
                                break;
                                
                        case 'baseclass':
                                $q = "INSERT INTO service_class (service, class, dir) VALUES ".
                                        "(".$ilDB->quote($this->current_module).",".
                                        $ilDB->quote($a_attribs["name"]).",".
                                        $ilDB->quote($a_attribs["dir"]).")";
                                $ilDB->query($q);
                                break;
                                
                }
        }

ilServiceReader::handlerCharacterData ( a_xml_parser,
a_data 
)

end tag handler

Parameters:
ressouce internal xml_parser_handler
string data private

Definition at line 132 of file class.ilServiceReader.php.

        {
                // DELETE WHITESPACES AND NEWLINES OF CHARACTER DATA
                $a_data = preg_replace("/\n/","",$a_data);
                $a_data = preg_replace("/\t+/","",$a_data);

                if (!empty($a_data))
                {
                        switch ($this->current_tag)
                        {
                                case '':
                        }
                }
        }

ilServiceReader::handlerEndTag ( a_xml_parser,
a_name 
)

end tag handler

Parameters:
ressouce internal xml_parser_handler
string element tag name private

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

        {
        }

ilServiceReader::ilServiceReader (  ) 

Definition at line 37 of file class.ilServiceReader.php.

References ilSaxParser::ilSaxParser().

        {
                $this->executed = false;
                parent::ilSaxParser(ILIAS_ABSOLUTE_PATH."/services.xml");
        }

Here is the call graph for this function:

ilServiceReader::setHandlers ( a_xml_parser  ) 

set event handler should be overwritten by inherited class private

Reimplemented from ilSaxParser.

Definition at line 54 of file class.ilServiceReader.php.

        {
                xml_set_object($a_xml_parser,$this);
                xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
                xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
        }


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