<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Sets profiling output file</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xsltprocessor.setparameter.html">XSLTProcessor::setParameter</a></div> <div class="next" style="text-align: right; float: right;"><a href="xsltprocessor.setsecurityprefs.html">XsltProcessor::setSecurityPrefs</a></div> <div class="up"><a href="class.xsltprocessor.html">XSLTProcessor</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="xsltprocessor.setprofiling" class="refentry"> <div class="refnamediv"> <h1 class="refname">XSLTProcessor::setProfiling</h1> <p class="verinfo">(PHP >= 5.3.0)</p><p class="refpurpose"><span class="refname">XSLTProcessor::setProfiling</span> — <span class="dc-title">Sets profiling output file</span></p> </div> <div class="refsect1 description" id="refsect1-xsltprocessor.setprofiling-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>XSLTProcessor::setProfiling</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span> )</div> <p class="para rdfs-comment"> Sets the file to output profiling information when processing a stylesheet. </p> </div> <div class="refsect1 parameters" id="refsect1-xsltprocessor.setprofiling-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">filename</code></em></span> <dd> <p class="para"> Path to the file to dump profiling information. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-xsltprocessor.setprofiling-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 examples" id="refsect1-xsltprocessor.setprofiling-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-5542"> <p><strong>Example #1 Example profiling output</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// Load the XML source<br /></span><span style="color: #0000BB">$xml </span><span style="color: #007700">= new </span><span style="color: #0000BB">DOMDocument</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$xml</span><span style="color: #007700">-></span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #DD0000">'collection.xml'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$xsl </span><span style="color: #007700">= new </span><span style="color: #0000BB">DOMDocument</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$xsl</span><span style="color: #007700">-></span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #DD0000">'collection.xsl'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Configure the transformer<br /></span><span style="color: #0000BB">$proc </span><span style="color: #007700">= new </span><span style="color: #0000BB">XSLTProcessor</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$proc</span><span style="color: #007700">-></span><span style="color: #0000BB">setProfiling</span><span style="color: #007700">(</span><span style="color: #DD0000">'profiling.txt'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$proc</span><span style="color: #007700">-></span><span style="color: #0000BB">importStyleSheet</span><span style="color: #007700">(</span><span style="color: #0000BB">$xsl</span><span style="color: #007700">); </span><span style="color: #FF8000">// attach the xsl rules<br /><br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">trim</span><span style="color: #007700">(</span><span style="color: #0000BB">$proc</span><span style="color: #007700">-></span><span style="color: #0000BB">transformToDoc</span><span style="color: #007700">(</span><span style="color: #0000BB">$xml</span><span style="color: #007700">)-></span><span style="color: #0000BB">firstChild</span><span style="color: #007700">-></span><span style="color: #0000BB">wholeText</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p> The above code will produce the following information in the profiling file: </p></div> <div class="example-contents screen"> <div class="cdata"><pre> number match name mode Calls Tot 100us Avg 0 cd 2 3 1 1 collection 1 1 1 Total 3 4 </pre></div> </div> </div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="xsltprocessor.setparameter.html">XSLTProcessor::setParameter</a></div> <div class="next" style="text-align: right; float: right;"><a href="xsltprocessor.setsecurityprefs.html">XsltProcessor::setSecurityPrefs</a></div> <div class="up"><a href="class.xsltprocessor.html">XSLTProcessor</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>