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('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''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.     array(
  19.         'rootTag' => 'music_library',
  20.         'rowTag' => 'artist',
  21.         'idColumn' => 'artistid',
  22.         'elements' => array(
  23.             '*',
  24.             'albums' => array(
  25.                 'sql' => array(
  26.                     'data' => array(
  27.                         'artistid'
  28.                     ),
  29.                     'query' => 'SELECT * FROM album WHERE artist_id = ?'
  30.                 ),
  31.                 'sql_options' => array(
  32.                     'uncached'      => true,
  33.                     'single_record' => false,
  34.                     'merge'         => false,
  35.                     'merge_master'  => false
  36.                 ),
  37.                 'rootTag' => 'albums',
  38.                 'rowTag' => 'album',
  39.                 'idColumn' => 'albumid',
  40.                 'elements' => array(
  41.                     '*',
  42.                     'artist_id' => '?:'
  43.                 )
  44.             )
  45.         )
  46.     )
  47. );
  48.  
  49. header('Content-Type: application/xml');
  50. echo '<?xml version="1.0" encoding="UTF-8"?>' "\n";
  51.  
  52. require_once('XML/Beautifier.php');
  53. $beautifier = new XML_Beautifier();
  54. print $beautifier->formatString($dom->saveXML());
  55.  
  56. require_once('File.php');
  57. $fp = new File();
  58. $fp->write('case07.profile'$query2xml->getProfile()FILE_MODE_WRITE);
  59. ?>

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