当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_Util::profilingSupported方法代码示例

本文整理汇总了PHP中PMA_Util::profilingSupported方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Util::profilingSupported方法的具体用法?PHP PMA_Util::profilingSupported怎么用?PHP PMA_Util::profilingSupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA_Util的用法示例。


在下文中一共展示了PMA_Util::profilingSupported方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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 = PMA_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']) && PMA_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 = PMA_Response::getInstance();
 }
 if (isset($_SESSION['profiling'])) {
开发者ID:mi-squared,项目名称:openemr,代码行数:31,代码来源:common.inc.php

示例2: PMA_executeTheQuery

/**
 * Function to handle all aspects relating to executing the query
 *
 * @param array   $analyzed_sql_results   analyzed sql results
 * @param String  $full_sql_query         full sql query
 * @param boolean $is_gotofile            whether to go to a file
 * @param String  $db                     current database
 * @param String  $table                  current table
 * @param boolean $find_real_end          whether to find the real end
 * @param String  $sql_query_for_bookmark sql query to be stored as bookmark
 * @param array   $extra_data             extra data
 *
 * @return mixed
 */
function PMA_executeTheQuery($analyzed_sql_results, $full_sql_query, $is_gotofile, $db, $table, $find_real_end, $sql_query_for_bookmark, $extra_data)
{
    $response = PMA_Response::getInstance();
    $response->getHeader()->getMenu()->setTable($table);
    // Only if we ask to see the php code
    if (isset($GLOBALS['show_as_php'])) {
        $result = null;
        $num_rows = 0;
        $unlim_num_rows = 0;
    } else {
        // If we don't ask to see the php code
        if (isset($_SESSION['profiling']) && PMA_Util::profilingSupported()) {
            $GLOBALS['dbi']->query('SET PROFILING=1;');
        }
        $result = PMA_executeQueryAndStoreResults($full_sql_query);
        // Displays an error message if required and stop parsing the script
        $error = $GLOBALS['dbi']->getError();
        if ($error) {
            PMA_handleQueryExecuteError($is_gotofile, $error, $full_sql_query);
        }
        // If there are no errors and bookmarklabel was given,
        // store the query as a bookmark
        if (!empty($_POST['bkm_label']) && !empty($sql_query_for_bookmark)) {
            $cfgBookmark = PMA_Bookmark_getParams();
            PMA_storeTheQueryAsBookmark($db, $cfgBookmark['user'], $sql_query_for_bookmark, $_POST['bkm_label'], isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null);
        }
        // end store bookmarks
        // Gets the number of rows affected/returned
        // (This must be done immediately after the query because
        // mysql_affected_rows() reports about the last query done)
        $num_rows = PMA_getNumberOfRowsAffectedOrChanged($analyzed_sql_results['is_affected'], $result, isset($num_rows) ? $num_rows : null);
        // Grabs the profiling results
        if (isset($_SESSION['profiling']) && PMA_Util::profilingSupported()) {
            $profiling_results = $GLOBALS['dbi']->fetchResult('SHOW PROFILE;');
        }
        $justBrowsing = PMA_isJustBrowsing($analyzed_sql_results, isset($find_real_end) ? $find_real_end : null);
        $unlim_num_rows = PMA_countQueryResults($num_rows, $analyzed_sql_results['is_select'], $justBrowsing, $db, $table, $analyzed_sql_results['parsed_sql'], $analyzed_sql_results);
        $extra_data = PMA_cleanupRelations(isset($db) ? $db : '', isset($table) ? $table : '', isset($_REQUEST['dropped_column']) ? $_REQUEST['dropped_column'] : null, isset($_REQUEST['purge']) ? $_REQUEST['purge'] : null, isset($extra_data) ? $extra_data : null);
        // Update Indexes list.
        if (isset($_REQUEST['index_change'])) {
            $extra_data['indexes_list'] = PMA_Index::getView($table, $db);
        }
    }
    return array($result, $num_rows, $unlim_num_rows, isset($profiling_results) ? $profiling_results : null, $extra_data);
}
开发者ID:harryboulderdash,项目名称:PlayGFC,代码行数:59,代码来源:sql.lib.php

示例3: PMA_getJsonForQueryAnalyzer

/**
 * Returns JSon for query_analyzer
 *
 * @return Array
 */
function PMA_getJsonForQueryAnalyzer()
{
    $return = array();
    if (strlen($_REQUEST['database'])) {
        $GLOBALS['dbi']->selectDb($_REQUEST['database']);
    }
    if ($profiling = PMA_Util::profilingSupported()) {
        $GLOBALS['dbi']->query('SET PROFILING=1;');
    }
    // Do not cache query
    $query = preg_replace('/^(\\s*SELECT)/i', '\\1 SQL_NO_CACHE', $_REQUEST['query']);
    $result = $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:pombredanne,项目名称:ArcherSys,代码行数:35,代码来源:server_status_monitor.lib.php

示例4: PMA_Bookmark_save

         }
     }
     PMA_Bookmark_save($bfields, isset($bkm_all_users));
     $bookmark_created = true;
 }
 // end store bookmarks
 // Gets the number of rows affected/returned
 // (This must be done immediately after the query because
 // mysql_affected_rows() reports about the last query done)
 if (!$is_affected) {
     $num_rows = $result ? @PMA_DBI_num_rows($result) : 0;
 } elseif (!isset($num_rows)) {
     $num_rows = @PMA_DBI_affected_rows();
 }
 // Grabs the profiling results
 if (isset($_SESSION['profiling']) && PMA_Util::profilingSupported()) {
     $profiling_results = PMA_DBI_fetch_result('SHOW PROFILE;');
 }
 // Checks if the current database has changed
 // This could happen if the user sends a query like "USE `database`;"
 /**
 * commented out auto-switching to active database - really required?
 * bug #2558 win: table list disappears (mixed case db names)
 * https://sourceforge.net/p/phpmyadmin/bugs/2558/
 * @todo RELEASE test and comit or rollback before release
     $current_db = PMA_DBI_fetch_value('SELECT DATABASE()');
     if ($db !== $current_db) {
    $db     = $current_db;
    $reload = 1;
     }
     unset($current_db);
开发者ID:SashiAsakura,项目名称:AWS_QuikID_website,代码行数:31,代码来源:sql.php

示例5: exit

            'SHOW GLOBAL VARIABLES WHERE Variable_name IN'
            . ' ("general_log","slow_query_log","long_query_time","log_output")',
            0,
            1
        );
        exit(json_encode($loggingVars));
    }

    if (isset($_REQUEST['query_analyzer'])) {
        $return = array();

        if (strlen($_REQUEST['database'])) {
            PMA_DBI_select_db($_REQUEST['database']);
        }

        if ($profiling == PMA_Util::profilingSupported()) {
            PMA_DBI_query('SET PROFILING=1;');
        }

        // Do not cache query
        $query = preg_replace(
            '/^(\s*SELECT)/i',
            '\\1 SQL_NO_CACHE',
            $_REQUEST['query']
        );

        $result = PMA_DBI_try_query($query);
        $return['affectedRows'] = $GLOBALS['cached_affected_rows'];

        $result = PMA_DBI_try_query('EXPLAIN ' . $query);
        while ($row = PMA_DBI_fetch_assoc($result)) {
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:31,代码来源:server_status.php

示例6: elseif

        $_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 = PMA_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'])
        && PMA_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')) {
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:common.inc.php


注:本文中的PMA_Util::profilingSupported方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。