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


PHP xhprof_param_init函数代码示例

本文整理汇总了PHP中xhprof_param_init函数的典型用法代码示例。如果您正苦于以下问题:PHP xhprof_param_init函数的具体用法?PHP xhprof_param_init怎么用?PHP xhprof_param_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: indexAction

 public function indexAction()
 {
     // param name, its type, and default value
     $params = array('run' => array(XHPROF_STRING_PARAM, ''), 'wts' => array(XHPROF_STRING_PARAM, ''), 'symbol' => array(XHPROF_STRING_PARAM, ''), 'sort' => array(XHPROF_STRING_PARAM, 'wt'), 'run1' => array(XHPROF_STRING_PARAM, ''), 'run2' => array(XHPROF_STRING_PARAM, ''), 'source' => array(XHPROF_STRING_PARAM, 'xhprof'), 'all' => array(XHPROF_UINT_PARAM, 0), 'source2' => array(XHPROF_STRING_PARAM, 'xhprof'));
     // pull values of these params, and create named globals for each param
     xhprof_param_init($params);
     global $run, $wts, $symbol, $sort, $run1, $run2, $source, $all, $source2, $sort_col;
     /* reset params to be a array of variable names to values
          by the end of this page, param should only contain values that need
          to be preserved for the next page. unset all unwanted keys in $params.
        */
     foreach ($params as $k => $v) {
         $params[$k] = ${$k};
         // unset key from params that are using default values. So URLs aren't
         // ridiculously long.
         if ($params[$k] == $v[1]) {
             unset($params[$k]);
         }
     }
     $sort_col = $this->getParam('sort');
     $params['dir'] = $this->storage->getCurrentDirectory();
     $params['list_url'] = $this->getParam('list_url');
     $GLOBALS['run_page_params'] = $params;
     $runData = $this->storage->getRunMetaData($run);
     $xhprofData = $this->storage->getRunXHProfData($run);
     RunTemplate::render($runData, $params, $xhprofData, $symbol);
 }
开发者ID:sugarcrm,项目名称:xhprof-viewer,代码行数:27,代码来源:RunController.php

示例2: graph

 public static function graph($run)
 {
     require_once LIB . "xhprof/xhprof_lib/display/xhprof.php";
     require_once LIB . "xhprof/xhprof_lib/utils/xhprof_runs.php";
     ini_set('max_execution_time', 100);
     ini_set('display_errors', "Off");
     error_reporting(0);
     $source = SITE;
     $params = array('run' => array(XHPROF_STRING_PARAM, $run), 'source' => array(XHPROF_STRING_PARAM, $source), 'func' => array(XHPROF_STRING_PARAM, ''), 'type' => array(XHPROF_STRING_PARAM, 'png'), 'threshold' => array(XHPROF_FLOAT_PARAM, 0.01), 'critical' => array(XHPROF_BOOL_PARAM, true), 'run1' => array(XHPROF_STRING_PARAM, ''), 'run2' => array(XHPROF_STRING_PARAM, ''));
     // pull values of these params, and create named globals for each param
     xhprof_param_init($params);
     // if invalid value specified for threshold, then use the default
     $threshold = 0.01;
     $type = 'png';
     $xhprof_runs_impl = new \XHProfRuns_Default(self::logpath());
     // single run call graph image generation
     // xhprof_render_image( $xhprof_runs_impl, $run, $type,$threshold, $func, $source, $critical );
     xhprof_render_image($xhprof_runs_impl, $run, $type, $threshold, $func, $source, $critical);
 }
开发者ID:jixm,项目名称:Simple-PHP-MVC-Skeleton,代码行数:19,代码来源:Debug.php

示例3: indexAction

 public function indexAction()
 {
     ini_set('max_execution_time', 100);
     $params = array('run' => array(XHPROF_STRING_PARAM, ''), 'source' => array(XHPROF_STRING_PARAM, 'xhprof'), 'func' => array(XHPROF_STRING_PARAM, ''), 'type' => array(XHPROF_STRING_PARAM, 'png'), 'threshold' => array(XHPROF_FLOAT_PARAM, 0.01), 'critical' => array(XHPROF_BOOL_PARAM, true), 'run1' => array(XHPROF_STRING_PARAM, ''), 'run2' => array(XHPROF_STRING_PARAM, ''));
     // pull values of these params, and create named globals for each param
     xhprof_param_init($params);
     global $run, $source, $func, $type, $threshold, $critical, $run1, $run2, $xhprof_legal_image_types;
     // if invalid value specified for threshold, then use the default
     if ($threshold < 0 || $threshold > 1) {
         $threshold = $params['threshold'][1];
     }
     // if invalid value specified for type, use the default
     if (!array_key_exists($type, $xhprof_legal_image_types)) {
         $type = $params['type'][1];
         // default image type.
     }
     if (!empty($run)) {
         // single run call graph image generation
         xhprof_render_image($this->storage, $run, $type, $threshold, $func, $source, $critical);
     }
 }
开发者ID:sugarcrm,项目名称:xhprof-viewer,代码行数:21,代码来源:CallGraphController.php

示例4: ini_set

 *   used for viewing results of XHProf runs from a
 *   browser.
 *
 * Modification History:
 *  02/15/2008 - cjiang  - The first version of callgraph visualizer
 *                         based on Graphviz's DOT tool.
 *
 * @author Changhao Jiang (cjiang@facebook.com)
 */
// by default assume that xhprof_html & xhprof_lib directories
// are at the same level.
$GLOBALS['XHPROF_LIB_ROOT'] = $_SERVER['DOCUMENT_ROOT'] . '/../application/library/xhprof_lib';
ini_set('max_execution_time', 100);
$params = array('run' => array(XHPROF_STRING_PARAM, ''), 'source' => array(XHPROF_STRING_PARAM, 'xhprof'), 'func' => array(XHPROF_STRING_PARAM, ''), 'type' => array(XHPROF_STRING_PARAM, 'png'), 'threshold' => array(XHPROF_FLOAT_PARAM, 0.01), 'critical' => array(XHPROF_BOOL_PARAM, true), 'run1' => array(XHPROF_STRING_PARAM, ''), 'run2' => array(XHPROF_STRING_PARAM, ''));
// pull values of these params, and create named globals for each param
xhprof_param_init($params);
// if invalid value specified for threshold, then use the default
if ($threshold < 0 || $threshold > 1) {
    $threshold = $params['threshold'][1];
}
// if invalid value specified for type, use the default
if (!array_key_exists($type, $xhprof_legal_image_types)) {
    $type = $params['type'][1];
    // default image type.
}
$xhprof_runs_impl = new XHProfRuns_Default();
if (!empty($run)) {
    // single run call graph image generation
    xhprof_render_image($xhprof_runs_impl, $run, $type, $threshold, $func, $source, $critical);
} else {
    // diff report call graph image generation
开发者ID:xn1224,项目名称:YOF,代码行数:31,代码来源:callgraph.php


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