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

Source for file Writer.php

Documentation is available at Writer.php

  1. <?php
  2. // +----------------------------------------------------------------------+
  3. // | PHP versions 4 and 5                                                 |
  4. // +----------------------------------------------------------------------+
  5. // | Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,                 |
  6. // | Stig. S. Bakken, Lukas Smith, Igor Feghali                           |
  7. // | All rights reserved.                                                 |
  8. // +----------------------------------------------------------------------+
  9. // | MDB2_Schema enables users to maintain RDBMS independant schema files |
  10. // | in XML that can be used to manipulate both data and database schemas |
  11. // | This LICENSE is in the BSD license style.                            |
  12. // |                                                                      |
  13. // | Redistribution and use in source and binary forms, with or without   |
  14. // | modification, are permitted provided that the following conditions   |
  15. // | are met:                                                             |
  16. // |                                                                      |
  17. // | Redistributions of source code must retain the above copyright       |
  18. // | notice, this list of conditions and the following disclaimer.        |
  19. // |                                                                      |
  20. // | Redistributions in binary form must reproduce the above copyright    |
  21. // | notice, this list of conditions and the following disclaimer in the  |
  22. // | documentation and/or other materials provided with the distribution. |
  23. // |                                                                      |
  24. // | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,    |
  25. // | Lukas Smith, Igor Feghali nor the names of his contributors may be   |
  26. // | used to endorse or promote products derived from this software       |
  27. // | without specific prior written permission.                           |
  28. // |                                                                      |
  29. // | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS  |
  30. // | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT    |
  31. // | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS    |
  32. // | FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE      |
  33. // | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,          |
  34. // | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
  35. // | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS|
  36. // |  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED  |
  37. // | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT          |
  38. // | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY|
  39. // | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE          |
  40. // | POSSIBILITY OF SUCH DAMAGE.                                          |
  41. // +----------------------------------------------------------------------+
  42. // | Author: Lukas Smith <smith@pooteeweet.org>                           |
  43. // | Author: Igor Feghali <ifeghali@php.net>                              |
  44. // +----------------------------------------------------------------------+
  45. //
  46. // $Id: Writer.php,v 1.39 2008/02/06 23:13:51 ifeghali Exp $
  47. //
  48.  
  49. /**
  50.  * Writes an XML schema file
  51.  *
  52.  * @package MDB2_Schema
  53.  * @category Database
  54.  * @access protected
  55.  * @author  Lukas Smith <smith@pooteeweet.org>
  56.  */
  57. {
  58.     // {{{ properties
  59.  
  60.     var $valid_types = array();
  61.  
  62.     // }}}
  63.     // {{{ constructor
  64.  
  65.     function __construct($valid_types = array())
  66.     {
  67.         $this->valid_types = $valid_types;
  68.     }
  69.  
  70.     function MDB2_Schema_Writer($valid_types = array())
  71.     {
  72.         $this->__construct($valid_types);
  73.     }
  74.  
  75.     // }}}
  76.     // {{{ raiseError()
  77.  
  78.     /**
  79.      * This method is used to communicate an error and invoke error
  80.      * callbacks etc.  Basically a wrapper for PEAR::raiseError
  81.      * without the message string.
  82.      *
  83.      * @param int|PEAR_Error integer error code or and PEAR_Error instance
  84.      * @param int      error mode, see PEAR_Error docs
  85.      *
  86.      *                  error level (E_USER_NOTICE etc).  If error mode is
  87.      *                  PEAR_ERROR_CALLBACK, this is the callback function,
  88.      *                  either as a function name, or as an array of an
  89.      *                  object and method name.  For other error modes this
  90.      *                  parameter is ignored.
  91.      * @param string   Extra debug information.  Defaults to the last
  92.      *                  query and native error code.
  93.      * @return object  PEAR error object
  94.      * @access  public
  95.      * @see PEAR_Error
  96.      */
  97.     function &raiseError($code = null$mode = null$options = null$userinfo = null)
  98.     {
  99.         $error =MDB2_Schema::raiseError($code$mode$options$userinfo);
  100.         return $error;
  101.     }
  102.  
  103.     // }}}
  104.     // {{{ _escapeSpecialChars()
  105.  
  106.     /**
  107.      * add escapecharacters to all special characters in a string
  108.      *
  109.      * @param string string that should be escaped
  110.      * @return string escaped string
  111.      * @access protected
  112.      */
  113.     function _escapeSpecialChars($string)
  114.     {
  115.         if (!is_string($string)) {
  116.             $string strval($string);
  117.         }
  118.  
  119.         $escaped '';
  120.         for ($char = 0$count strlen($string)$char $count$char++{
  121.             switch ($string[$char]{
  122.             case '&':
  123.                 $escaped.= '&amp;';
  124.                 break;
  125.             case '>':
  126.                 $escaped.= '&gt;';
  127.                 break;
  128.             case '<':
  129.                 $escaped.= '&lt;';
  130.                 break;
  131.             case '"':
  132.                 $escaped.= '&quot;';
  133.                 break;
  134.             case '\'':
  135.                 $escaped.= '&apos;';
  136.                 break;
  137.             default:
  138.                 $code ord($string[$char]);
  139.                 if ($code < 32 || $code > 127{
  140.                     $escaped.= "&#$code;";
  141.                 else {
  142.                     $escaped.= $string[$char];
  143.                 }
  144.                 break;
  145.             }
  146.         }
  147.         return $escaped;
  148.     }
  149.  
  150.     // }}}
  151.     // {{{ _dumpBoolean()
  152.  
  153.     /**
  154.      * dump the structure of a sequence
  155.      *
  156.      * @param string boolean value or variable definition
  157.      * @return string with xml boolea definition
  158.      * @access private
  159.      */
  160.     function _dumpBoolean($boolean)
  161.     {
  162.         if (is_string($boolean)) {
  163.             if ($boolean !== 'true' || $boolean !== 'false'
  164.                 || preg_match('/<variable>.*</variable>/'$boolean)
  165.             {
  166.                 return $boolean;
  167.             }
  168.         }
  169.         return $boolean 'true' 'false';
  170.     }
  171.  
  172.     // }}}
  173.     // {{{ dumpSequence()
  174.  
  175.     /**
  176.      * dump the structure of a sequence
  177.      *
  178.      * @param string sequence name
  179.      * @param string end of line characters
  180.      * @return mixed string xml sequence definition on success, or a error object
  181.      * @access public
  182.      */
  183.     function dumpSequence($sequence_definition$sequence_name$eol$dump = MDB2_SCHEMA_DUMP_ALL)
  184.     {
  185.         $buffer = "$eol <sequence>$eol  <name>$sequence_name</name>$eol";
  186.         if ($dump == MDB2_SCHEMA_DUMP_ALL || $dump == MDB2_SCHEMA_DUMP_CONTENT{
  187.             if (!empty($sequence_definition['start'])) {
  188.                 $start $sequence_definition['start'];
  189.                 $buffer.= "  <start>$start</start>$eol";
  190.             }
  191.         }
  192.  
  193.         if (!empty($sequence_definition['on'])) {
  194.             $buffer.= "  <on>$eol";
  195.             $buffer.= "   <table>".$sequence_definition['on']['table'];
  196.             $buffer.= "</table>$eol   <field>".$sequence_definition['on']['field'];
  197.             $buffer.= "</field>$eol  </on>$eol";
  198.         }
  199.         $buffer.= " </sequence>$eol";
  200.  
  201.         return $buffer;
  202.     }
  203.  
  204.     // }}}
  205.     // {{{ dumpDatabase()
  206.  
  207.     /**
  208.      * Dump a previously parsed database structure in the Metabase schema
  209.      * XML based format suitable for the Metabase parser. This function
  210.      * may optionally dump the database definition with initialization
  211.      * commands that specify the data that is currently present in the tables.
  212.      *
  213.      * @param array associative array that takes pairs of tag
  214.      *               names and values that define dump options.
  215.      *                  array (
  216.      *                      'output_mode'    =>    String
  217.      *                          'file' :   dump into a file
  218.      *                          default:   dump using a function
  219.      *                      'output'        =>    String
  220.      *                          depending on the 'Output_Mode'
  221.      *                                   name of the file
  222.      *                                   name of the function
  223.      *                      'end_of_line'        =>    String
  224.      *                          end of line delimiter that should be used
  225.      *                          default: "\n"
  226.      *                  );
  227.      * @param integer determines what data to dump
  228.      *                       MDB2_SCHEMA_DUMP_ALL       : the entire db
  229.      *                       MDB2_SCHEMA_DUMP_STRUCTURE : only the structure of the db
  230.      *                       MDB2_SCHEMA_DUMP_CONTENT   : only the content of the db
  231.      * @return mixed MDB2_OK on success, or a error object
  232.      * @access public
  233.      */
  234.     function dumpDatabase($database_definition$arguments$dump = MDB2_SCHEMA_DUMP_ALL)
  235.     {
  236.         if (!empty($arguments['output'])) {
  237.             if (!empty($arguments['output_mode']&& $arguments['output_mode'== 'file'{
  238.                 $fp fopen($arguments['output']'w');
  239.                 if ($fp === false{
  240.                     return $this->raiseError(MDB2_SCHEMA_ERROR_WRITERnullnull,
  241.                         'it was not possible to open output file');
  242.                 }
  243.  
  244.                 $output = false;
  245.             elseif (is_callable($arguments['output'])) {
  246.                 $output $arguments['output'];
  247.             else {
  248.                 return $this->raiseError(MDB2_SCHEMA_ERROR_WRITERnullnull,
  249.                     'no valid output function specified');
  250.             }
  251.         else {
  252.             return $this->raiseError(MDB2_SCHEMA_ERROR_WRITERnullnull,
  253.                 'no output method specified');
  254.         }
  255.  
  256.         $eol = isset($arguments['end_of_line']$arguments['end_of_line'"\n";
  257.  
  258.         $sequences = array();
  259.         if (!empty($database_definition['sequences'])
  260.             && is_array($database_definition['sequences'])
  261.         {
  262.             foreach ($database_definition['sequences'as $sequence_name => $sequence{
  263.                 $table !empty($sequence['on']$sequence['on']['table':'';
  264.                 $sequences[$table][$sequence_name;
  265.             }
  266.         }
  267.  
  268.         $buffer '<?xml version="1.0" encoding="ISO-8859-1" ?>'.$eol;
  269.         $buffer.= "<database>$eol$eol <name>".$database_definition['name']."</name>";
  270.         $buffer.= "$eol <create>".$this->_dumpBoolean($database_definition['create'])."</create>";
  271.         $buffer.= "$eol <overwrite>".$this->_dumpBoolean($database_definition['overwrite'])."</overwrite>$eol";
  272.         $buffer.= "$eol <charset>".$database_definition['charset']."</charset>$eol";
  273.  
  274.         if ($output{
  275.             call_user_func($output$buffer);
  276.         else {
  277.             fwrite($fp$buffer);
  278.         }
  279.  
  280.         if (!empty($database_definition['tables']&& is_array($database_definition['tables'])) {
  281.             foreach ($database_definition['tables'as $table_name => $table{
  282.                 $buffer = "$eol <table>$eol$eol  <name>$table_name</name>$eol";
  283.                 if ($dump == MDB2_SCHEMA_DUMP_ALL || $dump == MDB2_SCHEMA_DUMP_STRUCTURE{
  284.                     $buffer.= "$eol  <declaration>$eol";
  285.                     if (!empty($table['fields']&& is_array($table['fields'])) {
  286.                         foreach ($table['fields'as $field_name => $field{
  287.                             if (empty($field['type'])) {
  288.                                 return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATEnullnull,
  289.                                     'it was not specified the type of the field "'.
  290.                                     $field_name.'" of the table "'.$table_name.'"');
  291.                             }
  292.                             if (!empty($this->valid_types&& !array_key_exists($field['type']$this->valid_types)) {
  293.                                 return $this->raiseError(MDB2_SCHEMA_ERROR_UNSUPPORTEDnullnull,
  294.                                     'type "'.$field['type'].'" is not yet supported');
  295.                             }
  296.                             $buffer.= "$eol   <field>$eol    <name>$field_name</name>$eol    <type>";
  297.                             $buffer.= $field['type']."</type>$eol";
  298.                             if (!empty($field['fixed']&& $field['type'=== 'text'{
  299.                                 $buffer.= "    <fixed>".$this->_dumpBoolean($field['fixed'])."</fixed>$eol";
  300.                             }
  301.                             if (array_key_exists('default'$field)
  302.                                 && $field['type'!== 'clob' && $field['type'!== 'blob'
  303.                             {
  304.                                 $buffer.= '    <default>'.$this->_escapeSpecialChars($field['default'])."</default>$eol";
  305.                             }
  306.                             if (!empty($field['notnull'])) {
  307.                                 $buffer.= "    <notnull>".$this->_dumpBoolean($field['notnull'])."</notnull>$eol";
  308.                             else {
  309.                                 $buffer.= "    <notnull>false</notnull>$eol";
  310.                             }
  311.                             if (!empty($field['autoincrement'])) {
  312.                                 $buffer.= "    <autoincrement>" $field['autoincrement'."</autoincrement>$eol";
  313.                             }
  314.                             if (!empty($field['unsigned'])) {
  315.                                 $buffer.= "    <unsigned>".$this->_dumpBoolean($field['unsigned'])."</unsigned>$eol";
  316.                             }
  317.                             if (!empty($field['length'])) {
  318.                                 $buffer.= '    <length>'.$field['length']."</length>$eol";
  319.                             }
  320.                             $buffer.= "   </field>$eol";
  321.                         }
  322.                     }
  323.  
  324.                     if (!empty($table['indexes']&& is_array($table['indexes'])) {
  325.                         foreach ($table['indexes'as $index_name => $index{
  326.                             if (strtolower($index_name=== 'primary'{
  327.                                 $index_name $table_name '_pKey';
  328.                             }
  329.                             $buffer.= "$eol   <index>$eol    <name>$index_name</name>$eol";
  330.                             if (!empty($index['unique'])) {
  331.                                 $buffer.= "    <unique>".$this->_dumpBoolean($index['unique'])."</unique>$eol";
  332.                             }
  333.  
  334.                             if (!empty($index['primary'])) {
  335.                                 $buffer.= "    <primary>".$this->_dumpBoolean($index['primary'])."</primary>$eol";
  336.                             }
  337.  
  338.                             foreach ($index['fields'as $field_name => $field{
  339.                                 $buffer.= "    <field>$eol     <name>$field_name</name>$eol";
  340.                                 if (!empty($field&& is_array($field)) {
  341.                                     $buffer.= '     <sorting>'.$field['sorting']."</sorting>$eol";
  342.                                 }
  343.                                 $buffer.= "    </field>$eol";
  344.                             }
  345.                             $buffer.= "   </index>$eol";
  346.                         }
  347.                     }
  348.  
  349.                     if (!empty($table['constraints']&& is_array($table['constraints'])) {
  350.                         foreach ($table['constraints'as $constraint_name => $constraint{
  351.                             $buffer.= "$eol   <foreign>$eol    <name>$constraint_name</name>$eol";
  352.                             if (empty($constraint['fields']|| !is_array($constraint['fields'])) {
  353.                                 return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATEnullnull,
  354.                                     'it was not specified a field for the foreign key "'.
  355.                                     $constraint_name.'" of the table "'.$table_name.'"');
  356.                             }
  357.                             if (!is_array($constraint['references']|| empty($constraint['references']['table'])) {
  358.                                 return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATEnullnull,
  359.                                     'it was not specified the referenced table of the foreign key "'.
  360.                                     $constraint_name.'" of the table "'.$table_name.'"');
  361.                             }
  362.                             if (!empty($constraint['match'])) {
  363.                                 $buffer.= "    <match>".$constraint['match']."</match>$eol";
  364.                             }
  365.                             if (!empty($constraint['ondelete'])) {
  366.                                 $buffer.= "    <ondelete>".$constraint['ondelete']."</ondelete>$eol";
  367.                             }
  368.                             if (!empty($constraint['onupdate'])) {
  369.                                 $buffer.= "    <onupdate>".$constraint['onupdate']."</onupdate>$eol";
  370.                             }
  371.                             if (!empty($constraint['deferrable'])) {
  372.                                 $buffer.= "    <deferrable>".$constraint['deferrable']."</deferrable>$eol";
  373.                             }
  374.                             if (!empty($constraint['initiallydeferred'])) {
  375.                                 $buffer.= "    <initiallydeferred>".$constraint['initiallydeferred']."</initiallydeferred>$eol";
  376.                             }
  377.                             foreach ($constraint['fields'as $field_name => $field{
  378.                                 $buffer.= "    <field>$field_name</field>$eol";
  379.                             }
  380.                             $buffer.= "    <references>$eol     <table>".$constraint['references']['table']."</table>$eol";
  381.                             foreach ($constraint['references']['fields'as $field_name => $field{
  382.                                 $buffer.= "     <field>$field_name</field>$eol";
  383.                             }
  384.                             $buffer.= "    </references>$eol";
  385.  
  386.                             $buffer.= "   </foreign>$eol";
  387.                         }
  388.                     }
  389.  
  390.                     $buffer.= "$eol  </declaration>$eol";
  391.                 }
  392.  
  393.                 if ($output{
  394.                     call_user_func($output$buffer);
  395.                 else {
  396.                     fwrite($fp$buffer);
  397.                 }
  398.  
  399.                 $buffer '';
  400.                 if ($dump == MDB2_SCHEMA_DUMP_ALL || $dump == MDB2_SCHEMA_DUMP_CONTENT{
  401.                     if (!empty($table['initialization']&& is_array($table['initialization'])) {
  402.                         $buffer = "$eol  <initialization>$eol";
  403.                         foreach ($table['initialization'as $instruction{
  404.                             switch ($instruction['type']{
  405.                             case 'insert':
  406.                                 $buffer.= "$eol   <insert>$eol";
  407.                                 foreach ($instruction['data']['field'as $field{
  408.                                     $field_name $field['name'];
  409.                                     $buffer.= "$eol    <field>$eol     <name>$field_name</name>$eol";
  410.                                     $buffer.= $this->writeExpression($field['group']5$arguments);
  411.                                     $buffer.= "    </field>$eol";
  412.                                 }
  413.                                 $buffer.= "$eol   </insert>$eol";
  414.                                 break;
  415.                             case 'update':
  416.                                 $buffer.= "$eol   <update>$eol";
  417.                                 foreach ($instruction['data']['field'as $field{
  418.                                     $field_name $field['name'];
  419.                                     $buffer.= "$eol    <field>$eol     <name>$field_name</name>$eol";
  420.                                     $buffer.= $this->writeExpression($field['group']5$arguments);
  421.                                     $buffer.= "    </field>$eol";
  422.                                 }
  423.  
  424.                                 if (!empty($instruction['data']['where'])
  425.                                     && is_array($instruction['data']['where'])
  426.                                 {
  427.                                     $buffer.= "    <where>$eol";
  428.                                     $buffer.= $this->writeExpression($instruction['data']['where']5$arguments);
  429.                                     $buffer.= "    </where>$eol";
  430.                                 }
  431.  
  432.                                 $buffer.= "$eol   </update>$eol";
  433.                                 break;
  434.                             case 'delete':
  435.                                 $buffer.= "$eol   <delete>$eol$eol";
  436.                                 if (!empty($instruction['data']['where'])
  437.                                     && is_array($instruction['data']['where'])
  438.                                 {
  439.                                     $buffer.= "    <where>$eol";
  440.                                     $buffer.= $this->writeExpression($instruction['data']['where']5$arguments);
  441.                                     $buffer.= "    </where>$eol";
  442.                                 }
  443.                                 $buffer.= "$eol   </delete>$eol";
  444.                                 break;
  445.                             }
  446.                         }
  447.                         $buffer.= "$eol  </initialization>$eol";
  448.                     }
  449.                 }
  450.                 $buffer.= "$eol </table>$eol";
  451.                 if ($output{
  452.                     call_user_func($output$buffer);
  453.                 else {
  454.                     fwrite($fp$buffer);
  455.                 }
  456.  
  457.                 if (isset($sequences[$table_name])) {
  458.                     foreach ($sequences[$table_nameas $sequence{
  459.                         $result $this->dumpSequence(
  460.                             $database_definition['sequences'][$sequence],
  461.                             $sequence$eol$dump
  462.                         );
  463.                         if (PEAR::isError($result)) {
  464.                             return $result;
  465.                         }
  466.  
  467.                         if ($output{
  468.                             call_user_func($output$result);
  469.                         else {
  470.                             fwrite($fp$result);
  471.                         }
  472.                     }
  473.                 }
  474.             }
  475.         }
  476.  
  477.         if (isset($sequences[''])) {
  478.             foreach ($sequences[''as $sequence{
  479.                 $result $this->dumpSequence(
  480.                     $database_definition['sequences'][$sequence],
  481.                     $sequence$eol$dump
  482.                 );
  483.                 if (PEAR::isError($result)) {
  484.                     return $result;
  485.                 }
  486.  
  487.                 if ($output{
  488.                     call_user_func($output$result);
  489.                 else {
  490.                     fwrite($fp$result);
  491.                 }
  492.             }
  493.         }
  494.  
  495.         $buffer = "$eol</database>$eol";
  496.         if ($output{
  497.             call_user_func($output$buffer);
  498.         else {
  499.             fwrite($fp$buffer);
  500.             fclose($fp);
  501.         }
  502.  
  503.         return MDB2_OK;
  504.     }
  505.  
  506.     // }}}
  507.     // {{{ writeExpression()
  508.  
  509.     /**
  510.      * Dumps the structure of an element. Elements can be value, column,
  511.      * function or expression.
  512.      *
  513.      * @param array  multi dimensional array that represents the parsed element
  514.      *                 of a DML instruction.
  515.      * @param integer  base indentation width
  516.      * @param array  associative array that takes pairs of tag
  517.      *                 names and values that define dump options.
  518.      *
  519.      * @return string 
  520.      *
  521.      * @access public
  522.      * @see MDB2_Schema_Writer::dumpDatabase()
  523.      */
  524.     function writeExpression($element$offset = 0$arguments = null)
  525.     {
  526.         $eol = isset($arguments['end_of_line']$arguments['end_of_line'"\n";
  527.         $str '';
  528.         $indent str_repeat(' '$offset);
  529.         $noffset $offset + 1;
  530.  
  531.         switch ($element['type']{
  532.             case 'value':
  533.                 $str.= "$indent<value>".$this->_escapeSpecialChars($element['data'])."</value>$eol";
  534.             break;
  535.             case 'column':
  536.                 $str.= "$indent<column>".$this->_escapeSpecialChars($element['data'])."</column>$eol";
  537.             break;
  538.             case 'function':
  539.                 $str.= "$indent<function>$eol$indent <name>".$this->_escapeSpecialChars($element['data']['name'])."</name>$eol";
  540.  
  541.                 if (!empty($element['data']['arguments'])
  542.                     && is_array($element['data']['arguments'])
  543.                 {
  544.                     foreach ($element['data']['arguments'as $v{
  545.                         $str.= $this->writeExpression($v$noffset$arguments);
  546.                     }
  547.                 }
  548.  
  549.                 $str.= "$indent</function>$eol";
  550.             break;
  551.             case 'expression':
  552.                 $str.= "$indent<expression>$eol";
  553.                 $str.= $this->writeExpression($element['data']['operants'][0]$noffset$arguments);
  554.                 $str.= "$indent <operator>".$element['data']['operator']."</operator>$eol";
  555.                 $str.= $this->writeExpression($element['data']['operants'][1]$noffset$arguments);
  556.                 $str.= "$indent</expression>$eol";
  557.             break;
  558.         }
  559.         return $str;
  560.     }
  561.  
  562.     // }}}
  563. }
  564. ?>

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