HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]

Source for file log_errors.php

Documentation is available at log_errors.php

  1. <?php 
  2. @include '../include_path.php';
  3. /**
  4.  * Natural Horizontal ProgressBar example with blue skin.
  5.  * Logs errors on file (with full context)
  6.  * and browser display (restricted context)
  7.  * 
  8.  * @version    $Id: log_errors.php,v 1.1 2004/07/05 21:31:06 farell Exp $
  9.  * @author     Laurent Laville <pear@laurent-laville.org>
  10.  * @package    HTML_Progress
  11.  */
  12.  
  13. require_once 'HTML/Progress.php';
  14.  
  15. function _pushCallback($err)
  16. {
  17.     // don't die if the error is an exception (as default callback)
  18. }
  19.  
  20. $logger = array();
  21. $logger['handler']['file'= array(
  22.     'name' => 'progress.log',
  23.     'ident' => $_SERVER['REMOTE_ADDR']
  24. );
  25.  
  26. /* only class-method context will be display on message error of browser screen
  27.    but full context will be written in file logger
  28.    Recommanded for production WebSite
  29. */
  30. $logger['handler']['display'= array(
  31.     'conf' => array(
  32.                  'printf' => '<b>%s </b>: %s in <b>%s</b>',
  33.                  'ereg' => 'in (.*) \(file (.*) at line (.*)\)'
  34.                    )
  35. );
  36.  
  37. $bar = new HTML_Progress($logger);
  38. $bar->setAnimSpeed(10000);
  39. if ($bar->hasErrors()) {
  40.     exit;
  41. }
  42. ?>
  43. <html>
  44. <head>
  45. <title>FileLogger Progress example</title>
  46. <style type="text/css">
  47. <!--
  48. <?php echo $bar->getStyle()?>
  49.  
  50. body {
  51.     background-color: #EEEEEE;
  52.     color: #000000;
  53.     font-family: Verdana, Arial;
  54. }
  55.  
  56. a:visited, a:active, a:link {
  57.     color: navy;
  58. }
  59. // -->
  60. </style>
  61. <script type="text/javascript">
  62. <!--
  63. <?php echo $bar->getScript()?>
  64. //-->
  65. </script>
  66. </head>
  67. <body>
  68. <h1><?php echo basename(__FILE__)?></h1>
  69.  
  70. <?php 
  71. echo $bar->toHtml()
  72. $bar->run();
  73. ?>
  74.  
  75. <p>&lt;&lt; <a href="../index.html">Back examples TOC</a></p>
  76.  
  77. </body>
  78. </html>

Documentation generated on Mon, 11 Mar 2019 13:52:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.