本文整理汇总了PHP中PMA_StorageEngine类的典型用法代码示例。如果您正苦于以下问题:PHP PMA_StorageEngine类的具体用法?PHP PMA_StorageEngine怎么用?PHP PMA_StorageEngine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_StorageEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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"> </td>' . '<th>' . __('Storage Engine:') . PMA_Util::showMySQLDocu('Storage_engines') . '</th>' . '<td width="25"> </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"> </td>' . '<td>' . PMA_StorageEngine::getHtmlSelect('tbl_storage_engine', null, isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null) . '</td>' . '<td width="25"> </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:') . ' ' . 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;
}
示例2: 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"> </td>' . '<th>' . __('Collation:') . '</th>' . '<td width="25"> </td>' . '<th>' . __('Storage Engine:') . PMA_Util::showMySQLDocu('Storage_engines') . '</th>' . '<td width="25"> </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"> </td>' . '<td>' . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null, false) . '</td>' . '<td width="25"> </td>' . '<td>' . PMA_StorageEngine::getHtmlSelect('tbl_storage_engine', null, isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null) . '</td>' . '<td width="25"> </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:') . ' ' . 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;
}
示例3: PMA_getHtmlForSpecifiedServerEngines
/**
* setup HTML for a given Storage Engine
*
* @return string
*/
function PMA_getHtmlForSpecifiedServerEngines()
{
/**
* Displays details about a given Storage Engine
*/
$html = '';
$engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
$html .= '<h2>' . "\n" . PMA_Util::getImage('b_engine.png') . ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n" . ' ' . PMA_Util::showMySQLDocu($engine_plugin->getMysqlHelpPage()) . "\n" . '</h2>' . "\n\n";
$html .= '<p>' . "\n" . ' <em>' . "\n" . ' ' . htmlspecialchars($engine_plugin->getComment()) . "\n" . ' </em>' . "\n" . '</p>' . "\n\n";
$infoPages = $engine_plugin->getInfoPages();
if (!empty($infoPages) && is_array($infoPages)) {
$html .= '<p>' . "\n" . ' <strong>[</strong>' . "\n";
if (empty($_REQUEST['page'])) {
$html .= ' <strong>' . __('Variables') . '</strong>' . "\n";
} else {
$html .= ' <a href="server_engines.php' . PMA_URL_getCommon(array('engine' => $_REQUEST['engine'])) . '">' . __('Variables') . '</a>' . "\n";
}
foreach ($infoPages as $current => $label) {
$html .= ' <strong>|</strong>' . "\n";
if (isset($_REQUEST['page']) && $_REQUEST['page'] == $current) {
$html .= ' <strong>' . $label . '</strong>' . "\n";
} else {
$html .= ' <a href="server_engines.php' . PMA_URL_getCommon(array('engine' => $_REQUEST['engine'], 'page' => $current)) . '">' . htmlspecialchars($label) . '</a>' . "\n";
}
}
unset($current, $label);
$html .= ' <strong>]</strong>' . "\n" . '</p>' . "\n\n";
}
unset($infoPages, $page_output);
if (!empty($_REQUEST['page'])) {
$page_output = $engine_plugin->getPage($_REQUEST['page']);
}
if (!empty($page_output)) {
$html .= $page_output;
} else {
$html .= '<p> ' . $engine_plugin->getSupportInformationMessage() . "\n" . '</p>' . "\n" . $engine_plugin->getHtmlVariables();
}
return $html;
}
示例4: PMA_getPossibleRowFormat
/**
* Get array of possible row formats
*
* @return array $possible_row_formats
*/
function PMA_getPossibleRowFormat()
{
// the outer array is for engines, the inner array contains the dropdown
// option values as keys then the dropdown option labels
$possible_row_formats = array('ARIA' => array('FIXED' => 'FIXED', 'DYNAMIC' => 'DYNAMIC', 'PAGE' => 'PAGE'), 'MARIA' => array('FIXED' => 'FIXED', 'DYNAMIC' => 'DYNAMIC', 'PAGE' => 'PAGE'), 'MYISAM' => array('FIXED' => 'FIXED', 'DYNAMIC' => 'DYNAMIC'), 'PBXT' => array('FIXED' => 'FIXED', 'DYNAMIC' => 'DYNAMIC'), 'INNODB' => array('COMPACT' => 'COMPACT', 'REDUNDANT' => 'REDUNDANT'));
/** @var PMA_StorageEngine_Innodb $innodbEnginePlugin */
$innodbEnginePlugin = PMA_StorageEngine::getEngine('innodb');
$innodbPluginVersion = $innodbEnginePlugin->getInnodbPluginVersion();
if (!empty($innodbPluginVersion)) {
$innodb_file_format = $innodbEnginePlugin->getInnodbFileFormat();
} else {
$innodb_file_format = '';
}
if ('Barracuda' == $innodb_file_format && $innodbEnginePlugin->supportsFilePerTable()) {
$possible_row_formats['INNODB']['DYNAMIC'] = 'DYNAMIC';
$possible_row_formats['INNODB']['COMPRESSED'] = 'COMPRESSED';
}
return $possible_row_formats;
}
示例5: __construct
/**
* Constructor
*
* @param string $engine The engine ID
*/
function __construct($engine)
{
$storage_engines = PMA_StorageEngine::getStorageEngines();
if (!empty($storage_engines[$engine])) {
$this->engine = $engine;
$this->title = $storage_engines[$engine]['Engine'];
$this->comment = isset($storage_engines[$engine]['Comment']) ? $storage_engines[$engine]['Comment'] : '';
switch ($storage_engines[$engine]['Support']) {
case 'DEFAULT':
$this->support = PMA_ENGINE_SUPPORT_DEFAULT;
break;
case 'YES':
$this->support = PMA_ENGINE_SUPPORT_YES;
break;
case 'DISABLED':
$this->support = PMA_ENGINE_SUPPORT_DISABLED;
break;
case 'NO':
default:
$this->support = PMA_ENGINE_SUPPORT_NO;
}
}
}
示例6: htmlspecialchars
. ' </a></td>' . "\n"
. ' <td>' . htmlspecialchars($details['Comment']) . '</td>' . "\n"
. '</tr>' . "\n";
$odd_row = !$odd_row;
}
unset($odd_row, $engine, $details);
echo '</tbody>' . "\n"
. '</table>' . "\n";
} else {
/**
* Displays details about a given Storage Engine
*/
$engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
echo '<h2>' . "\n"
. ($GLOBALS['cfg']['MainPageIconic']
? '<img class="icon" src="' . $pmaThemeImage . 'b_engine.png"'
.' width="16" height="16" alt="" />' : '')
. ' ' . htmlspecialchars($engine_plugin->getTitle()) . "\n"
. ' ' . PMA_showMySQLDocu('', $engine_plugin->getMysqlHelpPage()) . "\n"
. '</h2>' . "\n\n";
echo '<p>' . "\n"
. ' <em>' . "\n"
. ' ' . htmlspecialchars($engine_plugin->getComment()) . "\n"
. ' </em>' . "\n"
. '</p>' . "\n\n";
$infoPages = $engine_plugin->getInfoPages();
if (!empty($infoPages) && is_array($infoPages)) {
echo '<p>' . "\n"
示例7: isValid
/**
* Returns true if given engine name is supported/valid, otherwise false
*
* @param string $engine name of engine
*
* @static
* @return boolean whether $engine is valid or not
*/
public static function isValid($engine)
{
if ($engine == "PBMS") {
return true;
}
$storage_engines = PMA_StorageEngine::getStorageEngines();
return isset($storage_engines[$engine]);
}
示例8: showCreatePageDialog
/**
* shows/displays the HTML FORM to create the page
*
* @param string $db name of the selected database
*
* @return void
* @access public
*/
public function showCreatePageDialog($db)
{
?>
<form method="post" action="schema_edit.php" name="frm_create_page">
<fieldset>
<legend>
<?php
echo __('Create a page') . "\n";
?>
</legend>
<?php
echo PMA_generate_common_hidden_inputs($db);
?>
<input type="hidden" name="do" value="createpage" />
<table>
<tr>
<td><label for="id_newpage"><?php
echo __('Page name');
?>
</label></td>
<td><input type="text" name="newpage" id="id_newpage" size="20" maxlength="50" /></td>
</tr>
<tr>
<td><?php
echo __('Automatic layout based on');
?>
</td>
<td>
<input type="checkbox" name="auto_layout_internal" id="id_auto_layout_internal" /><label for="id_auto_layout_internal">
<?php
echo __('Internal relations');
?>
</label><br />
<?php
/*
* Check to see whether INNODB and PBXT storage engines are Available in MYSQL PACKAGE
* If available, then provide AutoLayout for Foreign Keys in Schema View
*/
if (PMA_StorageEngine::isValid('InnoDB') || PMA_StorageEngine::isValid('PBXT')) {
?>
<input type="checkbox" name="auto_layout_foreign" id="id_auto_layout_foreign" /><label for="id_auto_layout_foreign">
<?php
echo __('FOREIGN KEY');
?>
</label><br />
<?php
}
?>
</td></tr>
</table>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" value="<?php
echo __('Go');
?>
" />
</fieldset>
</form>
<?php
}
示例9: array
if (isset($auto_increment) && strlen($auto_increment) > 0 && ($is_myisam_or_maria || $is_innodb || $is_pbxt)) {
?>
<tr><td><label for="auto_increment_opt">AUTO_INCREMENT</label></td>
<td><input type="text" name="new_auto_increment" id="auto_increment_opt"
value="<?php
echo $auto_increment;
?>
" /></td>
</tr>
<?php
}
// end if (MYISAM|INNODB)
// the outer array is for engines, the inner array contains the dropdown
// option values as keys then the dropdown option labels
$possible_row_formats = array('MARIA' => array('FIXED' => 'FIXED', 'DYNAMIC' => 'DYNAMIC', 'PAGE' => 'PAGE'), 'MYISAM' => array('FIXED' => 'FIXED', 'DYNAMIC' => 'DYNAMIC'), 'PBXT' => array('FIXED' => 'FIXED', 'DYNAMIC' => 'DYNAMIC'), 'INNODB' => array('COMPACT' => 'COMPACT', 'REDUNDANT' => 'REDUNDANT'));
$innodb_engine_plugin = PMA_StorageEngine::getEngine('innodb');
$innodb_plugin_version = $innodb_engine_plugin->getInnodbPluginVersion();
if (!empty($innodb_plugin_version)) {
$innodb_file_format = $innodb_engine_plugin->getInnodbFileFormat();
} else {
$innodb_file_format = '';
}
if ('Barracuda' == $innodb_file_format && $innodb_engine_plugin->supportsFilePerTable()) {
$possible_row_formats['INNODB']['DYNAMIC'] = 'DYNAMIC';
$possible_row_formats['INNODB']['COMPRESSED'] = 'COMPRESSED';
}
unset($innodb_engine_plugin, $innodb_plugin_version, $innodb_file_format);
// for MYISAM there is also COMPRESSED but it can be set only by the
// myisampack utility, so don't offer here the choice because if we
// try it inside an ALTER TABLE, MySQL (at least in 5.1.23-maria)
// does not return a warning
示例10: testPMAGetHtmlForSpecifiedServerEngines
/**
* Test for PMA_getHtmlForSpecifiedServerEngines
*
* @return void
*/
public function testPMAGetHtmlForSpecifiedServerEngines()
{
$_REQUEST['engine'] = "pbxt";
$_REQUEST['page'] = "page";
//Mock DBI
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock();
$GLOBALS['dbi'] = $dbi;
//test PMA_getHtmlForSpecifiedServerEngines
$html = PMA_getHtmlForSpecifiedServerEngines();
$engine_plugin = PMA_StorageEngine::getEngine($_REQUEST['engine']);
//validate 1: Engine title
$this->assertContains(htmlspecialchars($engine_plugin->getTitle()), $html);
//validate 2: Engine Mysql Help Page
$this->assertContains(PMA_Util::showMySQLDocu($engine_plugin->getMysqlHelpPage()), $html);
//validate 3: Engine Comment
$this->assertContains(htmlspecialchars($engine_plugin->getComment()), $html);
//validate 4: Engine Info Pages
$this->assertContains(__('Variables'), $html);
$this->assertContains(PMA_URL_getCommon(array('engine' => $_REQUEST['engine'], 'page' => "Documentation")), $html);
//validate 5: other items
$this->assertContains(PMA_URL_getCommon(array('engine' => $_REQUEST['engine'])), $html);
$this->assertContains($engine_plugin->getSupportInformationMessage(), $html);
$this->assertContains($engine_plugin->getHtmlVariables(), $html);
}
示例11: isset
if (PMA_MYSQL_INT_VERSION >= 40100) {
echo ' <td width="25"> </td>' . "\n" . ' <th>' . $strCollation . ': </th>' . "\n";
}
?>
</tr>
<tr><td><input type="text" name="comment" size="40" maxlength="80"
value="<?php
echo isset($comment) ? $comment : '';
?>
"
class="textfield" />
</td>
<td width="25"> </td>
<td>
<?php
echo PMA_StorageEngine::getHtmlSelect('tbl_type', null, isset($GLOBALS['tbl_type']) ? $GLOBALS['tbl_type'] : null);
?>
</td>
<?php
if (PMA_MYSQL_INT_VERSION >= 40100) {
echo ' <td width="25"> </td>' . "\n" . ' <td>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($tbl_collation) ? $tbl_collation : null, FALSE, 3) . ' </td>' . "\n";
}
?>
</tr>
</table>
<br />
<?php
}
// end if ($action == 'tbl_create.php')
?>
示例12: preg_replace
var new_fields = document.getElementById('added_fields').value;
var new_field_container = document.getElementById('table_columns');
var new_field = '<?php echo preg_replace('|\s+|', ' ', preg_replace('|\'|', '\\\'', $new_field)); ?>';
var i = 0;
for (i = 0; i < new_fields; i++) {
if (odd_row) {
new_field_container.innerHTML += '<tr class="odd">' + new_field + '</tr>';
} else {
new_field_container.innerHTML += '<tr class="even">' + new_field + '</tr>';
}
odd_row = ! odd_row;
}
return true;
}
// ]]>
</script>
<?php
}
*/
if ($action == 'tbl_create.php') {
$html .= '<table>' . '<tr class="vtop">' . '<th>' . __('Table comments') . ': </th>' . '<td width="25"> </td>' . '<th>' . __('Storage Engine') . ':' . PMA_Util::showMySQLDocu('Storage_engines', 'Storage_engines') . '</th>' . '<td width="25"> </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"> </td>' . '<td>' . PMA_StorageEngine::getHtmlSelect('tbl_storage_engine', null, isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null) . '</td>' . '<td width="25"> </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') . ': ' . PMA_Util::showMySQLDocu('Partitioning', '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 />';
}
// end if ($action == 'tbl_create.php')
$html .= '<fieldset class="tblFooters">' . '<input type="submit" name="do_save_data" value="' . __('Save') . '" />' . '</fieldset>' . '<div id="properties_message"></div>' . '</form>';
$html .= '<div id="popup_background"></div>';
PMA_Response::getInstance()->addHTML($html);
示例13: PMA_generate_common_hidden_inputs
<form method="post" action="pdf_pages.php" name="crpage">
<fieldset>
<legend>
<?php
echo $strCreatePage . "\n";
?>
</legend>
<?php
echo PMA_generate_common_hidden_inputs($db, $table);
?>
<input type="hidden" name="do" value="createpage" />
<input type="text" name="newpage" size="20" maxlength="50" />
<input type="checkbox" name="auto_layout_internal" />
<?php
echo '(' . $strAutomaticLayout . ' / ' . $strInternalRelations . ')';
if (PMA_StorageEngine::isValid('InnoDB') || PMA_StorageEngine::isValid('PBXT')) {
echo '<input type="checkbox" name="auto_layout_foreign" />' . '(' . $strAutomaticLayout . ' / FOREIGN KEY)';
}
?>
<input type="submit" value="<?php
echo $strGo;
?>
" />
</fieldset>
</form>
<?php
// Now if we already have chosen a page number then we should show the
// tables involved
if (isset($chpage) && $chpage > 0) {
echo "\n";
?>
示例14: testGetEngine
/**
* Test for PMA_StorageEngine::getEngine
*
* @param string $expectedClass Class that should be selected
* @param string $engineName Engine name
*
* @return void
*
* @dataProvider providerGetEngine
*/
public function testGetEngine($expectedClass, $engineName)
{
$this->assertInstanceOf($expectedClass, PMA_StorageEngine::getEngine($engineName));
}
示例15: __
<th><?php
echo __('Collation');
?>
: </th>
</tr>
<tr><td><input type="text" name="comment" size="40" maxlength="80"
value="<?php
echo isset($_REQUEST['comment']) ? htmlspecialchars($_REQUEST['comment']) : '';
?>
"
class="textfield" />
</td>
<td width="25"> </td>
<td>
<?php
echo PMA_StorageEngine::getHtmlSelect('tbl_type', null, isset($_REQUEST['tbl_type']) ? $_REQUEST['tbl_type'] : null);
?>
</td>
<td width="25"> </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');