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


PHP Debugger::trimpath方法代码示例

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


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

示例1: startTimer

 /**
  * Start an benchmarking timer.
  *
  * @param string $name The name of the timer to start.
  * @param string $message A message for your timer
  * @return bool true
  * @static
  **/
 function startTimer($name = null, $message = null)
 {
     $start = getMicrotime();
     $_this = DebugKitDebugger::getInstance();
     if (!$name) {
         $named = false;
         $calledFrom = debug_backtrace();
         $_name = $name = Debugger::trimpath($calledFrom[0]['file']) . ' line ' . $calledFrom[0]['line'];
     } else {
         $named = true;
     }
     if (!$message) {
         $message = $name;
     }
     $_name = $name;
     $i = 1;
     while (isset($_this->__benchmarks[$name])) {
         $i++;
         $name = $_name . ' #' . $i;
     }
     if ($i > 1) {
         $message .= ' #' . $i;
     }
     $_this->__benchmarks[$name] = array('start' => $start, 'message' => $message, 'named' => $named);
     return true;
 }
开发者ID:masayukiando,项目名称:cakephp1.3-mailmagazine,代码行数:34,代码来源:debug_kit_debugger.php

示例2: start

 /**
  * Start an benchmarking timer.
  *
  * @param string $name The name of the timer to start.
  * @param string $message A message for your timer
  * @return bool Always true
  */
 public static function start($name = null, $message = null)
 {
     $start = microtime(true);
     if (!$name) {
         $named = false;
         $calledFrom = debug_backtrace();
         $name = Debugger::trimpath($calledFrom[0]['file']) . ' line ' . $calledFrom[0]['line'];
     } else {
         $named = true;
     }
     if (!$message) {
         $message = $name;
     }
     $_name = $name;
     $i = 1;
     while (isset(self::$_timers[$name])) {
         $i++;
         $name = $_name . ' #' . $i;
     }
     if ($i > 1) {
         $message .= ' #' . $i;
     }
     self::$_timers[$name] = array('start' => $start, 'message' => $message, 'named' => $named);
     return true;
 }
开发者ID:tetsuo111,项目名称:main_cakephp_app,代码行数:32,代码来源:DebugTimer.php

示例3: record

 /**
  * Stores a memory point in the internal tracker.
  * Takes a optional message name which can be used to identify the memory point.
  * If no message is supplied a debug_backtrace will be done to identify the memory point.
  *
  * @param string $message Message to identify this memory point.
  * @return bool
  */
 public static function record($message = null)
 {
     $memoryUse = self::getCurrent();
     if (!$message) {
         $trace = debug_backtrace();
         $message = Debugger::trimpath($trace[0]['file']) . ' line ' . $trace[0]['line'];
     }
     if (isset(self::$_points[$message])) {
         $originalMessage = $message;
         $i = 1;
         while (isset(self::$_points[$message])) {
             $i++;
             $message = $originalMessage . ' #' . $i;
         }
     }
     self::$_points[$message] = $memoryUse;
     return true;
 }
开发者ID:gjcamacho,项目名称:blog_test,代码行数:26,代码来源:DebugMemory.php

示例4: setMemoryPoint

 /**
  * Stores a memory point in the internal tracker.
  * Takes a optional message name which can be used to identify the memory point.
  * If no message is supplied a debug_backtrace will be done to identifty the memory point.
  * If you don't have memory_get_xx methods this will not work.
  *
  * @param string $message Message to identify this memory point.
  * @return boolean
  **/
 function setMemoryPoint($message = null)
 {
     $memoryUse = DebugKitDebugger::getMemoryUse();
     if (!$message) {
         $named = false;
         $trace = debug_backtrace();
         $message = Debugger::trimpath($trace[0]['file']) . ' line ' . $trace[0]['line'];
     }
     $self =& DebugKitDebugger::getInstance();
     if (isset($self->__memoryPoints[$message])) {
         $originalMessage = $message;
         $i = 1;
         while (isset($self->__memoryPoints[$message])) {
             $i++;
             $message = $originalMessage . ' #' . $i;
         }
     }
     $self->__memoryPoints[$message] = $memoryUse;
     return true;
 }
开发者ID:ambagasdowa,项目名称:kml,代码行数:29,代码来源:debug_kit_debugger.php


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