phpmyadmin/libraries/import
2012-09-08 10:22:22 +05:30
..
upload Use package name PhpMyAdmin 2011-10-25 10:13:17 +02:00
csv.php patch #3475424 [import] Fixed CSV escape for the import 2012-01-22 04:24:03 -05:00
docsql.php Use package name PhpMyAdmin 2011-10-25 10:13:17 +02:00
ldi.php Use package name PhpMyAdmin 2011-10-25 10:13:17 +02:00
ods.php Merge branch 'QA_3_4' 2011-12-24 21:33:35 +05:30
README Replace TRUE/FALSE with true/false. 2011-06-06 11:55:09 +02:00
shp.php Use package name PhpMyAdmin 2011-10-25 10:13:17 +02:00
sql.php coding style : control structures 2011-11-24 15:32:30 +01:00
xml.php bug #3553068 [import] Table import from XML file fails 2012-09-08 10:22:22 +05:30

This directory holds import plugins for phpMyAdmin. Plugin should
basically look like following code. Official plugins need to have str*
messages with their definition in language files, if you build some
plugins for your use, you can use directly texts in plugin.

<?php
// vim: expandtab sw=4 ts=4 sts=4 ft=php:

/* Demo import plugin for phpMyAdmin */

if (isset($plugin_list)) {
    $plugin_list['name'] = array(           // set name of your plugin
        'text' => 'strName',                // text to be displayed as choice
        'extension' => '',                  // extension this plugin can handle
        'options' => array(                 // array of options for your plugin (optional)
            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)
        ),
        'options_text' => 'strNameImportOptions', // text to describe plugin options (must be set if options are used)
        );
} else {
/* We do not define function when plugin is just queried for information above */
    $buffer = '';
    while (!($finished && $i >= $len) && !$error && !$timeout_passed) {
        $data = PMA_importGetNextChunk();
        if ($data === false) {
            // subtract data we didn't handle yet and stop processing
            $offset -= strlen($buffer);
            break;
        } elseif ($data === true) {
            // Handle rest of buffer
        } else {
            // Append new data to buffer
            $buffer .= $data;
        }
        // PARSE $buffer here, post sql queries using:
        PMA_importRunQuery($sql, $verbose_sql_with_comments);
    } // End of import loop
    // Commit any possible data in buffers
    PMA_importRunQuery();
}
?>