| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*
|
|
|
4 |
* This file is part of the symfony package.
|
|
|
5 |
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
6 |
*
|
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
|
|
8 |
* file that was distributed with this source code.
|
|
|
9 |
*/
|
|
|
10 |
|
|
|
11 |
/**
|
|
|
12 |
* sfWebDebugPanelMemory adds a panel to the web debug toolbar with the memory used by the script.
|
|
|
13 |
*
|
|
|
14 |
* @package symfony
|
|
|
15 |
* @subpackage debug
|
|
|
16 |
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
17 |
* @version SVN: $Id: sfWebDebugPanelMemory.class.php 21069 2009-08-11 23:28:20Z Kris.Wallsmith $
|
|
|
18 |
*/
|
|
|
19 |
class sfWebDebugPanelMemory extends sfWebDebugPanel
|
|
|
20 |
{
|
|
|
21 |
public function getTitle()
|
|
|
22 |
{
|
|
|
23 |
$totalMemory = sprintf('%.1f', (memory_get_peak_usage(true) / 1024));
|
|
|
24 |
|
|
|
25 |
return '<img src="'.$this->webDebug->getOption('image_root_path').'/memory.png" alt="Memory" /> '.$totalMemory.' KB';
|
|
|
26 |
}
|
|
|
27 |
|
|
|
28 |
public function getPanelTitle()
|
|
|
29 |
{
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
public function getPanelContent()
|
|
|
33 |
{
|
|
|
34 |
}
|
|
|
35 |
}
|