当前位置: 首页>>代码示例>>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;未经允许,请勿转载。