1 This directory holds import plugins for phpMyAdmin. Plugin should
2 basically look like following code. Official plugins need to have str*
3 messages with their definition in language files, if you build some
4 plugins for your use, you can use directly texts in plugin.
8 // vim: expandtab sw=4 ts=4 sts=4 ft=php:
10 /* Demo import plugin for phpMyAdmin */
12 if (isset($plugin_list)) {
13 $plugin_list['name'] = array( // set name of your plugin
14 'text' => 'strName', // text to be displayed as choice
15 'extension' => '', // extension this plugin can handle
16 'options' => array( // array of options for your plugin (optional)
17 array('type' => '', 'name' => '', 'text' => ''), // type: bool or text, name: form element name, text: description in GUI, size: size of text element (optional). len: maximal size of input (optional)
19 'options_text' => 'strNameImportOptions', // text to describe plugin options (must be set if options are used)
22 /* We do not define function when plugin is just queried for information above */
24 while (!($finished && $i >= $len) && !$error && !$timeout_passed) {
25 $data = PMA_importGetNextChunk();
26 if ($data === FALSE) {
27 // subtract data we didn't handle yet and stop processing
28 $offset -= strlen($buffer);
30 } elseif ($data === TRUE) {
31 // Handle rest of buffer
33 // Append new data to buffer
36 // PARSE $buffer here, post sql queries using:
37 PMA_importRunQuery($sql, $verbose_sql_with_comments);
38 } // End of import loop
39 // Commit any possible data in buffers