本文整理汇总了PHP中PMA_Tracker类的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Tracker类的具体用法?PHP PMA_Tracker怎么用?PHP PMA_Tracker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_Tracker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getHtmlForActionLinks
/**
* Get the HTML links for action links
* Actions are, Browse, Search, Browse table label, empty table
*
* @param array $current_table current table
* @param boolean $table_is_view Is table view or not
* @param string $tbl_url_query table url query
* @param array $titles titles and icons for action links
* @param string $truename table name
* @param boolean $db_is_system_schema is database information schema or not
* @param string $url_query url query
*
* @return array ($browse_table, $search_table, $browse_table_label, $empty_table,
* $tracking_icon)
*/
function PMA_getHtmlForActionLinks($current_table, $table_is_view, $tbl_url_query, $titles, $truename, $db_is_system_schema, $url_query)
{
$empty_table = '';
if ($current_table['TABLE_ROWS'] > 0 || $table_is_view) {
$may_have_rows = true;
} else {
$may_have_rows = false;
}
$browse_table = '<a href="sql.php' . $tbl_url_query . '&pos=0">';
if ($may_have_rows) {
$browse_table .= $titles['Browse'];
} else {
$browse_table .= $titles['NoBrowse'];
}
$browse_table .= '</a>';
$search_table = '<a href="tbl_select.php' . $tbl_url_query . '">';
if ($may_have_rows) {
$search_table .= $titles['Search'];
} else {
$search_table .= $titles['NoSearch'];
}
$search_table .= '</a>';
$browse_table_label = '<a href="sql.php' . $tbl_url_query . '&pos=0" title="' . htmlspecialchars($current_table['TABLE_COMMENT']) . '">' . $truename . '</a>';
if (!$db_is_system_schema) {
$empty_table = '<a class="truncate_table_anchor ajax"';
$empty_table .= ' href="sql.php' . $tbl_url_query . '&sql_query=';
$empty_table .= urlencode('TRUNCATE ' . PMA_Util::backquote($current_table['TABLE_NAME']));
$empty_table .= '&message_to_show=' . urlencode(sprintf(__('Table %s has been emptied.'), htmlspecialchars($current_table['TABLE_NAME']))) . '">';
if ($may_have_rows) {
$empty_table .= $titles['Empty'];
} else {
$empty_table .= $titles['NoEmpty'];
}
$empty_table .= '</a>';
// truncating views doesn't work
if ($table_is_view) {
$empty_table = ' ';
}
}
$tracking_icon = '';
if (PMA_Tracker::isActive()) {
if (PMA_Tracker::isTracked($GLOBALS["db"], $truename)) {
$tracking_icon = '<a href="tbl_tracking.php' . $url_query . '&table=' . $truename . '">' . PMA_Util::getImage('eye.png', __('Tracking is active.')) . '</a>';
} elseif (PMA_Tracker::getVersion($GLOBALS["db"], $truename) > 0) {
$tracking_icon = '<a href="tbl_tracking.php' . $url_query . '&table=' . $truename . '">' . PMA_Util::getImage('eye_grey.png', __('Tracking is not active.')) . '</a>';
}
}
return array($browse_table, $search_table, $browse_table_label, $empty_table, $tracking_icon);
}
示例2:
if (isset($response) && $response->isAjax() && $token_mismatch) {
$response->isSuccess(false);
$response->addJSON('message', PMA_Message::error(__('Error: Token mismatch')));
exit;
}
} else {
// end if !defined('PMA_MINIMUM_COMMON')
// load user preferences
$GLOBALS['PMA_Config']->loadUserPreferences();
}
// remove sensitive values from session
$GLOBALS['PMA_Config']->set('blowfish_secret', '');
$GLOBALS['PMA_Config']->set('Servers', '');
$GLOBALS['PMA_Config']->set('default_server', '');
/* Tell tracker that it can actually work */
PMA_Tracker::enable();
/**
* @global boolean $GLOBALS['is_ajax_request']
* @todo should this be moved to the variables init section above?
*
* Check if the current request is an AJAX request, and set is_ajax_request
* accordingly. Suppress headers, footers and unnecessary output if set to
* true
*/
if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
$GLOBALS['is_ajax_request'] = true;
} else {
$GLOBALS['is_ajax_request'] = false;
}
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
PMA_fatalError(__("GLOBALS overwrite attempt"));
示例3: urlencode
if ($GLOBALS['cfg']['AjaxEnable']) {
$empty_table .= 'class="truncate_table_anchor"';
}
$empty_table .= ' href="sql.php?' . $tbl_url_query . '&sql_query=';
$empty_table .= urlencode('TRUNCATE ' . PMA_backquote($each_table['TABLE_NAME'])) . '&message_to_show=' . urlencode(sprintf(__('Table %s has been emptied'), htmlspecialchars($each_table['TABLE_NAME']))) . '">' . $titles['Empty'] . '</a>';
} else {
$empty_table = $titles['NoEmpty'];
}
$drop_query = 'DROP ' . ($table_is_view ? 'VIEW' : 'TABLE') . ' ' . PMA_backquote($each_table['TABLE_NAME']);
$drop_message = sprintf($table_is_view ? __('View %s has been dropped') : __('Table %s has been dropped'), str_replace(' ', ' ', htmlspecialchars($each_table['TABLE_NAME'])));
}
$tracking_icon = '';
if (PMA_Tracker::isActive()) {
if (PMA_Tracker::isTracked($GLOBALS["db"], $truename)) {
$tracking_icon = '<a href="tbl_tracking.php?' . $url_query . '&table=' . $truename . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye.png" alt="' . __('Tracking is active.') . '" title="' . __('Tracking is active.') . '" /></a>';
} elseif (PMA_Tracker::getVersion($GLOBALS["db"], $truename) > 0) {
$tracking_icon = '<a href="tbl_tracking.php?' . $url_query . '&table=' . $truename . '"><img class="icon" width="14" height="14" src="' . $pmaThemeImage . 'eye_grey.png" alt="' . __('Tracking is not active.') . '" title="' . __('Tracking is not active.') . '" /></a>';
}
}
if ($num_columns > 0 && $num_tables > $num_columns && $row_count % $num_columns == 0) {
$row_count = 1;
$odd_row = true;
?>
</tr>
</tbody>
</table>
<?php
PMA_TableHeader(false, $server_slave_status);
}
$ignored = false;
$do = false;
示例4: __
$tabs['tracking']['icon'] = 'eye.png';
$tabs['tracking']['text'] = __('Tracking');
$tabs['tracking']['link'] = 'tbl_tracking.php';
}
if (!$tbl_is_view && !(isset($db_is_information_schema) && $db_is_information_schema)) {
}
/**
* Views support a limited number of operations
*/
if ($tbl_is_view && !(isset($db_is_information_schema) && $db_is_information_schema)) {
$tabs['operation']['icon'] = 'b_tblops.png';
$tabs['operation']['link'] = 'view_operations.php';
$tabs['operation']['text'] = __('Operations');
}
if ($table_info_num_rows == 0 && !$tbl_is_view) {
$tabs['browse']['warning'] = __('Table seems to be empty!');
$tabs['search']['warning'] = __('Table seems to be empty!');
}
echo PMA_generate_html_tabs($tabs, $url_params);
unset($tabs);
if (PMA_Tracker::isActive() and PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"])) {
$msg = PMA_Message::notice('<a href="tbl_tracking.php?' . $url_query . '">' . sprintf(__('Tracking of %s.%s is activated.'), htmlspecialchars($GLOBALS["db"]), htmlspecialchars($GLOBALS["table"])) . '</a>');
$msg->display();
}
/**
* Displays a message
*/
if (!empty($message)) {
PMA_showMessage($message);
unset($message);
}
示例5: urlencode
?>
<a href="sql.php?<?php
echo $url_query;
?>
&session_max_rows=all&sql_query=<?php
echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()');
?>
"><?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'b_tblanalyse.png" width="16" height="16" alt="' . $strStructPropose . '" />';
}
echo $strStructPropose;
?>
</a><?php
echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n";
if (PMA_Tracker::isActive()) {
echo '<a href="tbl_tracking.php?' . $url_query . '">';
if ($cfg['PropertiesIconic']) {
echo '<img class="icon" src="' . $pmaThemeImage . 'eye.png" width="16" height="16" alt="' . $strTrackingTrackTable . '" /> ';
}
echo $strTrackingTrackTable . '</a>';
}
?>
<br />
<form method="post" action="tbl_addfield.php"
onsubmit="return checkFormElementInRange(this, 'num_fields', '<?php
echo str_replace('\'', '\\\'', $GLOBALS['strInvalidFieldAddCount']);
?>
', 1)">
<?php
示例6: _getDbTabs
/**
* Returns the db tabs as an array
*
* @return array Data for generating db tabs
*/
private function _getDbTabs()
{
$db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($this->_db);
$num_tables = count($GLOBALS['dbi']->getTables($this->_db));
$is_superuser = $GLOBALS['dbi']->isSuperuser();
$isCreateOrGrantUser = $GLOBALS['dbi']->isUserType('grant') || $GLOBALS['dbi']->isUserType('create');
/**
* Gets the relation settings
*/
$cfgRelation = PMA_getRelationsParam();
$tabs = array();
$tabs['structure']['link'] = 'db_structure.php';
$tabs['structure']['text'] = __('Structure');
$tabs['structure']['icon'] = 'b_props.png';
$tabs['sql']['link'] = 'db_sql.php';
$tabs['sql']['text'] = __('SQL');
$tabs['sql']['icon'] = 'b_sql.png';
$tabs['search']['text'] = __('Search');
$tabs['search']['icon'] = 'b_search.png';
$tabs['search']['link'] = 'db_search.php';
if ($num_tables == 0) {
$tabs['search']['warning'] = __('Database seems to be empty!');
}
$tabs['qbe']['text'] = __('Query');
$tabs['qbe']['icon'] = 's_db.png';
$tabs['qbe']['link'] = 'db_qbe.php';
if ($num_tables == 0) {
$tabs['qbe']['warning'] = __('Database seems to be empty!');
}
$tabs['export']['text'] = __('Export');
$tabs['export']['icon'] = 'b_export.png';
$tabs['export']['link'] = 'db_export.php';
if ($num_tables == 0) {
$tabs['export']['warning'] = __('Database seems to be empty!');
}
if (!$db_is_system_schema) {
$tabs['import']['link'] = 'db_import.php';
$tabs['import']['text'] = __('Import');
$tabs['import']['icon'] = 'b_import.png';
$tabs['operation']['link'] = 'db_operations.php';
$tabs['operation']['text'] = __('Operations');
$tabs['operation']['icon'] = 'b_tblops.png';
if (($is_superuser || $isCreateOrGrantUser) && !PMA_DRIZZLE) {
$tabs['privileges']['link'] = 'server_privileges.php';
$tabs['privileges']['args']['checkprivsdb'] = $this->_db;
// stay on database view
$tabs['privileges']['args']['viewing_mode'] = 'db';
$tabs['privileges']['text'] = __('Privileges');
$tabs['privileges']['icon'] = 's_rights.png';
}
if (!PMA_DRIZZLE) {
$tabs['routines']['link'] = 'db_routines.php';
$tabs['routines']['text'] = __('Routines');
$tabs['routines']['icon'] = 'b_routines.png';
}
if (!PMA_DRIZZLE && PMA_Util::currentUserHasPrivilege('EVENT', $this->_db)) {
$tabs['events']['link'] = 'db_events.php';
$tabs['events']['text'] = __('Events');
$tabs['events']['icon'] = 'b_events.png';
}
if (!PMA_DRIZZLE && PMA_Util::currentUserHasPrivilege('TRIGGER', $this->_db)) {
$tabs['triggers']['link'] = 'db_triggers.php';
$tabs['triggers']['text'] = __('Triggers');
$tabs['triggers']['icon'] = 'b_triggers.png';
}
}
if (PMA_Tracker::isActive()) {
$tabs['tracking']['text'] = __('Tracking');
$tabs['tracking']['icon'] = 'eye.png';
$tabs['tracking']['link'] = 'db_tracking.php';
}
if (!$db_is_system_schema) {
$tabs['designer']['text'] = __('Designer');
$tabs['designer']['icon'] = 'b_relations.png';
$tabs['designer']['link'] = 'db_designer.php';
$tabs['designer']['id'] = 'designer_tab';
}
if (!$db_is_system_schema && isset($cfgRelation['central_columnswork']) && $cfgRelation['central_columnswork']) {
$tabs['central_columns']['text'] = __('Central columns');
$tabs['central_columns']['icon'] = 'centralColumns.png';
$tabs['central_columns']['link'] = 'db_central_columns.php';
}
return $tabs;
}
示例7: _getDbTabs
/**
* Returns the db tabs as an array
*
* @return array Data for generating db tabs
*/
private function _getDbTabs()
{
$db_is_information_schema = PMA_is_system_schema($this->_db);
$num_tables = count(PMA_DBI_get_tables($this->_db));
$is_superuser = PMA_isSuperuser();
/**
* Gets the relation settings
*/
$cfgRelation = PMA_getRelationsParam();
$tabs = array();
$tabs['structure']['link'] = 'db_structure.php';
$tabs['structure']['text'] = __('Structure');
$tabs['structure']['icon'] = 'b_props.png';
$tabs['sql']['link'] = 'db_sql.php';
$tabs['sql']['args']['db_query_force'] = 1;
$tabs['sql']['text'] = __('SQL');
$tabs['sql']['icon'] = 'b_sql.png';
$tabs['search']['text'] = __('Search');
$tabs['search']['icon'] = 'b_search.png';
$tabs['search']['link'] = 'db_search.php';
if ($num_tables == 0) {
$tabs['search']['warning'] = __('Database seems to be empty!');
}
$tabs['qbe']['text'] = __('Query');
$tabs['qbe']['icon'] = 's_db.png';
$tabs['qbe']['link'] = 'db_qbe.php';
if ($num_tables == 0) {
$tabs['qbe']['warning'] = __('Database seems to be empty!');
}
$tabs['export']['text'] = __('Export');
$tabs['export']['icon'] = 'b_export.png';
$tabs['export']['link'] = 'db_export.php';
if ($num_tables == 0) {
$tabs['export']['warning'] = __('Database seems to be empty!');
}
if (!$db_is_information_schema) {
$tabs['import']['link'] = 'db_import.php';
$tabs['import']['text'] = __('Import');
$tabs['import']['icon'] = 'b_import.png';
$tabs['operation']['link'] = 'db_operations.php';
$tabs['operation']['text'] = __('Operations');
$tabs['operation']['icon'] = 'b_tblops.png';
if ($is_superuser && !PMA_DRIZZLE) {
$tabs['privileges']['link'] = 'server_privileges.php';
$tabs['privileges']['args']['checkprivs'] = $this->_db;
// stay on database view
$tabs['privileges']['args']['viewing_mode'] = 'db';
$tabs['privileges']['text'] = __('Privileges');
$tabs['privileges']['icon'] = 's_rights.png';
}
if (!PMA_DRIZZLE) {
$tabs['routines']['link'] = 'db_routines.php';
$tabs['routines']['text'] = __('Routines');
$tabs['routines']['icon'] = 'b_routines.png';
}
if (PMA_MYSQL_INT_VERSION >= 50106 && !PMA_DRIZZLE && PMA_Util::currentUserHasPrivilege('EVENT', $this->_db)) {
$tabs['events']['link'] = 'db_events.php';
$tabs['events']['text'] = __('Events');
$tabs['events']['icon'] = 'b_events.png';
}
if (!PMA_DRIZZLE && PMA_Util::currentUserHasPrivilege('TRIGGER', $this->_db)) {
$tabs['triggers']['link'] = 'db_triggers.php';
$tabs['triggers']['text'] = __('Triggers');
$tabs['triggers']['icon'] = 'b_triggers.png';
}
}
if (PMA_Tracker::isActive()) {
$tabs['tracking']['text'] = __('Tracking');
$tabs['tracking']['icon'] = 'eye.png';
$tabs['tracking']['link'] = 'db_tracking.php';
}
if (!$db_is_information_schema && $cfgRelation['designerwork']) {
$tabs['designer']['text'] = __('Designer');
$tabs['designer']['icon'] = 'b_relations.png';
$tabs['designer']['link'] = 'pmd_general.php';
}
return $tabs;
}
示例8: foreach
if (!empty($_REQUEST['selected_tbl'])) {
if ($_REQUEST['submit_mult'] == 'delete_tracking') {
foreach ($_REQUEST['selected_tbl'] as $table) {
PMA_Tracker::deleteTracking($GLOBALS['db'], $table);
}
PMA_Message::success(__('Tracking data deleted successfully.'))->display();
} elseif ($_REQUEST['submit_mult'] == 'track') {
echo PMA_getHtmlForDataDefinitionAndManipulationStatements('db_tracking.php' . $url_query, 0, $GLOBALS['db'], $_REQUEST['selected_tbl']);
exit;
}
} else {
PMA_Message::notice(__('No tables selected.'))->display();
}
}
// Get tracked data about the database
$data = PMA_Tracker::getTrackedData($_REQUEST['db'], '', '1');
// No tables present and no log exist
if ($num_tables == 0 && count($data['ddlog']) == 0) {
echo '<p>' . __('No tables found in database.') . '</p>' . "\n";
if (empty($db_is_system_schema)) {
echo PMA_getHtmlForCreateTable($db);
}
exit;
}
// ---------------------------------------------------------------------------
$cfgRelation = PMA_getRelationsParam();
// Prepare statement to get HEAD version
$all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' . PMA_Util::backquote($cfgRelation['db']) . '.' . PMA_Util::backquote($cfgRelation['tracking']) . ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($_REQUEST['db']) . '\' ' . ' GROUP BY table_name' . ' ORDER BY table_name ASC';
$all_tables_result = PMA_queryAsControlUser($all_tables_query);
// If a HEAD version exists
if ($GLOBALS['dbi']->numRows($all_tables_result) > 0) {
示例9: PMA_URL_getCommon
require_once './libraries/bookmark.lib.php';
// Check parameters
PMA_Util::checkParameters(array('db', 'table'));
$db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($db);
/**
* Set parameters for links
* @deprecated
*/
$url_query = PMA_URL_getCommon(array('db' => $db, 'table' => $table));
/**
* Set parameters for links
*/
$url_params = array();
$url_params['db'] = $db;
$url_params['table'] = $table;
/**
* Defines the urls to return to in case of error in a sql statement
*/
$err_url_0 = $cfg['DefaultTabDatabase'] . PMA_URL_getCommon(array('db' => $db));
$err_url = $cfg['DefaultTabTable'] . PMA_URL_getCommon($url_params);
/**
* Ensures the database and the table exist (else move to the "parent" script)
*/
require_once './libraries/db_table_exists.lib.php';
if (PMA_Tracker::isActive() && PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"]) && !isset($_REQUEST['submit_deactivate_now']) && !(isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldumpfile')) {
$temp_msg = '<a href="tbl_tracking.php' . $url_query . '">';
$temp_msg .= sprintf(__('Tracking of %s is activated.'), htmlspecialchars($GLOBALS["db"] . '.' . $GLOBALS["table"]));
$temp_msg .= '</a>';
$msg = PMA_Message::notice($temp_msg);
PMA_Response::getInstance()->addHTML($msg->getDisplay());
}
示例10: define
/**
* Table tracking page
*
* @package PhpMyAdmin
*/
// Run common work
require_once './libraries/common.inc.php';
require_once './libraries/tbl_tracking.lib.php';
define('TABLE_MAY_BE_ABSENT', true);
require './libraries/tbl_common.inc.php';
$url_query .= '&goto=tbl_tracking.php&back=tbl_tracking.php';
$url_params['goto'] = 'tbl_tracking.php';
$url_params['back'] = 'tbl_tracking.php';
// Init vars for tracking report
if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
$data = PMA_Tracker::getTrackedData($_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version']);
$selection_schema = false;
$selection_data = false;
$selection_both = false;
if (!isset($_REQUEST['logtype'])) {
$_REQUEST['logtype'] = 'schema_and_data';
}
if ($_REQUEST['logtype'] == 'schema') {
$selection_schema = true;
} elseif ($_REQUEST['logtype'] == 'data') {
$selection_data = true;
} else {
$selection_both = true;
}
if (!isset($_REQUEST['date_from'])) {
$_REQUEST['date_from'] = $data['date_from'];
示例11: PMA_URL_getCommon
$db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($db);
/**
* Set parameters for links
* @deprecated
*/
$url_query = PMA_URL_getCommon($db, $table);
/**
* Set parameters for links
*/
$url_params = array();
$url_params['db'] = $db;
$url_params['table'] = $table;
/**
* Defines the urls to return to in case of error in a sql statement
*/
$err_url_0 = $cfg['DefaultTabDatabase'] . PMA_URL_getCommon(array('db' => $db));
$err_url = $cfg['DefaultTabTable'] . PMA_URL_getCommon($url_params);
/**
* Ensures the database and the table exist (else move to the "parent" script)
*/
require_once './libraries/db_table_exists.lib.php';
if (PMA_Tracker::isActive() && PMA_Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"]) && !isset($_REQUEST['submit_deactivate_now'])) {
$temp_msg = '<a href="tbl_tracking.php?' . $url_query . '">';
$temp_msg .= sprintf(__('Tracking of %s is activated.'), htmlspecialchars($GLOBALS["db"] . '.' . $GLOBALS["table"]));
$temp_msg .= '</a>';
$msg = PMA_Message::notice($temp_msg);
$msg->display();
}
?>
>>>>>>> b875702c9c06ab5012e52ff4337439b03918f453
示例12: PMA_getUntrackedTables
/**
* Get untracked tables
*
* @param string $db current database
*
* @return array $untracked_tables
*/
function PMA_getUntrackedTables($db)
{
$untracked_tables = array();
$sep = $GLOBALS['cfg']['NavigationTreeTableSeparator'];
// Get list of tables
$table_list = PMA_Util::getTableList($db);
// For each table try to get the tracking version
foreach ($table_list as $key => $value) {
// If $value is a table group.
if (array_key_exists('is' . $sep . 'group', $value) && $value['is' . $sep . 'group']) {
foreach ($value as $temp_table) {
// If $temp_table is a table with the value for 'Name' is set,
// rather than a property of the table group.
if (is_array($temp_table) && array_key_exists('Name', $temp_table)) {
$tracking_version = PMA_Tracker::getVersion($db, $temp_table['Name']);
if ($tracking_version == -1) {
$untracked_tables[] = $temp_table['Name'];
}
}
}
} else {
// If $value is a table.
if (PMA_Tracker::getVersion($db, $value['Name']) == -1) {
$untracked_tables[] = $value['Name'];
}
}
}
return $untracked_tables;
}
示例13: PMA_DBI_try_query
/**
* runs a query and returns the result
*
* @param string $query query to run
* @param resource $link mysql link resource
* @param integer $options
* @return mixed
*/
function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_rows = true)
{
//print_r($query);
if (empty($link)) {
if (isset($GLOBALS['userlink'])) {
$link = $GLOBALS['userlink'];
} else {
return false;
}
}
if ($GLOBALS['cfg']['DBG']['sql']) {
$time = microtime(true);
}
/*
if ($options == ($options | PMA_DBI_QUERY_STORE)) {
$r = mysql_query($query, $link);
} elseif ($options == ($options | PMA_DBI_QUERY_UNBUFFERED)) {
$r = mysql_unbuffered_query($query, $link);
} else {
$r = mysql_query($query, $link);
}
*/
$stid = oci_parse($link, $query);
if (!$stid) {
$e = oci_error($link);
// For oci_execute errors pass the statement handle
PMA_mysqlDie($e['message'], $query);
}
$result_sql = oci_execute($stid);
if (!$result_sql) {
$e = oci_error($stid);
// For oci_execute errors pass the statement handle
//$error_str = ($e['message'])
//. ($e['sqltext']);
$sql_str = substr_replace($e['sqltext'], '^', $e['offset'], 0);
PMA_mysqlDie($e['message'], $sql_str);
}
$r = $stid;
if ($cache_affected_rows) {
$GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows($r, $get_from_cache = false);
}
if ($GLOBALS['cfg']['DBG']['sql']) {
$time = microtime(true) - $time;
$hash = md5($query);
if (isset($_SESSION['debug']['queries'][$hash])) {
$_SESSION['debug']['queries'][$hash]['count']++;
} else {
$_SESSION['debug']['queries'][$hash] = array();
$_SESSION['debug']['queries'][$hash]['count'] = 1;
$_SESSION['debug']['queries'][$hash]['query'] = $query;
$_SESSION['debug']['queries'][$hash]['time'] = $time;
}
$trace = array();
foreach (debug_backtrace() as $trace_step) {
$trace[] = PMA_Error::relPath($trace_step['file']) . '#' . $trace_step['line'] . ': ' . (isset($trace_step['class']) ? $trace_step['class'] : '') . (isset($trace_step['type']) ? $trace_step['type'] : '') . (isset($trace_step['function']) ? $trace_step['function'] : '') . '(' . (isset($trace_step['params']) ? implode(', ', $trace_step['params']) : '') . ')';
}
$_SESSION['debug']['queries'][$hash]['trace'][] = $trace;
}
if ($r != FALSE && PMA_Tracker::isActive() == TRUE) {
PMA_Tracker::handleQuery($query);
}
return $r;
}
示例14: PMA_getHtmlForOptionalActionLinks
/**
* Get HTML links for 'Print view', 'Relation view', 'Propose table structure',
* 'Track table' and 'Move columns'
*
* @param string $url_query url query
* @param boolean $tbl_is_view whether table is view or not
* @param boolean $db_is_system_schema whether db is information schema or not
*
* @return string $html_output
*/
function PMA_getHtmlForOptionalActionLinks($url_query, $tbl_is_view, $db_is_system_schema)
{
$html_output = '<a href="tbl_printview.php' . $url_query . '" target="print_view">' . PMA_Util::getIcon('b_print.png', __('Print view'), true) . '</a>';
if (!$tbl_is_view && !$db_is_system_schema) {
if (!PMA_DRIZZLE) {
$html_output .= '<a href="sql.php' . $url_query . '&session_max_rows=all&sql_query=' . urlencode('SELECT * FROM ' . PMA_Util::backquote($GLOBALS['table']) . ' PROCEDURE ANALYSE()') . '">' . PMA_Util::getIcon('b_tblanalyse.png', __('Propose table structure'), true) . '</a>';
$html_output .= PMA_Util::showMySQLDocu('procedure_analyse') . "\n";
}
if (PMA_Tracker::isActive()) {
$html_output .= '<a href="tbl_tracking.php' . $url_query . '">' . PMA_Util::getIcon('eye.png', __('Track table'), true) . '</a>';
}
$html_output .= '<a href="#" id="move_columns_anchor">' . PMA_Util::getIcon('b_move.png', __('Move columns'), true) . '</a>';
$html_output .= '<a href="normalization.php' . $url_query . '">' . PMA_Util::getIcon('normalize.png', __('Improve table structure'), true) . '</a>';
}
if ($tbl_is_view && !$db_is_system_schema) {
if (PMA_Tracker::isActive()) {
$html_output .= '<a href="tbl_tracking.php' . $url_query . '">' . PMA_Util::getIcon('eye.png', __('Track view'), true) . '</a>';
}
}
return $html_output;
}
示例15: tryQuery
/**
* runs a query and returns the result
*
* @param string $query query to run
* @param resource $link mysql link resource
* @param integer $options query options
* @param bool $cache_affected_rows whether to cache affected row
*
* @return mixed
*/
public function tryQuery($query, $link = null, $options = 0, $cache_affected_rows = true)
{
if (empty($link)) {
if (isset($GLOBALS['userlink'])) {
$link = $GLOBALS['userlink'];
} else {
return false;
}
}
if ($GLOBALS['cfg']['DBG']['sql']) {
$time = microtime(true);
}
$result = $this->_extension->realQuery($query, $link, $options);
if ($cache_affected_rows) {
$GLOBALS['cached_affected_rows'] = $this->affectedRows($link, false);
}
if ($GLOBALS['cfg']['DBG']['sql']) {
$time = microtime(true) - $time;
$this->_dbgQuery($query, $link, $result, $time);
}
if ($result != false && PMA_Tracker::isActive() == true) {
PMA_Tracker::handleQuery($query);
}
return $result;
}