XML_Unserializer::XML_Unserializer PHP Method

XML_Unserializer() public method

constructor
public XML_Unserializer ( mixed $options = null )
$options mixed array containing options for the unserialization
    function XML_Unserializer($options = null)
    {
        if (is_array($options)) {
            $this->options = array_merge($this->_defaultOptions, $options);
        } else {
            $this->options = $this->_defaultOptions;
        }
    }

Usage Example

Esempio n. 1
0
 function __construct($variables, $fail_on_invalid_names = true, $structure = false, $valid_types = array(), $force_defaults = true)
 {
     // force ISO-8859-1 due to different defaults for PHP4 and PHP5
     // todo: this probably needs to be investigated some more and cleaned up
     $this->options['encoding'] = 'ISO-8859-1';
     $this->options['XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE'] = true;
     $this->options['XML_UNSERIALIZER_OPTION_ATTRIBUTES_ARRAYKEY'] = false;
     $this->options['forceEnum'] = array('table', 'field', 'index', 'insert', 'update', 'delete');
     /*
      * todo: find a way to force the following items not to be parsed as arrays
      * as it cause problems in functions with multiple arguments
      */
     //$this->options['forceNEnum'] = array('value', 'column');
     $this->variables = $variables;
     $this->structure = $structure;
     $this->validator =& new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
     parent::XML_Unserializer($this->options);
 }