当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_exportHeader函数代码示例

本文整理汇总了PHP中PMA_exportHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_exportHeader函数的具体用法?PHP PMA_exportHeader怎么用?PHP PMA_exportHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_exportHeader函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: backup_mysql_fn

function backup_mysql_fn($shost, $suser, $spass, $sdb, $sdbfile)
{
    //echo $shost.' == '. $suser.' == '. $spass.' == '. $sdb.' == '. $sdbfile;
    $link = mysql_connect($shost, $suser, $spass);
    mysql_query('SET CHARACTER SET utf8');
    // Open and create a file handle for sql.
    $handle = fopen($sdbfile, 'w');
    $s_def = $alter_queries = $sresponse = '';
    $sql_alter = $tables = array();
    $ser_ver = PMA_sversion();
    $s_def = PMA_exportHeader($sdb, $ser_ver);
    fwrite($handle, $s_def);
    // List the tables
    $squery = mysql_query('SHOW TABLES FROM `' . $sdb . '`');
    while ($row = mysql_fetch_row($squery)) {
        $tables[] = $row[0];
    }
    // Sort the tables
    usort($tables, 'strnatcasecmp');
    foreach ($tables as $table => $v) {
        // Get the table structure(table definition)
        $stable_defn = PMA_getTableDef($sdb, $v, "\n");
        $s_def = $stable_defn['structure'] . "\n";
        fwrite($handle, $s_def);
        // Get the table data(table contents)
        // We have added $handle so that we can write the INSERT queries directly when we get it.
        // Basically To avoid MEMORY EXHAUST FOR  BIG INSERTS
        PMA_exportData($sdb, $v, "\n", $handle);
        // List of alter queries
        // We have changed this because the OLD method was putting the ALTER queries after CREATE table query which was causing issues.
        if (!empty($stable_defn['alter'])) {
            $alter_queries .= $stable_defn['alter'];
        }
    }
    fwrite($handle, $alter_queries);
    $sresponse = PMA_exportFooter();
    // Just to add the finishing lines
    fwrite($handle, $sresponse);
    fclose($handle);
    // Just check that file is created or not ??
    if (file_exists($sdbfile)) {
        return true;
    }
    return false;
}
开发者ID:Hezkibel,项目名称:soft,代码行数:45,代码来源:myback.php

示例2: unset

        }
        $backup_cfgServer = $cfg['Server'];
        require_once './libraries/header.inc.php';
        $cfg['Server'] = $backup_cfgServer;
        unset($backup_cfgServer);
        echo "\n" . '<div align="' . $cell_align_left . '">' . "\n";
        //echo '    <pre>' . "\n";
        echo '    <form name="nofunction">' . "\n" . '        <textarea name="sqldump" cols="50" rows="30" id="textSQLDUMP" wrap="OFF">' . "\n";
    }
    // end download
}
// Fake loop just to allow skip of remain of this code by break, I'd really
// need exceptions here :-)
do {
    // Add possibly some comments to export
    if (!PMA_exportHeader()) {
        break;
    }
    // Will we need relation & co. setup?
    $do_relation = isset($GLOBALS[$what . '_relation']);
    $do_comments = isset($GLOBALS[$what . '_comments']);
    $do_mime = isset($GLOBALS[$what . '_mime']);
    if ($do_relation || $do_comments || $do_mime) {
        require_once './libraries/relation.lib.php';
        $cfgRelation = PMA_getRelationsParam();
    }
    if ($do_mime) {
        require_once './libraries/transformations.lib.php';
    }
    // Include dates in export?
    $do_dates = isset($GLOBALS[$what . '_dates']);
开发者ID:alexhava,项目名称:elixirjuice,代码行数:31,代码来源:export.php

示例3: elseif

        require_once './header.inc.php';
        if ($export_type == 'server') {
            $active_page = 'server_export.php';
            require './server_export.php';
        } elseif ($export_type == 'database') {
            $active_page = 'db_details_export.php';
            require './db_details_export.php';
        } else {
            $active_page = 'tbl_properties_export.php';
            require './tbl_properties_export.php';
        }
        exit;
    }
}
// Add possibly some comments to export
PMA_exportHeader();
// Will we need relation & co. setup?
$do_relation = isset($GLOBALS[$what . '_relation']);
$do_comments = isset($GLOBALS[$what . '_comments']);
$do_mime = isset($GLOBALS[$what . '_mime']);
if ($do_relation || $do_comments || $do_mime) {
    require_once './libraries/relation.lib.php';
    $cfgRelation = PMA_getRelationsParam();
}
if ($do_mime) {
    require_once './libraries/transformations.lib.php';
}
// Include dates in export?
$do_dates = isset($GLOBALS[$what . '_dates']);
/**
 * Builds the dump
开发者ID:quartemer,项目名称:xoopserver,代码行数:31,代码来源:export.php


注:本文中的PMA_exportHeader函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。