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


PHP xdebug_stop_trace函数代码示例

本文整理汇总了PHP中xdebug_stop_trace函数的典型用法代码示例。如果您正苦于以下问题:PHP xdebug_stop_trace函数的具体用法?PHP xdebug_stop_trace怎么用?PHP xdebug_stop_trace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: display

 public function display($tpl = null)
 {
     xdebug_start_trace(JPATH_COMPONENT . '/views/xdebug/function_trace');
     $data = $this->get('Data');
     $this->assign('data', $data);
     parent::display($tpl);
     xdebug_stop_trace();
 }
开发者ID:jlleblanc,项目名称:joomla-development-workflow-presentation,代码行数:8,代码来源:view.html.php

示例2: stop

 public function stop()
 {
     if (static::$file) {
         xdebug_stop_trace();
         static::$file = null;
     }
 }
开发者ID:renanbr,项目名称:telltale,代码行数:7,代码来源:TraceManager.php

示例3: tearDown

 protected function tearDown()
 {
     if ($this->stopTraceOnTearDown) {
         xdebug_stop_trace();
         $this->stopTraceOnTearDown = false;
     }
 }
开发者ID:renanbr,项目名称:telltale,代码行数:7,代码来源:TraceManagerTest.php

示例4: traceStop

function traceStop()
{
    if (!function_exists('xdebug_is_enabled') || !xdebug_is_enabled()) {
        return;
    }
    xdebug_stop_trace();
}
开发者ID:alencarmo,项目名称:OCF,代码行数:7,代码来源:xdebug.php

示例5: stopTrace

 public static function stopTrace()
 {
     if (!extension_loaded('xdebug')) {
         throw new \RuntimeException('XDebug must be installed to use this function');
     }
     \xdebug_stop_trace();
 }
开发者ID:zucchi,项目名称:zucchi,代码行数:7,代码来源:Debug.php

示例6: flush

 public function flush()
 {
     xdebug_stop_trace();
     echo "\n\n", 'Generating tracing reports from file ', $this->traceFile, ':', "\n";
     echo '  Class Diagram ...';
     $builder = $this->parse();
     $builder->build()->write('build/logs/class_diagram.dot');
     echo ' done', "\n";
 }
开发者ID:rodrigorm,项目名称:audit,代码行数:9,代码来源:TestListener.php

示例7: end_trace

 /**
  * If an XDebug trace is running, this stops the trace.
  * 
  * @param bool $showAsDebug  If true, outputs the trace file as debug information (assuming displayDebug is used)
  * 
  * @return void
  */
 public static function end_trace($showAsDebug = false)
 {
     if (function_exists('xdebug_stop_trace')) {
         $file = xdebug_get_tracefile_name();
         xdebug_stop_trace();
         if ($showAsDebug === true) {
             $trace = file_get_contents($file);
             self::debug($trace);
         }
     }
 }
开发者ID:Borvik,项目名称:Munla,代码行数:18,代码来源:log.php

示例8: kataSmallProfile

 /**
  * shutdown function to generate profile report 
  */
 function kataSmallProfile()
 {
     xdebug_stop_trace();
     $lines = file($GLOBALS['kataSmallProfileFile'] . '.xt');
     unlink($GLOBALS['kataSmallProfileFile'] . '.xt');
     array_shift($lines);
     //version
     array_shift($lines);
     //trace start
     array_pop($lines);
     //exit
     array_pop($lines);
     //trace end
     $lastLine = array_pop($lines);
     //dummy
     $temp = explode("\t", $lines[2]);
     $endTime = $temp[3];
     $temp = explode("\t", $lastLine);
     $totalTime = $temp[3] - $endTime;
     unset($temp);
     $callStack = array();
     $outCnt = array();
     $out = array();
     foreach ($lines as $line) {
         $line = explode("\t", $line);
         if (1 == $line[2]) {
             $retLine = array_pop($callStack);
             if ($retLine[6] == 1) {
                 //user func
                 $time = $line[3] - $retLine[3];
                 $outCnt[$retLine[5]] = (empty($outCnt[$retLine[5]]) ? 0 : $outCnt[$retLine[5]]) + 1;
                 $out[$retLine[5]] = (empty($out[$retLine[5]]) ? 0 : $out[$retLine[5]]) + $time;
             }
             continue;
         }
         if (substr($line[8], 0, strlen(ROOT)) != ROOT) {
             continue;
         }
         if (0 == $line[2]) {
             // entry
             $callStack[] = $line;
         }
     }
     arsort($out);
     $tdCell = '<td style="border:1px solid red;padding:2px;">';
     echo '<table style="border:1px solid red;color:black;background-color:#e8e8e8;border-collapse:collapse;">';
     echo '<tr>' . $tdCell . 'What</td>' . $tdCell . 'x times</td>' . $tdCell . 'ms total</td></tr>';
     foreach ($out as $n => $v) {
         echo '<tr>' . $tdCell . '<pre class="c1">' . $n . '</pre></td>' . $tdCell . $outCnt[$n] . '</td>' . $tdCell . $v . ' ms</td></tr>';
     }
     echo "<tr>{$tdCell} Total (before destroy)</td>{$tdCell}</td>{$tdCell} {$totalTime} ms</td></tr>";
     echo '</table>';
 }
开发者ID:emente,项目名称:kataii---kata-framework-2.x,代码行数:56,代码来源:profile.php

示例9: stop

 static function stop()
 {
     if (ini_get('xdebug.auto_trace')) {
         return;
     }
     if (!self::$running) {
         throw new \BadMethodCallException();
     }
     xdebug_stop_trace();
     foreach (self::$iniRestore as $k => $v) {
         ini_set($k, $v);
     }
     self::$iniRestore = [];
     self::$running = false;
 }
开发者ID:shabbyrobe,项目名称:caper,代码行数:15,代码来源:Tracer.php

示例10: _preRender

 protected function _preRender()
 {
     parent::_preRender();
     if (Solar_Config::get('Foresmo', 'dev')) {
         xdebug_stop_trace();
         $trace_file = explode("\n", file_get_contents('/var/www/foresmo/tmp/trace.xt'));
         $trace_file_count = count($trace_file);
         $trace_dump = array();
         $defined_funcs = get_defined_functions();
         foreach ($trace_file as $line => $value) {
             if ($line == 0 || $line >= $trace_file_count - 4 || strstr($value, 'include(') || strstr($value, 'require(')) {
                 continue;
             }
             $tl = explode('-> ', $value);
             $tl = explode(' ', $tl[1]);
             if (!in_array(str_replace('()', '', $tl[0]), $defined_funcs['internal']) && strstr($tl[0], 'Foresmo') && !in_array($tl[0], $trace_dump)) {
                 $trace_dump[] = $tl[0];
             }
         }
         $tests = array();
         // Lets organize our trace dump calls to that we can easily check/run tests
         foreach ($trace_dump as $call) {
             if (strstr($call, '->')) {
                 $class_method = explode('->', $call);
             } else {
                 $class_method = explode('::', $call);
             }
             if (!isset($tests[$class_method[0]])) {
                 $tests[$class_method[0]] = array($class_method[1]);
             } else {
                 $tests[$class_method[0]][] = $class_method[1];
             }
         }
         var_dump($trace_dump);
         var_dump($tests);
         die;
     }
 }
开发者ID:btweedy,项目名称:foresmo,代码行数:38,代码来源:Index.php

示例11: log

 /**
  * Log same time range
  *
  * @param string  $timePoint  Time range name
  * @param boolean $additional Additional metric flag OPTIONAL
  *
  * @return void
  */
 public function log($timePoint, $additional = false)
 {
     if (!isset($this->points[$timePoint])) {
         $this->points[$timePoint] = array('start' => microtime(true), 'open' => true, 'time' => 0);
         if (self::$useXdebugStackTrace) {
             xdebug_start_trace(LC_DIR_LOG . $timePoint . '.' . microtime(true), XDEBUG_TRACE_COMPUTERIZED);
         }
     } elseif ($this->points[$timePoint]['open']) {
         $range = microtime(true) - $this->points[$timePoint]['start'];
         if ($additional) {
             $this->points[$timePoint]['time'] += $range;
         } else {
             $this->points[$timePoint]['time'] = $range;
         }
         $this->points[$timePoint]['open'] = false;
         if (self::$useXdebugStackTrace) {
             @xdebug_stop_trace();
         }
     } else {
         $this->points[$timePoint]['start'] = microtime(true);
         $this->points[$timePoint]['open'] = true;
         if (self::$useXdebugStackTrace) {
             xdebug_start_trace(LC_DIR_VAR . 'log' . LC_DS . $timePoint . '.' . microtime(true), XDEBUG_TRACE_COMPUTERIZED);
         }
     }
 }
开发者ID:kingsj,项目名称:core,代码行数:34,代码来源:Profiler.php

示例12: process

 function process($tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace)
 {
     switch ($functionName) {
         case $this->TimingPointName:
             $children = $functionChildren;
             $parameters = $functionParameters;
             $id = false;
             if (isset($parameters["id"])) {
                 $id = $tpl->elementValue($parameters["id"], $rootNamespace, $currentNamespace, $functionPlacement);
             }
             $startDescription = "debug-timing-point START: {$id}";
             eZDebug::addTimingPoint($startDescription);
             if (is_array($children)) {
                 foreach (array_keys($children) as $childKey) {
                     $child =& $children[$childKey];
                     $tpl->processNode($child, $textElements, $rootNamespace, $currentNamespace);
                 }
             }
             $endDescription = "debug-timing-point END: {$id}";
             eZDebug::addTimingPoint($endDescription);
             break;
         case $this->AccumulatorName:
             $children = $functionChildren;
             $parameters = $functionParameters;
             $id = false;
             if (isset($parameters["id"])) {
                 $id = $tpl->elementValue($parameters["id"], $rootNamespace, $currentNamespace, $functionPlacement);
             }
             $name = false;
             if (isset($parameters["name"])) {
                 $name = $tpl->elementValue($parameters["name"], $rootNamespace, $currentNamespace, $functionPlacement);
             }
             // Assign a name (as $functionName) which will be used in the debug output.
             $name = ($name === false and $id === false) ? $functionName : $name;
             // To uniquely identify this accumulator.
             $id = $id === false ? uniqID($functionName . '_') : $id;
             eZDebug::accumulatorStart($id, 'Debug-Accumulator', $name);
             if (is_array($children)) {
                 foreach (array_keys($children) as $childKey) {
                     $child =& $children[$childKey];
                     $tpl->processNode($child, $textElements, $rootNamespace, $currentNamespace);
                 }
             }
             eZDebug::accumulatorStop($id);
             break;
         case $this->LogName:
             $parameters = $functionParameters;
             if (isset($parameters['var'])) {
                 $var = $tpl->elementValue($parameters['var'], $rootNamespace, $currentNamespace, $functionPlacement);
             }
             if (isset($parameters['msg'])) {
                 $msg = $tpl->elementValue($parameters['msg'], $rootNamespace, $currentNamespace, $functionPlacement);
             }
             if (isset($var) && isset($msg)) {
                 eZDebug::writeDebug($var, $msg);
             } elseif (isset($msg)) {
                 eZDebug::writeDebug($msg);
             } elseif (isset($var)) {
                 eZDebug::writeDebug($var);
             }
             break;
         case $this->TraceName:
             $children = $functionChildren;
             $id = false;
             // If we have XDebug we start the trace, execute children and stop it
             // if not we just execute the children as normal
             if (extension_loaded('xdebug')) {
                 $parameters = $functionParameters;
                 if (isset($parameters["id"])) {
                     $id = $tpl->elementValue($parameters["id"], $rootNamespace, $currentNamespace, $functionPlacement);
                 }
                 if (!$id) {
                     $id = 'template-debug';
                 }
                 // If we already have a file, make sure it is truncated
                 if (file_exists($id . '.xt')) {
                     $fd = fopen($id, '.xt', 'w');
                     fclose($fd);
                 }
                 xdebug_start_trace($id);
                 if (is_array($children)) {
                     foreach (array_keys($children) as $childKey) {
                         $child =& $children[$childKey];
                         $tpl->processNode($child, $textElements, $rootNamespace, $currentNamespace);
                     }
                 }
                 xdebug_stop_trace();
             } elseif (is_array($children)) {
                 foreach (array_keys($children) as $childKey) {
                     $child =& $children[$childKey];
                     $tpl->processNode($child, $textElements, $rootNamespace, $currentNamespace);
                 }
             }
             break;
     }
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:96,代码来源:eztemplatedebugfunction.php

示例13: array

<?php

include_once __DIR__ . '/vendor/autoload.php';
$appConfig = $appConfig = array('modules' => array(), 'module_listener_options' => array('module_paths' => array('./vendor'), 'config_glob_paths' => array('config/autoload/{,*.}{global,local}.php')));
if (!is_dir(__DIR__ . '/trace')) {
    mkdir(__DIR__ . '/trace');
}
ini_set('xdebug.show_mem_delta', '1');
for ($t = 0; $t < 5; $t++) {
    xdebug_start_trace(sprintf('%s/trace/%d', __DIR__, $t + 1));
    $app = \Zend\Mvc\Application::init($appConfig);
    xdebug_stop_trace();
    \Zend\EventManager\StaticEventManager::resetInstance();
    $app = null;
}
开发者ID:akomm,项目名称:zf2-memory-leak-test,代码行数:15,代码来源:test3.php

示例14: stopXDTrace

 /**
  * Stop xdebug trace. Call startXDTrace() first.
  * @param string $file (default = STDOUT)
  */
 public function stopXDTrace($file = 'php://STDOUT')
 {
     $trace_file = xdebug_get_tracefile_name();
     xdebug_stop_trace();
     if (!$trace_file || !$file) {
         return;
     }
     $fh = fopen($trace_file, 'r');
     fgets($fh);
     // ignore first line
     $trace_buildin = array('microtime()', 'memory_get_usage()', 'xdebug_call_class()', 'xdebug_call_function()', 'xdebug_call_line()', 'xdebug_call_file()', 'xdebug_stop_trace()');
     $trace_func = array('rkphplib\\Profiler->log()');
     $buildin_list = array('time', 'in_array', 'is_object', 'is_array', 'is_null', 'array_push', 'join', 'preg_match', 'array_keys', 'array_shift', 'array_pop', 'array_push', 'strpos', 'preg_split', 'count', 'substr', 'mb_substr', 'basename', 'str_replace', 'mysqli->real_escape_string', 'mysqli->mysqli', 'mysqli->real_query', 'mysqli->set_charset', 'mysqli->query', 'mysqli_result->fetch_assoc', 'mysqli_result->close', 'mysqli->prepare', 'mysqli_stmt->bind_param', 'mysqli_stmt->execute', 'mysqli_stmt->close', 'ReflectionClass->__construct', 'ReflectionClass->getMethod', 'ReflectionMethod->invokeArgs');
     $buildin = array();
     foreach ($buildin_list as $func) {
         $buildin[$func . '()'] = 0;
     }
     $custom = array();
     $last = array(0, 0, '', '');
     while ($line = fgets($fh)) {
         $col = preg_split("/ +/", trim($line));
         if (empty($col[4])) {
             continue;
         }
         if (in_array($col[3], $trace_buildin)) {
             $last = $col;
             continue;
         }
         if (in_array($col[3], $trace_func)) {
             // ToDo ... ignore following
             continue;
         }
         if (isset($buildin[$col[3]])) {
             $buildin[$col[3]]++;
         } else {
             if (!isset($custom[$col[3]])) {
                 $custom[$col[3]] = array('call' => 0, 'time' => 0, 'mem' => 0);
             }
             $custom[$col[3]]['call']++;
             // ToDo ... collect following
             $custom[$col[3]]['time'] = 0;
             $custom[$col[3]]['mem'] = 0;
         }
         $last = $col;
     }
     fclose($fh);
     $fh = fopen($file, 'a');
     fwrite($fh, "\nBuildIn Functions:\n");
     foreach ($buildin as $func => $call) {
         if ($call > 10) {
             fprintf($fh, "%10s%50s\n", $call . 'x ', $func);
         }
     }
     fwrite($fh, "\nCustom Functions:\n");
     foreach ($custom as $func => $info) {
         if ($info['call'] > 0) {
             $c = $info['call'];
             fprintf($fh, "%10s%50s%16s%16s\n", $c . 'x ', $func, round($info['time'] / $c, 4) . ' s', round($info['mem'] / $c, 0) . ' b');
         }
     }
     fclose($fh);
 }
开发者ID:RolandKujundzic,项目名称:rkphplib,代码行数:66,代码来源:Profiler.class.php

示例15: stopTrace

 /**
  * Stops trace.
  * This is for temporary use when debugging.
  * DO NOT CHECK IN A CALL TO THIS FUNCTION.
  */
 public static function stopTrace()
 {
     xdebug_stop_trace();
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:9,代码来源:DebugUtil.php


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