MediaWiki::DumpFile::SQL - Process SQL dump files from a MediaWiki instance
use MediaWiki::DumpFile::SQL; $sql = MediaWiki::DumpFile::SQL->new($file); $sql = MediaWiki::DumpFile::SQL->new(\*FH); @schema = $sql->schema; $name = $sql->table_name; while(defined($row = $sql->next) { #do something with the data from the row }
This is the constructor for this package. It is called with a single parameter: the location of a MediaWiki SQL dump file or a reference to an already open file handle.
Returns a hash reference where the key is the column name from the table and the value of the hash is the value for that column and row. Returns undef when there is no more data available.
Returns a string of the table name that was discovered in the dump file.
Returns a string of the unparsed CREATE TABLE statement straight from the dump file.
Returns a list that represents the table schema as it was parsed by this module. Each item in the list is a reference to an array with two elements. The first element is the name of the row and the second element is the MySQL datatype associated with the row. The list is in an identical order as the definitions in the CREATE TABLE statement.
Tyler Riddle, <triddle at gmail.com>
<triddle at gmail.com>
Please see MediaWiki::DumpFile for information on how to report bugs in this software.
Copyright 2009 "Tyler Riddle".
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install MediaWiki::DumpFile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MediaWiki::DumpFile
CPAN shell
perl -MCPAN -e shell install MediaWiki::DumpFile
For more information on module installation, please visit the detailed CPAN module installation guide.