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

Source for file PHP_Debug_Sources.php

Documentation is available at PHP_Debug_Sources.php

  1. <?php
  2.  
  3. /**
  4.  * Display package source
  5.  * 
  6.  * @package PHP_Debug
  7.  * @filesource
  8.  */ 
  9.  
  10. echo '<?xml version="1.0" encoding="UTF-8"?>';
  11. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  12. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">     
  13.   <head>  
  14.     <title>PEAR::PHP_Debug, sources</title>
  15.   </head>
  16.   <body>
  17.   <h1>PHP_Debug, package sources</h1>
  18. <?php
  19. // Display source code =========================================================
  20.  
  21. // file
  22. function showSource($dir$file)
  23. {
  24.     $path $dir$file;
  25.     echo '<div>';
  26.     echo '<h1>'$path'</h1>';
  27.     highlight_file($path);
  28.     echo '</div>'"\n";
  29. }
  30.  
  31. // Dir
  32. function parseDir($dir$parent)
  33. {
  34.     $path $parent($dir['name'!= '/' $dir['name']'/' '');
  35.     foreach($dir->file as $file{
  36.         if (in_array($file['role']array('test''php'))) {
  37.             showSource($path$file['name']);
  38.         }
  39.     }    
  40.     foreach($dir->dir as $child{
  41.         parseDir($child$path);
  42.     }
  43.     return;
  44. }
  45.  
  46. $package simplexml_load_file('package.xml');
  47. $dir '';
  48. parseDir($package->contents->dir$dir);
  49. ?>
  50.   </body>
  51. </html>

Documentation generated on Mon, 11 Mar 2019 15:01:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.