PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/DevApp/library/ServerLibraries/FirePHPCore/0.3/demo/procedural.php4

http://firephp.googlecode.com/
PHP | 76 lines | 20 code | 17 blank | 39 comment | 0 complexity | bb81c17d9d480a17e1d2f56eb0a95d6c MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.0, MIT, Apache-2.0
  1. <?php
  2. /* ***** BEGIN LICENSE BLOCK *****
  3. *
  4. * This file is part of FirePHP (http://www.firephp.org/).
  5. *
  6. * Software License Agreement (New BSD License)
  7. *
  8. * Copyright (c) 2006-2009, Christoph Dorn
  9. * All rights reserved.
  10. *
  11. * Redistribution and use in source and binary forms, with or without modification,
  12. * are permitted provided that the following conditions are met:
  13. *
  14. * * Redistributions of source code must retain the above copyright notice,
  15. * this list of conditions and the following disclaimer.
  16. *
  17. * * Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. *
  21. * * Neither the name of Christoph Dorn nor the names of its
  22. * contributors may be used to endorse or promote products derived from this
  23. * software without specific prior written permission.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  26. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  27. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  28. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  29. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  30. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  31. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  32. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  34. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. *
  36. * ***** END LICENSE BLOCK ***** */
  37. /* NOTE: You must have the FirePHPCore library in your include path */
  38. set_include_path('./../lib/'.PATH_SEPARATOR.get_include_path());
  39. require('FirePHPCore/fb.php');
  40. /* NOTE: You must have Output Buffering enabled via
  41. ob_start() or output_buffering ini directive. */
  42. fb('Hello World'); /* Defaults to FirePHP::LOG */
  43. fb('Log message' ,FirePHP_LOG);
  44. fb('Info message' ,FirePHP_INFO);
  45. fb('Warn message' ,FirePHP_WARN);
  46. fb('Error message',FirePHP_ERROR);
  47. fb('Message with label','Label',FirePHP_LOG);
  48. fb(array('key1'=>'val1',
  49. 'key2'=>array(array('v1','v2'),'v3')),
  50. 'TestArray',FirePHP_LOG);
  51. fb('Backtrace to here',FirePHP_TRACE);
  52. fb(array('2 SQL queries took 0.06 seconds',array(
  53. array('SQL Statement','Time','Result'),
  54. array('SELECT * FROM Foo','0.02',array('row1','row2')),
  55. array('SELECT * FROM Bar','0.04',array('row1','row2'))
  56. )),FirePHP_TABLE);
  57. /* Will show only in "Server" tab for the request */
  58. fb(apache_request_headers(),'RequestHeaders',FirePHP_DUMP);
  59. print 'Hello World';