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

Source for file case02_debug.php

Documentation is available at case02_debug.php

  1. <?php
  2. require_once('XML/Query2XML.php');
  3. require_once('DB.php');
  4. $query2xml XML_Query2XML::factory(DB::connect('mysql://root@localhost/Query2XML_Tests'));
  5.  
  6. require_once('Log.php');
  7. $debugLogger &Log::factory('file''case02.log''Query2XML');
  8. $query2xml->enableDebugLog($debugLogger);
  9.  
  10. $query2xml->startProfiling();
  11.  
  12.  
  13. $dom $query2xml->getXML(
  14.     "SELECT
  15.         *
  16.      FROM
  17.         artist
  18.         LEFT JOIN album ON album.artist_id = artist.artistid",
  19.     array(
  20.         'rootTag' => 'music_library',
  21.         'rowTag' => 'artist',
  22.         'idColumn' => 'artistid',
  23.         'elements' => array(
  24.             'artistid',
  25.             'name',
  26.             'birth_year',
  27.             'birth_place',
  28.             'genre',
  29.             'albums' => array(
  30.                 'rootTag' => 'albums',
  31.                 'rowTag' => 'album',
  32.                 'idColumn' => 'albumid',
  33.                 'elements' => array(
  34.                     'albumid',
  35.                     'title',
  36.                     'published_year',
  37.                     'comment'
  38.                 )
  39.             )
  40.         )
  41.     )
  42. );
  43.  
  44. header('Content-Type: application/xml');
  45. echo '<?xml version="1.0" encoding="UTF-8"?>' "\n";
  46.  
  47. require_once('XML/Beautifier.php');
  48. $beautifier = new XML_Beautifier();
  49. print $beautifier->formatString($dom->saveXML());
  50.  
  51. require_once('File.php');
  52. $fp = new File();
  53. $fp->write('case02.profile'$query2xml->getProfile()FILE_MODE_WRITE);
  54. ?>

Documentation generated on Mon, 11 Mar 2019 14:45:59 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.