NetDebug.php 1001 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * The NetDebug class includes a NetDebug::trace function that works
  4. * like the Flash one
  5. *
  6. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  7. * @copyright (c) 2003 amfphp.org
  8. * @package flashservices
  9. * @subpackage util
  10. * @version $Id: NetDebug.php,v 1.1 2005/03/24 22:19:48 pmineault Exp $
  11. */
  12. class NetDebug
  13. {
  14. /**
  15. * Don't do anything, just in case something pops up that needs to be initialized
  16. */
  17. function initialize()
  18. {
  19. }
  20. /**
  21. * A static function that traces stuff in the NetDebug window
  22. *
  23. * Note emulation of static variables
  24. */
  25. function trace($what)
  26. {
  27. NetDebug::getTraceStack($what);
  28. }
  29. function printr($what)
  30. {
  31. ob_start();
  32. print_r($what);
  33. $result = ob_get_clean();
  34. NetDebug::getTraceStack($result);
  35. }
  36. function getTraceStack($val=NULL)
  37. {
  38. static $traceStack = array();
  39. if($val !== NULL)
  40. {
  41. $traceStack[] = $val;
  42. }
  43. return $traceStack;
  44. }
  45. }
  46. ?>