本文整理匯總了PHP中DebugKitDebugger::stopTimer方法的典型用法代碼示例。如果您正苦於以下問題:PHP DebugKitDebugger::stopTimer方法的具體用法?PHP DebugKitDebugger::stopTimer怎麽用?PHP DebugKitDebugger::stopTimer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DebugKitDebugger
的用法示例。
在下文中一共展示了DebugKitDebugger::stopTimer方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
/**
* Renders view for given action and layout. If $file is given, that is used
* for a view filename (e.g. customFunkyView.ctp).
* Adds timers, for all subsequent rendering, and injects the debugKit toolbar.
*
* @param string $action Name of action to render for
* @param string $layout Layout to use
* @param string $file Custom filename for view
* @return string Rendered Element
*/
function render($action = null, $layout = null, $file = null)
{
DebugKitDebugger::startTimer('viewRender', __('Rendering View', true));
$out = parent::render($action, $layout, $file);
DebugKitDebugger::stopTimer('viewRender');
DebugKitDebugger::stopTimer('controllerRender');
if (isset($this->loaded['toolbar'])) {
$this->loaded['toolbar']->postRender();
}
//Temporary work around to hide the SQL dump at page bottom
Configure::write('debug', 0);
return $this->output;
}
示例2: render
/**
* Renders view for given action and layout. If $file is given, that is used
* for a view filename (e.g. customFunkyView.ctp).
* Adds timers, for all subsequent rendering, and injects the debugKit toolbar.
*
* @param string $action Name of action to render for
* @param string $layout Layout to use
* @param string $file Custom filename for view
* @return string Rendered Element
*/
function render($action = null, $layout = null, $file = null)
{
DebugKitDebugger::startTimer('viewRender', __d('debug_kit', 'Rendering View', true));
$out = parent::render($action, $layout, $file);
DebugKitDebugger::stopTimer('viewRender');
DebugKitDebugger::stopTimer('controllerRender');
DebugKitDebugger::setMemoryPoint(__d('debug_kit', 'View render complete', true));
if (empty($this->params['requested']) && isset($this->loaded['toolbar'])) {
$backend = $this->loaded['toolbar']->getName();
$this->loaded['toolbar']->{$backend}->send();
}
if (empty($this->output)) {
return $out;
}
return $this->output;
}
示例3: render
/**
* Renders view for given action and layout. If $file is given, that is used
* for a view filename (e.g. customFunkyView.ctp).
* Adds timers, for all subsequent rendering, and injects the debugKit toolbar.
*
* @param string $action Name of action to render for
* @param string $layout Layout to use
* @param string $file Custom filename for view
* @return string Rendered Element
*/
function render($action = null, $layout = null, $file = null)
{
DebugKitDebugger::startTimer('viewRender', __d('debug_kit', 'Rendering View', true));
$out = parent::render($action, $layout, $file);
DebugKitDebugger::stopTimer('viewRender');
DebugKitDebugger::stopTimer('controllerRender');
DebugKitDebugger::setMemoryPoint(__d('debug_kit', 'View render complete', true));
if (isset($this->loaded['toolbar'])) {
$backend = $this->loaded['toolbar']->getName();
$this->loaded['toolbar']->{$backend}->send();
}
if (empty($this->output)) {
return $out;
}
//Temporary work around to hide the SQL dump at page bottom
Configure::write('debug', 0);
return $this->output;
}
示例4: afterSave
/**
* afterSave, stop the timer started from a save.
*
* @param string $Model
* @param string $created
* @return void
*/
public function afterSave(Model $Model, $created)
{
DebugKitDebugger::stopTimer($Model->alias . '_save');
return true;
}
示例5: testGetTimers
/**
* test getting all the set timers.
*
* @return void
**/
function testGetTimers()
{
DebugKitDebugger::startTimer('test1', 'this is my first test');
DebugKitDebugger::stopTimer('test1');
usleep(50);
DebugKitDebugger::startTimer('test2');
DebugKitDebugger::stopTimer('test2');
$timers = DebugKitDebugger::getTimers();
$this->assertEqual(count($timers), 3);
$this->assertTrue(is_float($timers['test1']['time']));
$this->assertTrue(isset($timers['test1']['message']));
$this->assertTrue(isset($timers['test2']['message']));
}
示例6: find
/**
* Queries the datasource and returns a result set array.
*
* @param string $type Type of find operation (all / first / count / neighbors / list / threaded)
* @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks)
* @return array Array of records
* @link http://book.cakephp.org/2.0/en/models/deleting-data.html#deleteall
*/
public function find($type = 'first', $query = array())
{
DebugKitDebugger::startTimer($this->name . '::find(' . $type . ')');
$results = parent::find($type, $query);
DebugKitDebugger::stopTimer($this->name . '::find(' . $type . ')');
return $results;
}
示例7: beforeRender
/**
* beforeRender callback
*
* Calls beforeRender on all the panels and set the aggregate to the controller.
*
* @return void
**/
function beforeRender(&$controller)
{
DebugKitDebugger::stopTimer('controllerAction');
$vars = array();
$panels = array_keys($this->panels);
foreach ($panels as $panelName) {
$panel =& $this->panels[$panelName];
$vars[$panelName]['content'] = $panel->beforeRender($controller);
$elementName = Inflector::underscore($panelName) . '_panel';
if (isset($panel->elementName)) {
$elementName = $panel->elementName;
}
$vars[$panelName]['elementName'] = $elementName;
$vars[$panelName]['plugin'] = $panel->plugin;
$vars[$panelName]['disableTimer'] = true;
}
$controller->set(array('debugToolbarPanels' => $vars, 'debugToolbarJavascript' => $this->javascript));
DebugKitDebugger::startTimer('controllerRender', __('Render Controller Action', true));
}
示例8: beforeRender
/**
* beforeRender callback
*
* Calls beforeRender on all the panels and set the aggregate to the controller.
*
* @return void
**/
function beforeRender(&$controller)
{
DebugKitDebugger::stopTimer('controllerAction');
$vars = $this->_gatherVars($controller);
$this->_saveState($controller, $vars);
$controller->set(array('debugToolbarPanels' => $vars, 'debugToolbarJavascript' => $this->javascript));
DebugKitDebugger::startTimer('controllerRender', __d('debug_kit', 'Render Controller Action', true));
DebugKitDebugger::setMemoryPoint(__d('debug_kit', 'Controller render start', true));
}
示例9: beforeRender
/**
* beforeRender callback
*
* Calls beforeRender on all the panels and set the aggregate to the controller.
*
* @return void
**/
public function beforeRender($controller) {
if (!class_exists('DebugKitDebugger')) {
return null;
}
DebugKitDebugger::stopTimer('controllerAction');
$vars = $this->_gatherVars($controller);
$this->_saveState($controller, $vars);
$controller->set(array('debugToolbarPanels' => $vars, 'debugToolbarJavascript' => $this->javascript));
DebugKitDebugger::startTimer('controllerRender', __d('debug_kit', 'Render Controller Action'));
DebugKitDebugger::setMemoryPoint(__d('debug_kit', 'Controller render start'));
}
示例10: render
/**
* Renders view for given action and layout.
* Adds timers, for all subsequent rendering, and injects the debugKit toolbar.
*
* @param string $action Name of action to render for
* @param string $layout Layout to use
* @return string Rendered Element
*/
public function render($action = null, $layout = null) {
DebugKitDebugger::startTimer('viewRender', __d('debug_kit', 'Rendering View'));
$out = parent::render($action, $layout);
DebugKitDebugger::stopTimer('viewRender');
DebugKitDebugger::stopTimer('controllerRender');
DebugKitDebugger::setMemoryPoint(__d('debug_kit', 'View render complete'));
if (empty($this->request->params['requested']) && $this->Helpers->attached('Toolbar')) {
$backend = $this->Helpers->Toolbar->getName();
$this->Helpers->Toolbar->{$backend}->send();
}
if (empty($this->output)) {
return $out;
}
return $this->output;
}