Project

General

Profile

Feature #7088

Drop "custom" XML support

Added by Julio Montoya about 5 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Target version:
Start date:
16/04/2014
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

What I mean by "custom" is to remove the calls of example:


main/admin/user_import.php

function parse_xml_data($file)
{
    global $users;
    $users = array();
    $parser = xml_parser_create('UTF-8');
    xml_set_element_handler($parser, 'element_start', 'element_end');
    xml_set_character_data_handler($parser, 'character_data');
    xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
    xml_parse($parser, api_utf8_encode_xml(file_get_contents($file)));
    xml_parser_free($parser);
    return $users;
}

We should build a class that gets an array and then transform the data to csv, xml, yml, json, etc.
Probably using Doctrine2 or Symfony serializer.

http://symfony.com/doc/current/components/serializer.html

Also available in: Atom PDF