MIOLO20
Toggle main menu visibility
Página principal
Estruturas de dados
Estruturas de dados
Hierarquia de classes
Campos de dados
Tudo
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Funções
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variáveis
$
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Ficheiros
Lista de ficheiros
Globais
Tudo
$
_
a
c
d
e
f
g
i
l
m
o
p
r
s
u
Funções
Variáveis
$
_
c
e
f
l
m
o
p
s
Exemplos
▼
MIOLO20
►
Estruturas de dados
▼
Ficheiros
▼
Lista de ficheiros
▼
classes
▼
contrib
▼
phpWsdl
►
class.complextypedemo.php
►
class.phpwsdl.php
►
class.phpwsdlclient.php
►
class.phpwsdlcomplex.php
►
class.phpwsdlelement.php
►
class.phpwsdlformatter.php
►
class.phpwsdlhash.php
►
class.phpwsdlmethod.php
►
class.phpwsdlobject.php
►
class.phpwsdlparam.php
►
class.phpwsdlparser.php
►
class.phpwsdlproxy.php
►
class.soapdemo.php
►
demo.php
►
demo2.php
►
demo3.php
►
demo4.php
►
demo5.php
►
demo6.php
►
teste.php
testewsdl.php
►
TSCounter
►
barcode.class
►
dbug.class
►
EasyDownload.class
►
webServicesServer.class
►
database
►
doc
►
extensions
►
ezpdf
►
flow
►
interfaces
►
model
►
persistence
►
pslib
►
security
►
services
►
tests
►
ui
►
utils
►
compatibility.class
►
miolo.class
►
Globais
►
Exemplos
•
Tudo
Estruturas de dados
Namespaces
Ficheiros
Funções
Variáveis
Carregando...
Procurando...
Nenhuma entrada encontrada
class.phpwsdlhash.php
Ir para a documentação deste ficheiro.
1
<?php
2
3
/*
4
PhpWsdl - Generate WSDL from PHP
5
Copyright (C) 2011 Andreas Zimmermann, wan24.de
6
7
This program is free software; you can redistribute it and/or modify it under
8
the terms of the GNU General Public License as published by the Free Software
9
Foundation; either version 3 of the License, or (at your option) any later
10
version.
11
12
This program is distributed in the hope that it will be useful, but WITHOUT
13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License along with
17
this program; if not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
if
(basename($_SERVER[
'SCRIPT_FILENAME'
])==basename(__FILE__))
21
exit;
22
23
// This is my solution to swap hash arrays between client/server. The receiver
24
// has to rebuild the hash object in the way his programming language supports
25
// hash arrays. It's just an example solution. To use the types defined here,
26
// you have to include this file in your source using "require". This file has
27
// also to be in the list of files that are parsed by PhpWsdl.
28
//
29
// A sample unserialized PHP hash array (use the "Serialize" method on this):
30
//
31
// Array(
32
// 'a' => 'Value of a',
33
// 'b' => 'Value of b'
34
// )
35
//
36
// The resulting serialized array (return this):
37
//
38
// Array(
39
// PhpWsdlHash(
40
// 'key' => 'a',
41
// 'value' => 'Value of a'
42
// ),
43
// PhpWsdlHash(
44
// 'key' => 'b',
45
// 'value' => 'Value of b'
46
// )
47
// )
48
//
49
// The received serialized array (use the "Deserialize" method on this):
50
//
51
// Array(
52
// object(
53
// 'key' => 'a',
54
// 'value' => 'Value of a'
55
// ),
56
// object(
57
// 'key' => 'b',
58
// 'value' => 'Value of b'
59
// )
60
// )
61
//
62
// The value type must be unique within an hash array. You can return prepared
63
// types like StringHashArray, or you define your own ones. To serialize an
64
// hash array to the target type, use the PhpWsdlHashArrayBuilder class:
65
//
66
// return PhpWsdlHashArrayBuilder::Serialize($yourHashVariable);
67
//
68
// To deserialize an received object:
69
//
70
// $yourHashVariable=PhpWsdlHashArrayBuilder::Deserialize($receivedHashVariable);
71
//
72
// Tip: I prefer converting hashes into an INI formatted string. The string
73
// type is primitive, but it can contain complex information. In nearly every
74
// programming language you can work with the INI format with predefined
75
// classes - or it's very easy to write your own.
76
113
class
PhpWsdlHashArrayBuilder
{
120
public
static
function
Serialize
($hash){
121
if
(is_null($hash))
122
return
null
;
123
$res=Array();
124
$keys=array_keys($hash);
125
$i=-1;
126
$len=
sizeof
($keys);
127
while
(++$i<$len)
128
$res[]=
new
PhpWsdlHash
($keys[$i],$hash[$keys[$i]]);
129
return
$res;
130
}
120
public
static
function
Serialize
($hash) {
…
}
131
138
public
static
function
Deserialize
($arr){
139
if
(is_null($arr))
140
return
null
;
141
$res=Array();
142
$i=-1;
143
$len=
sizeof
($arr);
144
while
(++$i<$len)
145
$res[$arr[$i]->Key]=$arr[$i]->Value;
146
return
$res;
147
}
138
public
static
function
Deserialize
($arr) {
…
}
148
}
113
class
PhpWsdlHashArrayBuilder
{
…
};
149
155
class
PhpWsdlHash
{
161
public
$Key
;
167
public
$Value
;
168
176
public
function
PhpWsdlHash
($key,$value){
177
self::__construct
($key, $value);
178
}
176
public
function
PhpWsdlHash
($key,$value) {
…
}
179
180
public
function
__construct
($key,$value){
181
$this->Key=$key;
182
$this->Value=$value;
183
}
180
public
function
__construct
($key,$value) {
…
}
184
}
155
class
PhpWsdlHash
{
…
};
PhpWsdlHashArrayBuilder
Definição
class.phpwsdlhash.php:113
PhpWsdlHashArrayBuilder\Serialize
static Serialize($hash)
Definição
class.phpwsdlhash.php:120
PhpWsdlHashArrayBuilder\Deserialize
static Deserialize($arr)
Definição
class.phpwsdlhash.php:138
PhpWsdlHash
Definição
class.phpwsdlhash.php:155
PhpWsdlHash\$Value
$Value
Definição
class.phpwsdlhash.php:167
PhpWsdlHash\__construct
__construct($key, $value)
Definição
class.phpwsdlhash.php:180
PhpWsdlHash\$Key
$Key
Definição
class.phpwsdlhash.php:161
PhpWsdlHash\PhpWsdlHash
PhpWsdlHash($key, $value)
Definição
class.phpwsdlhash.php:176
classes
contrib
phpWsdl
class.phpwsdlhash.php
Gerado por
1.10.0