mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-13 04:00:50 +00:00
Compare commits
942
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0a58d9570 | ||
|
|
7c495e9250 | ||
|
|
fcc7633bd0 | ||
|
|
77d490c8fa | ||
|
|
3005a78fbf | ||
|
|
7be8abe541 | ||
|
|
427e27cc74 | ||
|
|
f007536147 | ||
|
|
cf0b1ab2e3 | ||
|
|
302dc219c1 | ||
|
|
7aef25bc38 | ||
|
|
12e61e2ac4 | ||
|
|
0371773312 | ||
|
|
fd913127ab | ||
|
|
bb56953b8d | ||
|
|
5762d24683 | ||
|
|
71a63bc126 | ||
|
|
582c2462ad | ||
|
|
fd55fc78f4 | ||
|
|
0fe880b867 | ||
|
|
95c2ba883a | ||
|
|
fb743a3e27 | ||
|
|
56fa94a6c0 | ||
|
|
7756f1b7f2 | ||
|
|
be525968af | ||
|
|
2e3222d165 | ||
|
|
973651ae3b | ||
|
|
071b885744 | ||
|
|
bedd024310 | ||
|
|
dd14eb51d4 | ||
|
|
caf1b545b8 | ||
|
|
bf0d23f985 | ||
|
|
1f433956b0 | ||
|
|
d949f9d912 | ||
|
|
8f7009f7f2 | ||
|
|
2e4f176a6d | ||
|
|
694f5ed4de | ||
|
|
b882dbf5b9 | ||
|
|
982458f908 | ||
|
|
48e938368e | ||
|
|
9a57fc8cab | ||
|
|
0117c206d6 | ||
|
|
0be78cd2b4 | ||
|
|
304409e520 | ||
|
|
545b4cff3b | ||
|
|
1719d0062c | ||
|
|
1dafae56b9 | ||
|
|
720d8fdddc | ||
|
|
2fa3048632 | ||
|
|
8b02b1eb7e | ||
|
|
c34c7433eb | ||
|
|
2eb11eae36 | ||
|
|
c629ac4600 | ||
|
|
a743a6dee6 | ||
|
|
460aba89f8 | ||
|
|
c465c5a3eb | ||
|
|
18144dffe9 | ||
|
|
f896c7eeae | ||
|
|
74348caba2 | ||
|
|
bd62bcf18b | ||
|
|
42c98ab6c8 | ||
|
|
0ec69ef808 | ||
|
|
59a1c7dcf5 | ||
|
|
c8e2b9ebfe | ||
|
|
aac21de8ae | ||
|
|
db59a7414e | ||
|
|
dd6c7bb240 | ||
|
|
e486cb60bc | ||
|
|
9500c0c776 | ||
|
|
68cde46c9f | ||
|
|
4c37bb0be8 | ||
|
|
3859a66d14 | ||
|
|
486af716be | ||
|
|
c0bffe6dcf | ||
|
|
b4b0bd3a69 | ||
|
|
ae8c6a816a | ||
|
|
e8713cc150 | ||
|
|
e533fe138b | ||
|
|
aa6e7433bc | ||
|
|
90bb834ed1 | ||
|
|
86f292bc00 | ||
|
|
f251532caa | ||
|
|
72a2ec5d85 | ||
|
|
9ba9ff7b17 | ||
|
|
856b482bab | ||
|
|
38cb520533 | ||
|
|
8e9b151720 | ||
|
|
d720b0c631 | ||
|
|
ee957ac447 | ||
|
|
b6972e5890 | ||
|
|
e25f73df9c | ||
|
|
e28bc16c5b | ||
|
|
f95c4cb8bb | ||
|
|
1ee0cac2d9 | ||
|
|
5c19a5499b | ||
|
|
fb9e0bb965 | ||
|
|
1a97d39a61 | ||
|
|
9e37e7adfb | ||
|
|
5c4dca7424 | ||
|
|
5e0efd3caa | ||
|
|
d346b4ba9b | ||
|
|
31071bdd6c | ||
|
|
12e8ae3adb | ||
|
|
49f3b54810 | ||
|
|
e2fdfb6c19 | ||
|
|
dcdaf1e9a0 | ||
|
|
7f5ff80c86 | ||
|
|
171aaf4e8d | ||
|
|
9cc234e979 | ||
|
|
500cf0a542 | ||
|
|
b724a873e9 | ||
|
|
c77c03b751 | ||
|
|
bbd9c931b0 | ||
|
|
7bfabbae52 | ||
|
|
c6db0221c4 | ||
|
|
e1a54c8d10 | ||
|
|
3cba4261fa | ||
|
|
39c03bc2c5 | ||
|
|
22e0811f2c | ||
|
|
d7a3529ead | ||
|
|
7241d18de1 | ||
|
|
bf5d11b44e | ||
|
|
9ee32440ad | ||
|
|
729d43f733 | ||
|
|
0c0482d59c | ||
|
|
00366c63fc | ||
|
|
d8d9e16711 | ||
|
|
a86c9bbd24 | ||
|
|
cb9a33bc14 | ||
|
|
9b0239178c | ||
|
|
1a3e5a816b | ||
|
|
ff21c392f3 | ||
|
|
99637508f9 | ||
|
|
c48e8e5116 | ||
|
|
9b9ec7ad1e | ||
|
|
d7f0682135 | ||
|
|
aa6810479e | ||
|
|
84e44e9759 | ||
|
|
e49440bb73 | ||
|
|
4f45925b23 | ||
|
|
be8da1111e | ||
|
|
2527cce052 | ||
|
|
18939dd676 | ||
|
|
1a645aa637 | ||
|
|
8b67ff4348 | ||
|
|
3a9322c32a | ||
|
|
c8ff4f2262 | ||
|
|
d9fe90785e | ||
|
|
a4fe7b11ee | ||
|
|
863a441fba | ||
|
|
edea55ecd7 | ||
|
|
bdd3fbf67a | ||
|
|
55c86cbdb9 | ||
|
|
4bfdbfb167 | ||
|
|
6ccaefd48d | ||
|
|
fdee9fe213 | ||
|
|
8e6f5fe353 | ||
|
|
aa00851aa4 | ||
|
|
2b85acd861 | ||
|
|
004746d842 | ||
|
|
216784bcc3 | ||
|
|
1cdedb63bd | ||
|
|
49f0382490 | ||
|
|
50f76f501c | ||
|
|
1525ff177f | ||
|
|
2ea7d06455 | ||
|
|
f5ea07ce61 | ||
|
|
ce99003ae1 | ||
|
|
0200c77d7e | ||
|
|
4033fe903d | ||
|
|
4849145b66 | ||
|
|
bfaf2a8f36 | ||
|
|
f8b07fbbac | ||
|
|
08abb7213c | ||
|
|
f31d157ce7 | ||
|
|
868602b5ab | ||
|
|
5d420d7bb7 | ||
|
|
50d2474660 | ||
|
|
92cc078907 | ||
|
|
fe93cf1b9a | ||
|
|
7333bc8f82 | ||
|
|
9f8701ac58 | ||
|
|
55c5c4b362 | ||
|
|
51f2ad15f4 | ||
|
|
f4dd99e8b8 | ||
|
|
485c71abf7 | ||
|
|
c8948bf677 | ||
|
|
77102efc79 | ||
|
|
e64002e9ef | ||
|
|
043a1f5b36 | ||
|
|
bb0637213f | ||
|
|
b3ac7b808d | ||
|
|
ae3616fba8 | ||
|
|
50c22695cd | ||
|
|
7a5badecbf | ||
|
|
21390b3bf6 | ||
|
|
95ee73b7bf | ||
|
|
086a4fda17 | ||
|
|
e131b99b2a | ||
|
|
7dab648426 | ||
|
|
cd2968d0db | ||
|
|
930347763b | ||
|
|
1548b1ebf4 | ||
|
|
7e8039ef0d | ||
|
|
d1c0cc7f47 | ||
|
|
d484c0ebf8 | ||
|
|
8ff4b67307 | ||
|
|
14aa0e7495 | ||
|
|
bf0c1962d9 | ||
|
|
724429c759 | ||
|
|
00d6a6d8c2 | ||
|
|
5d5755af7c | ||
|
|
f373bcafd3 | ||
|
|
91fb452012 | ||
|
|
6e84cdacd1 | ||
|
|
b5da4730a3 | ||
|
|
2726272b68 | ||
|
|
9b8fbc368c | ||
|
|
ac125fa07f | ||
|
|
1f4e9b8eb7 | ||
|
|
5e0a6b43fc | ||
|
|
640dc6721c | ||
|
|
086c418737 | ||
|
|
21a600c569 | ||
|
|
5555498304 | ||
|
|
dd426eb391 | ||
|
|
6ec674deb7 | ||
|
|
8e15876ed5 | ||
|
|
ec0b8b8639 | ||
|
|
e98163546d | ||
|
|
666d9dea2c | ||
|
|
c334a7fe0b | ||
|
|
1f0a9a2c0c | ||
|
|
42f35b8783 | ||
|
|
334da52d65 | ||
|
|
9daf234fef | ||
|
|
a6072a2b76 | ||
|
|
bb4a3f979b | ||
|
|
651808e3dd | ||
|
|
ecc0759032 | ||
|
|
e9a6358d8d | ||
|
|
80ba3f416f | ||
|
|
c4521dfb2f | ||
|
|
b7875715ce | ||
|
|
ff65578160 | ||
|
|
ce2edd18c7 | ||
|
|
f85ea33a98 | ||
|
|
9ff0a9f23e | ||
|
|
d9e4d36c48 | ||
|
|
15d4bfd607 | ||
|
|
b7cfe4b5a6 | ||
|
|
f461ad12fb | ||
|
|
db230015b8 | ||
|
|
1ce0aca43e | ||
|
|
1c0de7be96 | ||
|
|
ec127efd14 | ||
|
|
64e2082f39 | ||
|
|
86306178c5 | ||
|
|
a5274daf1f | ||
|
|
f8ff0d2cb4 | ||
|
|
5f0e06e89c | ||
|
|
e120dab4f2 | ||
|
|
1d71c7b86e | ||
|
|
88bbfc9975 | ||
|
|
9c617f52f6 | ||
|
|
5945ba1c6d | ||
|
|
c89afb6539 | ||
|
|
b544c99344 | ||
|
|
bb0a9b3208 | ||
|
|
718d337c64 | ||
|
|
25dc000e41 | ||
|
|
1f77ab10fc | ||
|
|
ceed7b9d77 | ||
|
|
7ebc888513 | ||
|
|
06b796783c | ||
|
|
cecc66d17b | ||
|
|
c479e904dd | ||
|
|
893c567e35 | ||
|
|
6aecc88543 | ||
|
|
7480c6ac91 | ||
|
|
b5930ec988 | ||
|
|
2f47425d71 | ||
|
|
a0b0182016 | ||
|
|
ea59c6262d | ||
|
|
4a8de5c704 | ||
|
|
8c86b7e323 | ||
|
|
c51569c3b6 | ||
|
|
aef81e78a0 | ||
|
|
ca552c2618 | ||
|
|
55b4052887 | ||
|
|
217d3e39c6 | ||
|
|
a6c9ed61a6 | ||
|
|
fdc6b229a6 | ||
|
|
0b4182d8ad | ||
|
|
afa7fa58d7 | ||
|
|
de93525d7d | ||
|
|
c2c3eaf5a7 | ||
|
|
768f515afc | ||
|
|
7ae1572b39 | ||
|
|
af3950d196 | ||
|
|
03777d2784 | ||
|
|
25e8d3215d | ||
|
|
ba7b405913 | ||
|
|
183f99038a | ||
|
|
388607dc2d | ||
|
|
273d7623a6 | ||
|
|
15703e7fb8 | ||
|
|
37aafafc7d | ||
|
|
c4db6427f4 | ||
|
|
03188dfd50 | ||
|
|
bac7bb82b0 | ||
|
|
d4a01a8524 | ||
|
|
2fdf127a6f | ||
|
|
9f2cd8d5f2 | ||
|
|
f7c7e4cadb | ||
|
|
ff9fc7aa3f | ||
|
|
688f6d1b9d | ||
|
|
7cd06114f1 | ||
|
|
6659396dc6 | ||
|
|
5dc55d66fc | ||
|
|
156ab40baa | ||
|
|
05afcba8e7 | ||
|
|
f38526321b | ||
|
|
288d19ae0a | ||
|
|
779cc0f8d4 | ||
|
|
0af96031de | ||
|
|
84dcdc880f | ||
|
|
57a32b2825 | ||
|
|
690439a295 | ||
|
|
d03df22d4c | ||
|
|
4730528a95 | ||
|
|
1ab395eed3 | ||
|
|
9ea0fff51d | ||
|
|
60963ffe6c | ||
|
|
22e1885d29 | ||
|
|
900584ec7f | ||
|
|
b1d3a4d6cd | ||
|
|
bdaed8f51a | ||
|
|
367c917d80 | ||
|
|
062a5863c0 | ||
|
|
0a2f05f09b | ||
|
|
16106bd1f7 | ||
|
|
2185951cbb | ||
|
|
06c9c4d205 | ||
|
|
8a3bd41416 | ||
|
|
3aced8a7d4 | ||
|
|
e21f147cb9 | ||
|
|
ff33d897d5 | ||
|
|
bb30c3ad73 | ||
|
|
9f34a5beca | ||
|
|
05ce493547 | ||
|
|
bfa3967c70 | ||
|
|
a9cf0f46fc | ||
|
|
cddddbe04c | ||
|
|
9ec2c33e9d | ||
|
|
4648e756a9 | ||
|
|
9dfd6c8779 | ||
|
|
95987aedb2 | ||
|
|
4f7a06cf66 | ||
|
|
8c92d6574c | ||
|
|
d1c5e9706f | ||
|
|
4fc121ad7f | ||
|
|
58c67323da | ||
|
|
f27049afb6 | ||
|
|
da7b2d970d | ||
|
|
a758078ce5 | ||
|
|
20c9225f64 | ||
|
|
2492aba147 | ||
|
|
cc44d7c3d6 | ||
|
|
c138b63720 | ||
|
|
e34d5dd3e8 | ||
|
|
52967f54b9 | ||
|
|
45a1a3037a | ||
|
|
f760f7b6b3 | ||
|
|
67b6b9781f | ||
|
|
5f142e88fb | ||
|
|
011ea824da | ||
|
|
94e6ceec58 | ||
|
|
d391faffe6 | ||
|
|
41ab6de3aa | ||
|
|
7559d17ec1 | ||
|
|
2cc9d8537f | ||
|
|
98c17e6cee | ||
|
|
9b8cdd7fe9 | ||
|
|
66736faf95 | ||
|
|
d63aa79f79 | ||
|
|
52e84a5f0b | ||
|
|
68679a9d0e | ||
|
|
81b97d6f8e | ||
|
|
f42ff6e563 | ||
|
|
3c0d44c580 | ||
|
|
c106213d5c | ||
|
|
e46f133a2b | ||
|
|
668d8f88c1 | ||
|
|
3dece9cd5c | ||
|
|
26cb6a8d20 | ||
|
|
a8b620a91f | ||
|
|
802a410834 | ||
|
|
ed2ea558a8 | ||
|
|
e32ebf58c7 | ||
|
|
276a43792c | ||
|
|
114afad93d | ||
|
|
47ea35f85b | ||
|
|
161db1b519 | ||
|
|
8d2773e188 | ||
|
|
03ab5315d5 | ||
|
|
17479b8a0f | ||
|
|
9c4f6365b8 | ||
|
|
fc25077468 | ||
|
|
3e983d2bc6 | ||
|
|
3daa76dd25 | ||
|
|
5ae27dbe85 | ||
|
|
095595dd61 | ||
|
|
d33ceff2a5 | ||
|
|
61dd954da2 | ||
|
|
70432e3bef | ||
|
|
18e06aefee | ||
|
|
659a5ca923 | ||
|
|
dcb20d8fd6 | ||
|
|
488f38424e | ||
|
|
7323b80041 | ||
|
|
a14adbcafe | ||
|
|
0570451948 | ||
|
|
c1170b27fc | ||
|
|
01ad5f9b94 | ||
|
|
97301cbc36 | ||
|
|
92600eeb76 | ||
|
|
a731bd9f44 | ||
|
|
af2589e943 | ||
|
|
6b0adb932b | ||
|
|
4308ba9e42 | ||
|
|
87b3063593 | ||
|
|
6d4e490ae1 | ||
|
|
2fa25b8799 | ||
|
|
35839a5f96 | ||
|
|
0f88e33c05 | ||
|
|
ee5fe8f38d | ||
|
|
2c486990c6 | ||
|
|
cf2fe4d2da | ||
|
|
c3b452be51 | ||
|
|
1a920b4b19 | ||
|
|
e964bb3779 | ||
|
|
fd5f2b33a9 | ||
|
|
3d8e6218ef | ||
|
|
f713b0d8b0 | ||
|
|
c0eb65d6be | ||
|
|
71d140e992 | ||
|
|
1cabc773e4 | ||
|
|
6708c4d24d | ||
|
|
c663066261 | ||
|
|
f19bd6bf3f | ||
|
|
033bea7a29 | ||
|
|
5112f925df | ||
|
|
152bcb4e6d | ||
|
|
c6a8a1bf04 | ||
|
|
ea23f45b36 | ||
|
|
e0217033e4 | ||
|
|
1e8876bdad | ||
|
|
f49b5760eb | ||
|
|
f89ebf69bf | ||
|
|
c96af79b53 | ||
|
|
3df90156fd | ||
|
|
0c52aed751 | ||
|
|
a9a4668b92 | ||
|
|
bb2f10122c | ||
|
|
1544debc9f | ||
|
|
240b4d18e3 | ||
|
|
49664eb29a | ||
|
|
e7155c5f3d | ||
|
|
fc069fb51b | ||
|
|
18843133b8 | ||
|
|
ef667d12e1 | ||
|
|
b8547bbff0 | ||
|
|
51eac9d194 | ||
|
|
a4ef92e0ec | ||
|
|
ca2cd45607 | ||
|
|
b79c07099f | ||
|
|
a9b5596a02 | ||
|
|
935a58c3a2 | ||
|
|
753e0cf3dd | ||
|
|
bd55197721 | ||
|
|
1abd496ccf | ||
|
|
a3ad6e8426 | ||
|
|
193021f8f6 | ||
|
|
fd2483fe83 | ||
|
|
040839d34b | ||
|
|
3f67551437 | ||
|
|
80aadb9e77 | ||
|
|
395e90b16b | ||
|
|
be563c3140 | ||
|
|
41f25857bb | ||
|
|
f63d9b778f | ||
|
|
8ea1d52d7a | ||
|
|
c511afe310 | ||
|
|
77e48a2801 | ||
|
|
9220edbf14 | ||
|
|
8d9da24365 | ||
|
|
fdc6323b34 | ||
|
|
92d2462660 | ||
|
|
c61f4fe7b3 | ||
|
|
7de39b3377 | ||
|
|
3d67565aed | ||
|
|
accaef402b | ||
|
|
e7b71d3932 | ||
|
|
157ab1fd10 | ||
|
|
5a6bacea03 | ||
|
|
d39c73dba2 | ||
|
|
614a83e555 | ||
|
|
fd631013d9 | ||
|
|
fe2506a5ff | ||
|
|
5f2c98c566 | ||
|
|
c2176e0843 | ||
|
|
eb4e27f356 | ||
|
|
25eff603b1 | ||
|
|
2c09220992 | ||
|
|
c85abb1789 | ||
|
|
42bf45cee1 | ||
|
|
e2c593c928 | ||
|
|
d3f8b43799 | ||
|
|
9c6c9f8fcd | ||
|
|
5f607a11a9 | ||
|
|
3a2a0b1c4c | ||
|
|
f6cf0fce5c | ||
|
|
6809236f2b | ||
|
|
5c988b679e | ||
|
|
ad54620a27 | ||
|
|
4382065fad | ||
|
|
b298ce0dd0 | ||
|
|
af1432d9a8 | ||
|
|
68b0858da6 | ||
|
|
e572e41cff | ||
|
|
f133f366e2 | ||
|
|
37a4fa83fb | ||
|
|
ac73fa6482 | ||
|
|
f695a4c3b6 | ||
|
|
9c90d59fc0 | ||
|
|
dd15de6bda | ||
|
|
d98f4b5a6a | ||
|
|
ba0a3f5673 | ||
|
|
7ad4a8f0b5 | ||
|
|
e62a2145bb | ||
|
|
6d47746e5a | ||
|
|
c81a6322c1 | ||
|
|
36bc1fb617 | ||
|
|
fdd1cf4772 | ||
|
|
20156b84eb | ||
|
|
261860cfec | ||
|
|
c6fa04834c | ||
|
|
9b4f865e5d | ||
|
|
b3140b0218 | ||
|
|
4a27c8a032 | ||
|
|
faaaabb640 | ||
|
|
8b9c2fbc66 | ||
|
|
bed6a98112 | ||
|
|
5d0e8a70bb | ||
|
|
40e365b239 | ||
|
|
45894683e9 | ||
|
|
26d4841366 | ||
|
|
7fd1152dea | ||
|
|
c2187f4f17 | ||
|
|
10198da7d0 | ||
|
|
66aa7f76d8 | ||
|
|
4fb6c33182 | ||
|
|
6f8da6f3b3 | ||
|
|
398b912ca5 | ||
|
|
ffb1961064 | ||
|
|
991af2d2f0 | ||
|
|
7c5adc1bb8 | ||
|
|
2413a30578 | ||
|
|
840d327139 | ||
|
|
8ea2a50279 | ||
|
|
69a24f699d | ||
|
|
ac9dd33e9a | ||
|
|
9ebca1715b | ||
|
|
fa0e1a6363 | ||
|
|
c6b71544a4 | ||
|
|
7e94fe102c | ||
|
|
8879087461 | ||
|
|
11260dc9d7 | ||
|
|
4a7e9488dd | ||
|
|
53532f9ec2 | ||
|
|
263c27f1ea | ||
|
|
b1593177fd | ||
|
|
983479603c | ||
|
|
cbd263dafe | ||
|
|
75efe4efbb | ||
|
|
fcace76909 | ||
|
|
4fc8d5412d | ||
|
|
7a7c43c72b | ||
|
|
9c7635228f | ||
|
|
0aa95a722a | ||
|
|
35ae0bfaa2 | ||
|
|
552da2b7f2 | ||
|
|
10c80a1344 | ||
|
|
948c33ba88 | ||
|
|
ed36254fcc | ||
|
|
4b541216e3 | ||
|
|
532ec10636 | ||
|
|
01f0478750 | ||
|
|
c8d4018067 | ||
|
|
04e25c59f7 | ||
|
|
b99ce6c644 | ||
|
|
eb09c03ae1 | ||
|
|
55d7aa9142 | ||
|
|
9d20219f73 | ||
|
|
5173670675 | ||
|
|
d4a0d6f6a5 | ||
|
|
8aa0debb6e | ||
|
|
4b5fb9c99b | ||
|
|
d631657862 | ||
|
|
385729ef2a | ||
|
|
984380543e | ||
|
|
e9d17fba59 | ||
|
|
e7609d54be | ||
|
|
af8557850b | ||
|
|
3df73b303e | ||
|
|
b7e4606a73 | ||
|
|
8fc9bfc66e | ||
|
|
4b2f06a0fa | ||
|
|
77e3df17cc | ||
|
|
6cfa5ae855 | ||
|
|
7ec507dec2 | ||
|
|
fd66d44562 | ||
|
|
50ac9e5aef | ||
|
|
ac4554b8c8 | ||
|
|
2cd330b733 | ||
|
|
33db0681c8 | ||
|
|
ddd2ce19ec | ||
|
|
f1f5996447 | ||
|
|
215e66b8d6 | ||
|
|
d956ec06f2 | ||
|
|
24bbf22171 | ||
|
|
9675190c46 | ||
|
|
eef3cdf70b | ||
|
|
bdde9d0aa2 | ||
|
|
2108d66d2b | ||
|
|
1306b02625 | ||
|
|
7cb5be80be | ||
|
|
bcf2e083cc | ||
|
|
ed7d034849 | ||
|
|
f834ec6410 | ||
|
|
7ce83ed0ca | ||
|
|
f9712217d8 | ||
|
|
e54ec4b8d2 | ||
|
|
7145b24e59 | ||
|
|
2b51649f74 | ||
|
|
a0a0428b34 | ||
|
|
1ae32f0c2d | ||
|
|
afaecf4140 | ||
|
|
16add2cb7a | ||
|
|
2475dbc759 | ||
|
|
bc517aaa2a | ||
|
|
9547f33a8e | ||
|
|
8d1923852a | ||
|
|
90175ea1d8 | ||
|
|
c6f204ab79 | ||
|
|
55090ad3f8 | ||
|
|
2e9cafa7e5 | ||
|
|
c9d1212cf2 | ||
|
|
be72d3fe1b | ||
|
|
f3627d1d8d | ||
|
|
6cd12c25ee | ||
|
|
3d913d6143 | ||
|
|
f757c17b2f | ||
|
|
bf496a03cf | ||
|
|
d558e94c93 | ||
|
|
a6a0ae3e74 | ||
|
|
16f626702d | ||
|
|
bdfee70cec | ||
|
|
b6813a0898 | ||
|
|
aa55dcf8f5 | ||
|
|
d92f023f4d | ||
|
|
a51420ddc8 | ||
|
|
90dce5bec5 | ||
|
|
ef6658864a | ||
|
|
af4be723b2 | ||
|
|
d4223acfed | ||
|
|
e7a663d137 | ||
|
|
01ef5c86f1 | ||
|
|
34c712bae0 | ||
|
|
93ca6a350e | ||
|
|
008dc0c248 | ||
|
|
bfd4ad90ed | ||
|
|
06049c7753 | ||
|
|
98f4eed1d4 | ||
|
|
1baeaf9201 | ||
|
|
e2b1618571 | ||
|
|
f70be2a9a7 | ||
|
|
c1e7c349c5 | ||
|
|
692fc9d24a | ||
|
|
6b0b91474a | ||
|
|
43e6623c3d | ||
|
|
13e162eb04 | ||
|
|
05e397b330 | ||
|
|
283efd226d | ||
|
|
4be86f6c14 | ||
|
|
56107bb783 | ||
|
|
49ad4ad943 | ||
|
|
3744c31519 | ||
|
|
34c7b71a89 | ||
|
|
fcb3b7d6b9 | ||
|
|
a7851234a7 | ||
|
|
79dcd3c4cf | ||
|
|
e7605bb420 | ||
|
|
6eb3a0ff12 | ||
|
|
856dafbe36 | ||
|
|
c4ba0d56d2 | ||
|
|
998c64cc5d | ||
|
|
81586fed7d | ||
|
|
d2549b91aa | ||
|
|
5e63f36507 | ||
|
|
9f2275ec67 | ||
|
|
c23bb9ce4f | ||
|
|
339702a044 | ||
|
|
bd731f1ed3 | ||
|
|
309e5aacc1 | ||
|
|
67acb0fa9e | ||
|
|
6d7d365d3c | ||
|
|
63610854d5 | ||
|
|
827b79d6c1 | ||
|
|
b7010976f0 | ||
|
|
6faa5e5bc4 | ||
|
|
03caef107a | ||
|
|
8650dda505 | ||
|
|
35876e07b3 | ||
|
|
0cb305a4f8 | ||
|
|
17c7216ee0 | ||
|
|
5a0738d82d | ||
|
|
beed320140 | ||
|
|
97ab5eb4d4 | ||
|
|
694406816b | ||
|
|
96f815aa74 | ||
|
|
12e5f25ced | ||
|
|
3835ea2241 | ||
|
|
b5b59b7ee6 | ||
|
|
169ce6948d | ||
|
|
ed8ccb2911 | ||
|
|
b36e230373 | ||
|
|
956681d54a | ||
|
|
736588313d | ||
|
|
f660a474af | ||
|
|
c8ee823db0 | ||
|
|
39d29d68b2 | ||
|
|
842fa7a716 | ||
|
|
839512558f | ||
|
|
f142761ab8 | ||
|
|
375f71522b | ||
|
|
2fb7ff2f43 | ||
|
|
d5b75a2768 | ||
|
|
2a4f59ce8f | ||
|
|
0d29b1ef72 | ||
|
|
306918850b | ||
|
|
6695acbd23 | ||
|
|
3871b272fd | ||
|
|
a630f7cf1d | ||
|
|
98536a9d8b | ||
|
|
eb15881a94 | ||
|
|
9aea9970bb | ||
|
|
7ce609a045 | ||
|
|
8d5ade4cef | ||
|
|
8e5d7f67ef | ||
|
|
1c3f186c11 | ||
|
|
cea7bd34ca | ||
|
|
6cd646e939 | ||
|
|
e506353517 | ||
|
|
c7c6ddf6e1 | ||
|
|
0eb7973e96 | ||
|
|
1d6714eea4 | ||
|
|
5849307944 | ||
|
|
e2dd22e13f | ||
|
|
4bbff1f82d | ||
|
|
ba1e0fbf46 | ||
|
|
d78df15074 | ||
|
|
77821ecb75 | ||
|
|
8fdf6abb81 | ||
|
|
2070287f64 | ||
|
|
35382136b4 | ||
|
|
875814b68b | ||
|
|
591b6e7d59 | ||
|
|
d3a2e6852c | ||
|
|
65b0cbbfeb | ||
|
|
95122f3209 | ||
|
|
16670b2d42 | ||
|
|
6c7c785e9d | ||
|
|
14b549692e | ||
|
|
4affc10629 | ||
|
|
6b398307a3 | ||
|
|
eb8f7ccead | ||
|
|
2ed8d327b8 | ||
|
|
f7b9d75e18 | ||
|
|
5295f6e657 | ||
|
|
eaa9026f2d | ||
|
|
5360b2e876 | ||
|
|
55f12ed0bb | ||
|
|
18d55a08b3 | ||
|
|
29db4eaa2c | ||
|
|
9c9d4b2177 | ||
|
|
0c51c2b3dc | ||
|
|
6a547ff74b | ||
|
|
a21aa4991d | ||
|
|
a97cbb59e2 | ||
|
|
3ae6ab890d | ||
|
|
7bd89a17dd | ||
|
|
18a5dc440f | ||
|
|
c7050f9f93 | ||
|
|
093b043bca | ||
|
|
57a3edd204 | ||
|
|
a712b3f5f4 | ||
|
|
0ec6f5f3e9 | ||
|
|
debdc829df | ||
|
|
4214d95e6f | ||
|
|
5eaeb31845 | ||
|
|
2c92e3f983 | ||
|
|
e566262369 | ||
|
|
6ea06ad338 | ||
|
|
8fb3f4a199 | ||
|
|
e1c35b0f16 | ||
|
|
0faa05d744 | ||
|
|
82e8134fc6 | ||
|
|
70e5f19ff8 | ||
|
|
5cd68e4606 | ||
|
|
7917d26b57 | ||
|
|
0cc6d8fccf | ||
|
|
ab84d192be | ||
|
|
73bf754530 | ||
|
|
d20ee838f0 | ||
|
|
c687f71c5a | ||
|
|
8994f31b03 | ||
|
|
7a16fdbd27 | ||
|
|
4978b31363 | ||
|
|
20a2136350 | ||
|
|
2dfed948a1 | ||
|
|
8b5cb40c24 | ||
|
|
1d819f780c | ||
|
|
296bc367dc | ||
|
|
794f365e4e | ||
|
|
d9afe5c129 | ||
|
|
6c44faecfd | ||
|
|
544be4d557 | ||
|
|
9a2babf4b6 | ||
|
|
b89acbbc31 | ||
|
|
b37cbba31d | ||
|
|
562fa5b78f | ||
|
|
1fcbd36e6d | ||
|
|
7be4d4640a | ||
|
|
7802d1e61c | ||
|
|
65029af613 | ||
|
|
f600d3e481 | ||
|
|
ada8f84019 | ||
|
|
73cac507ad | ||
|
|
063c192a12 | ||
|
|
b2576fd44f | ||
|
|
48c8f7c55b | ||
|
|
b05115978c | ||
|
|
bb74381c49 | ||
|
|
dc8e2ab453 | ||
|
|
c71f17295c | ||
|
|
4033a44b95 | ||
|
|
6f533a3d8a | ||
|
|
1bfe97474f | ||
|
|
ae6d79eae3 | ||
|
|
71a5313fc5 | ||
|
|
7daca337be | ||
|
|
da497ecb88 | ||
|
|
655a3126a2 | ||
|
|
ae0519643e | ||
|
|
f01f0ff5e0 | ||
|
|
8e64a1c73f | ||
|
|
c4fc154089 | ||
|
|
de38a0eca4 | ||
|
|
da85b57c61 | ||
|
|
514996363e | ||
|
|
4e4a4036cf | ||
|
|
680e256d17 | ||
|
|
a50d3f2029 | ||
|
|
8c761c73ad | ||
|
|
f8721992dd | ||
|
|
525bb0ed7e | ||
|
|
fe18a0e9b1 | ||
|
|
ec46829b38 | ||
|
|
03d440e1c0 | ||
|
|
a412c510d4 | ||
|
|
ac07cbb0ca | ||
|
|
ce2ae19703 | ||
|
|
ca8772a059 | ||
|
|
23a44e86ce | ||
|
|
5c5c577359 | ||
|
|
15675d6f49 | ||
|
|
4cb293e5a1 | ||
|
|
c3e88c6d59 | ||
|
|
d39471b761 | ||
|
|
ddcf71c483 | ||
|
|
28624bb7f6 | ||
|
|
d74b967c9e | ||
|
|
cdb8029c39 | ||
|
|
8ef253d9dc | ||
|
|
d91ac3b7b8 | ||
|
|
08f7cfae71 | ||
|
|
dd734b5a5d | ||
|
|
d8b14bd700 | ||
|
|
4e395f36af | ||
|
|
b9ad07ca0b | ||
|
|
6497cc956c | ||
|
|
ee3e6f12ae | ||
|
|
4f7f46d0b8 | ||
|
|
991ca2274f | ||
|
|
b72ea915ab | ||
|
|
055f1f483e | ||
|
|
a493c51949 | ||
|
|
45cb9dc7b1 | ||
|
|
45f5605f38 | ||
|
|
6c3558c2ac | ||
|
|
0dd36fd9f5 | ||
|
|
d07f529652 | ||
|
|
cb6d34ee25 | ||
|
|
00cc762934 | ||
|
|
409f64d09d | ||
|
|
5367710045 | ||
|
|
e5343487ac | ||
|
|
f0e94729bf | ||
|
|
673dee58ad | ||
|
|
9b16b3d7b8 | ||
|
|
51a711b609 | ||
|
|
022e5db8ec | ||
|
|
a29eb8c1d2 | ||
|
|
c16bb3d7c9 | ||
|
|
aaba243f41 | ||
|
|
41226129d7 | ||
|
|
17384705d3 | ||
|
|
5e489050e1 | ||
|
|
4100b87e38 | ||
|
|
5f6f1ab107 | ||
|
|
de713235ed | ||
|
|
6e2cd3fcfe | ||
|
|
b686c05f3b | ||
|
|
174f00fe03 | ||
|
|
4f1947c729 | ||
|
|
50c811c210 | ||
|
|
614614c89e | ||
|
|
4de8da30d0 | ||
|
|
2e23a75ff4 | ||
|
|
02a5c36cb9 |
No files matched your search
@@ -0,0 +1,285 @@
|
||||
define dump_bt
|
||||
set $t = $arg0
|
||||
while $t
|
||||
printf "[0x%08x] ", $t
|
||||
if $t->function_state.function->common.function_name
|
||||
printf "%s() ", $t->function_state.function->common.function_name
|
||||
else
|
||||
printf "??? "
|
||||
end
|
||||
if $t->op_array != 0
|
||||
printf "%s:%d ", $t->op_array->filename, $t->opline->lineno
|
||||
end
|
||||
set $t = $t->prev_execute_data
|
||||
printf "\n"
|
||||
end
|
||||
end
|
||||
|
||||
document dump_bt
|
||||
dumps the current execution stack. usage: dump_bt executor_globals.current_execute_data
|
||||
end
|
||||
|
||||
define printzv
|
||||
set $ind = 0
|
||||
____printzv $arg0 0
|
||||
end
|
||||
|
||||
document printzv
|
||||
prints content of zval
|
||||
end
|
||||
|
||||
define ____printzv
|
||||
set $zvalue = $arg0
|
||||
|
||||
if $zvalue->type == 0
|
||||
set $typename = "NULL"
|
||||
end
|
||||
if $zvalue->type == 1
|
||||
set $typename = "long"
|
||||
end
|
||||
if $zvalue->type == 2
|
||||
set $typename = "double"
|
||||
end
|
||||
if $zvalue->type == 3
|
||||
set $typename = "string"
|
||||
end
|
||||
if $zvalue->type == 4
|
||||
set $typename = "array"
|
||||
end
|
||||
if $zvalue->type == 5
|
||||
set $typename = "object"
|
||||
end
|
||||
if $zvalue->type == 6
|
||||
set $typename = "bool"
|
||||
end
|
||||
if $zvalue->type == 7
|
||||
set $typename = "resource"
|
||||
end
|
||||
if $zvalue->type == 8
|
||||
set $typename = "constant"
|
||||
end
|
||||
if $zvalue->type == 9
|
||||
set $typename = "const_array"
|
||||
end
|
||||
|
||||
printf "[0x%08x] ", $zvalue
|
||||
|
||||
if $zvalue == executor_globals.uninitialized_zval_ptr
|
||||
printf "*uninitialized* "
|
||||
end
|
||||
printf "(refcount=%d) %s: ", $zvalue->refcount, $typename
|
||||
if $zvalue->type == 1
|
||||
printf "%ld", $zvalue->value.lval
|
||||
end
|
||||
if $zvalue->type == 2
|
||||
printf "%lf", $zvalue->value.dval
|
||||
end
|
||||
if $zvalue->type == 3
|
||||
printf "\"%s\"(%d)", $zvalue->value.str.val, $zvalue->value.str.len
|
||||
end
|
||||
if $zvalue->type == 4
|
||||
if ! $arg1
|
||||
printf "{\n"
|
||||
set $ind = $ind + 1
|
||||
____print_ht $zvalue->value.ht
|
||||
set $ind = $ind - 1
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
printf " "
|
||||
set $i = $i - 1
|
||||
end
|
||||
printf "}"
|
||||
end
|
||||
end
|
||||
if $zvalue->type == 5
|
||||
if ! $arg1
|
||||
printf "(prop examination disabled due to a gdb bug)"
|
||||
# set $ht = $zvalue->value.obj.handlers->get_properties($zvalue)
|
||||
# printf "{\n"
|
||||
# set $ind = $ind + 1
|
||||
# ____print_ht $ht
|
||||
# set $ind = $ind - 1
|
||||
# set $i = $ind
|
||||
# while $i > 0
|
||||
# printf " "
|
||||
# set $i = $i - 1
|
||||
# end
|
||||
# printf "}"
|
||||
end
|
||||
end
|
||||
if $zvalue->type == 6
|
||||
if $zvalue->lval
|
||||
printf "true"
|
||||
else
|
||||
printf "false"
|
||||
end
|
||||
end
|
||||
if $zvalue->type == 7
|
||||
printf "#%d", $zvalue->value.lval
|
||||
end
|
||||
printf "\n"
|
||||
end
|
||||
|
||||
define ____print_ht
|
||||
set $ht = $arg0
|
||||
set $p = $ht->pListHead
|
||||
|
||||
while $p != 0
|
||||
set $zval = *(struct _zval_struct **)$p->pData
|
||||
|
||||
set $i = $ind
|
||||
while $i > 0
|
||||
printf " "
|
||||
set $i = $i - 1
|
||||
end
|
||||
|
||||
if $p->nKeyLength > 0
|
||||
printf "\"%s\" => ", $p->arKey
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
____printzv $zval 1
|
||||
set $p = $p->pListNext
|
||||
end
|
||||
end
|
||||
|
||||
define print_ht
|
||||
set $ind = 1
|
||||
printf "[0x%08x] {\n", $arg0
|
||||
____print_ht $arg0
|
||||
printf "}\n"
|
||||
end
|
||||
|
||||
document print_ht
|
||||
dumps elements of HashTable made of zval
|
||||
end
|
||||
|
||||
define printzn
|
||||
set $ind = 0
|
||||
set $znode = $arg0
|
||||
if $znode->op_type == 1
|
||||
set $optype = "IS_CONST"
|
||||
end
|
||||
if $znode->op_type == 2
|
||||
set $optype = "IS_TMP_VAR"
|
||||
end
|
||||
if $znode->op_type == 4
|
||||
set $optype = "IS_VAR"
|
||||
end
|
||||
if $znode->op_type == 8
|
||||
set $optype = "IS_UNUSED"
|
||||
end
|
||||
|
||||
printf "[0x%08x] %s", $znode, $optype
|
||||
|
||||
if $znode->op_type == 1
|
||||
printf ": "
|
||||
____printzv &$znode->u.constant
|
||||
end
|
||||
if $znode->op_type == 2
|
||||
printf ": "
|
||||
set $tvar = (union _temp_variable *)((char *)executor_globals.current_execute_data->Ts + $znode->u.var)
|
||||
____printzv ((union _temp_variable *)$tvar)->tmp_var
|
||||
end
|
||||
if $znode->op_type == 4
|
||||
printf ": "
|
||||
set $tvar = (union _temp_variable *)((char *)executor_globals.current_execute_data->Ts + $znode->u.var)
|
||||
____printzv *$tvar->var.ptr_ptr
|
||||
end
|
||||
if $znode->op_type == 8
|
||||
printf "\n"
|
||||
end
|
||||
end
|
||||
|
||||
document printzn
|
||||
print type and content of znode.
|
||||
usage: printzn &opline->op1
|
||||
end
|
||||
|
||||
define printzops
|
||||
printf "op1 => "
|
||||
printzn &execute_data->opline.op1
|
||||
printf "op2 => "
|
||||
printzn &execute_data->opline.op2
|
||||
printf "result => "
|
||||
printzn &execute_data->opline.result
|
||||
end
|
||||
|
||||
document printzops
|
||||
dump operands of the current opline
|
||||
end
|
||||
|
||||
define zmemcheck
|
||||
set $p = alloc_globals.head
|
||||
set $stat = "?"
|
||||
set $total_size = 0
|
||||
if $arg0 != 0
|
||||
set $not_found = 1
|
||||
else
|
||||
set $not_found = 0
|
||||
end
|
||||
printf " block size status file:line\n"
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
while $p
|
||||
set $aptr = $p + sizeof(struct _zend_mem_header) + sizeof(align_test)
|
||||
if $arg0 == 0 || (void *)$aptr == (void *)$arg0
|
||||
if $p->magic == 0x7312f8dc
|
||||
set $stat = "OK"
|
||||
end
|
||||
if $p->magic == 0x99954317
|
||||
set $stat = "FREED"
|
||||
end
|
||||
if $p->magic == 0xfb8277dc
|
||||
set $stat = "CACHED"
|
||||
end
|
||||
set $filename = strrchr($p->filename, '/')
|
||||
if !$filename
|
||||
set $filename = $p->filename
|
||||
else
|
||||
set $filename = $filename + 1
|
||||
end
|
||||
printf " 0x%08x ", $aptr
|
||||
if $p->size == sizeof(struct _zval_struct) && ((struct _zval_struct *)$aptr)->type >= 0 && ((struct _zval_struct *)$aptr)->type < 10
|
||||
printf "ZVAL?(%-2d) ", $p->size
|
||||
else
|
||||
printf "%-9d ", $p->size
|
||||
end
|
||||
set $total_size = $total_size + $p->size
|
||||
printf "%-06s %s:%d", $stat, $filename, $p->lineno
|
||||
if $p->orig_filename
|
||||
set $orig_filename = strrchr($p->orig_filename, '/')
|
||||
if !$orig_filename
|
||||
set $orig_filename = $p->orig_filename
|
||||
else
|
||||
set $orig_filename = $orig_filename + 1
|
||||
end
|
||||
printf " <= %s:%d\n", $orig_filename, $p->orig_lineno
|
||||
else
|
||||
printf "\n"
|
||||
end
|
||||
if $arg0 != 0
|
||||
set $p = 0
|
||||
set $not_found = 0
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
else
|
||||
set $p = $p->pNext
|
||||
end
|
||||
end
|
||||
if $not_found
|
||||
printf "no such block that begins at 0x%08x.\n", $aptr
|
||||
end
|
||||
if $arg0 == 0
|
||||
printf "-------------------------------------------------------------------------------\n"
|
||||
printf " total: %d bytes\n", $total_size
|
||||
end
|
||||
end
|
||||
|
||||
document zmemcheck
|
||||
show status of a memory block.
|
||||
usage: zmemcheck [ptr].
|
||||
if ptr is 0, all blocks will be listed.
|
||||
end
|
||||
|
||||
@@ -8,6 +8,11 @@ up to date instructions in the online manual, located here:
|
||||
|
||||
http://www.php.net/manual/en/install.apache.php
|
||||
|
||||
For Apache 2, instructions and up-to-date information regarding it's
|
||||
support status, is available here:
|
||||
|
||||
http://www.php.net/manual/en/install.apache2.php
|
||||
|
||||
It is strongly recommended that you read the manual page before going
|
||||
further. However, for the impatient, here is a quick set of steps that
|
||||
will build PHP as (first) a dynamic Apache module (DSO) for Apache 1.3.x
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
|
||||
#
|
||||
# Zend
|
||||
#
|
||||
|
||||
$(builddir)/zend_language_scanner.lo: $(builddir)/zend_language_parser.h
|
||||
$(builddir)/zend_ini_scanner.lo: $(builddir)/zend_ini_parser.h
|
||||
|
||||
|
||||
+3
-3
@@ -37,7 +37,7 @@ install-modules: build-modules
|
||||
$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) && \
|
||||
echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/" && \
|
||||
rm -f modules/*.la && \
|
||||
cp modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) >/dev/null 2>&1 || true
|
||||
$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) >/dev/null 2>&1 || true
|
||||
|
||||
install-tester:
|
||||
@echo "Installing regression tester: $(INSTALL_ROOT)$(PEAR_INSTALLDIR)/"
|
||||
@@ -49,8 +49,8 @@ install-su: install-pear install-tester
|
||||
test: $(SAPI_CLI_PATH)
|
||||
@TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC=$(CC) \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' $(top_srcdir)/run-tests.php $(TESTS)
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' $(top_srcdir)/run-tests.php $(TESTS)
|
||||
|
||||
clean:
|
||||
find . -name \*.lo -o -name \*.o | xargs rm -f
|
||||
|
||||
@@ -1,22 +1,234 @@
|
||||
PHP 4 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
? ? ??? 2002, Version 4.3.0
|
||||
- Aliased dba_popen() to dba_open() until 4.3.1 when persistent STDIO streams
|
||||
are introduced. (Andrei)
|
||||
- Fixed a security bug in the bundled MySQL library. (Georg, Stefan)
|
||||
- ATTENTION! "make install" will *by default* install the CLI SAPI binary in
|
||||
{PREFIX}/bin/php. If you don't disable the CGI binary, it will be
|
||||
installed as {PREFIX}/bin/php-cgi.
|
||||
?? Apr 2003, Version 4.3.2
|
||||
- Replaced the old Apache2 module (sapi/apache2filter) with new and improved
|
||||
version (sapi/apache2handler). (Ian Holsman, Justin Erenkrantz)
|
||||
- Syncronized bundled GD library with GD 2.0.12. (Ilia)
|
||||
- Removed support for GDLIB version 1.x.x (php_gd.dll) on Windows. (Edin)
|
||||
- Enabled read-only GIF support in the bundled GDLIB (php_gd2.dll) on Windows.
|
||||
(Sebastian, Edin)
|
||||
- Improved dba extension (Marcus)
|
||||
. Added support for internal error handling of Berkeley db libraries.
|
||||
. Disallow Berkeley db versions 4.1.0 to 4.1.24 due to locking problems.
|
||||
. Disallow linkage of Berkeley db submodules against libraries with
|
||||
different major version.
|
||||
. Disallow configuring of more than one Berkeley db handler.
|
||||
. Reenabled dba_popen() with new persistent STDIO streams.
|
||||
- Added "disable_classes" php.ini option to allow administrators to disable
|
||||
certain classes for security reasons. (Harald)
|
||||
- Added man page for CLI version of PHP. (Marcus)
|
||||
- Added --clean option into phpize. (Jani)
|
||||
- Added --ldflags option into php-config. (Jani)
|
||||
- Added imagesavealpha() and imageistruecolor() functions. (Pierre)
|
||||
- Added XBM support for bundled GD library. (Marcus)
|
||||
- Added session_regenerate_id() function. (Sascha)
|
||||
- Added zlib_get_coding_type() function which returns the coding type used for
|
||||
output compression. (Moriyoshi)
|
||||
- Added OCIPasswordChange() which allows renewing expired Oracle users. (Maxim)
|
||||
- Added memory_get_usage(). Only available when PHP is configured with
|
||||
--enable-memory-limit. (Andrey)
|
||||
- Added improved JPEG 2000 support for getimagesize(). (Marcus, Adam Wright)
|
||||
- Added XBM and WBMP support for getimagesize(). (Marcus)
|
||||
- Added KOI8-R, CP866, and CP1251 support for htmlentities(). (Antony Dovgal, Moriyoshi)
|
||||
- Added domdocument->free() to free XML-documents from memory. (Rob Richards)
|
||||
- Fixed a lot of memory leaks in domxml. (Rob Richards, Chregu)
|
||||
- Fixed a bug in GD's truecolor TTF handling. (Derick)
|
||||
- Fixed several 64-bit problems. (Dave)
|
||||
- Fixed several errors in hwapi extension. Objects weren't handled properly. (Uwe)
|
||||
- Fixed bug #23340 (fopen on multiple URLs causes memory corruption). (Wez)
|
||||
- Fixed bug #23232 (safe_mode does not honor PHP_AUTH_* in apache2) (Ilia)
|
||||
- Fixed bug #23225 (money_format() didn't handle erroneous return of strfmon).
|
||||
(Ilia, marcot@tabini.ca)
|
||||
- Fixed bug #23201 (set_file_buffer() crashes with stdio streams). (Ilia)
|
||||
- Fixed Bug #23188 (CDB databases created with 'c' mode do not work). (Marcus)
|
||||
- Fixed bug #23187 (memory leaks in sybase_connect/sybase_pconnect). (Ilia)
|
||||
- Fixed bug #23152 ($http_response_header empty on invalid URLs) (Ilia)
|
||||
- Fixed bug #23102 (integer overflow in exif_iif_add_value()). (Ilia)
|
||||
- Fixed bug #23099 (ext/interbase: "libgds.so: undefined reference to 'crypt'"). (Jani)
|
||||
- Fixed bug #23093 (highlight_string() crashed with __FUNCTION__). (Jani)
|
||||
- Fixed bug #23080 (socket_strerror() crashes on win32). (Moriyoshi)
|
||||
- Fixed bug #23071 (when DST in effect, date("T") crashed PHP). (Scott MacVicar, Jani)
|
||||
- Fixed bug #23069 (tempnam creates readonly file [win32]). (Wez)
|
||||
- Fixed bug #23009 (pg_select with timestamp). (Marcus, Jay)
|
||||
- Fixed bug #23008 (ldap_start_tls() not available on Windows). (Edin)
|
||||
- Fixed bug #23004 (When ftp_close() is called, send QUIT to the ftp server). (Ilia)
|
||||
- Fixed bug #22989 (sendmail not found by configure). (igyu@ionsphere.org)
|
||||
- Fixed bug #22987 (missing perror() check in configure). (Jani)
|
||||
- Fixed bug #22965 (Crash in gd lib's ImageFillToBorder()). (Ilia)
|
||||
- Fixed bug #22939 (crash in imap_header_info()). (Ilia)
|
||||
- Fixed bug #22844 (Changing bool value via -d or ini_set(), On would be Off). (Ilia)
|
||||
- Fixed bug #22786 (Crash when trying to call DomAttribute's set_namespace method). (Chregu)
|
||||
- Fixed bug #22775 (Fatal errors exit with status 0 with CGI/CLI). (Jani)
|
||||
- Fixed bug #22774 (PHP crashes when exiting (long XML doc)). (Rob Richards)
|
||||
- Fixed bug #22751 (Compile error in gdcache.c when external libgd is used). (Jani)
|
||||
- Fixed bug #22721 (Poor file() performance on systems without mmap). (Wez)
|
||||
- Fixed bug #22709 (Crash in interbase when database unavailable). (Vladimir Michl)
|
||||
- Fixed bug #22681 (Crash when reading from invalid file pointer). (Ilia)
|
||||
- Fixed bug #22672 (User not logged under Apache2). (Ian)
|
||||
- Fixed bug #22616 (Wrong order of -lssl and -lcrypto with IMAP). (Jani)
|
||||
- Fixed bug #22613 (imagettfbox() does not add the kerning distance to the
|
||||
running position). (Ilia)
|
||||
- Fixed bug #22585 (Do not terminate the script on minor errors). (Ilia)
|
||||
- Fixed bug #22550 (overflow protection for upload_max_filesize ini option). (Ilia)
|
||||
- Fixed bug #22544 (writing transparency to truecolor png images). (Ilia)
|
||||
- Fixed bug #22538 (failed stat on stdio/stdin/stderr streams). (Wez, Ilia)
|
||||
- Fixed bug #22530 (append_child does not unlink node). (Chregu)
|
||||
- Fixed bug #22520 (mcrypt_generic_deinit() was not available on Windows). (Edin)
|
||||
- Fixed bug #22508 (Added protection against circular HTML redirects). (Ilia)
|
||||
- Fixed bug #22473 (ISAPI Secure Server variables not available). (Christian Swoboda)
|
||||
- Fixed bug #22402 (opening of ftp for read/write could fail due to invalid
|
||||
return code handling). (Ilia)
|
||||
- Fixed bug #22384 (FNM_CASEFOLD is not available). (Hartmut)
|
||||
- Fixed bug #22382 (fgetcsv() did not handle \" correctly). (Ilia)
|
||||
- Fixed bug #22376 (wrong httpd.conf modified when using INSTALL_ROOT). (Jani)
|
||||
- Fixed bug #22363 (combinations of fwrite(), fread() and fseek() produce
|
||||
unexpected results). (Wez)
|
||||
- Fixed bug #22355 (PHP would remove folding from Subject & To fields). (Ilia)
|
||||
- Fixed bug #22330 (overloaded strrpos() gives wrong results).
|
||||
(david@santinoli.com, Moriyoshi)
|
||||
- Fixed bug #22312 (crash on failed connection when curl_getinfo() was called).
|
||||
(Phil Oleson <poleson@verio.net>)
|
||||
- Fixed bug #22308 (optimized passthru, code is now ~40 times faster). (Ilia)
|
||||
- Fixed bug #22306 (pg_lo_seek($h, 0, PGSQL_SEEK_SET) succeeds but returns false).
|
||||
(Jani)
|
||||
- Fixed bug #22301 (htmlspecialchars() crashes Apache on Tru64). (Ilia)
|
||||
- Fixed bug #22299 (gethostbyname() with non-existing domain crashed on MacOSX).
|
||||
(Jani)
|
||||
- Fixed bug #22283 (possible crash when opening relative URLs). (Ilia)
|
||||
- Fixed bug #22234 (copy() fails if source file has 0 length). (Moriyoshi)
|
||||
- Fixed bug #22227 (printf() field limiters broke between 4.2.3 and 4.3.0).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #22224 (implode() changes object references in array). (Moriyoshi)
|
||||
- Fixed bug #22221 (bad rows count in the result object for postgresql). (Marc)
|
||||
- Fixed bug #22207 (e notation in *printf would be missing a 0 when there is
|
||||
no exponent). (Ilia)
|
||||
- Fixed bug #22220 ("php_admin_value open_basedir none" does not work). (Jani)
|
||||
- Fixed bug #22191 (frontbase build broken with old version of frontbase). (Ilia)
|
||||
- Fixed bug #22187 (spprintf function did not handle floats correctly). (Ilia)
|
||||
- Fixed bug #22149 (incorrect insertion of session id when tabs are used to
|
||||
separate tag elements). (Ilia)
|
||||
- Fixed bug #22141 (removed undocumented Boyer str_replace() method). (Sara)
|
||||
- Fixed bug #22103 (Added gdImageEllipse and replaced old gdImageFilledEllipse
|
||||
with a better implementation). (Pierre)
|
||||
- Fixed bug #22088 (array_shift() left next index to be +1 too much). (Jani)
|
||||
- Fixed bug #22083 (MySQL charset directory problem on Windows). (Edin)
|
||||
- Fixed bug #22059 (ftp_chdir() causes segfault). (Sara)
|
||||
- Fixed bug #22048 (crash in imap_header() when the e-mail contains an
|
||||
abnormally large number of special characters). (Ilia)
|
||||
- Fixed bug #22042 (pg_result_seek() would never seek to the 1st row in the
|
||||
result due to always seeking to row next to the one requested). (Ilia)
|
||||
- Fixed bug #22031 (Made curl_write() & curl_write_header() binary safe). (Ilia)
|
||||
- Fixed bug #22022 (Crash in imap_mail_compose() if the body is an empty array).
|
||||
(Ilia)
|
||||
- Fixed bug #22017 (date() does not support negative timestamps on win32). (Ilia)
|
||||
- Fixed bug #22004 (Overload extension and _call() breaks classes). (Shane)
|
||||
- Fixed bug #21998 (array_pop() did not reset the current array position). (Jani)
|
||||
- Fixed bug #21978, #21036 (win32 mail(), bcc: gets interpreted as cc:). (Sara)
|
||||
- Fixed bug #21885 (move_uploaded_file() does not ignore open_basedir). (Wez)
|
||||
- Fixed bug #21820 ("$arr['foo']" generates bogus E_NOTICE, should be E_PARSE). (Jani)
|
||||
- Fixed bug #21815 (fpassthru() ignored buffered data but complained anyway).
|
||||
(Wez)
|
||||
- Fixed bug #21809 (select would not always timeout during socket shutdown). (Wez)
|
||||
- Fixed bug #21751 (default output buffer could not be deleted). (Marcus)
|
||||
- Fixed bug #21725 (return behaviour differs between include and require). (Zeev)
|
||||
- Fixed bug #21713 (include remote files leaks descriptors on Solaris). (Wez)
|
||||
- Fixed bug #21708 (ucwords() trouble again). (Moriyoshi)
|
||||
- Fixed bug #21689 (fgetcsv() suppresses some characters before a separator).
|
||||
(Masahiro, Moriyoshi)
|
||||
- Fixed bug #21912, #21676 (GetImageSize() failed for remote files). (Wez)
|
||||
- Fixed bug #21597 (made glob() understand Windows paths). (Edin)
|
||||
- Fixed bug #21549 (problem with Ingres II persistent connections). (Jani)
|
||||
- Fixed bug #21544 (Extended checks for where FreeTDS is installed). (Frank)
|
||||
- Fixed bug #21534 (typo in gmp_gcdext() causes incorrect results). (Sara)
|
||||
- Fixed bug #21531 (file_exists() and other filestat functions report errors
|
||||
when the requested file/directory does not exists). (Sara)
|
||||
- Fixed bug #21529 (memory corruption by fsockopen()). (Ilia)
|
||||
- Fixed bug #21525 (bind_textdomain_codeset() now available on Windows). (Edin)
|
||||
- Fixed bug #21523 (number_format() could cause a memory allocation for a
|
||||
negative memory size in situations where the sprintf implementation of the
|
||||
host system generated less decimal places than were requested). (Wez)
|
||||
- Fixed bug #21518 (imagecreatefromstring() crashed with invalid image files).
|
||||
(Ilia)
|
||||
- Fixed bug #21511 (config.status warning). (Jani)
|
||||
- Fixed bug #21498 (mysql_pconnect connection problems). (Georg)
|
||||
- Fixed bug #21453 (improper handling of non-terminated < by strip_tags()).
|
||||
(Ilia)
|
||||
- Fixed bug #21445 (gd unable to open fonts). (Ilia)
|
||||
- Fixed bug #21443 (improper handling of ? surrounded by spaces in
|
||||
get_browser()). (Ilia)
|
||||
- Fixed bug #21442 (crash in mail() on Windows when 1st parameter is empty).
|
||||
(Edin)
|
||||
- Fixed bug #21410 (fixed handling of NULL or "" files on Win32). (Ilia)
|
||||
- Fixed bug #21378 (COM code crashes after update 4.2.1 to 4.3.0). (Harald)
|
||||
- Fixed bug #21338 (html_entity_decode() crashed when "" is passed). (Ilia)
|
||||
- Fixed bug #21310 (Solaris has issues with getcwd() needing read permissions
|
||||
on directories instead of just execute). (Wez, jflemer)
|
||||
- Fixed bug #21297 (in CLI/CGI sapis on the #! it would leave a \n when the
|
||||
the code encounters \r\n). (Ilia)
|
||||
- Fixed bug #21268 (session_decode() returned FALSE on success). (Ilia)
|
||||
- Fixed bug #21267 (opening URLs that result in redirection to a relative
|
||||
path was failing). (Ilia)
|
||||
- Fixed bug #21229 (missing 3rd argument to php_module_startup). (Ilia)
|
||||
- Fixed bug #21228 (broken check for ob_gzhandler and made ob_start() return
|
||||
the correct value). (Ilia)
|
||||
- Fixed bug #21226 (parse_url handling of urls without a path). (Ilia)
|
||||
- Fixed bug #21224 (apache configure fails when using --enable-versioning). (Jani)
|
||||
- Fixed bug #21169 (Compile Failure and lots of warnings on UnixWare). (Derick)
|
||||
- Fixed bug #21131 (fopen() with mode 'a+' and rewind() doesn't work). (Wez)
|
||||
- Fixed bug #20857 (snmpset() failed always, patch by: rs@epost.de). (Jani)
|
||||
- Fixed bug #20802 (PHP would die silently when memory limit reached). (Ilia)
|
||||
- Fixed bug #20715 (odbc could not be compiled as shared extension). (Jani)
|
||||
- Fixed bug #20641 (Numeric/decimal datatype overflow in the Interbase module
|
||||
on Win32). (Daniela)
|
||||
- Fixed bug #20503 (imagesetbrush() not available on Windows). (Edin)
|
||||
- Fixed bug #20282 (COM memory leak). (Harald)
|
||||
- Fixed bug #20256 (snprintf() not defined on some systems). (Jani)
|
||||
- Fixed bug #19919 (crash in sapi_apache_header_handler under heavy load).
|
||||
(George)
|
||||
- Fixed bug #19795 (Problems with strnatcmp() / strnatcasecmp()). (Moriyoshi)
|
||||
- Fixed bug #17868 (multiple <!--include--> used to include PHP files crashes).
|
||||
(Ilia)
|
||||
- Fixed bug #17448 (Print the message when OCI_SUCCESS_WITH_INFO is returned).
|
||||
(Maxim)
|
||||
- Fixed bug #17098 (make Apache2 aware that PHP scripts should not be cached).
|
||||
(Ilia)
|
||||
- Fixed bug #16798 (Compile failure with LOB support for Oracle version < 8.1).
|
||||
(Maxim)
|
||||
- Fixed bug #14532 (fixed connection_status() to return 2 for timeouts). (Jani)
|
||||
- Fixed bug #14245 ('make install' fails on AIX when using --with-apxs). (Jani)
|
||||
- Fixed bug #13561 (--without-pear disabled phpize/php-config install). (Jani)
|
||||
- Fixed bug #13551 (bcmath functions applying scale incorrectly). (Sara)
|
||||
|
||||
17 Feb 2003, Version 4.3.1
|
||||
- Fixed serious security vulnerability in CGI SAPI. (Shane)
|
||||
|
||||
27 Dec 2002, Version 4.3.0
|
||||
- If you don't specify building any other SAPI "make install" will install the
|
||||
CGI SAPI binary in {PREFIX}/bin/php. If you want to install CLI SAPI in that
|
||||
location use "make install-cli" after "make install" or add --disable-cgi
|
||||
to your configure options. In the Windows distribution CLI SAPI is included
|
||||
in the "cli" folder. (Edin)
|
||||
- Removed extensions: (Jan, Jani, Sebastian)
|
||||
. ext/aspell
|
||||
. ext/ccvs
|
||||
. ext/cybercash
|
||||
. ext/icap
|
||||
. sapi/fastcgi
|
||||
. sapi/fhttpd
|
||||
- Moved extensions to PECL (http://pear.php.net/): (James, Derick)
|
||||
- Moved extensions to PECL (http://pear.php.net/): (James, Derick, George)
|
||||
. ext/vpopmail
|
||||
. ext/cybermut
|
||||
. ext/cybercash
|
||||
- Make PHP_AUTH_* variables not available in safe mode under Apache when an
|
||||
external basic auth mechanism is used. (Philip)
|
||||
- Aliased dba_popen() to dba_open() until 4.3.2 when persistent STDIO streams
|
||||
are introduced. (Andrei)
|
||||
- Fixed a security bug in the bundled MySQL library. (Georg, Stefan)
|
||||
- ZLIB extension is now built-in in the Windows distribution.
|
||||
External extension (php_zlib.dll) has been removed. (Edin)
|
||||
- Fixed a bug in ISO-8601 week calculation
|
||||
- Fixed a crash when using invalid color index with imagecolortransparent().
|
||||
(Pierre-Alain Joye)
|
||||
- Fixed bug #20987 (no handling for client certificates). (Ilia)
|
||||
- Fixed bug #21039 (crash when not supplying an IV to mcrypt_generic_init).
|
||||
(Derick)
|
||||
- Fixed bug #20936 (openssl_pkey_get was broken). (jeroen@derks.it, Wez)
|
||||
@@ -32,7 +244,7 @@ PHP 4 NEWS
|
||||
true-color image). (Ilia)
|
||||
- Fixed a crash when converting between true-color images (png/jpeg) and
|
||||
gd1/gd2 image formats, png/jpeg -> gd1/gd2 -> png/jpeg conversion now
|
||||
works correctly. (Ilia, (Pierre-Alain Joye).
|
||||
works correctly. (Ilia, Pierre-Alain Joye)
|
||||
- Fixed a memory leak in the bundled GD library inside
|
||||
gdImageTrueColorToPalette(). (Ilia)
|
||||
- Fixed bug #12776 (array_walk crash). (Moriyoshi)
|
||||
@@ -91,7 +303,7 @@ PHP 4 NEWS
|
||||
(Sterling)
|
||||
- Remove $_FILES from $_REQUEST (import_request_variables is not modified),
|
||||
this didn't work properly in the first place, and added confusion. (Sterling)
|
||||
- Fix the socket_read() function on win32 to work in normal mode (reading to
|
||||
- Fixed the socket_read() function on win32 to work in normal mode (reading to
|
||||
the end of a line), as well as binary mode. (Sterling)
|
||||
- Fixed bug #20110 (added sanity check to prevent include/require functions
|
||||
from trying to include directories). (Ilia)
|
||||
@@ -274,8 +486,6 @@ PHP 4 NEWS
|
||||
- Made mime_magic and ZIP extensions available on Windows. (Edin)
|
||||
- Added xslt_backend_version() and xslt_backend_name() for getting
|
||||
information about the processor backend. (chregu)
|
||||
- Added php.ini option "allow_webdav_methods" to allow handling of
|
||||
WebDAV http requests within PHP scripts. (chregu)
|
||||
- Added ImageColorMatch() and ImageLayerEffect() functions which are only
|
||||
available when using the bundled GD library. (ttoohey)
|
||||
- Made major improvents to the pcntl extension. (Jason)
|
||||
@@ -376,8 +586,6 @@ PHP 4 NEWS
|
||||
- Added preliminary SAX-Input support. It's now possible to build a DomDocument
|
||||
with SAX-Events. (chregu)
|
||||
- Bundled GD library 2.0.1 with php (ext/gd/libgd) (Rasmus, Jani, Markus, Edin)
|
||||
- Fixed bug with Apache which let PHP_AUTH_* variables to be set when
|
||||
external basic auth mechanism was used. (Jani)
|
||||
- Fixed bzopen() crash in thread-safe mode. (Andrei)
|
||||
- Added better error-messages (3rd parameter) and validating of DTDs (2nd
|
||||
parameter) to domxml_open_mem() and domxml_open_file(). (Christian)
|
||||
|
||||
@@ -43,7 +43,6 @@ global
|
||||
(DONE ?)
|
||||
* Use arg_separator.input to implode args in the CGI sapi extension
|
||||
and arg_separator.input to explode in php_build_argv(). (DONE?)
|
||||
* Implement flush feature suitable for nested output buffers.
|
||||
|
||||
For PHP 5.0.0
|
||||
* bundle and use curl lib for fopen wrapper.
|
||||
@@ -67,6 +66,7 @@ global
|
||||
* find a better way to implement script timeouts. SIGVTALRM is used
|
||||
by some POSIX threads implementations (i.e. OpenBSD) and is not
|
||||
available in ZTS mode.
|
||||
* Implement flush feature suitable for nested output buffers.
|
||||
|
||||
|
||||
documentation
|
||||
@@ -158,7 +158,6 @@ ext/standard
|
||||
basename()
|
||||
dirname()
|
||||
strrpos()
|
||||
strip_tags()
|
||||
|
||||
ext/wddx
|
||||
--------
|
||||
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
This is an overview over existing segfaults in the current PHP source
|
||||
tree.
|
||||
|
||||
|
||||
Fixed:
|
||||
|
||||
mb_convert_encoding (Moriyoshi)
|
||||
socket_iovec_alloc (Rasmus)
|
||||
exif_imagetype,exif_thumbnail (Rasmus)
|
||||
dbase_open (Rasmus)
|
||||
array_pad (Rasmus)
|
||||
setlocale (Rasmus)
|
||||
unregister_tick_function (Rasmus)
|
||||
bcsub (Rasmus)
|
||||
str_repeat (Ilia)
|
||||
imagecopyresized (Ilia)
|
||||
mhash_keygen_s2k (Ilia)
|
||||
mb_ereg, mb_ereg_match, mb_eregi, mb_split (Moriyoshi)
|
||||
xml_parser_create (Moriyoshi)
|
||||
ob_start (Sascha)
|
||||
imagecreate/-truecolor (Sascha)
|
||||
flock (Sascha)
|
||||
register_shutdown_function (Sascha)
|
||||
mb_strcut('', [number greater than the length of first arg]) (Moriyoshi)
|
||||
ext/exif, ext/dba (7) (Marcus)
|
||||
|
||||
Open:
|
||||
|
||||
the dbase extension (1)
|
||||
chunk_split (2)
|
||||
socket_select (3)
|
||||
php_imagepolygon (4)
|
||||
imagesetstyle (5)
|
||||
bundled gd (6)
|
||||
php_base64_encode (8)
|
||||
pack (9)
|
||||
|
||||
(1) heap corruption, mostly visible in malloc-related calls. Whether you see
|
||||
this or not might depend on your libc/compiler. Hard to track down,
|
||||
because the result of the corruption might be quite delayed.
|
||||
|
||||
Reproducable with glibc-2.3/gcc 3.2.2 by:
|
||||
|
||||
cat <<X | php do_crash
|
||||
dbase_add_record
|
||||
dbase_close
|
||||
dbase_create
|
||||
dbase_delete_record
|
||||
dbase_get_record
|
||||
dbase_get_record_with_names
|
||||
dbase_numfields
|
||||
dbase_numrecords
|
||||
dbase_open
|
||||
X
|
||||
|
||||
(2) integer overflow in php_chunk_split
|
||||
|
||||
(3) heap corruption, dies in efree()/execute()
|
||||
|
||||
Methodology
|
||||
|
||||
1. Use a plain PHP_4_3 tree
|
||||
2. Use the config.nice from ammendment 1.
|
||||
3. Download the test script from:
|
||||
|
||||
<URL:http://schumann.cx/do_crash.txt>
|
||||
|
||||
4a. Use the scripts funcparse.awk/genfunclist.sh from phpdoc/scripts
|
||||
for creating a plain text function list. Feed that list to
|
||||
the script. Avoid calls like pcntl_fork. Manually remove functions
|
||||
which take too long to finish/eat up all memory.
|
||||
|
||||
4b. For testing a single function, echo the name of the function to
|
||||
the script like this:
|
||||
|
||||
echo dbase_open | php do_crash.txt
|
||||
|
||||
(4) integer overflow inside php_imagepolygon and possible subsequent
|
||||
integer overflows inside gdlib's gdImageFilledPolygon().
|
||||
|
||||
(5) integer overflow if the number of elements in the array passed as
|
||||
second argument * sizeof(int) result in an overflow.
|
||||
gdImageSetStyle function called by this php wrapper can die for the
|
||||
same reason.
|
||||
|
||||
(6) multiple integer overflows that can occur when trying to allocate a buffer
|
||||
for a new image. Affected functions:
|
||||
gdImageCreateFromJpegCtx
|
||||
readwbmp
|
||||
gdImageCreateFromXpm
|
||||
gdImageCreateFromPngCtx
|
||||
gdImagePngCtx
|
||||
gdImageCreateFromJpegCtx
|
||||
gdImageJpegCtx
|
||||
gdImageCreateFromGd2Ctx
|
||||
gdImageCreateFromGd2PartCtx
|
||||
_gdImageGd2
|
||||
GetDataBlock (gd_gif_in.c)
|
||||
|
||||
(7) few possible integer overflows, once safe_emalloc() or something similar
|
||||
is implemented they can all be addressed.
|
||||
|
||||
(8) integer overflow if the specified string is longer then ~1.1 billion bytes.
|
||||
|
||||
(9) multiple integer overflows, ex. pack("d4294967297", 2);
|
||||
|
||||
Ammendment 1.
|
||||
|
||||
CFLAGS='-O0 -g' \
|
||||
'../src/php4/configure' \
|
||||
'--enable-pcntl' \
|
||||
'--enable-shmop' \
|
||||
'--enable-sysvsem' \
|
||||
'--enable-sysvshm' \
|
||||
'--enable-wddx' \
|
||||
'--enable-yp' \
|
||||
'--enable-filepro' \
|
||||
'--enable-ftp' \
|
||||
'--enable-dba' \
|
||||
'--enable-dbase' \
|
||||
'--enable-dio' \
|
||||
'--enable-exif' \
|
||||
'--enable-mbstring' \
|
||||
'--enable-mbregex' \
|
||||
'--enable-sockets' \
|
||||
'--enable-bcmath' \
|
||||
'--enable-calendar' \
|
||||
'--enable-pcntl' \
|
||||
'--enable-shmop' \
|
||||
'--enable-sysvsem' \
|
||||
'--enable-sysvshm' \
|
||||
'--enable-wddx' \
|
||||
'--enable-yp' \
|
||||
'--enable-filepro' \
|
||||
'--enable-ftp' \
|
||||
'--enable-dba' \
|
||||
'--enable-dbase' \
|
||||
'--enable-dio' \
|
||||
'--enable-exif' \
|
||||
'--enable-mbstring' \
|
||||
'--enable-mbregex' \
|
||||
'--enable-sockets' \
|
||||
'--enable-bcmath' \
|
||||
'--enable-calendar' \
|
||||
"$@"
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+51
-42
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -303,7 +303,10 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
return (0);
|
||||
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
if (IS_ABSOLUTE_PATH(path, path_length)) {
|
||||
/* cwd_length can be 0 when getcwd() fails.
|
||||
* This can happen under solaris when a dir does not have read permissions
|
||||
* but *does* have execute permissions */
|
||||
if (IS_ABSOLUTE_PATH(path, path_length) || (state->cwd_length < 1)) {
|
||||
if (use_realpath && realpath(path, resolved_path)) {
|
||||
path = resolved_path;
|
||||
path_length = strlen(path);
|
||||
@@ -363,58 +366,64 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
|
||||
}
|
||||
|
||||
|
||||
ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok);
|
||||
while (ptr) {
|
||||
ptr_length = strlen(ptr);
|
||||
if (state->cwd_length > 0 || IS_ABSOLUTE_PATH(path, path_length)) {
|
||||
ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok);
|
||||
while (ptr) {
|
||||
ptr_length = strlen(ptr);
|
||||
|
||||
if (IS_DIRECTORY_UP(ptr, ptr_length)) {
|
||||
char save;
|
||||
if (IS_DIRECTORY_UP(ptr, ptr_length)) {
|
||||
char save;
|
||||
|
||||
save = DEFAULT_SLASH;
|
||||
save = DEFAULT_SLASH;
|
||||
|
||||
#define PREVIOUS state->cwd[state->cwd_length - 1]
|
||||
|
||||
while (IS_ABSOLUTE_PATH(state->cwd, state->cwd_length) &&
|
||||
!IS_SLASH(PREVIOUS)) {
|
||||
save = PREVIOUS;
|
||||
PREVIOUS = '\0';
|
||||
state->cwd_length--;
|
||||
}
|
||||
while (IS_ABSOLUTE_PATH(state->cwd, state->cwd_length) &&
|
||||
!IS_SLASH(PREVIOUS)) {
|
||||
save = PREVIOUS;
|
||||
PREVIOUS = '\0';
|
||||
state->cwd_length--;
|
||||
}
|
||||
|
||||
if (!IS_ABSOLUTE_PATH(state->cwd, state->cwd_length)) {
|
||||
state->cwd[state->cwd_length++] = save;
|
||||
state->cwd[state->cwd_length] = '\0';
|
||||
} else {
|
||||
PREVIOUS = '\0';
|
||||
state->cwd_length--;
|
||||
}
|
||||
} else if (!IS_DIRECTORY_CURRENT(ptr, ptr_length)) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1);
|
||||
if (!IS_ABSOLUTE_PATH(state->cwd, state->cwd_length)) {
|
||||
state->cwd[state->cwd_length++] = save;
|
||||
state->cwd[state->cwd_length] = '\0';
|
||||
} else {
|
||||
PREVIOUS = '\0';
|
||||
state->cwd_length--;
|
||||
}
|
||||
} else if (!IS_DIRECTORY_CURRENT(ptr, ptr_length)) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1);
|
||||
#ifdef TSRM_WIN32
|
||||
/* Windows 9x will consider C:\\Foo as a network path. Avoid it. */
|
||||
if ((state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') ||
|
||||
IsDBCSLeadByte(state->cwd[state->cwd_length-2])) {
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
}
|
||||
/* Windows 9x will consider C:\\Foo as a network path. Avoid it. */
|
||||
if ((state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') ||
|
||||
IsDBCSLeadByte(state->cwd[state->cwd_length-2])) {
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
}
|
||||
#elif defined(NETWARE)
|
||||
/* If the token is a volume name, it will have colon at the end -- so, no slash before it */
|
||||
if (ptr[ptr_length-1] != ':') {
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
}
|
||||
/* If the token is a volume name, it will have colon at the end -- so, no slash before it */
|
||||
if (ptr[ptr_length-1] != ':') {
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
}
|
||||
#else
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
|
||||
#endif
|
||||
memcpy(&state->cwd[state->cwd_length], ptr, ptr_length+1);
|
||||
state->cwd_length += ptr_length;
|
||||
memcpy(&state->cwd[state->cwd_length], ptr, ptr_length+1);
|
||||
state->cwd_length += ptr_length;
|
||||
}
|
||||
ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok);
|
||||
}
|
||||
ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok);
|
||||
}
|
||||
|
||||
if (state->cwd_length == COPY_WHEN_ABSOLUTE(state->cwd)) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1);
|
||||
state->cwd[state->cwd_length] = DEFAULT_SLASH;
|
||||
state->cwd[state->cwd_length+1] = '\0';
|
||||
state->cwd_length++;
|
||||
if (state->cwd_length == COPY_WHEN_ABSOLUTE(state->cwd)) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1);
|
||||
state->cwd[state->cwd_length] = DEFAULT_SLASH;
|
||||
state->cwd[state->cwd_length+1] = '\0';
|
||||
state->cwd_length++;
|
||||
}
|
||||
} else {
|
||||
state->cwd = (char *) realloc(state->cwd, path_length+1);
|
||||
memcpy(state->cwd, path, path_length+1);
|
||||
state->cwd_length = path_length;
|
||||
}
|
||||
|
||||
if (verify_path && verify_path(state)) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -196,8 +196,6 @@ typedef struct _virtual_cwd_globals {
|
||||
#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC)
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC)
|
||||
#else
|
||||
#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC)
|
||||
#endif
|
||||
#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC)
|
||||
#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode TSRMLS_CC)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+80
-99
@@ -28,7 +28,7 @@ AC_DEFUN([PHP_DEFINE],[
|
||||
dnl PHP_INIT_BUILD_SYSTEM
|
||||
dnl
|
||||
AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[
|
||||
mkdir include >/dev/null 2>&1
|
||||
test -d include || mkdir include
|
||||
> Makefile.objects
|
||||
> Makefile.fragments
|
||||
dnl We need to play tricks here to avoid matching the egrep line itself
|
||||
@@ -211,13 +211,13 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
AC_MSG_CHECKING([for OpenSSL version])
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include <openssl/opensslv.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0090500fL
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
|
||||
yes
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT([>= 0.9.5])
|
||||
AC_MSG_RESULT([>= 0.9.6])
|
||||
],[
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.5 or greater required.])
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
|
||||
@@ -531,7 +531,7 @@ PHP_ALWAYS_SHARED([$1])
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_ARG_ANALYZE],[
|
||||
ifelse([$3],yes,[PHP_ARG_ANALYZE_EX([$1])])
|
||||
ifelse([$3],yes,[PHP_ARG_ANALYZE_EX([$1])],[ext_output=ifelse([$]$1,,no,[$]$1)])
|
||||
ifelse([$2],,,[AC_MSG_RESULT([$ext_output])])
|
||||
])
|
||||
|
||||
@@ -590,7 +590,8 @@ AC_DEFUN([PHP_MODULE_PTR],[
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_CONFIG_NICE],[
|
||||
rm -f $1
|
||||
test -f $1 && mv $1 $1.old
|
||||
rm -f $1.old
|
||||
cat >$1<<EOF
|
||||
#! /bin/sh
|
||||
#
|
||||
@@ -667,21 +668,6 @@ AC_DEFUN([PHP_SUBST_OLD],[
|
||||
AC_SUBST($1)
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_MKDIR_P_CHECK],[
|
||||
AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[
|
||||
test -d conftestdir && rm -rf conftestdir
|
||||
mkdir -p conftestdir/somedir >/dev/null 2>&1
|
||||
dnl `mkdir -p' must be quiet about creating existing directories
|
||||
mkdir -p conftestdir/somedir >/dev/null 2>&1
|
||||
if test "$?" = "0" && test -d conftestdir/somedir; then
|
||||
ac_cv_mkdir_p=yes
|
||||
else
|
||||
ac_cv_mkdir_p=no
|
||||
fi
|
||||
rm -rf conftestdir
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_TM_GMTOFF],[
|
||||
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
|
||||
[AC_TRY_COMPILE([#include <sys/types.h>
|
||||
@@ -701,7 +687,8 @@ AC_DEFUN([PHP_CONFIGURE_PART],[
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_PROG_SENDMAIL],[
|
||||
AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib)
|
||||
PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib
|
||||
AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:$PHP_ALT_PATH)
|
||||
if test -n "$PROG_SENDMAIL"; then
|
||||
AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail])
|
||||
fi
|
||||
@@ -1107,7 +1094,11 @@ dnl
|
||||
dnl Set libtool variable
|
||||
dnl
|
||||
AC_DEFUN([PHP_SET_LIBTOOL_VARIABLE],[
|
||||
LIBTOOL='$(SHELL) libtool $1'
|
||||
if test -z "$LIBTOOL"; then
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
|
||||
else
|
||||
LIBTOOL="$LIBTOOL $1"
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -1270,10 +1261,7 @@ AC_DEFUN([PHP_ADD_BUILD_DIR],[
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_GEN_BUILD_DIRS],[
|
||||
PHP_MKDIR_P_CHECK
|
||||
if test "$ac_cv_mkdir_p" = "yes"; then
|
||||
mkdir -p $BUILD_DIR
|
||||
fi
|
||||
$php_shtool mkdir -p $BUILD_DIR
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -1462,6 +1450,70 @@ int main(void) {
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Some systems, notably Solaris, cause getcwd() or realpath to fail if a
|
||||
dnl component of the path has execute but not read permissions
|
||||
AC_DEFUN([PHP_BROKEN_GETCWD],[
|
||||
AC_MSG_CHECKING([for broken getcwd])
|
||||
os=`uname -sr 2>/dev/null`
|
||||
case $os in
|
||||
SunOS*)
|
||||
AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd])
|
||||
AC_MSG_RESULT([yes]);;
|
||||
*)
|
||||
AC_MSG_RESULT([no]);;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND],[
|
||||
AC_MSG_CHECKING([for broken libc stdio])
|
||||
AC_CACHE_VAL(have_broken_glibc_fopen_append,[
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
FILE *fp;
|
||||
long position;
|
||||
char *filename = "/tmp/phpglibccheck";
|
||||
|
||||
fp = fopen(filename, "w");
|
||||
if (fp == NULL) {
|
||||
perror("fopen");
|
||||
exit(2);
|
||||
}
|
||||
fputs("foobar", fp);
|
||||
fclose(fp);
|
||||
|
||||
fp = fopen(filename, "a+");
|
||||
position = ftell(fp);
|
||||
fclose(fp);
|
||||
unlink(filename);
|
||||
if (position == 0)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
[have_broken_glibc_fopen_append=no],
|
||||
[have_broken_glibc_fopen_append=yes ],
|
||||
AC_TRY_COMPILE([
|
||||
#include <features.h>
|
||||
],[
|
||||
#if !__GLIBC_PREREQ(2,2)
|
||||
choke me
|
||||
#endif
|
||||
],
|
||||
[have_broken_glibc_fopen_append=yes],
|
||||
[have_broken_glibc_fopen_append=no ])
|
||||
)])
|
||||
|
||||
if test "$have_broken_glibc_fopen_append" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on fopen with mode a+])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN([PHP_FOPENCOOKIE],[
|
||||
AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
|
||||
|
||||
@@ -1554,6 +1606,7 @@ AC_DEFUN([PHP_CHECK_LIBRARY], [
|
||||
$3
|
||||
],[
|
||||
LDFLAGS=$save_old_LDFLAGS
|
||||
unset ac_cv_func_$1
|
||||
$4
|
||||
])dnl
|
||||
])
|
||||
@@ -1738,75 +1791,3 @@ IFS="- /.
|
||||
APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6`
|
||||
])
|
||||
|
||||
dnl PHP_PROG_SED
|
||||
dnl ------------
|
||||
dnl Check for a fully-functional sed program, that truncates
|
||||
dnl as few characters as possible. Prefer GNU sed if found.
|
||||
dnl
|
||||
dnl Based on LT_AC_PROG_SED (libtool CVS)
|
||||
dnl
|
||||
AC_DEFUN([PHP_PROG_SED],
|
||||
[AC_MSG_CHECKING([for working sed])
|
||||
AC_CACHE_VAL(ac_cv_path_sed,
|
||||
[
|
||||
|
||||
# Create a temporary directory, and hook for its removal unless debugging.
|
||||
$debug ||
|
||||
{
|
||||
trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
|
||||
trap '{ (exit 1); exit 1; }' 1 2 13 15
|
||||
}
|
||||
|
||||
# Create a (secure) tmp directory for tmp files.
|
||||
: ${TMPDIR=/tmp}
|
||||
{
|
||||
tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
|
||||
test -n "$tmp" && test -d "$tmp"
|
||||
} ||
|
||||
{
|
||||
tmp=$TMPDIR/sed$$-$RANDOM
|
||||
(umask 077 && mkdir $tmp)
|
||||
} ||
|
||||
{
|
||||
echo "$me: cannot create a temporary directory in $TMPDIR" >&2
|
||||
{ (exit 1); exit 1; }
|
||||
}
|
||||
_max=0
|
||||
_count=0
|
||||
|
||||
# Use the sed found in PATH, skip the rest
|
||||
_sed=sed
|
||||
|
||||
# Check for GNU sed and select it if it is found.
|
||||
if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
|
||||
ac_cv_path_sed=${_sed}
|
||||
else
|
||||
cat /dev/null > "$tmp/sed.in"
|
||||
_count=0
|
||||
echo -n "0123456789" >"$tmp/sed.in"
|
||||
while true; do
|
||||
cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
|
||||
mv "$tmp/sed.tmp" "$tmp/sed.in"
|
||||
cp "$tmp/sed.in" "$tmp/sed.nl"
|
||||
echo >>"$tmp/sed.nl"
|
||||
${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break
|
||||
cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break
|
||||
# 10000 chars as input seems more than enough
|
||||
test $_count -gt 10 && break
|
||||
_count=`expr $_count + 1`
|
||||
if test $_count -gt $_max; then
|
||||
_max=$_count
|
||||
ac_cv_path_sed=${_sed}
|
||||
fi
|
||||
done
|
||||
fi
|
||||
rm -rf "$tmp"
|
||||
])
|
||||
if test -z "$ac_cv_path_sed"; then
|
||||
AC_MSG_ERROR([Could not find working sed on this system. Please install GNU sed.])
|
||||
else
|
||||
SED=$ac_cv_path_sed
|
||||
PHP_SUBST(SED)
|
||||
AC_MSG_RESULT([$SED])
|
||||
fi
|
||||
])
|
||||
+11
-5
@@ -16,7 +16,7 @@
|
||||
# | Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id: buildcheck.sh,v 1.21 2002-10-30 11:42:22 sas Exp $
|
||||
# $Id: buildcheck.sh,v 1.21.2.2 2003-04-16 12:05:43 jan Exp $
|
||||
#
|
||||
|
||||
echo "buildconf: checking installation..."
|
||||
@@ -73,23 +73,29 @@ fi
|
||||
# libtool 1.4 or newer
|
||||
# Prefer glibtool over libtool for Mac OS X compatibility
|
||||
libtool=`which glibtool 2> /dev/null`
|
||||
if test ! -f "$libtool"; then libtool=`which libtool`; fi
|
||||
if test ! -r "$libtool"; then libtool=`which libtool`; fi
|
||||
lt_pversion=`$libtool --version 2>/dev/null|sed -n -e 's/^[^0-9]*//' -e 1's/[- ].*//p'`
|
||||
if test "$lt_pversion" = ""; then
|
||||
echo "buildconf: libtool not found."
|
||||
echo " You need libtool version 1.4 or newer installed"
|
||||
echo " You need libtool version 1.4.3 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
fi
|
||||
lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
|
||||
IFS=.; set $lt_version; IFS=' '
|
||||
|
||||
if test "$1" -gt "1" || test "$2" -ge "4";
|
||||
if test "$3" = ""; then
|
||||
third=0
|
||||
else
|
||||
third=$3
|
||||
fi
|
||||
|
||||
if test "$1" -gt "1" || test "$2" -ge "5" || (test "$2" -ge "4" && test "$third" -ge "3")
|
||||
then
|
||||
echo "buildconf: libtool version $lt_pversion (ok)"
|
||||
else
|
||||
echo "buildconf: libtool version $lt_pversion found."
|
||||
echo " You need libtool version 1.4 or newer installed"
|
||||
echo " You need libtool version 1.4.3 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
File renamed without changes.
Vendored
+69
-31
@@ -3,7 +3,7 @@
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2002-05-29'
|
||||
timestamp='2002-10-21'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -88,30 +88,40 @@ if test $# != 0; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap 'exit 1' 1 2 15
|
||||
|
||||
dummy=dummy-$$
|
||||
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
|
||||
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
|
||||
# compiler to aid in system detection is discouraged as it requires
|
||||
# temporary files to be created and, as you can see below, it is a
|
||||
# headache to deal with in a portable fashion.
|
||||
|
||||
# CC_FOR_BUILD -- compiler used by this script.
|
||||
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
||||
# use `HOST_CC' if defined, but it is deprecated.
|
||||
|
||||
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
|
||||
,,) echo "int dummy(){}" > $dummy.c ;
|
||||
# This shell variable is my proudest work .. or something. --bje
|
||||
|
||||
set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
|
||||
(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
|
||||
|| (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
|
||||
dummy=$tmpdir/dummy ;
|
||||
files="$dummy.c $dummy.o $dummy.rel $dummy" ;
|
||||
trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
|
||||
case $CC_FOR_BUILD,$HOST_CC,$CC in
|
||||
,,) echo "int x;" > $dummy.c ;
|
||||
for c in cc gcc c89 c99 ; do
|
||||
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
|
||||
if test $? = 0 ; then
|
||||
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
|
||||
CC_FOR_BUILD="$c"; break ;
|
||||
fi ;
|
||||
done ;
|
||||
rm -f $dummy.c $dummy.o $dummy.rel ;
|
||||
rm -f $files ;
|
||||
if test x"$CC_FOR_BUILD" = x ; then
|
||||
CC_FOR_BUILD=no_compiler_found ;
|
||||
fi
|
||||
;;
|
||||
,,*) CC_FOR_BUILD=$CC ;;
|
||||
,*,*) CC_FOR_BUILD=$HOST_CC ;;
|
||||
esac'
|
||||
esac ;
|
||||
unset files'
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 1994-08-24)
|
||||
@@ -221,6 +231,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
eval $set_cc_for_build
|
||||
cat <<EOF >$dummy.s
|
||||
.data
|
||||
\$Lformat:
|
||||
@@ -246,10 +257,9 @@ main:
|
||||
jsr \$26,exit
|
||||
.end main
|
||||
EOF
|
||||
eval $set_cc_for_build
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
$CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
case `./$dummy` in
|
||||
case `$dummy` in
|
||||
0-0)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
@@ -271,9 +281,12 @@ EOF
|
||||
2-1307)
|
||||
UNAME_MACHINE="alphaev68"
|
||||
;;
|
||||
3-1307)
|
||||
UNAME_MACHINE="alphaev7"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f $dummy.s $dummy
|
||||
rm -f $dummy.s $dummy && rmdir $tmpdir
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit 0 ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
@@ -314,6 +327,10 @@ EOF
|
||||
NILE*:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
DRS?6000:UNIX_SV:4.2*:7*)
|
||||
case `/usr/bin/uname -p` in
|
||||
sparc) echo sparc-icl-nx7 && exit 0 ;;
|
||||
esac ;;
|
||||
sun4H:SunOS:5.*:*)
|
||||
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
@@ -420,15 +437,18 @@ EOF
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy \
|
||||
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c \
|
||||
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Motorola:PowerMAX_OS:*:*)
|
||||
echo powerpc-motorola-powermax
|
||||
exit 0 ;;
|
||||
Motorola:*:4.3:PL8-*)
|
||||
echo powerpc-harris-powermax
|
||||
exit 0 ;;
|
||||
Night_Hawk:*:*:PowerMAX_OS)
|
||||
echo powerpc-harris-powermax
|
||||
exit 0 ;;
|
||||
@@ -504,8 +524,8 @@ EOF
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
@@ -603,9 +623,9 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
|
||||
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
|
||||
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
|
||||
rm -f $dummy.c $dummy
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
fi ;;
|
||||
esac
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
@@ -641,8 +661,8 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
@@ -725,7 +745,19 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
# Determine whether the default compiler uses glibc.
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
rm -f $dummy.c && rmdir $tmpdir
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
@@ -786,7 +818,7 @@ EOF
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
rm -f $dummy.c
|
||||
rm -f $dummy.c && rmdir $tmpdir
|
||||
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
|
||||
;;
|
||||
ppc:Linux:*:*)
|
||||
@@ -849,7 +881,7 @@ EOF
|
||||
;;
|
||||
a.out-i386-linux)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||
exit 0 ;;
|
||||
exit 0 ;;
|
||||
coff-i386)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
|
||||
exit 0 ;;
|
||||
@@ -882,7 +914,7 @@ EOF
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
rm -f $dummy.c
|
||||
rm -f $dummy.c && rmdir $tmpdir
|
||||
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
|
||||
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
|
||||
;;
|
||||
@@ -960,6 +992,9 @@ EOF
|
||||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
mc68k:UNIX:SYSTEM5:3.51m)
|
||||
echo m68k-convergent-sysv
|
||||
exit 0 ;;
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
|
||||
@@ -1053,6 +1088,9 @@ EOF
|
||||
SX-5:SUPER-UX:*:*)
|
||||
echo sx5-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SX-6:SUPER-UX:*:*)
|
||||
echo sx6-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -1073,7 +1111,7 @@ EOF
|
||||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit 0 ;;
|
||||
NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
|
||||
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
|
||||
echo nsr-tandem-nsk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:NonStop-UX:*:*)
|
||||
@@ -1245,8 +1283,8 @@ main ()
|
||||
}
|
||||
EOF
|
||||
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
|
||||
rm -f $dummy.c $dummy && rmdir $tmpdir
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
|
||||
Vendored
+69
-42
@@ -3,7 +3,7 @@
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2002-05-28'
|
||||
timestamp='2002-09-05'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@@ -118,7 +118,7 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
|
||||
nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
@@ -229,24 +229,34 @@ case $basic_machine in
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| c4x | clipper \
|
||||
| clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 \
|
||||
| fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k \
|
||||
| m32r | m68000 | m68k | m88k | mcore \
|
||||
| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
|
||||
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
|
||||
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
|
||||
| mipsisa32 | mipsisa64 \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| ns16k | ns32k \
|
||||
| openrisc | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
|
||||
| sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic80 | tron \
|
||||
@@ -284,31 +294,42 @@ case $basic_machine in
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c54x-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
|
||||
| clipper-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | fx80-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* \
|
||||
| m32r-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | mcore-* \
|
||||
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
|
||||
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
|
||||
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* \
|
||||
| mips64vr5000-* | mips64vr5000el-* \
|
||||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipstx39 | mipstx39el \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
|
||||
| sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
|
||||
| tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
|
||||
@@ -728,13 +749,13 @@ case $basic_machine in
|
||||
pbb)
|
||||
basic_machine=m68k-tti
|
||||
;;
|
||||
pc532 | pc532-*)
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentiumpro | p6 | 6x86 | athlon)
|
||||
pentiumpro | p6 | 6x86 | athlon | athlon_*)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
@@ -755,22 +776,22 @@ case $basic_machine in
|
||||
power) basic_machine=power-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
;;
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
;;
|
||||
;;
|
||||
ppcle-* | powerpclittle-*)
|
||||
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64) basic_machine=powerpc64-unknown
|
||||
;;
|
||||
;;
|
||||
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||
basic_machine=powerpc64le-unknown
|
||||
;;
|
||||
;;
|
||||
ppc64le-* | powerpc64little-*)
|
||||
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
@@ -801,6 +822,12 @@ case $basic_machine in
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
sb1)
|
||||
basic_machine=mipsisa64sb1-unknown
|
||||
;;
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
@@ -866,7 +893,7 @@ case $basic_machine in
|
||||
sun386 | sun386i | roadrunner)
|
||||
basic_machine=i386-sun
|
||||
;;
|
||||
sv1)
|
||||
sv1)
|
||||
basic_machine=sv1-cray
|
||||
os=-unicos
|
||||
;;
|
||||
@@ -886,6 +913,10 @@ case $basic_machine in
|
||||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic4x | c4x*)
|
||||
basic_machine=tic4x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
@@ -924,8 +955,8 @@ case $basic_machine in
|
||||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
@@ -950,7 +981,7 @@ case $basic_machine in
|
||||
basic_machine=i386-pc
|
||||
os=-windows32-msvcrt
|
||||
;;
|
||||
xps | xps100)
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
ymp)
|
||||
@@ -996,7 +1027,7 @@ case $basic_machine in
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh3 | sh4 | sh3eb | sh4eb)
|
||||
sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sh64)
|
||||
@@ -1005,7 +1036,7 @@ case $basic_machine in
|
||||
sparc | sparcv9 | sparcv9b)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
cydra)
|
||||
basic_machine=cydra-cydrome
|
||||
;;
|
||||
orion)
|
||||
@@ -1020,10 +1051,6 @@ case $basic_machine in
|
||||
pmac | pmac-mpw)
|
||||
basic_machine=powerpc-apple
|
||||
;;
|
||||
c4x*)
|
||||
basic_machine=c4x-none
|
||||
os=-coff
|
||||
;;
|
||||
*-unknown)
|
||||
# Make sure to match an already-canonicalized machine name.
|
||||
;;
|
||||
@@ -1155,7 +1182,7 @@ case $os in
|
||||
os=-rtmk-nova
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
os=-nextstep2
|
||||
;;
|
||||
-nsk*)
|
||||
os=-nsk
|
||||
@@ -1194,8 +1221,8 @@ case $os in
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
@@ -1232,7 +1259,7 @@ case $basic_machine in
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
;;
|
||||
pdp11-*)
|
||||
pdp11-*)
|
||||
os=-none
|
||||
;;
|
||||
*-dec | vax-*)
|
||||
@@ -1325,19 +1352,19 @@ case $basic_machine in
|
||||
*-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
*-gould)
|
||||
*-gould)
|
||||
os=-sysv
|
||||
;;
|
||||
*-highlevel)
|
||||
*-highlevel)
|
||||
os=-bsd
|
||||
;;
|
||||
*-encore)
|
||||
os=-bsd
|
||||
;;
|
||||
*-sgi)
|
||||
*-sgi)
|
||||
os=-irix
|
||||
;;
|
||||
*-siemens)
|
||||
*-siemens)
|
||||
os=-sysv4
|
||||
;;
|
||||
*-masscomp)
|
||||
|
||||
+68
-47
@@ -30,9 +30,6 @@ dnl -------------------------------------------------------------------------
|
||||
AC_PREREQ(2.13)
|
||||
AC_INIT(README.CVS-RULES)
|
||||
|
||||
dnl check for working sed
|
||||
PHP_PROG_SED
|
||||
|
||||
PHP_CONFIG_NICE(config.nice)
|
||||
for arg in $0 "$@"; do
|
||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
|
||||
@@ -43,8 +40,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
MAJOR_VERSION=4
|
||||
MINOR_VERSION=3
|
||||
RELEASE_VERSION=0
|
||||
EXTRA_VERSION="RC4"
|
||||
RELEASE_VERSION=2
|
||||
EXTRA_VERSION="-RC2"
|
||||
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
|
||||
|
||||
dnl Define where extension directories are located in the configure context
|
||||
@@ -64,16 +61,15 @@ echo "#define PHP_MINOR_VERSION $MINOR_VERSION" >> php_version.h.new
|
||||
echo "#define PHP_RELEASE_VERSION $RELEASE_VERSION" >> php_version.h.new
|
||||
echo "#define PHP_EXTRA_VERSION \"$EXTRA_VERSION\"" >> php_version.h.new
|
||||
echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new
|
||||
cmp php_version.h.new php_version.h >/dev/null 2>&1
|
||||
cmp php_version.h.new $srcdir/main/php_version.h >/dev/null 2>&1
|
||||
if test $? -ne 0 ; then
|
||||
rm -f php_version.h && mv php_version.h.new php_version.h && \
|
||||
echo 'Updated php_version.h'
|
||||
rm -f $srcdir/main/php_version.h && mv php_version.h.new $srcdir/main/php_version.h && \
|
||||
echo 'Updated main/php_version.h'
|
||||
else
|
||||
rm -f php_version.h.new
|
||||
fi
|
||||
|
||||
|
||||
|
||||
dnl Catch common errors here to save a few seconds of our users' time
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
@@ -91,12 +87,12 @@ dnl -------------------------------------------------------------------------
|
||||
|
||||
cwd=`pwd`
|
||||
|
||||
PHP_INIT_BUILD_SYSTEM
|
||||
|
||||
php_shtool=$srcdir/build/shtool
|
||||
T_MD=`$php_shtool echo -n -e %B`
|
||||
T_ME=`$php_shtool echo -n -e %b`
|
||||
|
||||
PHP_INIT_BUILD_SYSTEM
|
||||
|
||||
dnl We want this one before the checks, so the checks can modify CFLAGS.
|
||||
test -z "$CFLAGS" && auto_cflags=1
|
||||
|
||||
@@ -139,9 +135,9 @@ if test "$YACC" != "bison -y"; then
|
||||
AC_MSG_WARN([You will need bison if you want to regenerate the PHP parsers.])
|
||||
else
|
||||
AC_MSG_CHECKING([bison version])
|
||||
set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'`
|
||||
if test "${1}" = "1" -a "${2}" -lt "28"; then
|
||||
AC_MSG_WARN(You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)
|
||||
set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'|tr -d a-z`
|
||||
if test "${1}" = "1" -a "(" "${2}" -lt "75" -a "${2}" -ne "28" -a "${2}" -ne "35" -o "${2}" -ge "875" ")"; then
|
||||
AC_MSG_WARN(You will need bison 1.28, 1.35 or 1.75 if you want to regenerate the Zend parser (found ${1}.${2}).)
|
||||
fi
|
||||
AC_MSG_RESULT(${1}.${2} (ok))
|
||||
fi
|
||||
@@ -159,11 +155,19 @@ if test "$ac_cv_c_const" = "yes" ; then
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([flex version])
|
||||
set `echo "" | $LEX -V -v --version 2>/dev/null | grep 'version' | cut -d ' ' -f 3 | sed -e 's/\./ /g' | sed -e 's/[^0-9 ]//g'`
|
||||
if test "${1}" != "2" -o "${2}" != "5" -o "${3}" -lt "4"; then
|
||||
AC_MSG_WARN(You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers.)
|
||||
fi
|
||||
if test "$LEX" ;then
|
||||
flexvers=`echo "" | $LEX -V -v --version 2>/dev/null |
|
||||
sed -e 's/^.* //' -e 's/\./ /g'`
|
||||
if test ! -z "$flexvers"; then
|
||||
set $flexvers
|
||||
if test "${1}" != "2" -o "${2}" != "5" -o "${3}" -lt "4"; then
|
||||
AC_MSG_WARN(You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers.)
|
||||
fi
|
||||
fi
|
||||
AC_MSG_RESULT(${1}.${2}.${3} (ok))
|
||||
else
|
||||
AC_MSG_WARN(You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers.)
|
||||
fi
|
||||
|
||||
dnl Platform-specific compile settings.
|
||||
dnl -------------------------------------------------------------------------
|
||||
@@ -231,7 +235,7 @@ SAPI_LIBTOOL=libphp4.la
|
||||
|
||||
PHP_CONFIGURE_PART(Configuring SAPI modules)
|
||||
|
||||
esyscmd(./scripts/config-stubs sapi)
|
||||
esyscmd(./build/config-stubs sapi)
|
||||
|
||||
dnl Show which main SAPI was selected
|
||||
AC_MSG_CHECKING([for chosen SAPI module])
|
||||
@@ -382,6 +386,8 @@ sys/ipc.h \
|
||||
])
|
||||
|
||||
PHP_FOPENCOOKIE
|
||||
PHP_BROKEN_GETCWD
|
||||
PHP_BROKEN_GLIBC_FOPEN_APPEND
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
dnl -------------------------------------------------------------------------
|
||||
@@ -444,6 +450,7 @@ dnl -------------------------------------------------------------------------
|
||||
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(
|
||||
alphasort \
|
||||
asctime_r \
|
||||
chroot \
|
||||
ctime_r \
|
||||
@@ -472,6 +479,7 @@ memmove \
|
||||
mkstemp \
|
||||
mmap \
|
||||
nl_langinfo \
|
||||
perror \
|
||||
poll \
|
||||
putenv \
|
||||
realpath \
|
||||
@@ -479,6 +487,7 @@ random \
|
||||
rand_r \
|
||||
regcomp \
|
||||
res_search \
|
||||
scandir \
|
||||
setitimer \
|
||||
setlocale \
|
||||
localeconv \
|
||||
@@ -554,7 +563,7 @@ dnl ## In diversion 4 we check user-configurable general settings.
|
||||
|
||||
dnl General settings.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
PHP_CONFIGURE_PART(General settings)
|
||||
|
||||
PHP_HELP_SEPARATOR([General settings:])
|
||||
|
||||
@@ -611,10 +620,10 @@ fi
|
||||
|
||||
PHP_ARG_WITH(pear, [whether to install PEAR, and where],
|
||||
[ --with-pear=DIR Install PEAR in DIR (default PREFIX/lib/php)
|
||||
--without-pear Do not install PEAR], DEFAULT, no)
|
||||
--without-pear Do not install PEAR], DEFAULT, yes)
|
||||
|
||||
if test "$PHP_PEAR" != "no" && test "$disable_cli" != "1"; then
|
||||
install_pear="install-pear install-build install-headers install-programs"
|
||||
install_pear="install-pear"
|
||||
PEAR_INSTALLDIR=$PHP_PEAR
|
||||
fi
|
||||
|
||||
@@ -727,20 +736,13 @@ dnl
|
||||
dnl OpenSSL configure
|
||||
dnl
|
||||
PHP_ARG_WITH(openssl,for OpenSSL support,
|
||||
[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.5) ])
|
||||
[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6) ])
|
||||
|
||||
if test "$PHP_OPENSSL" != "no"; then
|
||||
ext_openssl_shared=$ext_shared
|
||||
PHP_SETUP_OPENSSL
|
||||
fi
|
||||
|
||||
|
||||
AC_CHECK_LIB(crypt, crypt, [
|
||||
PHP_ADD_LIBRARY(crypt)
|
||||
PHP_ADD_LIBRARY(crypt, 1)
|
||||
AC_DEFINE(HAVE_CRYPT,1,[ ])
|
||||
])
|
||||
|
||||
divert(5)
|
||||
|
||||
dnl ## In diversion 5 we check which extensions should be compiled.
|
||||
@@ -769,13 +771,12 @@ dnl
|
||||
|
||||
AC_ARG_ENABLE(all,
|
||||
[ --disable-all Disable all extensions enabled by default.
|
||||
--enable-all Enable all extensions.
|
||||
], [
|
||||
PHP_ENABLE_ALL=$enableval
|
||||
])
|
||||
|
||||
# reading config stubs
|
||||
esyscmd(./scripts/config-stubs ext)
|
||||
esyscmd(./build/config-stubs ext)
|
||||
|
||||
|
||||
dnl Other settings.
|
||||
@@ -786,8 +787,12 @@ PHP_HELP_SEPARATOR([Other settings:])
|
||||
AC_MSG_CHECKING([whether to enable versioning])
|
||||
AC_ARG_ENABLE(versioning,
|
||||
[ --enable-versioning Export only required symbols.
|
||||
See INSTALL for more information],[
|
||||
PHP_VERSIONING=$enableval
|
||||
See INSTALL for more information], [
|
||||
if test "x$APXS" != "x"; then
|
||||
PHP_VERSIONING=$enableval
|
||||
else
|
||||
PHP_VERSIONING=no
|
||||
fi
|
||||
],[
|
||||
PHP_VERSIONING=no
|
||||
])
|
||||
@@ -796,7 +801,7 @@ AC_MSG_RESULT([$PHP_VERSIONING])
|
||||
if test "$PHP_VERSIONING" = "yes"; then
|
||||
test -z "$PHP_SYM_FILE" && PHP_SYM_FILE="$abs_srcdir/sapi/$PHP_SAPI/php.sym"
|
||||
if test -f "$PHP_SYM_FILE"; then
|
||||
EXTRA_LDFLAGS="-export-symbols $PHP_SYM_FILE"
|
||||
EXTRA_LDFLAGS="-export-symbols $PHP_SYM_FILE $EXTRA_LDFLAGS"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -821,6 +826,13 @@ esac
|
||||
PHP_REGEX
|
||||
|
||||
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
|
||||
|
||||
dnl this has to be here to prevent the openssl crypt() from
|
||||
dnl overriding the system provided crypt().
|
||||
if test "$ac_cv_lib_crypt_crypt" = "yes"; then
|
||||
EXTRA_LIBS="-lcrypt $EXTRA_LIBS -lcrypt"
|
||||
fi
|
||||
|
||||
unset LIBS LDFLAGS
|
||||
|
||||
dnl Configuring Zend and TSRM.
|
||||
@@ -987,6 +999,7 @@ PHP_SUBST(bindir)
|
||||
PHP_SUBST(exec_prefix)
|
||||
PHP_SUBST(includedir)
|
||||
PHP_SUBST(libdir)
|
||||
PHP_SUBST(mandir)
|
||||
PHP_SUBST(phplibdir)
|
||||
PHP_SUBST(phptempdir)
|
||||
PHP_SUBST(prefix)
|
||||
@@ -1060,11 +1073,20 @@ if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then
|
||||
CPPFLAGS="$CPPFLAGS -DTHREAD=1"
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Libtool creation
|
||||
dnl
|
||||
|
||||
PHP_CONFIGURE_PART(Configuring libtool)
|
||||
|
||||
LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"
|
||||
AC_PROG_LIBTOOL
|
||||
if test "$enable_debug" != "yes"; then
|
||||
PHP_SET_LIBTOOL_VARIABLE([--silent])
|
||||
fi
|
||||
|
||||
dnl libtool 1.4.3 needs this.
|
||||
PHP_SET_LIBTOOL_VARIABLE([--preserve-dup-deps])
|
||||
|
||||
test -z "$PHP_COMPILE" && PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
|
||||
test -z "$CXX_PHP_COMPILE" && CXX_PHP_COMPILE='$(LIBTOOL) --mode=compile $(CXX_COMPILE) -c $<'
|
||||
@@ -1081,7 +1103,7 @@ INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
|
||||
CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
|
||||
|
||||
all_targets='$(OVERALL_TARGET) $(PHP_MODULES) $(PHP_CLI_TARGET)'
|
||||
install_targets="install-sapi install-modules $install_pear"
|
||||
install_targets="install-sapi install-modules $install_pear install-build install-headers install-programs"
|
||||
if test "$PHP_SAPI" != "cgi"; then
|
||||
install_targets="$PHP_INSTALL_CLI_TARGET $install_targets"
|
||||
fi
|
||||
@@ -1092,7 +1114,7 @@ PHP_SUBST(install_targets)
|
||||
PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c)
|
||||
|
||||
PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
|
||||
safe_mode.c fopen_wrappers.c alloca.c \
|
||||
safe_mode.c fopen_wrappers.c alloca.c php_scandir.c \
|
||||
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
|
||||
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
|
||||
streams.c network.c php_open_temporary_file.c php_logos.c \
|
||||
@@ -1100,7 +1122,7 @@ PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
|
||||
PHP_ADD_SOURCES(/main, internal_functions.c,, sapi)
|
||||
PHP_ADD_SOURCES(/main, internal_functions_cli.c,, cli)
|
||||
|
||||
PHP_ADD_SOURCES(/Zend, zend_language_parser.c zend_language_scanner.c \
|
||||
PHP_ADD_SOURCES(/Zend, zend_language_parser.c zend_language_scanner.c \
|
||||
zend_ini_parser.c zend_ini_scanner.c)
|
||||
|
||||
PHP_ADD_SOURCES(Zend, \
|
||||
@@ -1131,7 +1153,7 @@ PHP_ADD_BUILD_DIR(sapi/$PHP_SAPI sapi/cli)
|
||||
PHP_ADD_BUILD_DIR(TSRM)
|
||||
PHP_ADD_BUILD_DIR(Zend)
|
||||
|
||||
|
||||
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/scripts/Makefile.frag,$abs_srcdir/scripts,scripts)
|
||||
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/pear/Makefile.frag,$abs_srcdir/pear,pear)
|
||||
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.frag,$abs_srcdir/Zend,Zend)
|
||||
|
||||
@@ -1141,8 +1163,10 @@ PHP_GEN_GLOBAL_MAKEFILE
|
||||
AC_DEFINE([HAVE_BUILD_DEFS_H], 1, [ ])
|
||||
|
||||
$php_shtool mkdir -p pear/scripts
|
||||
$php_shtool mkdir -p scripts
|
||||
|
||||
ALL_OUTPUT_FILES="php4.spec main/build-defs.h \
|
||||
pear/scripts/phpize pear/scripts/php-config \
|
||||
scripts/phpize scripts/php-config \
|
||||
$PHP_OUTPUT_FILES"
|
||||
|
||||
AC_OUTPUT($ALL_OUTPUT_FILES, [], [
|
||||
@@ -1162,10 +1186,10 @@ fi
|
||||
# Create configuration headers
|
||||
#
|
||||
|
||||
test -d TSRM || mkdir TSRM
|
||||
test -d TSRM || $php_shtool mkdir TSRM
|
||||
echo '#include "../main/php_config.h"' > TSRM/tsrm_config.h
|
||||
|
||||
test -d Zend || mkdir Zend
|
||||
test -d Zend || $php_shtool mkdir Zend
|
||||
|
||||
cat >Zend/zend_config.h <<FEO
|
||||
#include "../main/php_config.h"
|
||||
@@ -1296,7 +1320,7 @@ X
|
||||
fi
|
||||
fi
|
||||
|
||||
cat<<X
|
||||
cat <<X
|
||||
+--------------------------------------------------------------------+
|
||||
| License: |
|
||||
| This software is subject to the PHP License, available in this |
|
||||
@@ -1316,10 +1340,7 @@ cat<<X
|
||||
| avoid using it if possible. |
|
||||
+--------------------------------------------------------------------+
|
||||
|
||||
X
|
||||
PHP_CONFIGURE_PART(Thank you for using PHP.)
|
||||
cat<<X
|
||||
|
||||
Thank you for using PHP.
|
||||
|
||||
X
|
||||
|
||||
|
||||
+49
-21
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -96,7 +96,7 @@ PHP_RINIT_FUNCTION(bcmath)
|
||||
if (cfg_get_long("bcmath.scale", &bc_precision)==FAILURE) {
|
||||
bc_precision=0;
|
||||
}
|
||||
|
||||
if(bc_precision<0) bc_precision=0;
|
||||
bc_init_numbers(TSRMLS_C);
|
||||
|
||||
return SUCCESS;
|
||||
@@ -110,6 +110,21 @@ PHP_MINFO_FUNCTION(bcmath)
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
/* {{{ php_str2num
|
||||
Convert to bc_num detecting scale */
|
||||
static void php_str2num(bc_num *num, char *str TSRMLS_DC)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (!(p = strchr(str, '.'))) {
|
||||
bc_str2num(num, str, 0 TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
bc_str2num(num, str, strlen(p+1) TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
|
||||
Returns the sum of two arbitrary precision numbers */
|
||||
PHP_FUNCTION(bcadd)
|
||||
@@ -129,7 +144,7 @@ PHP_FUNCTION(bcadd)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(scale_param);
|
||||
scale = (int) Z_LVAL_PP(scale_param);
|
||||
scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -140,9 +155,11 @@ PHP_FUNCTION(bcadd)
|
||||
bc_init_num(&first TSRMLS_CC);
|
||||
bc_init_num(&second TSRMLS_CC);
|
||||
bc_init_num(&result TSRMLS_CC);
|
||||
bc_str2num(&first, Z_STRVAL_PP(left), scale TSRMLS_CC);
|
||||
bc_str2num(&second, Z_STRVAL_PP(right), scale TSRMLS_CC);
|
||||
php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC);
|
||||
php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC);
|
||||
bc_add (first, second, &result, scale);
|
||||
if (result->n_scale > scale)
|
||||
result->n_scale = scale;
|
||||
Z_STRVAL_P(return_value) = bc_num2str(result);
|
||||
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
@@ -172,7 +189,7 @@ PHP_FUNCTION(bcsub)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(scale_param);
|
||||
scale = (int) Z_LVAL_PP(scale_param);
|
||||
scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -183,9 +200,11 @@ PHP_FUNCTION(bcsub)
|
||||
bc_init_num(&first TSRMLS_CC);
|
||||
bc_init_num(&second TSRMLS_CC);
|
||||
bc_init_num(&result TSRMLS_CC);
|
||||
bc_str2num(&first, Z_STRVAL_PP(left), scale TSRMLS_CC);
|
||||
bc_str2num(&second, Z_STRVAL_PP(right), scale TSRMLS_CC);
|
||||
php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC);
|
||||
php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC);
|
||||
bc_sub (first, second, &result, scale);
|
||||
if (result->n_scale > scale)
|
||||
result->n_scale = scale;
|
||||
Z_STRVAL_P(return_value) = bc_num2str(result);
|
||||
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
@@ -215,7 +234,7 @@ PHP_FUNCTION(bcmul)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(scale_param);
|
||||
scale = (int) Z_LVAL_PP(scale_param);
|
||||
scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -226,9 +245,11 @@ PHP_FUNCTION(bcmul)
|
||||
bc_init_num(&first TSRMLS_CC);
|
||||
bc_init_num(&second TSRMLS_CC);
|
||||
bc_init_num(&result TSRMLS_CC);
|
||||
bc_str2num(&first, Z_STRVAL_PP(left), scale TSRMLS_CC);
|
||||
bc_str2num(&second, Z_STRVAL_PP(right), scale TSRMLS_CC);
|
||||
php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC);
|
||||
php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC);
|
||||
bc_multiply (first, second, &result, scale TSRMLS_CC);
|
||||
if (result->n_scale > scale)
|
||||
result->n_scale = scale;
|
||||
Z_STRVAL_P(return_value) = bc_num2str(result);
|
||||
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
@@ -258,7 +279,7 @@ PHP_FUNCTION(bcdiv)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(scale_param);
|
||||
scale = (int) Z_LVAL_PP(scale_param);
|
||||
scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -269,10 +290,12 @@ PHP_FUNCTION(bcdiv)
|
||||
bc_init_num(&first TSRMLS_CC);
|
||||
bc_init_num(&second TSRMLS_CC);
|
||||
bc_init_num(&result TSRMLS_CC);
|
||||
bc_str2num(&first, Z_STRVAL_PP(left), scale TSRMLS_CC);
|
||||
bc_str2num(&second, Z_STRVAL_PP(right), scale TSRMLS_CC);
|
||||
php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC);
|
||||
php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC);
|
||||
switch (bc_divide (first, second, &result, scale TSRMLS_CC)) {
|
||||
case 0: /* OK */
|
||||
if (result->n_scale > scale)
|
||||
result->n_scale = scale;
|
||||
Z_STRVAL_P(return_value) = bc_num2str(result);
|
||||
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
@@ -348,7 +371,7 @@ PHP_FUNCTION(bcpow)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(scale_param);
|
||||
scale = (int) Z_LVAL_PP(scale_param);
|
||||
scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -359,9 +382,11 @@ PHP_FUNCTION(bcpow)
|
||||
bc_init_num(&first TSRMLS_CC);
|
||||
bc_init_num(&second TSRMLS_CC);
|
||||
bc_init_num(&result TSRMLS_CC);
|
||||
bc_str2num(&first, Z_STRVAL_PP(left), scale TSRMLS_CC);
|
||||
bc_str2num(&second, Z_STRVAL_PP(right), scale TSRMLS_CC);
|
||||
php_str2num(&first, Z_STRVAL_PP(left) TSRMLS_CC);
|
||||
php_str2num(&second, Z_STRVAL_PP(right) TSRMLS_CC);
|
||||
bc_raise (first, second, &result, scale TSRMLS_CC);
|
||||
if (result->n_scale > scale)
|
||||
result->n_scale = scale;
|
||||
Z_STRVAL_P(return_value) = bc_num2str(result);
|
||||
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
@@ -391,7 +416,7 @@ PHP_FUNCTION(bcsqrt)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(scale_param);
|
||||
scale = (int) Z_LVAL_PP(scale_param);
|
||||
scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -399,8 +424,10 @@ PHP_FUNCTION(bcsqrt)
|
||||
}
|
||||
convert_to_string_ex(left);
|
||||
bc_init_num(&result TSRMLS_CC);
|
||||
bc_str2num(&result, Z_STRVAL_PP(left), scale TSRMLS_CC);
|
||||
php_str2num(&result, Z_STRVAL_PP(left) TSRMLS_CC);
|
||||
if (bc_sqrt (&result, scale TSRMLS_CC) != 0) {
|
||||
if (result->n_scale > scale)
|
||||
result->n_scale = scale;
|
||||
Z_STRVAL_P(return_value) = bc_num2str(result);
|
||||
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
@@ -431,7 +458,7 @@ PHP_FUNCTION(bccomp)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(scale_param);
|
||||
scale = (int) Z_LVAL_PP(scale_param);
|
||||
scale = (int) (Z_LVAL_PP(scale_param)<0) ? 0:Z_LVAL_PP(scale_param);
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -465,7 +492,8 @@ PHP_FUNCTION(bcscale)
|
||||
}
|
||||
|
||||
convert_to_long_ex(new_scale);
|
||||
bc_precision = Z_LVAL_PP(new_scale);
|
||||
bc_precision = (Z_LVAL_PP(new_scale)<0) ? 0 : Z_LVAL_PP(new_scale);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
bcadd() function
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
bccomp() function
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
bcdiv() function
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
bcmod() function
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
bcmul() function
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
bcpow() function
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
bcscale() function
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
bcsqrt() function
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
bcsub() function
|
||||
--SKIP--
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--INI--
|
||||
bcmath.scale=0
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -260,6 +260,10 @@
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#if defined(PHP_WIN32) && _MSC_VER >= 1200
|
||||
#pragma setlocale("english")
|
||||
#endif
|
||||
|
||||
#include "sdncal.h"
|
||||
|
||||
#define HALAKIM_PER_HOUR 1080
|
||||
|
||||
+61
-136
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -15,7 +15,7 @@
|
||||
| Author: Zeev Suraski <zeev@zend.com> |
|
||||
| Harald Radi <h.radi@nme.at> |
|
||||
| Alan Brown <abrown@pobox.com> |
|
||||
| Wez Furlong <wez@thebrainroom.com> |
|
||||
| Wez Furlong <wez@thebrainroom.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
/* $Id$ */
|
||||
@@ -124,7 +124,7 @@ PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DIS
|
||||
if (C_ISREFD(obj)) {
|
||||
if (C_HASTLIB(obj)) {
|
||||
hr = C_TYPEINFO_VT(obj)->Invoke(C_TYPEINFO(obj), C_DISPATCH(obj), dispIdMember, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr);
|
||||
if (FAILED(hr)) {
|
||||
if (FAILED(hr) && (hr != DISP_E_EXCEPTION)) {
|
||||
hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, &IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr);
|
||||
if (SUCCEEDED(hr)) {
|
||||
/*
|
||||
@@ -726,7 +726,7 @@ PHP_FUNCTION(com_load)
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_RESOURCE(zend_list_insert(obj, IS_COM));
|
||||
RETVAL_COM(obj);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -744,7 +744,7 @@ static int do_COM_invoke(comval *obj, WORD dispflags, pval *function_name, VARIA
|
||||
int current_arg, current_variant;
|
||||
unsigned long count;
|
||||
|
||||
if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "next")) {
|
||||
if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "next")) {
|
||||
/* Grab one argument off the stack, allocate enough
|
||||
* VARIANTs
|
||||
* Get the IEnumVariant interface and call ->Next();
|
||||
@@ -896,7 +896,7 @@ static int do_COM_invoke(comval *obj, WORD dispflags, pval *function_name, VARIA
|
||||
efree(funcname);
|
||||
for (current_arg=0;current_arg<arg_count;current_arg++) {
|
||||
/* don't release IDispatch pointers as they are used afterwards */
|
||||
if (V_VT(&variant_args[current_arg]) != VT_DISPATCH) {
|
||||
if (V_VT(&(variant_args[current_arg])) != VT_DISPATCH) {
|
||||
/* @todo review this: what happens to an array of IDispatchs or a VARIANT->IDispatch */
|
||||
VariantClear(&variant_args[current_arg]);
|
||||
}
|
||||
@@ -918,6 +918,7 @@ static int do_COM_invoke(comval *obj, WORD dispflags, pval *function_name, VARIA
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto mixed com_invoke_ex(int module, int invokeflags, string handler_name [, mixed arg [, mixed ...]])
|
||||
Invokes a COM module */
|
||||
PHP_FUNCTION(com_invoke_ex)
|
||||
@@ -947,17 +948,7 @@ PHP_FUNCTION(com_invoke_ex)
|
||||
dispflags = (WORD)Z_LVAL_P(invokeflags);
|
||||
|
||||
/* obtain IDispatch interface */
|
||||
if (Z_TYPE_P(object) == IS_OBJECT && (Z_OBJCE_P(object) == &COM_class_entry || !strcmp(Z_OBJCE_P(object)->name, "COM"))) {
|
||||
zval **tmp;
|
||||
zend_hash_index_find(Z_OBJPROP_P(object), 0, (void**)&tmp);
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, "comval", IS_COM);
|
||||
} else if (Z_TYPE_P(object) == IS_RESOURCE) {
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, &object, -1, "comval", IS_COM);
|
||||
}
|
||||
if (obj == NULL) {
|
||||
php_error(E_WARNING, "%d is not a COM object handler", Z_LVAL_P(object));
|
||||
RETURN_NULL();
|
||||
}
|
||||
FETCH_COM_SAFE(object, obj);
|
||||
|
||||
ALLOC_VARIANT(var_result);
|
||||
|
||||
@@ -982,7 +973,6 @@ PHP_FUNCTION(com_invoke)
|
||||
pval **arguments;
|
||||
pval *object, *function_name;
|
||||
comval *obj;
|
||||
int type;
|
||||
int arg_count = ZEND_NUM_ARGS();
|
||||
VARIANT *var_result;
|
||||
|
||||
@@ -998,12 +988,7 @@ PHP_FUNCTION(com_invoke)
|
||||
function_name = arguments[1];
|
||||
|
||||
/* obtain IDispatch interface */
|
||||
convert_to_long(object);
|
||||
obj = (comval *)zend_list_find(Z_LVAL_P(object), &type);
|
||||
if (!obj || (type != IS_COM)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s is not a COM object handler", Z_STRVAL_P(function_name));
|
||||
RETURN_NULL();
|
||||
}
|
||||
FETCH_COM_SAFE(object, obj);
|
||||
|
||||
/* obtain property/method handler */
|
||||
convert_to_string_ex(&function_name);
|
||||
@@ -1030,7 +1015,6 @@ PHP_FUNCTION(com_release)
|
||||
{
|
||||
pval *object;
|
||||
comval *obj;
|
||||
int type;
|
||||
int arg_count = ZEND_NUM_ARGS();
|
||||
|
||||
if (arg_count != 1) {
|
||||
@@ -1042,12 +1026,7 @@ PHP_FUNCTION(com_release)
|
||||
}
|
||||
|
||||
/* obtain IDispatch interface */
|
||||
convert_to_long_ex(&object);
|
||||
obj = (comval *)zend_list_find(Z_LVAL_P(object), &type);
|
||||
if (!obj || (type != IS_COM)) {
|
||||
php_error(E_WARNING, "%s(): %d is not a COM object handler", get_active_function_name(TSRMLS_C));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
FETCH_COM_SAFE(object, obj);
|
||||
|
||||
RETURN_LONG(php_COM_release(obj TSRMLS_CC))
|
||||
}
|
||||
@@ -1060,7 +1039,6 @@ PHP_FUNCTION(com_addref)
|
||||
{
|
||||
pval *object;
|
||||
comval *obj;
|
||||
int type;
|
||||
int arg_count = ZEND_NUM_ARGS();
|
||||
|
||||
if (arg_count != 1) {
|
||||
@@ -1072,13 +1050,7 @@ PHP_FUNCTION(com_addref)
|
||||
}
|
||||
|
||||
/* obtain IDispatch interface */
|
||||
convert_to_long_ex(&object);
|
||||
obj = (comval *)zend_list_find(Z_LVAL_P(object), &type);
|
||||
if (!obj || (type != IS_COM))
|
||||
{
|
||||
php_error(E_WARNING, "%s(): %d is not a COM object handler", get_active_function_name(TSRMLS_C));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
FETCH_COM_SAFE(object, obj);
|
||||
|
||||
RETURN_LONG(php_COM_addref(obj TSRMLS_CC));
|
||||
}
|
||||
@@ -1453,12 +1425,8 @@ PHP_FUNCTION(com_print_typeinfo)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(arg1) == IS_OBJECT && (Z_OBJCE_P(arg1) == &COM_class_entry || !strcmp(Z_OBJCE_P(arg1)->name, "COM"))) {
|
||||
zval **tmp;
|
||||
zend_hash_index_find(Z_OBJPROP_P(arg1), 0, (void**)&tmp);
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, "comval", IS_COM);
|
||||
} else if (Z_TYPE_P(arg1) == IS_RESOURCE) {
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, &arg1, -1, "comval", IS_COM);
|
||||
if (Z_TYPE_P(arg1) == IS_OBJECT) {
|
||||
FETCH_COM_SAFE(arg1, obj);
|
||||
} else {
|
||||
convert_to_string(arg1);
|
||||
typelibname = Z_STRVAL_P(arg1);
|
||||
@@ -1492,14 +1460,8 @@ PHP_FUNCTION(com_event_sink)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(object) == IS_OBJECT && (Z_OBJCE_P(object) == &COM_class_entry || !strcmp(Z_OBJCE_P(object)->name, "COM"))) {
|
||||
zval **tmp;
|
||||
zend_hash_index_find(Z_OBJPROP_P(object), 0, (void**)&tmp);
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, "comval", IS_COM);
|
||||
} else {
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, &object, -1, "comval", IS_COM);
|
||||
}
|
||||
|
||||
FETCH_COM_SAFE(object, obj);
|
||||
|
||||
if (sink && Z_TYPE_P(sink) == IS_ARRAY) {
|
||||
/* 0 => typelibname, 1 => dispname */
|
||||
zval **tmp;
|
||||
@@ -1682,8 +1644,10 @@ static void do_COM_propput(pval *return_value, comval *obj, pval *arg_property,
|
||||
hr = php_COM_invoke(obj, dispid, DISPATCH_PROPERTYGET, &dispparams, var_result, &ErrString TSRMLS_CC);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
php_variant_to_pval(var_result, return_value, codepage TSRMLS_CC);
|
||||
RETVAL_VARIANT(var_result);
|
||||
} else {
|
||||
FREE_VARIANT(var_result);
|
||||
|
||||
*return_value = *value;
|
||||
zval_copy_ctor(return_value);
|
||||
}
|
||||
@@ -1691,10 +1655,10 @@ static void do_COM_propput(pval *return_value, comval *obj, pval *arg_property,
|
||||
if (ErrString) {
|
||||
pefree(ErrString, 1);
|
||||
}
|
||||
} else {
|
||||
FREE_VARIANT(var_result);
|
||||
}
|
||||
|
||||
FREE_VARIANT(var_result);
|
||||
|
||||
efree(new_value); // FREE_VARIANT does a VariantClear() which is not desired here !
|
||||
efree(propname);
|
||||
}
|
||||
@@ -1721,18 +1685,8 @@ PHP_FUNCTION(com_propget)
|
||||
object = arguments[0];
|
||||
function_name = arguments[1];
|
||||
|
||||
if (Z_TYPE_P(object) == IS_OBJECT && (Z_OBJCE_P(object) == &COM_class_entry || !strcmp(Z_OBJCE_P(object)->name, "COM"))) {
|
||||
zval **tmp;
|
||||
zend_hash_index_find(Z_OBJPROP_P(object), 0, (void**)&tmp);
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, "comval", IS_COM);
|
||||
} else if (Z_TYPE_P(object) == IS_RESOURCE) {
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, &object, -1, "comval", IS_COM);
|
||||
}
|
||||
if (obj == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 1 is not a COM object handler");
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
FETCH_COM_SAFE(object, obj);
|
||||
|
||||
/* obtain property/method handler */
|
||||
convert_to_string_ex(&function_name);
|
||||
|
||||
@@ -1773,18 +1727,8 @@ PHP_FUNCTION(com_propput)
|
||||
object = arguments[0];
|
||||
function_name = arguments[1];
|
||||
|
||||
if (Z_TYPE_P(object) == IS_OBJECT && (Z_OBJCE_P(object) == &COM_class_entry || !strcmp(Z_OBJCE_P(object)->name, "COM"))) {
|
||||
zval **tmp;
|
||||
zend_hash_index_find(Z_OBJPROP_P(object), 0, (void**)&tmp);
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, "comval", IS_COM);
|
||||
} else if (Z_TYPE_P(object) == IS_RESOURCE) {
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, &object, -1, "comval", IS_COM);
|
||||
}
|
||||
if (obj == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "parameter 1 is not a COM object handler");
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
FETCH_COM_SAFE(object, obj);
|
||||
|
||||
/* obtain property/method handler */
|
||||
convert_to_string_ex(&function_name);
|
||||
|
||||
@@ -1844,7 +1788,7 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
|
||||
{
|
||||
zend_overloaded_element *overloaded_property;
|
||||
zend_llist_element *element;
|
||||
pval return_value;
|
||||
pval retval;
|
||||
pval **comval_handle;
|
||||
pval *object = property_reference->object;
|
||||
int type;
|
||||
@@ -1852,14 +1796,14 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
|
||||
VARIANT *var_result;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
INIT_ZVAL(return_value);
|
||||
ZVAL_NULL(&return_value);
|
||||
INIT_ZVAL(retval);
|
||||
ZVAL_NULL(&retval);
|
||||
|
||||
/* fetch the IDispatch interface */
|
||||
zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle);
|
||||
obj = (comval *) zend_list_find(Z_LVAL_P(*comval_handle), &type);
|
||||
if (!obj || (type != IS_COM)) {
|
||||
return return_value;
|
||||
return retval;
|
||||
}
|
||||
|
||||
ALLOC_COM(obj_prop);
|
||||
@@ -1873,7 +1817,7 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
|
||||
FREE_VARIANT(var_result);
|
||||
FREE_COM(obj_prop);
|
||||
|
||||
return return_value;
|
||||
return retval;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1882,7 +1826,7 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
|
||||
FREE_VARIANT(var_result);
|
||||
FREE_COM(obj_prop);
|
||||
|
||||
return return_value;
|
||||
return retval;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1890,35 +1834,32 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
|
||||
FREE_VARIANT(var_result);
|
||||
|
||||
if (obj != obj_prop) {
|
||||
FREE_COM(obj_prop);
|
||||
efree(obj_prop);
|
||||
|
||||
return_value = *object;
|
||||
ZVAL_ADDREF(&return_value);
|
||||
retval = *object;
|
||||
zval_copy_ctor(&retval);
|
||||
} else {
|
||||
RETVAL_COM(obj);
|
||||
ZVAL_COM(&retval, obj);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (obj == obj_prop) {
|
||||
// not head
|
||||
pval_destructor(&overloaded_property->element);
|
||||
}
|
||||
zval_dtor(&overloaded_property->element);
|
||||
|
||||
if (V_VT(var_result) == VT_DISPATCH) {
|
||||
if (V_DISPATCH(var_result) == NULL) {
|
||||
FREE_VARIANT(var_result);
|
||||
FREE_COM(obj_prop);
|
||||
|
||||
return return_value;
|
||||
return retval;
|
||||
}
|
||||
|
||||
obj = obj_prop;
|
||||
php_COM_set(obj, &V_DISPATCH(var_result), TRUE TSRMLS_CC);
|
||||
VariantInit(var_result); // to protect C_DISPATCH(obj) from being freed when var_result is destructed
|
||||
} else {
|
||||
php_variant_to_pval(var_result, &return_value, codepage TSRMLS_CC);
|
||||
php_variant_to_pval(var_result, &retval, codepage TSRMLS_CC);
|
||||
|
||||
FREE_COM(obj_prop);
|
||||
obj_prop = NULL;
|
||||
@@ -1926,13 +1867,13 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer
|
||||
}
|
||||
|
||||
if (obj_prop != NULL) {
|
||||
RETVAL_COM(obj);
|
||||
ZVAL_COM(&retval, obj);
|
||||
}
|
||||
|
||||
|
||||
FREE_VARIANT(var_result);
|
||||
|
||||
return return_value;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -2002,7 +1943,7 @@ PHPAPI int php_COM_set_property_handler(zend_property_reference *property_refere
|
||||
}
|
||||
|
||||
VariantInit(var_result); // to protect C_DISPATCH(obj) from being freed when var_result is destructed
|
||||
pval_destructor(&overloaded_property->element);
|
||||
zval_dtor(&overloaded_property->element);
|
||||
}
|
||||
FREE_VARIANT(var_result);
|
||||
|
||||
@@ -2010,7 +1951,7 @@ PHPAPI int php_COM_set_property_handler(zend_property_reference *property_refere
|
||||
do_COM_propput(NULL, obj, &overloaded_property->element, value TSRMLS_CC);
|
||||
FREE_COM(obj_prop);
|
||||
|
||||
pval_destructor(&overloaded_property->element);
|
||||
zval_dtor(&overloaded_property->element);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -2041,20 +1982,15 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro
|
||||
if (zend_llist_count(property_reference->elements_list)==1
|
||||
&& !strcmp(Z_STRVAL(function_name->element), "com")) {
|
||||
/* constructor */
|
||||
pval *object_handle;
|
||||
|
||||
PHP_FN(com_load)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
if (zend_is_true(return_value)) {
|
||||
ALLOC_ZVAL(object_handle);
|
||||
*object_handle = *return_value;
|
||||
pval_copy_constructor(object_handle);
|
||||
INIT_PZVAL(object_handle);
|
||||
zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL);
|
||||
pval_destructor(&function_name->element);
|
||||
} else {
|
||||
ZVAL_NULL(object);
|
||||
}
|
||||
/* free instance created by 'new' */
|
||||
zval_dtor(object);
|
||||
|
||||
/* and override it with the instance created by 'com_load()' */
|
||||
*object = *return_value;
|
||||
INIT_ZVAL(*return_value);
|
||||
|
||||
zval_dtor(&function_name->element);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2062,8 +1998,8 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro
|
||||
property = php_COM_get_property_handler(property_reference);
|
||||
|
||||
if (Z_TYPE(property) != IS_OBJECT) {
|
||||
pval_destructor(&property);
|
||||
pval_destructor(&function_name->element);
|
||||
zval_dtor(&property);
|
||||
zval_dtor(&function_name->element);
|
||||
|
||||
/* error message - function call on a non-object */
|
||||
return;
|
||||
@@ -2073,8 +2009,8 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro
|
||||
obj = (comval *)zend_list_find(Z_LVAL_PP(handle), &type);
|
||||
|
||||
if (!obj || (type != IS_COM)) {
|
||||
pval_destructor(&property);
|
||||
pval_destructor(&function_name->element);
|
||||
zval_dtor(&property);
|
||||
zval_dtor(&function_name->element);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2092,24 +2028,20 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro
|
||||
|
||||
ALLOC_VARIANT(var_result);
|
||||
|
||||
arguments = (pval **) emalloc(sizeof(pval *)*arg_count);
|
||||
arguments = (zval **) emalloc(sizeof(zval *)*arg_count);
|
||||
zend_get_parameters_array(ht, arg_count, arguments);
|
||||
|
||||
if (do_COM_invoke(obj , DISPATCH_METHOD|DISPATCH_PROPERTYGET, &function_name->element, var_result, arguments, arg_count TSRMLS_CC) == SUCCESS) {
|
||||
php_variant_to_pval(var_result, return_value, codepage TSRMLS_CC);
|
||||
RETVAL_VARIANT(var_result);
|
||||
} else {
|
||||
FREE_VARIANT(var_result);
|
||||
}
|
||||
|
||||
FREE_VARIANT(var_result);
|
||||
|
||||
efree(arguments);
|
||||
}
|
||||
|
||||
if (zend_llist_count(property_reference->elements_list) > 1) {
|
||||
/* destruct temporary object */
|
||||
zend_list_delete(Z_LVAL_PP(handle));
|
||||
pval_destructor(&property);
|
||||
}
|
||||
|
||||
pval_destructor(&function_name->element);
|
||||
zval_dtor(&property);
|
||||
zval_dtor(&function_name->element);
|
||||
}
|
||||
|
||||
|
||||
@@ -2370,9 +2302,7 @@ PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
|
||||
PHP_FUNCTION(com_isenum)
|
||||
{
|
||||
pval *object;
|
||||
pval **comval_handle;
|
||||
comval *obj;
|
||||
int type;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
@@ -2381,12 +2311,7 @@ PHP_FUNCTION(com_isenum)
|
||||
zend_get_parameters(ht, 1, &object);
|
||||
|
||||
/* obtain IDispatch interface */
|
||||
zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle);
|
||||
obj = (comval *) zend_list_find(Z_LVAL_PP(comval_handle), &type);
|
||||
if (!obj || (type != IS_COM)) {
|
||||
php_error(E_WARNING,"%s(): %s is not a COM object handler", get_active_function_name(TSRMLS_C), "");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
FETCH_COM_SAFE(object, obj);
|
||||
|
||||
RETURN_BOOL(C_HASENUM(obj));
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+17
-4
@@ -42,20 +42,33 @@ END_EXTERN_C()
|
||||
} \
|
||||
ZVAL_RESOURCE(handle, zend_list_insert((o), IS_COM)); \
|
||||
\
|
||||
zval_copy_ctor(handle); \
|
||||
zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \
|
||||
object_and_properties_init(z, &COM_class_entry, properties); \
|
||||
(z)->is_ref=1; \
|
||||
}
|
||||
|
||||
#define RETVAL_COM(o) ZVAL_COM(&return_value, o);
|
||||
#define RETVAL_COM(o) ZVAL_COM(return_value, o);
|
||||
#define RETURN_COM(o) RETVAL_COM(o) \
|
||||
return;
|
||||
|
||||
#define ALLOC_COM(z) (z) = (comval *) ecalloc(1, sizeof(comval)); \
|
||||
C_REFCOUNT(z) = 0;
|
||||
#define ALLOC_COM(z) (z) = (comval *) ecalloc(1, sizeof(comval));
|
||||
|
||||
#define FREE_COM(z) php_COM_destruct(z TSRMLS_CC);
|
||||
|
||||
#define FETCH_COM(z, obj) { \
|
||||
zval **tmp; \
|
||||
zend_hash_index_find(Z_OBJPROP_P(z), 0, (void**)&tmp); \
|
||||
ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, "comval", IS_COM); \
|
||||
} \
|
||||
if (obj == NULL) { \
|
||||
php_error(E_WARNING, "%d is not a COM object handler", Z_LVAL_P(z)); \
|
||||
RETURN_NULL(); \
|
||||
}
|
||||
|
||||
#define FETCH_COM_SAFE(z, obj) \
|
||||
if ((Z_TYPE_P(z) == IS_OBJECT) && (Z_OBJCE_P(z) == &COM_class_entry)) \
|
||||
FETCH_COM(z, obj)
|
||||
|
||||
#define IS_COM php_COM_get_le_comval()
|
||||
|
||||
#define C_HASTLIB(x) ((x)->typelib)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -729,7 +729,6 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TS
|
||||
php_COM_set(obj, &V_DISPATCH(var_arg), FALSE TSRMLS_CC);
|
||||
|
||||
ZVAL_COM(pval_arg, obj);
|
||||
VariantInit(var_arg); // to protect C_DISPATCH(obj) from being freed when var_result is destructed
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+13
-8
@@ -12,14 +12,19 @@
|
||||
|
||||
#define IS_VARIANT php_VARIANT_get_le_variant()
|
||||
|
||||
#define ZVAL_VARIANT(z, v) if (V_VT(v) == VT_DISPATCH) { \
|
||||
comval *obj; \
|
||||
ALLOC_COM(obj); \
|
||||
php_COM_set(obj, &V_DISPATCH(v), TRUE TSRMLS_CC); \
|
||||
ZVAL_RESOURCE((z), zend_list_insert(obj, IS_COM)); \
|
||||
} else { \
|
||||
php_variant_to_pval((v), (z), codepage TSRMLS_CC); \
|
||||
FREE_VARIANT(v); \
|
||||
#define ZVAL_VARIANT(z, v) if (V_VT(v) == VT_DISPATCH) { \
|
||||
if (V_DISPATCH(v)) { \
|
||||
comval *obj; \
|
||||
ALLOC_COM(obj); \
|
||||
php_COM_set(obj, &V_DISPATCH(v), TRUE TSRMLS_CC); \
|
||||
ZVAL_COM((z), obj); \
|
||||
efree(v); \
|
||||
} else { \
|
||||
ZVAL_NULL(z); \
|
||||
} \
|
||||
} else { \
|
||||
php_variant_to_pval((v), (z), codepage TSRMLS_CC); \
|
||||
FREE_VARIANT(v); \
|
||||
}
|
||||
|
||||
#define RETVAL_VARIANT(v) ZVAL_VARIANT(return_value, (v));
|
||||
|
||||
+87
-61
@@ -1,70 +1,96 @@
|
||||
dnl $Id$
|
||||
|
||||
AC_DEFUN(CPDF_TEMP_SUBST,[
|
||||
old_LIBS=$LIBS
|
||||
$1
|
||||
LIBS=$old_LIBS
|
||||
])
|
||||
|
||||
AC_DEFUN(CPDF_JPEG_TEST,[
|
||||
CPDF_TEMP_SUBST([
|
||||
AC_ARG_WITH(jpeg-dir,
|
||||
[ --with-jpeg-dir[=DIR] CPDF: Set the path to libjpeg install prefix.],[
|
||||
for i in $withval /usr/local /usr; do
|
||||
if test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a; then
|
||||
CPDF_JPEG_DIR=$i
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test -z "$CPDF_JPEG_DIR"; then
|
||||
AC_MSG_CHECKING([for libjpeg (needed by cpdflib 2.x)])
|
||||
AC_MSG_ERROR([libjpeg.(a|so) not found.])
|
||||
fi
|
||||
LIBS="$LIBS -L$CPDF_JPEG_DIR/lib"
|
||||
],)
|
||||
AC_CHECK_LIB(jpeg,jpeg_read_header, ,[AC_MSG_ERROR(Problem with libjpeg.(a|so). Please check config.log for more information.)],)
|
||||
if test -z $CPDF_JPEG_DIR; then
|
||||
PHP_ADD_LIBRARY(jpeg)
|
||||
else
|
||||
PHP_ADD_LIBRARY_WITH_PATH(jpeg, $CPDF_JPEG_DIR/lib)
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN(CPDF_TIFF_TEST,[
|
||||
CPDF_TEMP_SUBST([
|
||||
AC_ARG_WITH(tiff-dir,
|
||||
[ --with-tiff-dir[=DIR] CPDF: Set the path to libtiff install prefix.],[
|
||||
for i in $withval /usr/local /usr; do
|
||||
if test -f $i/lib/libtiff.$SHLIB_SUFFIX_NAME -o -f $i/lib/libtiff.a; then
|
||||
CPDF_TIFF_DIR=$i
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test -z "$CPDF_TIFF_DIR"; then
|
||||
AC_MSG_CHECKING([for libtiff (needed by cpdflib 2.x)])
|
||||
AC_MSG_ERROR([libtiff.(a|so) not found.])
|
||||
fi
|
||||
LIBS="$LIBS -L$CPDF_TIFF_DIR/lib"
|
||||
],)
|
||||
AC_CHECK_LIB(tiff,TIFFOpen, ,[AC_MSG_ERROR(Problem with libtiff.(a|so). Please check config.log for more information.)],)
|
||||
if test -z $CPDF_TIFF_DIR; then
|
||||
PHP_ADD_LIBRARY(tiff)
|
||||
else
|
||||
PHP_ADD_LIBRARY_WITH_PATH(tiff, $CPDF_TIFF_DIR/lib)
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(for cpdflib support)
|
||||
AC_ARG_WITH(cpdflib,
|
||||
[ --with-cpdflib[=DIR] Include cpdflib support (requires cpdflib >= 2).],
|
||||
[
|
||||
case $withval in
|
||||
no)
|
||||
AC_MSG_RESULT(no) ;;
|
||||
yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_NEW_EXTENSION(cpdf, cpdf.c)
|
||||
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
|
||||
[AC_MSG_ERROR([Cpdf module requires cpdflib >= 2.])])
|
||||
PHP_ADD_LIBRARY(cpdf)
|
||||
PHP_ADD_LIBRARY(tiff)
|
||||
PHP_ADD_LIBRARY(jpeg)
|
||||
;;
|
||||
*)
|
||||
test -f $withval/include/cpdflib.h && CPDFLIB_INCLUDE=$withval/include
|
||||
if test -n "$CPDFLIB_INCLUDE" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_NEW_EXTENSION(cpdf, cpdf.c)
|
||||
old_LIBS=$LIBS
|
||||
old_withval=$withval
|
||||
|
||||
AC_MSG_CHECKING([for libjpeg (needed by cpdflib 2.x)])
|
||||
AC_ARG_WITH(jpeg-dir,
|
||||
[ --with-jpeg-dir[=DIR] jpeg dir for cpdflib 2.x],[
|
||||
AC_MSG_RESULT(yes)
|
||||
if test -z $withval; then
|
||||
withval=/usr/local
|
||||
fi
|
||||
LIBS="$LIBS -L$withval/lib"
|
||||
AC_CHECK_LIB(jpeg,jpeg_read_header, ,[AC_MSG_RESULT(no)],)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(jpeg, $withval/lib)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN(If configure fails try --with-jpeg-dir=<DIR>)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([for libtiff (needed by cpdflib 2.x)])
|
||||
AC_ARG_WITH(tiff-dir,
|
||||
[ --with-tiff-dir[=DIR] tiff dir for cpdflib 2.x],[
|
||||
AC_MSG_RESULT(yes)
|
||||
if test -z $withval; then
|
||||
withval=/usr/local
|
||||
fi
|
||||
LIBS="$LIBS -L$withval/lib"
|
||||
AC_CHECK_LIB(tiff,TIFFOpen, ,[AC_MSG_RESULT(no)],)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(tiff, $withval/lib)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN(If configure fails try --with-tiff-dir=<DIR>)
|
||||
])
|
||||
withval=$old_withval
|
||||
|
||||
LIBS="$LIBS -L$withval/lib"
|
||||
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
|
||||
[AC_MSG_ERROR([Cpdflib module requires cpdflib >= 2.])])
|
||||
LIBS=$old_LIBS
|
||||
PHP_ADD_LIBRARY_WITH_PATH(cpdf, $withval/lib)
|
||||
PHP_ADD_INCLUDE($CPDFLIB_INCLUDE)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi ;;
|
||||
esac
|
||||
if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_NEW_EXTENSION(cpdf, cpdf.c)
|
||||
CPDF_JPEG_TEST
|
||||
CPDF_TIFF_TEST
|
||||
for i in $withval /usr /usr/local; do
|
||||
if test -f $i/include/cpdflib.h; then
|
||||
CPDFLIB_INCLUDE=$i/include
|
||||
AC_MSG_CHECKING(for cpdflib.h)
|
||||
AC_MSG_RESULT([in $i/include])
|
||||
CPDF_TEMP_SUBST([
|
||||
LIBS="$LIBS -L$i/lib"
|
||||
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
|
||||
[AC_MSG_ERROR([Cpdflib module requires cpdflib >= 2.])])
|
||||
])
|
||||
if test "$i" != "/usr" -a "$i" != "/usr/local"; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(cpdf, $i/lib)
|
||||
PHP_ADD_INCLUDE($CPDFLIB_INCLUDE)
|
||||
else
|
||||
PHP_ADD_LIBRARY(cpdf)
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test -z "$CPDFLIB_INCLUDE"; then
|
||||
AC_MSG_CHECKING(for cpdflib.h)
|
||||
AC_MSG_ERROR([not found])
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
+3
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -41,6 +41,8 @@
|
||||
#include <gd.h>
|
||||
#endif
|
||||
|
||||
#include <cpdflib.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
+1
-3
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -29,8 +29,6 @@
|
||||
#undef T
|
||||
#endif
|
||||
|
||||
#include <cpdflib.h>
|
||||
|
||||
extern zend_module_entry cpdf_module_entry;
|
||||
#define cpdf_module_ptr &cpdf_module_entry
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -18,6 +18,7 @@ if test "$PHP_CURL" != "no"; then
|
||||
if test -r $i/include/curl/easy.h; then
|
||||
CURL_DIR=$i
|
||||
AC_MSG_RESULT(found in $i)
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
+76
-45
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -191,7 +191,10 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE_DEFAULT);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_CRLF);
|
||||
|
||||
#ifdef CURLOPT_ENCODING
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_ENCODING);
|
||||
#endif
|
||||
|
||||
/* Constants effecting the way CURLOPT_CLOSEPOLICY works */
|
||||
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
|
||||
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC);
|
||||
@@ -335,7 +338,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
|
||||
switch (t->method) {
|
||||
case PHP_CURL_STDOUT:
|
||||
PUTS(data);
|
||||
PHPWRITE(data, size);
|
||||
break;
|
||||
case PHP_CURL_FILE:
|
||||
return fwrite(data, size, nmemb, t->fp);
|
||||
@@ -391,7 +394,9 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
|
||||
switch (t->method) {
|
||||
case PHP_CURL_DIRECT:
|
||||
length = fread(data, size, nmemb, t->fp);
|
||||
if (t->fp) {
|
||||
length = fread(data, size, nmemb, t->fp);
|
||||
}
|
||||
break;
|
||||
case PHP_CURL_USER: {
|
||||
zval *argv[3];
|
||||
@@ -453,7 +458,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
|
||||
if (ch->handlers->write->method == PHP_CURL_RETURN)
|
||||
smart_str_appendl(&ch->handlers->write->buf, data, (int) length);
|
||||
else
|
||||
PUTS(data);
|
||||
PHPWRITE(data, size);
|
||||
break;
|
||||
case PHP_CURL_FILE:
|
||||
return fwrite(data, size, nmemb, t->fp);
|
||||
@@ -733,9 +738,13 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_COOKIEJAR:
|
||||
case CURLOPT_SSL_CIPHER_LIST:
|
||||
case CURLOPT_SSLKEY:
|
||||
case CURLOPT_SSLCERT:
|
||||
case CURLOPT_SSLKEYTYPE:
|
||||
case CURLOPT_SSLKEYPASSWD:
|
||||
case CURLOPT_SSLENGINE:
|
||||
#ifdef CURLOPT_ENCODING
|
||||
case CURLOPT_ENCODING:
|
||||
#endif
|
||||
case CURLOPT_SSLENGINE_DEFAULT: {
|
||||
char *copystr = NULL;
|
||||
|
||||
@@ -1035,46 +1044,68 @@ PHP_FUNCTION(curl_getinfo)
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_URL, &s_code);
|
||||
CAAS("url", s_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_TYPE, &s_code);
|
||||
CAAS("content_type", s_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_HTTP_CODE, &l_code);
|
||||
CAAL("http_code", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_HEADER_SIZE, &l_code);
|
||||
CAAL("header_size", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_REQUEST_SIZE, &l_code);
|
||||
CAAL("request_size", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_FILETIME, &l_code);
|
||||
CAAL("filetime", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SSL_VERIFYRESULT, &l_code);
|
||||
CAAL("ssl_verify_result", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_COUNT, &l_code);
|
||||
CAAL("redirect_count", l_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME, &d_code);
|
||||
CAAD("total_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME, &d_code);
|
||||
CAAD("namelookup_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME, &d_code);
|
||||
CAAD("connect_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME, &d_code);
|
||||
CAAD("pretransfer_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SIZE_UPLOAD, &d_code);
|
||||
CAAD("size_upload", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SIZE_DOWNLOAD, &d_code);
|
||||
CAAD("size_download", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SPEED_DOWNLOAD, &d_code);
|
||||
CAAD("speed_download", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_SPEED_UPLOAD, &d_code);
|
||||
CAAD("speed_upload", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d_code);
|
||||
CAAD("download_content_length", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_UPLOAD, &d_code);
|
||||
CAAD("upload_content_length", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_STARTTRANSFER_TIME, &d_code);
|
||||
CAAD("starttransfer_time", d_code);
|
||||
curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_TIME, &d_code);
|
||||
CAAD("redirect_time", d_code);
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_URL, &s_code) == CURLE_OK) {
|
||||
CAAS("url", s_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_TYPE, &s_code) == CURLE_OK) {
|
||||
if (s_code != NULL) {
|
||||
CAAS("content_type", s_code);
|
||||
}
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_HTTP_CODE, &l_code) == CURLE_OK) {
|
||||
CAAL("http_code", l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_HEADER_SIZE, &l_code) == CURLE_OK) {
|
||||
CAAL("header_size", l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_REQUEST_SIZE, &l_code) == CURLE_OK) {
|
||||
CAAL("request_size", l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_FILETIME, &l_code) == CURLE_OK) {
|
||||
CAAL("filetime", l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SSL_VERIFYRESULT, &l_code) == CURLE_OK) {
|
||||
CAAL("ssl_verify_result", l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_COUNT, &l_code) == CURLE_OK) {
|
||||
CAAL("redirect_count", l_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("total_time", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("namelookup_time", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("connect_time", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("pretransfer_time", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_UPLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("size_upload", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SIZE_DOWNLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("size_download", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_DOWNLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("speed_download", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_SPEED_UPLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("speed_upload", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("download_content_length", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_UPLOAD, &d_code) == CURLE_OK) {
|
||||
CAAD("upload_content_length", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_STARTTRANSFER_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("starttransfer_time", d_code);
|
||||
}
|
||||
if (curl_easy_getinfo(ch->cp, CURLINFO_REDIRECT_TIME, &d_code) == CURLE_OK) {
|
||||
CAAD("redirect_time", d_code);
|
||||
}
|
||||
} else {
|
||||
option = Z_LVAL_PP(zoption);
|
||||
switch (option) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -108,7 +108,7 @@ PHP_MINFO_FUNCTION(cyrus)
|
||||
|
||||
extern void fatal(char *s, int exit)
|
||||
{
|
||||
php_error(E_ERROR, s);
|
||||
php_error(E_ERROR, "%s", s);
|
||||
}
|
||||
|
||||
/* {{{ proto resource cyrus_connect([ string host [, string port [, int flags]]])
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -260,7 +260,7 @@ PHP_MINFO_FUNCTION(db)
|
||||
{
|
||||
/* this isn't pretty ... should break out the info a bit more (cmv) */
|
||||
php_info_print_box_start(0);
|
||||
php_printf(php_get_info_db());
|
||||
php_printf("%s", php_get_info_db());
|
||||
php_info_print_box_end();
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+261
-128
@@ -2,7 +2,11 @@ dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
dnl Suppose we need FlatFile if no or only CDB is used.
|
||||
dnl Suppose we need FlatFile if no support or only CDB is used.
|
||||
|
||||
AC_DEFUN(PHP_DBA_STD_BEGIN,[
|
||||
unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_TEMP_LDFLAGS,[
|
||||
old_LDFLAGS=$LDFLAGS
|
||||
@@ -14,7 +18,6 @@ AC_DEFUN(PHP_TEMP_LDFLAGS,[
|
||||
dnl Assign INCLUDE/LFLAGS from PREFIX
|
||||
AC_DEFUN(PHP_DBA_STD_ASSIGN,[
|
||||
if test -n "$THIS_PREFIX" && test "$THIS_PREFIX" != "/usr"; then
|
||||
THIS_INCLUDE=$THIS_PREFIX/include
|
||||
THIS_LFLAGS=$THIS_PREFIX/lib
|
||||
fi
|
||||
])
|
||||
@@ -22,195 +25,315 @@ AC_DEFUN(PHP_DBA_STD_ASSIGN,[
|
||||
dnl Standard check
|
||||
AC_DEFUN(PHP_DBA_STD_CHECK,[
|
||||
THIS_RESULT="yes"
|
||||
if test "$THIS_PREFIX" != "/usr" -a "$THIS_INCLUDE" = ""; then
|
||||
if test -z "$THIS_INCLUDE"; then
|
||||
AC_MSG_ERROR(cannot find necessary header file(s))
|
||||
fi
|
||||
if test "$THIS_LIBS" = "" ; then
|
||||
if test -z "$THIS_LIBS"; then
|
||||
AC_MSG_ERROR(cannot find necessary library)
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Attach THIS_x to DBA_x
|
||||
AC_DEFUN(PHP_DBA_STD_ATTACH,[
|
||||
PHP_ADD_INCLUDE($THIS_INCLUDE)
|
||||
PHP_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD)
|
||||
unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX
|
||||
])
|
||||
|
||||
dnl Print the result message
|
||||
dnl parameters(name [, full name [, empty or error message]])
|
||||
AC_DEFUN(AC_DBA_STD_RESULT,[
|
||||
THIS_NAME=[]translit($1,a-z0-9-,A-Z0-9_)
|
||||
if test -n "$2"; then
|
||||
THIS_FULL_NAME="$2"
|
||||
else
|
||||
THIS_FULL_NAME="$THIS_NAME"
|
||||
fi
|
||||
AC_MSG_CHECKING(for $THIS_FULL_NAME support)
|
||||
if test -n "$3"; then
|
||||
AC_MSG_ERROR($3)
|
||||
fi
|
||||
if test "$THIS_RESULT" = "yes" -o "$THIS_RESULT" = "builtin"; then
|
||||
HAVE_DBA=1
|
||||
eval HAVE_$THIS_NAME=1
|
||||
AC_MSG_RESULT($THIS_RESULT)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
unset THIS_RESULT
|
||||
unset THIS_RESULT THIS_NAME THIS_FULL_NAME
|
||||
])
|
||||
|
||||
PHP_ARG_ENABLE(dba,whether to enable DBA,
|
||||
[ --enable-dba Build DBA with builtin modules])
|
||||
|
||||
AC_ARG_WITH(gdbm,
|
||||
[ --with-gdbm[=DIR] Include GDBM support],[
|
||||
[ --with-gdbm[=DIR] DBA: Include GDBM support],[
|
||||
if test "$withval" != "no"; then
|
||||
for i in /usr/local /usr $withval; do
|
||||
PHP_DBA_STD_BEGIN
|
||||
for i in $withval /usr/local /usr; do
|
||||
if test -f "$i/include/gdbm.h"; then
|
||||
THIS_PREFIX="$i"
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/gdbm.h
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
unset ac_cv_lib_gdbm_gdbm_open
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB(gdbm, gdbm_open, [AC_DEFINE(DBA_GDBM, 1, [ ]) THIS_LIBS=gdbm])
|
||||
])
|
||||
if test -n "$THIS_INCLUDE"; then
|
||||
unset ac_cv_lib_gdbm_gdbm_open
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB(gdbm, gdbm_open, [
|
||||
AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
|
||||
AC_DEFINE(DBA_GDBM, 1, [ ])
|
||||
THIS_LIBS=gdbm
|
||||
])
|
||||
])
|
||||
fi
|
||||
|
||||
PHP_DBA_STD_ASSIGN
|
||||
PHP_DBA_STD_CHECK
|
||||
PHP_DBA_STD_ATTACH
|
||||
fi
|
||||
])
|
||||
AC_MSG_CHECKING(for GDBM support)
|
||||
AC_DBA_STD_RESULT
|
||||
AC_DBA_STD_RESULT(gdbm)
|
||||
|
||||
AC_ARG_WITH(ndbm,
|
||||
[ --with-ndbm[=DIR] Include NDBM support],[
|
||||
[ --with-ndbm[=DIR] DBA: Include NDBM support],[
|
||||
if test "$withval" != "no"; then
|
||||
for i in /usr/local /usr $withval; do
|
||||
if test -f "$i/include/db1/ndbm.h" ; then
|
||||
PHP_DBA_STD_BEGIN
|
||||
for i in $withval /usr/local /usr; do
|
||||
if test -f "$i/include/ndbm.h"; then
|
||||
THIS_PREFIX=$i
|
||||
NDBM_EXTRA=db1/ndbm.h
|
||||
elif test -f "$i/include/ndbm.h" ; then
|
||||
THIS_INCLUDE=$i/include/ndbm.h
|
||||
break
|
||||
elif test -f "$i/include/db1/ndbm.h"; then
|
||||
THIS_PREFIX=$i
|
||||
NDBM_EXTRA=ndbm.h
|
||||
THIS_INCLUDE=$i/include/db1/ndbm.h
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$NDBM_EXTRA" != ""; then
|
||||
AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$NDBM_EXTRA", [ ])
|
||||
fi
|
||||
|
||||
for LIB in db1 ndbm c; do
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB($LIB, dbm_open, [AC_DEFINE(DBA_NDBM,1, [ ]) THIS_LIBS=$LIB])
|
||||
])
|
||||
done
|
||||
|
||||
if test -n "$THIS_INCLUDE"; then
|
||||
for LIB in ndbm db1 c; do
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB($LIB, dbm_open, [
|
||||
AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
|
||||
AC_DEFINE(DBA_NDBM,1, [ ])
|
||||
THIS_LIBS=$LIB
|
||||
break
|
||||
])
|
||||
])
|
||||
done
|
||||
fi
|
||||
|
||||
PHP_DBA_STD_ASSIGN
|
||||
PHP_DBA_STD_CHECK
|
||||
PHP_DBA_STD_ATTACH
|
||||
fi
|
||||
])
|
||||
AC_MSG_CHECKING(for NDBM support)
|
||||
AC_DBA_STD_RESULT
|
||||
AC_DBA_STD_RESULT(ndbm)
|
||||
|
||||
AC_ARG_WITH(db2,
|
||||
[ --with-db2[=DIR] Include Berkeley DB2 support],[
|
||||
if test "$withval" != "no"; then
|
||||
for i in /usr/local /usr /usr/BerkeleyDB $withval/BerkeleyDB $withval; do
|
||||
if test -f "$i/db2/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
DB2_EXTRA=db2
|
||||
elif test -f "$i/include/db2/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
DB2_EXTRA=db2/db.h
|
||||
elif test -f "$i/include/db/db2.h"; then
|
||||
THIS_PREFIX=$i
|
||||
DB2_EXTRA=db/db2.h
|
||||
elif test -f "$i/include/db2.h"; then
|
||||
THIS_PREFIX=$i
|
||||
DB2_EXTRA=db2.h
|
||||
elif test -f "$i/include/db.h" ; then
|
||||
THIS_PREFIX=$i
|
||||
DB2_EXTRA=db.h
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$DB2_EXTRA" = "db2" ; then
|
||||
DBA_INCLUDE="$DBA_INCLUDE -I$THIS_PREFIX/db2"
|
||||
DB2_EXTRA=db.h
|
||||
fi
|
||||
|
||||
if test -n "$DB2_EXTRA"; then
|
||||
AC_DEFINE_UNQUOTED(DB2_INCLUDE_FILE, "$DB2_EXTRA", [ ])
|
||||
fi
|
||||
|
||||
for LIB in db db2 c; do
|
||||
dnl Berkeley specific (library and version test)
|
||||
dnl parameters(version, library list, function)
|
||||
AC_DEFUN(PHP_DBA_DB_CHECK,[
|
||||
for LIB in $2; do
|
||||
if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f $THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB($LIB, db_appinit, [AC_DEFINE(DBA_DB2,1,[ ]) THIS_LIBS=$LIB])
|
||||
AC_CHECK_LIB($LIB, $3, [
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include "$THIS_INCLUDE"
|
||||
yes
|
||||
#endif
|
||||
],[
|
||||
THIS_LIBS=$LIB
|
||||
break
|
||||
])
|
||||
])
|
||||
])
|
||||
done
|
||||
|
||||
PHP_DBA_STD_ASSIGN
|
||||
PHP_DBA_STD_CHECK
|
||||
PHP_DBA_STD_ATTACH
|
||||
fi
|
||||
done
|
||||
if test "$1" = "4"; then
|
||||
AC_MSG_CHECKING(for db4 minor version and patch level)
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include "$THIS_INCLUDE"
|
||||
#if DB_VERSION_MINOR != 1 || DB_VERSION_PATCH >= 25
|
||||
yes
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT(ok)
|
||||
],[
|
||||
AC_MSG_ERROR(Version 4.1 requires patch level 25)
|
||||
])
|
||||
fi
|
||||
if test "$ext_shared" = "yes"; then
|
||||
AC_MSG_CHECKING(if db can be used as shared extension)
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include "$THIS_INCLUDE"
|
||||
#if DB_VERSION_MAJOR > 3 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR > 2)
|
||||
yes
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
],[
|
||||
AC_MSG_ERROR(At least version 3.3 is required)
|
||||
])
|
||||
fi
|
||||
if test -n "$THIS_LIBS"; then
|
||||
AC_DEFINE(DBA_DB$1, 1, [ ])
|
||||
if test -n "$THIS_INCLUDE"; then
|
||||
AC_DEFINE_UNQUOTED(DB$1_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
|
||||
fi
|
||||
fi
|
||||
PHP_DBA_STD_ASSIGN
|
||||
PHP_DBA_STD_CHECK
|
||||
PHP_DBA_STD_ATTACH
|
||||
])
|
||||
AC_MSG_CHECKING(for Berkeley DB2 support)
|
||||
AC_DBA_STD_RESULT
|
||||
|
||||
AC_ARG_WITH(db3,
|
||||
[ --with-db3[=DIR] Include Berkeley DB3 support],[
|
||||
AC_ARG_WITH(db4,
|
||||
[ --with-db4[=DIR] DBA: Include Berkeley DB4 support],[
|
||||
if test "$withval" != "no"; then
|
||||
for i in /usr/local /usr /usr/local/BerkeleyDB.3.0 $withval; do
|
||||
if test -f "$i/db3/db.h"; then
|
||||
PHP_DBA_STD_BEGIN
|
||||
for i in $withval /usr/local/BerkeleyDB.4.1 /usr/local/BerkeleyDB.4.0 /usr/local /usr; do
|
||||
if test -f "$i/db4/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
DB3_EXTRA=db3
|
||||
elif test -f "$i/include/db3/db.h"; then
|
||||
THIS_INCLUDE=$i/db4/db.h
|
||||
break
|
||||
elif test -f "$i/include/db4/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
DB3_EXTRA=db3/db.h
|
||||
elif test -f "$i/include/db/db3.h"; then
|
||||
THIS_INCLUDE=$i/include/db4/db.h
|
||||
break
|
||||
elif test -f "$i/include/db/db4.h"; then
|
||||
THIS_PREFIX=$i
|
||||
DB3_EXTRA=db/db3.h
|
||||
elif test -f "$i/include/db3.h"; then
|
||||
THIS_INCLUDE=$i/include/db/db4.h
|
||||
break
|
||||
elif test -f "$i/include/db4.h"; then
|
||||
THIS_PREFIX=$i
|
||||
DB3_EXTRA=db3.h
|
||||
THIS_INCLUDE=$i/include/db4.h
|
||||
break
|
||||
elif test -f "$i/include/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
DB3_EXTRA=db.h
|
||||
THIS_INCLUDE=$i/include/db.h
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if test -n "$DB3_EXTRA"; then
|
||||
AC_DEFINE_UNQUOTED(DB3_INCLUDE_FILE, "$DB3_EXTRA", [ ])
|
||||
fi
|
||||
|
||||
for LIB in db-3.1 db-3 db3 db; do
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB($LIB, db_create, [AC_DEFINE(DBA_DB3,1,[ ]) THIS_LIBS=$LIB])
|
||||
])
|
||||
done
|
||||
|
||||
PHP_DBA_STD_ASSIGN
|
||||
PHP_DBA_STD_CHECK
|
||||
PHP_DBA_STD_ATTACH
|
||||
PHP_DBA_DB_CHECK(4, db-4.1 db-4.0 db-4 db4 db, db_create)
|
||||
fi
|
||||
])
|
||||
AC_MSG_CHECKING(for Berkeley DB3 support)
|
||||
AC_DBA_STD_RESULT
|
||||
AC_DBA_STD_RESULT(db4,Berkeley DB4)
|
||||
|
||||
AC_ARG_WITH(db3,
|
||||
[ --with-db3[=DIR] DBA: Include Berkeley DB3 support],[
|
||||
if test "$withval" != "no"; then
|
||||
PHP_DBA_STD_BEGIN
|
||||
if test "$HAVE_DB4" = "1"; then
|
||||
AC_DBA_STD_RESULT(db3,Berkeley DB3,You cannot combine --with-db3 with --with-db4)
|
||||
fi
|
||||
for i in $withval /usr/local/BerkeleyDB.3.3 /usr/local/BerkeleyDB.3.2 /usr/local/BerkeleyDB.3.1 /usr/local/BerkeleyDB.3.0 /usr/local /usr; do
|
||||
if test -f "$i/db3/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db3/db.h
|
||||
break
|
||||
elif test -f "$i/include/db3/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db3/db.h
|
||||
break
|
||||
elif test -f "$i/include/db/db3.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db/db3.h
|
||||
break
|
||||
elif test -f "$i/include/db3.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db3.h
|
||||
break
|
||||
elif test -f "$i/include/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db.h
|
||||
break
|
||||
fi
|
||||
done
|
||||
PHP_DBA_DB_CHECK(3, db-3.3 db-3.2 db-3.1 db-3.0 db-3 db3 db, db_create)
|
||||
fi
|
||||
])
|
||||
AC_DBA_STD_RESULT(db3,Berkeley DB3)
|
||||
|
||||
AC_ARG_WITH(db2,
|
||||
[ --with-db2[=DIR] DBA: Include Berkeley DB2 support],[
|
||||
if test "$withval" != "no"; then
|
||||
PHP_DBA_STD_BEGIN
|
||||
if test "$HAVE_DB3" = "1" -o "$HAVE_DB4" = "1"; then
|
||||
AC_DBA_STD_RESULT(db2,Berkeley DB2,You cannot combine --with-db2 with --with-db3 or --with-db4)
|
||||
fi
|
||||
for i in $withval $withval/BerkeleyDB /usr/BerkeleyDB /usr/local /usr; do
|
||||
if test -f "$i/db2/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/db2/db.h
|
||||
break
|
||||
elif test -f "$i/include/db2/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db2/db.h
|
||||
break
|
||||
elif test -f "$i/include/db/db2.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db/db2.h
|
||||
break
|
||||
elif test -f "$i/include/db2.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db2.h
|
||||
break
|
||||
elif test -f "$i/include/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/db.h
|
||||
break
|
||||
fi
|
||||
done
|
||||
PHP_DBA_DB_CHECK(2, db-2 db2 db, db_appinit)
|
||||
fi
|
||||
])
|
||||
AC_DBA_STD_RESULT(db2,Berkeley DB2)
|
||||
|
||||
AC_ARG_WITH(dbm,
|
||||
[ --with-dbm[=DIR] Include DBM support],[
|
||||
[ --with-dbm[=DIR] DBA: Include DBM support],[
|
||||
if test "$withval" != "no"; then
|
||||
for i in /usr/local /usr $withval; do
|
||||
if test -f "$i/include/dbm.h" ; then
|
||||
PHP_DBA_STD_BEGIN
|
||||
for i in $withval /usr/local /usr; do
|
||||
if test -f "$i/include/dbm.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/dbm.h
|
||||
break
|
||||
elif test -f "$i/include/gdbm/dbm.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/gdbm/dbm.h
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
for LIB in db1 dbm c; do
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB($LIB, dbminit, [AC_DEFINE(DBA_DBM,1,[ ]) THIS_LIBS=$LIB])
|
||||
])
|
||||
done
|
||||
|
||||
if test -n "$THIS_INCLUDE"; then
|
||||
for LIB in dbm c gdbm; do
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB($LIB, dbminit, [
|
||||
AC_MSG_CHECKING(for DBM using GDBM)
|
||||
AC_DEFINE_UNQUOTED(DBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
|
||||
if test "$LIB" = "gdbm"; then
|
||||
AC_DEFINE_UNQUOTED(DBM_VERSION, "GDBM", [ ])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(DBM_VERSION, "DBM", [ ])
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_DEFINE(DBA_DBM,1,[ ])
|
||||
THIS_LIBS=$LIB
|
||||
])
|
||||
if test -n "$THIS_LIBS"; then
|
||||
break
|
||||
fi
|
||||
])
|
||||
done
|
||||
fi
|
||||
|
||||
PHP_DBA_STD_ASSIGN
|
||||
PHP_DBA_STD_CHECK
|
||||
PHP_DBA_STD_ATTACH
|
||||
fi
|
||||
])
|
||||
AC_MSG_CHECKING(for DBM support)
|
||||
AC_DBA_STD_RESULT
|
||||
AC_DBA_STD_RESULT(dbm)
|
||||
|
||||
AC_DEFUN(PHP_DBA_BUILTIN_CDB,[
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
|
||||
@@ -222,21 +345,31 @@ AC_DEFUN(PHP_DBA_BUILTIN_CDB,[
|
||||
])
|
||||
|
||||
AC_ARG_WITH(cdb,
|
||||
[ --with-cdb[=DIR] Include CDB support],[
|
||||
if test "$withval" != "no"; then
|
||||
[ --with-cdb[=DIR] DBA: Include CDB support],[
|
||||
if test "$withval" = "yes"; then
|
||||
PHP_DBA_BUILTIN_CDB
|
||||
elif test "$withval" != "no"; then
|
||||
for i in /usr/local /usr $withval; do
|
||||
if test -f "$i/include/cdb.h" ; then
|
||||
PHP_DBA_STD_BEGIN
|
||||
for i in $withval /usr/local /usr; do
|
||||
if test -f "$i/include/cdb.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/include/cdb.h
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
for LIB in cdb c; do
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB($LIB, cdb_read, [AC_DEFINE(DBA_CDB,1,[ ]) THIS_LIBS=$LIB])
|
||||
])
|
||||
done
|
||||
if test -n "$THIS_INCLUDE"; then
|
||||
for LIB in cdb c; do
|
||||
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB($LIB, cdb_read, [
|
||||
AC_DEFINE_UNQUOTED(CDB_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
|
||||
AC_DEFINE(DBA_CDB,1,[ ])
|
||||
THIS_LIBS=$LIB
|
||||
break
|
||||
])
|
||||
])
|
||||
done
|
||||
fi
|
||||
|
||||
PHP_DBA_STD_ASSIGN
|
||||
PHP_DBA_STD_CHECK
|
||||
@@ -247,13 +380,12 @@ AC_ARG_WITH(cdb,
|
||||
PHP_DBA_BUILTIN_CDB
|
||||
fi
|
||||
])
|
||||
AC_MSG_CHECKING(for CDB support)
|
||||
AC_DBA_STD_RESULT
|
||||
AC_DBA_STD_RESULT(cdb)
|
||||
|
||||
AC_DEFUN(PHP_DBA_BUILTIN_FLATFILE,[
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
|
||||
AC_DEFINE(DBA_FLATFILE, 1, [ ])
|
||||
flat_sources="dba_flatfile.c libflatfile/flatfile.c"
|
||||
flat_sources="libflatfile/flatfile.c"
|
||||
THIS_RESULT="builtin"
|
||||
])
|
||||
|
||||
@@ -261,7 +393,7 @@ dnl
|
||||
dnl FlatFile check must be the last one.
|
||||
dnl
|
||||
AC_ARG_WITH(flatfile,
|
||||
[ --with-flatfile Include FlatFile support],[
|
||||
[ --with-flatfile DBA: Include FlatFile support],[
|
||||
if test "$withval" != "no"; then
|
||||
PHP_DBA_BUILTIN_FLATFILE
|
||||
fi
|
||||
@@ -270,14 +402,15 @@ AC_ARG_WITH(flatfile,
|
||||
PHP_DBA_BUILTIN_FLATFILE
|
||||
fi
|
||||
])
|
||||
AC_MSG_CHECKING(for FlatFile support)
|
||||
AC_DBA_STD_RESULT
|
||||
AC_DBA_STD_RESULT(FlatFile,FlatFile)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable DBA interface)
|
||||
if test "$HAVE_DBA" = "1"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DBA, 1, [ ])
|
||||
PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c $cdb_sources $flat_sources, $ext_shared)
|
||||
PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c dba_db4.c dba_flatfile.c $cdb_sources $flat_sources, $ext_shared)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/libcdb)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/libflatfile)
|
||||
PHP_SUBST(DBA_SHARED_LIBADD)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
+73
-48
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -44,13 +44,14 @@
|
||||
#include "php_cdb.h"
|
||||
#include "php_db2.h"
|
||||
#include "php_db3.h"
|
||||
#include "php_db4.h"
|
||||
#include "php_flatfile.h"
|
||||
|
||||
/* {{{ dba_functions[]
|
||||
*/
|
||||
function_entry dba_functions[] = {
|
||||
PHP_FE(dba_open, NULL)
|
||||
PHP_FALIAS(dba_popen, dba_open, NULL)
|
||||
PHP_FE(dba_popen, NULL)
|
||||
/* Disabled until 4.3.1, when persistent STDIO streams are implemented. */
|
||||
/* PHP_FE(dba_popen, NULL) */
|
||||
PHP_FE(dba_close, NULL)
|
||||
@@ -70,6 +71,7 @@ function_entry dba_functions[] = {
|
||||
/* }}} */
|
||||
|
||||
PHP_MINIT_FUNCTION(dba);
|
||||
PHP_MSHUTDOWN_FUNCTION(dba);
|
||||
PHP_MINFO_FUNCTION(dba);
|
||||
|
||||
zend_module_entry dba_module_entry = {
|
||||
@@ -77,7 +79,7 @@ zend_module_entry dba_module_entry = {
|
||||
"dba",
|
||||
dba_functions,
|
||||
PHP_MINIT(dba),
|
||||
NULL,
|
||||
PHP_MSHUTDOWN(dba),
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(dba),
|
||||
@@ -89,21 +91,6 @@ zend_module_entry dba_module_entry = {
|
||||
ZEND_GET_MODULE(dba)
|
||||
#endif
|
||||
|
||||
typedef struct dba_handler {
|
||||
char *name; /* handler name */
|
||||
int flags; /* whether and how dba does locking and other flags*/
|
||||
int (*open)(dba_info *, char **error TSRMLS_DC);
|
||||
void (*close)(dba_info * TSRMLS_DC);
|
||||
char* (*fetch)(dba_info *, char *, int, int, int * TSRMLS_DC);
|
||||
int (*update)(dba_info *, char *, int, char *, int, int TSRMLS_DC);
|
||||
int (*exists)(dba_info *, char *, int TSRMLS_DC);
|
||||
int (*delete)(dba_info *, char *, int TSRMLS_DC);
|
||||
char* (*firstkey)(dba_info *, int * TSRMLS_DC);
|
||||
char* (*nextkey)(dba_info *, int * TSRMLS_DC);
|
||||
int (*optimize)(dba_info * TSRMLS_DC);
|
||||
int (*sync)(dba_info * TSRMLS_DC);
|
||||
} dba_handler;
|
||||
|
||||
/* {{{ macromania */
|
||||
|
||||
#define DBA_ID_PARS \
|
||||
@@ -156,14 +143,14 @@ typedef struct dba_handler {
|
||||
|
||||
/* a DBA handler must have specific routines */
|
||||
|
||||
#define DBA_NAMED_HND(name, x, flags) \
|
||||
#define DBA_NAMED_HND(alias, name, flags) \
|
||||
{\
|
||||
#name, flags, dba_open_##x, dba_close_##x, dba_fetch_##x, dba_update_##x, \
|
||||
dba_exists_##x, dba_delete_##x, dba_firstkey_##x, dba_nextkey_##x, \
|
||||
dba_optimize_##x, dba_sync_##x \
|
||||
#alias, flags, dba_open_##name, dba_close_##name, dba_fetch_##name, dba_update_##name, \
|
||||
dba_exists_##name, dba_delete_##name, dba_firstkey_##name, dba_nextkey_##name, \
|
||||
dba_optimize_##name, dba_sync_##name, dba_info_##name \
|
||||
},
|
||||
|
||||
#define DBA_HND(x, flags) DBA_NAMED_HND(x, x, flags)
|
||||
#define DBA_HND(name, flags) DBA_NAMED_HND(name, name, flags)
|
||||
|
||||
/* check whether the user has write access */
|
||||
#define DBA_WRITE_CHECK \
|
||||
@@ -198,10 +185,13 @@ static dba_handler handler[] = {
|
||||
#if DBA_DB3
|
||||
DBA_HND(db3, DBA_LOCK_ALL) /* No lock in lib */
|
||||
#endif
|
||||
#if DBA_DB4
|
||||
DBA_HND(db4, DBA_LOCK_ALL) /* No lock in lib */
|
||||
#endif
|
||||
#if DBA_FLATFILE
|
||||
DBA_HND(flatfile, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */
|
||||
#endif
|
||||
{ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
|
||||
{ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static int le_db;
|
||||
@@ -212,16 +202,26 @@ static int le_pdb;
|
||||
*/
|
||||
static void dba_close(dba_info *info TSRMLS_DC)
|
||||
{
|
||||
if (info->hnd) info->hnd->close(info TSRMLS_CC);
|
||||
if (info->path) pefree(info->path, info->flags&DBA_PERSISTENT);
|
||||
if (info->fp && info->fp!=info->lock.fp) php_stream_close(info->fp);
|
||||
if (info->hnd) {
|
||||
info->hnd->close(info TSRMLS_CC);
|
||||
}
|
||||
if (info->path) {
|
||||
pefree(info->path, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
if (info->fp && info->fp!=info->lock.fp) {
|
||||
php_stream_close(info->fp);
|
||||
}
|
||||
if (info->lock.fd) {
|
||||
php_flock(info->lock.fd, LOCK_UN);
|
||||
/*close(info->lock.fd);*/
|
||||
info->lock.fd = 0;
|
||||
}
|
||||
if (info->lock.fp) php_stream_close(info->lock.fp);
|
||||
if (info->lock.name) pefree(info->lock.name, info->flags&DBA_PERSISTENT);
|
||||
if (info->lock.fp) {
|
||||
php_stream_close(info->lock.fp);
|
||||
}
|
||||
if (info->lock.name) {
|
||||
pefree(info->lock.name, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
pefree(info, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -236,12 +236,29 @@ static void dba_close_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ dba_close_pe_rsrc_deleter */
|
||||
int dba_close_pe_rsrc_deleter(list_entry *le, void *pDba TSRMLS_DC)
|
||||
{
|
||||
return le->ptr == pDba;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ dba_close_pe_rsrc */
|
||||
static void dba_close_pe_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
dba_info *info = (dba_info *)rsrc->ptr;
|
||||
|
||||
/* closes the resource by calling dba_close_rsrc() */
|
||||
zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) dba_close_pe_rsrc_deleter, info TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ PHP_MINIT_FUNCTION
|
||||
*/
|
||||
PHP_MINIT_FUNCTION(dba)
|
||||
{
|
||||
le_db = zend_register_list_destructors_ex(dba_close_rsrc, NULL, "dba", module_number);
|
||||
le_pdb = zend_register_list_destructors_ex(NULL, dba_close_rsrc, "dba persistent", module_number);
|
||||
le_pdb = zend_register_list_destructors_ex(dba_close_pe_rsrc, dba_close_rsrc, "dba persistent", module_number);
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -357,14 +374,15 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
int i;
|
||||
int lock_mode, lock_flag, lock_dbf = 0;
|
||||
char *file_mode;
|
||||
char mode[4], *pmode, *lock_file_mode;
|
||||
char mode[4], *pmode, *lock_file_mode = NULL;
|
||||
int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0;
|
||||
|
||||
if(ac < 3) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
/* we pass additional args to the respective handler */
|
||||
args = emalloc(ac * sizeof(zval *));
|
||||
args = safe_emalloc(ac, sizeof(zval *), 0);
|
||||
if (zend_get_parameters_array_ex(ac, args) != SUCCESS) {
|
||||
FREENOW;
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -429,6 +447,10 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
switch (pmode[1]) {
|
||||
case 'd':
|
||||
lock_dbf = 1;
|
||||
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
|
||||
lock_flag = (hptr->flags & DBA_LOCK_ALL);
|
||||
break;
|
||||
}
|
||||
/* no break */
|
||||
case 'l':
|
||||
lock_flag = DBA_LOCK_ALL;
|
||||
@@ -539,7 +561,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
/* when in read only mode try to use existing .lck file first */
|
||||
/* do not log errors for .lck file while in read ony mode on .lck file */
|
||||
lock_file_mode = "rb";
|
||||
info->lock.fp = php_stream_open_wrapper(info->lock.name, lock_file_mode, STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
|
||||
info->lock.fp = php_stream_open_wrapper(info->lock.name, lock_file_mode, STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, NULL);
|
||||
}
|
||||
if (!info->lock.fp) {
|
||||
/* when not in read mode or failed to open .lck file read only. now try again in create(write) mode and log errors */
|
||||
@@ -547,7 +569,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
}
|
||||
}
|
||||
if (!info->lock.fp) {
|
||||
info->lock.fp = php_stream_open_wrapper(info->lock.name, lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
|
||||
info->lock.fp = php_stream_open_wrapper(info->lock.name, lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, NULL);
|
||||
}
|
||||
if (!info->lock.fp) {
|
||||
dba_close(info TSRMLS_CC);
|
||||
@@ -571,7 +593,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
if (info->lock.fp && lock_dbf) {
|
||||
info->fp = info->lock.fp; /* use the same stream for locking and database access */
|
||||
} else {
|
||||
info->fp = php_stream_open_wrapper(info->path, file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
|
||||
info->fp = php_stream_open_wrapper(info->path, file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, NULL);
|
||||
}
|
||||
if (!info->fp) {
|
||||
dba_close(info TSRMLS_CC);
|
||||
@@ -583,7 +605,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
|
||||
if (error || hptr->open(info, &error TSRMLS_CC) != SUCCESS) {
|
||||
dba_close(info TSRMLS_CC);
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", Z_STRVAL_PP(args[2]), error?": ":"", error?error:"");
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:"");
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -598,6 +620,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
Z_TYPE(new_le) = le_pdb;
|
||||
new_le.ptr = info;
|
||||
if (zend_hash_update(&EG(persistent_list), key, keylen+1, &new_le, sizeof(list_entry), NULL) == FAILURE) {
|
||||
dba_close(info TSRMLS_CC);
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Could not register persistent resource");
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -756,23 +780,26 @@ PHP_FUNCTION(dba_sync)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array dba_handlers()
|
||||
/* {{{ proto array dba_handlers([bool full_info])
|
||||
List configured databases */
|
||||
PHP_FUNCTION(dba_handlers)
|
||||
{
|
||||
dba_handler *hptr;
|
||||
zend_bool full_info = 0;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=0) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &full_info) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (array_init(return_value) == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize array");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
array_init(return_value);
|
||||
|
||||
for(hptr = handler; hptr->name; hptr++) {
|
||||
add_next_index_string(return_value, hptr->name, 1);
|
||||
if (full_info) {
|
||||
add_assoc_string(return_value, hptr->name, hptr->info(hptr, NULL TSRMLS_CC), 0);
|
||||
} else {
|
||||
add_next_index_string(return_value, hptr->name, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -790,10 +817,8 @@ PHP_FUNCTION(dba_list)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (array_init(return_value) == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize array");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
array_init(return_value);
|
||||
|
||||
numitems = zend_hash_next_free_element(&EG(regular_list));
|
||||
for (i=1; i<numitems; i++) {
|
||||
if (zend_hash_index_find(&EG(regular_list), i, (void **) &le)==FAILURE) {
|
||||
@@ -807,7 +832,7 @@ PHP_FUNCTION(dba_list)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#endif
|
||||
#endif /* HAVE_DBA */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
+24
-10
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -35,12 +35,13 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#if DBA_CDB_BUILTIN
|
||||
#include "libcdb/cdb.h"
|
||||
#include "libcdb/cdb_make.h"
|
||||
#include "libcdb/uint32.h"
|
||||
# include "libcdb/cdb.h"
|
||||
# include "libcdb/cdb_make.h"
|
||||
# include "libcdb/uint32.h"
|
||||
#else
|
||||
#include <cdb.h>
|
||||
#include <uint32.h>
|
||||
# ifdef CDB_INCLUDE_FILE
|
||||
# include CDB_INCLUDE_FILE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define CDB_INFO \
|
||||
@@ -85,10 +86,10 @@ DBA_OPEN_FUNC(cdb)
|
||||
break;
|
||||
#if DBA_CDB_BUILTIN
|
||||
case DBA_TRUNC:
|
||||
case DBA_CREAT:
|
||||
make = 1;
|
||||
file = info->fp;
|
||||
break;
|
||||
case DBA_CREAT:
|
||||
case DBA_WRITER:
|
||||
*error = "Update operations are not supported";
|
||||
return FAILURE; /* not supported */
|
||||
@@ -162,7 +163,7 @@ DBA_FETCH_FUNC(cdb)
|
||||
}
|
||||
}
|
||||
len = cdb_datalen(&cdb->c);
|
||||
new_entry = emalloc(len+1);
|
||||
new_entry = safe_emalloc(len, 1, 1);
|
||||
|
||||
if (php_cdb_read(&cdb->c, new_entry, len, cdb_datapos(&cdb->c)) == -1) {
|
||||
efree(new_entry);
|
||||
@@ -267,7 +268,7 @@ DBA_FIRSTKEY_FUNC(cdb)
|
||||
uint32_unpack(buf, &klen);
|
||||
uint32_unpack(buf + 4, &dlen);
|
||||
|
||||
key = emalloc(klen + 1);
|
||||
key = safe_emalloc(klen, 1, 1);
|
||||
if (cdb_file_read(cdb->file, key, klen) < klen) {
|
||||
efree(key);
|
||||
key = NULL;
|
||||
@@ -299,7 +300,7 @@ DBA_NEXTKEY_FUNC(cdb)
|
||||
uint32_unpack(buf, &klen);
|
||||
uint32_unpack(buf + 4, &dlen);
|
||||
|
||||
key = emalloc(klen + 1);
|
||||
key = safe_emalloc(klen, 1, 1);
|
||||
if (cdb_file_read(cdb->file, key, klen) < klen) {
|
||||
efree(key);
|
||||
key = NULL;
|
||||
@@ -324,6 +325,19 @@ DBA_SYNC_FUNC(cdb)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
DBA_INFO_FUNC(cdb)
|
||||
{
|
||||
#if DBA_CDB_BUILTIN
|
||||
if (!strcmp(hnd->name, "cdb")) {
|
||||
return estrdup(cdb_version());
|
||||
} else {
|
||||
return estrdup(cdb_make_version());
|
||||
}
|
||||
#else
|
||||
return estrdup("External");
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+6
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -188,6 +188,11 @@ DBA_SYNC_FUNC(db2)
|
||||
return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS;
|
||||
}
|
||||
|
||||
DBA_INFO_FUNC(db2)
|
||||
{
|
||||
return estrdup(DB_VERSION_STRING);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+34
-16
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -35,6 +35,13 @@
|
||||
#include <db.h>
|
||||
#endif
|
||||
|
||||
static void php_dba_db3_errcall_fcn(const char *errpfx, char *msg)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
|
||||
}
|
||||
|
||||
#define DB3_DATA dba_db3_data *dba = info->dbf
|
||||
#define DB3_GKEY \
|
||||
DBT gkey; \
|
||||
@@ -50,7 +57,7 @@ DBA_OPEN_FUNC(db3)
|
||||
{
|
||||
DB *dbp = NULL;
|
||||
DBTYPE type;
|
||||
int gmode = 0;
|
||||
int gmode = 0, err;
|
||||
int filemode = 0644;
|
||||
struct stat check_stat;
|
||||
int s = VCWD_STAT(info->path, &check_stat);
|
||||
@@ -65,30 +72,36 @@ DBA_OPEN_FUNC(db3)
|
||||
info->mode == DBA_WRITER ? 0 :
|
||||
info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1;
|
||||
|
||||
if (gmode == -1)
|
||||
if (gmode == -1) {
|
||||
return FAILURE; /* not possible */
|
||||
}
|
||||
|
||||
if (info->argc > 0) {
|
||||
convert_to_long_ex(info->argv[0]);
|
||||
filemode = Z_LVAL_PP(info->argv[0]);
|
||||
}
|
||||
|
||||
if (db_create(&dbp, NULL, 0) == 0 &&
|
||||
#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
|
||||
dbp->open(dbp, 0, info->path, NULL, type, gmode, filemode) == 0) {
|
||||
#else
|
||||
dbp->open(dbp, info->path, NULL, type, gmode, filemode) == 0) {
|
||||
#ifdef DB_FCNTL_LOCKING
|
||||
gmode |= DB_FCNTL_LOCKING;
|
||||
#endif
|
||||
dba_db3_data *data;
|
||||
|
||||
data = pemalloc(sizeof(*data), info->flags&DBA_PERSISTENT);
|
||||
data->dbp = dbp;
|
||||
data->cursor = NULL;
|
||||
info->dbf = data;
|
||||
if ((err=db_create(&dbp, NULL, 0)) == 0) {
|
||||
dbp->set_errcall(dbp, php_dba_db3_errcall_fcn);
|
||||
if ((err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) {
|
||||
dba_db3_data *data;
|
||||
|
||||
data = pemalloc(sizeof(*data), info->flags&DBA_PERSISTENT);
|
||||
data->dbp = dbp;
|
||||
data->cursor = NULL;
|
||||
info->dbf = data;
|
||||
|
||||
return SUCCESS;
|
||||
} else if (dbp != NULL) {
|
||||
dbp->close(dbp, 0);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
dbp->close(dbp, 0);
|
||||
*error = db_strerror(err);
|
||||
}
|
||||
} else {
|
||||
*error = db_strerror(err);
|
||||
}
|
||||
|
||||
return FAILURE;
|
||||
@@ -204,6 +217,11 @@ DBA_SYNC_FUNC(db3)
|
||||
return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS;
|
||||
}
|
||||
|
||||
DBA_INFO_FUNC(db3)
|
||||
{
|
||||
return estrdup(DB_VERSION_STRING);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Sascha Schumann <sascha@schumann.cx> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
|
||||
#if DBA_DB4
|
||||
#include "php_db4.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <string.h>
|
||||
#ifdef DB4_INCLUDE_FILE
|
||||
#include DB4_INCLUDE_FILE
|
||||
#else
|
||||
#include <db.h>
|
||||
#endif
|
||||
|
||||
static void php_dba_db4_errcall_fcn(const char *errpfx, char *msg)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
|
||||
}
|
||||
|
||||
#define DB4_DATA dba_db4_data *dba = info->dbf
|
||||
#define DB4_GKEY \
|
||||
DBT gkey; \
|
||||
memset(&gkey, 0, sizeof(gkey)); \
|
||||
gkey.data = (char *) key; gkey.size = keylen
|
||||
|
||||
typedef struct {
|
||||
DB *dbp;
|
||||
DBC *cursor;
|
||||
} dba_db4_data;
|
||||
|
||||
DBA_OPEN_FUNC(db4)
|
||||
{
|
||||
DB *dbp = NULL;
|
||||
DBTYPE type;
|
||||
int gmode = 0, err;
|
||||
int filemode = 0644;
|
||||
struct stat check_stat;
|
||||
int s = VCWD_STAT(info->path, &check_stat);
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
info->mode == DBA_TRUNC ? DB_BTREE :
|
||||
s? DB_BTREE : DB_UNKNOWN;
|
||||
|
||||
gmode = info->mode == DBA_READER ? DB_RDONLY :
|
||||
(info->mode == DBA_CREAT && s) ? DB_CREATE :
|
||||
(info->mode == DBA_CREAT && !s) ? 0 :
|
||||
info->mode == DBA_WRITER ? 0 :
|
||||
info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1;
|
||||
|
||||
if (gmode == -1) {
|
||||
return FAILURE; /* not possible */
|
||||
}
|
||||
|
||||
if (info->argc > 0) {
|
||||
convert_to_long_ex(info->argv[0]);
|
||||
filemode = Z_LVAL_PP(info->argv[0]);
|
||||
}
|
||||
|
||||
#ifdef DB_FCNTL_LOCKING
|
||||
gmode |= DB_FCNTL_LOCKING;
|
||||
#endif
|
||||
|
||||
if ((err=db_create(&dbp, NULL, 0)) == 0) {
|
||||
dbp->set_errcall(dbp, php_dba_db4_errcall_fcn);
|
||||
if (
|
||||
#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
|
||||
(err=dbp->open(dbp, 0, info->path, NULL, type, gmode, filemode)) == 0) {
|
||||
#else
|
||||
(err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) {
|
||||
#endif
|
||||
dba_db4_data *data;
|
||||
|
||||
data = pemalloc(sizeof(*data), info->flags&DBA_PERSISTENT);
|
||||
data->dbp = dbp;
|
||||
data->cursor = NULL;
|
||||
info->dbf = data;
|
||||
|
||||
return SUCCESS;
|
||||
} else {
|
||||
dbp->close(dbp, 0);
|
||||
*error = db_strerror(err);
|
||||
}
|
||||
} else {
|
||||
*error = db_strerror(err);
|
||||
}
|
||||
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
DBA_CLOSE_FUNC(db4)
|
||||
{
|
||||
DB4_DATA;
|
||||
|
||||
if (dba->cursor) dba->cursor->c_close(dba->cursor);
|
||||
dba->dbp->close(dba->dbp, 0);
|
||||
pefree(dba, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
|
||||
DBA_FETCH_FUNC(db4)
|
||||
{
|
||||
DBT gval;
|
||||
char *new = NULL;
|
||||
DB4_DATA;
|
||||
DB4_GKEY;
|
||||
|
||||
memset(&gval, 0, sizeof(gval));
|
||||
if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
|
||||
if (newlen) *newlen = gval.size;
|
||||
new = estrndup(gval.data, gval.size);
|
||||
}
|
||||
return new;
|
||||
}
|
||||
|
||||
DBA_UPDATE_FUNC(db4)
|
||||
{
|
||||
DBT gval;
|
||||
DB4_DATA;
|
||||
DB4_GKEY;
|
||||
|
||||
memset(&gval, 0, sizeof(gval));
|
||||
gval.data = (char *) val;
|
||||
gval.size = vallen;
|
||||
|
||||
if (!dba->dbp->put(dba->dbp, NULL, &gkey, &gval,
|
||||
mode == 1 ? DB_NOOVERWRITE : 0)) {
|
||||
return SUCCESS;
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
DBA_EXISTS_FUNC(db4)
|
||||
{
|
||||
DBT gval;
|
||||
DB4_DATA;
|
||||
DB4_GKEY;
|
||||
|
||||
memset(&gval, 0, sizeof(gval));
|
||||
if (!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
|
||||
return SUCCESS;
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
DBA_DELETE_FUNC(db4)
|
||||
{
|
||||
DB4_DATA;
|
||||
DB4_GKEY;
|
||||
|
||||
return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS;
|
||||
}
|
||||
|
||||
DBA_FIRSTKEY_FUNC(db4)
|
||||
{
|
||||
DB4_DATA;
|
||||
|
||||
if (dba->cursor) {
|
||||
dba->cursor->c_close(dba->cursor);
|
||||
}
|
||||
|
||||
dba->cursor = NULL;
|
||||
if (dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0) != 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* we should introduce something like PARAM_PASSTHRU... */
|
||||
return dba_nextkey_db4(info, newlen TSRMLS_CC);
|
||||
}
|
||||
|
||||
DBA_NEXTKEY_FUNC(db4)
|
||||
{
|
||||
DB4_DATA;
|
||||
DBT gkey, gval;
|
||||
char *nkey = NULL;
|
||||
|
||||
memset(&gkey, 0, sizeof(gkey));
|
||||
memset(&gval, 0, sizeof(gval));
|
||||
|
||||
if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) == 0) {
|
||||
if (gkey.data) {
|
||||
nkey = estrndup(gkey.data, gkey.size);
|
||||
if (newlen) *newlen = gkey.size;
|
||||
}
|
||||
}
|
||||
|
||||
return nkey;
|
||||
}
|
||||
|
||||
DBA_OPTIMIZE_FUNC(db4)
|
||||
{
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
DBA_SYNC_FUNC(db4)
|
||||
{
|
||||
DB4_DATA;
|
||||
|
||||
return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS;
|
||||
}
|
||||
|
||||
DBA_INFO_FUNC(db4)
|
||||
{
|
||||
return estrdup(DB_VERSION_STRING);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
+26
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -27,7 +27,12 @@
|
||||
#if DBA_DBM
|
||||
#include "php_dbm.h"
|
||||
|
||||
#include <dbm.h>
|
||||
#ifdef DBM_INCLUDE_FILE
|
||||
#include DBM_INCLUDE_FILE
|
||||
#endif
|
||||
#if DBA_GDBM
|
||||
#include "php_gdbm.h"
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
@@ -108,6 +113,14 @@ DBA_UPDATE_FUNC(dbm)
|
||||
datum gval;
|
||||
|
||||
DBM_GKEY;
|
||||
|
||||
if (mode == 1) { /* insert */
|
||||
gval = fetch(gkey);
|
||||
if(gval.dptr) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
gval.dptr = (char *) val;
|
||||
gval.dsize = vallen;
|
||||
|
||||
@@ -177,6 +190,17 @@ DBA_SYNC_FUNC(dbm)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
DBA_INFO_FUNC(dbm)
|
||||
{
|
||||
#if DBA_GDBM
|
||||
if (!strcmp(DBM_VERSION, "GDBM"))
|
||||
{
|
||||
return dba_info_gdbm(hnd, info TSRMLS_CC);
|
||||
}
|
||||
#endif
|
||||
return estrdup(DBM_VERSION);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -163,6 +163,11 @@ DBA_SYNC_FUNC(flatfile)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
DBA_INFO_FUNC(flatfile)
|
||||
{
|
||||
return estrdup(flatfile_version());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+10
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -27,7 +27,9 @@
|
||||
#if DBA_GDBM
|
||||
#include "php_gdbm.h"
|
||||
|
||||
#include <gdbm.h>
|
||||
#ifdef GDBM_INCLUDE_FILE
|
||||
#include GDBM_INCLUDE_FILE
|
||||
#endif
|
||||
|
||||
#define GDBM_DATA dba_gdbm_data *dba = info->dbf
|
||||
#define GDBM_GKEY datum gkey; gkey.dptr = (char *) key; gkey.dsize = keylen
|
||||
@@ -180,6 +182,12 @@ DBA_SYNC_FUNC(gdbm)
|
||||
gdbm_sync(dba->dbf);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
DBA_INFO_FUNC(gdbm)
|
||||
{
|
||||
return estrdup(gdbm_version);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+7
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -153,6 +153,12 @@ DBA_SYNC_FUNC(ndbm)
|
||||
{
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
DBA_INFO_FUNC(ndbm)
|
||||
{
|
||||
return estrdup("NDBM");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -193,3 +193,10 @@ int cdb_find(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
|
||||
return cdb_findnext(c, key, len TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ cdb_version */
|
||||
char *cdb_version()
|
||||
{
|
||||
return "0.75, $Revision$";
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -52,4 +52,6 @@ int cdb_find(struct cdb *, char *, unsigned int TSRMLS_DC);
|
||||
#define cdb_datapos(c) ((c)->dpos)
|
||||
#define cdb_datalen(c) ((c)->dlen)
|
||||
|
||||
char *cdb_version();
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -79,8 +79,7 @@ int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datale
|
||||
|
||||
head = c->head;
|
||||
if (!head || (head->num >= CDB_HPLIST)) {
|
||||
head = (struct cdb_hplist *)
|
||||
emalloc(sizeof(struct cdb_hplist));
|
||||
head = (struct cdb_hplist *) emalloc(sizeof(struct cdb_hplist));
|
||||
if (!head)
|
||||
return -1;
|
||||
head->num = 0;
|
||||
@@ -172,8 +171,7 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
|
||||
return -1;
|
||||
}
|
||||
|
||||
c->split = (struct cdb_hp *)
|
||||
emalloc(memsize * sizeof(struct cdb_hp));
|
||||
c->split = (struct cdb_hp *) safe_emalloc(memsize, sizeof(struct cdb_hp), 0);
|
||||
if (!c->split)
|
||||
return -1;
|
||||
|
||||
@@ -238,3 +236,9 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
|
||||
return php_stream_flush(c->fp);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ cdb_make_version */
|
||||
char *cdb_make_version()
|
||||
{
|
||||
return "0.75, $Revision$";
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -59,5 +59,6 @@ int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int TSRMLS_DC);
|
||||
int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32 TSRMLS_DC);
|
||||
int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int TSRMLS_DC);
|
||||
int cdb_make_finish(struct cdb_make * TSRMLS_DC);
|
||||
char *cdb_make_version();
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+132
-116
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -38,6 +38,8 @@
|
||||
|
||||
#include "flatfile.h"
|
||||
|
||||
#define FLATFILE_BLOCK_SIZE 1024
|
||||
|
||||
/*
|
||||
* ret = -1 means that database was opened for read-only
|
||||
* ret = 0 success
|
||||
@@ -54,21 +56,25 @@ int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode T
|
||||
php_stream_seek(dba->fp, 0L, SEEK_END);
|
||||
php_stream_printf(dba->fp TSRMLS_CC, "%d\n", key_datum.dsize);
|
||||
php_stream_flush(dba->fp);
|
||||
if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize)
|
||||
if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) {
|
||||
return -1;
|
||||
}
|
||||
php_stream_printf(dba->fp TSRMLS_CC, "%d\n", value_datum.dsize);
|
||||
php_stream_flush(dba->fp);
|
||||
if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize)
|
||||
if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) {
|
||||
return -1;
|
||||
} else { /* DBM_REPLACE */
|
||||
}
|
||||
} else { /* FLATFILE_REPLACE */
|
||||
flatfile_delete(dba, key_datum TSRMLS_CC);
|
||||
php_stream_printf(dba->fp TSRMLS_CC, "%d\n", key_datum.dsize);
|
||||
php_stream_flush(dba->fp);
|
||||
if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize)
|
||||
if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) {
|
||||
return -1;
|
||||
}
|
||||
php_stream_printf(dba->fp TSRMLS_CC, "%d\n", value_datum.dsize);
|
||||
if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize)
|
||||
if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
php_stream_flush(dba->fp);
|
||||
@@ -80,25 +86,16 @@ int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode T
|
||||
*/
|
||||
datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) {
|
||||
datum value_datum = {NULL, 0};
|
||||
size_t num=0;
|
||||
size_t buf_size = 1024;
|
||||
char *buf;
|
||||
char buf[16];
|
||||
|
||||
if (flatfile_findkey(dba, key_datum TSRMLS_CC)) {
|
||||
buf = emalloc((buf_size+1) * sizeof(char));
|
||||
if (php_stream_gets(dba->fp, buf, 15)) {
|
||||
num = atoi(buf);
|
||||
if (num > buf_size) {
|
||||
buf_size+=num;
|
||||
buf = erealloc(buf, (buf_size+1)*sizeof(char));
|
||||
}
|
||||
php_stream_read(dba->fp, buf, num);
|
||||
value_datum.dptr = buf;
|
||||
value_datum.dsize = num;
|
||||
if (php_stream_gets(dba->fp, buf, sizeof(buf))) {
|
||||
value_datum.dsize = atoi(buf);
|
||||
value_datum.dptr = safe_emalloc(value_datum.dsize, 1, 1);
|
||||
value_datum.dsize = php_stream_read(dba->fp, value_datum.dptr, value_datum.dsize);
|
||||
} else {
|
||||
value_datum.dptr = NULL;
|
||||
value_datum.dsize = 0;
|
||||
efree(buf);
|
||||
}
|
||||
}
|
||||
return value_datum;
|
||||
@@ -110,57 +107,55 @@ datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) {
|
||||
int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) {
|
||||
char *key = key_datum.dptr;
|
||||
size_t size = key_datum.dsize;
|
||||
|
||||
char *buf;
|
||||
size_t buf_size = FLATFILE_BLOCK_SIZE;
|
||||
char *buf = emalloc(buf_size);
|
||||
size_t num;
|
||||
size_t buf_size = 1024;
|
||||
size_t pos;
|
||||
|
||||
php_stream_rewind(dba->fp);
|
||||
|
||||
buf = emalloc((buf_size + 1)*sizeof(char));
|
||||
while(!php_stream_eof(dba->fp)) {
|
||||
/* read in the length of the key name */
|
||||
if (!php_stream_gets(dba->fp, buf, 15))
|
||||
if (!php_stream_gets(dba->fp, buf, 15)) {
|
||||
break;
|
||||
}
|
||||
num = atoi(buf);
|
||||
if (num > buf_size) {
|
||||
buf_size += num;
|
||||
buf = erealloc(buf, (buf_size+1)*sizeof(char));
|
||||
if (num >= buf_size) {
|
||||
buf_size = num + FLATFILE_BLOCK_SIZE;
|
||||
buf = erealloc(buf, buf_size);
|
||||
}
|
||||
pos = php_stream_tell(dba->fp);
|
||||
|
||||
/* read in the key name */
|
||||
num = php_stream_read(dba->fp, buf, sizeof(char)*num);
|
||||
if (num<0)
|
||||
num = php_stream_read(dba->fp, buf, num);
|
||||
if (num < 0) {
|
||||
break;
|
||||
*(buf+num) = '\0';
|
||||
}
|
||||
|
||||
if (size == num && !memcmp(buf, key, size)) {
|
||||
php_stream_seek(dba->fp, pos, SEEK_SET);
|
||||
php_stream_putc(dba->fp, 0);
|
||||
php_stream_flush(dba->fp);
|
||||
php_stream_seek(dba->fp, 0L, SEEK_END);
|
||||
if (buf)
|
||||
efree(buf);
|
||||
efree(buf);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/* read in the length of the value */
|
||||
if (!php_stream_gets(dba->fp, buf, 15))
|
||||
if (!php_stream_gets(dba->fp, buf, 15)) {
|
||||
break;
|
||||
}
|
||||
num = atoi(buf);
|
||||
if (num > buf_size) {
|
||||
buf_size+=num;
|
||||
buf = erealloc(buf, (buf_size+1)*sizeof(char));
|
||||
if (num >= buf_size) {
|
||||
buf_size = num + FLATFILE_BLOCK_SIZE;
|
||||
buf = erealloc(buf, buf_size);
|
||||
}
|
||||
/* read in the value */
|
||||
num = php_stream_read(dba->fp, buf, sizeof(char)*num);
|
||||
if (num<0)
|
||||
num = php_stream_read(dba->fp, buf, num);
|
||||
if (num < 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (buf)
|
||||
efree(buf);
|
||||
efree(buf);
|
||||
return FAILURE;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -168,133 +163,154 @@ int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) {
|
||||
/* {{{ flatfile_findkey
|
||||
*/
|
||||
int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) {
|
||||
char *buf = NULL;
|
||||
size_t buf_size = FLATFILE_BLOCK_SIZE;
|
||||
char *buf = emalloc(buf_size);
|
||||
size_t num;
|
||||
size_t buf_size = 1024;
|
||||
int ret=0;
|
||||
void *key = key_datum.dptr;
|
||||
size_t size = key_datum.dsize;
|
||||
|
||||
php_stream_rewind(dba->fp);
|
||||
buf = emalloc((buf_size+1)*sizeof(char));
|
||||
while (!php_stream_eof(dba->fp)) {
|
||||
if (!php_stream_gets(dba->fp, buf, 15))
|
||||
if (!php_stream_gets(dba->fp, buf, 15)) {
|
||||
break;
|
||||
}
|
||||
num = atoi(buf);
|
||||
if (num >= buf_size) {
|
||||
buf_size = num + FLATFILE_BLOCK_SIZE;
|
||||
buf = erealloc(buf, buf_size);
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf, num);
|
||||
if (num < 0) {
|
||||
break;
|
||||
num = atoi(buf);
|
||||
if (num > buf_size) {
|
||||
buf_size+=num;
|
||||
buf = erealloc(buf, (buf_size+1)*sizeof(char));
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf, sizeof(char)*num);
|
||||
if (num<0) break;
|
||||
*(buf+num) = '\0';
|
||||
if (size == num) {
|
||||
if (!memcmp(buf, key, size)) {
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!php_stream_gets(dba->fp, buf, 15))
|
||||
if (!php_stream_gets(dba->fp, buf, 15)) {
|
||||
break;
|
||||
num = atoi(buf);
|
||||
if (num > buf_size) {
|
||||
buf_size+=num;
|
||||
buf = erealloc(buf, (buf_size+1)*sizeof(char));
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf, sizeof(char)*num);
|
||||
if (num<0)
|
||||
num = atoi(buf);
|
||||
if (num >= buf_size) {
|
||||
buf_size = num + FLATFILE_BLOCK_SIZE;
|
||||
buf = erealloc(buf, buf_size);
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf, num);
|
||||
if (num < 0) {
|
||||
break;
|
||||
*(buf+num) = '\0';
|
||||
}
|
||||
}
|
||||
if (buf)
|
||||
efree(buf);
|
||||
return(ret);
|
||||
efree(buf);
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ flatfile_firstkey
|
||||
*/
|
||||
datum flatfile_firstkey(flatfile *dba TSRMLS_DC) {
|
||||
datum buf;
|
||||
datum res;
|
||||
size_t num;
|
||||
size_t buf_size = 1024;
|
||||
size_t buf_size = FLATFILE_BLOCK_SIZE;
|
||||
char *buf = emalloc(buf_size);
|
||||
|
||||
php_stream_rewind(dba->fp);
|
||||
buf.dptr = emalloc((buf_size+1)*sizeof(char));
|
||||
while(!php_stream_eof(dba->fp)) {
|
||||
if (!php_stream_gets(dba->fp, buf.dptr, 15)) break;
|
||||
num = atoi(buf.dptr);
|
||||
if (num > buf_size) {
|
||||
buf_size+=num;
|
||||
buf.dptr = erealloc(buf.dptr, (buf_size+1)*sizeof(char));
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf.dptr, num);
|
||||
if (num<0)
|
||||
if (!php_stream_gets(dba->fp, buf, 15)) {
|
||||
break;
|
||||
buf.dsize = num;
|
||||
if (*(buf.dptr)!=0) {
|
||||
}
|
||||
num = atoi(buf);
|
||||
if (num >= buf_size) {
|
||||
buf_size = num + FLATFILE_BLOCK_SIZE;
|
||||
buf = erealloc(buf, buf_size);
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf, num);
|
||||
if (num < 0) {
|
||||
break;
|
||||
}
|
||||
if (*(buf) != 0) {
|
||||
dba->CurrentFlatFilePos = php_stream_tell(dba->fp);
|
||||
return(buf);
|
||||
res.dptr = buf;
|
||||
res.dsize = num;
|
||||
return res;
|
||||
}
|
||||
if (!php_stream_gets(dba->fp, buf.dptr, 15)) break;
|
||||
num = atoi(buf.dptr);
|
||||
if (num > buf_size) {
|
||||
buf_size+=num;
|
||||
buf.dptr = erealloc(buf.dptr, (buf_size+1)*sizeof(char));
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf.dptr, num);
|
||||
if (num<0)
|
||||
if (!php_stream_gets(dba->fp, buf, 15)) {
|
||||
break;
|
||||
}
|
||||
num = atoi(buf);
|
||||
if (num >= buf_size) {
|
||||
buf_size = num + FLATFILE_BLOCK_SIZE;
|
||||
buf = erealloc(buf, buf_size);
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf, num);
|
||||
if (num < 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (buf.dptr)
|
||||
efree(buf.dptr);
|
||||
buf.dptr = NULL;
|
||||
return(buf);
|
||||
efree(buf);
|
||||
res.dptr = NULL;
|
||||
res.dsize = 0;
|
||||
return res;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ flatfile_nextkey
|
||||
*/
|
||||
datum flatfile_nextkey(flatfile *dba TSRMLS_DC) {
|
||||
datum buf;
|
||||
datum res;
|
||||
size_t num;
|
||||
size_t buf_size = 1024;
|
||||
size_t buf_size = FLATFILE_BLOCK_SIZE;
|
||||
char *buf = emalloc(buf_size);
|
||||
|
||||
php_stream_seek(dba->fp, dba->CurrentFlatFilePos, SEEK_SET);
|
||||
buf.dptr = emalloc((buf_size+1)*sizeof(char));
|
||||
while(!php_stream_eof(dba->fp)) {
|
||||
if (!php_stream_gets(dba->fp, buf.dptr, 15)) break;
|
||||
num = atoi(buf.dptr);
|
||||
if (num > buf_size) {
|
||||
buf_size+=num;
|
||||
buf.dptr = erealloc(buf.dptr, (buf_size+1)*sizeof(char));
|
||||
if (!php_stream_gets(dba->fp, buf, 15)) {
|
||||
break;
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf.dptr, num);
|
||||
if (num<0)
|
||||
break;
|
||||
if (!php_stream_gets(dba->fp, buf.dptr, 15))
|
||||
break;
|
||||
num = atoi(buf.dptr);
|
||||
if (num > buf_size) {
|
||||
buf_size+=num;
|
||||
buf.dptr = erealloc(buf.dptr, (buf_size+1)*sizeof(char));
|
||||
num = atoi(buf);
|
||||
if (num >= buf_size) {
|
||||
buf_size = num + FLATFILE_BLOCK_SIZE;
|
||||
buf = erealloc(buf, buf_size);
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf.dptr, num);
|
||||
if (num<0)
|
||||
num = php_stream_read(dba->fp, buf, num);
|
||||
if (num < 0) {
|
||||
break;
|
||||
buf.dsize = num;
|
||||
if (*(buf.dptr)!=0) {
|
||||
}
|
||||
if (!php_stream_gets(dba->fp, buf, 15)) {
|
||||
break;
|
||||
}
|
||||
num = atoi(buf);
|
||||
if (num >= buf_size) {
|
||||
buf_size = num + FLATFILE_BLOCK_SIZE;
|
||||
buf = erealloc(buf, buf_size);
|
||||
}
|
||||
num = php_stream_read(dba->fp, buf, num);
|
||||
if (num < 0) {
|
||||
break;
|
||||
}
|
||||
if (*(buf)!=0) {
|
||||
dba->CurrentFlatFilePos = php_stream_tell(dba->fp);
|
||||
return(buf);
|
||||
res.dptr = buf;
|
||||
res.dsize = num;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
if (buf.dptr)
|
||||
efree(buf.dptr);
|
||||
buf.dptr = NULL;
|
||||
return(buf);
|
||||
efree(buf);
|
||||
res.dptr = NULL;
|
||||
res.dsize = 0;
|
||||
return res;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ flatfile_version */
|
||||
char *flatfile_version()
|
||||
{
|
||||
return "1.0, $Revision$";
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef PHP_LIBDBM_H
|
||||
#define PHP_LIBDBM_H
|
||||
#ifndef PHP_LIB_FLATFILE_H
|
||||
#define PHP_LIB_FLATFILE_H
|
||||
|
||||
typedef struct {
|
||||
char *dptr;
|
||||
@@ -43,5 +43,6 @@ int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC);
|
||||
int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC);
|
||||
datum flatfile_firstkey(flatfile *dba TSRMLS_DC);
|
||||
datum flatfile_nextkey(flatfile *dba TSRMLS_DC);
|
||||
char *flatfile_version();
|
||||
|
||||
#endif
|
||||
+22
-2
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -68,6 +68,23 @@ typedef struct dba_info {
|
||||
extern zend_module_entry dba_module_entry;
|
||||
#define dba_module_ptr &dba_module_entry
|
||||
|
||||
typedef struct dba_handler {
|
||||
char *name; /* handler name */
|
||||
int flags; /* whether and how dba does locking and other flags*/
|
||||
int (*open)(dba_info *, char **error TSRMLS_DC);
|
||||
void (*close)(dba_info * TSRMLS_DC);
|
||||
char* (*fetch)(dba_info *, char *, int, int, int * TSRMLS_DC);
|
||||
int (*update)(dba_info *, char *, int, char *, int, int TSRMLS_DC);
|
||||
int (*exists)(dba_info *, char *, int TSRMLS_DC);
|
||||
int (*delete)(dba_info *, char *, int TSRMLS_DC);
|
||||
char* (*firstkey)(dba_info *, int * TSRMLS_DC);
|
||||
char* (*nextkey)(dba_info *, int * TSRMLS_DC);
|
||||
int (*optimize)(dba_info * TSRMLS_DC);
|
||||
int (*sync)(dba_info * TSRMLS_DC);
|
||||
char* (*info)(struct dba_handler *hnd, dba_info * TSRMLS_DC);
|
||||
/* dba_info==NULL: Handler info, dba_info!=NULL: Database info */
|
||||
} dba_handler;
|
||||
|
||||
/* common prototypes which must be supplied by modules */
|
||||
|
||||
#define DBA_OPEN_FUNC(x) \
|
||||
@@ -90,6 +107,8 @@ extern zend_module_entry dba_module_entry;
|
||||
int dba_optimize_##x(dba_info *info TSRMLS_DC)
|
||||
#define DBA_SYNC_FUNC(x) \
|
||||
int dba_sync_##x(dba_info *info TSRMLS_DC)
|
||||
#define DBA_INFO_FUNC(x) \
|
||||
char *dba_info_##x(dba_handler *hnd, dba_info *info TSRMLS_DC)
|
||||
|
||||
#define DBA_FUNCS(x) \
|
||||
DBA_OPEN_FUNC(x); \
|
||||
@@ -101,7 +120,8 @@ extern zend_module_entry dba_module_entry;
|
||||
DBA_FIRSTKEY_FUNC(x); \
|
||||
DBA_NEXTKEY_FUNC(x); \
|
||||
DBA_OPTIMIZE_FUNC(x); \
|
||||
DBA_SYNC_FUNC(x)
|
||||
DBA_SYNC_FUNC(x); \
|
||||
DBA_INFO_FUNC(x)
|
||||
|
||||
#define VALLEN(p) Z_STRVAL_PP(p), Z_STRLEN_PP(p)
|
||||
|
||||
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
DBA dba_popen Test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
print("info $HND handler used");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once('test.inc');
|
||||
echo "database handler: $handler\n";
|
||||
if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
|
||||
echo "Opened\n";
|
||||
dba_insert("a", "Inserted", $db);
|
||||
echo dba_fetch("a", $db)."\n";
|
||||
dba_close($db);
|
||||
echo "Closed\n";
|
||||
} else {
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
if (($db=dba_popen($db_file, "n", $handler))!==FALSE) {
|
||||
echo "Opened\n";
|
||||
dba_insert("a", "Inserted", $db);
|
||||
echo dba_fetch("a", $db)."\n";
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
database handler: %s
|
||||
Opened
|
||||
Inserted
|
||||
Closed
|
||||
Opened
|
||||
Inserted
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
DBA DB4 handler test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (!in_array('db4', dba_handlers())) die('skip DB4 handler not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require_once('test.inc');
|
||||
$handler = 'db4';
|
||||
require_once('dba_handler.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
database handler: db4
|
||||
3NYNYY
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
["key number 6"]=>
|
||||
string(13) "The 6th value"
|
||||
["key2"]=>
|
||||
string(27) "Content 2 replaced 2nd time"
|
||||
["key5"]=>
|
||||
string(23) "The last content string"
|
||||
}
|
||||
@@ -67,7 +67,7 @@
|
||||
} else {
|
||||
echo "Error reading database\n";
|
||||
}
|
||||
if ($dba_reader) {
|
||||
if (!empty($dba_reader)) {
|
||||
dba_close($dba_reader);
|
||||
}
|
||||
if (($db_file = dba_popen($db_filename, 'r'.($handler!='gdbm'?'-':''), $handler))!==FALSE) {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -247,9 +247,10 @@ dbhead_t *dbf_open(char *dp, int o_flags TSRMLS_DC)
|
||||
|
||||
cp = dp;
|
||||
if ((fd = VCWD_OPEN(cp, o_flags|O_BINARY)) < 0) {
|
||||
cp = (char *)malloc(256);
|
||||
strcpy(cp, dp); strcat(cp, ".dbf");
|
||||
cp = (char *)malloc(MAXPATHLEN); /* So where does this get free()'d? -RL */
|
||||
strncpy(cp, dp, MAXPATHLEN-5); strcat(cp, ".dbf");
|
||||
if ((fd = VCWD_OPEN(cp, o_flags)) < 0) {
|
||||
free(cp);
|
||||
perror("open");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+6
-6
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -85,7 +85,7 @@ int get_module_identifier(char *module_name)
|
||||
return DBX_UNKNOWN;
|
||||
}
|
||||
|
||||
int split_dbx_handle_object(zval **dbx_object, zval ***pdbx_handle, zval ***pdbx_module, zval ***pdbx_database)
|
||||
int split_dbx_handle_object(zval **dbx_object, zval ***pdbx_handle, zval ***pdbx_module, zval ***pdbx_database TSRMLS_DC)
|
||||
{
|
||||
convert_to_object_ex(dbx_object);
|
||||
if (zend_hash_find(Z_OBJPROP_PP(dbx_object), "handle", 7, (void **) pdbx_handle)==FAILURE
|
||||
@@ -334,7 +334,7 @@ ZEND_FUNCTION(dbx_close)
|
||||
if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database)) {
|
||||
if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
|
||||
zend_error(E_WARNING, "dbx_close: not a valid dbx_handle-object...");
|
||||
RETURN_LONG(0);
|
||||
}
|
||||
@@ -386,7 +386,7 @@ ZEND_FUNCTION(dbx_query)
|
||||
if (ZEND_NUM_ARGS()<min_number_of_arguments || ZEND_NUM_ARGS()>number_of_arguments || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database)) {
|
||||
if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
|
||||
zend_error(E_WARNING, "dbx_query: not a valid dbx_handle-object...");
|
||||
RETURN_LONG(0);
|
||||
}
|
||||
@@ -560,7 +560,7 @@ ZEND_FUNCTION(dbx_error)
|
||||
if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database)) {
|
||||
if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
|
||||
zend_error(E_WARNING, "dbx_error: not a valid dbx_handle-object...");
|
||||
RETURN_LONG(0);
|
||||
}
|
||||
@@ -593,7 +593,7 @@ ZEND_FUNCTION(dbx_escape_string)
|
||||
if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database)) {
|
||||
if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) {
|
||||
zend_error(E_WARNING, "dbx_esc: not a valid dbx_handle-object...");
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+3
-17
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -228,31 +228,17 @@ int dbx_pgsql_getcolumntype(zval **rv, zval **result_handle, long column_index,
|
||||
int dbx_pgsql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
|
||||
{
|
||||
/* returns array[0..columncount-1] as strings on success or 0 as long on failure */
|
||||
int number_of_arguments=2;
|
||||
int save_error_reporting=0;
|
||||
zval **arguments[2];
|
||||
zval *zval_row=NULL;
|
||||
int number_of_arguments=1;
|
||||
zval **arguments[1];
|
||||
zval *returned_zval=NULL;
|
||||
|
||||
MAKE_STD_ZVAL(zval_row);
|
||||
ZVAL_LONG(zval_row, row_number);
|
||||
arguments[0]=result_handle;
|
||||
arguments[1]=&zval_row;
|
||||
|
||||
if (EG(error_reporting) & E_WARNING){
|
||||
save_error_reporting = EG(error_reporting);
|
||||
EG(error_reporting) &= ~E_WARNING;
|
||||
}
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fetch_array", &returned_zval, number_of_arguments, arguments);
|
||||
if (save_error_reporting) {
|
||||
EG(error_reporting) = save_error_reporting;
|
||||
}
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
FREE_ZVAL(zval_row);
|
||||
return 0;
|
||||
}
|
||||
FREE_ZVAL(zval_row);
|
||||
MOVE_RETURNED_TO_RV(rv, returned_zval);
|
||||
return 1;
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| dbx module version 1.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
+10
-10
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -146,8 +146,8 @@ PHP_FUNCTION(dio_open)
|
||||
php_fd_t *f;
|
||||
char *file_name;
|
||||
int file_name_length;
|
||||
int flags;
|
||||
mode_t mode = 0;
|
||||
long flags;
|
||||
long mode = 0;
|
||||
int fd;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", &file_name, &file_name_length, &flags, &mode) == FAILURE) {
|
||||
@@ -178,7 +178,7 @@ PHP_FUNCTION(dio_read)
|
||||
zval *r_fd;
|
||||
php_fd_t *f;
|
||||
char *data;
|
||||
int bytes = 1024;
|
||||
long bytes = 1024;
|
||||
ssize_t res;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &r_fd, &bytes) == FAILURE) {
|
||||
@@ -207,8 +207,8 @@ PHP_FUNCTION(dio_write)
|
||||
zval *r_fd;
|
||||
php_fd_t *f;
|
||||
char *data;
|
||||
size_t data_len;
|
||||
size_t trunc_len = 0;
|
||||
int data_len;
|
||||
long trunc_len = 0;
|
||||
ssize_t res;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &r_fd, &data, &data_len, &trunc_len) == FAILURE) {
|
||||
@@ -232,7 +232,7 @@ PHP_FUNCTION(dio_truncate)
|
||||
{
|
||||
zval *r_fd;
|
||||
php_fd_t *f;
|
||||
off_t offset;
|
||||
long offset;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &r_fd, &offset) == FAILURE) {
|
||||
return;
|
||||
@@ -293,8 +293,8 @@ PHP_FUNCTION(dio_seek)
|
||||
{
|
||||
zval *r_fd;
|
||||
php_fd_t *f;
|
||||
off_t offset;
|
||||
int whence = SEEK_SET;
|
||||
long offset;
|
||||
long whence = SEEK_SET;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &r_fd, &offset, &whence) == FAILURE) {
|
||||
return;
|
||||
@@ -312,7 +312,7 @@ PHP_FUNCTION(dio_fcntl)
|
||||
zval *r_fd;
|
||||
zval *arg = NULL;
|
||||
php_fd_t *f;
|
||||
int cmd;
|
||||
long cmd;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &r_fd, &cmd, &arg) == FAILURE) {
|
||||
return;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
|
||||
+341
-82
@@ -2,7 +2,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2002 The PHP Group |
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -316,6 +316,7 @@ static function_entry php_domxmldoc_class_functions[] = {
|
||||
PHP_FALIAS(create_processing_instruction, domxml_doc_create_processing_instruction, NULL)
|
||||
PHP_FALIAS(get_elements_by_tagname, domxml_doc_get_elements_by_tagname, NULL)
|
||||
PHP_FALIAS(get_element_by_id, domxml_doc_get_element_by_id, NULL)
|
||||
PHP_FALIAS(free, domxml_doc_free_doc, NULL)
|
||||
/* Everything below this comment is none DOM compliant */
|
||||
/* children is deprecated because it is inherited from DomNode */
|
||||
/* PHP_FALIAS(children, domxml_node_children, NULL) */
|
||||
@@ -529,8 +530,8 @@ zend_module_entry domxml_module_entry = {
|
||||
"domxml",
|
||||
domxml_functions,
|
||||
PHP_MINIT(domxml),
|
||||
PHP_MSHUTDOWN(domxml),
|
||||
NULL,
|
||||
PHP_RINIT(domxml),
|
||||
NULL,
|
||||
PHP_MINFO(domxml),
|
||||
DOMXML_API_VERSION, /* Extension versionnumber */
|
||||
@@ -589,29 +590,103 @@ static inline void node_wrapper_dtor(xmlNodePtr node)
|
||||
}
|
||||
|
||||
|
||||
/* This function should only be used when freeing nodes
|
||||
as dependant objects are destroyed */
|
||||
static inline void node_wrapper_free(xmlNodePtr node TSRMLS_DC)
|
||||
{
|
||||
zval *wrapper, **handle;
|
||||
int type, refcount = 0;
|
||||
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
wrapper = dom_object_get_data(node);
|
||||
if (wrapper != NULL ) {
|
||||
/* All references need to be destroyed */
|
||||
if (zend_hash_index_find(Z_OBJPROP_P(wrapper), 0, (void **) &handle) == SUCCESS) {
|
||||
if (zend_list_find(Z_LVAL_PP(handle), &type)) {
|
||||
zend_list_delete(Z_LVAL_PP(handle));
|
||||
}
|
||||
} else {
|
||||
refcount = wrapper->refcount;
|
||||
zval_ptr_dtor(&wrapper);
|
||||
|
||||
/* only set it to null, if refcount was 1 before, otherwise it has still needed references */
|
||||
if (refcount == 1) {
|
||||
dom_object_set_data(node, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static inline void attr_list_wrapper_dtor(xmlAttrPtr attr)
|
||||
{
|
||||
while (attr != NULL) {
|
||||
/* Attribute nodes contain children which can be accessed */
|
||||
node_wrapper_dtor((xmlNodePtr) attr);
|
||||
attr = attr->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline void node_list_wrapper_dtor(xmlNodePtr node)
|
||||
/* destroyref is a bool indicating if all registered objects for nodes
|
||||
within the tree should be destroyed */
|
||||
static inline void node_list_wrapper_dtor(xmlNodePtr node, int destroyref TSRMLS_DC)
|
||||
{
|
||||
while (node != NULL) {
|
||||
node_list_wrapper_dtor(node->children);
|
||||
node_list_wrapper_dtor(node->children, destroyref TSRMLS_CC);
|
||||
switch (node->type) {
|
||||
/* Skip property freeing for the following types */
|
||||
case XML_ATTRIBUTE_DECL:
|
||||
case XML_DTD_NODE:
|
||||
case XML_ENTITY_DECL:
|
||||
case XML_ATTRIBUTE_NODE:
|
||||
break;
|
||||
default:
|
||||
attr_list_wrapper_dtor(node->properties);
|
||||
/* Attribute Nodes contain accessible children
|
||||
Call this function with the propert list
|
||||
attr_list_wrapper_dtor(node->properties); */
|
||||
node_list_wrapper_dtor((xmlNodePtr) node->properties, destroyref TSRMLS_CC);
|
||||
}
|
||||
node_wrapper_dtor(node);
|
||||
|
||||
if (destroyref == 1) {
|
||||
node_wrapper_free(node TSRMLS_CC);
|
||||
} else {
|
||||
node_wrapper_dtor(node);
|
||||
}
|
||||
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* Navigate through the tree and unlink nodes which are referenced by objects */
|
||||
static inline void node_list_unlink(xmlNodePtr node)
|
||||
{
|
||||
zval *wrapper;
|
||||
|
||||
while (node != NULL) {
|
||||
|
||||
wrapper = dom_object_get_data(node);
|
||||
|
||||
if (wrapper != NULL ) {
|
||||
/* This node is referenced so no need to check children */
|
||||
xmlUnlinkNode(node);
|
||||
} else {
|
||||
node_list_unlink(node->children);
|
||||
|
||||
switch (node->type) {
|
||||
/* Skip property freeing for the following types */
|
||||
case XML_ATTRIBUTE_DECL:
|
||||
case XML_DTD_NODE:
|
||||
case XML_ENTITY_DECL:
|
||||
case XML_ATTRIBUTE_NODE:
|
||||
break;
|
||||
default:
|
||||
node_list_unlink((xmlNodePtr) node->properties);
|
||||
}
|
||||
}
|
||||
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
@@ -645,13 +720,12 @@ static void php_free_xml_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
xmlDoc *doc = (xmlDoc *) rsrc->ptr;
|
||||
|
||||
if (doc) {
|
||||
node_list_wrapper_dtor(doc->children);
|
||||
node_list_wrapper_dtor(doc->children, 0 TSRMLS_CC);
|
||||
node_wrapper_dtor((xmlNodePtr) doc);
|
||||
xmlFreeDoc(doc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void php_free_xml_node(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
xmlNodePtr node = (xmlNodePtr) rsrc->ptr;
|
||||
@@ -659,20 +733,23 @@ static void php_free_xml_node(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
/* if node has no parent, it will not be freed by php_free_xml_doc, so do it here
|
||||
and for all children as well. */
|
||||
if (node->parent == NULL) {
|
||||
attr_list_wrapper_dtor(node->properties);
|
||||
node_list_wrapper_dtor(node->children);
|
||||
/* Attribute Nodes ccontain accessible children
|
||||
attr_list_wrapper_dtor(node->properties); */
|
||||
node_list_wrapper_dtor((xmlNodePtr) node->properties, 0 TSRMLS_CC);
|
||||
node_list_wrapper_dtor(node->children, 0 TSRMLS_CC);
|
||||
node_wrapper_dtor(node);
|
||||
xmlFreeNode(node);
|
||||
} else {
|
||||
node_wrapper_dtor(node);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void php_free_xml_attr(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
xmlNodePtr node = (xmlNodePtr) rsrc->ptr;
|
||||
if (node->parent == NULL) {
|
||||
/* Attribute Nodes contain accessible children */
|
||||
node_list_wrapper_dtor(node->children, 0 TSRMLS_CC);
|
||||
node_wrapper_dtor(node);
|
||||
xmlFreeProp((xmlAttrPtr) node);
|
||||
} else {
|
||||
@@ -708,42 +785,37 @@ static void php_free_xml_parser(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
|
||||
|
||||
#if HAVE_DOMXSLT
|
||||
static void php_free_xslt_stylesheet(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
xsltStylesheetPtr sheet = (xsltStylesheetPtr) rsrc->ptr;
|
||||
|
||||
if (sheet) {
|
||||
node_wrapper_dtor((xmlNodePtr) sheet);
|
||||
xsltFreeStylesheet(sheet);
|
||||
}
|
||||
}
|
||||
|
||||
static void xsltstylesheet_set_data(void *obj, zval *wrapper)
|
||||
{
|
||||
/*
|
||||
char tmp[20];
|
||||
sprintf(tmp, "%08X", obj);
|
||||
fprintf(stderr, "Adding %s to hash\n", tmp);
|
||||
*/
|
||||
((xsltStylesheetPtr) obj)->_private = wrapper;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HELLY_0
|
||||
static zval *xsltstylesheet_get_data(void *obj)
|
||||
{
|
||||
/*
|
||||
char tmp[20];
|
||||
sprintf(tmp, "%08X", obj);
|
||||
fprintf(stderr, "Trying getting %s from object ...", tmp);
|
||||
if(((xmlNodePtr) obj)->_private)
|
||||
fprintf(stderr, " found\n");
|
||||
else
|
||||
fprintf(stderr, " not found\n");
|
||||
*/
|
||||
return ((zval *) (((xsltStylesheetPtr) obj)->_private));
|
||||
}
|
||||
#endif
|
||||
|
||||
static void php_free_xslt_stylesheet(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
xsltStylesheetPtr sheet = (xsltStylesheetPtr) rsrc->ptr;
|
||||
zval *wrapper;
|
||||
int refcount = 0;
|
||||
|
||||
if (sheet) {
|
||||
wrapper = xsltstylesheet_get_data(sheet);
|
||||
|
||||
if (wrapper != NULL ) {
|
||||
refcount = wrapper->refcount;
|
||||
zval_ptr_dtor(&wrapper);
|
||||
|
||||
/* only set it to null, if refcount was 1 before, otherwise it has still needed references */
|
||||
if (refcount == 1) {
|
||||
xsltstylesheet_set_data(sheet, NULL);
|
||||
}
|
||||
}
|
||||
xsltFreeStylesheet(sheet);
|
||||
}
|
||||
}
|
||||
|
||||
void *php_xsltstylesheet_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
|
||||
{
|
||||
@@ -775,7 +847,7 @@ void *php_xsltstylesheet_get_object(zval *wrapper, int rsrc_type1, int rsrc_type
|
||||
return obj;
|
||||
}
|
||||
|
||||
static void php_xsltstylesheet_set_object(zval *wrapper, void *obj, int rsrc_type)
|
||||
static void php_xsltstylesheet_set_object(zval *wrapper, void *obj, int rsrc_type TSRMLS_DC)
|
||||
{
|
||||
zval *handle, *addr;
|
||||
|
||||
@@ -889,7 +961,7 @@ static zval *xpath_context_get_data(void *obj)
|
||||
return ((zval *) (((xmlXPathContextPtr) obj)->user));
|
||||
}
|
||||
|
||||
static void php_xpath_set_context(zval *wrapper, void *obj, int rsrc_type)
|
||||
static void php_xpath_set_context(zval *wrapper, void *obj, int rsrc_type TSRMLS_DC)
|
||||
{
|
||||
zval *handle, *addr;
|
||||
|
||||
@@ -932,7 +1004,7 @@ static zval *php_xpathcontext_new(xmlXPathContextPtr obj, int *found TSRMLS_DC)
|
||||
*/
|
||||
object_init_ex(wrapper, xpathctx_class_entry);
|
||||
rsrc_type = le_xpathctxp;
|
||||
php_xpath_set_context(wrapper, (void *) obj, rsrc_type);
|
||||
php_xpath_set_context(wrapper, (void *) obj, rsrc_type TSRMLS_CC);
|
||||
|
||||
return (wrapper);
|
||||
}
|
||||
@@ -944,7 +1016,7 @@ static void xmlparser_set_data(void *obj, zval *wrapper)
|
||||
}
|
||||
|
||||
|
||||
static void php_xmlparser_set_object(zval *wrapper, void *obj, int rsrc_type)
|
||||
static void php_xmlparser_set_object(zval *wrapper, void *obj, int rsrc_type TSRMLS_DC)
|
||||
{
|
||||
zval *handle, *addr;
|
||||
|
||||
@@ -979,7 +1051,7 @@ static zval *php_xmlparser_new(xmlParserCtxtPtr obj, int *found TSRMLS_DC)
|
||||
MAKE_STD_ZVAL(wrapper);
|
||||
object_init_ex(wrapper, domxmlparser_class_entry);
|
||||
rsrc_type = le_domxmlparserp;
|
||||
php_xmlparser_set_object(wrapper, (void *) obj, rsrc_type);
|
||||
php_xmlparser_set_object(wrapper, (void *) obj, rsrc_type TSRMLS_CC);
|
||||
|
||||
return (wrapper);
|
||||
}
|
||||
@@ -1061,7 +1133,7 @@ void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC
|
||||
}
|
||||
|
||||
|
||||
static void php_dom_set_object(zval *wrapper, void *obj, int rsrc_type)
|
||||
static void php_dom_set_object(zval *wrapper, void *obj, int rsrc_type TSRMLS_DC)
|
||||
{
|
||||
zval *handle, *addr;
|
||||
|
||||
@@ -1301,7 +1373,7 @@ PHPAPI zval *php_domobject_new(xmlNodePtr obj, int *found, zval *wrapper_in TSR
|
||||
return NULL;
|
||||
}
|
||||
|
||||
php_dom_set_object(wrapper, (void *) obj, rsrc_type);
|
||||
php_dom_set_object(wrapper, (void *) obj, rsrc_type TSRMLS_CC);
|
||||
return (wrapper);
|
||||
}
|
||||
|
||||
@@ -1314,7 +1386,7 @@ static void domxml_error(void *ctx, const char *msg, ...)
|
||||
va_start(ap, msg);
|
||||
vsnprintf(buf, 1024, msg, ap);
|
||||
va_end(ap);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, buf);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", buf);
|
||||
}
|
||||
|
||||
static void domxml_error_ext(void *ctx, const char *msg, ...)
|
||||
@@ -1351,7 +1423,7 @@ static void domxml_error_ext(void *ctx, const char *msg, ...)
|
||||
}
|
||||
add_next_index_zval(ctxt->_private,errormessages);
|
||||
}
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, buf);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", buf);
|
||||
|
||||
}
|
||||
|
||||
@@ -1398,7 +1470,7 @@ static void domxml_error_validate(void *ctx, const char *msg, ...)
|
||||
add_next_index_zval(ctxt->errors,errormessages);
|
||||
}
|
||||
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, buf);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", buf);
|
||||
|
||||
}
|
||||
|
||||
@@ -1462,25 +1534,29 @@ xmlDocPtr php_dom_xmlSAXParse(xmlSAXHandlerPtr sax, const char *buffer, int size
|
||||
return(ret);
|
||||
}
|
||||
|
||||
PHP_RINIT_FUNCTION(domxml)
|
||||
PHP_MSHUTDOWN_FUNCTION(domxml)
|
||||
{
|
||||
#if HAVE_DOMXSLT
|
||||
xsltCleanupGlobals();
|
||||
#endif
|
||||
xmlCleanupParser();
|
||||
|
||||
/* If you want do find memleaks in this module, compile libxml2 with --with-mem-debug and
|
||||
uncomment the following line, this will tell you the amount of not freed memory
|
||||
and the total used memory into apaches error_log */
|
||||
/* xmlMemoryDump(); */
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/* PHP_MINIT_FUNCTION(domxml)
|
||||
*/
|
||||
PHP_MINIT_FUNCTION(domxml)
|
||||
{
|
||||
zend_class_entry ce;
|
||||
|
||||
le_domxmldocp = zend_register_list_destructors_ex(php_free_xml_doc, NULL, "domdocument", module_number);
|
||||
/* Freeing the document contains freeing the complete tree.
|
||||
Therefore nodes, attributes etc. may not be freed seperately.
|
||||
*/
|
||||
le_domxmlnodep = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domnode", module_number);
|
||||
le_domxmlcommentp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domcomment", module_number);
|
||||
le_domxmlattrp = zend_register_list_destructors_ex(php_free_xml_attr, NULL, "domattribute", module_number);
|
||||
le_domxmltextp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domtext", module_number);
|
||||
le_domxmlattrp = zend_register_list_destructors_ex(php_free_xml_attr, NULL, "domattribute", module_number);
|
||||
le_domxmlelementp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domelement", module_number);
|
||||
le_domxmldtdp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domdtd", module_number);
|
||||
le_domxmlcdatap = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domcdata", module_number);
|
||||
@@ -1488,6 +1564,11 @@ PHP_MINIT_FUNCTION(domxml)
|
||||
le_domxmlpip = zend_register_list_destructors_ex(php_free_xml_node, NULL, "dompi", module_number);
|
||||
le_domxmlparserp = zend_register_list_destructors_ex(php_free_xml_parser, NULL, "domparser", module_number);
|
||||
le_domxmldoctypep = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domdocumenttype", module_number);
|
||||
le_domxmldocp = zend_register_list_destructors_ex(php_free_xml_doc, NULL, "domdocument", module_number);
|
||||
/* Freeing the document contains freeing the complete tree.
|
||||
Therefore nodes, attributes etc. may not be freed seperately.
|
||||
Moved to end of list to support loading via dl()
|
||||
*/
|
||||
/* Not yet initialized le_*s */
|
||||
le_domxmlnotationp = -10003;
|
||||
|
||||
@@ -1709,12 +1790,42 @@ PHP_FUNCTION(domxml_attr_value)
|
||||
{
|
||||
zval *id;
|
||||
xmlAttrPtr attrp;
|
||||
xmlChar *content;
|
||||
|
||||
DOMXML_GET_THIS_OBJ(attrp, id, le_domxmlattrp);
|
||||
|
||||
DOMXML_NO_ARGS();
|
||||
|
||||
RETURN_STRING((char *) xmlNodeGetContent((xmlNodePtr) attrp), 1);
|
||||
/* RETURN_STRING((char *) xmlNodeGetContent((xmlNodePtr) attrp), 1); */
|
||||
if ((content = xmlNodeGetContent((xmlNodePtr) attrp)) != NULL) {
|
||||
RETVAL_STRING(content,1);
|
||||
} else {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
xmlFree(content);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool domxml_attr_set_value(string content)
|
||||
Set value of attribute */
|
||||
PHP_FUNCTION(domxml_attr_set_value)
|
||||
{
|
||||
zval *id;
|
||||
xmlAttrPtr attrp;
|
||||
int content_len;
|
||||
char *content;
|
||||
|
||||
DOMXML_PARAM_TWO(attrp, id, le_domxmlattrp, "s", &content, &content_len);
|
||||
|
||||
/* If attribute has children unlink referenced nodes
|
||||
Spec indicates that content is to be overwritten and not appended
|
||||
xmlNodeSetContentLen will take care of removing and freeing the rest */
|
||||
if (attrp->children) {
|
||||
node_list_unlink(((xmlNodePtr) attrp) ->children);
|
||||
}
|
||||
xmlNodeSetContentLen((xmlNodePtr) attrp, content, content_len);
|
||||
RETURN_TRUE;
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1760,12 +1871,19 @@ PHP_FUNCTION(domxml_pi_data)
|
||||
{
|
||||
zval *id;
|
||||
xmlNodePtr nodep;
|
||||
xmlChar *content;
|
||||
|
||||
DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlpip);
|
||||
|
||||
DOMXML_NO_ARGS();
|
||||
|
||||
RETURN_STRING(xmlNodeGetContent(nodep), 1);
|
||||
/* RETURN_STRING(xmlNodeGetContent(nodep), 1); */
|
||||
if ((content = xmlNodeGetContent(nodep)) != NULL) {
|
||||
RETVAL_STRING(content,1);
|
||||
} else {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
xmlFree(content);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1967,7 +2085,8 @@ PHP_FUNCTION(domxml_clone_node)
|
||||
zval *rv = NULL;
|
||||
zval *id;
|
||||
xmlNode *n, *node;
|
||||
int ret, recursive = 0;;
|
||||
int ret;
|
||||
long recursive = 0;
|
||||
|
||||
DOMXML_GET_THIS_OBJ(n, id, le_domxmlnodep);
|
||||
|
||||
@@ -2296,14 +2415,20 @@ PHP_FUNCTION(domxml_node_append_child)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't append attribute node");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* XXX:ls */
|
||||
if (child == parent) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't append node to itself");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (!(child->doc == NULL || child->doc == parent->doc)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't append node, which is in a different document than the parent node");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* first unlink node, if child is already a child of parent */
|
||||
if (child->parent == parent){
|
||||
/* first unlink node, if child is already in the tree */
|
||||
if (child->doc == parent->doc && child->parent != NULL){
|
||||
xmlUnlinkNode(child);
|
||||
}
|
||||
|
||||
@@ -2394,9 +2519,40 @@ PHP_FUNCTION(domxml_node_insert_before)
|
||||
|
||||
DOMXML_GET_OBJ(child, node, le_domxmlnodep);
|
||||
|
||||
new_child = NULL;
|
||||
|
||||
if (ref != NULL) {
|
||||
DOMXML_GET_OBJ(refp, ref, le_domxmlnodep);
|
||||
new_child = xmlAddPrevSibling(refp, child);
|
||||
|
||||
/*
|
||||
* The following code is from libxml2/tree.c
|
||||
* libxml does free textnodes, if there are adjacent TEXT nodes
|
||||
* This is bad behaviour for domxml, since then we have have reference
|
||||
* to undefined nodes. The idea here is, that we do this text comparison
|
||||
* by ourself and not free the nodes. and only if libxml2 won't do any harm
|
||||
* call the function from libxml2.
|
||||
* The code is exactly the same as in libxml2, only xmlFreeNode was taken away.
|
||||
*/
|
||||
|
||||
if (child->type == XML_TEXT_NODE) {
|
||||
if (refp->type == XML_TEXT_NODE) {
|
||||
xmlChar *tmp;
|
||||
|
||||
tmp = xmlStrdup(child->content);
|
||||
tmp = xmlStrcat(tmp, refp->content);
|
||||
xmlNodeSetContent(refp, tmp);
|
||||
xmlFree(tmp);
|
||||
new_child = refp;
|
||||
}
|
||||
if ((refp->prev != NULL) && (refp->prev->type == XML_TEXT_NODE)
|
||||
&& (refp->name == refp->prev->name)) {
|
||||
xmlNodeAddContent(refp->prev, child->content);
|
||||
new_child = refp->prev;
|
||||
}
|
||||
}
|
||||
|
||||
if (new_child == NULL)
|
||||
new_child = xmlAddPrevSibling(refp, child);
|
||||
} else {
|
||||
/* first unlink node, if child is already a child of parent
|
||||
for some strange reason, this is needed
|
||||
@@ -2734,6 +2890,13 @@ PHP_FUNCTION(domxml_elem_set_attribute)
|
||||
|
||||
DOMXML_PARAM_FOUR(nodep, id, le_domxmlelementp, "ss", &name, &name_len, &value, &value_len);
|
||||
|
||||
|
||||
/* If attribute exists, all children nodes are freed by setprop
|
||||
unlink referenced children */
|
||||
attr = xmlHasProp(nodep,name);
|
||||
if (attr != NULL) {
|
||||
node_list_unlink(attr->children);
|
||||
}
|
||||
attr = xmlSetProp(nodep, name, value);
|
||||
if (!attr) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such attribute '%s'", name);
|
||||
@@ -2759,7 +2922,17 @@ PHP_FUNCTION(domxml_elem_remove_attribute)
|
||||
if (attrp == NULL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
xmlUnlinkNode((xmlNodePtr)attrp);
|
||||
|
||||
/* Check for registered nodes within attributes tree when attribute is not referenced
|
||||
Unlink dependant nodes and free attribute if not registered */
|
||||
if (dom_object_get_data((xmlNodePtr) attrp) == NULL) {
|
||||
node_list_unlink(attrp->children);
|
||||
xmlUnlinkNode((xmlNodePtr) attrp);
|
||||
xmlFreeProp(attrp);
|
||||
} else {
|
||||
xmlUnlinkNode((xmlNodePtr) attrp);
|
||||
}
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2846,6 +3019,7 @@ PHP_FUNCTION(domxml_doc_get_elements_by_tagname)
|
||||
xmlXPathObjectPtr xpathobjp;
|
||||
xmlNode *contextnodep;
|
||||
int name_len;
|
||||
int free_context = 0;
|
||||
char *str,*name;
|
||||
|
||||
contextnode = NULL;
|
||||
@@ -2856,6 +3030,7 @@ PHP_FUNCTION(domxml_doc_get_elements_by_tagname)
|
||||
/* if no xpath_context was submitted, create a new one */
|
||||
if (ctxpin == NULL) {
|
||||
ctxp = xmlXPathNewContext(docp);
|
||||
free_context = 1;
|
||||
} else {
|
||||
DOMXML_GET_OBJ(ctxp, ctxpin, le_xpathctxp);
|
||||
}
|
||||
@@ -2893,6 +3068,10 @@ PHP_FUNCTION(domxml_doc_get_elements_by_tagname)
|
||||
|
||||
if (NULL == (nodesetp = xpathobjp->nodesetval)) {
|
||||
zval_dtor(rv);
|
||||
xmlXPathFreeObject (xpathobjp);
|
||||
if (free_context) {
|
||||
xmlXPathFreeContext(ctxp);
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -2912,6 +3091,10 @@ PHP_FUNCTION(domxml_doc_get_elements_by_tagname)
|
||||
break;
|
||||
}
|
||||
|
||||
xmlXPathFreeObject(xpathobjp);
|
||||
if (free_context) {
|
||||
xmlXPathFreeContext(ctxp);
|
||||
}
|
||||
*return_value = *rv;
|
||||
FREE_ZVAL(rv);
|
||||
}
|
||||
@@ -2990,6 +3173,7 @@ PHP_FUNCTION(domxml_elem_get_elements_by_tagname)
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(rv), &child, sizeof(zval *), NULL);
|
||||
}
|
||||
}
|
||||
xmlXPathFreeNodeSet(nodesetp);
|
||||
*return_value = *rv;
|
||||
FREE_ZVAL(rv);
|
||||
|
||||
@@ -3301,7 +3485,11 @@ PHP_FUNCTION(domxml_node_set_namespace)
|
||||
|
||||
/* if node is in a document, search for an already existing namespace */
|
||||
if (nodep->doc != NULL) {
|
||||
nsptr = xmlSearchNsByHref(nodep->doc, nodep, (xmlChar*) uri);
|
||||
if (nodep->type == XML_ATTRIBUTE_NODE) {
|
||||
nsptr = xmlSearchNsByHref(nodep->doc, nodep->parent, (xmlChar*) uri);
|
||||
} else {
|
||||
nsptr = xmlSearchNsByHref(nodep->doc, nodep, (xmlChar*) uri);
|
||||
}
|
||||
} else {
|
||||
nsptr = NULL;
|
||||
}
|
||||
@@ -3316,9 +3504,13 @@ PHP_FUNCTION(domxml_node_set_namespace)
|
||||
sprintf(prefixtmp, "a%d", random);
|
||||
prefix = prefixtmp;
|
||||
}
|
||||
nsptr = xmlNewNs(nodep, uri, prefix);
|
||||
if (nodep->type == XML_ATTRIBUTE_NODE) {
|
||||
nsptr = xmlNewNs(nodep->parent, uri, prefix);
|
||||
} else {
|
||||
nsptr = xmlNewNs(nodep, uri, prefix);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
xmlSetNs(nodep, nsptr);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3521,7 +3713,8 @@ PHP_FUNCTION(domxml_doc_imported_node)
|
||||
zval *arg1, *id, *rv = NULL;
|
||||
xmlNodePtr node, srcnode;
|
||||
xmlDocPtr docp;
|
||||
int ret, recursive = 0;
|
||||
int ret;
|
||||
long recursive = 0;
|
||||
|
||||
DOMXML_GET_THIS_OBJ(docp, id, le_domxmldocp);
|
||||
|
||||
@@ -3532,11 +3725,14 @@ PHP_FUNCTION(domxml_doc_imported_node)
|
||||
|
||||
DOMXML_GET_OBJ(srcnode, arg1, le_domxmlnodep);
|
||||
|
||||
node = xmlCopyNode(srcnode, recursive);
|
||||
/* node = xmlCopyNode(srcnode, recursive); */
|
||||
node = xmlDocCopyNode(srcnode, docp, recursive);
|
||||
if (!node) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
node->doc = docp; /* Not enough because other nodes in the tree are not set */
|
||||
/* No longer need handled by xmlDocCopyNode
|
||||
node->doc = docp;
|
||||
*/
|
||||
|
||||
DOMXML_RET_OBJ(rv, node, &ret);
|
||||
}
|
||||
@@ -3613,6 +3809,10 @@ PHP_FUNCTION(domxml_dump_mem_file)
|
||||
|
||||
DOMXML_PARAM_FOUR(docp, id, le_domxmldocp, "s|ll", &file, &file_len, &compressmode, &format);
|
||||
|
||||
if ((PG(safe_mode) && (!php_checkuid(file, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(file TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
xmlSetCompressMode(compressmode);
|
||||
|
||||
if (format) {
|
||||
@@ -3651,6 +3851,11 @@ PHP_FUNCTION(domxml_dump_node)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (docp->type != XML_DOCUMENT_NODE && docp->type != XML_HTML_DOCUMENT_NODE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Object has to be a DomDocument Node");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
buf = xmlBufferCreate();
|
||||
if (!buf) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not fetch buffer");
|
||||
@@ -3722,7 +3927,8 @@ PHP_FUNCTION(xmldoc)
|
||||
int ret;
|
||||
char *buffer;
|
||||
int buffer_len;
|
||||
int mode = 0, prevSubstValue;
|
||||
long mode = 0;
|
||||
int prevSubstValue;
|
||||
int oldvalue = xmlDoValidityCheckingDefaultValue;
|
||||
int oldvalue_keepblanks;
|
||||
int prevLoadExtDtdValue = xmlLoadExtDtdDefaultValue;
|
||||
@@ -3808,7 +4014,8 @@ PHP_FUNCTION(xmldocfile)
|
||||
xmlDoc *docp = NULL;
|
||||
int ret, file_len;
|
||||
char *file;
|
||||
int mode = 0, prevSubstValue;
|
||||
long mode = 0;
|
||||
int prevSubstValue;
|
||||
int oldvalue = xmlDoValidityCheckingDefaultValue;
|
||||
int oldvalue_keepblanks;
|
||||
zval *errors = NULL;
|
||||
@@ -4010,7 +4217,7 @@ PHP_FUNCTION(domxml_doc_add_root)
|
||||
{
|
||||
zval *id, *rv = NULL;
|
||||
xmlDoc *docp;
|
||||
xmlNode *nodep;
|
||||
xmlNode *nodep, *root;
|
||||
int ret, name_len;
|
||||
char *name;
|
||||
|
||||
@@ -4021,7 +4228,14 @@ PHP_FUNCTION(domxml_doc_add_root)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
xmlDocSetRootElement(docp, nodep);
|
||||
if ((root = xmlDocSetRootElement(docp, nodep)) != NULL) {
|
||||
/* Root node already unlinked from xmlDocSetRootElement */
|
||||
if (dom_object_get_data(root) == NULL) {
|
||||
node_list_unlink(root->children);
|
||||
node_list_unlink((xmlNodePtr) root->properties);
|
||||
xmlFreeNode(root);
|
||||
}
|
||||
}
|
||||
|
||||
DOMXML_RET_OBJ(rv, nodep, &ret);
|
||||
}
|
||||
@@ -4111,6 +4325,30 @@ PHP_FUNCTION(domxml_new_xmldoc)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool domxml_doc_free_doc()
|
||||
Frees xmldoc and removed objects from hash */
|
||||
PHP_FUNCTION(domxml_doc_free_doc)
|
||||
{
|
||||
zval *doc;
|
||||
xmlNode *docp;
|
||||
|
||||
DOMXML_GET_THIS_OBJ(docp, doc, le_domxmldocp);
|
||||
|
||||
if (! (docp->type == XML_DOCUMENT_NODE || docp->type == XML_HTML_DOCUMENT_NODE) ) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "DomDocument is required");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
node_list_wrapper_dtor(docp->children, 1 TSRMLS_CC);
|
||||
node_list_wrapper_dtor((xmlNodePtr) docp->properties, 1 TSRMLS_CC);
|
||||
/* Attribute Nodes ccontain accessible children
|
||||
attr_list_wrapper_dtor(docp->properties); */
|
||||
node_wrapper_free(docp TSRMLS_CC);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto object domxml_parser([string buf[,string filename]])
|
||||
Creates new xmlparser */
|
||||
PHP_FUNCTION(domxml_parser)
|
||||
@@ -4486,14 +4724,18 @@ static int node_attributes(zval **attributes, xmlNode *nodep TSRMLS_DC)
|
||||
while (attr) {
|
||||
zval *pattr;
|
||||
int ret;
|
||||
xmlChar *content;
|
||||
|
||||
pattr = php_domobject_new((xmlNodePtr) attr, &ret, NULL TSRMLS_CC);
|
||||
/** XXX FIXME XXX */
|
||||
/* if(0 <= (n = node_children(&children, attr->children TSRMLS_CC))) {
|
||||
zend_hash_update(Z_OBJPROP_P(value), "children", sizeof("children"), (void *) &children, sizeof(zval *), NULL);
|
||||
}
|
||||
*/ add_property_string(pattr, "name", (char *) (attr->name), 1);
|
||||
add_property_string(pattr, "value", xmlNodeGetContent((xmlNodePtr) attr), 1);
|
||||
*/
|
||||
add_property_string(pattr, "name", (char *) (attr->name), 1);
|
||||
content = xmlNodeGetContent((xmlNodePtr) attr);
|
||||
add_property_string(pattr, "value", content, 1);
|
||||
xmlFree(content);
|
||||
zend_hash_next_index_insert(Z_ARRVAL_PP(attributes), &pattr, sizeof(zval *), NULL);
|
||||
attr = attr->next;
|
||||
count++;
|
||||
@@ -4810,9 +5052,19 @@ PHP_FUNCTION(xpath_register_ns)
|
||||
|
||||
DOMXML_PARAM_FOUR(ctxp, id, le_xpathctxp, "ss", &prefix, &prefix_len, &uri, &uri_len);
|
||||
|
||||
/* set the context node to NULL - what is a context node anyway? */
|
||||
ctxp->node = NULL;
|
||||
|
||||
#ifdef CHREGU_0
|
||||
/* this leads to memleaks... commenting it out, as it works for me without copying
|
||||
it. chregu */
|
||||
/*
|
||||
this is a hack - libxml2 doesn't copy the URI, it simply uses the string
|
||||
given in the parameter - which is normally deallocated after the function
|
||||
*/
|
||||
uri_static = estrndup(uri, uri_len);
|
||||
result = xmlXPathRegisterNs(ctxp, prefix, uri_static);
|
||||
#endif
|
||||
|
||||
result = xmlXPathRegisterNs(ctxp, prefix, uri);
|
||||
|
||||
if (0 == result) {
|
||||
@@ -4886,7 +5138,7 @@ static zval *php_xsltstylesheet_new(xsltStylesheetPtr obj, int *found TSRMLS_DC)
|
||||
|
||||
object_init_ex(wrapper, domxsltstylesheet_class_entry);
|
||||
rsrc_type = le_domxsltstylesheetp;
|
||||
php_xsltstylesheet_set_object(wrapper, (void *) obj, rsrc_type);
|
||||
php_xsltstylesheet_set_object(wrapper, (void *) obj, rsrc_type TSRMLS_CC);
|
||||
|
||||
return (wrapper);
|
||||
}
|
||||
@@ -4921,8 +5173,10 @@ PHP_FUNCTION(domxml_xslt_stylesheet)
|
||||
|
||||
sheetp = xsltParseStylesheetDoc(docp);
|
||||
|
||||
if (!sheetp)
|
||||
if (!sheetp) {
|
||||
xmlFreeDoc(docp);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
rv = php_xsltstylesheet_new(sheetp, &ret TSRMLS_CC);
|
||||
DOMXML_RET_ZVAL(rv);
|
||||
@@ -4952,9 +5206,10 @@ PHP_FUNCTION(domxml_xslt_stylesheet_doc)
|
||||
|
||||
sheetp = xsltParseStylesheetDoc(newdocp);
|
||||
|
||||
if (!sheetp)
|
||||
if (!sheetp) {
|
||||
xmlFreeDoc(newdocp);
|
||||
RETURN_FALSE;
|
||||
|
||||
}
|
||||
rv = php_xsltstylesheet_new(sheetp, &ret TSRMLS_CC);
|
||||
DOMXML_RET_ZVAL(rv);
|
||||
}
|
||||
@@ -5169,7 +5424,8 @@ PHP_FUNCTION(domxml_xslt_result_dump_file)
|
||||
xmlDocPtr xmldocp;
|
||||
char *filename;
|
||||
int filename_len;
|
||||
int ret, compression = 0;
|
||||
int ret;
|
||||
long compression = 0;
|
||||
|
||||
DOMXML_GET_THIS(idxsl);
|
||||
|
||||
@@ -5182,6 +5438,9 @@ PHP_FUNCTION(domxml_xslt_result_dump_file)
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "os|l", &idxml, &filename, &filename_len, &compression) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
DOMXML_GET_OBJ(xmldocp, idxml, le_domxmldocp);
|
||||
|
||||
|
||||
Loaded 100 of 770 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user