phpmyadmin/phpmyadmin — pull request #50 by alexukf (2012-04-30 23:57:21+00:00)
Title: Add import plugin for the mediawiki format

I know that mediawiki is not such a popular format to export to and import from, but I wanted to create a new plugin in order to have a better understanding of the whole import process and I figured that some use cases may actually exist. For example, if somebody wants to import a table from:
- wikipedia;
- redmine;
- other crm wikis or any other mediawiki pages;
- exported mediawiki file from phpMyAdmin (which may now act as a backup the user exported before altering some tables).

I've listed here some implementation details:
- Tables are imported one at a time, because the performance provided by keeping more of them in memory and importing them at the end was lower than 5% (tested on a 3MB import file with small tables);
- Provides parsing of the mediawiki format for tables as seen at [0] and treats special cases such as split lines when reading chunk by chunk;
- Table names are imported from comments, otherwise generic names are given: TABLE 1, TABLE 2, etc;
- If the table headers are empty, the columns will be imported as COL 1, COL 2, etc;
- More details in the comments.

Alex

[0] http://www.mediawiki.org/wiki/Help:Tables