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

Source for file case07_debug.php

Documentation is available at case07_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''case07.log''Query2XML');
  8. $query2xml->enableDebugLog($debugLogger);
  9.  
  10. $query2xml->startProfiling();
  11.  
  12.  
  13. $dom $query2xml->getXML(
  14.     "SELECT
  15.         *
  16.      FROM
  17.         artist
  18.      ORDER BY
  19.         artistid",
  20.     array(
  21.         'rootTag' => 'music_library',
  22.         'rowTag' => 'artist',
  23.         'idColumn' => 'artistid',
  24.         'elements' => array(
  25.             '*',
  26.             'albums' => array(
  27.                 'sql' => array(
  28.                     'data' => array(
  29.                         'artistid'
  30.                     ),
  31.                     'query' => 'SELECT * FROM album WHERE artist_id = ?'
  32.                 ),
  33.                 'rootTag' => 'albums',
  34.                 'rowTag' => 'album',
  35.                 'idColumn' => 'albumid',
  36.                 'elements' => array(
  37.                     '*',
  38.                     'artist_id' => '?:'
  39.                 )
  40.             )
  41.         )
  42.     )
  43. );
  44.  
  45. header('Content-Type: application/xml');
  46.  
  47. $dom->formatOutput = true;
  48. print $dom->saveXML();
  49.  
  50. require_once 'File.php';
  51. $fp = new File();
  52. $fp->write('case07.profile'$query2xml->getProfile()FILE_MODE_WRITE);
  53. ?>

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