本文整理汇总了PHP中PMA\libraries\Table::isMerge方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::isMerge方法的具体用法?PHP Table::isMerge怎么用?PHP Table::isMerge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA\libraries\Table
的用法示例。
在下文中一共展示了Table::isMerge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getHtmlForExportOptions
/**
* Prints Html For Export Options
*
* @param String $export_type Selected Export Type
* @param String $db Selected DB
* @param String $table Selected Table
* @param String $multi_values Export selection
* @param String $num_tables number of tables
* @param ExportPlugin[] $export_list Export List
* @param String $unlim_num_rows Number of Rows
*
* @return string
*/
function PMA_getHtmlForExportOptions($export_type, $db, $table, $multi_values, $num_tables, $export_list, $unlim_num_rows)
{
global $cfg;
$html = PMA_getHtmlForExportOptionsMethod();
$html .= PMA_getHtmlForExportOptionsFormatDropdown($export_list);
$html .= PMA_getHtmlForExportOptionsSelection($export_type, $multi_values);
$_table = new Table($table, $db);
if (strlen($table) > 0 && empty($num_tables) && !$_table->isMerge()) {
$html .= PMA_getHtmlForExportOptionsRows($db, $table, $unlim_num_rows);
}
if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) {
$html .= PMA_getHtmlForExportOptionsQuickExport();
}
$html .= PMA_getHtmlForAliasModalDialog($db, $table);
$html .= PMA_getHtmlForExportOptionsOutput($export_type);
$html .= PMA_getHtmlForExportOptionsFormat($export_list);
return $html;
}
示例2: testIsMergeCase4
/**
* Test for isMerge -- when ENGINE info is ISDB
*
* @return void
*/
public function testIsMergeCase4()
{
$map = array(array(array('PMA', 'PMA_BookMark'), null, array('ENGINE' => "ISDB")), array(array('PMA', 'PMA_BookMark', 'ENGINE'), null, "ISDB"));
$GLOBALS['dbi']->expects($this->any())->method('getCachedTableContent')->will($this->returnValueMap($map));
$tableObj = new Table('PMA_BookMark', 'PMA');
$this->assertEquals(false, $tableObj->isMerge());
}
示例3: PMA_exportDatabase
/**
* Export at the database level
*
* @param string $db the database to export
* @param array $tables the tables to export
* @param string $whatStrucOrData structure or data or both
* @param array $table_structure whether to export structure for each table
* @param array $table_data whether to export data for each table
* @param ExportPlugin $export_plugin the selected export plugin
* @param string $crlf end of line character(s)
* @param string $err_url the URL in case of error
* @param string $export_type the export type
* @param bool $do_relation whether to export relation info
* @param bool $do_comments whether to add comments
* @param bool $do_mime whether to add MIME info
* @param bool $do_dates whether to add dates
* @param array $aliases Alias information for db/table/column
* @param string $separate_files whether it is a separate-files export
*
* @return void
*/
function PMA_exportDatabase($db, $tables, $whatStrucOrData, $table_structure, $table_data, $export_plugin, $crlf, $err_url, $export_type, $do_relation, $do_comments, $do_mime, $do_dates, $aliases, $separate_files)
{
$db_alias = !empty($aliases[$db]['alias']) ? $aliases[$db]['alias'] : '';
if (!$export_plugin->exportDBHeader($db, $db_alias)) {
return;
}
if (!$export_plugin->exportDBCreate($db, $export_type, $db_alias)) {
return;
}
if ($separate_files == 'database') {
PMA_saveObjectInBuffer('database', true);
}
if (($GLOBALS['sql_structure_or_data'] == 'structure' || $GLOBALS['sql_structure_or_data'] == 'structure_and_data') && isset($GLOBALS['sql_procedure_function'])) {
$export_plugin->exportRoutines($db, $aliases);
if ($separate_files == 'database') {
PMA_saveObjectInBuffer('routines');
}
}
$views = array();
foreach ($tables as $table) {
$_table = new Table($table, $db);
// if this is a view, collect it for later;
// views must be exported after the tables
$is_view = $_table->isView();
if ($is_view) {
$views[] = $table;
}
if (($whatStrucOrData == 'structure' || $whatStrucOrData == 'structure_and_data') && in_array($table, $table_structure)) {
// for a view, export a stand-in definition of the table
// to resolve view dependencies (only when it's a single-file export)
if ($is_view) {
if ($separate_files == '' && isset($GLOBALS['sql_create_view']) && !$export_plugin->exportStructure($db, $table, $crlf, $err_url, 'stand_in', $export_type, $do_relation, $do_comments, $do_mime, $do_dates, $aliases)) {
break;
}
} else {
if (isset($GLOBALS['sql_create_table'])) {
$table_size = $GLOBALS['maxsize'];
// Checking if the maximum table size constrain has been set
// And if that constrain is a valid number or not
if ($table_size !== '' && is_numeric($table_size)) {
// This obtains the current table's size
$query = 'SELECT data_length + index_length
from information_schema.TABLES
WHERE table_schema = "' . $db . '"
AND table_name = "' . $table . '"';
$size = $GLOBALS['dbi']->fetchValue($query);
//Converting the size to MB
$size = $size / 1024 / 1024;
if ($size > $table_size) {
continue;
}
}
if (!$export_plugin->exportStructure($db, $table, $crlf, $err_url, 'create_table', $export_type, $do_relation, $do_comments, $do_mime, $do_dates, $aliases)) {
break;
}
}
}
}
// if this is a view or a merge table, don't export data
if (($whatStrucOrData == 'data' || $whatStrucOrData == 'structure_and_data') && in_array($table, $table_data) && !($is_view || $_table->isMerge())) {
$local_query = 'SELECT * FROM ' . PMA\libraries\Util::backquote($db) . '.' . PMA\libraries\Util::backquote($table);
if (!$export_plugin->exportData($db, $table, $crlf, $err_url, $local_query, $aliases)) {
break;
}
}
// this buffer was filled, we save it and go to the next one
if ($separate_files == 'database') {
PMA_saveObjectInBuffer('table_' . $table);
}
// now export the triggers (needs to be done after the data because
// triggers can modify already imported tables)
if (isset($GLOBALS['sql_create_trigger']) && ($whatStrucOrData == 'structure' || $whatStrucOrData == 'structure_and_data') && in_array($table, $table_structure)) {
if (!$export_plugin->exportStructure($db, $table, $crlf, $err_url, 'triggers', $export_type, $do_relation, $do_comments, $do_mime, $do_dates, $aliases)) {
break;
}
if ($separate_files == 'database') {
PMA_saveObjectInBuffer('table_' . $table, true);
}
}
//.........这里部分代码省略.........