No regular expressions were active.
1 |
|
<?php
|
|
1 |
|
<?php
|
2 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
|
2 |
|
/*********
**********
**********
**********
**********
**********
**********
******
|
3 |
|
*
O
rca Intera
ctive Foru
m Script
|
|
3 |
|
*
O
rca Intera
ctive Foru
m Script
|
4 |
|
*
----------
-----
|
|
4 |
|
*
----------
-----
--
|
5 |
|
*
Start
e
d
:
Fr
Nov
10
2006
|
|
5 |
|
*
b
e
gin
:
Fr
Nov
10
2006
|
6 |
|
*
C
opyright
:
(C)
200
7
BoonEx
Group
|
|
6 |
|
*
c
opyright
:
(C)
200
6
BoonEx
Group
|
7 |
|
*
W
ebsite
:
http://www
.boonex.co
m
|
|
7 |
|
*
w
ebsite
:
http://www
.boonex.co
m
/
|
8 |
|
* This fil
e is part
of Orca -
Interactiv
e Forum Sc
ript
|
|
8 |
|
* This fil
e is part
of Orca -
Interactiv
e Forum Sc
ript
|
9 |
|
*
|
|
9 |
|
*
|
10 |
|
*
Orca
is
free
software
;
y
o
u
c
a
n
r
ed
i
s
tribut
e
i
t
and/
o
r
modify
i
t
u
n
d
e
r
|
|
10 |
|
*
Orca
is
free
software
.
This
w
o
rk
is
li
c
e
n
s
ed
under
a
Creat
i
ve
Common
s
At
tribut
i
o
n
3.0
L
i
ce
n
s
e
.
|
11 |
|
* the term
s of the G
NU General
Public Li
cense as p
ublished b
y the
|
|
11 |
|
* http://c
reativecom
mons.org/l
icenses/by
/3.0/
|
12 |
|
* Free Sof
tware Foun
dation; ei
ther versi
on 2 of th
e
|
|
|
13 |
|
* License,
or any la
ter versio
n.
|
|
|
14 |
|
*
|
|
12 |
|
*
|
15 |
|
* Orca is
distribute
d in the h
ope that i
t will be
useful, bu
t WITHOUT
ANY WARRAN
TY;
|
|
13 |
|
* Orca is
distribute
d in the h
ope that i
t will be
useful, bu
t WITHOUT
ANY WARRAN
TY;
|
16 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
|
14 |
|
* without
even the i
mplied war
ranty of
MERCHANTAB
ILITY or F
ITNESS FOR
A PARTICU
LAR PURPOS
E.
|
17 |
|
*
See
the
GNU
G
e
n
e
r
al
Pu
b
l
i
c
License
for
more
details.
|
|
15 |
|
*
See
the
Cr
e
ativ
e
Commons
Att
r
i
b
ut
i
on
3.0
License
for
more
details.
|
18 |
|
*
You
should
have
received
a
copy
of
the
GNU
G
e
n
e
r
al
Pu
b
l
i
c
License
along
with
Orca,
|
|
16 |
|
*
You
should
have
received
a
copy
of
the
Cr
e
ativ
e
Commons
Att
r
i
b
ut
i
on
3.0
License
along
with
Orca,
|
19 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
|
17 |
|
* see lice
nse.txt fi
le; if not
, write to
marketing
@boonex.co
m
|
20 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
|
18 |
|
**********
**********
**********
**********
**********
**********
**********
*****/
|
21 |
|
|
|
19 |
|
|
22 |
|
|
|
20 |
|
|
23 |
|
// class f
or XML/XSL
tranforma
tion
|
|
21 |
|
// class f
or XML/XSL
tranforma
tion
|
24 |
|
|
|
22 |
|
|
25 |
|
define ('B
XXSLTRANSF
ORM_FF', 4
); // xml
and xsl da
ta in two
files
|
|
23 |
|
define ('B
XXSLTRANSF
ORM_FF', 4
); // xml
and xsl da
ta in two
files
|
26 |
|
define ('B
XXSLTRANSF
ORM_FS', 2
); // xml
data in th
e file and
xsl data
in the str
ing
|
|
24 |
|
define ('B
XXSLTRANSF
ORM_FS', 2
); // xml
data in th
e file and
xsl data
in the str
ing
|
27 |
|
define ('B
XXSLTRANSF
ORM_SF', 1
); // xml
data in th
e string a
nd xsl dat
a in the f
ile
|
|
25 |
|
define ('B
XXSLTRANSF
ORM_SF', 1
); // xml
data in th
e string a
nd xsl dat
a in the f
ile
|
28 |
|
define ('B
XXSLTRANSF
ORM_SS', 0
); // xml
and xsl da
ta in stri
ngs
|
|
26 |
|
define ('B
XXSLTRANSF
ORM_SS', 0
); // xml
and xsl da
ta in stri
ngs
|
29 |
|
|
|
27 |
|
|
30 |
|
define ('B
XXSLTRANSF
ORM_XML_FI
LE', 2); /
/ xml file
bit
|
|
28 |
|
define ('B
XXSLTRANSF
ORM_XML_FI
LE', 2); /
/ xml file
bit
|
31 |
|
define ('B
XXSLTRANSF
ORM_XSL_FI
LE', 1); /
/ xsl file
bit
|
|
29 |
|
define ('B
XXSLTRANSF
ORM_XSL_FI
LE', 1); /
/ xsl file
bit
|
32 |
|
|
|
30 |
|
|
33 |
|
class BxXs
lTransform
|
|
31 |
|
class BxXs
lTransform
|
34 |
|
{
|
|
32 |
|
{
|
35 |
|
var $_
tmp_dir =
"/tmp/";
|
|
33 |
|
var $_
tmp_dir =
"/tmp/";
|
36 |
|
var $_
mode;
|
|
34 |
|
var $_
mode;
|
37 |
|
var $_
xml;
|
|
35 |
|
var $_
xml;
|
38 |
|
var $_
xsl;
|
|
36 |
|
var $_
xsl;
|
39 |
|
var $_
header = '
Content-Ty
pe: applic
ation/xml;
charset=U
TF-8';
|
|
37 |
|
var $_
header = '
Content-Ty
pe: applic
ation/xml;
charset=U
TF-8';
|
40 |
|
|
|
38 |
|
|
41 |
|
/**
|
|
39 |
|
/**
|
42 |
|
* con
tructor
|
|
40 |
|
* con
tructor
|
43 |
|
* @p
aram $xml
xml fo
r transfor
mation
|
|
41 |
|
* @p
aram $xml
xml fo
r transfor
mation
|
44 |
|
* @p
aram $xsl
xsl fo
r transfor
mation
|
|
42 |
|
* @p
aram $xsl
xsl fo
r transfor
mation
|
45 |
|
* @p
aram $mode
xml/xs
l transfor
mation mod
e (BXXSLTR
ANSFORM_FF
|BXXSLTRAN
SFORM_FS|B
XXSLTRANSF
ORM_SF|BXX
SLTRANSFOR
M_SS)
|
|
43 |
|
* @p
aram $mode
xml/xs
l transfor
mation mod
e (BXXSLTR
ANSFORM_FF
|BXXSLTRAN
SFORM_FS|B
XXSLTRANSF
ORM_SF|BXX
SLTRANSFOR
M_SS)
|
46 |
|
*/
|
|
44 |
|
*/
|
47 |
|
functi
on BxXslTr
ansform ($
xml, $xsl,
$mode)
|
|
45 |
|
functi
on BxXslTr
ansform ($
xml, $xsl,
$mode)
|
48 |
|
{
|
|
46 |
|
{
|
49 |
|
$t
his->_mode
= $mode;
|
|
47 |
|
$t
his->_mode
= $mode;
|
50 |
|
$t
his->_xml
= $xml;
|
|
48 |
|
$t
his->_xml
= $xml;
|
51 |
|
$t
his->_xsl
= $xsl;
|
|
49 |
|
$t
his->_xsl
= $xsl;
|
52 |
|
}
|
|
50 |
|
}
|
53 |
|
|
|
51 |
|
|
54 |
|
functi
on process
()
|
|
52 |
|
functi
on process
()
|
55 |
|
{
|
|
53 |
|
{
|
56 |
|
gl
obal $gCon
f;
|
|
54 |
|
gl
obal $gCon
f;
|
57 |
|
|
|
55 |
|
|
58 |
|
if
('client'
== $gConf
['xsl_mode
'])
|
|
56 |
|
if
('client'
== $gConf
['xsl_mode
'])
|
59 |
|
{
|
|
57 |
|
{
|
60 |
|
echo 'de
pricated';
exit;
|
|
58 |
|
echo 'de
pricated';
exit;
|
61 |
|
}
|
|
59 |
|
}
|
62 |
|
|
|
60 |
|
|
63 |
|
he
ader ($thi
s->_header
);
|
|
61 |
|
he
ader ($thi
s->_header
);
|
64 |
|
|
|
62 |
|
|
65 |
|
//
xml: stri
ng, xsl: f
ile
|
|
63 |
|
//
xml: stri
ng, xsl: f
ile
|
66 |
|
if
( !($this
->_mode &
BXXSLTRANS
FORM_XML_F
ILE) && ($
this->_mod
e & BXXSLT
RANSFORM_X
SL_FILE) )
|
|
64 |
|
if
( !($this
->_mode &
BXXSLTRANS
FORM_XML_F
ILE) && ($
this->_mod
e & BXXSLT
RANSFORM_X
SL_FILE) )
|
67 |
|
{
|
|
65 |
|
{
|
68 |
|
$args =
array(
|
|
66 |
|
$args =
array(
|
69 |
|
'/_x
ml' => $th
is->_xml,
|
|
67 |
|
'/_x
ml' => $th
is->_xml,
|
70 |
|
);
|
|
68 |
|
);
|
71 |
|
|
|
69 |
|
|
72 |
|
validate
_unicode (
$this->_xm
l);
|
|
70 |
|
validate
_unicode (
$this->_xm
l);
|
73 |
|
|
|
71 |
|
|
74 |
|
if (((in
t)phpversi
on()) >= 5
)
|
|
72 |
|
if (((in
t)phpversi
on()) >= 5
)
|
75 |
|
{
|
|
73 |
|
{
|
76 |
|
|
|
74 |
|
|
77 |
|
$xml
= new DOM
Document()
;
|
|
75 |
|
$xml
= new DOM
Document()
;
|
78 |
|
if (
!@$xml->lo
adXML($thi
s->_xml))
|
|
76 |
|
if (
!@$xml->lo
adXML($thi
s->_xml))
|
79 |
|
{
|
|
77 |
|
{
|
80 |
|
$mk = new
Mistake ()
;
|
|
78 |
|
$mk = new
Mistake ()
;
|
81 |
|
$mk->log (
"BxXslTran
sform::pro
cess - can
not load
xml:\n " .
$this->_x
ml);
|
|
79 |
|
$mk->log (
"BxXslTran
sform::pro
cess - can
not load
xml:\n " .
$this->_x
ml);
|
82 |
|
$mk->displ
ayError
("
S
orry,
s
ite
is
unavailabl
e
now,
please
try
again
later.
");
|
|
80 |
|
$mk->displ
ayError
("
[L[
S
ite
is
unavailabl
e
]]
");
|
83 |
|
}
|
|
81 |
|
}
|
84 |
|
|
|
82 |
|
|
85 |
|
$xsl
= new Dom
Document()
;
|
|
83 |
|
$xsl
= new Dom
Document()
;
|
86 |
|
$xsl
->load($th
is->_xsl);
|
|
84 |
|
$xsl
->load($th
is->_xsl);
|
87 |
|
|
|
85 |
|
|
88 |
|
$pro
c = new Xs
ltProcesso
r();
|
|
86 |
|
$pro
c = new Xs
ltProcesso
r();
|
89 |
|
$pro
c->importS
tyleSheet(
$xsl);
|
|
87 |
|
$pro
c->importS
tyleSheet(
$xsl);
|
90 |
|
$res
= $proc->
transformT
oXML($xml)
;
|
|
88 |
|
$res
= $proc->
transformT
oXML($xml)
;
|
91 |
|
|
|
89 |
|
|
92 |
|
}
|
|
90 |
|
}
|
93 |
|
else
|
|
91 |
|
else
|
94 |
|
{
|
|
92 |
|
{
|
95 |
|
|
|
93 |
|
|
96 |
|
if (
function_e
xists('dom
xml_xslt_s
tylesheet_
file'))
|
|
94 |
|
if (
function_e
xists('dom
xml_xslt_s
tylesheet_
file'))
|
97 |
|
{
|
|
95 |
|
{
|
98 |
|
$xmldoc =
new DomDoc
ument ($th
is->_xml);
|
|
96 |
|
$xmldoc =
new DomDoc
ument ($th
is->_xml);
|
99 |
|
$xsldoc =
domxml_xsl
t_styleshe
et_file($t
his->_xsl)
;
|
|
97 |
|
$xsldoc =
domxml_xsl
t_styleshe
et_file($t
his->_xsl)
;
|
100 |
|
$result =
$xsldoc->
process($x
mldoc);
|
|
98 |
|
$result =
$xsldoc->
process($x
mldoc);
|
101 |
|
$res = $x
sldoc->res
ult_dump_m
em($result
);
|
|
99 |
|
$res = $x
sldoc->res
ult_dump_m
em($result
);
|
102 |
|
}
|
|
100 |
|
}
|
103 |
|
else
if (functi
on_exists
('xslt_cre
ate'))
|
|
101 |
|
else
if (functi
on_exists
('xslt_cre
ate'))
|
104 |
|
{
|
|
102 |
|
{
|
105 |
|
$xh = xslt
_create();
|
|
103 |
|
$xh = xslt
_create();
|
106 |
|
xslt_setop
t($xh, XSL
T_SABOPT_I
GNORE_DOC_
NOT_FOUND)
;
|
|
104 |
|
xslt_setop
t($xh, XSL
T_SABOPT_I
GNORE_DOC_
NOT_FOUND)
;
|
107 |
|
$res = xsl
t_process
($xh, 'arg
:/_xml', $
this->_xsl
, NULL, $a
rgs);
|
|
105 |
|
$res = xsl
t_process
($xh, 'arg
:/_xml', $
this->_xsl
, NULL, $a
rgs);
|
108 |
|
xslt_free(
$xh);
|
|
106 |
|
xslt_free(
$xh);
|
109 |
|
}
|
|
107 |
|
}
|
110 |
|
else
|
|
108 |
|
else
|
111 |
|
{
|
|
109 |
|
{
|
112 |
|
die('Serve
r XSLT sup
port is no
t enabled,
try to us
e client X
SL transfo
rmation ht
tp://your-
domain/orc
a_folder/?
xsl_mode=c
lient');
|
|
110 |
|
die('Serve
r XSLT sup
port is no
t enabled,
try to us
e client X
SL transfo
rmation ht
tp://your-
domain/orc
a_folder/?
xsl_mode=c
lient');
|
113 |
|
}
|
|
111 |
|
}
|
114 |
|
}
|
|
112 |
|
}
|
115 |
|
|
|
113 |
|
|
116 |
|
return $
res;
|
|
114 |
|
return $
res;
|
117 |
|
}
|
|
115 |
|
}
|
118 |
|
|
|
116 |
|
|
119 |
|
//
xml: file
, xsl: fil
e
|
|
117 |
|
//
xml: file
, xsl: fil
e
|
120 |
|
if
( ($this-
>_mode & B
XXSLTRANSF
ORM_XML_FI
LE) && ($t
his->_mode
& BXXSLTR
ANSFORM_XS
L_FILE) )
|
|
118 |
|
if
( ($this-
>_mode & B
XXSLTRANSF
ORM_XML_FI
LE) && ($t
his->_mode
& BXXSLTR
ANSFORM_XS
L_FILE) )
|
121 |
|
{
|
|
119 |
|
{
|
122 |
|
|
|
120 |
|
|
123 |
|
if (((in
t)phpversi
on()) >= 5
)
|
|
121 |
|
if (((in
t)phpversi
on()) >= 5
)
|
124 |
|
{
|
|
122 |
|
{
|
125 |
|
$xml
= new DOM
Document()
;
|
|
123 |
|
$xml
= new DOM
Document()
;
|
126 |
|
$xml
->load($th
is->_xml);
|
|
124 |
|
$xml
->load($th
is->_xml);
|
127 |
|
|
|
125 |
|
|
128 |
|
$xsl
= new Dom
Document()
;
|
|
126 |
|
$xsl
= new Dom
Document()
;
|
129 |
|
$xsl
->load($th
is->_xsl);
|
|
127 |
|
$xsl
->load($th
is->_xsl);
|
130 |
|
|
|
128 |
|
|
131 |
|
$pro
c = new Xs
ltProcesso
r();
|
|
129 |
|
$pro
c = new Xs
ltProcesso
r();
|
132 |
|
$pro
c->importS
tyleSheet(
$xsl);
|
|
130 |
|
$pro
c->importS
tyleSheet(
$xsl);
|
133 |
|
$res
= $proc->
transformT
oXML($xml)
;
|
|
131 |
|
$res
= $proc->
transformT
oXML($xml)
;
|
134 |
|
}
|
|
132 |
|
}
|
135 |
|
else
|
|
133 |
|
else
|
136 |
|
{
|
|
134 |
|
{
|
137 |
|
if (
function_e
xists('dom
xml_xslt_s
tylesheet_
file'))
|
|
135 |
|
if (
function_e
xists('dom
xml_xslt_s
tylesheet_
file'))
|
138 |
|
{
|
|
136 |
|
{
|
139 |
|
$xmldoc =
new DomDoc
ument ($th
is->_xml);
|
|
137 |
|
$xmldoc =
new DomDoc
ument ($th
is->_xml);
|
140 |
|
$xsldoc =
domxml_xsl
t_styleshe
et_file($t
his->_xsl)
;
|
|
138 |
|
$xsldoc =
domxml_xsl
t_styleshe
et_file($t
his->_xsl)
;
|
141 |
|
$result =
$xsldoc->
process($x
mldoc);
|
|
139 |
|
$result =
$xsldoc->
process($x
mldoc);
|
142 |
|
$res = $x
sldoc->res
ult_dump_m
em($result
);
|
|
140 |
|
$res = $x
sldoc->res
ult_dump_m
em($result
);
|
143 |
|
}
|
|
141 |
|
}
|
144 |
|
else
if (functi
on_exists
('xslt_cre
ate'))
|
|
142 |
|
else
if (functi
on_exists
('xslt_cre
ate'))
|
145 |
|
{
|
|
143 |
|
{
|
146 |
|
$xh = xslt
_create();
|
|
144 |
|
$xh = xslt
_create();
|
147 |
|
$res = xsl
t_process
($xh, $thi
s->_xml, $
this->_xsl
, NULL, $a
rgs);
|
|
145 |
|
$res = xsl
t_process
($xh, $thi
s->_xml, $
this->_xsl
, NULL, $a
rgs);
|
148 |
|
xslt_setop
t($xh, XSL
T_SABOPT_I
GNORE_DOC_
NOT_FOUND)
;
|
|
146 |
|
xslt_setop
t($xh, XSL
T_SABOPT_I
GNORE_DOC_
NOT_FOUND)
;
|
149 |
|
xslt_free(
$xh);
|
|
147 |
|
xslt_free(
$xh);
|
150 |
|
}
|
|
148 |
|
}
|
151 |
|
else
|
|
149 |
|
else
|
152 |
|
{
|
|
150 |
|
{
|
153 |
|
die('XSLT
support is
not enabl
ed');
|
|
151 |
|
die('XSLT
support is
not enabl
ed');
|
154 |
|
}
|
|
152 |
|
}
|
155 |
|
}
|
|
153 |
|
}
|
156 |
|
return $
res;
|
|
154 |
|
return $
res;
|
157 |
|
//return
`/opt/jr
e1.5.0_06/
bin/java -
jar /opt/s
axon/saxon
.jar -ds {
$this->_xm
l} {$this-
>_xsl}`;
|
|
155 |
|
//return
`/opt/jr
e1.5.0_06/
bin/java -
jar /opt/s
axon/saxon
.jar -ds {
$this->_xm
l} {$this-
>_xsl}`;
|
158 |
|
}
|
|
156 |
|
}
|
159 |
|
|
|
157 |
|
|
160 |
|
re
turn "<h1>
not suppor
ted </h1>"
;
|
|
158 |
|
re
turn "<h1>
not suppor
ted</h1>";
|
161 |
|
}
|
|
159 |
|
}
|
162 |
|
|
|
160 |
|
|
163 |
|
functi
on setHead
er ($s)
|
|
161 |
|
functi
on setHead
er ($s)
|
164 |
|
{
|
|
162 |
|
{
|
165 |
|
$t
his->_head
er = $s;
|
|
163 |
|
$t
his->_head
er = $s;
|
166 |
|
}
|
|
164 |
|
}
|
167 |
|
|
|
165 |
|
|
168 |
|
|
|
166 |
|
|
169 |
|
// private
methods
|
|
167 |
|
// private
methods
|
170 |
|
|
|
168 |
|
|
171 |
|
functi
on _genFil
ename ()
|
|
169 |
|
functi
on _genFil
ename ()
|
172 |
|
{
|
|
170 |
|
{
|
173 |
|
li
st ($usec,
$sec) = e
xplode ('
', microti
me());
|
|
171 |
|
li
st ($usec,
$sec) = e
xplode ('
', microti
me());
|
174 |
|
sr
and ((floa
t) $sec +
((float) $
usec * 100
000));
|
|
172 |
|
sr
and ((floa
t) $sec +
((float) $
usec * 100
000));
|
175 |
|
re
turn $this
->_tmp_dir
. '/' . r
and() . '_
' . rand()
. '.xml';
|
|
173 |
|
re
turn $this
->_tmp_dir
. '/' . r
and() . '_
' . rand()
. '.xml';
|
176 |
|
}
|
|
174 |
|
}
|
177 |
|
|
|
175 |
|
|
178 |
|
}
|
|
176 |
|
}
|
179 |
|
|
|
177 |
|
|
180 |
|
?>
|
|
178 |
|
?>
|