phpmyadmin/libraries/plugins/import
2012-06-22 19:30:41 +03:00
..
upload oop: import/upload interface and classes 2012-06-22 18:28:24 +03:00
ImportCsv.class.php oop: fix display import plugins list bug 2012-06-19 14:53:04 +03:00
ImportDocsql.class.php oop: fix display import plugins list bug 2012-06-19 14:53:04 +03:00
ImportLdi.class.php oop: fix display import plugins list bug 2012-06-19 14:53:04 +03:00
ImportMediawiki.class.php oop: fix display import plugins list bug 2012-06-19 14:53:04 +03:00
ImportOds.class.php oop: ImportOds 2012-06-18 20:18:20 +03:00
ImportShp.class.php oop: import/upload interface and classes 2012-06-22 18:28:24 +03:00
ImportSql.class.php oop: import - remove getters and setters for globals 2012-06-18 19:27:27 +03:00
ImportXml.class.php oop: import - remove getters and setters for globals 2012-06-18 19:27:27 +03:00
PMA_ShapeFile.class.php oop: ImportShp 2012-06-18 20:40:48 +03:00
PMA_ShapeRecord.class.php oop: ImportShp 2012-06-18 20:40:48 +03:00
README oop: remove old plugins 2012-06-22 19:30:41 +03:00

Todo: Rewrite!

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();
}
?>