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/04/18 13:25:43 farell Exp $
  9.  * @author     Laurent Laville <pear@laurent-laville.org>
  10.  * @package    HTML_Progress
  11.  */
  12.  
  13. require_once 'HTML/Progress.php';
  14.  
  15. $logger = array();
  16. $logger['log_errors''off';
  17. $logger['handler']['file'= array(
  18.     'name' => 'progress.log',
  19.     'ident' => $_SERVER['REMOTE_ADDR']
  20. );
  21.  
  22. /* only class-method context will be display on message error of browser screen
  23.    but full context will be written in file logger
  24.    Recommanded for production WebSite
  25. */
  26. $logger['handler']['display'= array(
  27.     'conf' => array(
  28.                  'printf' => '<b>%s </b>: %s in <b>%s</b>',
  29.                  'ereg' => 'in (.*) \(file (.*) at line (.*)\)'
  30.                    )
  31. );
  32.  
  33. $bar = new HTML_Progress($logger);
  34. $bar->setAnimSpeed('100');
  35. ?>
  36. <html>
  37. <head>
  38. <title>FileLogger Progress example</title>
  39. <style type="text/css">
  40. <!--
  41. <?php echo $bar->getStyle()?>
  42.  
  43. body {
  44.     background-color: #EEEEEE;
  45.     color: #000000;
  46.     font-family: Verdana, Arial;
  47. }
  48.  
  49. a:visited, a:active, a:link {
  50.     color: navy;
  51. }
  52. // -->
  53. </style>
  54. <script type="text/javascript">
  55. <!--
  56. <?php echo $bar->getScript()?>
  57. //-->
  58. </script>
  59. </head>
  60. <body>
  61. <h1><?php echo basename(__FILE__)?></h1>
  62.  
  63. <?php 
  64. echo $bar->toHtml()
  65.  
  66. do {
  67.     $bar->display();
  68.     if ($bar->getPercentComplete(== 1{
  69.         break;   // the progress bar has reached 100%
  70.     }
  71.     $bar->incValue();
  72. while(1);
  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 10:15:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.