sfWebDebugPanelMemory.class.php 1011 B

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