本文整理汇总了PHP中Console::profile方法的典型用法代码示例。如果您正苦于以下问题:PHP Console::profile方法的具体用法?PHP Console::profile怎么用?PHP Console::profile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Console
的用法示例。
在下文中一共展示了Console::profile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
$url = '/server/listServer';
if (isset($argv[1])) {
$url = $argv[1];
}
require_once dirname(__FILE__) . '/../bootstrap/dbunit.php';
Console::$profilingEnabled = true;
register_shutdown_function(array('Console', 'profile'), 'end');
class AuthenticatedBrowser extends sfBrowser
{
protected function doCall()
{
$this->context = $this->getContext(true);
$admin = sfGuardUserPeer::retrieveByPk(1);
$this->context->getUser()->signIn($admin);
ob_start();
$this->context->getController()->dispatch();
$html = ob_get_clean();
}
}
$browser = new AuthenticatedBrowser();
sfConfig::set('app_parser_panels', array());
sfConfig::set('app_parser_skip_toolbar', true);
$browser->get($url);
Console::profile('end');
Console::restartProfiling();
$browser->get($url);
示例2: postProcess
private function postProcess($build = false, $uri = null)
{
if ($uri) {
$this->process["parses"][$this->iteration]["module"] = strtok($uri, "/");
$this->process["parses"][$this->iteration]["component_name"] = strtok("/");
}
Console::profile('postProcess');
/*
* Create widgets in advanced for the text link script (widget launcher)
*/
sfApplicationConfiguration::getActive()->loadHelpers(array("Helper", "Url", "afUrl"));
// Update session if needed..
$module = $this->context->getModuleName();
$action = $this->context->getActionName();
$this->context->getUser()->getAttributeHolder()->removeNamespace('parser/grid');
if ($this->type === self::WIZARD) {
if (isset($this->attribute_holder["init"])) {
$this->context->getUser()->getAttributeHolder()->removeNamespace('parser/wizard');
}
self::updateSession(false, "parser/wizard", null, $this->datastore, $this->process);
}
if (!$build) {
$pageHelp = $this->type !== self::WIZARD && isset($this->process["parses"][0]["extra"]) && $this->widgetHelpSettings->getWidgetHelpIsEnabled();
} else {
$pageHelp = null;
}
if ($this->multi) {
$this->page = $this->process["parses"][0];
unset($this->process["parses"][0]);
if ($pageHelp) {
$this->layout->addHelp($this->page["extra"]);
}
$this->layout->setTitle($this->page["title"] . (class_exists('afExtjsWidgetConfig') ? afExtjsWidgetConfig::getPostfixTitle() : ''));
}
if ($this->tree) {
$this->layout->addItem('west', $this->tree);
}
foreach ($this->process["parses"] as $it => $parse) {
// Parse additional scripts..
if (array_key_exists("scripts", $parse)) {
$this->parseScripts($parse);
}
/*
* Moved the tools in this loop to have different tools on different portlets depending upon their types.
*/
$tools = new afExtjsTools();
// Help popup
if ($this->widgetHelpSettings && $this->widgetHelpSettings->getPopupHelpIsEnabled()) {
$tools->addItem(array('id' => 'help', 'qtip' => "Widget Help", 'handler' => array('parameters' => 'e,target,panel', 'source' => "afApp.loadPopupHelp(panel.idxml);")));
}
//Print - for grids it is added later due parameters.
if ($parse["view"] != "list") {
$tools->addItem(array('id' => 'print', 'qtip' => "Printer friendly version", 'handler' => array('parameters' => 'e,target,panel', 'source' => "window.open('/'+panel.idxml+'?af_format=pdf&" . $this->getQueryString() . "','print');")));
}
if (isset($parse['params']) && isset($parse['params']['settings'])) {
$tools->addItem(array('id' => 'gear', 'qtip' => 'Setting', 'handler' => array('parameters' => 'e,target,panel', 'source' => "afApp.widgetPopup('" . $parse['params']['settings'] . "','Settings',panel)")));
}
//$tools->addItem(array('id'=>'start-reload','handler'=>array('parameter'=>'e,target,panel','source'=>'this.id="stop-reload"')));
$tools->addItem(array('id' => 'close', 'qtip' => 'Close', 'handler' => array('parameters' => 'e,target,panel', 'source' => "var portal=panel.ownerCt.ownerCt;panel.ownerCt.remove(panel, true);portal.onWidgetDrop();")));
/***********************************************************/
if (!$build) {
$widgetHelp = $this->type !== self::WIZARD && isset($parse["description"]) && $this->widgetHelpSettings->getWidgetHelpIsEnabled();
if ($widgetHelp) {
if ($this->type === self::PANEL) {
$this->layout->addHelp($parse["description"]);
}
}
}
if ($this->multi) {
$current_area = $this->page["areas"][$parse["area"]];
} else {
$current_area = isset($parse["area"]) ? $parse["area"] : null;
}
$view = $parse["view"];
$parsedgroups = array();
if (!isset($parse["multipart"])) {
$parse["multipart"] = false;
}
if ($this->multi && isset($this->page["confirm"])) {
$this->layout->attributes['listeners']['beforerender'] = $this->layout->afExtjs->asMethod(array('parameters' => 'el', 'source' => "Ext.Msg.confirm('" . $this->page["confirm"]["title"] . "','" . $this->page["confirm"]["text"] . "', function(btn){if (btn=='yes'){ return true; }else{ window.location.href='" . $this->page["confirm"]["url"] . "';return false;} });"));
}
//echo "<pre>";print_r($parse);exit;
$formoptions = $this->multi ? array("title" => $parse["title"], "fileUpload" => $parse["multipart"], "portal" => true, "tools" => $tools) : array("fileUpload" => $parse["multipart"]);
if ($it == 1 && $this->multi && $this->type === self::WIZARD) {
$panel = $this->layout->startColumn(array('columnWidth' => isset($current_area["attributes"]["width"]) ? $current_area["attributes"]["width"] : '0.98'));
}
if ($this->type == self::PAGE) {
$action_name = preg_replace("/[0-9]+/", "", $parse["component"]);
}
// Determine group - Wizards
if (!$this->openGroup && $this->tabbedWizard) {
$this->openGroup = true;
$wizard_group = $this->layout->startGroup();
}
if ($view == "edit" || $view == "show") {
$formoptions["action"] = url_for($parse["form"]);
$formoptions["name"] = "form" . $it;
$formoptions["classic"] = $parse["classic"] !== "false";
$formoptions["labelWidth"] = isset($parse['labelWidth']) ? $parse['labelWidth'] : '75';
if ($this->type == self::PANEL) {
//.........这里部分代码省略.........