1. <?php
  2. /**
  3. * Generate phpinfo() style PEAR information, embedded into user-defined html template
  4. *
  5. * @author    Laurent Laville
  6. * @package   PEAR_Info
  7. * @version   $Id:$
  8. * @license   http://www.php.net/license/3_01.txt  PHP License 3.01
  9. * @ignore
  10. */
  11.  
  12. // require the PEAR_Info file
  13. require_once 'PEAR/Info.php';
  14.  
  15. class PEAR_Info3 extends PEAR_Info
  16. {
  17.     function toHtml()
  18.     {
  19.         if (!defined('PEAR_INFO_CSS')) {
  20.             PEAR_Info::setStyleSheet();
  21.         }
  22.         $styles = file_get_contents(PEAR_INFO_CSS);
  23.  
  24.         $body = $this->info;
  25.  
  26.         $html = <<<HTML
  27. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  28.     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  29. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
  30. <head>
  31. <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
  32. <meta name="author" content="Laurent Laville" />
  33. <title>My PEAR_Info()</title>
  34. <style type="text/css">
  35. <!--
  36. $styles
  37.  -->
  38. </style>
  39. </head>
  40. <body>
  41.  
  42. <div id="header">
  43. <h1>Laurent-Laville.org</h1>
  44. </div>
  45.  
  46. <div id="footer">
  47. </div>
  48.  
  49. <div id="contents">
  50. $body
  51. </div>
  52.  
  53. </body>
  54. </html>
  55. HTML;
  56.         return $html;
  57.     }
  58. }
  59.  
  60. // set your own styles, rather than use the default stylesheet
  61. PEAR_Info::setStyleSheet(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pearinfo3.css');
  62.  
  63. // Create PEAR_Info object
  64. $info = new PEAR_Info3();
  65.  
  66. // Display PEAR_Info output
  67. $info->display();
  68.  
  69. ?>