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

Source for file display_errors.php

Documentation is available at display_errors.php

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

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