當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DebugKitDebugger類代碼示例

本文整理匯總了PHP中DebugKitDebugger的典型用法代碼示例。如果您正苦於以下問題:PHP DebugKitDebugger類的具體用法?PHP DebugKitDebugger怎麽用?PHP DebugKitDebugger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DebugKitDebugger類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     Configure::write('log', true);
     DebugKitDebugger::clearTimers();
     TestFireCake::reset();
 }
開發者ID:juliocp88,項目名稱:cakephp-example,代碼行數:12,代碼來源:DebugKitDebuggerTest.php

示例2: testSaveTimers

 /**
  * Test save timers
  *
  * @return void
  */
 public function testSaveTimers()
 {
     $timers = DebugKitDebugger::getTimers(false);
     $this->assertEquals(count($timers), 1);
     $this->Article->save(array('user_id' => 1, 'title' => 'test', 'body' => 'test'));
     $result = DebugKitDebugger::getTimers(false);
     $this->assertEquals(count($result), 2);
 }
開發者ID:hupla78,項目名稱:Nadia,代碼行數:13,代碼來源:TimedBehaviorTest.php

示例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', __('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;
 }
開發者ID:kondrat,項目名稱:agift,代碼行數:23,代碼來源:debug.php

示例4: 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;
 }
開發者ID:ambagasdowa,項目名稱:kml,代碼行數:26,代碼來源:debug.php

示例5: 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;
 }
開發者ID:predominant,項目名稱:debug_kit,代碼行數:28,代碼來源:debug.php

示例6: 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']));
 }
開發者ID:afzet,項目名稱:cake-cart,代碼行數:22,代碼來源:debug_kit_debugger.test.php

示例7: clearMemoryPoints

 /**
  * Clear out any existing memory points
  *
  * @return void
  **/
 function clearMemoryPoints()
 {
     $self =& DebugKitDebugger::getInstance();
     $self->__memoryPoints = array();
 }
開發者ID:ambagasdowa,項目名稱:kml,代碼行數:10,代碼來源:debug_kit_debugger.php

示例8: testBeforeRedirect

/**
 * test that vars are gathered and state is saved on beforeRedirect
 *
 * @return void
 **/
	public function testBeforeRedirect() {
		$this->_loadController(array(
			'panels' => array('test', 'session', 'history'),
		));

		$configName = 'debug_kit';
		$this->Controller->Toolbar->cacheKey = 'toolbar_history';
		Cache::delete('toolbar_history', $configName);

		DebugKitDebugger::startTimer('controllerAction', 'testing beforeRedirect');
		$MockPanel = $this->getMock('DebugPanel');
		$MockPanel->expects($this->once())->method('beforeRender');
		$this->Controller->Toolbar->panels['test'] = $MockPanel;
		$this->Controller->Toolbar->beforeRedirect($this->Controller);

		$result = Cache::read('toolbar_history', $configName);
		$this->assertTrue(isset($result[0]['session']));
		$this->assertTrue(isset($result[0]['test']));

		$timers = DebugKitDebugger::getTimers();
		$this->assertTrue(isset($timers['controllerAction']));
	}
開發者ID:neterslandreau,項目名稱:tubones,代碼行數:27,代碼來源:ToolbarComponentTest.php

示例9: testRenderTimers

 /**
  * test rendering and ensure that timers are being set.
  *
  * @access public
  * @return void
  */
 function testRenderTimers()
 {
     $this->Controller->viewPath = 'posts';
     $this->Controller->action = 'index';
     $this->Controller->params = array('action' => 'index', 'controller' => 'posts', 'plugin' => null, 'url' => array('url' => 'posts/index'), 'base' => null, 'here' => '/posts/index');
     $this->Controller->layout = 'default';
     $View =& new DebugView($this->Controller, false);
     $View->render('index');
     $result = DebugKitDebugger::getTimers();
     $this->assertEqual(count($result), 4);
     $this->assertTrue(isset($result['viewRender']));
     $this->assertTrue(isset($result['render_default.ctp']));
     $this->assertTrue(isset($result['render_index.ctp']));
     $result = DebugKitDebugger::getMemoryPoints();
     $this->assertTrue(isset($result['View render complete']));
 }
開發者ID:masayukiando,項目名稱:googlemap-search_ActionScript3.0,代碼行數:22,代碼來源:debug.test.php

示例10: testBeforeRedirect

 /**
  * test that vars are gathered and state is saved on beforeRedirect
  *
  * @return void
  **/
 function testBeforeRedirect()
 {
     $this->Controller->components = array('DebugKit.Toolbar' => array('panels' => array('MockDebug', 'session', 'history')));
     $this->Controller->Component->init($this->Controller);
     $this->Controller->Component->initialize($this->Controller);
     $configName = 'debug_kit';
     $this->Controller->Toolbar->cacheKey = 'toolbar_history';
     Cache::delete('toolbar_history', $configName);
     DebugKitDebugger::startTimer('controllerAction', 'testing beforeRedirect');
     $this->Controller->Toolbar->panels['MockDebug']->expectOnce('beforeRender');
     $this->Controller->Toolbar->beforeRedirect($this->Controller);
     $result = Cache::read('toolbar_history', $configName);
     $this->assertTrue(isset($result[0]['session']));
     $this->assertTrue(isset($result[0]['mock_debug']));
     $timers = DebugKitDebugger::getTimers();
     $this->assertTrue(isset($timers['controllerAction']));
 }
開發者ID:masayukiando,項目名稱:cakephp1.3-mailmagazine,代碼行數:22,代碼來源:toolbar.test.php

示例11: 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;
 }
開發者ID:superstarrajini,項目名稱:cakepackages,代碼行數:15,代碼來源:AppModel.php

示例12: testOutput

 /**
  * test _output switch to firePHP
  *
  * @return void
  */
 function testOutput()
 {
     $firecake =& FireCake::getInstance('TestFireCake');
     Debugger::invoke(DebugKitDebugger::getInstance('DebugKitDebugger'));
     Debugger::output('fb');
     $foo .= '';
     $result = $firecake->sentHeaders;
     $this->assertPattern('/GROUP_START/', $result['X-Wf-1-1-1-1']);
     $this->assertPattern('/ERROR/', $result['X-Wf-1-1-1-2']);
     $this->assertPattern('/GROUP_END/', $result['X-Wf-1-1-1-5']);
     Debugger::invoke(Debugger::getInstance('Debugger'));
     Debugger::output();
 }
開發者ID:afzet,項目名稱:cake-cart,代碼行數:18,代碼來源:debug_kit_debugger.test.php

示例13: beforeRender

 /**
  * beforeRender Callback
  *
  * @return array
  **/
 function beforeRender(&$controller)
 {
     $this->startTime = DebugKitDebugger::requestStartTime();
     $this->currentTime = DebugKitDebugger::requestTime();
     $out = array();
     foreach ($this->logFiles as $log) {
         $file = LOGS . $log;
         if (!file_exists($file)) {
             continue;
         }
         $out[$log] = $this->_parseFile($file);
     }
     return $out;
 }
開發者ID:TomMaher,項目名稱:umambo,代碼行數:19,代碼來源:toolbar.php

示例14: requestTime

 /**
  * Get the total execution time until this point
  *
  * @access public
  * @return float elapsed time in seconds since script start.
  * @static
  */
 function requestTime()
 {
     $start = DebugKitDebugger::requestStartTime();
     $now = getMicroTime();
     return $now - $start;
 }
開發者ID:masayukiando,項目名稱:cakephp1.3-mailmagazine,代碼行數:13,代碼來源:debug_kit_debugger.php

示例15: tearDown

 /**
  * tear down function
  *
  * @return void
  **/
 function tearDown()
 {
     unset($this->View, $this->Controller);
     DebugKitDebugger::clearTimers();
     Configure::write('debug', $this->_debug);
 }
開發者ID:afzet,項目名稱:cake-cart,代碼行數:11,代碼來源:debug.test.php


注:本文中的DebugKitDebugger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。