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 PEAR_Info3($pear_dir = false, $pear_user_config = false)
  18.     {
  19.         $this->__construct($pear_dir, $pear_user_config);
  20.     }
  21.  
  22.     function toHtml()
  23.     {
  24.         $styles = basename($this->getStyleSheet(false));
  25.  
  26.         $body = $this->info;
  27.  
  28.         $html = <<<HTML
  29. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  30.     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  31. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
  32. <head>
  33. <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
  34. <meta name="author" content="Laurent Laville" />
  35. <title>My PEAR_Info()</title>
  36. <link rel="stylesheet" type="text/css" href="$styles" />
  37. </head>
  38. <body>
  39.  
  40. <div id="header">
  41. <h1>Laurent-Laville.org</h1>
  42. </div>
  43.  
  44. <div id="footer">
  45. </div>
  46.  
  47. <div id="contents">
  48. $body
  49. </div>
  50.  
  51. </body>
  52. </html>
  53. HTML;
  54.         return $html;
  55.     }
  56. }
  57.  
  58. // Create PEAR_Info object
  59. $info = new PEAR_Info3();
  60.  
  61. // set your own styles, rather than use the default stylesheet
  62. $info->setStyleSheet(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pearinfo3.css');
  63.  
  64. // Display PEAR_Info output
  65. $info->display();
  66.  
  67. ?>