/** * Initialize the instance if needed, called by the constructor * * Here we create objects we need before the execution. */ protected function init() { // ask your mother first before going out playing with toys parent::init(); $this->log('initializing '.$this->get_name().' converter', backup::LOG_INFO); // good boy, prepare XML parser and processor $this->log('setting xml parser', backup::LOG_DEBUG, null, 1); $this->xmlparser = new progressive_parser(); $this->xmlparser->set_file($this->get_tempdir_path() . '/moodle.xml'); $this->log('setting xml processor', backup::LOG_DEBUG, null, 1); $this->xmlprocessor = new moodle1_parser_processor($this); $this->xmlparser->set_processor($this->xmlprocessor); // make sure that MOD and BLOCK paths are visited $this->xmlprocessor->add_path('/MOODLE_BACKUP/COURSE/MODULES/MOD'); $this->xmlprocessor->add_path('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK'); // register the conversion handlers foreach (moodle1_handlers_factory::get_handlers($this) as $handler) { $this->log('registering handler', backup::LOG_DEBUG, get_class($handler), 1); $this->register_handler($handler, $handler->get_paths()); } }
/** * Log a message * * @see parent::log() * @param string $message message text * @param int $level message level {@example backup::LOG_WARNING} * @param null|mixed $a additional information * @param null|int $depth the message depth * @param bool $display whether the message should be sent to the output, too */ public function log($message, $level, $a = null, $depth = null, $display = false) { parent::log('(imscc1) ' . $message, $level, $a, $depth, $display); }