當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Util::profilingSupported方法代碼示例

本文整理匯總了PHP中PMA\libraries\Util::profilingSupported方法的典型用法代碼示例。如果您正苦於以下問題:PHP Util::profilingSupported方法的具體用法?PHP Util::profilingSupported怎麽用?PHP Util::profilingSupported使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PMA\libraries\Util的用法示例。


在下文中一共展示了Util::profilingSupported方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: PMA_getJsonForQueryAnalyzer

/**
 * Returns JSon for query_analyzer
 *
 * @return array
 */
function PMA_getJsonForQueryAnalyzer()
{
    $return = array();
    if (mb_strlen($_REQUEST['database'])) {
        $GLOBALS['dbi']->selectDb($_REQUEST['database']);
    }
    if ($profiling = PMA\libraries\Util::profilingSupported()) {
        $GLOBALS['dbi']->query('SET PROFILING=1;');
    }
    // Do not cache query
    $query = preg_replace('/^(\\s*SELECT)/i', '\\1 SQL_NO_CACHE', $_REQUEST['query']);
    $GLOBALS['dbi']->tryQuery($query);
    $return['affectedRows'] = $GLOBALS['cached_affected_rows'];
    $result = $GLOBALS['dbi']->tryQuery('EXPLAIN ' . $query);
    while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
        $return['explain'][] = $row;
    }
    // In case an error happened
    $return['error'] = $GLOBALS['dbi']->getError();
    $GLOBALS['dbi']->freeResult($result);
    if ($profiling) {
        $return['profiling'] = array();
        $result = $GLOBALS['dbi']->tryQuery('SELECT seq,state,duration FROM INFORMATION_SCHEMA.PROFILING' . ' WHERE QUERY_ID=1 ORDER BY seq');
        while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
            $return['profiling'][] = $row;
        }
        $GLOBALS['dbi']->freeResult($result);
    }
    return $return;
}
開發者ID:flash1452,項目名稱:phpmyadmin,代碼行數:35,代碼來源:server_status_monitor.lib.php

示例2: unset

         unset($_SESSION['tmpval']['navi_limit_offset']);
     }
     $_SESSION['tmpval']['previous_server'] = $GLOBALS['server'];
 } else {
     // end server connecting
     // No need to check for 'PMA_BYPASS_GET_INSTANCE' since this execution path
     // applies only to initial login
     $response = Response::getInstance();
     $response->getHeader()->disableMenuAndConsole();
     $response->getFooter()->setMinimal();
 }
 /**
  * check if profiling was requested and remember it
  * (note: when $cfg['ServerDefault'] = 0, constant is not defined)
  */
 if (isset($_REQUEST['profiling']) && Util::profilingSupported()) {
     $_SESSION['profiling'] = true;
 } elseif (isset($_REQUEST['profiling_form'])) {
     // the checkbox was unchecked
     unset($_SESSION['profiling']);
 }
 // load user preferences
 $GLOBALS['PMA_Config']->loadUserPreferences();
 /**
  * Inclusion of profiling scripts is needed on various
  * pages like sql, tbl_sql, db_sql, tbl_select
  */
 if (!defined('PMA_BYPASS_GET_INSTANCE')) {
     $response = Response::getInstance();
 }
 if (isset($_SESSION['profiling'])) {
開發者ID:deerob,項目名稱:phpmyadmin,代碼行數:31,代碼來源:common.inc.php


注:本文中的PMA\libraries\Util::profilingSupported方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。