XPressME Integration Kit

Trac

Changeset 39


Ignore:
Timestamp:
Dec 22, 2008, 9:57:45 PM (15 years ago)
Author:
toemon
Message:

D3Pipeにて同じライブラリを使っているため、D3pipeモジュールをインストールしてあると、重複となるバグを修正 #47

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/xml.php

    r35 r39  
    1414# and returns an equivalent PHP data structure 
    1515################################################################################### 
     16if( ! function_exists( 'XML_unserialize' ) ) : // d3pipe Used function 
    1617function & XML_unserialize(&$xml){ 
    1718        $xml_parser = &new XML(); 
     
    2021        return $data; 
    2122} 
     23endif; 
    2224################################################################################### 
    2325# XML_serialize: serializes any PHP data structure into XML 
    2426# Takes one parameter: the data to serialize. Must be an array. 
    2527################################################################################### 
     28if( ! function_exists( 'XML_serialize' ) ) : // d3pipe Used function 
    2629function & XML_serialize(&$data, $level = 0, $prior_key = NULL){ 
    2730        if($level == 0){ ob_start(); echo '<?xml version="1.0" ?>',"\n"; } 
     
    4952        if($level == 0){ $str = &ob_get_contents(); ob_end_clean(); return $str; } 
    5053} 
     54endif; 
    5155################################################################################### 
    5256# XML class: utility class to be used with PHP's XML handling functions 
     
    6064 
    6165        function XML(){ 
    62                 $this->parser = &xml_parser_create(); 
     66                // $this->parser = &xml_parser_create(); 
     67                $this->parser = xml_parser_create(); // GIJ 
     68                /* 
    6369                xml_parser_set_option(&$this->parser, XML_OPTION_CASE_FOLDING, false); 
    6470                xml_set_object(&$this->parser, &$this); 
    6571                xml_set_element_handler(&$this->parser, 'open','close'); 
    6672                xml_set_character_data_handler(&$this->parser, 'data'); 
     73                */ 
     74                xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false); 
     75                xml_set_object($this->parser, $this); 
     76                xml_set_element_handler($this->parser, 'open','close'); 
     77                xml_set_character_data_handler($this->parser, 'data'); 
    6778        } 
    68         function destruct(){ xml_parser_free(&$this->parser); } 
     79        function destruct(){ 
     80                // xml_parser_free(&$this->parser); // GIJ 
     81                xml_parser_free($this->parser); 
     82        } 
    6983        function & parse(&$data){ 
    7084                $this->document = array(); 
    7185                $this->stack    = array(); 
    7286                $this->parent   = &$this->document; 
    73                 return xml_parse(&$this->parser, &$data, true) ? $this->document : NULL; 
     87                // return xml_parse(&$this->parser, &$data, true) ? $this->document : NULL; // GIJ 
     88                $ret = @xml_parse($this->parser, $data, true) ? $this->document : NULL; 
     89                return $ret ; 
    7490        } 
    7591        function open(&$parser, $tag, $attributes){ 
Note: See TracChangeset for help on using the changeset viewer.