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


PHP Profiler::display方法代码示例

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


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

示例1: se_framework_exception_handler

function se_framework_exception_handler($e)
{
    if (!DEBUG) {
        page_not_found();
    }
    // display Profiler
    include SYSPATH . '/core/Profiler' . EXT;
    Profiler::displayTrace($e);
    Profiler::display();
}
开发者ID:silentworks,项目名称:the-compressor,代码行数:10,代码来源:Simplengine.php

示例2: fn_dispatch


//.........这里部分代码省略.........
    if (MODE == 'add') {
        $tpl = 'update.tpl';
    } elseif (strpos(MODE, 'add_') === 0) {
        $tpl = str_replace('add_', 'update_', MODE) . '.tpl';
    } else {
        $tpl = MODE . '.tpl';
    }
    $view =& Registry::get('view');
    if ($view->template_exists('views/' . CONTROLLER . '/' . $tpl)) {
        // try to find template in base views
        $view->assign('content_tpl', 'views/' . CONTROLLER . '/' . $tpl);
    } elseif (defined('LOADED_ADDON_PATH') && $view->template_exists('addons/' . LOADED_ADDON_PATH . '/views/' . CONTROLLER . '/' . $tpl)) {
        // try to find template in addon views
        $view->assign('content_tpl', 'addons/' . LOADED_ADDON_PATH . '/views/' . CONTROLLER . '/' . $tpl);
    } elseif (!empty($addons)) {
        // try to find template in addon views that extend base views
        foreach ($addons as $addon => $_v) {
            if ($view->template_exists('addons/' . $addon . '/views/' . CONTROLLER . '/' . $tpl)) {
                $view->assign('content_tpl', 'addons/' . $addon . '/views/' . CONTROLLER . '/' . $tpl);
                break;
            }
        }
    }
    foreach ($controllers_cascade as $item) {
        $_res = fn_run_controller($item);
        // 0 - status, 1 - url
        $external = !empty($_res[2]) ? $_res[2] : false;
        $url = !empty($_res[1]) ? $_res[1] : '';
        // Status could be changed only if we allow to run controllers despite of init controller
        if ($run_controllers == true) {
            $status = !empty($_res[0]) ? $_res[0] : CONTROLLER_STATUS_OK;
        }
        if ($status == CONTROLLER_STATUS_OK && !empty($url)) {
            $redirect_url = $url;
        } elseif ($status == CONTROLLER_STATUS_REDIRECT && !empty($url)) {
            $redirect_url = $url;
            break;
        } elseif ($status == CONTROLLER_STATUS_DENIED || $status == CONTROLLER_STATUS_NO_PAGE) {
            break;
        }
    }
    if (AREA == 'A') {
        fn_init_view_tools($_REQUEST);
    }
    // In console mode, just stop here
    if (defined('CONSOLE')) {
        exit;
    }
    // Redirect if controller returned successful/redirect status only
    if (in_array($status, array(CONTROLLER_STATUS_OK, CONTROLLER_STATUS_REDIRECT)) && !empty($_REQUEST['redirect_url']) && !$external) {
        $redirect_url = $_REQUEST['redirect_url'];
    }
    // If controller returns "Redirect" status, check if redirect url exists
    if ($status == CONTROLLER_STATUS_REDIRECT && empty($redirect_url)) {
        $status = CONTROLLER_STATUS_NO_PAGE;
    }
    // Attach params and redirect if needed
    if (in_array($status, array(CONTROLLER_STATUS_OK, CONTROLLER_STATUS_REDIRECT)) && !empty($redirect_url)) {
        $params = array('page', 'selected_section');
        $url_params = array();
        foreach ($params as $param) {
            if (!empty($_REQUEST[$param])) {
                $url_params[] = "{$param}=" . $_REQUEST[$param];
            }
        }
        if (!empty($url_params)) {
            $redirect_url .= (strpos($redirect_url, '?') === false ? '?' : '&') . implode('&', $url_params);
        }
        if (!isset($external)) {
            $external = false;
        }
        fn_redirect($redirect_url, false, $external);
    }
    if (!$view->get_var('content_tpl') && $status == CONTROLLER_STATUS_OK) {
        // FIXME
        $status = CONTROLLER_STATUS_NO_PAGE;
    }
    if ($status != CONTROLLER_STATUS_OK) {
        if ($status == CONTROLLER_STATUS_NO_PAGE) {
            header(' ', true, 404);
        }
        $view->assign('exception_status', $status);
        $view->assign('content_tpl', 'exception.tpl');
        if ($status == CONTROLLER_STATUS_DENIED) {
            $view->assign('page_title', fn_get_lang_var('access_denied'));
        } elseif ($status == CONTROLLER_STATUS_NO_PAGE) {
            $view->assign('page_title', fn_get_lang_var('page_not_found'));
        }
        if (AREA != 'A') {
            Registry::set('root_template', 'exception.tpl');
        }
    }
    Profiler::checkpoint('Before TPL');
    Registry::get('view')->display(Registry::get('root_template'));
    Profiler::checkpoint('After TPL');
    Profiler::display();
    fn_set_hook('complete');
    exit;
    // stop execution
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:101,代码来源:fn.control.php


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