Ignore:
Timestamp:
2011/10/25 00:02:55 (13 years ago)
Author:
Seasoft
Message:

#1521 (PEAR::SOAP 配布と異なる部分がある)

  • 新しいバージョンの配布ファイルを上書きすることで解決

#1522 (PEAR::SOAP をバージョンアップ)

  • 0.11.0 -> 0.12.0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/module/SOAP/Value.php

    r20119 r21299  
    4141{ 
    4242    /** 
    43      * @var string 
     43     * The actual value. 
     44     * 
     45     * @var mixed 
    4446     */ 
    4547    var $value = null; 
    4648 
    4749    /** 
     50     * QName instance representing the value name. 
     51     * 
     52     * @var QName 
     53     */ 
     54    var $nqn; 
     55 
     56    /** 
     57     * The value name, without namespace information. 
     58     * 
    4859     * @var string 
    4960     */ 
     
    5162 
    5263    /** 
     64     * The namespace of the value name. 
     65     * 
     66     * @var string 
     67     */ 
     68    var $namespace = ''; 
     69 
     70    /** 
     71     * QName instance representing the value type. 
     72     * 
     73     * @var QName 
     74     */ 
     75    var $tqn; 
     76 
     77    /** 
     78     * The value type, without namespace information. 
     79     * 
    5380     * @var string 
    5481     */ 
     
    5683 
    5784    /** 
    58      * Namespace 
    59      * 
    60      * @var string 
    61      */ 
    62     var $namespace = ''; 
     85     * The namespace of the value type. 
     86     * 
     87     * @var string 
     88     */ 
    6389    var $type_namespace = ''; 
    6490 
     91    /** 
     92     * The type of the array elements, if this value is an array. 
     93     * 
     94     * @var string 
     95     */ 
     96    var $arrayType = ''; 
     97 
     98    /** 
     99     * A hash of additional attributes. 
     100     * 
     101     * @see SOAP_Value() 
     102     * @var array 
     103     */ 
    65104    var $attributes = array(); 
    66105 
    67106    /** 
    68      * @var string 
    69      */ 
    70     var $arrayType = ''; 
    71  
     107     * List of encoding and serialization options. 
     108     * 
     109     * @see SOAP_Value() 
     110     * @var array 
     111     */ 
    72112    var $options = array(); 
    73  
    74     var $nqn; 
    75     var $tqn; 
    76113 
    77114    /** 
     
    82119     *                           automatically if not set. 
    83120     * @param mixed $value       Value to set. 
    84      * @param array $attributes  Attributes. 
     121     * @param array $attributes  A has of additional XML attributes to be 
     122     *                           added to the serialized value. 
     123     * @param array $options     A list of encoding and serialization options: 
     124     *                           - 'attachment': array with information about 
     125     *                             the attachment 
     126     *                           - 'soap_encoding': defines encoding for SOAP 
     127     *                             message part of a MIME encoded SOAP request 
     128     *                             (default: base64) 
     129     *                           - 'keep_arrays_flat': use the tag name 
     130     *                             multiple times for each element when 
     131     *                             passing in an array in literal mode 
     132     *                           - 'no_type_prefix': supress adding of the 
     133     *                             namespace prefix 
    85134     */ 
    86135    function SOAP_Value($name = '', $type = false, $value = null, 
    87                         $attributes = array()) 
    88     { 
    89         // Detect type if not passed. 
     136                        $attributes = array(), $options = array()) 
     137    { 
    90138        $this->nqn = new QName($name); 
    91139        $this->name = $this->nqn->name; 
    92140        $this->namespace = $this->nqn->namespace; 
    93         $this->tqn = new QName($type); 
    94         $this->type = $this->tqn->name; 
    95         $this->type_prefix = $this->tqn->ns; 
    96         $this->type_namespace = $this->tqn->namespace; 
     141        if ($type) { 
     142            $this->tqn = new QName($type); 
     143            $this->type = $this->tqn->name; 
     144            $this->type_namespace = $this->tqn->namespace; 
     145        } 
    97146        $this->value = $value; 
    98147        $this->attributes = $attributes; 
     148        $this->options = $options; 
    99149    } 
    100150 
     
    110160    { 
    111161        return $serializer->_serializeValue($this->value, 
    112                                             $this->name, 
    113                                             $this->type, 
    114                                             $this->namespace, 
    115                                             $this->type_namespace, 
     162                                            $this->nqn, 
     163                                            $this->tqn, 
    116164                                            $this->options, 
    117165                                            $this->attributes, 
     
    157205 
    158206        if (isset($actor)) { 
    159             $this->attributes['SOAP-ENV:actor'] = $actor; 
    160         } elseif (!isset($this->attributes['SOAP-ENV:actor'])) { 
    161             $this->attributes['SOAP-ENV:actor'] = 'http://schemas.xmlsoap.org/soap/actor/next'; 
    162         } 
    163         $this->attributes['SOAP-ENV:mustUnderstand'] = (int)$mustunderstand; 
     207            $this->attributes[SOAP_BASE::SOAPENVPrefix().':actor'] = $actor; 
     208        } elseif (!isset($this->attributes[SOAP_BASE::SOAPENVPrefix().':actor'])) { 
     209            $this->attributes[SOAP_BASE::SOAPENVPrefix().':actor'] = 'http://schemas.xmlsoap.org/soap/actor/next'; 
     210        } 
     211        $this->attributes[SOAP_BASE::SOAPENVPrefix().':mustUnderstand'] = (int)$mustunderstand; 
    164212    } 
    165213 
     
    184232     *                          is provide. 
    185233     * @param string $file      The attachment data. 
     234     * @param array $attributes Attributes. 
    186235     */ 
    187236    function SOAP_Attachment($name = '', $type = 'application/octet-stream', 
    188                              $filename, $file = null) 
     237                             $filename, $file = null, $attributes = null) 
    189238    { 
    190239        parent::SOAP_Value($name, null, null); 
    191240 
    192         $filedata = ($file === null) ? $this->_file2str($filename) : $file; 
     241        $filedata = $file === null ? $this->_file2str($filename) : $file; 
    193242        $filename = basename($filename); 
    194243        if (PEAR::isError($filedata)) { 
     
    199248        $cid = md5(uniqid(time())); 
    200249 
    201         $this->attributes['href'] = 'cid:' . $cid;  
     250        $this->attributes = $attributes; 
     251        $this->attributes['href'] = 'cid:' . $cid; 
    202252 
    203253        $this->options['attachment'] = array('body' => $filedata, 
Note: See TracChangeset for help on using the changeset viewer.