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.
7 // vim: expandtab sw=4 ts=4 sts=4 ft=php:
9 /* Demo import plugin for phpMyAdmin */
11 if (isset($plugin_list)) {
12 $plugin_list['name'] = array( // set name of your plugin
13 'text' => 'strName', // text to be displayed as choice
14 'extension' => '', // extension this plugin can handle
15 'options' => array( // array of options for your plugin (optional)
16 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)
18 'options_text' => 'strNameImportOptions', // text to describe plugin options (must be set if options are used)
21 /* We do not define function when plugin is just queried for information above */
23 while (!($finished && $i >= $len) && !$error && !$timeout_passed) {
24 $data = PMA_importGetNextChunk();
25 if ($data === false) {
26 // subtract data we didn't handle yet and stop processing
27 $offset -= strlen($buffer);
29 } elseif ($data === true) {
30 // Handle rest of buffer
32 // Append new data to buffer
35 // PARSE $buffer here, post sql queries using:
36 PMA_importRunQuery($sql, $verbose_sql_with_comments);
37 } // End of import loop
38 // Commit any possible data in buffers