Exemplo n.º 1
0
    public function display($expand, $indent = 0.0)
    {
        usort($this->children, 'compare_point');
        $ex = isset($expand[$this->name()]);
        $anchor = str_replace('"', '', $this->name());
        if (!$ex) {
            if (count($this->children)) {
                $url = getEscapedProfileUrl(false, false, $expand + [$this->name() => true]);
                $extet = " <a id=\"{$anchor}\" href=\"{$url}#{$anchor}\">[+]</a>";
            } else {
                $extet = '';
            }
        } else {
            $e = [];
            foreach ($expand as $name => $ep) {
                if ($name != $this->name()) {
                    $e += [$name => $ep];
                }
            }
            $url = getEscapedProfileUrl(false, false, $e);
            $extet = " <a id=\"{$anchor}\" href=\"{$url}#{$anchor}\">[–]</a>";
        }
        ?>
	<tr>
		<th>
			<div style="margin-left: <?php 
        echo (int) $indent;
        ?>
em;">
				<?php 
        echo htmlspecialchars(str_replace(',', ', ', $this->name())) . $extet;
        ?>
			</div>
		</th>
		<?php 
        //@codingStandardsIgnoreStart
        ?>
		<td class="mw-profileinfo-timep"><?php 
        echo @wfPercent($this->time() / self::$totaltime * 100);
        ?>
</td>
		<td class="mw-profileinfo-memoryp"><?php 
        echo @wfPercent($this->memory() / self::$totalmemory * 100);
        ?>
</td>
		<td class="mw-profileinfo-count"><?php 
        echo $this->count();
        ?>
</td>
		<td class="mw-profileinfo-cpr"><?php 
        echo round(sprintf('%.2f', $this->callsPerRequest()), 2);
        ?>
</td>
		<td class="mw-profileinfo-tpc"><?php 
        echo round(sprintf('%.2f', $this->timePerCall()), 2);
        ?>
</td>
		<td class="mw-profileinfo-mpc"><?php 
        echo round(sprintf('%.2f', $this->memoryPerCall() / 1024), 2);
        ?>
</td>
		<td class="mw-profileinfo-tpr"><?php 
        echo @round(sprintf('%.2f', $this->time() / self::$totalcount), 2);
        ?>
</td>
		<td class="mw-profileinfo-mpr"><?php 
        echo @round(sprintf('%.2f', $this->memory() / self::$totalcount / 1024), 2);
        ?>
</td>
		<?php 
        //@codingStandardsIgnoreEnd
        ?>
	</tr>
		<?php 
        if ($ex) {
            foreach ($this->children as $child) {
                $child->display($expand, $indent + 2);
            }
        }
    }
Exemplo n.º 2
0
    function display($expand, $indent = 0.0)
    {
        usort($this->children, 'compare_point');
        $ex = isset($expand[$this->name()]);
        if (!$ex) {
            if (count($this->children)) {
                $url = getEscapedProfileUrl(false, false, $expand + array($this->name() => true));
                $extet = " <a href=\"{$url}\">[+]</a>";
            } else {
                $extet = '';
            }
        } else {
            $e = array();
            foreach ($expand as $name => $ep) {
                if ($name != $this->name()) {
                    $e += array($name => $ep);
                }
            }
            $extet = " <a href=\"" . getEscapedProfileUrl(false, false, $e) . "\">[–]</a>";
        }
        ?>
		<tr>
		<td class="name" style="padding-left: <?php 
        echo $indent;
        ?>
em;">
			<?php 
        echo htmlspecialchars($this->name()) . $extet;
        ?>
		</td>
		<td class="timep"><?php 
        echo @wfPercent($this->time() / self::$totaltime * 100);
        ?>
</td>
		<td class="memoryp"><?php 
        echo @wfPercent($this->memory() / self::$totalmemory * 100);
        ?>
</td>
		<td class="count"><?php 
        echo $this->count();
        ?>
</td>
		<td class="cpr"><?php 
        echo round(sprintf('%.2f', $this->callsPerRequest()), 2);
        ?>
</td>
		<td class="tpc"><?php 
        echo round(sprintf('%.2f', $this->timePerCall()), 2);
        ?>
</td>
		<td class="mpc"><?php 
        echo round(sprintf('%.2f', $this->memoryPerCall() / 1024), 2);
        ?>
</td>
		<td class="tpr"><?php 
        echo @round(sprintf('%.2f', $this->time() / self::$totalcount), 2);
        ?>
</td>
		<td class="mpr"><?php 
        echo @round(sprintf('%.2f', $this->memory() / self::$totalcount / 1024), 2);
        ?>
</td>
		</tr>
		<?php 
        if ($ex) {
            foreach ($this->children as $child) {
                $child->display($expand, $indent + 2);
            }
        }
    }