(PHP >= 5.3.0, PHP 7, PHP 8)
XSLTProcessor::setProfiling — 設定效能分析輸出檔案
filename
傾印效能分析資訊的檔案路徑。
永遠回傳 true
。
範例 #1 效能分析輸出範例
<?php
// 載入 XML 來源
$xml = new DOMDocument;
$xml->load('collection.xml');
$xsl = new DOMDocument;
$xsl->load('collection.xsl');
// 設定轉換器
$proc = new XSLTProcessor;
$proc->setProfiling('profiling.txt');
$proc->importStyleSheet($xsl); // 附加 XSL 規則
echo trim($proc->transformToDoc($xml)->firstChild->wholeText);
?>
上述程式碼會在效能分析檔案中產生以下資訊
number match name mode Calls Tot 100us Avg 0 cd 2 3 1 1 collection 1 1 1 Total 3 4