本文整理汇总了PHP中Tracy\Debugger::detectDebugMode方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::detectDebugMode方法的具体用法?PHP Debugger::detectDebugMode怎么用?PHP Debugger::detectDebugMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracy\Debugger
的用法示例。
在下文中一共展示了Debugger::detectDebugMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseXMLFile
function parseXMLFile($fileInfo, &$memoryLeakData)
{
usleep($fileInfo['time'] * 1000000 / 2);
consumeMemory($fileInfo['size'] * 10, $memoryLeakData);
}
function storeData($fileInfo, &$memoryLeakData)
{
// pm is shortcut for ProcessMonitor::dump()
pm('some debug msg');
usleep($fileInfo['time'] * 1000000 / 3);
consumeMemory($fileInfo['size'] / 10, $memoryLeakData);
}
// end of fake demo specific code
// processMonitor extends Tracy\Debugger and mostly respects it's configuration
// therefore configure Debugger first
Debugger::detectDebugMode();
Debugger::enable();
Debugger::$maxDepth = 1;
// initialize ProcessMonitor
ProcessMonitor::$reportMode = ProcessMonitor::SHOW_DETAIL;
// ProcessMonitor::start is intended to be run only once
ProcessMonitor::start('some API import (this is only fake demo)');
$count = 0;
// this is how typical processing loop looks like
foreach ($filesList as $fileInfo) {
// while debugging scripts which repeat some actions multiple times
// reset process monitor timers in each loop
pmr('some api call to import ' . $fileInfo['name']);
// 1. step some api call
runApiCallToGetXMLFile($fileInfo, $memoryLeakData);
// pms is shortcut for ProcessMonitor::addSummary()