本文整理匯總了PHP中DebugKitDebugger::setMemoryPoint方法的典型用法代碼示例。如果您正苦於以下問題:PHP DebugKitDebugger::setMemoryPoint方法的具體用法?PHP DebugKitDebugger::setMemoryPoint怎麽用?PHP DebugKitDebugger::setMemoryPoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DebugKitDebugger
的用法示例。
在下文中一共展示了DebugKitDebugger::setMemoryPoint方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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', __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;
}
示例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 (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;
}
示例3: testMemorySettingAndGetting
/**
* test making memory use markers.
*
* @return void
**/
function testMemorySettingAndGetting()
{
$result = DebugKitDebugger::setMemoryPoint('test marker');
$this->assertTrue($result);
$result = DebugKitDebugger::getMemoryPoints(true);
$this->assertEqual(count($result), 1);
$this->assertTrue(isset($result['test marker']));
$this->assertTrue(is_numeric($result['test marker']));
$result = DebugKitDebugger::getMemoryPoints();
$this->assertTrue(empty($result));
DebugKitDebugger::setMemoryPoint('test marker');
DebugKitDebugger::setMemoryPoint('test marker');
$result = DebugKitDebugger::getMemoryPoints();
$this->assertEqual(count($result), 2);
$this->assertTrue(isset($result['test marker']));
$this->assertTrue(isset($result['test marker #2']));
}
示例4: 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));
}
示例5: 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'));
}
示例6: 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;
}