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


PHP PMA_Partition类代码示例

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


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

示例1: getPartitionNames

 /**
  * returns array of partition names for a specific db/table
  *
  * @param string $db    database name
  * @param string $table table name
  *
  * @access  public
  * @return array   of partition names
  */
 public static function getPartitionNames($db, $table)
 {
     if (PMA_Partition::havePartitioning()) {
         return PMA_DBI_fetch_result("SELECT `PARTITION_NAME` FROM `information_schema`.`PARTITIONS`" . " WHERE `TABLE_SCHEMA` = '" . $db . "' AND `TABLE_NAME` = '" . $table . "'");
     } else {
         return array();
     }
 }
开发者ID:yxwzaxns,项目名称:sakura,代码行数:17,代码来源:Partition.class.php

示例2: getPartitionNames

 /**
  * returns array of partition names for a specific db/table
  *
  * @access  public
  * @uses    PMA_DBI_fetch_result()
  * @return  array   of partition names
  */
 static public function getPartitionNames($db, $table)
 {
     if (PMA_Partition::havePartitioning()) {
         return PMA_DBI_fetch_result("select `PARTITION_NAME` from `information_schema`.`PARTITIONS` where `TABLE_SCHEMA` = '" . $db . "' and `TABLE_NAME` = '" . $table . "'");
     } else {
         return array();
     }
 }
开发者ID:blumenbach,项目名称:blumenbach-online.de,代码行数:15,代码来源:Partition.class.php

示例3: getPartitionNames

 /**
  * returns array of partition names for a specific db/table
  *
  * @param string $db    database name
  * @param string $table table name
  *
  * @access  public
  * @return array   of partition names
  */
 public static function getPartitionNames($db, $table)
 {
     if (PMA_Partition::havePartitioning()) {
         return $GLOBALS['dbi']->fetchResult("SELECT `PARTITION_NAME` FROM `information_schema`.`PARTITIONS`" . " WHERE `TABLE_SCHEMA` = '" . PMA_Util::sqlAddSlashes($db) . "' AND `TABLE_NAME` = '" . PMA_Util::sqlAddSlashes($table) . "'");
     } else {
         return array();
     }
 }
开发者ID:mercysmart,项目名称:naikelas,代码行数:17,代码来源:Partition.class.php

示例4: PMA_getHtmlForTableConfigurations

/**
 * Function to get html for table comments, storage engine, collation and
 * partition definition
 *
 * @return string
 */
function PMA_getHtmlForTableConfigurations()
{
    $html = '<table>' . '<tr class="vtop">' . '<th>' . __('Table comments:') . '</th>' . '<td width="25">&nbsp;</td>' . '<th>' . __('Storage Engine:') . PMA_Util::showMySQLDocu('Storage_engines') . '</th>' . '<td width="25">&nbsp;</td>' . '<th>' . __('Collation:') . '</th>' . '</tr>' . '<tr><td><input type="text" name="comment" size="40" maxlength="80"' . ' value="' . (isset($_REQUEST['comment']) ? htmlspecialchars($_REQUEST['comment']) : '') . '" class="textfield" />' . '</td>' . '<td width="25">&nbsp;</td>' . '<td>' . PMA_StorageEngine::getHtmlSelect('tbl_storage_engine', null, isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null) . '</td>' . '<td width="25">&nbsp;</td>' . '<td>' . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null, false, 3) . '</td>' . '</tr>';
    if (PMA_Partition::havePartitioning()) {
        $html .= '<tr class="vtop">' . '<th>' . __('PARTITION definition:') . '&nbsp;' . PMA_Util::showMySQLDocu('Partitioning') . '</th>' . '</tr>' . '<tr>' . '<td>' . '<textarea name="partition_definition" id="partitiondefinition"' . ' cols="' . $GLOBALS['cfg']['TextareaCols'] . '"' . ' rows="' . $GLOBALS['cfg']['TextareaRows'] . '"' . ' dir="' . $GLOBALS['text_dir'] . '">' . (isset($_REQUEST['partition_definition']) ? htmlspecialchars($_REQUEST['partition_definition']) : '') . '</textarea>' . '</td>' . '</tr>';
    }
    $html .= '</table>' . '<br />';
    return $html;
}
开发者ID:FilipeRamosFernandes,项目名称:phpmyadmin,代码行数:15,代码来源:tbl_columns_definition_form.lib.php

示例5: getPartitionMethod

 /**
  * returns the partition method used by the table.
  *
  * @param string $db    database name
  * @param string $table table name
  *
  * @return string partition method
  */
 public static function getPartitionMethod($db, $table)
 {
     if (PMA_Partition::havePartitioning()) {
         $partition_method = $GLOBALS['dbi']->fetchResult("SELECT `PARTITION_METHOD` FROM `information_schema`.`PARTITIONS`" . " WHERE `TABLE_SCHEMA` = '" . PMA_Util::sqlAddSlashes($db) . "'" . " AND `TABLE_NAME` = '" . PMA_Util::sqlAddSlashes($table) . "'");
         if (!empty($partition_method)) {
             return $partition_method[0];
         }
     }
     return null;
 }
开发者ID:hewenhao2008,项目名称:phpmyadmin,代码行数:18,代码来源:Partition.class.php

示例6: PMA_getHtmlForTableConfigurations

/**
 * Function to get html for table comments, storage engine, collation and
 * partition definition
 *
 * @return string
 */
function PMA_getHtmlForTableConfigurations()
{
    $html = '<table>';
    $html .= '<tr class="vtop">' . '<th>' . __('Table comments:') . '</th>' . '<td width="25">&nbsp;</td>' . '<th>' . __('Collation:') . '</th>' . '<td width="25">&nbsp;</td>' . '<th>' . __('Storage Engine:') . PMA_Util::showMySQLDocu('Storage_engines') . '</th>' . '<td width="25">&nbsp;</td>' . '<th>' . __('Connection:') . PMA_Util::showMySQLDocu('federated-create-connection') . '</th>' . '</tr>';
    $commentLength = PMA_MYSQL_INT_VERSION >= 50503 ? 2048 : 60;
    $html .= '<tr>' . '<td><input type="text" name="comment"' . ' size="40" maxlength="' . $commentLength . '"' . ' value="' . (isset($_REQUEST['comment']) ? htmlspecialchars($_REQUEST['comment']) : '') . '" class="textfield" />' . '</td>' . '<td width="25">&nbsp;</td>' . '<td>' . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null, false) . '</td>' . '<td width="25">&nbsp;</td>' . '<td>' . PMA_StorageEngine::getHtmlSelect('tbl_storage_engine', null, isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null) . '</td>' . '<td width="25">&nbsp;</td>' . '<td><input type="text" name="connection" size="40"' . ' value="' . (isset($_REQUEST['connection']) ? htmlspecialchars($_REQUEST['connection']) : '') . '"' . ' placeholder="scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name"' . ' class="textfield" required="required" />' . '</td>' . '</tr>';
    if (PMA_Partition::havePartitioning()) {
        $html .= '<tr class="vtop">' . '<th>' . __('PARTITION definition:') . '&nbsp;' . PMA_Util::showMySQLDocu('Partitioning') . '</th>' . '</tr>' . '<tr>' . '<td>' . '<textarea name="partition_definition" id="partitiondefinition"' . ' cols="' . $GLOBALS['cfg']['TextareaCols'] . '"' . ' rows="' . $GLOBALS['cfg']['TextareaRows'] . '"' . ' dir="' . $GLOBALS['text_dir'] . '">' . (isset($_REQUEST['partition_definition']) ? htmlspecialchars($_REQUEST['partition_definition']) : '') . '</textarea>' . '</td>' . '</tr>';
    }
    $html .= '</table>' . '<br />';
    return $html;
}
开发者ID:mercysmart,项目名称:naikelas,代码行数:18,代码来源:tbl_columns_definition_form.lib.php

示例7: isset

        </td>
        <td width="25">&nbsp;</td>
        <td>
    <?php 
    echo PMA_StorageEngine::getHtmlSelect('tbl_type', null, isset($_REQUEST['tbl_type']) ? $_REQUEST['tbl_type'] : null);
    ?>
        </td>
        <td width="25">&nbsp;</td>
        <td>
    <?php 
    echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null, false, 3);
    ?>
        </td>
    </tr>
    <?php 
    if (PMA_Partition::havePartitioning()) {
        ?>
    <tr valign="top">
        <th><?php 
        echo __('PARTITION definition');
        ?>
:&nbsp;<?php 
        echo PMA_showMySQLDocu('Partitioning', 'Partitioning');
        ?>
        </th>
    </tr>
    <tr>
        <td>
            <textarea name="partition_definition" id="partitiondefinition"
                cols="<?php 
        echo $GLOBALS['cfg']['TextareaCols'];
开发者ID:BGCX262,项目名称:zuozhenshi-prego-svn-to-git,代码行数:31,代码来源:tbl_properties.inc.php

示例8: PMA_getHtmlForPartitionMaintenance

/**
 * Get HTML snippet for partition maintenance
 *
 * @param array $partition_names array of partition names for a specific db/table
 * @param array $url_params      url parameters
 *
 * @return string $html_output
 */
function PMA_getHtmlForPartitionMaintenance($partition_names, $url_params)
{
    $choices = array('ANALYZE' => __('Analyze'), 'CHECK' => __('Check'), 'OPTIMIZE' => __('Optimize'), 'REBUILD' => __('Rebuild'), 'REPAIR' => __('Repair'), 'TRUNCATE' => __('Truncate'));
    $partition_method = PMA_Partition::getPartitionMethod($GLOBALS['db'], $GLOBALS['table']);
    // add COALESCE or DROP option to choices array depeding on Partition method
    if ($partition_method == 'RANGE' || $partition_method == 'LIST') {
        $choices['DROP'] = __('Drop');
    } else {
        $choices['COALESCE'] = __('Coalesce');
    }
    $html_output = '<div class="operations_half_width">' . '<form id="partitionsForm" class="ajax" ' . 'method="post" action="tbl_operations.php" >' . PMA_URL_getHiddenInputs($GLOBALS['db'], $GLOBALS['table']) . '<fieldset>' . '<legend>' . __('Partition maintenance') . PMA_Util::showMySQLDocu('partitioning_maintenance') . '</legend>';
    $html_select = '<select id="partition_name" name="partition_name[]"' . ' multiple="multiple" required="required">' . "\n";
    $first = true;
    foreach ($partition_names as $one_partition) {
        $one_partition = htmlspecialchars($one_partition);
        $html_select .= '<option value="' . $one_partition . '"';
        if ($first) {
            $html_select .= ' selected="selected"';
            $first = false;
        }
        $html_select .= '>' . $one_partition . '</option>' . "\n";
    }
    $html_select .= '</select>' . "\n";
    $html_output .= sprintf(__('Partition %s'), $html_select);
    $html_output .= '<div class="clearfloat" />';
    $html_output .= PMA_Util::getRadioFields('partition_operation', $choices, 'ANALYZE', false, true, 'floatleft');
    $this_url_params = array_merge($url_params, array('sql_query' => 'ALTER TABLE ' . PMA_Util::backquote($GLOBALS['table']) . ' REMOVE PARTITIONING;'));
    $html_output .= '<div class="clearfloat" /><br />';
    $html_output .= '<a href="sql.php' . PMA_URL_getCommon($this_url_params) . '">' . __('Remove partitioning') . '</a>';
    $html_output .= '</fieldset>' . '<fieldset class="tblFooters">' . '<input type="hidden" name="submit_partition" value="1">' . '<input type="submit" value="' . __('Go') . '" />' . '</fieldset>' . '</form>' . '</div>';
    return $html_output;
}
开发者ID:mi-squared,项目名称:openemr,代码行数:40,代码来源:operations.lib.php

示例9: array

$response->addHTML(PMA_getHtmlForTableMaintenance($is_myisam_or_aria, $is_innodb, $is_berkeleydb, $url_params));
if (!(isset($db_is_system_schema) && $db_is_system_schema)) {
    $truncate_table_url_params = array();
    $drop_table_url_params = array();
    if (!$tbl_is_view && !(isset($db_is_system_schema) && $db_is_system_schema)) {
        $this_sql_query = 'TRUNCATE TABLE ' . PMA_Util::backquote($GLOBALS['table']);
        $truncate_table_url_params = array_merge($url_params, array('sql_query' => $this_sql_query, 'goto' => 'tbl_structure.php', 'reload' => '1', 'message_to_show' => sprintf(__('Table %s has been emptied.'), htmlspecialchars($table))));
    }
    if (!(isset($db_is_system_schema) && $db_is_system_schema)) {
        $this_sql_query = 'DROP TABLE ' . PMA_Util::backquote($GLOBALS['table']);
        $drop_table_url_params = array_merge($url_params, array('sql_query' => $this_sql_query, 'goto' => 'db_operations.php', 'reload' => '1', 'purge' => '1', 'message_to_show' => sprintf($tbl_is_view ? __('View %s has been dropped.') : __('Table %s has been dropped.'), htmlspecialchars($table)), 'table' => $GLOBALS['table']));
    }
    $response->addHTML(PMA_getHtmlForDeleteDataOrTable($truncate_table_url_params, $drop_table_url_params));
}
if (PMA_Partition::havePartitioning()) {
    $partition_names = PMA_Partition::getPartitionNames($db, $table);
    // show the Partition maintenance section only if we detect a partition
    if (!is_null($partition_names[0])) {
        $response->addHTML(PMA_getHtmlForPartitionMaintenance($partition_names, $url_params));
    }
    // end if
}
// end if
unset($partition_names);
// Referential integrity check
// The Referential integrity check was intended for the non-InnoDB
// tables for which the relations are defined in pmadb
// so I assume that if the current table is InnoDB, I don't display
// this choice (InnoDB maintains integrity by itself)
if ($cfgRelation['relwork'] && !$is_innodb) {
    $GLOBALS['dbi']->selectDb($GLOBALS['db']);
开发者ID:Sorekk,项目名称:cvillecouncilus,代码行数:31,代码来源:tbl_operations.php


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