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 'MDB2.php';
  4. $query2xml XML_Query2XML::factory(MDB2::factory('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.      ORDER BY
  20.         artist.artistid,
  21.         album.albumid",
  22.     array(
  23.         'rootTag' => 'music_library',
  24.         'rowTag' => 'artist',
  25.         'idColumn' => 'artistid',
  26.         'elements' => array(
  27.             'artistid',
  28.             'name',
  29.             'birth_year',
  30.             'birth_place',
  31.             'genre',
  32.             'albums' => array(
  33.                 'rootTag' => 'albums',
  34.                 'rowTag' => 'album',
  35.                 'idColumn' => 'albumid',
  36.                 'elements' => array(
  37.                     'albumid',
  38.                     'title',
  39.                     'published_year',
  40.                     'comment'
  41.                 )
  42.             )
  43.         )
  44.     )
  45. );
  46.  
  47. header('Content-Type: application/xml');
  48.  
  49. $dom->formatOutput = true;
  50. print $dom->saveXML();
  51.  
  52. require_once 'File.php';
  53. $fp = new File();
  54. $fp->write('case02.profile'$query2xml->getProfile()FILE_MODE_WRITE);
  55. ?>

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