/** * Start the importing process by loading the XML file. * * @see lib/importer/TikiImporter_Wiki#import() * * @param string $filePath path to the XML file * @return void * @throws UnexpectedValueException if invalid file mime type */ function import($filePath) { if (isset($_FILES['importFile']) && !in_array($_FILES['importFile']['type'], $this->validTypes)) { throw new UnexpectedValueException(tra('Invalid file mime type')); } if (!empty($_POST['importAttachments']) && $_POST['importAttachments'] == 'on') { $this->checkRequirementsForAttachments(); } $this->saveAndDisplayLog("Loading and validating the XML file\n"); $this->dom = new DOMDocument(); $this->dom->load($filePath); $this->configureParser(); if (!empty($_POST['importAttachments']) && $_POST['importAttachments'] == 'on') { $this->downloadAttachments(); } parent::import(); }