本文整理汇总了PHP中PMA_Index::getView方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Index::getView方法的具体用法?PHP PMA_Index::getView怎么用?PHP PMA_Index::getView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Index
的用法示例。
在下文中一共展示了PMA_Index::getView方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_handleCreateOrEditIndex
/**
* Function to handle the creation or edit of an index
*
* @param string $db current db
* @param string $table current table
* @param PMA_Index $index current index
*
* @return void
*/
function PMA_handleCreateOrEditIndex($db, $table, $index)
{
$error = false;
$sql_query = PMA_getSqlQueryForIndexCreateOrEdit($db, $table, $index, $error);
// If there is a request for SQL previewing.
if (isset($_REQUEST['preview_sql'])) {
PMA_previewSQL($sql_query);
}
if (!$error) {
$GLOBALS['dbi']->query($sql_query);
$message = PMA_Message::success(__('Table %1$s has been altered successfully.'));
$message->addParam($table);
if ($GLOBALS['is_ajax_request'] == true) {
$response = PMA_Response::getInstance();
$response->addJSON('message', $message);
$response->addJSON('index_table', PMA_Index::getView($table, $db));
$response->addJSON('sql_query', PMA_Util::getMessage(null, $sql_query));
} else {
include 'tbl_structure.php';
}
exit;
} else {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
$response->addJSON('message', $error);
exit;
}
}
示例2: PMA_getHtmlForDisplayIndexes
/**
* Get HTML for display indexes
*
* @return string $html_output
*/
function PMA_getHtmlForDisplayIndexes()
{
$html_output = PMA_Util::getDivForSliderEffect('indexes', __('Indexes'));
$html_output .= PMA_Index::getView($GLOBALS['table'], $GLOBALS['db']);
$html_output .= '<fieldset class="tblFooters" style="text-align: left;">' . '<form action="tbl_indexes.php" method="post">';
$html_output .= PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']) . sprintf(__('Create an index on %s columns'), '<input type="text" size="2" name="added_fields" value="1" />');
$html_output .= '<input type="hidden" name="create_index" value="1" />' . '<input class="add_index ajax"' . ' type="submit" value="' . __('Go') . '" />';
$html_output .= '</form>' . '</fieldset>' . '</div>' . '</div>';
return $html_output;
}
示例3: PMA_getHtmlForTableStructure
/**
* return html for Table Structure
*
* @param bool $have_rel whether have relation
* @param bool $tbl_is_view Is a table view?
* @param array $columns columns list
* @param array $analyzed_sql analyzed sql
* @param array $res_rel relations array
* @param string $db database
* @param string $table table
* @param array $cfgRelation config from PMA_getRelationsParam
* @param array $cfg global config
* @param array $showtable showing table information
* @param int $cell_align_left cell align left
*
* @return string
*/
function PMA_getHtmlForTableStructure($have_rel, $tbl_is_view, $columns, $analyzed_sql, $res_rel, $db, $table, $cfgRelation, $cfg, $showtable, $cell_align_left)
{
/**
* Displays the table structure
*/
$html = '<table style="width: 100%;">';
$html .= '<thead>';
$html .= '<tr>';
$html .= '<th>' . __('Column') . '</th>';
$html .= '<th>' . __('Type') . '</th>';
$html .= '<th>' . __('Null') . '</th>';
$html .= '<th>' . __('Default') . '</th>';
if ($have_rel) {
$html .= '<th>' . __('Links to') . '</th>' . "\n";
}
$html .= ' <th>' . __('Comments') . '</th>' . "\n";
if ($cfgRelation['mimework']) {
$html .= ' <th>MIME</th>' . "\n";
}
$html .= '</tr>';
$html .= '</thead>';
$html .= '<tbody>';
$html .= PMA_getHtmlForPrintViewColumns($tbl_is_view, $columns, $analyzed_sql, $have_rel, $res_rel, $db, $table, $cfgRelation);
$html .= '</tbody>';
$html .= '</table>';
if (!$tbl_is_view && !$GLOBALS['dbi']->isSystemSchema($db)) {
/**
* Displays indexes
*/
$html .= PMA_Index::getView($table, $db, true);
/**
* Displays Space usage and row statistics
*
*/
if ($cfg['ShowStats']) {
$html .= PMA_getHtmlForSpaceUsageAndRowStatistics($showtable, $db, $table, $cell_align_left);
}
// end if ($cfg['ShowStats'])
}
return $html;
}
示例4: PMA_executeTheQuery
/**
* Function to handle all aspects relating to executing the query
*
* @param array $analyzed_sql_results analyzed sql results
* @param String $full_sql_query full sql query
* @param boolean $is_gotofile whether to go to a file
* @param String $db current database
* @param String $table current table
* @param boolean $find_real_end whether to find the real end
* @param String $sql_query_for_bookmark sql query to be stored as bookmark
* @param array $extra_data extra data
*
* @return mixed
*/
function PMA_executeTheQuery($analyzed_sql_results, $full_sql_query, $is_gotofile, $db, $table, $find_real_end, $sql_query_for_bookmark, $extra_data)
{
$response = PMA_Response::getInstance();
$response->getHeader()->getMenu()->setTable($table);
// Only if we ask to see the php code
if (isset($GLOBALS['show_as_php'])) {
$result = null;
$num_rows = 0;
$unlim_num_rows = 0;
} else {
// If we don't ask to see the php code
if (isset($_SESSION['profiling']) && PMA_Util::profilingSupported()) {
$GLOBALS['dbi']->query('SET PROFILING=1;');
}
$result = PMA_executeQueryAndStoreResults($full_sql_query);
// Displays an error message if required and stop parsing the script
$error = $GLOBALS['dbi']->getError();
if ($error) {
PMA_handleQueryExecuteError($is_gotofile, $error, $full_sql_query);
}
// If there are no errors and bookmarklabel was given,
// store the query as a bookmark
if (!empty($_POST['bkm_label']) && !empty($sql_query_for_bookmark)) {
$cfgBookmark = PMA_Bookmark_getParams();
PMA_storeTheQueryAsBookmark($db, $cfgBookmark['user'], $sql_query_for_bookmark, $_POST['bkm_label'], isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null);
}
// end store bookmarks
// Gets the number of rows affected/returned
// (This must be done immediately after the query because
// mysql_affected_rows() reports about the last query done)
$num_rows = PMA_getNumberOfRowsAffectedOrChanged($analyzed_sql_results['is_affected'], $result, isset($num_rows) ? $num_rows : null);
// Grabs the profiling results
if (isset($_SESSION['profiling']) && PMA_Util::profilingSupported()) {
$profiling_results = $GLOBALS['dbi']->fetchResult('SHOW PROFILE;');
}
$justBrowsing = PMA_isJustBrowsing($analyzed_sql_results, isset($find_real_end) ? $find_real_end : null);
$unlim_num_rows = PMA_countQueryResults($num_rows, $analyzed_sql_results['is_select'], $justBrowsing, $db, $table, $analyzed_sql_results['parsed_sql'], $analyzed_sql_results);
$extra_data = PMA_cleanupRelations(isset($db) ? $db : '', isset($table) ? $table : '', isset($_REQUEST['dropped_column']) ? $_REQUEST['dropped_column'] : null, isset($_REQUEST['purge']) ? $_REQUEST['purge'] : null, isset($extra_data) ? $extra_data : null);
// Update Indexes list.
if (isset($_REQUEST['index_change'])) {
$extra_data['indexes_list'] = PMA_Index::getView($table, $db);
}
}
return array($result, $num_rows, $unlim_num_rows, isset($profiling_results) ? $profiling_results : null, $extra_data);
}
示例5: checkFormElementInRange
/**
* If there are more than 20 rows, displays browse/select/insert/empty/drop
* links again
*/
if ($fields_cnt > 20) {
require './libraries/tbl_links.inc.php';
}
// end if ($fields_cnt > 20)
/**
* Displays indexes
*/
if (!$tbl_is_view && !$db_is_information_schema && 'ARCHIVE' != $tbl_type) {
/**
* Display indexes
*/
echo PMA_Index::getView($table, $db);
?>
<br />
<form action="./tbl_indexes.php" method="post"
onsubmit="return checkFormElementInRange(this, 'idx_num_fields',
'<?php
echo str_replace('\'', '\\\'', $GLOBALS['strInvalidColumnCount']);
?>
',
1)">
<fieldset>
<?php
echo PMA_generate_common_hidden_inputs($db, $table);
echo sprintf($strCreateIndex, '<input type="text" size="2" name="added_fields" value="1" />');
?>
<input type="submit" name="create_index" value="<?php
示例6:
$response->addHTML('<div id="structure-action-links">');
if ($tbl_is_view) {
$response->addHTML(PMA_getHtmlForEditView($url_params));
}
$response->addHTML(PMA_getHtmlForOptionalActionLinks($url_query, $tbl_is_view, $db_is_system_schema, $tbl_storage_engine, $cfgRelation));
$response->addHTML('</div>');
if (!$tbl_is_view && !$db_is_system_schema) {
$response->addHTML('<br />');
$response->addHTML(PMA_getHtmlForAddColumn($columns_list));
}
/**
* Displays indexes
*/
if (!$tbl_is_view && !$db_is_system_schema && 'ARCHIVE' != $tbl_storage_engine) {
//return the list of index
$response->addJSON('indexes_list', PMA_Index::getView($GLOBALS['table'], $GLOBALS['db']));
$response->addHTML(PMA_getHtmlForDisplayIndexes());
}
/**
* Displays Space usage and row statistics
*/
// BEGIN - Calc Table Space
// Get valid statistics whatever is the table type
if ($cfg['ShowStats']) {
//get table stats in HTML format
$tablestats = PMA_getHtmlForDisplayTableStats($showtable, $table_info_num_rows, $tbl_is_view, $db_is_system_schema, $tbl_storage_engine, $url_query, $tbl_collation);
//returning the response in JSON format to be used by Ajax
$response->addJSON('tableStat', $tablestats);
$response->addHTML($tablestats);
}
// END - Calc Table Space
示例7: list
echo ' </td>' . "\n";
}
?>
</tr>
<?php
}
// end foreach
?>
</tbody>
</table>
<?php
if (!$tbl_is_view && !PMA_is_system_schema($db)) {
/**
* Displays indexes
*/
echo PMA_Index::getView($table, $db, true);
/**
* Displays Space usage and row statistics
*
*/
if ($cfg['ShowStats']) {
$nonisam = false;
if (isset($showtable['Type']) && !preg_match('@ISAM|HEAP@i', $showtable['Type'])) {
$nonisam = true;
}
if ($nonisam == false) {
// Gets some sizes
$mergetable = PMA_Table::isMerge($db, $table);
list($data_size, $data_unit) = PMA_formatByteDown($showtable['Data_length']);
if ($mergetable == false) {
list($index_size, $index_unit) = PMA_formatByteDown($showtable['Index_length']);
示例8: PMA_cleanupRelations
/**
* If a table, database or column gets dropped, clean comments.
*
* @param String $db current database
* @param String $table current table
* @param String $dropped_column dropped column if any
* @param bool $purge whether purge set or not
* @param array $extra_data extra data
*
* @return array $extra_data
*/
function PMA_cleanupRelations($db, $table, $dropped_column, $purge, $extra_data)
{
include_once 'libraries/relation_cleanup.lib.php';
if (isset($purge) && $purge == 1) {
if (strlen($table) && strlen($db)) {
PMA_relationsCleanupTable($db, $table);
} elseif (strlen($db)) {
PMA_relationsCleanupDatabase($db);
}
}
if (isset($dropped_column) && !empty($dropped_column) && strlen($db) && strlen($table)) {
PMA_relationsCleanupColumn($db, $table, $dropped_column);
if (isset($extra_data)) {
// to refresh the list of indexes (Ajax mode)
$extra_data['indexes_list'] = PMA_Index::getView($table, $db);
}
}
return $extra_data;
}
示例9: implode
$error = PMA_Message::error(__('No index parts defined!'));
} else {
$sql_query .= ' (' . implode(', ', $index_fields) . ')';
}
if (PMA_MYSQL_INT_VERSION > 50500) {
$sql_query .= "COMMENT '" . PMA_Util::sqlAddSlashes($index->getComment()) . "'";
}
$sql_query .= ';';
if (!$error) {
PMA_DBI_query($sql_query);
$message = PMA_Message::success(__('Table %1$s has been altered successfully'));
$message->addParam($table);
if ($GLOBALS['is_ajax_request'] == true) {
$response = PMA_Response::getInstance();
$response->addJSON('message', $message);
$response->addJSON('index_table', PMA_Index::getView($table, $db));
$response->addJSON('sql_query', PMA_Util::getMessage(null, $sql_query));
} else {
$active_page = 'tbl_structure.php';
include 'tbl_structure.php';
}
exit;
} else {
if ($GLOBALS['is_ajax_request'] == true) {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
$response->addJSON('message', $error);
exit;
} else {
$error->display();
}