本文整理汇总了PHP中PMA\libraries\Util::getDbInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::getDbInfo方法的具体用法?PHP Util::getDbInfo怎么用?PHP Util::getDbInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA\libraries\Util
的用法示例。
在下文中一共展示了Util::getDbInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getDbInfo
/**
* Retrieves databse information for further use
*
* @param string $sub_part Page part name
*
* @return void
*/
private function _getDbInfo($sub_part)
{
list($tables, $num_tables, $total_num_tables, , $is_show_stats, $db_is_system_schema, , , $pos) = Util::getDbInfo($this->db, $sub_part);
$this->_tables = $tables;
$this->_num_tables = $num_tables;
$this->_pos = $pos;
$this->_db_is_system_schema = $db_is_system_schema;
$this->_total_num_tables = $total_num_tables;
$this->_is_show_stats = $is_show_stats;
}
示例2: indexAction
/**
* Index action
*
* @return void
*/
public function indexAction()
{
// Add/Remove favorite tables using Ajax request.
if ($GLOBALS['is_ajax_request'] && !empty($_REQUEST['favorite_table'])) {
$this->addRemoveFavoriteTablesAction();
return;
}
// If there is an Ajax request for real row count of a table.
if ($GLOBALS['is_ajax_request'] && isset($_REQUEST['real_row_count']) && $_REQUEST['real_row_count'] == true) {
$this->handleRealRowCountRequestAction();
return;
}
// Drops/deletes/etc. multiple tables if required
if (!empty($_POST['submit_mult']) && isset($_POST['selected_tbl']) || isset($_POST['mult_btn'])) {
$this->multiSubmitAction();
}
$this->response->getHeader()->getScripts()->addFiles(array('db_structure.js', 'tbl_change.js', 'jquery/jquery-ui-timepicker-addon.js'));
$this->_url_query .= '&goto=db_structure.php';
// Gets the database structure
$sub_part = '_structure';
list($tables, $num_tables, $total_num_tables, , $is_show_stats, $db_is_system_schema, , , $pos) = Util::getDbInfo($GLOBALS['db'], $sub_part);
$this->_tables = $tables;
// updating $tables seems enough for #11376, but updating other
// variables too in case they may cause some other problem.
$this->_num_tables = $num_tables;
$this->_pos = $pos;
$this->_db_is_system_schema = $db_is_system_schema;
$this->_total_num_tables = $total_num_tables;
$this->_is_show_stats = $is_show_stats;
include_once 'libraries/replication.inc.php';
PageSettings::showGroup('DbStructure');
// 1. No tables
if ($this->_num_tables == 0) {
$this->response->addHTML(Message::notice(__('No tables found in database.')));
if (empty($db_is_system_schema)) {
$this->response->addHTML(PMA_getHtmlForCreateTable($this->db));
}
return;
}
// else
// 2. Shows table information
/**
* Displays the tables list
*/
$this->response->addHTML('<div id="tableslistcontainer">');
$_url_params = array('pos' => $this->_pos, 'db' => $this->db);
// Add the sort options if they exists
if (isset($_REQUEST['sort'])) {
$_url_params['sort'] = $_REQUEST['sort'];
}
if (isset($_REQUEST['sort_order'])) {
$_url_params['sort_order'] = $_REQUEST['sort_order'];
}
$this->response->addHTML(Util::getListNavigator($this->_total_num_tables, $this->_pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']));
$this->displayTableList();
// display again the table list navigator
$this->response->addHTML(Util::getListNavigator($this->_total_num_tables, $this->_pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']));
$this->response->addHTML('</div><hr />');
/**
* Work on the database
*/
/* DATABASE WORK */
/* Printable view of a table */
$this->response->addHTML(Template::get('database/structure/print_view_data_dictionary_link')->render(array('url_query' => $this->_url_query)));
if (empty($this->_db_is_system_schema)) {
$this->response->addHTML(PMA_getHtmlForCreateTable($this->db));
}
}
示例3: isset
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Database structure manipulation
*
* @package PhpMyAdmin
*/
namespace PMA;
use PMA\libraries\controllers\database\DatabaseStructureController;
use PMA\libraries\Response;
use PMA\libraries\Util;
require_once 'libraries/common.inc.php';
require_once 'libraries/db_common.inc.php';
list($tables, $num_tables, $total_num_tables, $sub_part, $is_show_stats, $db_is_system_schema, $tooltip_truename, $tooltip_aliasname, $pos) = Util::getDbInfo($GLOBALS['db'], isset($sub_part) ? $sub_part : '');
$container = libraries\di\Container::getDefaultContainer();
$container->factory('PMA\\libraries\\controllers\\database\\DatabaseStructureController');
$container->alias('DatabaseStructureController', 'PMA\\libraries\\controllers\\database\\DatabaseStructureController');
$container->set('PMA\\libraries\\Response', Response::getInstance());
$container->alias('response', 'PMA\\libraries\\Response');
global $db, $pos, $db_is_system_schema, $total_num_tables, $tables, $num_tables;
/* Define dependencies for the concerned controller */
$dependency_definitions = array('db' => $db, 'url_query' => &$GLOBALS['url_query'], 'pos' => $pos, 'db_is_system_schema' => $db_is_system_schema, 'num_tables' => $num_tables, 'total_num_tables' => $total_num_tables, 'tables' => $tables);
/** @var DatabaseStructureController $controller */
$controller = $container->get('DatabaseStructureController', $dependency_definitions);
$controller->indexAction();
示例4: indexAction
/**
* Index action
*
* @return void
*/
public function indexAction()
{
// Add/Remove favorite tables using Ajax request.
if ($GLOBALS['is_ajax_request'] && !empty($_REQUEST['favorite_table'])) {
$this->addRemoveFavoriteTablesAction();
return;
}
$this->response->getHeader()->getScripts()->addFiles(array('db_structure.js', 'tbl_change.js', 'jquery/jquery-ui-timepicker-addon.js'));
// Drops/deletes/etc. multiple tables if required
if (!empty($_POST['submit_mult']) && isset($_POST['selected_tbl']) || isset($_POST['mult_btn'])) {
$action = 'db_structure.php';
$err_url = 'db_structure.php' . PMA_URL_getCommon(array('db' => $this->db));
// see bug #2794840; in this case, code path is:
// db_structure.php -> libraries/mult_submits.inc.php -> sql.php
// -> db_structure.php and if we got an error on the multi submit,
// we must display it here and not call again mult_submits.inc.php
if (!isset($_POST['error']) || false === $_POST['error']) {
include 'libraries/mult_submits.inc.php';
}
if (empty($_POST['message'])) {
$_POST['message'] = Message::success();
}
}
$this->_url_query .= '&goto=db_structure.php';
// Gets the database structure
$sub_part = '_structure';
list($tables, $num_tables, $total_num_tables, , $is_show_stats, $db_is_system_schema, $tooltip_truename, $tooltip_aliasname, $pos) = Util::getDbInfo($GLOBALS['db'], isset($sub_part) ? $sub_part : '');
$this->_tables = $tables;
// updating $tables seems enough for #11376, but updating other
// variables too in case they may cause some other problem.
$this->_num_tables = $num_tables;
$this->_pos = $pos;
$this->_db_is_system_schema = $db_is_system_schema;
$this->_total_num_tables = $total_num_tables;
$this->_is_show_stats = $is_show_stats;
// If there is an Ajax request for real row count of a table.
if ($GLOBALS['is_ajax_request'] && isset($_REQUEST['real_row_count']) && $_REQUEST['real_row_count'] == true) {
$this->handleRealRowCountRequestAction();
return;
}
include_once 'libraries/replication.inc.php';
PageSettings::showGroup('DbStructure');
$db_collation = PMA_getDbCollation($this->db);
$titles = Util::buildActionTitles();
// 1. No tables
if ($this->_num_tables == 0) {
$this->response->addHTML(Message::notice(__('No tables found in database.')));
if (empty($db_is_system_schema)) {
$this->response->addHTML(PMA_getHtmlForCreateTable($this->db));
}
return;
}
// else
// 2. Shows table information
/**
* Displays the tables list
*/
$this->response->addHTML('<div id="tableslistcontainer">');
$_url_params = array('pos' => $this->_pos, 'db' => $this->db);
// Add the sort options if they exists
if (isset($_REQUEST['sort'])) {
$_url_params['sort'] = $_REQUEST['sort'];
}
if (isset($_REQUEST['sort_order'])) {
$_url_params['sort_order'] = $_REQUEST['sort_order'];
}
$this->response->addHTML(Util::getListNavigator($this->_total_num_tables, $this->_pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']));
// table form
$this->response->addHTML(Template::get('database/structure/table_header')->render(array('db' => $this->db, 'db_is_system_schema' => $this->_db_is_system_schema, 'replication' => $GLOBALS['replication_info']['slave']['status'])));
$i = $sum_entries = 0;
$overhead_check = '';
$create_time_all = '';
$update_time_all = '';
$check_time_all = '';
$num_columns = $GLOBALS['cfg']['PropertiesNumColumns'] > 1 ? ceil($this->_num_tables / $GLOBALS['cfg']['PropertiesNumColumns']) + 1 : 0;
$row_count = 0;
$sum_size = (double) 0;
$overhead_size = (double) 0;
$hidden_fields = array();
$odd_row = true;
$overall_approx_rows = false;
// Instance of RecentFavoriteTable class.
$fav_instance = RecentFavoriteTable::getInstance('favorite');
foreach ($this->_tables as $keyname => $current_table) {
// Get valid statistics whatever is the table type
$drop_query = '';
$drop_message = '';
$overhead = '';
$table_is_view = false;
$table_encoded = urlencode($current_table['TABLE_NAME']);
// Sets parameters for links
$tbl_url_query = $this->_url_query . '&table=' . $table_encoded;
// do not list the previous table's size info for a view
list($current_table, $formatted_size, $unit, $formatted_overhead, $overhead_unit, $overhead_size, $table_is_view, $sum_size) = $this->getStuffForEngineTypeTable($current_table, $sum_size, $overhead_size);
$curTable = $this->dbi->getTable($this->db, $current_table['TABLE_NAME']);
//.........这里部分代码省略.........