mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-25 18:05:42 +00:00
Compare commits
748
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fa3785651 | ||
|
|
f03caa7b35 | ||
|
|
84eb811be9 | ||
|
|
86da4546de | ||
|
|
9006d8e97b | ||
|
|
e189a15dbf | ||
|
|
88ccac85f3 | ||
|
|
f22b3a19cf | ||
|
|
78f795af80 | ||
|
|
4b18e8086a | ||
|
|
73b34fff94 | ||
|
|
dc04255655 | ||
|
|
c254e0f3ee | ||
|
|
dca5128c58 | ||
|
|
64ee4a850e | ||
|
|
8ff5296643 | ||
|
|
9a24af562c | ||
|
|
e943420bbb | ||
|
|
4608fd6e3f | ||
|
|
370a9e6266 | ||
|
|
59835d886b | ||
|
|
17a411d422 | ||
|
|
393dfba684 | ||
|
|
6d369a51c8 | ||
|
|
9decf616c9 | ||
|
|
f4d96cee48 | ||
|
|
afd5493707 | ||
|
|
7df5e203c6 | ||
|
|
36478058f4 | ||
|
|
fe871be5ca | ||
|
|
25679a60c7 | ||
|
|
afd9e80cb1 | ||
|
|
2361e1e342 | ||
|
|
e41125d052 | ||
|
|
5be79b203b | ||
|
|
9c4b602ee2 | ||
|
|
27879d0f0d | ||
|
|
800b1765ae | ||
|
|
0e93bfdbc3 | ||
|
|
7b7543afad | ||
|
|
4bd822a180 | ||
|
|
35e0567b62 | ||
|
|
4191d2bde1 | ||
|
|
ef14bdb691 | ||
|
|
69cfb62619 | ||
|
|
adfb56c304 | ||
|
|
f335d5447e | ||
|
|
ef89c82c02 | ||
|
|
4c28ca442f | ||
|
|
3a63f098bd | ||
|
|
c0ddfe89e2 | ||
|
|
da62e960e2 | ||
|
|
d0d3b02de7 | ||
|
|
2ce3e8cdec | ||
|
|
2a1bfae434 | ||
|
|
ac534dbf37 | ||
|
|
2aeb246874 | ||
|
|
18a2f7bab4 | ||
|
|
8b2def80d0 | ||
|
|
f0ae93e466 | ||
|
|
21616c7854 | ||
|
|
116956cc64 | ||
|
|
2dd02323c0 | ||
|
|
a85a72e29a | ||
|
|
7492d02cb2 | ||
|
|
52d5dd4da5 | ||
|
|
16ab834b5e | ||
|
|
1b60fa245e | ||
|
|
c057fc931a | ||
|
|
10243d019d | ||
|
|
a13710455c | ||
|
|
cfac03af3c | ||
|
|
39894c69cd | ||
|
|
59d28ed4df | ||
|
|
e2cf657294 | ||
|
|
d18b7a533a | ||
|
|
9308d262d0 | ||
|
|
ad791c135c | ||
|
|
48900111a8 | ||
|
|
61e4791abe | ||
|
|
9b708216d5 | ||
|
|
f692aeb36b | ||
|
|
3a867aad64 | ||
|
|
e4a63807a1 | ||
|
|
1a92434b06 | ||
|
|
2dfed48c99 | ||
|
|
1c2b48e0ca | ||
|
|
fea1d6c1fb | ||
|
|
a754abdc5f | ||
|
|
a56a817706 | ||
|
|
e547d66316 | ||
|
|
d6f18bd5f3 | ||
|
|
6d0d0172f3 | ||
|
|
e2e0cfb6fa | ||
|
|
ec1d763fd2 | ||
|
|
d88229acba | ||
|
|
eb00f1dd54 | ||
|
|
adec65bea6 | ||
|
|
a82bc1b50c | ||
|
|
7620efc274 | ||
|
|
45775e2029 | ||
|
|
46eecba03b | ||
|
|
6e6732ae6a | ||
|
|
9c33e3d3ce | ||
|
|
fff1d6a533 | ||
|
|
ab2ba0f49f | ||
|
|
bda27d167f | ||
|
|
edff9053e8 | ||
|
|
60d11d734c | ||
|
|
5e9a4ecc0e | ||
|
|
0d59c975a0 | ||
|
|
6db270f8fc | ||
|
|
a11f040979 | ||
|
|
e2a74cf344 | ||
|
|
89dde23f32 | ||
|
|
a07e4ef2ff | ||
|
|
a60b5db89e | ||
|
|
85bffe131e | ||
|
|
361aa7dd32 | ||
|
|
e5b50cede5 | ||
|
|
b5b29e267e | ||
|
|
d632dba1ef | ||
|
|
4704bb7186 | ||
|
|
b1eafc6a75 | ||
|
|
c2a66c59c6 | ||
|
|
cb9b99262e | ||
|
|
480e8dd7fc | ||
|
|
f1b478c291 | ||
|
|
a23dfb3b11 | ||
|
|
5646e5f747 | ||
|
|
ee9deb187a | ||
|
|
806c28b5c2 | ||
|
|
8103e07a23 | ||
|
|
de85bccf03 | ||
|
|
18557cba09 | ||
|
|
2fb568e65e | ||
|
|
94f05e60c2 | ||
|
|
2bf4ba798f | ||
|
|
0d6bac093d | ||
|
|
f17845f9bd | ||
|
|
40a1c4b4f4 | ||
|
|
283476972f | ||
|
|
8acd0a3835 | ||
|
|
925a3b6ba8 | ||
|
|
149d034a81 | ||
|
|
b485c4f26c | ||
|
|
db8d5a7fb0 | ||
|
|
ee3c85162f | ||
|
|
ccc0fb6122 | ||
|
|
d18b757655 | ||
|
|
08604e5d44 | ||
|
|
ce2f1ce4bc | ||
|
|
872948f21a | ||
|
|
491cf63bab | ||
|
|
675a41bee2 | ||
|
|
5714f48f4c | ||
|
|
05331829c6 | ||
|
|
258d90d101 | ||
|
|
8d28cb5737 | ||
|
|
c1a998a604 | ||
|
|
ca4d592e11 | ||
|
|
42d1578fb4 | ||
|
|
36e88551eb | ||
|
|
fea99094df | ||
|
|
5b3a654f07 | ||
|
|
0e09bbae14 | ||
|
|
3fcd022dc5 | ||
|
|
66ac209938 | ||
|
|
bbbf1df01d | ||
|
|
3857aa4f7d | ||
|
|
b4bed3fd88 | ||
|
|
776587fdac | ||
|
|
d0d8c4a6a3 | ||
|
|
353dd2444a | ||
|
|
472aaf3f50 | ||
|
|
186e6dc1ba | ||
|
|
46afe5a792 | ||
|
|
99ab17375d | ||
|
|
6d36221995 | ||
|
|
2dadbe3855 | ||
|
|
a11e7affc8 | ||
|
|
fbed1b901c | ||
|
|
75d44d8c07 | ||
|
|
491347fba6 | ||
|
|
b2a44d9327 | ||
|
|
3e59eb2be9 | ||
|
|
32f67e7664 | ||
|
|
010213e4ca | ||
|
|
6afa7b45ef | ||
|
|
6e1032c30d | ||
|
|
70c3e3e95f | ||
|
|
c290f39e3b | ||
|
|
b0fe9422e4 | ||
|
|
2f695ba37d | ||
|
|
72e5f9d395 | ||
|
|
1ba3c62c8b | ||
|
|
e56b9397d9 | ||
|
|
4aacd42826 | ||
|
|
ac848809b5 | ||
|
|
3f585ac923 | ||
|
|
f7972bc8be | ||
|
|
cd8ba5af5b | ||
|
|
fc787ac20f | ||
|
|
72cafaaabf | ||
|
|
968eb65b01 | ||
|
|
c872775134 | ||
|
|
55ec6edbfb | ||
|
|
7a06046d74 | ||
|
|
9761587fc6 | ||
|
|
65b33edeee | ||
|
|
62b4710d9e | ||
|
|
e60d220d5c | ||
|
|
e8d32e9779 | ||
|
|
32505ff927 | ||
|
|
5bda30d1bb | ||
|
|
40bc834210 | ||
|
|
24f458a004 | ||
|
|
aa405f4114 | ||
|
|
13e0c93f0c | ||
|
|
9ec1245550 | ||
|
|
aa1c8bdee5 | ||
|
|
0934056575 | ||
|
|
f59a6aceea | ||
|
|
28dabfb7a6 | ||
|
|
bd5f18bdf7 | ||
|
|
95c6f3e8a0 | ||
|
|
1f2cc89995 | ||
|
|
d20b3d0ed5 | ||
|
|
94e8d2ec62 | ||
|
|
d5bb4753c8 | ||
|
|
8ab1c72867 | ||
|
|
bfb188eff5 | ||
|
|
cbb59ee1b0 | ||
|
|
b02ce8bdc7 | ||
|
|
4d98201217 | ||
|
|
189fe6e665 | ||
|
|
20a35aa472 | ||
|
|
889eb2234e | ||
|
|
b4a6c9fe75 | ||
|
|
b1e3eaacaf | ||
|
|
2457ddb3ba | ||
|
|
e225eee248 | ||
|
|
1c65d69485 | ||
|
|
1eb9a119af | ||
|
|
7651ed0925 | ||
|
|
901af0e106 | ||
|
|
b485be88da | ||
|
|
7c728e6b9e | ||
|
|
049eaa886a | ||
|
|
a2f21f3e8c | ||
|
|
4ac705885e | ||
|
|
5f003af4d4 | ||
|
|
6ce26891e8 | ||
|
|
3d9aed8039 | ||
|
|
c298c075f4 | ||
|
|
84c5c7da97 | ||
|
|
17d5386bb3 | ||
|
|
5fdef05cb0 | ||
|
|
ce4fbe580d | ||
|
|
9f8be37c4e | ||
|
|
bf26b9a7e1 | ||
|
|
c23ec177d5 | ||
|
|
1a283a6c42 | ||
|
|
ca64fae35d | ||
|
|
485cba185b | ||
|
|
43eddf7a58 | ||
|
|
5896ff7e80 | ||
|
|
0767e6f1e2 | ||
|
|
4f2153fd14 | ||
|
|
8edac7234d | ||
|
|
b767129303 | ||
|
|
6d57013b3e | ||
|
|
f137ee87f7 | ||
|
|
fa55a5a826 | ||
|
|
0be182e1ba | ||
|
|
c3757b1f05 | ||
|
|
21af3e8c4e | ||
|
|
4df567fe9d | ||
|
|
1c662bee50 | ||
|
|
e7f085d84b | ||
|
|
fc12da950c | ||
|
|
1f27563128 | ||
|
|
e2782d9e1d | ||
|
|
3782f21222 | ||
|
|
bc24daedc3 | ||
|
|
41c1ea1b05 | ||
|
|
415df9168f | ||
|
|
e98926be3f | ||
|
|
488f26359a | ||
|
|
e5cc26627a | ||
|
|
619d34b7f8 | ||
|
|
58fa31451a | ||
|
|
4942844edb | ||
|
|
f4d7971b7f | ||
|
|
ab9ceb9526 | ||
|
|
9e07fed96e | ||
|
|
0ea4d57d56 | ||
|
|
77005be687 | ||
|
|
aef886e34c | ||
|
|
b21f1582dd | ||
|
|
f8f72bd52e | ||
|
|
7cd06f5088 | ||
|
|
db7baa737f | ||
|
|
bb83f93954 | ||
|
|
008b424ee9 | ||
|
|
720d3804fc | ||
|
|
9d61de0ec9 | ||
|
|
16f3c4b7fb | ||
|
|
65c28b0cc6 | ||
|
|
c0edbc5eee | ||
|
|
a170be820e | ||
|
|
652147def5 | ||
|
|
343a1f081c | ||
|
|
c82c3a41b4 | ||
|
|
e2ee8d0edb | ||
|
|
d702e37902 | ||
|
|
e0d22f195b | ||
|
|
88004a6208 | ||
|
|
a2a30ca7d3 | ||
|
|
d7264e744d | ||
|
|
7f04983ed3 | ||
|
|
ac99c5ab03 | ||
|
|
60097c2661 | ||
|
|
72f98037f4 | ||
|
|
6465017e05 | ||
|
|
f75ae95c8f | ||
|
|
26ff74d670 | ||
|
|
b34666a014 | ||
|
|
d8bbff45c1 | ||
|
|
39a8fc274a | ||
|
|
b6006ed2fc | ||
|
|
4ceecd3e5e | ||
|
|
ab74b63ff2 | ||
|
|
3214d963ec | ||
|
|
6bacb29c98 | ||
|
|
339427de12 | ||
|
|
f1dd5c2406 | ||
|
|
bb4ea41589 | ||
|
|
c5a669caa6 | ||
|
|
cee27dd710 | ||
|
|
879fb489f3 | ||
|
|
1ab01b470b | ||
|
|
e25d006476 | ||
|
|
2732fbadbe | ||
|
|
418cada107 | ||
|
|
850a158531 | ||
|
|
4282e55dfe | ||
|
|
05a0c36072 | ||
|
|
05ae3f22ab | ||
|
|
903275e887 | ||
|
|
88b48b5376 | ||
|
|
88e0b419f2 | ||
|
|
33d7423950 | ||
|
|
30c26df348 | ||
|
|
cadd668aac | ||
|
|
b2c85181d0 | ||
|
|
7da8651511 | ||
|
|
22aab1e328 | ||
|
|
919f53ee51 | ||
|
|
3b2cf9ddef | ||
|
|
3f11a2a6a8 | ||
|
|
2725d3534f | ||
|
|
48c975a333 | ||
|
|
fe042a90b9 | ||
|
|
fab70dea69 | ||
|
|
7b1548e798 | ||
|
|
e084903eab | ||
|
|
3f71921c58 | ||
|
|
806f9145de | ||
|
|
bd3cb846c0 | ||
|
|
9356017daa | ||
|
|
351a686a7c | ||
|
|
61c05dfc9f | ||
|
|
553fb5a3be | ||
|
|
35f457c92e | ||
|
|
b855ab0dd4 | ||
|
|
238aa7baee | ||
|
|
46174f8ac8 | ||
|
|
379040771d | ||
|
|
37a02a3984 | ||
|
|
575b38ee2f | ||
|
|
977ec5eb4a | ||
|
|
064cab8ac8 | ||
|
|
d5fe19eb92 | ||
|
|
c2eb068c8a | ||
|
|
efc550eea3 | ||
|
|
3f54dd40b6 | ||
|
|
7c0dd1251c | ||
|
|
0d8beb77f6 | ||
|
|
1cab24458b | ||
|
|
cfc97c7d71 | ||
|
|
30f1001553 | ||
|
|
92d3c2a08e | ||
|
|
9cfcbd137b | ||
|
|
b74daafbcd | ||
|
|
af01cf787d | ||
|
|
6da25bdae8 | ||
|
|
6ffa3e1780 | ||
|
|
ff35f925b7 | ||
|
|
6b0aaabc98 | ||
|
|
e60da236ae | ||
|
|
d58f597885 | ||
|
|
a25742e18f | ||
|
|
b75c57e521 | ||
|
|
77a22a2835 | ||
|
|
0690aff6b5 | ||
|
|
f877a76a0e | ||
|
|
605563c0a8 | ||
|
|
b2a7d2ed4e | ||
|
|
b2bd6e465c | ||
|
|
ceb065f9eb | ||
|
|
c2302046dd | ||
|
|
bd6bd53646 | ||
|
|
c95bd4ad87 | ||
|
|
1167e85cf3 | ||
|
|
77225b912f | ||
|
|
aa3a1426e8 | ||
|
|
0072a36646 | ||
|
|
cecfd0ace4 | ||
|
|
d7409a9797 | ||
|
|
1560aabbaf | ||
|
|
6ff7c1cedf | ||
|
|
6c7394101b | ||
|
|
c4845a8b65 | ||
|
|
728ca44dff | ||
|
|
1af7f512bc | ||
|
|
07ff7f16c7 | ||
|
|
bfcbf4bc19 | ||
|
|
69322ae43b | ||
|
|
2dea730e08 | ||
|
|
84cc58d013 | ||
|
|
165a1d62c8 | ||
|
|
d5fba05f61 | ||
|
|
9868377fa0 | ||
|
|
c25ed56914 | ||
|
|
a6aef8844f | ||
|
|
7d96d95a5e | ||
|
|
79ff9f2fa3 | ||
|
|
79f338488e | ||
|
|
7c70a8f8c2 | ||
|
|
1e76a63719 | ||
|
|
29c92b6d91 | ||
|
|
7ec8b0bcba | ||
|
|
370eecd336 | ||
|
|
f89eae47f2 | ||
|
|
3d598476ec | ||
|
|
b7d673db52 | ||
|
|
e3d9b17e53 | ||
|
|
dfba9a0ab0 | ||
|
|
47e16d8ad6 | ||
|
|
f3618527a6 | ||
|
|
ad2fa621bd | ||
|
|
f2565109ea | ||
|
|
b1a7a8d572 | ||
|
|
519c152527 | ||
|
|
2e783c4dac | ||
|
|
e95fbd1f2c | ||
|
|
fa40ecfec1 | ||
|
|
be27697628 | ||
|
|
86842904be | ||
|
|
2556aa7b2a | ||
|
|
9f7f4f5bb8 | ||
|
|
85f4e2b191 | ||
|
|
e945608fa4 | ||
|
|
d892bf5333 | ||
|
|
d3b271d04f | ||
|
|
498c4ce19d | ||
|
|
6f53bb90e4 | ||
|
|
e57d86daef | ||
|
|
b050f6e430 | ||
|
|
8caea61bd3 | ||
|
|
8b2dc6853a | ||
|
|
02a1624d22 | ||
|
|
c09cdb4a07 | ||
|
|
2e870b76c6 | ||
|
|
687e73c7af | ||
|
|
71be643056 | ||
|
|
e975382a82 | ||
|
|
35a8ad18a9 | ||
|
|
349a98d388 | ||
|
|
c65fd57a24 | ||
|
|
b459ec5cdb | ||
|
|
e187fad2d1 | ||
|
|
8182575647 | ||
|
|
f9938a3e9a | ||
|
|
ca50da933e | ||
|
|
f43b7faec5 | ||
|
|
ba533a91c4 | ||
|
|
ae171ce2d2 | ||
|
|
97662dc30e | ||
|
|
fc8b10cf71 | ||
|
|
a6901dc7ba | ||
|
|
7297a2b02e | ||
|
|
a4d484b478 | ||
|
|
d3399f8f25 | ||
|
|
5b1dd1818c | ||
|
|
04e9bdd516 | ||
|
|
f5c49771df | ||
|
|
7759a36327 | ||
|
|
fb51a889f4 | ||
|
|
facd6c20c8 | ||
|
|
5e0da82b7f | ||
|
|
9dbbc057c5 | ||
|
|
886184c38e | ||
|
|
3da82597bb | ||
|
|
c2de8f4282 | ||
|
|
0ea41bf2b1 | ||
|
|
7e3fa7bd59 | ||
|
|
cf9cec3562 | ||
|
|
e680c28694 | ||
|
|
8db0c60f58 | ||
|
|
fba6b0da53 | ||
|
|
916627208c | ||
|
|
8da6929e93 | ||
|
|
385db5abbd | ||
|
|
fd4d2df3e6 | ||
|
|
7076a84b83 | ||
|
|
957fcfac4b | ||
|
|
77ec263329 | ||
|
|
d496c5f4a5 | ||
|
|
372fe3128c | ||
|
|
ff8670e601 | ||
|
|
451deb0101 | ||
|
|
b278b99605 | ||
|
|
1d5ca2f45e | ||
|
|
fc0799f0ca | ||
|
|
3a43c4124f | ||
|
|
d197a131db | ||
|
|
7be9dcd263 | ||
|
|
117395ed23 | ||
|
|
7d40544703 | ||
|
|
064e743014 | ||
|
|
701da1fa4d | ||
|
|
224e070c74 | ||
|
|
c1dc317791 | ||
|
|
add133a4c6 | ||
|
|
383d813dd9 | ||
|
|
9a53d1b4fe | ||
|
|
2fe43e8af8 | ||
|
|
f55e1330d5 | ||
|
|
9e09a7c02b | ||
|
|
07b9f0c1d5 | ||
|
|
61fc0ba6b2 | ||
|
|
10bb058051 | ||
|
|
7ba06d0145 | ||
|
|
1b48b07ee4 | ||
|
|
e941298e55 | ||
|
|
be2763d13d | ||
|
|
ef440f1b4e | ||
|
|
d990e2881b | ||
|
|
0c4cf5aff2 | ||
|
|
38b3ef790b | ||
|
|
fd7bb0b3da | ||
|
|
2298aaef75 | ||
|
|
123a5c20d8 | ||
|
|
d60fc0981b | ||
|
|
70491a7ea0 | ||
|
|
0b49f0bea0 | ||
|
|
33108da1d0 | ||
|
|
1674a79e11 | ||
|
|
6f581e803c | ||
|
|
9c7d125108 | ||
|
|
5fc1090dbe | ||
|
|
2057041621 | ||
|
|
3cadadee34 | ||
|
|
660d1fe292 | ||
|
|
d3cc1a3186 | ||
|
|
274237f4d2 | ||
|
|
602241f936 | ||
|
|
7880b84ba7 | ||
|
|
e9c4ca1b61 | ||
|
|
c0bc7b6c80 | ||
|
|
0934f19c69 | ||
|
|
41441e017a | ||
|
|
1277a79544 | ||
|
|
ce527f42cd | ||
|
|
edb801394b | ||
|
|
c40e1cbbfc | ||
|
|
faff0dbd45 | ||
|
|
dff2f35098 | ||
|
|
261429dc52 | ||
|
|
2db6b7e8f1 | ||
|
|
9aa1cce146 | ||
|
|
8c766b9670 | ||
|
|
0777e6062c | ||
|
|
8d4a2eabb8 | ||
|
|
2a836845c8 | ||
|
|
5c4f19b7c5 | ||
|
|
63a8f46dda | ||
|
|
3d972fcc0e | ||
|
|
d69e7b6d04 | ||
|
|
f0623f78eb | ||
|
|
2891206718 | ||
|
|
c4ab6c2cad | ||
|
|
56b4205f38 | ||
|
|
35b40bdb2a | ||
|
|
63289837ae | ||
|
|
439596bce5 | ||
|
|
f725d7b180 | ||
|
|
933ef3298a | ||
|
|
16b3e1e406 | ||
|
|
d560e58711 | ||
|
|
29a8e606f3 | ||
|
|
b4f086b52a | ||
|
|
cf33623715 | ||
|
|
894e2f15f0 | ||
|
|
e7175cbecf | ||
|
|
241945e11f | ||
|
|
1aecd0f1ff | ||
|
|
9cb84b6351 | ||
|
|
cc68ee790e | ||
|
|
e786476701 | ||
|
|
a48ac52a7d | ||
|
|
9e33cdb499 | ||
|
|
5de9ca91cb | ||
|
|
f2d8bb4c38 | ||
|
|
bd719279db | ||
|
|
4f16113988 | ||
|
|
fb79cfb853 | ||
|
|
1a0e3b62e2 | ||
|
|
af30033599 | ||
|
|
b6c6a8db3a | ||
|
|
07b70c743c | ||
|
|
ca7ad2ff2c | ||
|
|
79e4f5a47f | ||
|
|
2be22abf64 | ||
|
|
2fafe59ed2 | ||
|
|
3687e5e953 | ||
|
|
4c1c759343 | ||
|
|
ef32b131ce | ||
|
|
792645aa6f | ||
|
|
8055bab946 | ||
|
|
19928d2509 | ||
|
|
c0f72d9fac | ||
|
|
77b6cdb7dd | ||
|
|
f71e66e50d | ||
|
|
71461f74b2 | ||
|
|
dfbeb6b786 | ||
|
|
3e1affd647 | ||
|
|
1ba9226cb5 | ||
|
|
7f2c03ed0e | ||
|
|
251b1ad96b | ||
|
|
c8e7bc0542 | ||
|
|
ab3957bda7 | ||
|
|
5320379dc0 | ||
|
|
f6b36353a6 | ||
|
|
e5523b4954 | ||
|
|
de9f401877 | ||
|
|
46fd530566 | ||
|
|
b6b4369972 | ||
|
|
3aeaad418f | ||
|
|
b2bedbf40e | ||
|
|
62ef1e2857 | ||
|
|
0d03073c89 | ||
|
|
1ebbe4d551 | ||
|
|
1d14341231 | ||
|
|
b4c03fb0a9 | ||
|
|
9eeb62c4a3 | ||
|
|
116f2fa00a | ||
|
|
d6fbae0c27 | ||
|
|
6c37499531 | ||
|
|
7a92fe4c4c | ||
|
|
986b654098 | ||
|
|
ef7c1af78d | ||
|
|
2a8c1bb255 | ||
|
|
ef2d599f45 | ||
|
|
627c9515b1 | ||
|
|
fc846109ba | ||
|
|
5775569f18 | ||
|
|
55b41157cf | ||
|
|
5ba98ed5d3 | ||
|
|
69e0f3bf48 | ||
|
|
97422095ed | ||
|
|
40acbc1ea5 | ||
|
|
94a9447396 | ||
|
|
8229beefa4 | ||
|
|
6a62b9d5b7 | ||
|
|
bf6c5ff7c1 | ||
|
|
e6177356ec | ||
|
|
53b384c01d | ||
|
|
b66f3b08bb | ||
|
|
92e30ad3df | ||
|
|
17e89935c4 | ||
|
|
04ced9d63d | ||
|
|
555173a263 | ||
|
|
54391bb2ca | ||
|
|
ea0f710586 | ||
|
|
5a2899b78e | ||
|
|
f26cc7bcd4 | ||
|
|
08bc2cde18 | ||
|
|
a5d361d9c4 | ||
|
|
96d4171df7 | ||
|
|
fd2aaa768a | ||
|
|
24f73838f2 | ||
|
|
2b97f7ce7b | ||
|
|
e7e577e05d | ||
|
|
52bdfd3dca | ||
|
|
0e29833fc7 | ||
|
|
92c07fbccc | ||
|
|
bc3d6e90fa | ||
|
|
056e268cb3 | ||
|
|
50eb9f576a | ||
|
|
0db5048d6a | ||
|
|
eed604dce5 | ||
|
|
97b55a966d | ||
|
|
8d5a034c9d | ||
|
|
de6e5e315d | ||
|
|
8a44b6f251 | ||
|
|
e6770d6361 | ||
|
|
e5d8e11306 | ||
|
|
821b603ec2 | ||
|
|
34363d77db | ||
|
|
7a8260d5e0 | ||
|
|
1f1d49bbd6 | ||
|
|
0e82616ea6 | ||
|
|
9a68a887f0 | ||
|
|
f2b405924d | ||
|
|
eee7417f1f | ||
|
|
db48c076a6 | ||
|
|
5a15aee0e0 | ||
|
|
d67afcc9c1 | ||
|
|
b09f475602 | ||
|
|
c4e6c0aa83 | ||
|
|
e459214613 | ||
|
|
3dbe3deb64 | ||
|
|
701c81c7d1 | ||
|
|
557fd9b7a3 | ||
|
|
ae3de7f0c0 | ||
|
|
43b0c8adea | ||
|
|
c70f036024 | ||
|
|
d74a72d580 | ||
|
|
40d758b019 | ||
|
|
b390e0ebf1 | ||
|
|
ab2ea18cb5 | ||
|
|
ea33b2824e | ||
|
|
140e562446 | ||
|
|
9209328fd3 | ||
|
|
35938e4d90 | ||
|
|
316d124ec4 | ||
|
|
b1f59b4703 | ||
|
|
08ce3d0ed5 | ||
|
|
e39472c606 | ||
|
|
3924c1eabf | ||
|
|
929ab8b529 | ||
|
|
da55120b84 | ||
|
|
b1c0e42d00 | ||
|
|
b694edc23d | ||
|
|
0fe951a702 |
No files matched your search
+14
-4
@@ -31,6 +31,11 @@ EXTENSION: aolserver
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: activescript
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: apache
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -45,6 +50,10 @@ EXTENSION: cgi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cli
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fhttpd
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
@@ -54,8 +63,9 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: nsapi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
PRIMARY MAINTAINER: Uwe Schindler <thetaphi@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: phttpd
|
||||
MAINTENANCE: Unknown
|
||||
@@ -126,7 +136,7 @@ STATUS: Experimental
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: interbase
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jouni.ahto@exdec.fi>
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jouni.ahto@exdec.fi>, Ard Biesheuvel <ard@ard.nu>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -330,7 +340,7 @@ MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcrypt
|
||||
PRIMARY MAINTAINER: Derick Rethans <d.rethans@jdimedia.nl>
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@derickrethans.nl>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
+13
-9
@@ -16,15 +16,15 @@ build-modules: $(PHP_MODULES)
|
||||
|
||||
libphp4.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
|
||||
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
|
||||
-@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
|
||||
|
||||
libs/libphp4.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
|
||||
$(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp4.so
|
||||
|
||||
install: $(install_targets)
|
||||
install: $(all_targets) $(install_targets)
|
||||
|
||||
install-sapi: libphp4.la
|
||||
@echo "Installing PHP SAPI module"
|
||||
-@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
|
||||
install-sapi: $(OVERALL_TARGET)
|
||||
@echo "Installing PHP SAPI module: $(PHP_SAPI)"
|
||||
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
|
||||
-@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
|
||||
for i in 0.0.0 0.0 0; do \
|
||||
@@ -50,11 +50,15 @@ install-tester:
|
||||
|
||||
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' -d 'output_buffering=0' $(top_srcdir)/run-tests.php $(TESTS)
|
||||
test:
|
||||
-@if test -x $(SAPI_CLI_PATH) && test ! -z $(SAPI_CLI_PATH); then \
|
||||
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' -d 'output_buffering=0' $(top_srcdir)/run-tests.php $(TESTS); \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
find . -name \*.lo | xargs rm -f
|
||||
|
||||
@@ -1,17 +1,121 @@
|
||||
PHP 4 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
19 Jun 2003, Version 4.3.3RC1
|
||||
- Synchronized bundled GD library with GD 2.0.15. (Ilia)
|
||||
?? ??? 2003, Version 4.3.5
|
||||
- Fixed header handler in NSAPI SAPI (header->replace was ignored,
|
||||
send_default_content_type now sends value from php.ini).
|
||||
(Uwe Schindler)
|
||||
- Fixed bug #26025 (Segfault on glob() without GLOB_NOCHECK or GLOB_NOMAGIC
|
||||
under *BSD platforms). (Moriyoshi)
|
||||
|
||||
3 Nov 2003, Version 4.3.4
|
||||
- Made MCVE extension available on win32. (Jani)
|
||||
- Added apache_get_version() function. (Ilia)
|
||||
- Fixed disk_total_space() and disk_free_space() under FreeBSD. (Jon Parise)
|
||||
- Fixed crash bug when non-existing save/serializer handler was used. (Jani)
|
||||
- Fixed memory leak in gethostbynamel() if an error occurs. (Sara)
|
||||
- Fixed FastCGI being unable to bind to a specific IP. (Sascha)
|
||||
- Fixed multibyte regex engine to properly handle ".*" pattern under
|
||||
POSIX compatible mode. (K.Kosako <kosako at sofnec.co.jp>, Moriyoshi)
|
||||
- Fixed bug #25955 (Compile failure on MacOSX 10.3 Panther). (Marko, Dan)
|
||||
- Fixed bug #25923 (mail() modifies the to & subject arguments). (Ilia)
|
||||
- Fixed bug #25922 (Crash in error handler when 5th argument is modified).
|
||||
(Ilia)
|
||||
- Fixed bug #25918 (Possible crash in mime_content_type()). (Ilia)
|
||||
- Fixed bug #25900 (document->get_elements_by_tag_name with default xmlns).
|
||||
(Rob)
|
||||
- Fixed bug #25895 (Incorrect detection of safe_mode limited ini options).
|
||||
(Ilia)
|
||||
- Fixed bug #25888 (Crash of php.exe when xpath_eval of a namespace). (Rob)
|
||||
- Fixed bug #25836 (last key of multi-dimensional array passed via GPC not
|
||||
being escaped when magic_quotes_gpc is on). (Ilia)
|
||||
- Fixed bug #25825 (tzset() was not called to reset libc environment on
|
||||
request shutdown). (Wez)
|
||||
- Fixed bug #25814 (Make flock() return correct value when 3rd argument is
|
||||
used). (Ilia)
|
||||
- Fixed bug #25800 (parse_url() could not parse urls with empty port). (Ilia)
|
||||
- Fixed bug #25780 (ext/session: invalid "session.cookie_lifetime" makes
|
||||
session_start() to crash in win32). (Jani)
|
||||
- Fixed bug #25777 (Do not rtrim() of text fields fetched from mssql). (Ilia)
|
||||
- Fixed bug #25770 (Segfault with PHP and bison 1.875).
|
||||
(eggert@gnu.org, Marcus)
|
||||
- Fixed bug #25764 (ldap_get_option() crashes with unbound ldap link). (Jani)
|
||||
- Fixed bug #25758 (var_export does not escape ' & \ inside array keys).
|
||||
(Ilia)
|
||||
- Fixed bug #25752 (ext/ncurses: ncurses.h instead of curses.h with BSD).
|
||||
(Jani)
|
||||
- Fixed bug #25746 (Do not bail out when unable to chdir original dir on
|
||||
systems with broken getcwd()). (Ilia)
|
||||
- Fixed bug #25745 (ctype functions fail with non-ascii characters).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #25744 (make ZTS build of ext/sybase compile). (Ilia)
|
||||
- Fixed bug #25738 (alloca() related issues on the Darwin platform).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #25708 (extract($GLOBALS, EXTR_REFS) mangles $GLOBALS).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #25707 (html_entity_decode() over-decodes &lt;). (Moriyoshi)
|
||||
- Fixed bug #25703 (openssl configure check failed). (Jani)
|
||||
- Fixed bug #25701 (On flush() set headers_sent in apache2handler). (Ilia)
|
||||
- Fixed bug #25671 (str_replace() corrupts subarrays). (Sara)
|
||||
- Fixed bug #25669 (eregi() with non-ascii characters). (Moriyoshi)
|
||||
- Fixed bug #25665 (var_dump() hangs on Nan and INF). (Ilia)
|
||||
- Fixed bug #25648 (xslt_set_encoding() not detected correctly). (Jani)
|
||||
- Fixed bug #25636 (SNMP Session not closed on success).
|
||||
(Ilia, patch by: nesslage at mwsc dot edu)
|
||||
- Fixed bug #25635 (Make "make tests" to fail due to invalid include_path).
|
||||
(Ilia)
|
||||
- Fixed bug #25604 (HAVE_SNMP_PARSE_OID undefined with phpize build). (Jani)
|
||||
- Fixed bug #25583 (Incorrect handling of paths starting with "/" on win32
|
||||
inside glob() function). (Ilia)
|
||||
- Fixed bug #25570 (Possible crash in apache2handler when zend_bailout called
|
||||
outside of zend_try {} block). (Ilia)
|
||||
- Fixed bug #25558 (ext/dbase: reverted fix for bug #23463). (Vlad)
|
||||
- Fixed bug #25530 (checkdate() incorrectly handles floats). (Ilia)
|
||||
- Fixed bug #25525 (ldap_explode_dn() crashes when passed invalid dn).
|
||||
(Sara, patch by: mikael dot suvi at trigger dot ee)
|
||||
- Fixed bug #25504 (pcre_match_all() crashes when passed only 2 parameters).
|
||||
(Jani)
|
||||
- Fixed bug #25483 (ext/informix: bogus -469 error from ifx_query()).
|
||||
(Jani, patch by: denisov at kubsu dot ru)
|
||||
- Fixed bug #25463 (ext/cpdf: compile failure with bundled GD)
|
||||
- Fixed bug #25429 (fix copying of stdin using copy() function). (Ilia)
|
||||
- Fixed bug #25424 (ext/informix: lvarchar not supported in win32). (Jani)
|
||||
- Fixed bug #25404 (ext/pgsql: open transactions not closed when script ends).
|
||||
(Marcus)
|
||||
- Fixed bug #25385 (ob_gzhandler(): typo in sapi_add_header_ex() call). (Jani)
|
||||
- Fixed bug #25378 (unserialize() crashes with invalid data). (Jani)
|
||||
- Fixed bug #25372 (sscanf() does not work with %X). (Jani)
|
||||
- Fixed bug #25348 ("make install" fails with --enable-short-tags). (Jani)
|
||||
- Fixed bug #25343 (is_dir() gives warning on FreeBSD). (Jani)
|
||||
- Fixed bug #25333 (Possible body corruption & crash in win32 mail()). (Ilia)
|
||||
- Fixed bug #25316 (Possible infinite loop inside _php_stream_write()). (Ilia)
|
||||
- Fixed bug #25314 (FTP_ASCII mode behaving like binary from Win->Unix).
|
||||
(Sara)
|
||||
- Fixed bug #25308 (php -m crashes when zend extensions are loaded). (Stas)
|
||||
- Fixed bug #25307 (Crash with WDDX serializer). (Sascha, Jani)
|
||||
- Fixed bug #25295 (QNX6: php_ini.c:414: 'alphasort' undeclared). (Jani)
|
||||
- Fixed bug #25294 (ext/ftp: NLST failure leads to crash on exit). (Sara, Rob)
|
||||
- Fixed bug #25293 (Output correct EOL to error_log). (Ilia)
|
||||
- Fixed bug #25239 (ftp_fopen_wrapper not RFC compliant). (Sara)
|
||||
- Fixed bug #25218 ("deflate" compressed pages had a gzip header). (Stefan)
|
||||
- Fixed bug #25211 (image.c compile failure with AIX). (Marcus)
|
||||
- Fixed bug #25166 (WDDX serializer handler missing in win32). (Jani)
|
||||
- Fixed bug #25109 (Possible crash when fetching field names in pgsql). (Ilia)
|
||||
- Fixed bug #25106 (Added more stringent checks on bzopen() mode). (Ilia)
|
||||
- Fixed bug #25070 (unlock session files on win32 before closing them). (Ilia)
|
||||
- Fixed bug #24402 (Compile failure with gettext 0.12.x). (Jani)
|
||||
- Fixed bug #23488 (zlib.output_compression overrides Vary header). (Stefan)
|
||||
- Fixed bug #23326 (ext/domxml: Attributes via append_child not supported).
|
||||
(Melvyn)
|
||||
- Fixed bug #21220 (Wrong Apache version shown in phpinfo() output). (Jani)
|
||||
- Fixed bug #18534 (ifx_close() leaves open session). (nobbie@php.net)
|
||||
- Fixed bug #14049 (realpath() returns invalid results for non-existent
|
||||
paths). (Ilia)
|
||||
|
||||
25 Aug 2003, Version 4.3.3
|
||||
- Upgraded the bundled Expat library to version 1.95.6. (Jani)
|
||||
- Upgraded the bundled PCRE library to version 4.3. (Andrei)
|
||||
- Upgraded the bundled GD library to version GD 2.0.15. (Ilia)
|
||||
- Improved the engine to use POSIX/socket IO where feasible. (Sascha)
|
||||
- Improved the NSAPI SAPI module (Uwe Schindler)
|
||||
. php4_init (magnus.conf): new parameter to set alternate path to php.ini.
|
||||
(php_ini="/path/to/php.ini")
|
||||
. php4_execute (obj.conf): support for additional php.ini values.
|
||||
Allows different settings per virtual server.
|
||||
(See sapi/nsapi/nsapi-readme.txt for more information)
|
||||
. Added support for virtual()
|
||||
. Added "nsapi.read_timeout" php.ini option.
|
||||
. Synced $_SERVER variables to be similar to Apache variables
|
||||
- Improved the IMAP extension (Ilia)
|
||||
. Added imap_timeout() function. (bug #24161)
|
||||
. Added optional 'charset' parameter to imap_search() and imap_sort().
|
||||
@@ -20,31 +124,120 @@ PHP 4 NEWS
|
||||
. Added transaction constants: IBASE_REC_VERSION, IBASE_REC_NO_VERSION,
|
||||
IBASE_WRITE, IBASE_WAIT and IBASE_CONCURRENCY. (bugs #8797, #23887)
|
||||
. Made numeric/decimal datatype handling work on any platform.
|
||||
- Improved the NSAPI SAPI module (Uwe Schindler)
|
||||
. Added possibility to use PHP to generate HTTP error pages (404 Not Found..)
|
||||
. Added possibility to use PHP to generate directory listings for directories
|
||||
without index.html
|
||||
. php4_init (magnus.conf): new parameter to set alternate path to php.ini.
|
||||
(php_ini="/path/to/php.ini")
|
||||
. php4_execute (obj.conf): support for additional php.ini values.
|
||||
Allows different settings per virtual server.
|
||||
(See sapi/nsapi/nsapi-readme.txt for more information)
|
||||
. Added support for virtual().
|
||||
. Added nsapi_request_headers() and nsapi_response_headers() with aliases
|
||||
for apache compatibility.
|
||||
. Added "nsapi.read_timeout" php.ini option.
|
||||
. Synced $_SERVER variables to be similar to Apache variables.
|
||||
- Added DBA handler 'inifile' to support ini files. (Marcus)
|
||||
- Added a "DEBUG" note to 'php -v' output when --enable-debug is used. (Derick)
|
||||
- Added long options into CLI & CGI (e.g. --version). (Marcus)
|
||||
- Added a new parameter to preg_match*() that can be used to specify
|
||||
the starting offset in the subject string to match from. (Andrei)
|
||||
- Fixed possible integer overflows in:
|
||||
. base64_encode(). (Moriyoshi)
|
||||
. bundled GD library. (Ilia)
|
||||
- Fixed "mysql.connect_timeout" php.ini option to be settable with ini_set().
|
||||
(Rasmus)
|
||||
- Fixed FastCGI IIS document root problem. (Shane)
|
||||
- Fixed corruption of multibyte character including 0x5c as second
|
||||
byte in multipart/form-data. (Rui)
|
||||
- Fixed possible crash in imagerotate() when an invalid color index
|
||||
is used for background color. (Pierre-Alain Joye)
|
||||
- Fixed a bug that under certain circumstances could invalidate safe_mode.
|
||||
(Ilia)
|
||||
- Fixed certificate version and allowed setting of the serial number in
|
||||
openssl_csr_sign(). (Stefan Roehrich)
|
||||
- Fixed each() to be binary safe for keys. (Zeev)
|
||||
- Fixed ext/yaz to not log if "yaz.log_file" php.ini option is not set. (Adam)
|
||||
- Fixed a bug in bundled libmysql (mysql bug #564). (Georg)
|
||||
- Fixed ext/exif to honor "magic_quotes_runtime" php.ini option. (Marcus)
|
||||
- Fixed bug #25093 (ext/pgsql: Various leaks due to non-freed queries). (Ilia)
|
||||
- Fixed bug #25084 (ext/session: Fixed session.referer_check to be independent
|
||||
on register_globals). (Ilia)
|
||||
- Fixed bug #25081 (odbc_fetch_array() may mangle numeric fields). (Ilia)
|
||||
- Fixed bug #25044 (header("Location:") changing HTTP status). (Marcus)
|
||||
- Fixed bug #25037 (win32 mail(): Possible infinite loop inside SendText()).
|
||||
(Ilia)
|
||||
- Fixed bug #25007 (rand() & mt_rand() seed RNG every call). (Jani)
|
||||
- Fixed bug #24989 (external libexpat conflicts with bundled libexpat). (Jani)
|
||||
- Fixed bug #24980 (array_reduce() uses first element as default running
|
||||
total). (Ilia)
|
||||
- Fixed bug #24977 (Reverted mysql_select_db() optimization). (Ilia)
|
||||
- Fixed bug #24958 (Apache2 SAPIs: Incorrect handling of 404s). (Ilia, Justin)
|
||||
- Fixed bug #24951 (ob_flush() needlessly destroys output handler). (Ilia)
|
||||
- Fixed bug #24936 (ext/fdf not linked properly as shared extension). (Jani)
|
||||
- Fixed bug #24909 (Bad random numbers with ZTS builds on Solaris). (Ilia)
|
||||
- Fixed bug #24897 (inconsistent behavior of shuffle() & array_multisort()).
|
||||
(Ilia, Jani)
|
||||
- Fixed bug #24883 ("variables_order" and "gpc_order" being ignored). (Ilia)
|
||||
- Fixed bug #24873 (incorrect handling of / inside open_basedir). (Ilia)
|
||||
- Fixed bug #24871 (aggregate(): methods misidentified as constructors). (Ilia)
|
||||
- Fixed bug #24827 (ob_gzhandler overrides Vary header). (Ilia)
|
||||
- Fixed bug #24792 (--enable-zend-multibyte causes random segfaults with ZTS).
|
||||
(Fujimoto)
|
||||
- Fixed bug #24783 (foreach($ar as $key => $val), $key not binary safe). (Zeev)
|
||||
- Fixed bug #24760 (non-default SNMP port number not working). (Jani)
|
||||
- Fixed bug #24752 (Unhandled "uniqueidentifier" field type).
|
||||
(Ilia, s.sonnenberg[at]coolspot.de)
|
||||
- Fixed bug #24710 (Crash when $obj->{0} is used). (Zeev)
|
||||
- Fixed bug #24663 (\n. sequences were not being escaped). (Ilia)
|
||||
- Fixed bug #24640 (var_export() and var_dump() can not output large floats).
|
||||
(Marcus)
|
||||
- Fixed bug #24629 (FreeBSD select() does not like large microseconds values).
|
||||
(Mirco Bauer).
|
||||
- Fixed bug #24609 (ext/domxml: segfault when using replace node across
|
||||
different docs). (Rob Richards)
|
||||
- Fixed bug #24594 (Rewrite of the imagefill() function). (Pierre-Alain Joye)
|
||||
- Fixed bug #24592 (NULL related crash in session extension). (Sascha)
|
||||
- Fixed bug #24573 (debug_backtrace() crashes if $this set to null). (Jani)
|
||||
- Fixed bug #24560 (parse_url() incorrectly handling certain file:// based
|
||||
schemas). (Ilia)
|
||||
- Fixed bug #24557 (make fclose() respect refcount on the resource).
|
||||
(Wez, Ilia)
|
||||
- Fixed bug #24537 (apache2 compile misses some include directories). (Jani)
|
||||
- Fixed bug #24535 (ext/mysql: crash when retrieving data from unbuffered
|
||||
result after the original connection has been changed). (Ilia)
|
||||
- Fixed bug #24519 (aggregate_methods_by_list() does not increment refcount).
|
||||
- Fixed bug #24313 (file_exists() warning on non-existent files when
|
||||
open_basedir is used). (Ilia)
|
||||
- Fixed bug #24312 (base64_decode() does not skip 0xF0-0xFF characters).
|
||||
(gereon.steffens[at]onvista.de, Ilia)
|
||||
- Fixed bug #24284 (Fixed memory leak inside pg_ping()). (Ilia)
|
||||
- Fixed bug #24249 (fdf_add_doc_javascript() not available on Windows). (Edin)
|
||||
- Fixed bug #24224 (ibase_blob_get() overflow). (Ard)
|
||||
- Fixed bug #24223 (missing variable initialization in bundled gd). (Ilia)
|
||||
- Fixed bug #24220 (range() didn't handle numeric strings correctly). (Ilia)
|
||||
- Fixed bug #24210 (not detecting assume_default_colors - typo). (Sara)
|
||||
- Fixed bug #24198 (Invalid recursion detection in array_merge_recurcive()).
|
||||
(Ilia)
|
||||
- Fixed bug #24177 (Apache2 SAPIs: status set incorrectly after flush()).
|
||||
(Ilia)
|
||||
- Fixed bug #24155 (gdImageRotate270 incorrectly use x parameter for y axis).
|
||||
(tom@gksystems.com, Ilia)
|
||||
- Fixed bug #24150 (crash in imap_fetch_overview() &
|
||||
- Fixed bug #24150 (crash in imap_fetch_overview() &
|
||||
imap_rfc822_write_address()). (Ilia)
|
||||
- Fixed bug #24142 (workaround for a gcc bug affecting round()). (Marcus, Ilia)
|
||||
- Fixed bug #24063 (serialize() missing 0 after the . on scientific notation).
|
||||
(Marcus, Ilia)
|
||||
- Fixed bug #24063 (scientific notation broken in *printf()). (Ilia)
|
||||
- Fixed bug #24060 (ncurses_del_panel() causes segfault). (Georg)
|
||||
- Fixed bug #24054 (Integer overflow failure with GCC/x86 for *=). (Sascha)
|
||||
- Fixed bug #24028 (Reading raw post message by php://input failed). (Jani)
|
||||
- Fixed bug #24009 (FastCGI handling of file not found). (Shane)
|
||||
- Fixed bug #24007 (Problem with register_globals & arrays). (Ilia)
|
||||
- Fixed bug #23951 (constants in static initializers clobbered by inheritance).
|
||||
(Wez, Zend Engine)
|
||||
- Fixed bug #23936 (ext/interbase: fail to select and fetch). (Ard)
|
||||
- Fixed bug #23913 (make rename() work across partitions on *nix). (Ilia)
|
||||
- Fixed bug #23912 (Invalid CSS in phpinfo() output). (Ilia)
|
||||
- Fixed bug #23902 (NULL in CGI header output). (Shane)
|
||||
@@ -53,15 +246,50 @@ PHP 4 NEWS
|
||||
- Fixed bug #23897 (Fixed a check for mbfilter_ru.h). (aleks@m2media.ru, Ilia)
|
||||
- Fixed bug #23894 (sprintf() decimal specifiers problem). (Moriyoshi)
|
||||
- Fixed bug #23888 (Missing input validation for flags parameter). (Ilia)
|
||||
- Fixed bug #23808 (broken imagecopymerge()). (Pierre-Alain Joye)
|
||||
- Fixed bug #23798 (Spaces were not being stripped from Bcc header). (Ilia)
|
||||
- Fixed bug #23792 (imagerotate() problems with limited platte, the function
|
||||
will always return true color image from now on). (Pierre-Alain Joye)
|
||||
- Fixed bug #23779 (mysql_connect(): disable local infile option if php.ini
|
||||
option "open_basedir" is set). (Georg)
|
||||
- Fixed bug #23769 (In FreeBSD glob() gives wrong result when pattern not
|
||||
found). (Hartmut)
|
||||
- Fixed bug #23733 (Coredump on startup with Oracle 9+). (Edin)
|
||||
- Fixed bug #23685 (fake values returned when OID value is an empty string).
|
||||
(Jani)
|
||||
- Fixed bug #23664 (FastCGI socket listenting). (Shane)
|
||||
- Fixed bug #23509 (exit code lost when exit() called from
|
||||
register_shutdown_function()). (Ilia)
|
||||
- Fixed bug #23463 (ext/dbase: added Dbase2 version check). (Vlad Krupin)
|
||||
- Fixed bug #23285 (Potential Stack overflow in zendlex). (Wez)
|
||||
- Fixed bug #23104 (hash position of static arrays not being reset). (Ilia)
|
||||
- Fixed bug #23038, #23574 (aggregate() related leaks and crashes). (Andrei)
|
||||
- Fixed bug #22947 (Ack() inside win32/sendmail.c may stall in certain
|
||||
situations). (Ilia)
|
||||
- Fixed bug #22690 (ob_start() did not work with create_function() callbacks).
|
||||
(Marcus)
|
||||
- Fixed bug #22592 (Cascading assignments to strings with curly braces broken).
|
||||
(Stas)
|
||||
- Fixed bug #22245 (References inside $_SESSION not being handled). (Ilia)
|
||||
- Fixed bug #22154 (Possible crash when memory_limit is reached and output
|
||||
buffering in addition to session.use_trans_sid is used). (Ilia)
|
||||
- Fixed bug #22072 (Apache2 sapis do not detect aborted connections). (Ilia)
|
||||
- Fixed bug #21958 (workaround for unusual realpath() on AIX & Tru64). (Ilia)
|
||||
- Fixed bug #21957 (serialize() mangles objects with __sleep). (Ilia)
|
||||
- Fixed bug #21918 (strange behaviour of mixed type in array-keys). (Marcus)
|
||||
- Fixed bug #21855 (Threading issue on HP-UX). (Roshan Naik, Andi, Moriyoshi)
|
||||
- Fixed bug #21611 (version_compare() does not support "p" as suffix).
|
||||
(Stefan Walk)
|
||||
- Fixed bug #21074 (Apache2: "ErrorDocument xxx /error.php" broken). (Jani)
|
||||
- Fixed bug #20896 (-s -w modes with php-cli cause php to hang). (Ilia)
|
||||
- Fixed bug #19613 (putenv("VAR=") does not empty VAR on win32). (Zeev)
|
||||
- Fixed bug #18744 (ibase_blob_add() has max limit of 64k). (Ard)
|
||||
- Fixed bug #18291 (escapeshellcmd() can now handle quoted arguments). (Ilia)
|
||||
- Fixed bug #17414 (pthreads bug workaround). (timo.teras[at]iki.fi)
|
||||
- Fixed bug #13142 (strtotime not handling "M d H:i:s Y" format). (Ilia)
|
||||
- Fixed bug #11924 (ibase_query(), ibase_execute() mangled passed parameters).
|
||||
(Jani)
|
||||
- Fixed bug #7014 (crash in _php_ibase_error() after request shutdown). (Ard)
|
||||
|
||||
29 May 2003, Version 4.3.2
|
||||
- Syncronized bundled GD library with GD 2.0.12. (Ilia)
|
||||
|
||||
@@ -37,7 +37,7 @@ Note though that you might get little response, if your patch is
|
||||
too hard to review.
|
||||
|
||||
If you would like change/add many lines, it is better to ask module
|
||||
maintainer and/or php-dev@lists.php.net, or pear-dev@lists.php.net if
|
||||
maintainer and/or internals@lists.php.net, or pear-dev@lists.php.net if
|
||||
you are patching PEAR. Official module maintainers can be found in
|
||||
EXTENSIONS file in PHP source.
|
||||
|
||||
@@ -79,7 +79,7 @@ Check list for submitting patch
|
||||
|
||||
Where to send your patch?
|
||||
-------------------------
|
||||
If you are patching C source, send the patch to php-dev@lists.php.net.
|
||||
If you are patching C source, send the patch to internals@lists.php.net.
|
||||
If you are patching a module, you should also send the patch to the
|
||||
maintainer. Official module maintainers are listed in EXTENSION file
|
||||
in source.
|
||||
|
||||
@@ -181,6 +181,7 @@ TSRM_API void tsrm_shutdown(void)
|
||||
#if defined(GNUPTH)
|
||||
pth_kill();
|
||||
#elif defined(PTHREADS)
|
||||
pthread_setspecific(tls_key, 0);
|
||||
pthread_key_delete(tls_key);
|
||||
#elif defined(TSRM_WIN32)
|
||||
TlsFree(tls_key);
|
||||
|
||||
+3
-2
@@ -95,14 +95,15 @@ dnl For the thread implementations, we always use --with-*
|
||||
dnl to maintain consistency
|
||||
|
||||
AC_ARG_WITH(tsrm-pth,
|
||||
[ --with-tsrm-pth[=pth-config] Use GNU Pth.],[
|
||||
[ --with-tsrm-pth[=pth-config]
|
||||
Use GNU Pth.],[
|
||||
TSRM_PTH=$withval
|
||||
],[
|
||||
TSRM_PTH=no
|
||||
])
|
||||
|
||||
AC_ARG_WITH(tsrm-st,
|
||||
[ --with-tsrm-st],[
|
||||
[ --with-tsrm-st Use SGI's State Threads],[
|
||||
TSRM_ST=$withval
|
||||
],[
|
||||
TSRM_ST=no
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#define HAVE_UTIME 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_REALPATH 1
|
||||
|
||||
#include <malloc.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef __GNUC__
|
||||
# ifndef HAVE_ALLOCA_H
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
#pragma alloca
|
||||
# else
|
||||
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
||||
char *alloca ();
|
||||
|
||||
@@ -486,19 +486,23 @@ CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path
|
||||
CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
char *retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
retval = virtual_file_ex(&new_state, path, NULL, 1);
|
||||
|
||||
if (!retval) {
|
||||
if (virtual_file_ex(&new_state, path, NULL, 1)==0) {
|
||||
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
|
||||
|
||||
memcpy(real_path, new_state.cwd, len);
|
||||
real_path[len] = '\0';
|
||||
return real_path;
|
||||
retval = real_path;
|
||||
} else {
|
||||
retval = NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
CWD_STATE_FREE(&new_state);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC)
|
||||
|
||||
+29
-2
@@ -41,6 +41,10 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__osf__) || defined(_AIX)
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
#include "readdir.h"
|
||||
#include <sys/utime.h>
|
||||
@@ -57,10 +61,10 @@ typedef unsigned short mode_t;
|
||||
* to account for volume name that is unique to NetWare absolute paths
|
||||
*/
|
||||
#define COPY_WHEN_ABSOLUTE(path) 2
|
||||
#define IS_ABSOLUTE_PATH(path, len) \
|
||||
(len >= 2 && ((isalpha(path[0]) && path[1] == ':') || (IS_SLASH(path[0]) && IS_SLASH(path[1]))))
|
||||
#define IS_UNC_PATH(path, len) \
|
||||
(len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))
|
||||
#define IS_ABSOLUTE_PATH(path, len) \
|
||||
(len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len)))
|
||||
|
||||
#elif defined(NETWARE)
|
||||
#ifdef HAVE_DIRENT_H
|
||||
@@ -155,6 +159,25 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC);
|
||||
CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC);
|
||||
#endif
|
||||
|
||||
/* On AIX & Tru64 when a file does not exist realpath() returns
|
||||
* NULL, and sets errno to ENOENT. Unlike in other libc implementations
|
||||
* the destination is not filled and remains undefined. Therefor, we
|
||||
* must populate it manually using strcpy as done on systems with no
|
||||
* realpath() function.
|
||||
*/
|
||||
#if defined(__osf__) || defined(_AIX)
|
||||
static char *php_realpath_hack(char *src, char *dest)
|
||||
{
|
||||
char *ret;
|
||||
|
||||
if ((ret = realpath(src, dest)) == NULL && errno == ENOENT) {
|
||||
return strcpy(dest, src);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAVE_UTIME
|
||||
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC);
|
||||
#endif
|
||||
@@ -232,7 +255,11 @@ typedef struct _virtual_cwd_globals {
|
||||
#define VCWD_ACCESS(pathname, mode) access(pathname, mode)
|
||||
|
||||
#ifdef HAVE_REALPATH
|
||||
#if defined(__osf__) || defined(_AIX)
|
||||
#define VCWD_REALPATH(path, real_path) php_realpath_hack(path, real_path)
|
||||
#else
|
||||
#define VCWD_REALPATH(path, real_path) realpath(path, real_path)
|
||||
#endif
|
||||
#else
|
||||
#define VCWD_REALPATH(path, real_path) strcpy(real_path, path)
|
||||
#endif
|
||||
|
||||
@@ -359,4 +359,13 @@ TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
TSRM_API char *realpath(char *orig_path, char *buffer)
|
||||
{
|
||||
int ret = GetFullPathName(orig_path, _MAX_PATH, buffer, NULL);
|
||||
if(!ret || ret > _MAX_PATH) {
|
||||
return NULL;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
#endif
|
||||
@@ -101,4 +101,5 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags);
|
||||
TSRM_API int shmdt(const void *shmaddr);
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf);
|
||||
|
||||
TSRM_API char *realpath(char *orig_path, char *buffer);
|
||||
#endif
|
||||
+151
-97
@@ -16,6 +16,9 @@ AC_DEFUN([PHP_ADD_MAKEFILE_FRAGMENT],[
|
||||
sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_PROG_RE2C,[
|
||||
AC_CHECK_PROG(RE2C, re2c, re2c, [exit 0;])
|
||||
])
|
||||
|
||||
dnl PHP_DEFINE(WHAT[, value])
|
||||
dnl
|
||||
@@ -177,73 +180,13 @@ AC_DEFUN([PHP_REMOVE_USR_LIB],[
|
||||
unset ac_new_flags
|
||||
for i in [$]$1; do
|
||||
case [$]i in
|
||||
-L/usr/lib|-L/usr/lib/) ;;
|
||||
*) ac_new_flags="[$]ac_new_flags [$]i" ;;
|
||||
-L/usr/lib|-L/usr/lib/[)] ;;
|
||||
*[)] ac_new_flags="[$]ac_new_flags [$]i" ;;
|
||||
esac
|
||||
done
|
||||
$1=[$]ac_new_flags
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
if test "$PHP_OPENSSL" = "yes"; then
|
||||
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
|
||||
fi
|
||||
|
||||
for i in $PHP_OPENSSL; do
|
||||
if test -r $i/include/openssl/evp.h; then
|
||||
OPENSSL_INCDIR=$i/include
|
||||
fi
|
||||
if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
|
||||
OPENSSL_LIBDIR=$i/lib
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$OPENSSL_INCDIR"; then
|
||||
AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
|
||||
fi
|
||||
|
||||
if test -z "$OPENSSL_LIBDIR"; then
|
||||
AC_MSG_ERROR([Cannot find OpenSSL's libraries])
|
||||
fi
|
||||
|
||||
old_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS=-I$OPENSSL_INCDIR
|
||||
AC_MSG_CHECKING([for OpenSSL version])
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include <openssl/opensslv.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
|
||||
yes
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT([>= 0.9.6])
|
||||
],[
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
|
||||
PHP_ADD_INCLUDE($OPENSSL_INCDIR)
|
||||
PHP_ADD_LIBPATH($OPENSSL_LIBDIR)
|
||||
|
||||
PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
|
||||
PHP_ADD_LIBRARY(crypto)
|
||||
],[
|
||||
AC_MSG_ERROR([libcrypto not found!])
|
||||
],[
|
||||
-L$OPENSSL_LIBDIR
|
||||
])
|
||||
|
||||
PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
|
||||
PHP_ADD_LIBRARY(ssl)
|
||||
],[
|
||||
AC_MSG_ERROR([libssl not found!])
|
||||
],[
|
||||
-L$OPENSSL_LIBDIR
|
||||
])
|
||||
|
||||
OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR
|
||||
AC_SUBST(OPENSSL_INCDIR_OPT)
|
||||
])
|
||||
|
||||
dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD)
|
||||
dnl
|
||||
dnl Use this macro, if you need to add libraries and or library search
|
||||
@@ -253,11 +196,11 @@ dnl
|
||||
AC_DEFUN([PHP_EVAL_LIBLINE],[
|
||||
for ac_i in $1; do
|
||||
case $ac_i in
|
||||
-l*)
|
||||
-l*[)]
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
PHP_ADD_LIBRARY($ac_ii,1,$2)
|
||||
;;
|
||||
-L*)
|
||||
-L*[)]
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
PHP_ADD_LIBPATH($ac_ii,$2)
|
||||
;;
|
||||
@@ -273,7 +216,7 @@ dnl
|
||||
AC_DEFUN([PHP_EVAL_INCLINE],[
|
||||
for ac_i in $1; do
|
||||
case $ac_i in
|
||||
-I*)
|
||||
-I*[)]
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
PHP_ADD_INCLUDE($ac_ii)
|
||||
;;
|
||||
@@ -337,10 +280,10 @@ AC_DEFUN([PHP_SHLIB_SUFFIX_NAME],[
|
||||
PHP_SUBST(SHLIB_SUFFIX_NAME)
|
||||
SHLIB_SUFFIX_NAME=so
|
||||
case $host_alias in
|
||||
*hpux*)
|
||||
*hpux*[)]
|
||||
SHLIB_SUFFIX_NAME=sl
|
||||
;;
|
||||
*darwin*)
|
||||
*darwin*[)]
|
||||
SHLIB_SUFFIX_NAME=dylib
|
||||
;;
|
||||
esac
|
||||
@@ -511,17 +454,17 @@ AC_DEFUN([PHP_ARG_ANALYZE_EX],[
|
||||
ext_output="yes, shared"
|
||||
ext_shared=yes
|
||||
case [$]$1 in
|
||||
shared,*)
|
||||
shared,*[)]
|
||||
$1=`echo "[$]$1"|sed 's/^shared,//'`
|
||||
;;
|
||||
shared)
|
||||
shared[)]
|
||||
$1=yes
|
||||
;;
|
||||
no)
|
||||
no[)]
|
||||
ext_output=no
|
||||
ext_shared=no
|
||||
;;
|
||||
*)
|
||||
*[)]
|
||||
ext_output=yes
|
||||
ext_shared=no
|
||||
;;
|
||||
@@ -654,8 +597,8 @@ main() {
|
||||
])
|
||||
])
|
||||
case $ac_cv_time_r_type in
|
||||
hpux) AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;;
|
||||
irix) AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;;
|
||||
hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;;
|
||||
irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;;
|
||||
esac
|
||||
])
|
||||
|
||||
@@ -1124,6 +1067,7 @@ AC_DEFUN([PHP_CHECK_CC_OPTION],[
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
rm -rf conftest*
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_REGEX],[
|
||||
@@ -1186,7 +1130,9 @@ main() {
|
||||
int res = 0;
|
||||
res = res || (snprintf(buf, 2, "marcus") != 6);
|
||||
res = res || (buf[1] != '\0');
|
||||
res = res || (snprintf(buf, 0, "boerger") != 7);
|
||||
/* Implementations may consider this as an encoding error */
|
||||
snprintf(buf, 0, "boerger");
|
||||
/* However, they MUST ignore the pointer */
|
||||
res = res || (buf[0] != 'm');
|
||||
res = res || (snprintf(NULL, 0, "boerger") != 7);
|
||||
res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8);
|
||||
@@ -1207,7 +1153,7 @@ main() {
|
||||
fi
|
||||
])
|
||||
|
||||
dnl PHP_SHARED_MODULE(module-name, object-var, build-dir)
|
||||
dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx)
|
||||
dnl
|
||||
dnl Basically sets up the link-stage for building module-name
|
||||
dnl from object_var in build-dir.
|
||||
@@ -1219,8 +1165,8 @@ AC_DEFUN([PHP_SHARED_MODULE],[
|
||||
\$(phplibdir)/$1.la: $3/$1.la
|
||||
\$(LIBTOOL) --mode=install cp $3/$1.la \$(phplibdir)
|
||||
|
||||
$3/$1.la: \$($2) \$(translit($1,a-z-,A-Z_)_SHARED_DEPENDENCIES)
|
||||
\$(LIBTOOL) --mode=link \$(CC) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z-,A-Z_)_SHARED_LIBADD)
|
||||
$3/$1.la: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES)
|
||||
\$(LIBTOOL) --mode=link ifelse($4,,[\$(CC)],[\$(CXX)]) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
|
||||
|
||||
EOF
|
||||
])
|
||||
@@ -1236,10 +1182,10 @@ AC_DEFUN([PHP_SELECT_SAPI],[
|
||||
PHP_SAPI=$1
|
||||
|
||||
case "$2" in
|
||||
static) PHP_BUILD_STATIC;;
|
||||
shared) PHP_BUILD_SHARED;;
|
||||
bundle) PHP_BUILD_BUNDLE;;
|
||||
program) PHP_BUILD_PROGRAM($5);;
|
||||
static[)] PHP_BUILD_STATIC;;
|
||||
shared[)] PHP_BUILD_SHARED;;
|
||||
bundle[)] PHP_BUILD_BUNDLE;;
|
||||
program[)] PHP_BUILD_PROGRAM($5);;
|
||||
esac
|
||||
|
||||
ifelse($3,,,[PHP_ADD_SOURCES([sapi/$1],[$3],[$4],[sapi])])
|
||||
@@ -1247,7 +1193,7 @@ AC_DEFUN([PHP_SELECT_SAPI],[
|
||||
|
||||
dnl deprecated
|
||||
AC_DEFUN([PHP_EXTENSION],[
|
||||
sources=`$AWK -f $abs_srcdir/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in`
|
||||
sources=`$AWK -f $abs_srcdir/build/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in`
|
||||
|
||||
PHP_NEW_EXTENSION($1, $sources, $2, $3)
|
||||
|
||||
@@ -1265,7 +1211,7 @@ AC_DEFUN([PHP_GEN_BUILD_DIRS],[
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]])
|
||||
dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags[, cxx]]]])
|
||||
dnl
|
||||
dnl Includes an extension in the build.
|
||||
dnl
|
||||
@@ -1295,7 +1241,7 @@ dnl ---------------------------------------------- Static module
|
||||
if test "$3" = "shared" || test "$3" = "yes"; then
|
||||
dnl ---------------------------------------------- Shared module
|
||||
PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
|
||||
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir)
|
||||
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
|
||||
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module)
|
||||
fi
|
||||
fi
|
||||
@@ -1325,13 +1271,13 @@ AC_DEFUN([PHP_SOLARIS_PIC_WEIRDNESS],[
|
||||
if test -n "$EXT_SHARED"; then
|
||||
os=`uname -sr 2>/dev/null`
|
||||
case $os in
|
||||
"SunOS 5.6"|"SunOS 5.7")
|
||||
"SunOS 5.6"|"SunOS 5.7"[)]
|
||||
case $CC in
|
||||
gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";;
|
||||
*) CFLAGS="$CFLAGS -fpic";;
|
||||
*[)] CFLAGS="$CFLAGS -fpic";;
|
||||
esac
|
||||
AC_MSG_RESULT([yes]);;
|
||||
*)
|
||||
*[)]
|
||||
AC_MSG_RESULT([no]);;
|
||||
esac
|
||||
else
|
||||
@@ -1369,8 +1315,8 @@ AC_DEFUN([PHP_SYS_LFS],
|
||||
ac_shellvars='CPPFLAGS LDFLAGS LIBS'
|
||||
for ac_shellvar in $ac_shellvars; do
|
||||
case $ac_shellvar in
|
||||
CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
|
||||
*) ac_lfsvar=LFS_$ac_shellvar ;;
|
||||
CPPFLAGS[)] ac_lfsvar=LFS_CFLAGS ;;
|
||||
*[)] ac_lfsvar=LFS_$ac_shellvar ;;
|
||||
esac
|
||||
eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
|
||||
(getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
|
||||
@@ -1379,14 +1325,14 @@ AC_DEFUN([PHP_SYS_LFS],
|
||||
eval ac_test_$ac_shellvar=\$ac_getconf
|
||||
done
|
||||
case "$ac_result$ac_getconfs" in
|
||||
yes) ac_result=no ;;
|
||||
yes[)] ac_result=no ;;
|
||||
esac
|
||||
case "$ac_result$ac_set" in
|
||||
yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
|
||||
yes?*[)] ac_result="yes, but $ac_set is already set, so use its settings"
|
||||
esac
|
||||
AC_MSG_RESULT([$ac_result])
|
||||
case $ac_result in
|
||||
yes)
|
||||
yes[)]
|
||||
for ac_shellvar in $ac_shellvars; do
|
||||
eval $ac_shellvar=\$ac_test_$ac_shellvar
|
||||
done ;;
|
||||
@@ -1456,10 +1402,10 @@ AC_DEFUN([PHP_BROKEN_GETCWD],[
|
||||
AC_MSG_CHECKING([for broken getcwd])
|
||||
os=`uname -sr 2>/dev/null`
|
||||
case $os in
|
||||
SunOS*)
|
||||
SunOS*[)]
|
||||
AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd])
|
||||
AC_MSG_RESULT([yes]);;
|
||||
*)
|
||||
*[)]
|
||||
AC_MSG_RESULT([no]);;
|
||||
esac
|
||||
])
|
||||
@@ -1600,12 +1546,18 @@ dnl Wrapper for AC_CHECK_LIB
|
||||
dnl
|
||||
AC_DEFUN([PHP_CHECK_LIBRARY], [
|
||||
save_old_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$5 $LDFLAGS"
|
||||
ac_stuff="$5"
|
||||
|
||||
save_ext_shared=$ext_shared
|
||||
ext_shared=yes
|
||||
PHP_EVAL_LIBLINE([$]ac_stuff, LDFLAGS)
|
||||
AC_CHECK_LIB([$1],[$2],[
|
||||
LDFLAGS=$save_old_LDFLAGS
|
||||
ext_shared=$save_ext_shared
|
||||
$3
|
||||
],[
|
||||
LDFLAGS=$save_old_LDFLAGS
|
||||
ext_shared=$save_ext_shared
|
||||
unset ac_cv_func_$1
|
||||
$4
|
||||
])dnl
|
||||
@@ -1631,6 +1583,108 @@ AC_DEFUN([PHP_CHECK_FRAMEWORK], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_SETUP_OPENSSL(shared-add [, action-found [, action-not-found]])
|
||||
dnl
|
||||
dnl Common setup macro for openssl
|
||||
dnl
|
||||
AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
found_openssl=no
|
||||
unset OPENSSL_INCDIR
|
||||
unset OPENSSL_LIBDIR
|
||||
|
||||
dnl First try to find pkg-config
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
|
||||
dnl If pkg-config is found try using it
|
||||
if test "$PHP_OPENSSL" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
|
||||
if $PKG_CONFIG --atleast-version=0.9.6 openssl; then
|
||||
found_openssl=yes
|
||||
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
|
||||
OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
|
||||
OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
|
||||
else
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
fi
|
||||
|
||||
if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then
|
||||
PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($OPENSSL_INCS)
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
dnl If pkg-config fails for some reason, revert to the old method
|
||||
if test "$PHP_OPENSSL" = "yes"; then
|
||||
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
|
||||
fi
|
||||
|
||||
for i in $PHP_OPENSSL; do
|
||||
if test -r $i/include/openssl/evp.h; then
|
||||
OPENSSL_INCDIR=$i/include
|
||||
fi
|
||||
if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
|
||||
OPENSSL_LIBDIR=$i/lib
|
||||
fi
|
||||
test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
|
||||
done
|
||||
|
||||
if test -z "$OPENSSL_INCDIR"; then
|
||||
AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
|
||||
fi
|
||||
|
||||
if test -z "$OPENSSL_LIBDIR"; then
|
||||
AC_MSG_ERROR([Cannot find OpenSSL's libraries])
|
||||
fi
|
||||
|
||||
old_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS=-I$OPENSSL_INCDIR
|
||||
AC_MSG_CHECKING([for OpenSSL version])
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include <openssl/opensslv.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
|
||||
yes
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT([>= 0.9.6])
|
||||
],[
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
|
||||
PHP_ADD_INCLUDE($OPENSSL_INCDIR)
|
||||
PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
|
||||
|
||||
PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
|
||||
PHP_ADD_LIBRARY(crypto,,$1)
|
||||
],[
|
||||
AC_MSG_ERROR([libcrypto not found!])
|
||||
],[
|
||||
-L$OPENSSL_LIBDIR
|
||||
])
|
||||
|
||||
PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
|
||||
PHP_ADD_LIBRARY(ssl,,$1)
|
||||
found_openssl=yes
|
||||
],[
|
||||
AC_MSG_ERROR([libssl not found!])
|
||||
],[
|
||||
-L$OPENSSL_LIBDIR
|
||||
])
|
||||
fi
|
||||
|
||||
dnl For apache 1.3.x static build
|
||||
OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR
|
||||
AC_SUBST(OPENSSL_INCDIR_OPT)
|
||||
|
||||
if test "$found_openssl" = "yes"; then
|
||||
ifelse([$2],[],:,[$2])
|
||||
ifelse([$3],[],,[else $3])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]])
|
||||
dnl
|
||||
@@ -1765,12 +1819,12 @@ AC_DEFUN([PHP_CHECK_FUNC],[
|
||||
AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
|
||||
|
||||
case $found in
|
||||
yes)
|
||||
yes[)]
|
||||
PHP_DEF_HAVE($1)
|
||||
ac_cv_func_$1=yes
|
||||
;;
|
||||
ifelse($#,1,,[
|
||||
*) PHP_CHECK_FUNC_LIB($@) ;;
|
||||
*[)] PHP_CHECK_FUNC_LIB($@) ;;
|
||||
])
|
||||
esac
|
||||
])
|
||||
|
||||
+7
-2
@@ -52,8 +52,13 @@ $(TOUCH_FILES):
|
||||
touch $(TOUCH_FILES)
|
||||
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
aclocal 2>&1 | $(SUPPRESS_WARNINGS)
|
||||
|
||||
@echo rebuilding $@
|
||||
@libtoolize=`./build/shtool path glibtoolize libtoolize`; \
|
||||
$$libtoolize --copy --automake; \
|
||||
ltpath=`dirname $$libtoolize`; \
|
||||
ltfile=`cd $$ltpath/../share/aclocal; pwd`/libtool.m4; \
|
||||
cat acinclude.m4 $$ltfile > $@
|
||||
|
||||
configure: aclocal.m4 configure.in $(config_m4_files)
|
||||
@echo rebuilding $@
|
||||
@autoconf 2>&1 | $(SUPPRESS_WARNINGS)
|
||||
+15
-35
@@ -16,7 +16,7 @@
|
||||
# | Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id: buildcheck.sh,v 1.21.2.3 2003-05-19 13:14:06 sniper Exp $
|
||||
# $Id: buildcheck.sh,v 1.21.2.6 2003-09-28 13:37:59 tal Exp $
|
||||
#
|
||||
|
||||
echo "buildconf: checking installation..."
|
||||
@@ -24,7 +24,7 @@ echo "buildconf: checking installation..."
|
||||
stamp=$1
|
||||
|
||||
# autoconf 2.13 or newer
|
||||
ac_version=`autoconf --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
ac_version=`autoconf --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
if test -z "$ac_version"; then
|
||||
echo "buildconf: autoconf not found."
|
||||
echo " You need autoconf version 2.13 or newer installed"
|
||||
@@ -50,39 +50,17 @@ if test "$1" = "2" && test "$2" -ge "50"; then
|
||||
stamp=
|
||||
fi
|
||||
|
||||
|
||||
# automake 1.4 or newer
|
||||
am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
am_version_clean=`echo $am_version|sed -e 's/-p[0-9]*$//'`
|
||||
if test "$am_version" = ""; then
|
||||
echo "buildconf: automake not found."
|
||||
echo " You need automake version 1.4 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
fi
|
||||
IFS=.; set $am_version_clean; IFS=' '
|
||||
if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then
|
||||
echo "buildconf: automake version $am_version found."
|
||||
echo " You need automake version 1.4 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
else
|
||||
echo "buildconf: automake version $am_version (ok)"
|
||||
fi
|
||||
|
||||
# libtool 1.4.3 or newer
|
||||
# Prefer glibtool over libtool for Mac OS X compatibility
|
||||
libtool=`./build/shtool path glibtool 2> /dev/null`
|
||||
if test ! -r "$libtool"; then libtool=`./build/shtool path libtool`; fi
|
||||
lt_pversion=`$libtool --version 2>/dev/null|sed -n -e 's/^[^0-9]*//' -e 1's/[- ].*//p'`
|
||||
# libtoolize 1.4.3 or newer
|
||||
# Prefer glibtoolize over libtoolize for Mac OS X compatibility
|
||||
libtoolize=`./build/shtool path glibtoolize libtoolize 2> /dev/null`
|
||||
lt_pversion=`$libtoolize --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//'`
|
||||
if test "$lt_pversion" = ""; then
|
||||
echo "buildconf: libtool not found."
|
||||
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=' '
|
||||
IFS=.; set $lt_pversion; IFS=' '
|
||||
|
||||
if test "$3" = ""; then
|
||||
third=0
|
||||
@@ -100,12 +78,14 @@ echo " to build PHP from CVS."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
am_prefix=`./build/shtool path automake | sed -e 's#/[^/]*/[^/]*$##'`
|
||||
lt_prefix=`echo $libtool | sed -e 's#/[^/]*/[^/]*$##'`
|
||||
if test "$am_prefix" != "$lt_prefix"; then
|
||||
echo "WARNING: automake and libtool are installed in different"
|
||||
echo " directories. This may cause aclocal to fail."
|
||||
echo " continuing anyway"
|
||||
ltpath=`echo $libtoolize | sed -e 's#/[^/]*/[^/]*$##'`
|
||||
ltfile="$ltpath/share/aclocal/libtool.m4"
|
||||
if test -r "$ltfile"; then
|
||||
:
|
||||
else
|
||||
echo "buildconf: $ltfile does not exist."
|
||||
echo " Please reinstall libtool."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test -n "$stamp" && touch $stamp
|
||||
|
||||
File renamed without changes.
@@ -18,11 +18,6 @@ while test $# -gt 0; do
|
||||
automake_flags=--copy
|
||||
fi
|
||||
|
||||
if test "$1" = "--ZendEngine2"; then
|
||||
ZENDDIR=ZendEngine2
|
||||
echo "Using Zend Engine 2 code"
|
||||
fi
|
||||
|
||||
if test "$1" = "--force"; then
|
||||
devok=1
|
||||
echo "Forcing buildconf"
|
||||
@@ -38,6 +33,28 @@ if test "$dev" = "0" -a "$devok" = "0"; then
|
||||
fi
|
||||
|
||||
if test -z "$ZENDDIR"; then
|
||||
if grep "PHP_MAJOR_VERSION 5" main/php_version.h >/dev/null; then
|
||||
v=5
|
||||
else
|
||||
v=4
|
||||
fi
|
||||
|
||||
if test "$v" = "5"; then
|
||||
if test -r "Zend/OBJECTS2_HOWTO"; then
|
||||
:
|
||||
else
|
||||
mv Zend ZendEngine1 2>/dev/null
|
||||
mv ZendEngine2 Zend
|
||||
fi
|
||||
else
|
||||
if test -r "Zend/zend_execute_globals.h"; then
|
||||
:
|
||||
else
|
||||
mv Zend ZendEngine2 2>/dev/null
|
||||
mv ZendEngine1 Zend
|
||||
fi
|
||||
fi
|
||||
|
||||
ZENDDIR=Zend
|
||||
echo "using default Zend directory"
|
||||
fi
|
||||
|
||||
+94
-63
@@ -40,8 +40,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
MAJOR_VERSION=4
|
||||
MINOR_VERSION=3
|
||||
RELEASE_VERSION=3
|
||||
EXTRA_VERSION="RC1"
|
||||
RELEASE_VERSION=4
|
||||
EXTRA_VERSION="RC3"
|
||||
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
|
||||
|
||||
dnl Define where extension directories are located in the configure context
|
||||
@@ -127,6 +127,7 @@ dnl AC_PROG_CXXCPP
|
||||
dnl check for -R, etc. switch
|
||||
PHP_RUNPATH_SWITCH
|
||||
|
||||
PHP_PROG_RE2C
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_AWK
|
||||
@@ -136,8 +137,8 @@ if test "$YACC" != "bison -y"; then
|
||||
else
|
||||
AC_MSG_CHECKING([bison version])
|
||||
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}).)
|
||||
if test "${1}" -ne "1" -o "(" "${2}" != "28" -a "${2}" != "35" -a "${2}" != "75" -a "${2}" != "875" ")"; then
|
||||
AC_MSG_WARN(You will need bison 1.28, 1.35, 1.75 or 1.875 if you want to regenerate the Zend parser (found ${1}.${2}).)
|
||||
fi
|
||||
AC_MSG_RESULT(${1}.${2} (ok))
|
||||
fi
|
||||
@@ -188,6 +189,7 @@ case $host_alias in
|
||||
CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";;
|
||||
*darwin*|*rhapsody*)
|
||||
CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
|
||||
AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther])
|
||||
php_multiple_shlib_versions_ok=yes;;
|
||||
*beos*)
|
||||
beos_threads=1
|
||||
@@ -316,17 +318,14 @@ dnl -------------------------------------------------------------------------
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_DIRENT
|
||||
|
||||
dnl In QNX opendir resides in libc but dirent.h is still required
|
||||
if test "`uname -s 2>/dev/null`" != "QNX"; then
|
||||
AC_HEADER_DIRENT
|
||||
else
|
||||
AC_CHECK_HEADERS(dirent.h)
|
||||
fi
|
||||
PHP_MISSING_FCLOSE_DECL
|
||||
dnl QNX requires unix.h to allow functions in libunix to work properly
|
||||
AC_CHECK_HEADERS([ \
|
||||
dirent.h \
|
||||
ApplicationServices/ApplicationServices.h \
|
||||
sys/param.h \
|
||||
sys/types.h \
|
||||
sys/time.h \
|
||||
netinet/in.h \
|
||||
@@ -370,7 +369,11 @@ unix.h \
|
||||
utime.h \
|
||||
sys/utsname.h \
|
||||
sys/ipc.h \
|
||||
dlfcn.h
|
||||
],[],[],[
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
@@ -519,7 +522,7 @@ vsnprintf \
|
||||
|
||||
dnl Check for getaddrinfo, should be a better way, but...
|
||||
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
|
||||
[AC_TRY_COMPILE([#include <netdb.h>],
|
||||
[AC_TRY_LINK([#include <netdb.h>],
|
||||
[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);],
|
||||
ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no)])
|
||||
if test "$ac_cv_func_getaddrinfo" = yes; then
|
||||
@@ -613,27 +616,6 @@ if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then
|
||||
PHP_CONFIG_FILE_SCAN_DIR=""
|
||||
fi
|
||||
|
||||
# compatibility
|
||||
if test -z "$with_pear" && test "$enable_pear" = "no"; then
|
||||
with_pear=no
|
||||
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, yes)
|
||||
|
||||
if test "$PHP_PEAR" != "no" && test "$disable_cli" != "1"; then
|
||||
install_pear="install-pear"
|
||||
PEAR_INSTALLDIR=$PHP_PEAR
|
||||
fi
|
||||
|
||||
if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
|
||||
case $PHP_LAYOUT in
|
||||
GNU) PEAR_INSTALLDIR=$datadir/pear;;
|
||||
*) PEAR_INSTALLDIR=$libdir/php;;
|
||||
esac
|
||||
fi
|
||||
|
||||
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
|
||||
PHP_ARG_ENABLE(safe-mode, whether to enable safe mode by default,
|
||||
@@ -731,17 +713,19 @@ if test "$PHP_IPV6" != "no" && test "$ac_cv_ipv6_support" = yes; then
|
||||
AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
|
||||
fi
|
||||
|
||||
|
||||
dnl
|
||||
dnl OpenSSL configure
|
||||
dnl
|
||||
PHP_ARG_WITH(openssl,for OpenSSL support,
|
||||
[ --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_MSG_CHECKING([whether to enable versioning])
|
||||
AC_ARG_ENABLE(versioning,
|
||||
[ --enable-versioning Export only required symbols.
|
||||
See INSTALL for more information], [
|
||||
if test "x$APXS" != "x"; then
|
||||
PHP_VERSIONING=$enableval
|
||||
else
|
||||
PHP_VERSIONING=no
|
||||
fi
|
||||
],[
|
||||
PHP_VERSIONING=no
|
||||
])
|
||||
AC_MSG_RESULT([$PHP_VERSIONING])
|
||||
|
||||
divert(5)
|
||||
|
||||
@@ -778,26 +762,9 @@ AC_ARG_ENABLE(all,
|
||||
# reading config stubs
|
||||
esyscmd(./build/config-stubs ext)
|
||||
|
||||
|
||||
dnl Other settings.
|
||||
dnl Extensions post-config
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
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], [
|
||||
if test "x$APXS" != "x"; then
|
||||
PHP_VERSIONING=$enableval
|
||||
else
|
||||
PHP_VERSIONING=no
|
||||
fi
|
||||
],[
|
||||
PHP_VERSIONING=no
|
||||
])
|
||||
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
|
||||
@@ -823,8 +790,6 @@ shared)
|
||||
;;
|
||||
esac
|
||||
|
||||
PHP_REGEX
|
||||
|
||||
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
|
||||
|
||||
dnl this has to be here to prevent the openssl crypt() from
|
||||
@@ -835,10 +800,70 @@ fi
|
||||
|
||||
unset LIBS LDFLAGS
|
||||
|
||||
dnl PEAR
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
PHP_HELP_SEPARATOR([PEAR:])
|
||||
PHP_CONFIGURE_PART(Configuring PEAR)
|
||||
|
||||
# compatibility
|
||||
if test -z "$with_pear" && test "$enable_pear" = "no"; then
|
||||
with_pear=no
|
||||
fi
|
||||
|
||||
PHP_ARG_WITH(pear, [whether to install PEAR],
|
||||
[ --with-pear=DIR Install PEAR in DIR (default PREFIX/lib/php)
|
||||
--without-pear Do not install PEAR], DEFAULT, yes)
|
||||
|
||||
if test "$PHP_PEAR" != "no"; then
|
||||
|
||||
dnl
|
||||
dnl PEAR dependancies
|
||||
dnl
|
||||
if test "$PHP_SAPI_CLI" = "no"; then
|
||||
pear_error_msg="$pear_error_msg
|
||||
PEAR requires CLI to be enabled. Add --enable-cli to the configure line."
|
||||
fi
|
||||
if test "$PHP_PCRE_REGEX" = "no"; then
|
||||
pear_error_msg="$pear_error_msg
|
||||
PEAR requires PCRE to be enabled. Add --with-pcre-regex to the configure line."
|
||||
fi
|
||||
if test "$PHP_XML" = "no"; then
|
||||
pear_error_msg="$pear_error_msg
|
||||
PEAR requires XML to be enabled. Add --enable-xml to the configure line."
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl ext/xmlrpc is not really there yet to be a requirement..
|
||||
dnl
|
||||
dnl if test "$PHP_XMLRPC" = "no"; then
|
||||
dnl pear_error_msg="$pear_error_msg
|
||||
dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line."
|
||||
dnl fi
|
||||
dnl
|
||||
|
||||
if test "$pear_error_msg"; then
|
||||
AC_MSG_ERROR([$pear_error_msg])
|
||||
fi
|
||||
|
||||
install_pear="install-pear"
|
||||
PEAR_INSTALLDIR=$PHP_PEAR
|
||||
|
||||
if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
|
||||
case $PHP_LAYOUT in
|
||||
GNU) PEAR_INSTALLDIR=$datadir/pear;;
|
||||
*) PEAR_INSTALLDIR=$libdir/php;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
dnl Configuring Zend and TSRM.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
PHP_HELP_SEPARATOR([Zend:])
|
||||
PHP_CONFIGURE_PART(Configuring Zend)
|
||||
|
||||
LIBZEND_BASIC_CHECKS
|
||||
LIBZEND_DLSYM_CHECK
|
||||
LIBZEND_OTHER_CHECKS
|
||||
@@ -862,12 +887,14 @@ fi
|
||||
ZEND_EXTRA_LIBS="$LIBS"
|
||||
unset LIBS LDFLAGS
|
||||
|
||||
PHP_HELP_SEPARATOR([TSRM:])
|
||||
PHP_CONFIGURE_PART(Configuring TSRM)
|
||||
TSRM_BASIC_CHECKS
|
||||
if test "$PHP_THREAD_SAFETY" = "yes"; then
|
||||
TSRM_THREADS_CHECKS
|
||||
fi
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
|
||||
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
|
||||
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
|
||||
unset LIBS LDFLAGS
|
||||
|
||||
@@ -967,6 +994,7 @@ if test -z "$php_ldflags_add_usr_lib"; then
|
||||
fi
|
||||
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
|
||||
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
|
||||
|
||||
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
|
||||
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
|
||||
@@ -1022,6 +1050,7 @@ PHP_SUBST_OLD(DEBUG_CFLAGS)
|
||||
PHP_SUBST(DEFS)
|
||||
PHP_SUBST_OLD(EXTENSION_DIR)
|
||||
PHP_SUBST_OLD(EXTRA_LDFLAGS)
|
||||
PHP_SUBST_OLD(EXTRA_LDFLAGS_PROGRAM)
|
||||
PHP_SUBST_OLD(EXTRA_LIBS)
|
||||
PHP_SUBST_OLD(ZEND_EXTRA_LIBS)
|
||||
PHP_SUBST_OLD(INCLUDES)
|
||||
@@ -1044,6 +1073,7 @@ PHP_SUBST(PHP_RPATHS)
|
||||
PHP_SUBST(PHP_SAPI)
|
||||
PHP_SUBST_OLD(PHP_VERSION)
|
||||
PHP_SUBST(PROG_SENDMAIL)
|
||||
PHP_SUBST(RE2C)
|
||||
PHP_SUBST(SHELL)
|
||||
PHP_SUBST(SHARED_LIBTOOL)
|
||||
PHP_SUBST(TSRM_DIR)
|
||||
@@ -1077,6 +1107,7 @@ dnl
|
||||
dnl Libtool creation
|
||||
dnl
|
||||
|
||||
PHP_HELP_SEPARATOR([Libtool:])
|
||||
PHP_CONFIGURE_PART(Configuring libtool)
|
||||
|
||||
LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Bzip2
|
||||
Sterling Hughes
|
||||
+542
@@ -0,0 +1,542 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| 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: Sterling Hughes <sterling@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
#include "php_bz2.h"
|
||||
|
||||
#if HAVE_BZ2
|
||||
|
||||
/* PHP Includes */
|
||||
#include "ext/standard/file.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "ext/standard/php_string.h"
|
||||
|
||||
/* for fileno() */
|
||||
#include <stdio.h>
|
||||
|
||||
/* Internal error constants */
|
||||
#define PHP_BZ_ERRNO 0
|
||||
#define PHP_BZ_ERRSTR 1
|
||||
#define PHP_BZ_ERRBOTH 2
|
||||
|
||||
/* Blocksize of the decompression buffer */
|
||||
#define PHP_BZ_DECOMPRESS_SIZE 4096
|
||||
|
||||
function_entry bz2_functions[] = {
|
||||
PHP_FE(bzopen, NULL)
|
||||
PHP_FE(bzread, NULL)
|
||||
PHP_FALIAS(bzwrite, fwrite, NULL)
|
||||
PHP_FALIAS(bzflush, fflush, NULL)
|
||||
PHP_FALIAS(bzclose, fclose, NULL)
|
||||
PHP_FE(bzerrno, NULL)
|
||||
PHP_FE(bzerrstr, NULL)
|
||||
PHP_FE(bzerror, NULL)
|
||||
PHP_FE(bzcompress, NULL)
|
||||
PHP_FE(bzdecompress, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
zend_module_entry bz2_module_entry = {
|
||||
STANDARD_MODULE_HEADER,
|
||||
"bz2",
|
||||
bz2_functions,
|
||||
PHP_MINIT(bz2),
|
||||
PHP_MSHUTDOWN(bz2),
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(bz2),
|
||||
NO_VERSION_YET,
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#ifdef COMPILE_DL_BZ2
|
||||
ZEND_GET_MODULE(bz2)
|
||||
#endif
|
||||
|
||||
struct php_bz2_stream_data_t {
|
||||
BZFILE *bz_file;
|
||||
php_stream *stream;
|
||||
};
|
||||
|
||||
/* {{{ BZip2 stream implementation */
|
||||
|
||||
static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract;
|
||||
size_t ret;
|
||||
|
||||
ret = BZ2_bzread(self->bz_file, buf, count);
|
||||
|
||||
if (ret == 0) {
|
||||
stream->eof = 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract;
|
||||
|
||||
return BZ2_bzwrite(self->bz_file, (char*)buf, count);
|
||||
}
|
||||
|
||||
static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
|
||||
int ret = EOF;
|
||||
|
||||
if (close_handle) {
|
||||
BZ2_bzclose(self->bz_file);
|
||||
}
|
||||
|
||||
if (self->stream) {
|
||||
php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | (close_handle == 0 ? PHP_STREAM_FREE_PRESERVE_HANDLE : 0));
|
||||
}
|
||||
|
||||
efree(self);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int php_bz2iop_flush(php_stream *stream TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
|
||||
return BZ2_bzflush(self->bz_file);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
php_stream_ops php_stream_bz2io_ops = {
|
||||
php_bz2iop_write, php_bz2iop_read,
|
||||
php_bz2iop_close, php_bz2iop_flush,
|
||||
"BZip2",
|
||||
NULL, /* seek */
|
||||
NULL, /* cast */
|
||||
NULL, /* stat */
|
||||
NULL /* set_option */
|
||||
};
|
||||
|
||||
/* {{{ Bzip2 stream openers */
|
||||
PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz,
|
||||
char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self;
|
||||
|
||||
self = emalloc(sizeof(*self));
|
||||
|
||||
self->stream = innerstream;
|
||||
self->bz_file = bz;
|
||||
|
||||
return php_stream_alloc_rel(&php_stream_bz2io_ops, self, 0, mode);
|
||||
}
|
||||
|
||||
PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
|
||||
char *path,
|
||||
char *mode,
|
||||
int options,
|
||||
char **opened_path,
|
||||
php_stream_context *context STREAMS_DC TSRMLS_DC)
|
||||
{
|
||||
php_stream *retstream = NULL, *stream = NULL;
|
||||
char *path_copy = NULL;
|
||||
BZFILE *bz_file = NULL;
|
||||
|
||||
if (strncasecmp("compress.bzip2://", path, 17) == 0) {
|
||||
path += 17;
|
||||
}
|
||||
if (mode[0] != 'w' && mode[0] != 'r' && mode[1] != '\0') {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef VIRTUAL_DIR
|
||||
virtual_filepath_ex(path, &path_copy, NULL TSRMLS_CC);
|
||||
#else
|
||||
path_copy = path;
|
||||
#endif
|
||||
|
||||
/* try and open it directly first */
|
||||
bz_file = BZ2_bzopen(path_copy, mode);
|
||||
|
||||
if (opened_path && bz_file) {
|
||||
*opened_path = estrdup(path_copy);
|
||||
}
|
||||
path_copy = NULL;
|
||||
|
||||
if (bz_file == NULL) {
|
||||
/* that didn't work, so try and get something from the network/wrapper */
|
||||
stream = php_stream_open_wrapper(path, mode, options, opened_path);
|
||||
|
||||
if (stream) {
|
||||
int fd;
|
||||
if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
|
||||
bz_file = BZ2_bzdopen(fd, mode);
|
||||
}
|
||||
}
|
||||
/* remove the file created by php_stream_open_wrapper(), it is not needed since BZ2 functions
|
||||
* failed.
|
||||
*/
|
||||
if (!bz_file && mode[0] == 'w') {
|
||||
VCWD_UNLINK(*opened_path);
|
||||
}
|
||||
}
|
||||
|
||||
if (bz_file) {
|
||||
retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC);
|
||||
if (retstream) {
|
||||
return retstream;
|
||||
}
|
||||
|
||||
BZ2_bzclose(bz_file);
|
||||
}
|
||||
|
||||
if (stream) {
|
||||
php_stream_close(stream);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
static php_stream_wrapper_ops bzip2_stream_wops = {
|
||||
_php_stream_bz2open,
|
||||
NULL, /* close */
|
||||
NULL, /* fstat */
|
||||
NULL, /* stat */
|
||||
NULL, /* opendir */
|
||||
"BZip2"
|
||||
};
|
||||
|
||||
php_stream_wrapper php_stream_bzip2_wrapper = {
|
||||
&bzip2_stream_wops,
|
||||
NULL,
|
||||
0 /* is_url */
|
||||
};
|
||||
|
||||
static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int);
|
||||
|
||||
PHP_MINIT_FUNCTION(bz2)
|
||||
{
|
||||
php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MSHUTDOWN_FUNCTION(bz2)
|
||||
{
|
||||
php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MINFO_FUNCTION(bz2)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "BZip2 Support", "Enabled");
|
||||
php_info_print_table_row(2, "BZip2 Version", (char *) BZ2_bzlibVersion());
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
/* {{{ proto string bzread(int bz[, int length])
|
||||
Reads up to length bytes from a BZip2 stream, or 1024 bytes if length is not specified */
|
||||
PHP_FUNCTION(bzread)
|
||||
{
|
||||
zval *bz;
|
||||
long len = 1024;
|
||||
php_stream *stream;
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_stream_from_zval(stream, &bz);
|
||||
|
||||
if (len < 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
Z_STRVAL_P(return_value) = emalloc(len + 1);
|
||||
Z_STRLEN_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), len);
|
||||
|
||||
if (Z_STRLEN_P(return_value) < 0) {
|
||||
efree(Z_STRVAL_P(return_value));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0;
|
||||
|
||||
if (PG(magic_quotes_runtime)) {
|
||||
Z_STRVAL_P(return_value) = php_addslashes( Z_STRVAL_P(return_value),
|
||||
Z_STRLEN_P(return_value),
|
||||
&Z_STRLEN_P(return_value), 1 TSRMLS_CC);
|
||||
}
|
||||
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto resource bzopen(string|int file|fp, string mode)
|
||||
Opens a new BZip2 stream */
|
||||
PHP_FUNCTION(bzopen)
|
||||
{
|
||||
zval **file, /* The file to open */
|
||||
**mode; /* The mode to open the stream with */
|
||||
BZFILE *bz; /* The compressed file stream */
|
||||
php_stream *stream = NULL;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &file, &mode) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(mode);
|
||||
|
||||
if (Z_STRVAL_PP(mode)[0] != 'r' && Z_STRVAL_PP(mode)[0] != 'w' && Z_STRVAL_PP(mode)[1] != '\0') {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", Z_STRVAL_PP(mode));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* If it's not a resource its a string containing the filename to open */
|
||||
if (Z_TYPE_PP(file) != IS_RESOURCE) {
|
||||
convert_to_string_ex(file);
|
||||
stream = php_stream_bz2open(NULL,
|
||||
Z_STRVAL_PP(file),
|
||||
Z_STRVAL_PP(mode),
|
||||
ENFORCE_SAFE_MODE | REPORT_ERRORS,
|
||||
NULL);
|
||||
} else {
|
||||
/* If it is a resource, than its a stream resource */
|
||||
int fd;
|
||||
|
||||
php_stream_from_zval(stream, file);
|
||||
|
||||
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
bz = BZ2_bzdopen(fd, Z_STRVAL_PP(mode));
|
||||
|
||||
stream = php_stream_bz2open_from_BZFILE(bz, Z_STRVAL_PP(mode), stream);
|
||||
}
|
||||
|
||||
if (stream) {
|
||||
php_stream_to_zval(stream, return_value);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int bzerrno(resource bz)
|
||||
Returns the error number */
|
||||
PHP_FUNCTION(bzerrno)
|
||||
{
|
||||
php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRNO);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string bzerrstr(resource bz)
|
||||
Returns the error string */
|
||||
PHP_FUNCTION(bzerrstr)
|
||||
{
|
||||
php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRSTR);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array bzerror(resource bz)
|
||||
Returns the error number and error string in an associative array */
|
||||
PHP_FUNCTION(bzerror)
|
||||
{
|
||||
php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRBOTH);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string bzcompress(string source [, int blocksize100k [, int workfactor]])
|
||||
Compresses a string into BZip2 encoded data */
|
||||
PHP_FUNCTION(bzcompress)
|
||||
{
|
||||
zval **source, /* Source data to compress */
|
||||
**zblock_size, /* Optional block size to use */
|
||||
**zwork_factor; /* Optional work factor to use */
|
||||
char *dest = NULL; /* Destination to place the compressed data into */
|
||||
int error, /* Error Container */
|
||||
block_size = 4, /* Block size for compression algorithm */
|
||||
work_factor = 0, /* Work factor for compression algorithm */
|
||||
argc; /* Argument count */
|
||||
unsigned int source_len, /* Length of the source data */
|
||||
dest_len; /* Length of the destination buffer */
|
||||
|
||||
argc = ZEND_NUM_ARGS();
|
||||
|
||||
if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &source, &zblock_size, &zwork_factor) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(source);
|
||||
|
||||
/* Assign them to easy to use variables, dest_len is initially the length of the data
|
||||
+ .01 x length of data + 600 which is the largest size the results of the compression
|
||||
could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net
|
||||
for pointing this out). */
|
||||
source_len = Z_STRLEN_PP(source);
|
||||
dest_len = Z_STRLEN_PP(source) + (0.01 * Z_STRLEN_PP(source)) + 600;
|
||||
|
||||
/* Allocate the destination buffer */
|
||||
dest = emalloc(dest_len + 1);
|
||||
|
||||
/* Handle the optional arguments */
|
||||
if (argc > 1) {
|
||||
convert_to_long_ex(zblock_size);
|
||||
block_size = Z_LVAL_PP(zblock_size);
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
convert_to_long_ex(zwork_factor);
|
||||
work_factor = Z_LVAL_PP(zwork_factor);
|
||||
}
|
||||
|
||||
error = BZ2_bzBuffToBuffCompress(dest, &dest_len, Z_STRVAL_PP(source), source_len, block_size, 0, work_factor);
|
||||
if (error != BZ_OK) {
|
||||
efree(dest);
|
||||
RETURN_LONG(error);
|
||||
} else {
|
||||
/* Copy the buffer, we have perhaps allocate alot more than we need,
|
||||
so we erealloc() the buffer to the proper size */
|
||||
dest = erealloc(dest, dest_len + 1);
|
||||
dest[dest_len] = 0;
|
||||
RETURN_STRINGL(dest, dest_len, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string bzdecompress(string source [, int small])
|
||||
Decompresses BZip2 compressed data */
|
||||
PHP_FUNCTION(bzdecompress)
|
||||
{
|
||||
zval **source, /* Source data to decompress */
|
||||
**zsmall; /* (Optional) user specified small */
|
||||
char *dest; /* Destination buffer, initially allocated */
|
||||
int error, /* Error container */
|
||||
iter = 1, /* Iteration count for the compression loop */
|
||||
size, /* Current size to realloc the dest buffer to */
|
||||
dest_len = PHP_BZ_DECOMPRESS_SIZE, /* Size of the destination length */
|
||||
small = 0, /* The actual small */
|
||||
argc = ZEND_NUM_ARGS(); /* Argument count */
|
||||
|
||||
if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &source, &zsmall) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(source);
|
||||
|
||||
/* optional small argument handling */
|
||||
if (argc > 1) {
|
||||
convert_to_long_ex(zsmall);
|
||||
small = Z_LVAL_PP(zsmall);
|
||||
}
|
||||
|
||||
/* Depending on the size of the source buffer, either allocate
|
||||
the length of the source buffer or the a default decompression
|
||||
size */
|
||||
dest = emalloc(PHP_BZ_DECOMPRESS_SIZE > Z_STRLEN_PP(source) ? PHP_BZ_DECOMPRESS_SIZE : Z_STRLEN_PP(source));
|
||||
|
||||
/* (de)Compression Loop */
|
||||
do {
|
||||
/* Handle the (re)allocation of the buffer */
|
||||
size = dest_len * iter;
|
||||
if (iter > 1) {
|
||||
dest = erealloc(dest, size);
|
||||
}
|
||||
++iter;
|
||||
|
||||
/* Perform the decompression */
|
||||
error = BZ2_bzBuffToBuffDecompress(dest, &size, Z_STRVAL_PP(source), Z_STRLEN_PP(source), small, 0);
|
||||
} while (error == BZ_OUTBUFF_FULL);
|
||||
|
||||
if (error != BZ_OK) {
|
||||
efree(dest);
|
||||
RETURN_LONG(error);
|
||||
} else {
|
||||
/* we might have allocated a little to much, so erealloc the buffer
|
||||
down to size, before returning it */
|
||||
dest = erealloc(dest, size + 1);
|
||||
dest[size] = 0;
|
||||
RETURN_STRINGL(dest, size, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_bz2_error()
|
||||
The central error handling interface, does the work for bzerrno, bzerrstr and bzerror */
|
||||
static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt)
|
||||
{
|
||||
zval **bzp; /* BZip2 Resource Pointer */
|
||||
php_stream *stream;
|
||||
const char *errstr; /* Error string */
|
||||
int errnum; /* Error number */
|
||||
struct php_bz2_stream_data_t *self;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &bzp) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
php_stream_from_zval(stream, bzp);
|
||||
|
||||
if (!php_stream_is(stream, PHP_STREAM_IS_BZIP2)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
self = (struct php_bz2_stream_data_t *) stream->abstract;
|
||||
|
||||
/* Fetch the error information */
|
||||
errstr = BZ2_bzerror(self->bz_file, &errnum);
|
||||
|
||||
/* Determine what to return */
|
||||
switch (opt) {
|
||||
case PHP_BZ_ERRNO:
|
||||
RETURN_LONG(errnum);
|
||||
break;
|
||||
case PHP_BZ_ERRSTR:
|
||||
RETURN_STRING((char*)errstr, 1);
|
||||
break;
|
||||
case PHP_BZ_ERRBOTH:
|
||||
array_init(return_value);
|
||||
|
||||
add_assoc_long (return_value, "errno", errnum);
|
||||
add_assoc_string(return_value, "errstr", (char*)errstr, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: fdm=marker
|
||||
* vim: noet sw=4 ts=4
|
||||
*/
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
# Microsoft Developer Studio Project File - Name="bz2" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=bz2 - Win32 Debug_TS
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "bz2.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "bz2.mak" CFG="bz2 - Win32 Debug_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "bz2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "bz2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "bz2 - Win32 Release_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release_TS"
|
||||
# PROP BASE Intermediate_Dir "Release_TS"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release_TS"
|
||||
# PROP Intermediate_Dir "Release_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x407 /d "NDEBUG"
|
||||
# ADD RSC /l 0x407 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_bz2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "bz2 - Win32 Debug_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug_TS"
|
||||
# PROP BASE Intermediate_Dir "Debug_TS"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug_TS"
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x407 /d "_DEBUG"
|
||||
# ADD RSC /l 0x407 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 php4ts_debug.lib libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_bz2.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "bz2 - Win32 Release_TS"
|
||||
# Name "bz2 - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\bz2.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_bz2.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,39 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(bz2, for BZip2 support,
|
||||
[ --with-bz2[=DIR] Include BZip2 support])
|
||||
|
||||
if test "$PHP_BZ2" != "no"; then
|
||||
if test -r $PHP_BZ2/include/bzlib.h; then
|
||||
BZIP_DIR=$PHP_BZ2
|
||||
else
|
||||
AC_MSG_CHECKING(for BZip2 in default path)
|
||||
for i in /usr/local /usr; do
|
||||
if test -r $i/include/bzlib.h; then
|
||||
BZIP_DIR=$i
|
||||
AC_MSG_RESULT(found in $i)
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$BZIP_DIR"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
AC_MSG_ERROR(Please reinstall the BZip2 distribution)
|
||||
fi
|
||||
|
||||
PHP_CHECK_LIBRARY(bz2, BZ2_bzerror,
|
||||
[
|
||||
PHP_ADD_INCLUDE($BZIP_DIR/include)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/lib, BZ2_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_BZ2,1,[ ])
|
||||
], [
|
||||
AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0)
|
||||
], [
|
||||
-L$BZIP_DIR/lib
|
||||
])
|
||||
|
||||
PHP_NEW_EXTENSION(bz2, bz2.c, $ext_shared)
|
||||
PHP_SUBST(BZ2_SHARED_LIBADD)
|
||||
fi
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!-- do not use the "Type" attribute here, that one is only for
|
||||
generated package.xml files -->
|
||||
<package>
|
||||
<name>bz2</name>
|
||||
<summary>A Bzip2 management extension</summary>
|
||||
<description>
|
||||
Bz2 is an extension to create and parse bzip2 compressed data.
|
||||
</description>
|
||||
<license>PHP License</license>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>sterling</user>
|
||||
<name>Sterling Hughes</name>
|
||||
<email>sterling@php.net</email>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<release>
|
||||
<version>1.0</version>
|
||||
<date>2003-05-17</date>
|
||||
<state>stable</state>
|
||||
<notes>
|
||||
Initial Release in PECL
|
||||
</notes>
|
||||
</release>
|
||||
<filelist>
|
||||
<dir role="src" name="/">
|
||||
<file role="doc">CREDITS</file>
|
||||
<file role="src">config.m4</file>
|
||||
<file role="doc">php_bz2.h</file>
|
||||
<file role="src">bz2.c</file>
|
||||
<file role="src">bz2.dsp</file>
|
||||
</dir>
|
||||
</filelist>
|
||||
</package>
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| 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: Sterling Hughes <sterling@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef PHP_BZ2_H
|
||||
#define PHP_BZ2_H
|
||||
|
||||
#if HAVE_BZ2
|
||||
|
||||
extern zend_module_entry bz2_module_entry;
|
||||
#define phpext_bz2_ptr &bz2_module_entry
|
||||
|
||||
/* Bzip2 includes */
|
||||
#include <bzlib.h>
|
||||
|
||||
PHP_MINIT_FUNCTION(bz2);
|
||||
PHP_MSHUTDOWN_FUNCTION(bz2);
|
||||
PHP_MINFO_FUNCTION(bz2);
|
||||
PHP_FUNCTION(bzopen);
|
||||
PHP_FUNCTION(bzread);
|
||||
PHP_FUNCTION(bzerrno);
|
||||
PHP_FUNCTION(bzerrstr);
|
||||
PHP_FUNCTION(bzerror);
|
||||
PHP_FUNCTION(bzcompress);
|
||||
PHP_FUNCTION(bzdecompress);
|
||||
|
||||
#else
|
||||
#define phpext_bz2_ptr NULL
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
# ifdef PHP_BZ2_EXPORTS
|
||||
# define PHP_BZ2_API __declspec(dllexport)
|
||||
# else
|
||||
# define PHP_BZ2_API __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# define PHP_BZ2_API
|
||||
#endif
|
||||
|
||||
PHP_BZ2_API PHPAPI php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
|
||||
PHP_BZ2_API PHPAPI php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC);
|
||||
|
||||
#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC)
|
||||
#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC)
|
||||
|
||||
php_stream_ops php_stream_bz2io_ops;
|
||||
#define PHP_STREAM_IS_BZIP2 &php_stream_bz2io_ops
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
BZ2 with files
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("bz2")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php // $Id$
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$filename = "testfile.bz2";
|
||||
$str = "This is a test string.\n";
|
||||
$bz = bzopen($filename, "w");
|
||||
bzwrite($bz, $str);
|
||||
bzclose($bz);
|
||||
|
||||
$bz = bzopen($filename, "r");
|
||||
print bzread($bz, 10);
|
||||
print bzread($bz);
|
||||
bzclose($bz);
|
||||
unlink($filename);
|
||||
|
||||
--EXPECT--
|
||||
This is a test string.
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
BZ2 with strings
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("bz2")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php // $Id$
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
# This FAILS
|
||||
$blaat = <<<HEREDOC
|
||||
This is some random data
|
||||
HEREDOC;
|
||||
|
||||
# This Works: (so, is heredoc related)
|
||||
#$blaat= 'This is some random data';
|
||||
|
||||
$blaat2 = bzdecompress(bzcompress($blaat));
|
||||
|
||||
$tests = <<<TESTS
|
||||
\$blaat === \$blaat2
|
||||
TESTS;
|
||||
include(dirname(__FILE__) . '/../../../tests/quicktester.inc');
|
||||
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -161,7 +161,7 @@ PHP_FUNCTION(cal_info)
|
||||
}
|
||||
convert_to_long_ex(cal);
|
||||
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %ld", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ PHP_FUNCTION(cal_days_in_month)
|
||||
convert_to_long_ex(year);
|
||||
|
||||
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %ld", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ PHP_FUNCTION(cal_to_jd)
|
||||
convert_to_long_ex(year);
|
||||
|
||||
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %ld", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ PHP_FUNCTION(cal_from_jd)
|
||||
convert_to_long_ex(cal);
|
||||
|
||||
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %ld", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
calendar = &cal_conversion_table[Z_LVAL_PP(cal)];
|
||||
|
||||
+16
-25
@@ -55,7 +55,7 @@
|
||||
#ifdef PHP_WIN32
|
||||
|
||||
#define _WIN32_DCOM
|
||||
|
||||
#define COBJMACROS
|
||||
#include <iostream.h>
|
||||
#include <math.h>
|
||||
#include <ocidl.h>
|
||||
@@ -2224,7 +2224,6 @@ static ITypeLib *php_COM_find_typelib(char *search_string, int mode TSRMLS_DC)
|
||||
|
||||
PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
|
||||
{
|
||||
ITypeComp *TypeComp;
|
||||
int i;
|
||||
int interfaces;
|
||||
|
||||
@@ -2232,40 +2231,33 @@ PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
interfaces = TypeLib->lpVtbl->GetTypeInfoCount(TypeLib);
|
||||
interfaces = ITypeLib_GetTypeInfoCount(TypeLib);
|
||||
|
||||
TypeLib->lpVtbl->GetTypeComp(TypeLib, &TypeComp);
|
||||
for (i=0; i<interfaces; i++) {
|
||||
TYPEKIND pTKind;
|
||||
|
||||
TypeLib->lpVtbl->GetTypeInfoType(TypeLib, i, &pTKind);
|
||||
if (pTKind==TKIND_ENUM) {
|
||||
ITypeLib_GetTypeInfoType(TypeLib, i, &pTKind);
|
||||
if (pTKind == TKIND_ENUM) {
|
||||
ITypeInfo *TypeInfo;
|
||||
VARDESC *pVarDesc;
|
||||
UINT NameCount;
|
||||
int j;
|
||||
#if 0
|
||||
BSTR bstr_EnumId;
|
||||
char *EnumId;
|
||||
|
||||
TypeLib->lpVtbl->GetDocumentation(TypeLib, i, &bstr_EnumId, NULL, NULL, NULL);
|
||||
EnumId = php_OLECHAR_to_char(bstr_EnumId, NULL, codepage);
|
||||
printf("Enumeration %d - %s:\n", i, EnumId);
|
||||
efree(EnumId);
|
||||
#endif
|
||||
ITypeLib_GetTypeInfo(TypeLib, i, &TypeInfo);
|
||||
|
||||
TypeLib->lpVtbl->GetTypeInfo(TypeLib, i, &TypeInfo);
|
||||
|
||||
j=0;
|
||||
while (SUCCEEDED(TypeInfo->lpVtbl->GetVarDesc(TypeInfo, j, &pVarDesc))) {
|
||||
for (j = 0; ; j++) {
|
||||
BSTR bstr_ids;
|
||||
zend_constant c;
|
||||
zval exists, results, value;
|
||||
char *const_name;
|
||||
|
||||
TypeInfo->lpVtbl->GetNames(TypeInfo, pVarDesc->memid, &bstr_ids, 1, &NameCount);
|
||||
if (NameCount!=1) {
|
||||
j++;
|
||||
if (FAILED(ITypeInfo_GetVarDesc(TypeInfo, j, &pVarDesc))) {
|
||||
break;
|
||||
}
|
||||
|
||||
ITypeInfo_GetNames(TypeInfo, pVarDesc->memid, &bstr_ids, 1, &NameCount);
|
||||
if (NameCount != 1) {
|
||||
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
|
||||
continue;
|
||||
}
|
||||
const_name = php_OLECHAR_to_char(bstr_ids, &c.name_len, codepage TSRMLS_CC);
|
||||
@@ -2282,7 +2274,7 @@ PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
|
||||
php_error(E_WARNING, "%s(): Type library value %s is already defined and has a different value", get_active_function_name(TSRMLS_C), c.name);
|
||||
}
|
||||
free(c.name);
|
||||
j++;
|
||||
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2296,10 +2288,9 @@ PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
|
||||
|
||||
zend_register_constant(&c TSRMLS_CC);
|
||||
}
|
||||
|
||||
j++;
|
||||
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
|
||||
}
|
||||
TypeInfo->lpVtbl->Release(TypeInfo);
|
||||
ITypeInfo_Release(TypeInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -52,13 +52,13 @@ AC_ARG_WITH(cpdflib,
|
||||
[
|
||||
PHP_WITH_SHARED
|
||||
if test "$withval" != "no"; then
|
||||
PHP_NEW_EXTENSION(cpdf, cpdf.c, $ext_shared)
|
||||
cpdf_withval=$withval
|
||||
PHP_NEW_EXTENSION(cpdf, cpdf.c, $ext_shared,, \\$(GDLIB_CFLAGS))
|
||||
PHP_SUBST(CPDF_SHARED_LIBADD)
|
||||
|
||||
CPDF_JPEG_TEST
|
||||
CPDF_TIFF_TEST
|
||||
|
||||
for i in $withval /usr /usr/local; do
|
||||
for i in $cpdf_withval /usr/local /usr; do
|
||||
if test -f "$i/include/cpdflib.h"; then
|
||||
CPDFLIB_INCLUDE=$i/include
|
||||
AC_MSG_CHECKING(for cpdflib.h)
|
||||
|
||||
+18
-19
@@ -7,27 +7,26 @@ PHP_ARG_WITH(crack, for CRACKlib support,
|
||||
|
||||
if test "$PHP_CRACK" != "no"; then
|
||||
|
||||
for i in /usr/local/lib /usr/lib $PHP_CRACK/lib $PHP_CRACK/cracklib; do
|
||||
test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i
|
||||
done
|
||||
for i in $PHP_CRACK/lib $PHP_CRACK/cracklib /usr/local/lib /usr/lib; do
|
||||
test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i && break
|
||||
done
|
||||
|
||||
for i in /usr/local/include /usr/include $PHP_CRACK/include $PHP_CRACK/cracklib; do
|
||||
test -f $i/packer.h && CRACK_INCLUDEDIR=$i
|
||||
done
|
||||
if test -z "$CRACK_LIBDIR"; then
|
||||
AC_MSG_ERROR(Cannot find the cracklib library file)
|
||||
fi
|
||||
|
||||
for i in $PHP_CRACK/include $PHP_CRACK/cracklib /usr/local/include /usr/include; do
|
||||
test -f $i/packer.h && CRACK_INCLUDEDIR=$i && break
|
||||
done
|
||||
|
||||
if test -z "$CRACK_LIBDIR"; then
|
||||
AC_MSG_ERROR(Cannot find the cracklib library file)
|
||||
fi
|
||||
if test -z "$CRACK_INCLUDEDIR"; then
|
||||
AC_MSG_ERROR(Cannot find a cracklib header file)
|
||||
fi
|
||||
|
||||
if test -z "$CRACK_INCLUDEDIR"; then
|
||||
AC_MSG_ERROR(Cannot find a cracklib header file)
|
||||
fi
|
||||
PHP_ADD_INCLUDE($CRACK_INCLUDEDIR)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(crack, $CRACK_LIBDIR, CRACK_SHARED_LIBADD)
|
||||
|
||||
PHP_ADD_INCLUDE($CRACK_INCLUDEDIR)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(crack, $CRACK_LIBDIR, CRACK_SHARED_LIBADD)
|
||||
|
||||
PHP_NEW_EXTENSION(crack, crack.c, $ext_shared)
|
||||
PHP_SUBST(CRACK_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_CRACK, 1, [ ])
|
||||
PHP_NEW_EXTENSION(crack, crack.c, $ext_shared)
|
||||
PHP_SUBST(CRACK_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_CRACK, 1, [ ])
|
||||
fi
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ PHP_MINFO_FUNCTION(ctype)
|
||||
p=Z_STRVAL_P(c); \
|
||||
len = Z_STRLEN_P(c); \
|
||||
for(n=0;n<len;n++) { \
|
||||
if(!iswhat(*p++)) RETURN_FALSE; \
|
||||
if(!iswhat((int)*(unsigned char *)(p++))) RETURN_FALSE; \
|
||||
} \
|
||||
RETURN_TRUE; \
|
||||
} \
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #25745 (ctype functions fail with non-ascii characters)
|
||||
--FILE--
|
||||
<?php
|
||||
$funcs = array(
|
||||
"ctype_alnum", "ctype_alpha", "ctype_cntrl", "ctype_digit",
|
||||
"ctype_graph", "ctype_lower", "ctype_print", "ctype_punct",
|
||||
"ctype_space", "ctype_upper", "ctype_xdigit"
|
||||
);
|
||||
|
||||
foreach ($funcs as $ctype_func) {
|
||||
for ($i = 0; $i < 256; $i++) {
|
||||
$a = $ctype_func($i);
|
||||
$b = $ctype_func(chr($i));
|
||||
if ($a != $b) {
|
||||
echo "broken... $ctype_func($i) = $a, $ctype_func(chr($i)) = $b\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
+25
-8
@@ -191,7 +191,7 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE_DEFAULT);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_CRLF);
|
||||
#ifdef CURLOPT_ENCODING
|
||||
#if LIBCURL_VERSION_NUM >= 0x070a00
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_ENCODING);
|
||||
#endif
|
||||
|
||||
@@ -349,7 +349,6 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
zval *argv[2];
|
||||
zval *retval;
|
||||
int error;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
MAKE_STD_ZVAL(argv[0]);
|
||||
MAKE_STD_ZVAL(argv[1]);
|
||||
@@ -729,22 +728,18 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_USERAGENT:
|
||||
case CURLOPT_FTPPORT:
|
||||
case CURLOPT_COOKIE:
|
||||
case CURLOPT_COOKIEFILE:
|
||||
case CURLOPT_REFERER:
|
||||
case CURLOPT_INTERFACE:
|
||||
case CURLOPT_KRB4LEVEL:
|
||||
case CURLOPT_RANDOM_FILE:
|
||||
case CURLOPT_EGDSOCKET:
|
||||
case CURLOPT_CAINFO:
|
||||
case CURLOPT_CAPATH:
|
||||
case CURLOPT_COOKIEJAR:
|
||||
case CURLOPT_SSL_CIPHER_LIST:
|
||||
case CURLOPT_SSLKEY:
|
||||
case CURLOPT_SSLCERT:
|
||||
case CURLOPT_SSLKEYTYPE:
|
||||
case CURLOPT_SSLKEYPASSWD:
|
||||
case CURLOPT_SSLKEYPASSWD:
|
||||
case CURLOPT_SSLENGINE:
|
||||
#ifdef CURLOPT_ENCODING
|
||||
#if LIBCURL_VERSION_NUM >= 0x070a00
|
||||
case CURLOPT_ENCODING:
|
||||
#endif
|
||||
case CURLOPT_SSLENGINE_DEFAULT: {
|
||||
@@ -954,6 +949,28 @@ PHP_FUNCTION(curl_setopt)
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, slist);
|
||||
|
||||
break;
|
||||
}
|
||||
/* the following options deal with files, therefor safe_mode & open_basedir checks
|
||||
* are required.
|
||||
*/
|
||||
case CURLOPT_COOKIEJAR:
|
||||
case CURLOPT_SSLCERT:
|
||||
case CURLOPT_RANDOM_FILE:
|
||||
case CURLOPT_COOKIEFILE: {
|
||||
char *copystr = NULL;
|
||||
|
||||
convert_to_string_ex(zvalue);
|
||||
|
||||
if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, copystr);
|
||||
zend_llist_add_element(&ch->to_free.str, ©str);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -113,7 +113,7 @@ BSC32=bscmake.exe
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 php4ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 php4ts_debug.lib libcurl.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
|
||||
# ADD LINK32 php4ts_debug.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "curl - Win32 Release_TS_SSL"
|
||||
@@ -142,7 +142,7 @@ BSC32=bscmake.exe
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 php4ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 php4ts.lib libcurl.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
|
||||
# ADD LINK32 php4ts.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(cyrus, for cyrus imap support,
|
||||
[ --with-cyrus[=dir] Include Cyrus IMAP support])
|
||||
[ --with-cyrus[=DIR] Include Cyrus IMAP support])
|
||||
|
||||
if test "$PHP_CYRUS" != "no"; then
|
||||
found_cyrus=no
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ AC_DEFUN(AC_PREFERRED_DB_LIB,[
|
||||
|
||||
|
||||
PHP_ARG_WITH(db, for xDBM support,
|
||||
[ --with-db Include old xDBM support (deprecated use --with-dba)])
|
||||
[ --with-db Include old xDBM support (deprecated, use --enable-dba instead)])
|
||||
|
||||
if test "$PHP_DB" != "no"; then
|
||||
|
||||
|
||||
+7
-7
@@ -513,7 +513,7 @@ PHP_FUNCTION(dbminsert)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ PHP_FUNCTION(dbmreplace)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ PHP_FUNCTION(dbmfetch)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ PHP_FUNCTION(dbmexists)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ PHP_FUNCTION(dbmdelete)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -779,7 +779,7 @@ PHP_FUNCTION(dbmfirstkey)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ PHP_FUNCTION(dbmnextkey)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -258,7 +258,7 @@ AC_ARG_WITH(db3,
|
||||
done
|
||||
PHP_DBA_DB_CHECK(3, db-3.3 db-3.2 db-3.1 db-3.0 db-3 db3 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
fi
|
||||
])
|
||||
])
|
||||
AC_DBA_STD_RESULT(db3,Berkeley DB3)
|
||||
|
||||
AC_ARG_WITH(db2,
|
||||
|
||||
+11
-3
@@ -321,7 +321,11 @@ static void dba_close(dba_info *info TSRMLS_DC)
|
||||
pefree(info->path, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
if (info->fp && info->fp!=info->lock.fp) {
|
||||
php_stream_close(info->fp);
|
||||
if(info->flags&DBA_PERSISTENT) {
|
||||
php_stream_pclose(info->fp);
|
||||
} else {
|
||||
php_stream_close(info->fp);
|
||||
}
|
||||
}
|
||||
if (info->lock.fd) {
|
||||
php_flock(info->lock.fd, LOCK_UN);
|
||||
@@ -329,7 +333,11 @@ static void dba_close(dba_info *info TSRMLS_DC)
|
||||
info->lock.fd = 0;
|
||||
}
|
||||
if (info->lock.fp) {
|
||||
php_stream_close(info->lock.fp);
|
||||
if(info->flags&DBA_PERSISTENT) {
|
||||
php_stream_pclose(info->lock.fp);
|
||||
} else {
|
||||
php_stream_close(info->lock.fp);
|
||||
}
|
||||
}
|
||||
if (info->lock.name) {
|
||||
pefree(info->lock.name, info->flags&DBA_PERSISTENT);
|
||||
@@ -666,7 +674,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
if (*pmode=='t') {
|
||||
pmode++;
|
||||
if (!lock_flag) {
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)", hptr->name);
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)");
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ DBA_OPEN_FUNC(db2)
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
info->mode == DBA_TRUNC ? DB_BTREE :
|
||||
s ? DB_BTREE : DB_UNKNOWN;
|
||||
!s ? DB_BTREE : DB_UNKNOWN;
|
||||
|
||||
gmode = info->mode == DBA_READER ? DB_RDONLY :
|
||||
(info->mode == DBA_CREAT && s) ? DB_CREATE :
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ DBA_OPEN_FUNC(db3)
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
info->mode == DBA_TRUNC ? DB_BTREE :
|
||||
s? DB_BTREE : DB_UNKNOWN;
|
||||
!s? DB_BTREE : DB_UNKNOWN;
|
||||
|
||||
gmode = info->mode == DBA_READER ? DB_RDONLY :
|
||||
(info->mode == DBA_CREAT && s) ? DB_CREATE :
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ DBA_OPEN_FUNC(db4)
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
info->mode == DBA_TRUNC ? DB_BTREE :
|
||||
s? DB_BTREE : DB_UNKNOWN;
|
||||
!s? DB_BTREE : DB_UNKNOWN;
|
||||
|
||||
gmode = info->mode == DBA_READER ? DB_RDONLY :
|
||||
(info->mode == DBA_CREAT && s) ? DB_CREATE :
|
||||
|
||||
+10
-2
@@ -40,7 +40,12 @@
|
||||
inifile *dba = info->dbf
|
||||
|
||||
#define INIFILE_GKEY \
|
||||
key_type ini_key = inifile_key_split((char*)key) /* keylen not needed here */
|
||||
key_type ini_key; \
|
||||
if (!key) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No key specified"); \
|
||||
return 0; \
|
||||
} \
|
||||
ini_key = inifile_key_split((char*)key) /* keylen not needed here */
|
||||
|
||||
#define INIFILE_DONE \
|
||||
inifile_key_free(&ini_key)
|
||||
@@ -119,9 +124,12 @@ DBA_EXISTS_FUNC(inifile)
|
||||
|
||||
DBA_DELETE_FUNC(inifile)
|
||||
{
|
||||
int res;
|
||||
|
||||
INIFILE_DATA;
|
||||
INIFILE_GKEY;
|
||||
int res = inifile_delete(dba, &ini_key TSRMLS_CC);
|
||||
|
||||
res = inifile_delete(dba, &ini_key TSRMLS_CC);
|
||||
|
||||
INIFILE_DONE;
|
||||
return (res == -1 ? FAILURE : SUCCESS);
|
||||
|
||||
@@ -154,7 +154,7 @@ static char *etrim(const char *str)
|
||||
return NULL;
|
||||
}
|
||||
val = (char*)str;
|
||||
while (strchr(" \t\r\n", *val)) {
|
||||
while (*val && strchr(" \t\r\n", *val)) {
|
||||
val++;
|
||||
}
|
||||
l = strlen(val);
|
||||
|
||||
@@ -37,9 +37,9 @@ database file created
|
||||
database file created
|
||||
array(3) {
|
||||
[%d]=>
|
||||
string(%d) "%sext/dba/tests/test0.dbm"
|
||||
string(%d) "%s/dba/tests/test0.dbm"
|
||||
[%d]=>
|
||||
string(%d) "%sext/dba/tests/test1.dbm"
|
||||
string(%d) "%s/dba/tests/test1.dbm"
|
||||
[%d]=>
|
||||
string(%d) "%sext/dba/tests/test2.dbm"
|
||||
string(%d) "%s/dba/tests/test2.dbm"
|
||||
}
|
||||
+1
-1
@@ -674,7 +674,7 @@ PHP_FUNCTION(dbase_create)
|
||||
|
||||
/* field type */
|
||||
if (zend_hash_index_find(Z_ARRVAL_PP (field), 1, (void **)&value) == FAILURE) {
|
||||
php_error(E_WARNING, "expected field type as sececond element of list in field %d", i);
|
||||
php_error(E_WARNING, "expected field type as second element of list in field %d", i);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_string_ex(value);
|
||||
|
||||
+2
-2
@@ -161,7 +161,7 @@ PHP_FUNCTION(dio_open)
|
||||
}
|
||||
|
||||
if (fd == -1) {
|
||||
php_error(E_WARNING, "%s(): cannot open file %s with flags %d and permissions %d: %s",
|
||||
php_error(E_WARNING, "%s(): cannot open file %s with flags %ld and permissions %ld: %s",
|
||||
get_active_function_name(TSRMLS_C), file_name, flags, mode, strerror(errno));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ PHP_FUNCTION(dio_truncate)
|
||||
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
|
||||
|
||||
if (ftruncate(f->fd, offset) == -1) {
|
||||
php_error(E_WARNING, "%s(): couldn't truncate %d to %d bytes: %s",
|
||||
php_error(E_WARNING, "%s(): couldn't truncate %d to %ld bytes: %s",
|
||||
get_active_function_name(TSRMLS_C), f->fd, offset, strerror(errno));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
+275
-223
@@ -146,6 +146,8 @@
|
||||
#define DOMXML_LOAD_SUBSTITUTE_ENTITIES 4
|
||||
#define DOMXML_LOAD_COMPLETE_ATTRS 8
|
||||
#define DOMXML_LOAD_DONT_KEEP_BLANKS 16
|
||||
#define DOMXML_LOAD_FILE 1
|
||||
|
||||
static int le_domxmldocp;
|
||||
static int le_domxmldoctypep;
|
||||
static int le_domxmldtdp;
|
||||
@@ -158,6 +160,7 @@ static int le_domxmlpip;
|
||||
static int le_domxmlcommentp;
|
||||
static int le_domxmlnotationp;
|
||||
static int le_domxmlparserp;
|
||||
static int le_domxmlnamespacep;
|
||||
|
||||
/*static int le_domxmlentityp;*/
|
||||
static int le_domxmlentityrefp;
|
||||
@@ -170,7 +173,6 @@ static int le_domxsltstylesheetp;
|
||||
static void domxml_error(void *ctx, const char *msg, ...);
|
||||
static void domxml_error_ext(void *ctx, const char *msg, ...);
|
||||
static void domxml_error_validate(void *ctx, const char *msg, ...);
|
||||
static xmlDocPtr php_dom_xmlSAXParse(xmlSAXHandlerPtr sax, const char *buffer, int size, int recovery, void *data);
|
||||
|
||||
#if defined(LIBXML_XPATH_ENABLED)
|
||||
static int le_xpathctxp;
|
||||
@@ -512,6 +514,13 @@ static zend_function_entry php_domxmlattr_class_functions[] = {
|
||||
};
|
||||
|
||||
static zend_function_entry php_domxmlns_class_functions[] = {
|
||||
PHP_FALIAS(node_name, domxml_node_name, NULL)
|
||||
PHP_FALIAS(node_type, domxml_node_type, NULL)
|
||||
PHP_FALIAS(node_value, domxml_node_value, NULL)
|
||||
PHP_FALIAS(prefix, domxml_node_prefix, NULL)
|
||||
PHP_FALIAS(namespace_uri, domxml_node_namespace_uri, NULL)
|
||||
PHP_FALIAS(owner_document, domxml_node_owner_document, NULL)
|
||||
PHP_FALIAS(parent_node, domxml_node_parent, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -732,11 +741,19 @@ 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) {
|
||||
if (node->parent == NULL || node->type == XML_NAMESPACE_DECL) {
|
||||
/* Attribute Nodes ccontain accessible children
|
||||
attr_list_wrapper_dtor(node->properties); */
|
||||
xmlSetTreeDoc(node, NULL);
|
||||
node_list_wrapper_dtor((xmlNodePtr) node->properties, 1 TSRMLS_CC);
|
||||
if (node->type == XML_NAMESPACE_DECL) {
|
||||
if (node->ns) {
|
||||
xmlFreeNs(node->ns);
|
||||
node->ns = NULL;
|
||||
}
|
||||
node->type = XML_ELEMENT_NODE;
|
||||
} else {
|
||||
node_list_wrapper_dtor((xmlNodePtr) node->properties, 1 TSRMLS_CC);
|
||||
}
|
||||
node_list_wrapper_dtor(node->children, 1 TSRMLS_CC);
|
||||
node_wrapper_dtor(node);
|
||||
xmlFreeNode(node);
|
||||
@@ -818,7 +835,7 @@ static void php_free_xslt_stylesheet(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
void *php_xsltstylesheet_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
|
||||
static void *php_xsltstylesheet_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
|
||||
{
|
||||
void *obj;
|
||||
zval **handle;
|
||||
@@ -867,8 +884,9 @@ static void php_xsltstylesheet_set_object(zval *wrapper, void *obj, int rsrc_typ
|
||||
}
|
||||
#endif /* HAVE_DOMXSLT */
|
||||
|
||||
|
||||
void *php_xpath_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
|
||||
/* Not used? */
|
||||
/*
|
||||
static void *php_xpath_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
|
||||
{
|
||||
void *obj;
|
||||
zval **handle;
|
||||
@@ -897,6 +915,7 @@ void *php_xpath_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_
|
||||
|
||||
return obj;
|
||||
}
|
||||
*/
|
||||
|
||||
static zval *php_xpathobject_new(xmlXPathObjectPtr obj, int *found TSRMLS_DC)
|
||||
{
|
||||
@@ -907,7 +926,7 @@ static zval *php_xpathobject_new(xmlXPathObjectPtr obj, int *found TSRMLS_DC)
|
||||
return (wrapper);
|
||||
}
|
||||
|
||||
void *php_xpath_get_context(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
|
||||
static void *php_xpath_get_context(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
|
||||
{
|
||||
void *obj;
|
||||
zval **handle;
|
||||
@@ -1101,7 +1120,7 @@ static char **php_xmlparser_make_params(zval *idvars TSRMLS_DC)
|
||||
/* }}} */
|
||||
/* end parser stuff */
|
||||
|
||||
void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
|
||||
static void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
|
||||
{
|
||||
void *obj;
|
||||
zval **handle;
|
||||
@@ -1368,6 +1387,22 @@ PHPAPI zval *php_domobject_new(xmlNodePtr obj, int *found, zval *wrapper_in TSR
|
||||
break;
|
||||
}
|
||||
|
||||
case XML_NAMESPACE_DECL:
|
||||
{
|
||||
xmlNodePtr nodep = obj;
|
||||
if(!wrapper_in)
|
||||
object_init_ex(wrapper, domxmlns_class_entry);
|
||||
rsrc_type = le_domxmlnamespacep;
|
||||
add_property_long(wrapper, "type", Z_TYPE_P(nodep));
|
||||
add_property_stringl(wrapper, "name", (char *) nodep->name, strlen(nodep->name), 1);
|
||||
content = xmlNodeGetContent(nodep->children);
|
||||
if (content) {
|
||||
add_property_stringl(wrapper, "value", (char *) content, strlen(content), 1);
|
||||
xmlFree(content);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported node type: %d\n", Z_TYPE_P(obj));
|
||||
FREE_ZVAL(wrapper);
|
||||
@@ -1412,7 +1447,7 @@ static void domxml_error_ext(void *ctx, const char *msg, ...)
|
||||
add_assoc_string(errormessages,"errormessage",buf,1);
|
||||
input = ctxt->input;
|
||||
if (ctxt->name) {
|
||||
add_assoc_string(errormessages,"nodename",ctxt->name,1);
|
||||
add_assoc_string(errormessages,"nodename",(char *) ctxt->name,1);
|
||||
}
|
||||
if (input != NULL) {
|
||||
add_assoc_long(errormessages,"line",input->line);
|
||||
@@ -1448,7 +1483,7 @@ static void domxml_error_validate(void *ctx, const char *msg, ...)
|
||||
}
|
||||
if (ctxt->parser != NULL) {
|
||||
if (ctxt->parser->name) {
|
||||
add_assoc_string(errormessages,"nodename",ctxt->parser->name,1);
|
||||
add_assoc_string(errormessages,"nodename",(char *)ctxt->parser->name,1);
|
||||
}
|
||||
|
||||
if (ctxt->parser->input != NULL) {
|
||||
@@ -1475,73 +1510,13 @@ static void domxml_error_validate(void *ctx, const char *msg, ...)
|
||||
|
||||
}
|
||||
|
||||
xmlDocPtr php_dom_xmlSAXParse(xmlSAXHandlerPtr sax, const char *buffer, int size, int recovery, void *data) {
|
||||
|
||||
xmlDocPtr ret;
|
||||
xmlParserCtxtPtr ctxt;
|
||||
domxml_ErrorCtxt errorCtxt;
|
||||
char *directory = NULL;
|
||||
|
||||
xmlInitParser();
|
||||
/*if size == -1, we assume, it's a filename not a inmemory xml doc*/
|
||||
if (size == -1) {
|
||||
ctxt = (xmlParserCtxt *) xmlCreateFileParserCtxt( buffer);
|
||||
} else {
|
||||
ctxt = (xmlParserCtxt *) xmlCreateMemoryParserCtxt((xmlChar *) buffer, size);
|
||||
}
|
||||
if (ctxt == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
if (sax != NULL) {
|
||||
if (ctxt->sax != NULL)
|
||||
xmlFree(ctxt->sax);
|
||||
ctxt->sax = sax;
|
||||
}
|
||||
if (data!=NULL) {
|
||||
ctxt->_private=data;
|
||||
}
|
||||
|
||||
/* store directory name */
|
||||
if (size == -1) {
|
||||
if ((ctxt->directory == NULL) && (directory == NULL))
|
||||
directory = xmlParserGetDirectory(buffer);
|
||||
if ((ctxt->directory == NULL) && (directory != NULL))
|
||||
ctxt->directory = (char *) xmlStrdup((xmlChar *) directory);
|
||||
}
|
||||
errorCtxt.valid = &ctxt->vctxt;
|
||||
errorCtxt.errors = data;
|
||||
errorCtxt.parser = ctxt;
|
||||
|
||||
ctxt->sax->error = domxml_error_ext;
|
||||
ctxt->sax->warning = domxml_error_ext;
|
||||
ctxt->vctxt.userData= (void *) &errorCtxt;
|
||||
ctxt->vctxt.error = (xmlValidityErrorFunc) domxml_error_validate;
|
||||
ctxt->vctxt.warning = (xmlValidityWarningFunc) domxml_error_validate;
|
||||
|
||||
xmlParseDocument(ctxt);
|
||||
|
||||
if ((ctxt->wellFormed) || recovery) {
|
||||
ret = ctxt->myDoc;
|
||||
} else {
|
||||
ret = NULL;
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
ctxt->myDoc = NULL;
|
||||
}
|
||||
if (sax != NULL)
|
||||
ctxt->sax = NULL;
|
||||
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
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 */
|
||||
@@ -1565,6 +1540,7 @@ 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_domxmlnamespacep = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domnamespacenode", 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.
|
||||
@@ -1947,6 +1923,7 @@ PHP_FUNCTION(domxml_node_name)
|
||||
zval *id;
|
||||
xmlNode *n;
|
||||
int fullQName = 0;
|
||||
xmlChar *qname = NULL;
|
||||
const char *str = NULL;
|
||||
|
||||
DOMXML_PARAM_ONE(n, id, le_domxmlnodep,"|b",&fullQName);
|
||||
@@ -1954,16 +1931,24 @@ PHP_FUNCTION(domxml_node_name)
|
||||
switch (Z_TYPE_P(n)) {
|
||||
case XML_ELEMENT_NODE:
|
||||
if (fullQName && n->ns && n->ns->prefix) {
|
||||
/* there is maybe a better way of doing this...*/
|
||||
char *tmpstr;
|
||||
tmpstr = (char*) emalloc((strlen(n->ns->prefix)+strlen(n->name)) * sizeof(char)) ;
|
||||
sprintf(tmpstr,"%s:%s", (char*) n->ns->prefix, (char*) n->name);
|
||||
str = strdup(tmpstr);
|
||||
efree(tmpstr);
|
||||
qname = xmlStrdup(n->ns->prefix);
|
||||
qname = xmlStrcat(qname, ":");
|
||||
qname = xmlStrcat(qname, n->name);
|
||||
str = qname;
|
||||
} else {
|
||||
str = n->name;
|
||||
}
|
||||
break;
|
||||
case XML_NAMESPACE_DECL:
|
||||
if (n->ns != NULL && n->ns->prefix) {
|
||||
qname = xmlStrdup("xmlns");
|
||||
qname = xmlStrcat(qname, ":");
|
||||
qname = xmlStrcat(qname, n->name);
|
||||
str = qname;
|
||||
} else {
|
||||
str = (char *) n->name;
|
||||
}
|
||||
break;
|
||||
|
||||
case XML_TEXT_NODE:
|
||||
str = "#text";
|
||||
@@ -2007,7 +1992,10 @@ PHP_FUNCTION(domxml_node_name)
|
||||
}
|
||||
|
||||
if(str != NULL) {
|
||||
RETURN_STRING((char *) str, 1);
|
||||
RETVAL_STRING((char *) str, 1);
|
||||
if (qname) {
|
||||
xmlFree(qname);
|
||||
}
|
||||
} else {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
@@ -2033,6 +2021,11 @@ PHP_FUNCTION(domxml_node_value)
|
||||
case XML_PI_NODE:
|
||||
str = n->content;
|
||||
break;
|
||||
case XML_NAMESPACE_DECL:
|
||||
if (n->children) {
|
||||
str = n->children->content;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
str = NULL;
|
||||
break;
|
||||
@@ -2384,6 +2377,7 @@ PHP_FUNCTION(domxml_node_replace_node)
|
||||
{
|
||||
zval *id, *rv = NULL, *node;
|
||||
xmlNodePtr repnode, nodep, old_repnode;
|
||||
xmlDocPtr tmpdoc;
|
||||
int ret;
|
||||
|
||||
DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep);
|
||||
@@ -2394,8 +2388,18 @@ PHP_FUNCTION(domxml_node_replace_node)
|
||||
|
||||
DOMXML_GET_OBJ(repnode, node, le_domxmlnodep);
|
||||
|
||||
tmpdoc = repnode->doc;
|
||||
|
||||
old_repnode = xmlReplaceNode(nodep, repnode);
|
||||
|
||||
/* ReplaceNode will change the doc for only the first node
|
||||
so check if doc was changed */
|
||||
if (tmpdoc != repnode->doc) {
|
||||
/* Set doc back to old doc otherwise libxml wont change all sub nodes */
|
||||
repnode->doc = tmpdoc;
|
||||
xmlSetTreeDoc(repnode, old_repnode->doc);
|
||||
}
|
||||
|
||||
DOMXML_RET_OBJ(rv, old_repnode, &ret);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2412,11 +2416,6 @@ PHP_FUNCTION(domxml_node_append_child)
|
||||
|
||||
DOMXML_GET_OBJ(child, node, le_domxmlnodep);
|
||||
|
||||
if (child->type == XML_ATTRIBUTE_NODE) {
|
||||
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");
|
||||
@@ -2456,6 +2455,45 @@ PHP_FUNCTION(domxml_node_append_child)
|
||||
}
|
||||
}
|
||||
/* end libxml2 code */
|
||||
else if (child->type == XML_ATTRIBUTE_NODE) {
|
||||
if (parent->properties != NULL) {
|
||||
/* Check if an attribute with the same name exists */
|
||||
xmlAttrPtr foundattrp;
|
||||
if (child->ns == NULL)
|
||||
foundattrp = xmlHasProp(parent, child->name);
|
||||
else
|
||||
foundattrp = xmlHasNsProp(parent, child->name, child->ns->href);
|
||||
if (foundattrp != (xmlAttrPtr) child) {
|
||||
if (foundattrp != NULL) {
|
||||
if (dom_object_get_data((xmlNodePtr) foundattrp) == NULL) {
|
||||
node_list_unlink(foundattrp->children);
|
||||
xmlUnlinkNode((xmlNodePtr) foundattrp);
|
||||
xmlFreeProp(foundattrp);
|
||||
} else {
|
||||
xmlUnlinkNode((xmlNodePtr) foundattrp);
|
||||
}
|
||||
new_child = (xmlNodePtr) xmlCopyProp(parent, (xmlAttrPtr) child);
|
||||
if (!new_child) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such attribute '%s'", child->name);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
xmlAttr *prop;
|
||||
prop = parent->properties;
|
||||
while (prop->next != NULL) {
|
||||
prop = prop->next;
|
||||
}
|
||||
prop->next = (xmlAttrPtr) new_child;
|
||||
((xmlAttrPtr) new_child)->prev = prop;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
new_child = (xmlNodePtr) foundattrp;
|
||||
}
|
||||
}
|
||||
/* For all other intents and purposes fall through to the xmlAddChild
|
||||
* call
|
||||
*/
|
||||
}
|
||||
|
||||
if (NULL == new_child) {
|
||||
new_child = xmlAddChild(parent, child);
|
||||
@@ -3040,11 +3078,11 @@ PHP_FUNCTION(domxml_doc_get_elements_by_tagname)
|
||||
DOMXML_GET_OBJ(contextnodep, contextnode, le_domxmlnodep);
|
||||
}
|
||||
ctxp->node = contextnodep;
|
||||
str = (char*) emalloc((name_len+3) * sizeof(char)) ;
|
||||
str = (char*) emalloc((name_len+23) * sizeof(char)) ;
|
||||
if (str == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate memory for string");
|
||||
}
|
||||
sprintf(str ,"//%s",name);
|
||||
sprintf(str ,"//*[local-name() = '%s']", name);
|
||||
|
||||
xpathobjp = xmlXPathEval(str, ctxp);
|
||||
efree(str);
|
||||
@@ -3107,7 +3145,8 @@ struct _idsIterator {
|
||||
xmlNode *element;
|
||||
};
|
||||
|
||||
static void idsHashScanner(void *payload, void *data, xmlChar *name) {
|
||||
static void idsHashScanner(void *payload, void *data, xmlChar *name)
|
||||
{
|
||||
idsIterator *priv = (idsIterator *)data;
|
||||
|
||||
if (priv->element == NULL && xmlStrEqual (name, priv->elementId))
|
||||
@@ -3919,6 +3958,89 @@ PHP_FUNCTION(domxml_doc_ids)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static xmlDocPtr domxml_document_parser(int mode, int loadtype, char *source, void *data TSRMLS_DC) {
|
||||
xmlDocPtr ret;
|
||||
xmlParserCtxtPtr ctxt;
|
||||
domxml_ErrorCtxt errorCtxt;
|
||||
char *directory = NULL;
|
||||
int validate = 0, resolve_externals = 0;
|
||||
int keep_blanks = 1, recovery = 1, substitute_ent;
|
||||
|
||||
substitute_ent = xmlSubstituteEntitiesDefaultValue;
|
||||
|
||||
if (mode & DOMXML_LOAD_DONT_KEEP_BLANKS)
|
||||
keep_blanks = 0;
|
||||
|
||||
if(mode & DOMXML_LOAD_SUBSTITUTE_ENTITIES)
|
||||
substitute_ent = 1;
|
||||
|
||||
if(mode & DOMXML_LOAD_COMPLETE_ATTRS)
|
||||
resolve_externals = XML_COMPLETE_ATTRS;
|
||||
|
||||
if(mode & DOMXML_LOAD_VALIDATING)
|
||||
validate = 1;
|
||||
|
||||
if(mode & DOMXML_LOAD_RECOVERING)
|
||||
recovery = 1;
|
||||
|
||||
xmlInitParser();
|
||||
|
||||
keep_blanks = xmlKeepBlanksDefault(keep_blanks);
|
||||
|
||||
if (loadtype == DOMXML_LOAD_FILE) {
|
||||
ctxt = xmlCreateFileParserCtxt(source);
|
||||
} else {
|
||||
ctxt = xmlCreateDocParserCtxt(source);
|
||||
}
|
||||
|
||||
xmlKeepBlanksDefault(keep_blanks);
|
||||
/* xmlIndentTreeOutput default is changed in xmlKeepBlanksDefault
|
||||
reset back to 1 which is default value */
|
||||
|
||||
xmlIndentTreeOutput = 1;
|
||||
|
||||
if (ctxt == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if (loadtype == DOMXML_LOAD_FILE) {
|
||||
if ((ctxt->directory == NULL) && (directory == NULL))
|
||||
directory = xmlParserGetDirectory(source);
|
||||
if ((ctxt->directory == NULL) && (directory != NULL))
|
||||
ctxt->directory = (char *) xmlStrdup((xmlChar *) directory);
|
||||
}
|
||||
|
||||
ctxt->validate = validate;
|
||||
ctxt->loadsubset = resolve_externals;
|
||||
ctxt->replaceEntities = substitute_ent;
|
||||
|
||||
if (data != NULL) {
|
||||
errorCtxt.valid = &ctxt->vctxt;
|
||||
errorCtxt.errors = data;
|
||||
errorCtxt.parser = ctxt;
|
||||
|
||||
ctxt->sax->error = domxml_error_ext;
|
||||
ctxt->sax->warning = domxml_error_ext;
|
||||
ctxt->vctxt.userData= (void *) &errorCtxt;
|
||||
ctxt->vctxt.error = (xmlValidityErrorFunc) domxml_error_validate;
|
||||
ctxt->vctxt.warning = (xmlValidityWarningFunc) domxml_error_validate;
|
||||
}
|
||||
|
||||
xmlParseDocument(ctxt);
|
||||
|
||||
if (ctxt->wellFormed || recovery)
|
||||
ret = ctxt->myDoc;
|
||||
else {
|
||||
ret = NULL;
|
||||
xmlFreeDoc(ctxt->myDoc);
|
||||
ctxt->myDoc = NULL;
|
||||
}
|
||||
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* {{{ proto object xmldoc(string xmldoc[, int mode[, array error]])
|
||||
Creates DOM object of XML document */
|
||||
PHP_FUNCTION(xmldoc)
|
||||
@@ -3929,76 +4051,23 @@ PHP_FUNCTION(xmldoc)
|
||||
char *buffer;
|
||||
int buffer_len;
|
||||
long mode = 0;
|
||||
int prevSubstValue;
|
||||
int oldvalue = xmlDoValidityCheckingDefaultValue;
|
||||
int oldvalue_keepblanks;
|
||||
int prevLoadExtDtdValue = xmlLoadExtDtdDefaultValue;
|
||||
zval *errors ;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &buffer, &buffer_len, &mode, &errors) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
/* Either of the following line force validation */
|
||||
/* xmlLoadExtDtdDefaultValue = XML_DETECT_IDS; */
|
||||
/* xmlDoValidityCheckingDefaultValue = 1; */
|
||||
if (ZEND_NUM_ARGS() == 3 ) {
|
||||
|
||||
if (ZEND_NUM_ARGS() == 3) {
|
||||
zval_dtor(errors);
|
||||
array_init(errors);
|
||||
docp = domxml_document_parser(mode, 0, buffer, errors TSRMLS_CC);
|
||||
} else {
|
||||
docp = domxml_document_parser(mode, 0, buffer, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (mode & DOMXML_LOAD_DONT_KEEP_BLANKS)
|
||||
oldvalue_keepblanks = xmlKeepBlanksDefault(0);
|
||||
else
|
||||
oldvalue_keepblanks = xmlKeepBlanksDefault(1);
|
||||
|
||||
if(mode & DOMXML_LOAD_SUBSTITUTE_ENTITIES)
|
||||
prevSubstValue = xmlSubstituteEntitiesDefault (1);
|
||||
else
|
||||
prevSubstValue = xmlSubstituteEntitiesDefault (0);
|
||||
|
||||
if(mode & DOMXML_LOAD_COMPLETE_ATTRS)
|
||||
xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
|
||||
|
||||
switch (mode & (DOMXML_LOAD_PARSING | DOMXML_LOAD_VALIDATING | DOMXML_LOAD_RECOVERING)) {
|
||||
case DOMXML_LOAD_PARSING:
|
||||
xmlDoValidityCheckingDefaultValue = 0;
|
||||
if (ZEND_NUM_ARGS() == 3) {
|
||||
docp = php_dom_xmlSAXParse( NULL, (char *) buffer, buffer_len, 0 , errors);
|
||||
} else {
|
||||
docp = xmlParseDoc(buffer);
|
||||
}
|
||||
break;
|
||||
case DOMXML_LOAD_VALIDATING:
|
||||
xmlDoValidityCheckingDefaultValue = 1;
|
||||
if (ZEND_NUM_ARGS() == 3) {
|
||||
docp = php_dom_xmlSAXParse(NULL, (char *) buffer, buffer_len, 0, errors);
|
||||
} else {
|
||||
docp = xmlParseDoc(buffer);
|
||||
}
|
||||
break;
|
||||
case DOMXML_LOAD_RECOVERING:
|
||||
xmlDoValidityCheckingDefaultValue = 0;
|
||||
if (ZEND_NUM_ARGS() == 3) {
|
||||
docp = php_dom_xmlSAXParse(NULL, (char *) buffer, buffer_len, 1, errors);
|
||||
} else {
|
||||
docp = xmlRecoverDoc(buffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
xmlSubstituteEntitiesDefault (prevSubstValue);
|
||||
xmlDoValidityCheckingDefaultValue = oldvalue;
|
||||
xmlLoadExtDtdDefaultValue = prevLoadExtDtdValue;
|
||||
xmlKeepBlanksDefault(oldvalue_keepblanks);
|
||||
|
||||
if (!docp)
|
||||
RETURN_FALSE;
|
||||
|
||||
/* dtd = xmlGetIntSubset(docp);
|
||||
if(dtd) {
|
||||
xmlParseDTD(dtd->ExternalID, dtd->SystemID);
|
||||
}
|
||||
*/
|
||||
|
||||
if(DOMXML_IS_TYPE(getThis(), domxmldoc_class_entry)) {
|
||||
DOMXML_DOMOBJ_NEW(getThis(), (xmlNodePtr) docp, &ret);
|
||||
} else {
|
||||
@@ -4016,68 +4085,24 @@ PHP_FUNCTION(xmldocfile)
|
||||
int ret, file_len;
|
||||
char *file;
|
||||
long mode = 0;
|
||||
int prevSubstValue;
|
||||
int oldvalue = xmlDoValidityCheckingDefaultValue;
|
||||
int oldvalue_keepblanks;
|
||||
zval *errors = NULL;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &file, &file_len, &mode, &errors) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ZEND_NUM_ARGS() == 3 ) {
|
||||
|
||||
if (ZEND_NUM_ARGS() == 3) {
|
||||
zval_dtor(errors);
|
||||
array_init(errors);
|
||||
docp = domxml_document_parser(mode, 1, file, errors TSRMLS_CC);
|
||||
} else {
|
||||
docp = domxml_document_parser(mode, 1, file, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (mode & DOMXML_LOAD_DONT_KEEP_BLANKS)
|
||||
oldvalue_keepblanks = xmlKeepBlanksDefault(0);
|
||||
else
|
||||
oldvalue_keepblanks = xmlKeepBlanksDefault(1);
|
||||
|
||||
if(mode & DOMXML_LOAD_SUBSTITUTE_ENTITIES)
|
||||
prevSubstValue = xmlSubstituteEntitiesDefault (1);
|
||||
else
|
||||
prevSubstValue = xmlSubstituteEntitiesDefault (0);
|
||||
|
||||
if(mode & DOMXML_LOAD_COMPLETE_ATTRS)
|
||||
xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
|
||||
|
||||
switch (mode & (DOMXML_LOAD_PARSING | DOMXML_LOAD_VALIDATING | DOMXML_LOAD_RECOVERING)) {
|
||||
case DOMXML_LOAD_PARSING:
|
||||
xmlDoValidityCheckingDefaultValue = 0;
|
||||
if (ZEND_NUM_ARGS() == 3) {
|
||||
docp = php_dom_xmlSAXParse( NULL, (char *) file, -1 , 0 , errors);
|
||||
} else {
|
||||
docp = xmlParseFile(file);
|
||||
}
|
||||
break;
|
||||
case DOMXML_LOAD_VALIDATING:
|
||||
xmlDoValidityCheckingDefaultValue = 1;
|
||||
if (ZEND_NUM_ARGS() == 3) {
|
||||
docp = php_dom_xmlSAXParse(NULL, (char *) file, -1, 0, errors);
|
||||
} else {
|
||||
docp = xmlParseFile(file);
|
||||
}
|
||||
break;
|
||||
case DOMXML_LOAD_RECOVERING:
|
||||
xmlDoValidityCheckingDefaultValue = 0;
|
||||
if (ZEND_NUM_ARGS() == 3) {
|
||||
docp = php_dom_xmlSAXParse(NULL, (char*) file, -1, 1, errors);
|
||||
} else {
|
||||
docp = xmlRecoverFile(file);
|
||||
}
|
||||
break;
|
||||
}
|
||||
xmlSubstituteEntitiesDefault (prevSubstValue);
|
||||
xmlDoValidityCheckingDefaultValue = oldvalue;
|
||||
xmlKeepBlanksDefault(oldvalue_keepblanks);
|
||||
|
||||
if (!docp) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if(DOMXML_IS_TYPE(getThis(), domxmldoc_class_entry)) {
|
||||
DOMXML_DOMOBJ_NEW(getThis(), (xmlNodePtr) docp, &ret);
|
||||
} else {
|
||||
@@ -4272,7 +4297,6 @@ PHP_FUNCTION(domxml_doc_validate)
|
||||
xmlDoc *docp;
|
||||
domxml_ErrorCtxt errorCtxt;
|
||||
zval *errors ;
|
||||
int oldvalue = xmlDoValidityCheckingDefaultValue;
|
||||
|
||||
DOMXML_PARAM_ONE(docp, id, le_domxmldocp,"|z",&errors);
|
||||
errorCtxt.valid = &cvp;
|
||||
@@ -4286,7 +4310,6 @@ PHP_FUNCTION(domxml_doc_validate)
|
||||
}
|
||||
|
||||
errorCtxt.parser = NULL;
|
||||
xmlDoValidityCheckingDefaultValue = 1;
|
||||
cvp.userData = (void *) &errorCtxt;
|
||||
cvp.error = (xmlValidityErrorFunc) domxml_error_validate;
|
||||
cvp.warning = (xmlValidityWarningFunc) domxml_error_validate;
|
||||
@@ -4299,8 +4322,6 @@ PHP_FUNCTION(domxml_doc_validate)
|
||||
} else {
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
xmlDoValidityCheckingDefaultValue = oldvalue;
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -4412,7 +4433,7 @@ PHP_FUNCTION(domxml_parser_start_element)
|
||||
char *tagname;
|
||||
int tagname_len;
|
||||
char **atts = NULL;
|
||||
|
||||
|
||||
DOMXML_PARAM_THREE(parserp, id, le_domxmlparserp,"s|a", &tagname, &tagname_len, ¶ms);
|
||||
if (params != NULL) {
|
||||
atts = php_xmlparser_make_params(params TSRMLS_CC);
|
||||
@@ -4702,9 +4723,7 @@ static int node_namespace(zval **attributes, xmlNode *nodep TSRMLS_DC)
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
/* We don't have a type zval. **attributes is also very unusual. */
|
||||
|
||||
/* {{{ proto int node_attributes(zval **attributes, int node)
|
||||
/* {{{ int node_attributes(zval **attributes, int node)
|
||||
Returns list of children nodes */
|
||||
static int node_attributes(zval **attributes, xmlNode *nodep TSRMLS_DC)
|
||||
{
|
||||
@@ -4809,7 +4828,8 @@ PHP_FUNCTION(domxml_xmltree)
|
||||
}
|
||||
|
||||
/* Create a new xml document */
|
||||
docp = xmlParseDoc(buf);
|
||||
docp = domxml_document_parser(0, 0, buf, NULL TSRMLS_CC);
|
||||
|
||||
if (!docp) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -4922,6 +4942,8 @@ static void php_xpathptr_eval(INTERNAL_FUNCTION_PARAMETERS, int mode, int expr)
|
||||
|
||||
if (contextnode) {
|
||||
DOMXML_GET_OBJ(contextnodep, contextnode, le_domxmlnodep);
|
||||
} else {
|
||||
contextnodep = xmlDocGetRootElement(ctxp->doc);
|
||||
}
|
||||
ctxp->node = contextnodep;
|
||||
|
||||
@@ -4978,9 +5000,27 @@ static void php_xpathptr_eval(INTERNAL_FUNCTION_PARAMETERS, int mode, int expr)
|
||||
xmlNodePtr node = nodesetp->nodeTab[i];
|
||||
zval *child;
|
||||
int retnode;
|
||||
xmlNsPtr curns;
|
||||
xmlNodePtr nsparent;
|
||||
|
||||
if (node->type == XML_NAMESPACE_DECL) {
|
||||
nsparent = node->_private;
|
||||
curns = xmlNewNs(NULL, node->name, NULL);
|
||||
if (node->children) {
|
||||
curns->prefix = xmlStrdup((char *) node->children);
|
||||
}
|
||||
if (node->children) {
|
||||
node = xmlNewDocNode(ctxp->doc, NULL, (char *) node->children, node->name);
|
||||
} else {
|
||||
node = xmlNewDocNode(ctxp->doc, NULL, "xmlns", node->name);
|
||||
}
|
||||
node->type = XML_NAMESPACE_DECL;
|
||||
node->parent = nsparent;
|
||||
node->ns = curns;
|
||||
}
|
||||
|
||||
/* construct a node object */
|
||||
child = php_domobject_new(node, &retnode, NULL TSRMLS_CC);
|
||||
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(arr), &child, sizeof(zval *), NULL);
|
||||
}
|
||||
zend_hash_update(Z_OBJPROP_P(rv), "nodeset", sizeof("nodeset"), (void *) &arr, sizeof(zval *), NULL);
|
||||
@@ -5151,28 +5191,26 @@ PHP_FUNCTION(domxml_xslt_stylesheet)
|
||||
zval *rv;
|
||||
xmlDocPtr docp;
|
||||
xsltStylesheetPtr sheetp;
|
||||
int ret;
|
||||
int ret, mode, prevSubstValue, prevExtDtdValue;
|
||||
char *buffer;
|
||||
int buffer_len;
|
||||
int prevSubstValue, prevExtDtdValue;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buffer, &buffer_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
prevSubstValue = xmlSubstituteEntitiesDefault (1);
|
||||
prevExtDtdValue = xmlLoadExtDtdDefaultValue;
|
||||
xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
||||
|
||||
docp = xmlParseDoc(buffer);
|
||||
|
||||
xmlSubstituteEntitiesDefault (prevSubstValue);
|
||||
xmlLoadExtDtdDefaultValue = prevExtDtdValue;
|
||||
mode = DOMXML_LOAD_SUBSTITUTE_ENTITIES | DOMXML_LOAD_COMPLETE_ATTRS;
|
||||
docp = domxml_document_parser(mode, 0, buffer, NULL TSRMLS_CC);
|
||||
|
||||
if (!docp)
|
||||
RETURN_FALSE;
|
||||
|
||||
prevSubstValue = xmlSubstituteEntitiesDefault(1);
|
||||
prevExtDtdValue = xmlLoadExtDtdDefaultValue;
|
||||
xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
||||
sheetp = xsltParseStylesheetDoc(docp);
|
||||
xmlSubstituteEntitiesDefault(prevSubstValue);
|
||||
xmlLoadExtDtdDefaultValue = prevExtDtdValue;
|
||||
|
||||
if (!sheetp) {
|
||||
xmlFreeDoc(docp);
|
||||
@@ -5221,26 +5259,32 @@ PHP_FUNCTION(domxml_xslt_stylesheet_doc)
|
||||
PHP_FUNCTION(domxml_xslt_stylesheet_file)
|
||||
{
|
||||
zval *rv;
|
||||
xmlDocPtr docp;
|
||||
xsltStylesheetPtr sheetp;
|
||||
int ret, file_len;
|
||||
int ret, file_len, mode, prevSubstValue, prevExtDtdValue;
|
||||
char *file;
|
||||
int prevSubstValue, prevExtDtdValue;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
prevSubstValue = xmlSubstituteEntitiesDefault (1);
|
||||
mode = DOMXML_LOAD_SUBSTITUTE_ENTITIES | DOMXML_LOAD_COMPLETE_ATTRS;
|
||||
docp = domxml_document_parser(mode, 1, file, NULL TSRMLS_CC);
|
||||
|
||||
if (!docp)
|
||||
RETURN_FALSE;
|
||||
|
||||
prevSubstValue = xmlSubstituteEntitiesDefault(1);
|
||||
prevExtDtdValue = xmlLoadExtDtdDefaultValue;
|
||||
xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
||||
|
||||
sheetp = xsltParseStylesheetFile(file);
|
||||
|
||||
xmlSubstituteEntitiesDefault (prevSubstValue);
|
||||
sheetp = xsltParseStylesheetDoc(docp);
|
||||
xmlSubstituteEntitiesDefault(prevSubstValue);
|
||||
xmlLoadExtDtdDefaultValue = prevExtDtdValue;
|
||||
|
||||
if (!sheetp)
|
||||
if (!sheetp) {
|
||||
xmlFreeDoc(docp);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
rv = php_xsltstylesheet_new(sheetp, &ret TSRMLS_CC);
|
||||
DOMXML_RET_ZVAL(rv);
|
||||
@@ -5337,7 +5381,7 @@ PHP_FUNCTION(domxml_xslt_process)
|
||||
xmlDocPtr xmldocp;
|
||||
xmlDocPtr docp;
|
||||
char **params = NULL;
|
||||
int ret;
|
||||
int ret, clone = 0;
|
||||
char *filename;
|
||||
int filename_len = 0;
|
||||
|
||||
@@ -5349,7 +5393,7 @@ PHP_FUNCTION(domxml_xslt_process)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|abs", &idxml, &idparams, &xpath_params, &filename, &filename_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|a!b!s!l", &idxml, &idparams, &xpath_params, &filename, &filename_len, &clone) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -5359,6 +5403,10 @@ PHP_FUNCTION(domxml_xslt_process)
|
||||
params = php_domxslt_make_params(idparams, xpath_params TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (clone == 1) {
|
||||
xmldocp = xmlCopyDoc(xmldocp, 1);
|
||||
}
|
||||
|
||||
if (filename_len) {
|
||||
FILE *f;
|
||||
f = fopen (filename,"w");
|
||||
@@ -5368,6 +5416,10 @@ PHP_FUNCTION(domxml_xslt_process)
|
||||
docp = xsltApplyStylesheet(xsltstp, xmldocp, (const char**)params);
|
||||
}
|
||||
|
||||
if (clone == 1) {
|
||||
xmlFreeDoc(xmldocp);
|
||||
}
|
||||
|
||||
if (params) {
|
||||
efree(params);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#if HAVE_DOMXML
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#include <libxml/SAX.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/xinclude.h>
|
||||
@@ -245,4 +246,4 @@ typedef struct {
|
||||
#endif /* HAVE_DOMXML */
|
||||
#define phpext_domxml_ptr domxml_module_ptr
|
||||
|
||||
#endif /* _PHP_DIR_H */
|
||||
#endif /* _PHP_DOMXML_H */
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Attributes via append_child not supported (bug #23326)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$document = domxml_new_doc('1.0');
|
||||
$test = $document->create_element('test');
|
||||
$j = 0;
|
||||
for($i=0;$i<10;$i++)
|
||||
{
|
||||
if( $j < 5 )
|
||||
$j = $i;
|
||||
$test->append_child($document->create_attribute("key$j", $i));
|
||||
}
|
||||
$document->append_child($test);
|
||||
echo $document->dump_mem(1);
|
||||
?>
|
||||
--EXPECT--
|
||||
<?xml version="1.0"?>
|
||||
<test key0="0" key1="1" key2="2" key3="3" key4="4" key5="9"/>
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Bug #25900 (DomDocument->get_elements_by_tagname() doesn't work with default ns)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$xml = <<<HERE
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<foo xmlns="http://www.example.com/ns/foo">
|
||||
<bar><test1 /></bar>
|
||||
<bar><test2 /></bar>
|
||||
</foo>
|
||||
HERE;
|
||||
|
||||
function dump($elems) {
|
||||
foreach ($elems as $elem) {
|
||||
var_dump($elem->node_name());
|
||||
if ($elem->node_type() == XML_ELEMENT_NODE) {
|
||||
dump($elem->child_nodes());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dom = xmldoc($xml);
|
||||
$doc = $dom->document_element();
|
||||
dump($dom->get_elements_by_tagname('bar'));
|
||||
dump($doc->get_elements_by_tagname('bar'));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
string(5) "test1"
|
||||
string(3) "bar"
|
||||
string(5) "test2"
|
||||
string(3) "bar"
|
||||
string(5) "test1"
|
||||
string(3) "bar"
|
||||
string(5) "test2"
|
||||
@@ -1,8 +1,8 @@
|
||||
/* character-class table */
|
||||
static struct cclass {
|
||||
char *name;
|
||||
char *chars;
|
||||
char *multis;
|
||||
unsigned char *name;
|
||||
unsigned char *chars;
|
||||
unsigned char *multis;
|
||||
} cclasses[] = {
|
||||
{"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ""},
|
||||
{"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
||||
|
||||
@@ -124,9 +124,9 @@ FILE *d;
|
||||
break;
|
||||
case OCHAR:
|
||||
if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL)
|
||||
fprintf(d, "\\%c", (char)opnd);
|
||||
fprintf(d, "\\%c", (unsigned char)opnd);
|
||||
else
|
||||
fprintf(d, "%s", regchar((char)opnd));
|
||||
fprintf(d, "%s", regchar((unsigned char)opnd));
|
||||
break;
|
||||
case OBOL:
|
||||
fprintf(d, "^");
|
||||
@@ -228,11 +228,11 @@ FILE *d;
|
||||
- regchar - make a character printable
|
||||
== static char *regchar(int ch);
|
||||
*/
|
||||
static char * /* -> representation */
|
||||
static unsigned char * /* -> representation */
|
||||
regchar(ch)
|
||||
int ch;
|
||||
{
|
||||
static char buf[10];
|
||||
static unsigned char buf[10];
|
||||
|
||||
if (isprint(ch) || ch == ' ')
|
||||
sprintf(buf, "%c", ch);
|
||||
|
||||
+63
-63
@@ -33,11 +33,11 @@ struct match {
|
||||
struct re_guts *g;
|
||||
int eflags;
|
||||
regmatch_t *pmatch; /* [nsub+1] (0 element unused) */
|
||||
char *offp; /* offsets work from here */
|
||||
char *beginp; /* start of string -- virtual NUL precedes */
|
||||
char *endp; /* end of string -- virtual NUL here */
|
||||
char *coldp; /* can be no match starting before here */
|
||||
char **lastpos; /* [nplus+1] */
|
||||
unsigned char *offp; /* offsets work from here */
|
||||
unsigned char *beginp; /* start of string -- virtual NUL precedes */
|
||||
unsigned char *endp; /* end of string -- virtual NUL here */
|
||||
unsigned char *coldp; /* can be no match starting before here */
|
||||
unsigned char **lastpos; /* [nplus+1] */
|
||||
STATEVARS;
|
||||
states st; /* current states */
|
||||
states fresh; /* states for a fresh start */
|
||||
@@ -65,20 +65,20 @@ struct match {
|
||||
static int /* 0 success, REG_NOMATCH failure */
|
||||
matcher(g, string, nmatch, pmatch, eflags)
|
||||
register struct re_guts *g;
|
||||
char *string;
|
||||
unsigned char *string;
|
||||
size_t nmatch;
|
||||
regmatch_t pmatch[];
|
||||
int eflags;
|
||||
{
|
||||
register char *endp;
|
||||
register unsigned char *endp;
|
||||
register size_t i;
|
||||
struct match mv;
|
||||
register struct match *m = &mv;
|
||||
register char *dp;
|
||||
register unsigned char *dp;
|
||||
const register sopno gf = g->firststate+1; /* +1 for OEND */
|
||||
const register sopno gl = g->laststate;
|
||||
char *start;
|
||||
char *stop;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
|
||||
/* simplify the situation where possible */
|
||||
if (g->cflags®_NOSUB)
|
||||
@@ -156,10 +156,10 @@ int eflags;
|
||||
dp = dissect(m, m->coldp, endp, gf, gl);
|
||||
} else {
|
||||
if (g->nplus > 0 && m->lastpos == NULL)
|
||||
m->lastpos = (char **)malloc((g->nplus+1) *
|
||||
sizeof(char *));
|
||||
m->lastpos = (unsigned char **)malloc((g->nplus+1) *
|
||||
sizeof(unsigned char *));
|
||||
if (g->nplus > 0 && m->lastpos == NULL) {
|
||||
free(m->pmatch);
|
||||
free((char *)m->pmatch);
|
||||
STATETEARDOWN(m);
|
||||
return(REG_ESPACE);
|
||||
}
|
||||
@@ -225,30 +225,30 @@ int eflags;
|
||||
|
||||
/*
|
||||
- dissect - figure out what matched what, no back references
|
||||
== static char *dissect(register struct match *m, char *start, \
|
||||
== char *stop, sopno startst, sopno stopst);
|
||||
== static unsigned char *dissect(register struct match *m, unsigned char *start, \
|
||||
== unsigned char *stop, sopno startst, sopno stopst);
|
||||
*/
|
||||
static char * /* == stop (success) always */
|
||||
static unsigned char * /* == stop (success) always */
|
||||
dissect(m, start, stop, startst, stopst)
|
||||
register struct match *m;
|
||||
char *start;
|
||||
char *stop;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
{
|
||||
register int i;
|
||||
register sopno ss; /* start sop of current subRE */
|
||||
register sopno es; /* end sop of current subRE */
|
||||
register char *sp; /* start of string matched by it */
|
||||
register char *stp; /* string matched by it cannot pass here */
|
||||
register char *rest; /* start of rest of string */
|
||||
register char *tail; /* string unmatched by rest of RE */
|
||||
register unsigned char *sp; /* start of string matched by it */
|
||||
register unsigned char *stp; /* string matched by it cannot pass here */
|
||||
register unsigned char *rest; /* start of rest of string */
|
||||
register unsigned char *tail; /* string unmatched by rest of RE */
|
||||
register sopno ssub; /* start sop of subsubRE */
|
||||
register sopno esub; /* end sop of subsubRE */
|
||||
register char *ssp; /* start of string matched by subsubRE */
|
||||
register char *sep; /* end of string matched by subsubRE */
|
||||
register char *oldssp; /* previous ssp */
|
||||
register char *dp;
|
||||
register unsigned char *ssp; /* start of string matched by subsubRE */
|
||||
register unsigned char *sep; /* end of string matched by subsubRE */
|
||||
register unsigned char *oldssp; /* previous ssp */
|
||||
register unsigned char *dp;
|
||||
|
||||
AT("diss", start, stop, startst, stopst);
|
||||
sp = start;
|
||||
@@ -413,25 +413,25 @@ sopno stopst;
|
||||
|
||||
/*
|
||||
- backref - figure out what matched what, figuring in back references
|
||||
== static char *backref(register struct match *m, char *start, \
|
||||
== char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
== static unsigned char *backref(register struct match *m, unsigned char *start, \
|
||||
== unsigned char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
*/
|
||||
static char * /* == stop (success) or NULL (failure) */
|
||||
static unsigned char * /* == stop (success) or NULL (failure) */
|
||||
backref(m, start, stop, startst, stopst, lev)
|
||||
register struct match *m;
|
||||
char *start;
|
||||
char *stop;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
sopno lev; /* PLUS nesting level */
|
||||
{
|
||||
register int i;
|
||||
register sopno ss; /* start sop of current subRE */
|
||||
register char *sp; /* start of string matched by it */
|
||||
register unsigned char *sp; /* start of string matched by it */
|
||||
register sopno ssub; /* start sop of subsubRE */
|
||||
register sopno esub; /* end sop of subsubRE */
|
||||
register char *ssp; /* start of string matched by subsubRE */
|
||||
register char *dp;
|
||||
register unsigned char *ssp; /* start of string matched by subsubRE */
|
||||
register unsigned char *dp;
|
||||
register size_t len;
|
||||
register int hard;
|
||||
register sop s;
|
||||
@@ -446,7 +446,7 @@ sopno lev; /* PLUS nesting level */
|
||||
for (ss = startst; !hard && ss < stopst; ss++)
|
||||
switch (OP(s = m->g->strip[ss])) {
|
||||
case OCHAR:
|
||||
if (sp == stop || *sp++ != (char)OPND(s))
|
||||
if (sp == stop || *sp++ != (unsigned char)OPND(s))
|
||||
return(NULL);
|
||||
break;
|
||||
case OANY:
|
||||
@@ -613,31 +613,31 @@ sopno lev; /* PLUS nesting level */
|
||||
/* "can't happen" */
|
||||
assert(nope);
|
||||
/* NOTREACHED */
|
||||
return((char *)NULL); /* dummy */
|
||||
return((unsigned char *)NULL); /* dummy */
|
||||
}
|
||||
|
||||
/*
|
||||
- fast - step through the string at top speed
|
||||
== static char *fast(register struct match *m, char *start, \
|
||||
== char *stop, sopno startst, sopno stopst);
|
||||
== static unsigned char *fast(register struct match *m, unsigned char *start, \
|
||||
== unsigned char *stop, sopno startst, sopno stopst);
|
||||
*/
|
||||
static char * /* where tentative match ended, or NULL */
|
||||
static unsigned char * /* where tentative match ended, or NULL */
|
||||
fast(m, start, stop, startst, stopst)
|
||||
register struct match *m;
|
||||
char *start;
|
||||
char *stop;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
{
|
||||
register states st = m->st;
|
||||
register states fresh = m->fresh;
|
||||
register states tmp = m->tmp;
|
||||
register char *p = start;
|
||||
register unsigned char *p = start;
|
||||
register int c = (start == m->beginp) ? OUT : *(start-1);
|
||||
register int lastc; /* previous c */
|
||||
register int flagch;
|
||||
register int i;
|
||||
register char *coldp; /* last p after which no match was underway */
|
||||
register unsigned char *coldp; /* last p after which no match was underway */
|
||||
|
||||
CLEAR(st);
|
||||
SET1(st, startst);
|
||||
@@ -709,26 +709,26 @@ sopno stopst;
|
||||
|
||||
/*
|
||||
- slow - step through the string more deliberately
|
||||
== static char *slow(register struct match *m, char *start, \
|
||||
== char *stop, sopno startst, sopno stopst);
|
||||
== static unsigned char *slow(register struct match *m, unsigned char *start, \
|
||||
== unsigned char *stop, sopno startst, sopno stopst);
|
||||
*/
|
||||
static char * /* where it ended */
|
||||
static unsigned char * /* where it ended */
|
||||
slow(m, start, stop, startst, stopst)
|
||||
register struct match *m;
|
||||
char *start;
|
||||
char *stop;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
{
|
||||
register states st = m->st;
|
||||
register states empty = m->empty;
|
||||
register states tmp = m->tmp;
|
||||
register char *p = start;
|
||||
register unsigned char *p = start;
|
||||
register int c = (start == m->beginp) ? OUT : *(start-1);
|
||||
register int lastc; /* previous c */
|
||||
register int flagch;
|
||||
register int i;
|
||||
register char *matchp; /* last p at which a match ended */
|
||||
register unsigned char *matchp; /* last p at which a match ended */
|
||||
|
||||
AT("slow", start, stop, startst, stopst);
|
||||
CLEAR(st);
|
||||
@@ -805,8 +805,8 @@ sopno stopst;
|
||||
== #define BOW (BOL+4)
|
||||
== #define EOW (BOL+5)
|
||||
== #define CODEMAX (BOL+5) // highest code used
|
||||
== #define NONCHAR(c) ((c) > CHAR_MAX)
|
||||
== #define NNONCHAR (CODEMAX-CHAR_MAX)
|
||||
== #define NONCHAR(c) ((c) > UCHAR_MAX)
|
||||
== #define NNONCHAR (CODEMAX-UCHAR_MAX)
|
||||
*/
|
||||
static states
|
||||
step(g, start, stop, bef, ch, aft)
|
||||
@@ -832,8 +832,8 @@ register states aft; /* states already known reachable after */
|
||||
break;
|
||||
case OCHAR:
|
||||
/* only characters can match */
|
||||
assert(!NONCHAR(ch) || ch != (char)OPND(s));
|
||||
if (ch == (char)OPND(s))
|
||||
assert(!NONCHAR(ch) || ch != (unsigned char)OPND(s));
|
||||
if (ch == (unsigned char)OPND(s))
|
||||
FWD(aft, bef, 1);
|
||||
break;
|
||||
case OBOL:
|
||||
@@ -926,14 +926,14 @@ register states aft; /* states already known reachable after */
|
||||
/*
|
||||
- print - print a set of states
|
||||
== #ifdef REDEBUG
|
||||
== static void print(struct match *m, char *caption, states st, \
|
||||
== static void print(struct match *m, unsigned char *caption, states st, \
|
||||
== int ch, FILE *d);
|
||||
== #endif
|
||||
*/
|
||||
static void
|
||||
print(m, caption, st, ch, d)
|
||||
struct match *m;
|
||||
char *caption;
|
||||
unsigned char *caption;
|
||||
states st;
|
||||
int ch;
|
||||
FILE *d;
|
||||
@@ -959,16 +959,16 @@ FILE *d;
|
||||
/*
|
||||
- at - print current situation
|
||||
== #ifdef REDEBUG
|
||||
== static void at(struct match *m, char *title, char *start, char *stop, \
|
||||
== static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, \
|
||||
== sopno startst, sopno stopst);
|
||||
== #endif
|
||||
*/
|
||||
static void
|
||||
at(m, title, start, stop, startst, stopst)
|
||||
struct match *m;
|
||||
char *title;
|
||||
char *start;
|
||||
char *stop;
|
||||
unsigned char *title;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
{
|
||||
@@ -985,7 +985,7 @@ sopno stopst;
|
||||
/*
|
||||
- pchar - make a character printable
|
||||
== #ifdef REDEBUG
|
||||
== static char *pchar(int ch);
|
||||
== static unsigned char *pchar(int ch);
|
||||
== #endif
|
||||
*
|
||||
* Is this identical to regchar() over in debug.c? Well, yes. But a
|
||||
@@ -993,11 +993,11 @@ sopno stopst;
|
||||
* a matching debug.o, and this is convenient. It all disappears in
|
||||
* the non-debug compilation anyway, so it doesn't matter much.
|
||||
*/
|
||||
static char * /* -> representation */
|
||||
static unsigned char * /* -> representation */
|
||||
pchar(ch)
|
||||
int ch;
|
||||
{
|
||||
static char pbuf[10];
|
||||
static unsigned char pbuf[10];
|
||||
|
||||
if (isprint(ch) || ch == ' ')
|
||||
sprintf(pbuf, "%c", ch);
|
||||
|
||||
+10
-10
@@ -4,11 +4,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* === engine.c === */
|
||||
static int matcher(register struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
static char *dissect(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static char *backref(register struct match *m, char *start, char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
static char *fast(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static char *slow(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static int matcher(register struct re_guts *g, unsigned char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
static unsigned char *dissect(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static unsigned char *backref(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
static unsigned char *fast(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static unsigned char *slow(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft);
|
||||
#define BOL (OUT+1)
|
||||
#define EOL (BOL+1)
|
||||
@@ -17,16 +17,16 @@ static states step(register struct re_guts *g, sopno start, sopno stop, register
|
||||
#define BOW (BOL+4)
|
||||
#define EOW (BOL+5)
|
||||
#define CODEMAX (BOL+5) /* highest code used */
|
||||
#define NONCHAR(c) ((c) > CHAR_MAX)
|
||||
#define NNONCHAR (CODEMAX-CHAR_MAX)
|
||||
#define NONCHAR(c) ((c) > UCHAR_MAX)
|
||||
#define NNONCHAR (CODEMAX-UCHAR_MAX)
|
||||
#ifdef REDEBUG
|
||||
static void print(struct match *m, char *caption, states st, int ch, FILE *d);
|
||||
static void print(struct match *m, unsigned char *caption, states st, int ch, FILE *d);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static void at(struct match *m, char *title, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static char *pchar(int ch);
|
||||
static unsigned char *pchar(int ch);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+45
-45
@@ -19,8 +19,8 @@
|
||||
* other clumsinesses
|
||||
*/
|
||||
struct parse {
|
||||
char *next; /* next character in RE */
|
||||
char *end; /* end of string (-> NUL normally) */
|
||||
unsigned char *next; /* next character in RE */
|
||||
unsigned char *end; /* end of string (-> NUL normally) */
|
||||
int error; /* has an error been seen? */
|
||||
sop *strip; /* malloced strip */
|
||||
sopno ssize; /* malloced strip size (allocated) */
|
||||
@@ -34,7 +34,7 @@ struct parse {
|
||||
|
||||
#include "regcomp.ih"
|
||||
|
||||
static char nuls[10]; /* place to point scanner in event of error */
|
||||
static unsigned char nuls[10]; /* place to point scanner in event of error */
|
||||
|
||||
/*
|
||||
* macros for use with parse structure
|
||||
@@ -127,7 +127,7 @@ int cflags;
|
||||
|
||||
/* set things up */
|
||||
p->g = g;
|
||||
p->next = (char *)pattern; /* convenience; we do not modify it */
|
||||
p->next = (unsigned char *)pattern; /* convenience; we do not modify it */
|
||||
p->end = p->next + len;
|
||||
p->error = 0;
|
||||
p->ncsalloc = 0;
|
||||
@@ -147,7 +147,7 @@ int cflags;
|
||||
g->mlen = 0;
|
||||
g->nsub = 0;
|
||||
g->ncategories = 1; /* category 0 is "everything else" */
|
||||
g->categories = &g->catspace[-(CHAR_MIN)];
|
||||
g->categories = &g->catspace[0];
|
||||
(void) memset((char *)g->catspace, 0, NC*sizeof(cat_t));
|
||||
g->backrefs = 0;
|
||||
|
||||
@@ -193,7 +193,7 @@ p_ere(p, stop)
|
||||
register struct parse *p;
|
||||
int stop; /* character this ERE should end at */
|
||||
{
|
||||
register char c;
|
||||
register unsigned char c;
|
||||
register sopno prevback = 0;
|
||||
register sopno prevfwd = 0;
|
||||
register sopno conc;
|
||||
@@ -238,7 +238,7 @@ static void
|
||||
p_ere_exp(p)
|
||||
register struct parse *p;
|
||||
{
|
||||
register char c;
|
||||
register unsigned char c;
|
||||
register sopno pos;
|
||||
register int count;
|
||||
register int count2;
|
||||
@@ -518,7 +518,7 @@ int starordinary; /* is a leading * an ordinary character? */
|
||||
REQUIRE(starordinary, REG_BADRPT);
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
ordinary(p, (char)c); /* takes off BACKSL, if any */
|
||||
ordinary(p, (unsigned char)c); /* takes off BACKSL, if any */
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -657,8 +657,8 @@ p_b_term(p, cs)
|
||||
register struct parse *p;
|
||||
register cset *cs;
|
||||
{
|
||||
register char c;
|
||||
register char start, finish;
|
||||
register unsigned char c;
|
||||
register unsigned char start, finish;
|
||||
register int i;
|
||||
|
||||
/* classify what we've got */
|
||||
@@ -723,11 +723,11 @@ p_b_cclass(p, cs)
|
||||
register struct parse *p;
|
||||
register cset *cs;
|
||||
{
|
||||
register char *sp = p->next;
|
||||
register unsigned char *sp = p->next;
|
||||
register struct cclass *cp;
|
||||
register size_t len;
|
||||
register char *u;
|
||||
register char c;
|
||||
register unsigned char *u;
|
||||
register unsigned char c;
|
||||
|
||||
while (MORE() && isalpha(PEEK()))
|
||||
NEXT();
|
||||
@@ -759,7 +759,7 @@ p_b_eclass(p, cs)
|
||||
register struct parse *p;
|
||||
register cset *cs;
|
||||
{
|
||||
register char c;
|
||||
register unsigned char c;
|
||||
|
||||
c = p_b_coll_elem(p, '=');
|
||||
CHadd(cs, c);
|
||||
@@ -769,11 +769,11 @@ register cset *cs;
|
||||
- p_b_symbol - parse a character or [..]ed multicharacter collating symbol
|
||||
== static char p_b_symbol(register struct parse *p);
|
||||
*/
|
||||
static char /* value of symbol */
|
||||
static unsigned char /* value of symbol */
|
||||
p_b_symbol(p)
|
||||
register struct parse *p;
|
||||
{
|
||||
register char value;
|
||||
register unsigned char value;
|
||||
|
||||
REQUIRE(MORE(), REG_EBRACK);
|
||||
if (!EATTWO('[', '.'))
|
||||
@@ -789,12 +789,12 @@ register struct parse *p;
|
||||
- p_b_coll_elem - parse a collating-element name and look it up
|
||||
== static char p_b_coll_elem(register struct parse *p, int endc);
|
||||
*/
|
||||
static char /* value of collating element */
|
||||
static unsigned char /* value of collating element */
|
||||
p_b_coll_elem(p, endc)
|
||||
register struct parse *p;
|
||||
int endc; /* name ended by endc,']' */
|
||||
{
|
||||
register char *sp = p->next;
|
||||
register unsigned char *sp = p->next;
|
||||
register struct cname *cp;
|
||||
register int len;
|
||||
|
||||
@@ -818,7 +818,7 @@ int endc; /* name ended by endc,']' */
|
||||
- othercase - return the case counterpart of an alphabetic
|
||||
== static char othercase(int ch);
|
||||
*/
|
||||
static char /* if no counterpart, return ch */
|
||||
static unsigned char /* if no counterpart, return ch */
|
||||
othercase(ch)
|
||||
int ch;
|
||||
{
|
||||
@@ -842,9 +842,9 @@ bothcases(p, ch)
|
||||
register struct parse *p;
|
||||
int ch;
|
||||
{
|
||||
register char *oldnext = p->next;
|
||||
register char *oldend = p->end;
|
||||
char bracket[3];
|
||||
register unsigned char *oldnext = p->next;
|
||||
register unsigned char *oldend = p->end;
|
||||
unsigned char bracket[3];
|
||||
|
||||
assert(othercase(ch) != ch); /* p_bracket() would recurse */
|
||||
p->next = bracket;
|
||||
@@ -888,9 +888,9 @@ static void
|
||||
nonnewline(p)
|
||||
register struct parse *p;
|
||||
{
|
||||
register char *oldnext = p->next;
|
||||
register char *oldend = p->end;
|
||||
char bracket[4];
|
||||
register unsigned char *oldnext = p->next;
|
||||
register unsigned char *oldend = p->end;
|
||||
unsigned char bracket[4];
|
||||
|
||||
p->next = bracket;
|
||||
p->end = bracket+3;
|
||||
@@ -1015,19 +1015,19 @@ register struct parse *p;
|
||||
if (p->g->sets == NULL)
|
||||
p->g->sets = (cset *)malloc(nc * sizeof(cset));
|
||||
else
|
||||
p->g->sets = (cset *)realloc((char *)p->g->sets,
|
||||
p->g->sets = (cset *)realloc((unsigned char *)p->g->sets,
|
||||
nc * sizeof(cset));
|
||||
if (p->g->setbits == NULL)
|
||||
p->g->setbits = (uch *)malloc(nbytes);
|
||||
else {
|
||||
p->g->setbits = (uch *)realloc((char *)p->g->setbits,
|
||||
p->g->setbits = (uch *)realloc((unsigned char *)p->g->setbits,
|
||||
nbytes);
|
||||
/* xxx this isn't right if setbits is now NULL */
|
||||
for (i = 0; i < no; i++)
|
||||
p->g->sets[i].ptr = p->g->setbits + css*(i/CHAR_BIT);
|
||||
}
|
||||
if (p->g->sets != NULL && p->g->setbits != NULL)
|
||||
(void) memset((char *)p->g->setbits + (nbytes - css),
|
||||
(void) memset((unsigned char *)p->g->setbits + (nbytes - css),
|
||||
0, css);
|
||||
else {
|
||||
no = 0;
|
||||
@@ -1120,7 +1120,7 @@ register cset *cs;
|
||||
|
||||
for (i = 0; i < css; i++)
|
||||
if (CHIN(cs, i))
|
||||
return((char)i);
|
||||
return((unsigned char)i);
|
||||
assert(never);
|
||||
return(0); /* arbitrary */
|
||||
}
|
||||
@@ -1153,7 +1153,7 @@ static void
|
||||
mcadd(p, cs, cp)
|
||||
register struct parse *p;
|
||||
register cset *cs;
|
||||
register char *cp;
|
||||
register unsigned char *cp;
|
||||
{
|
||||
register size_t oldend = cs->smultis;
|
||||
|
||||
@@ -1174,14 +1174,14 @@ register char *cp;
|
||||
#if 0
|
||||
/*
|
||||
- mcsub - subtract a collating element from a cset
|
||||
== static void mcsub(register cset *cs, register char *cp);
|
||||
== static void mcsub(register cset *cs, register unsigned char *cp);
|
||||
*/
|
||||
static void
|
||||
mcsub(cs, cp)
|
||||
register cset *cs;
|
||||
register char *cp;
|
||||
register unsigned cset *cs;
|
||||
register unsigned char *cp;
|
||||
{
|
||||
register char *fp = mcfind(cs, cp);
|
||||
register unsigned char *fp = mcfind(cs, cp);
|
||||
register size_t len = strlen(fp);
|
||||
|
||||
assert(fp != NULL);
|
||||
@@ -1201,12 +1201,12 @@ register char *cp;
|
||||
|
||||
/*
|
||||
- mcin - is a collating element in a cset?
|
||||
== static int mcin(register cset *cs, register char *cp);
|
||||
== static int mcin(register cset *cs, register unsigned char *cp);
|
||||
*/
|
||||
static int
|
||||
mcin(cs, cp)
|
||||
register cset *cs;
|
||||
register char *cp;
|
||||
register unsigned char *cp;
|
||||
{
|
||||
return(mcfind(cs, cp) != NULL);
|
||||
}
|
||||
@@ -1214,14 +1214,14 @@ register char *cp;
|
||||
|
||||
/*
|
||||
- mcfind - find a collating element in a cset
|
||||
== static char *mcfind(register cset *cs, register char *cp);
|
||||
== static unsigned char *mcfind(register cset *cs, register unsigned char *cp);
|
||||
*/
|
||||
static char *
|
||||
static unsigned char *
|
||||
mcfind(cs, cp)
|
||||
register cset *cs;
|
||||
register char *cp;
|
||||
register unsigned char *cp;
|
||||
{
|
||||
register char *p;
|
||||
register unsigned char *p;
|
||||
|
||||
if (cs->multis == NULL)
|
||||
return(NULL);
|
||||
@@ -1322,11 +1322,11 @@ register struct re_guts *g;
|
||||
if (p->error != 0)
|
||||
return;
|
||||
|
||||
for (c = CHAR_MIN; c <= CHAR_MAX; c++)
|
||||
for (c = 0; c <= UCHAR_MAX; c++)
|
||||
if (cats[c] == 0 && isinsets(g, c)) {
|
||||
cat = g->ncategories++;
|
||||
cats[c] = cat;
|
||||
for (c2 = c+1; c2 <= CHAR_MAX; c2++)
|
||||
for (c2 = c+1; c2 <= UCHAR_MAX; c2++)
|
||||
if (cats[c2] == 0 && samesets(g, c, c2))
|
||||
cats[c2] = cat;
|
||||
}
|
||||
@@ -1477,7 +1477,7 @@ register struct parse *p;
|
||||
register struct re_guts *g;
|
||||
{
|
||||
g->nstates = p->slen;
|
||||
g->strip = (sop *)realloc((char *)p->strip, p->slen * sizeof(sop));
|
||||
g->strip = (sop *)realloc((unsigned char *)p->strip, p->slen * sizeof(sop));
|
||||
if (g->strip == NULL) {
|
||||
SETERROR(REG_ESPACE);
|
||||
g->strip = p->strip;
|
||||
@@ -1504,7 +1504,7 @@ register struct re_guts *g;
|
||||
register sop *newstart = NULL;
|
||||
register sopno newlen;
|
||||
register sop s;
|
||||
register char *cp;
|
||||
register unsigned char *cp;
|
||||
register sopno i;
|
||||
|
||||
/* avoid making error situations worse */
|
||||
@@ -1565,7 +1565,7 @@ register struct re_guts *g;
|
||||
while (OP(s = *scan++) != OCHAR)
|
||||
continue;
|
||||
assert(cp < g->must + g->mlen);
|
||||
*cp++ = (char)OPND(s);
|
||||
*cp++ = (unsigned char)OPND(s);
|
||||
}
|
||||
assert(cp == g->must + g->mlen);
|
||||
*cp++ = '\0'; /* just on general principles */
|
||||
|
||||
@@ -14,9 +14,9 @@ static void p_bracket(register struct parse *p);
|
||||
static void p_b_term(register struct parse *p, register cset *cs);
|
||||
static void p_b_cclass(register struct parse *p, register cset *cs);
|
||||
static void p_b_eclass(register struct parse *p, register cset *cs);
|
||||
static char p_b_symbol(register struct parse *p);
|
||||
static char p_b_coll_elem(register struct parse *p, int endc);
|
||||
static char othercase(int ch);
|
||||
static unsigned char p_b_symbol(register struct parse *p);
|
||||
static unsigned char p_b_coll_elem(register struct parse *p, int endc);
|
||||
static unsigned char othercase(int ch);
|
||||
static void bothcases(register struct parse *p, int ch);
|
||||
static void ordinary(register struct parse *p, register int ch);
|
||||
static void nonnewline(register struct parse *p);
|
||||
@@ -27,11 +27,11 @@ static void freeset(register struct parse *p, register cset *cs);
|
||||
static int freezeset(register struct parse *p, register cset *cs);
|
||||
static int firstch(register struct parse *p, register cset *cs);
|
||||
static int nch(register struct parse *p, register cset *cs);
|
||||
static void mcadd(register struct parse *p, register cset *cs, register char *cp);
|
||||
static void mcadd(register struct parse *p, register cset *cs, register unsigned char *cp);
|
||||
#if 0
|
||||
static void mcsub(register cset *cs, register char *cp);
|
||||
static int mcin(register cset *cs, register char *cp);
|
||||
static char *mcfind(register cset *cs, register char *cp);
|
||||
static void mcsub(register cset *cs, register unsigned char *cp);
|
||||
static int mcin(register cset *cs, register unsigned char *cp);
|
||||
static unsigned char *mcfind(register cset *cs, register unsigned char *cp);
|
||||
#endif
|
||||
static void mcinvert(register struct parse *p, register cset *cs);
|
||||
static void mccase(register struct parse *p, register cset *cs);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
= typedef struct {
|
||||
= int re_magic;
|
||||
= size_t re_nsub; // number of parenthesized subexpressions
|
||||
= const char *re_endp; // end pointer for REG_PEND
|
||||
= const unsigned char *re_endp; // end pointer for REG_PEND
|
||||
= struct re_guts *re_g; // none of your business :-)
|
||||
= } regex_t;
|
||||
= typedef struct {
|
||||
@@ -90,7 +90,7 @@ typedef struct {
|
||||
uch mask; /* bit within array */
|
||||
uch hash; /* hash code */
|
||||
size_t smultis;
|
||||
char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */
|
||||
unsigned char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */
|
||||
} cset;
|
||||
/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */
|
||||
#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c))
|
||||
@@ -125,8 +125,8 @@ struct re_guts {
|
||||
int nbol; /* number of ^ used */
|
||||
int neol; /* number of $ used */
|
||||
int ncategories; /* how many character categories */
|
||||
cat_t *categories; /* ->catspace[-CHAR_MIN] */
|
||||
char *must; /* match must contain this string */
|
||||
cat_t *categories; /* ->catspace[-UCHAR_MIN] */
|
||||
unsigned char *must; /* match must contain this string */
|
||||
int mlen; /* length of must */
|
||||
size_t nsub; /* copy of re_nsub */
|
||||
int backrefs; /* does it use back references? */
|
||||
@@ -136,5 +136,5 @@ struct re_guts {
|
||||
};
|
||||
|
||||
/* misc utilities */
|
||||
#define OUT (CHAR_MAX+1) /* a non-character value */
|
||||
#define OUT (UCHAR_MAX+1) /* a non-character value */
|
||||
#define ISWORD(c) (isalnum(c) || (c) == '_')
|
||||
@@ -67,14 +67,14 @@ static int nope = 0; /* for use in asserts; shuts lint up */
|
||||
#undef SNAMES
|
||||
|
||||
/* macros for manipulating states, large version */
|
||||
#define states char *
|
||||
#define states unsigned char *
|
||||
#define CLEAR(v) memset(v, 0, m->g->nstates)
|
||||
#define SET0(v, n) ((v)[n] = 0)
|
||||
#define SET1(v, n) ((v)[n] = 1)
|
||||
#define ISSET(v, n) ((v)[n])
|
||||
#define ASSIGN(d, s) memcpy(d, s, m->g->nstates)
|
||||
#define EQ(a, b) (memcmp(a, b, m->g->nstates) == 0)
|
||||
#define STATEVARS int vn; char *space
|
||||
#define STATEVARS int vn; unsigned char *space
|
||||
#define STATESETUP(m, nv) { (m)->space = malloc((nv)*(m)->g->nstates); \
|
||||
if ((m)->space == NULL) return(REG_ESPACE); \
|
||||
(m)->vn = 0; }
|
||||
@@ -132,7 +132,7 @@ int eflags;
|
||||
eflags = GOODFLAGS(eflags);
|
||||
|
||||
if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags®_LARGE))
|
||||
return(smatcher(g, (char *)string, nmatch, pmatch, eflags));
|
||||
return(smatcher(g, (unsigned char *)string, nmatch, pmatch, eflags));
|
||||
else
|
||||
return(lmatcher(g, (char *)string, nmatch, pmatch, eflags));
|
||||
return(lmatcher(g, (unsigned char *)string, nmatch, pmatch, eflags));
|
||||
}
|
||||
+10
-8
@@ -134,7 +134,7 @@ ZEND_DECLARE_MODULE_GLOBALS(exif)
|
||||
/* {{{ PHP_INI
|
||||
*/
|
||||
|
||||
ZEND_API ZEND_INI_MH(OnUpdateEncode)
|
||||
ZEND_INI_MH(OnUpdateEncode)
|
||||
{
|
||||
#if EXIF_USE_MBSTRING
|
||||
if (new_value && strlen(new_value) && !php_mb_check_encoding_list(new_value TSRMLS_CC)) {
|
||||
@@ -145,7 +145,7 @@ ZEND_API ZEND_INI_MH(OnUpdateEncode)
|
||||
return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_API ZEND_INI_MH(OnUpdateDecode)
|
||||
ZEND_INI_MH(OnUpdateDecode)
|
||||
{
|
||||
#if EXIF_USE_MBSTRING
|
||||
if (!php_mb_check_encoding_list(new_value TSRMLS_CC)) {
|
||||
@@ -243,10 +243,10 @@ static const char * EXIF_ERROR_CORRUPT = "File structure corrupted";
|
||||
static const char * EXIF_ERROR_THUMBEOF = "Thumbnail goes IFD boundary or end of file reached";
|
||||
static const char * EXIF_ERROR_FSREALLOC = "Illegal reallocating of undefined file section";
|
||||
|
||||
#define EXIF_ERRLOG_FILEEOF php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_FILEEOF);
|
||||
#define EXIF_ERRLOG_CORRUPT php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_CORRUPT);
|
||||
#define EXIF_ERRLOG_THUMBEOF php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_THUMBEOF);
|
||||
#define EXIF_ERRLOG_FSREALLOC php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_FSREALLOC);
|
||||
#define EXIF_ERRLOG_FILEEOF php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", EXIF_ERROR_FILEEOF);
|
||||
#define EXIF_ERRLOG_CORRUPT php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", EXIF_ERROR_CORRUPT);
|
||||
#define EXIF_ERRLOG_THUMBEOF php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", EXIF_ERROR_THUMBEOF);
|
||||
#define EXIF_ERRLOG_FSREALLOC php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", EXIF_ERROR_FSREALLOC);
|
||||
/* }}} */
|
||||
|
||||
/* {{{ format description defines
|
||||
@@ -3791,15 +3791,17 @@ PHP_FUNCTION(exif_read_data)
|
||||
exif_error_docref(NULL TSRMLS_CC, &ImageInfo, E_NOTICE, "sections found: %s", sections_str[0] ? sections_str : "None");
|
||||
#endif
|
||||
|
||||
ImageInfo.sections_found |= FOUND_COMPUTED;/* do not inform about in debug*/
|
||||
ImageInfo.sections_found |= FOUND_COMPUTED|FOUND_FILE;/* do not inform about in debug*/
|
||||
|
||||
if (ret==FALSE || (sections_needed && !(sections_needed&ImageInfo.sections_found)) || array_init(return_value) == FAILURE) {
|
||||
if (ret==FALSE || (sections_needed && !(sections_needed&ImageInfo.sections_found))) {
|
||||
/* array_init must be checked at last! otherwise the array must be freed if a later test fails. */
|
||||
exif_discard_imageinfo(&ImageInfo);
|
||||
EFREE_IF(sections_str);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL TSRMLS_CC, &ImageInfo, E_NOTICE, "generate section FILE");
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /D "LIBZEND_EXPORTS" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
@@ -71,7 +71,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /D "LIBZEND_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ if test "\$PHP_$EXTNAME" != "no"; then
|
||||
dnl # --with-$extname -> add include path
|
||||
dnl PHP_ADD_INCLUDE(\$${EXTNAME}_DIR/include)
|
||||
|
||||
dnl # --with-$extname -> chech for lib and symbol presence
|
||||
dnl # --with-$extname -> check for lib and symbol presence
|
||||
dnl LIBNAME=$extname # you may want to change this
|
||||
dnl LIBSYMBOL=$extname # you most likely want to change this
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ if (php_sapi_name() != "cli") {
|
||||
1) Make sure you have CygWin installed
|
||||
2) Adjust the $cygwin_path to match your installation
|
||||
3) Change the environment cariable PATHEXT to include .PHP
|
||||
4) run ext_skel --ext_name=...
|
||||
4) run ext_skel --extname=...
|
||||
the first time you run this script you will be asked to
|
||||
associate it with a program. chooses the CLI version of php.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ if test "$PHP_FBSQL" != "no"; then
|
||||
FBSQL_INSTALLATION_DIR=""
|
||||
if test "$PHP_FBSQL" = "yes"; then
|
||||
|
||||
for i in /Local/Library /usr /usr/local /opt /Library /usr/lib; do
|
||||
for i in /Local/Library /usr/local /usr /opt /Library /usr/lib; do
|
||||
if test -f $i/FrontBase/include/FBCAccess/FBCAccess.h; then
|
||||
FBSQL_INSTALLATION_DIR=$i/FrontBase
|
||||
break
|
||||
|
||||
+2
-2
@@ -107,7 +107,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php4ts_debug.lib FBCAccess.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Debug_TS/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"\usr\FrontBase\lib"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib php4ts_debug.lib FBCAccess.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Debug_TS/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"\usr\FrontBase\lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "fbsql - Win32 Release_TS"
|
||||
|
||||
@@ -133,7 +133,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib FBCAccess.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Release_TS/php_fbsql.dll" /libpath:"..\..\Release_TS" /libpath:"\usr\FrontBase\lib" /libpath:"..\..\Release_TS_inline"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib FBCAccess.lib ws2_32.lib /nologo /dll /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Release_TS/php_fbsql.dll" /libpath:"..\..\Release_TS" /libpath:"\usr\FrontBase\lib" /libpath:"..\..\Release_TS_inline"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
+13
-9
@@ -358,9 +358,9 @@ static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link)
|
||||
/* {{{ PHP_INI
|
||||
*/
|
||||
PHP_INI_BEGIN()
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateInt, allowPersistent, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.generate_warnings", "0", PHP_INI_SYSTEM, OnUpdateInt, generateWarnings, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.autocommit", "1", PHP_INI_SYSTEM, OnUpdateInt, autoCommit, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allowPersistent, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.generate_warnings", "0", PHP_INI_SYSTEM, OnUpdateBool, generateWarnings, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.autocommit", "1", PHP_INI_SYSTEM, OnUpdateBool, autoCommit, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_ENTRY_EX ("fbsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateInt, maxPersistent, zend_fbsql_globals, fbsql_globals, display_link_numbers)
|
||||
STD_PHP_INI_ENTRY_EX ("fbsql.max_links", "128", PHP_INI_SYSTEM, OnUpdateInt, maxLinks, zend_fbsql_globals, fbsql_globals, display_link_numbers)
|
||||
STD_PHP_INI_ENTRY_EX ("fbsql.max_connections", "128", PHP_INI_SYSTEM, OnUpdateInt, maxConnections, zend_fbsql_globals, fbsql_globals, display_link_numbers)
|
||||
@@ -2278,7 +2278,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
#ifdef FB_TinyInteger
|
||||
case FB_TinyInteger:
|
||||
{
|
||||
short int v = *((short int*)data);
|
||||
short int v = *((FBTinyInteger*)data);
|
||||
char b[128];
|
||||
sprintf(b, "%d", v);
|
||||
phpfbestrdup(b, length, value);
|
||||
@@ -2706,7 +2706,7 @@ PHP_FUNCTION(fbsql_num_fields)
|
||||
Fetch a row of data. Returns an indexed array */
|
||||
PHP_FUNCTION(fbsql_fetch_row)
|
||||
{
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_NUM);
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_NUM, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2714,7 +2714,7 @@ PHP_FUNCTION(fbsql_fetch_row)
|
||||
Detch a row of data. Returns an assoc array */
|
||||
PHP_FUNCTION(fbsql_fetch_assoc)
|
||||
{
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC);
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2722,7 +2722,7 @@ PHP_FUNCTION(fbsql_fetch_assoc)
|
||||
Fetch a row of data. Returns an object */
|
||||
PHP_FUNCTION(fbsql_fetch_object)
|
||||
{
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC);
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 2);
|
||||
if (Z_TYPE_P(return_value)==IS_ARRAY) {
|
||||
object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value));
|
||||
}
|
||||
@@ -2733,7 +2733,7 @@ PHP_FUNCTION(fbsql_fetch_object)
|
||||
Fetches a result row as an array (associative, numeric or both)*/
|
||||
PHP_FUNCTION(fbsql_fetch_array)
|
||||
{
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_BOTH);
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_BOTH, 2);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2781,7 +2781,7 @@ static void _parse_list(zval** return_value, FBCPList* list)
|
||||
}
|
||||
}
|
||||
|
||||
static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
|
||||
static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args)
|
||||
{
|
||||
|
||||
PHPFBResult* result = NULL;
|
||||
@@ -2790,6 +2790,10 @@ static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
|
||||
int i;
|
||||
void **row;
|
||||
|
||||
if (ZEND_NUM_ARGS() > expected_args) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
switch (ZEND_NUM_ARGS()) {
|
||||
case 1:
|
||||
if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) {
|
||||
|
||||
@@ -101,7 +101,7 @@ PHP_FUNCTION(fbsql_warnings);
|
||||
PHP_FUNCTION(fbsql_get_autostart_info);
|
||||
/* PHP_FUNCTION(fbsql_set_autostart_info); */
|
||||
|
||||
static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type);
|
||||
static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args);
|
||||
static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent);
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(fbsql)
|
||||
|
||||
+7
-7
@@ -8,22 +8,22 @@ PHP_ARG_WITH(fdftk, for FDF support,
|
||||
if test "$PHP_FDFTK" != "no"; then
|
||||
|
||||
case $host_os in
|
||||
aix*)
|
||||
aix*[)]
|
||||
libtype=aix
|
||||
;;
|
||||
solaris* )
|
||||
solaris*[)]
|
||||
libtype=solaris
|
||||
;;
|
||||
linux*)
|
||||
linux*[)]
|
||||
libtype=linux
|
||||
;;
|
||||
*)
|
||||
*[)]
|
||||
AC_MSG_ERROR([The fdf toolkit is not available for $host_os.])
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$PHP_FDFTK" = "yes"; then
|
||||
PHP_FDFTK="/usr /usr/local ../FDFToolkitForUNIX ext/fdf/FDFToolkitForUNIX ../fdftk ext/fdf/fdftk"
|
||||
PHP_FDFTK="/usr/local /usr ../FDFToolkitForUNIX ext/fdf/FDFToolkitForUNIX ../fdftk ext/fdf/fdftk"
|
||||
fi
|
||||
|
||||
for dir in $PHP_FDFTK; do
|
||||
@@ -65,9 +65,9 @@ if test "$PHP_FDFTK" != "no"; then
|
||||
AC_MSG_ERROR(no usable fdf library found)
|
||||
fi
|
||||
|
||||
PHP_ADD_LIBRARY_WITH_PATH($FDFLIBRARY, $FDFTK_LIB_DIR, FDFTK_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH($FDFLIBRARY, $FDFTK_LIB_DIR, FDF_SHARED_LIBADD)
|
||||
|
||||
PHP_NEW_EXTENSION(fdf, fdf.c, $ext_shared)
|
||||
PHP_SUBST(FDFTK_SHARED_LIBADD)
|
||||
PHP_SUBST(FDF_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_FDFLIB,1,[ ])
|
||||
fi
|
||||
+5
-2
@@ -39,6 +39,10 @@
|
||||
#include "php_variables.h"
|
||||
#include "php_fdf.h"
|
||||
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR)
|
||||
#endif
|
||||
|
||||
static int le_fdf;
|
||||
|
||||
SAPI_POST_HANDLER_FUNC(fdf_post_handler);
|
||||
@@ -378,13 +382,12 @@ PHP_FUNCTION(fdf_get_value)
|
||||
}
|
||||
which++;
|
||||
} while (err == FDFErcOK);
|
||||
if(err == FDFErcNoValue) err = FDFErcOK;
|
||||
efree(buffer);
|
||||
buffer = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
if(err != FDFErcOK) {
|
||||
if ((err != FDFErcOK) && (err != FDFErcNoValue)) {
|
||||
if(buffer) efree(buffer);
|
||||
FDF_FAILURE(err);
|
||||
}
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /D "HAVE_FDFTK_5" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
@@ -72,7 +72,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /D "HAVE_FDFTK_5" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
|
||||
@@ -2,8 +2,6 @@ dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
AC_ARG_WITH(filepro,[],[enable_filepro=$withval])
|
||||
|
||||
PHP_ARG_ENABLE(filepro,whether to enable the bundled filePro support,
|
||||
[ --enable-filepro Enable the bundled read-only filePro support.])
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ PHP_FUNCTION(filepro_fieldname)
|
||||
}
|
||||
|
||||
php_error(E_WARNING,
|
||||
"%s(): Unable to locate field number %d.", get_active_function_name(TSRMLS_C),
|
||||
"%s(): Unable to locate field number %ld.", get_active_function_name(TSRMLS_C),
|
||||
Z_LVAL_P(fno));
|
||||
|
||||
RETVAL_FALSE;
|
||||
@@ -426,7 +426,7 @@ PHP_FUNCTION(filepro_fieldtype)
|
||||
}
|
||||
}
|
||||
php_error(E_WARNING,
|
||||
"%s(): Unable to locate field number %d.", get_active_function_name(TSRMLS_C),
|
||||
"%s(): Unable to locate field number %ld.", get_active_function_name(TSRMLS_C),
|
||||
Z_LVAL_P(fno));
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
@@ -465,7 +465,7 @@ PHP_FUNCTION(filepro_fieldwidth)
|
||||
}
|
||||
}
|
||||
php_error(E_WARNING,
|
||||
"%s(): Unable to locate field number %d.", get_active_function_name(TSRMLS_C),
|
||||
"%s(): Unable to locate field number %ld.", get_active_function_name(TSRMLS_C),
|
||||
Z_LVAL_P(fno));
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
|
||||
+26
-27
@@ -165,7 +165,7 @@ ftp_close(ftpbuf_t *ftp)
|
||||
if (ftp->data)
|
||||
data_close(ftp, ftp->data);
|
||||
if (ftp->fd != -1) {
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
if (ftp->ssl_active) {
|
||||
SSL_shutdown(ftp->ssl_handle);
|
||||
}
|
||||
@@ -224,13 +224,13 @@ ftp_quit(ftpbuf_t *ftp)
|
||||
int
|
||||
ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
|
||||
{
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
SSL_CTX *ctx = NULL;
|
||||
#endif
|
||||
if (ftp == NULL)
|
||||
return 0;
|
||||
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
if (ftp->use_ssl && !ftp->ssl_active) {
|
||||
if (!ftp_putcmd(ftp, "AUTH", "TLS"))
|
||||
return 0;
|
||||
@@ -421,9 +421,10 @@ ftp_chdir(ftpbuf_t *ftp, const char *dir)
|
||||
{
|
||||
if (ftp == NULL)
|
||||
return 0;
|
||||
if (ftp->pwd)
|
||||
if (ftp->pwd) {
|
||||
efree(ftp->pwd);
|
||||
ftp->pwd = NULL;
|
||||
ftp->pwd = NULL;
|
||||
}
|
||||
|
||||
if (!ftp_putcmd(ftp, "CWD", dir))
|
||||
return 0;
|
||||
@@ -442,9 +443,10 @@ ftp_cdup(ftpbuf_t *ftp)
|
||||
if (ftp == NULL)
|
||||
return 0;
|
||||
|
||||
if (ftp->pwd)
|
||||
if (ftp->pwd) {
|
||||
efree(ftp->pwd);
|
||||
ftp->pwd = NULL;
|
||||
ftp->pwd = NULL;
|
||||
}
|
||||
|
||||
if (!ftp_putcmd(ftp, "CDUP", NULL))
|
||||
return 0;
|
||||
@@ -715,8 +717,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
|
||||
if (type == FTPTYPE_ASCII && lastch == '\r')
|
||||
php_stream_putc(outstream, '\r');
|
||||
|
||||
data = data_close(ftp, data);
|
||||
ftp->data = NULL;
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
|
||||
if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) {
|
||||
goto bail;
|
||||
@@ -724,8 +725,7 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
|
||||
|
||||
return 1;
|
||||
bail:
|
||||
data_close(ftp, data);
|
||||
ftp->data = NULL;
|
||||
ftp->data = data_close(ftp, data);
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -798,14 +798,14 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, i
|
||||
if (size && my_send(ftp, data->fd, data->buf, size) != size)
|
||||
goto bail;
|
||||
|
||||
data = data_close(ftp, data);
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
|
||||
if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250))
|
||||
goto bail;
|
||||
|
||||
return 1;
|
||||
bail:
|
||||
data_close(ftp, data);
|
||||
ftp->data = data_close(ftp, data);
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1089,7 +1089,7 @@ my_send(ftpbuf_t *ftp, int s, void *buf, size_t len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) {
|
||||
sent = SSL_write(ftp->ssl_handle, buf, size);
|
||||
} else
|
||||
@@ -1133,7 +1133,7 @@ my_recv(ftpbuf_t *ftp, int s, void *buf, size_t len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) {
|
||||
nr_bytes = SSL_read(ftp->ssl_handle, buf, len);
|
||||
} else
|
||||
@@ -1354,7 +1354,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp)
|
||||
php_sockaddr_storage addr;
|
||||
socklen_t size;
|
||||
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
SSL_CTX *ctx;
|
||||
TSRMLS_FETCH();
|
||||
#endif
|
||||
@@ -1373,7 +1373,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp)
|
||||
}
|
||||
|
||||
data_accepted:
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
|
||||
/* now enable ssl if we need to */
|
||||
if (ftp->use_ssl && ftp->use_ssl_for_data) {
|
||||
@@ -1420,7 +1420,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
|
||||
if (data == NULL)
|
||||
return NULL;
|
||||
if (data->listener != -1) {
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
if (data->ssl_active) {
|
||||
SSL_shutdown(data->ssl_handle);
|
||||
data->ssl_active = 0;
|
||||
@@ -1429,7 +1429,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
|
||||
closesocket(data->listener);
|
||||
}
|
||||
if (data->fd != -1) {
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
if (data->ssl_active) {
|
||||
SSL_shutdown(data->ssl_handle);
|
||||
data->ssl_active = 0;
|
||||
@@ -1498,7 +1498,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
data = data_close(ftp, data);
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
|
||||
if (ferror(tmpfp))
|
||||
goto bail;
|
||||
@@ -1537,8 +1537,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
|
||||
return ret;
|
||||
bail:
|
||||
if (data)
|
||||
data_close(ftp, data);
|
||||
ftp->data = data_close(ftp, data);
|
||||
fclose(tmpfp);
|
||||
if (ret)
|
||||
efree(ret);
|
||||
@@ -1594,7 +1593,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
|
||||
return (ftp_nb_continue_read(ftp));
|
||||
|
||||
bail:
|
||||
data_close(ftp, data);
|
||||
ftp->data = data_close(ftp, data);
|
||||
return PHP_FTP_FAILED;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1647,7 +1646,7 @@ ftp_nb_continue_read(ftpbuf_t *ftp)
|
||||
if (type == FTPTYPE_ASCII && lastch == '\r')
|
||||
php_stream_putc(ftp->stream, '\r');
|
||||
|
||||
data = data_close(ftp, data);
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
|
||||
if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) {
|
||||
goto bail;
|
||||
@@ -1657,7 +1656,7 @@ ftp_nb_continue_read(ftpbuf_t *ftp)
|
||||
return PHP_FTP_FINISHED;
|
||||
bail:
|
||||
ftp->nb = 0;
|
||||
data_close(ftp, data);
|
||||
ftp->data = data_close(ftp, data);
|
||||
return PHP_FTP_FAILED;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1709,7 +1708,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
|
||||
return (ftp_nb_continue_write(ftp));
|
||||
|
||||
bail:
|
||||
data_close(ftp, data);
|
||||
ftp->data = data_close(ftp, data);
|
||||
return PHP_FTP_FAILED;
|
||||
|
||||
}
|
||||
@@ -1764,7 +1763,7 @@ ftp_nb_continue_write(ftpbuf_t *ftp)
|
||||
ftp->nb = 0;
|
||||
return PHP_FTP_FINISHED;
|
||||
bail:
|
||||
data_close(ftp, ftp->data);
|
||||
ftp->data = data_close(ftp, ftp->data);
|
||||
ftp->nb = 0;
|
||||
return PHP_FTP_FAILED;
|
||||
}
|
||||
|
||||
+2
-2
@@ -49,7 +49,7 @@ typedef struct databuf
|
||||
int fd; /* data connection */
|
||||
ftptype_t type; /* transfer type */
|
||||
char buf[FTP_BUFSIZE]; /* data buffer */
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
SSL *ssl_handle; /* ssl handle */
|
||||
int ssl_active; /* flag if ssl is active or not */
|
||||
#endif
|
||||
@@ -78,7 +78,7 @@ typedef struct ftpbuf
|
||||
int lastch; /* last char of previous call */
|
||||
int direction; /* recv = 0 / send = 1 */
|
||||
int closestream;/* close or not close stream */
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
int use_ssl; /* enable(1) or disable(0) ssl */
|
||||
int use_ssl_for_data; /* en/disable ssl for the dataconnection */
|
||||
int old_ssl; /* old mode = forced data encryption */
|
||||
|
||||
+23
-23
@@ -48,7 +48,7 @@ static int le_ftpbuf;
|
||||
|
||||
function_entry php_ftp_functions[] = {
|
||||
PHP_FE(ftp_connect, NULL)
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
PHP_FE(ftp_ssl_connect, NULL)
|
||||
#endif
|
||||
PHP_FE(ftp_login, NULL)
|
||||
@@ -139,7 +139,7 @@ PHP_MINFO_FUNCTION(ftp)
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto resource ftp_connect(string host [, int port [, int timeout)]])
|
||||
/* {{{ proto resource ftp_connect(string host [, int port [, int timeout]])
|
||||
Opens a FTP stream */
|
||||
PHP_FUNCTION(ftp_connect)
|
||||
{
|
||||
@@ -166,7 +166,7 @@ PHP_FUNCTION(ftp_connect)
|
||||
|
||||
/* autoseek for resuming */
|
||||
ftp->autoseek = FTP_DEFAULT_AUTOSEEK;
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
/* disable ssl */
|
||||
ftp->use_ssl = 0;
|
||||
#endif
|
||||
@@ -175,8 +175,8 @@ PHP_FUNCTION(ftp_connect)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if HAVE_OPENSSL_EXT
|
||||
/* {{{ proto resource ftp_ssl_connect(string host [, int port [, int timeout)]])
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
/* {{{ proto resource ftp_ssl_connect(string host [, int port [, int timeout]])
|
||||
Opens a FTP-SSL stream */
|
||||
PHP_FUNCTION(ftp_ssl_connect)
|
||||
{
|
||||
@@ -603,15 +603,15 @@ PHP_FUNCTION(ftp_get)
|
||||
}
|
||||
|
||||
if (ftp->autoseek && resumepos) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, "rb+", NULL);
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", NULL);
|
||||
if (outstream == NULL) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, "wb", NULL);
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL);
|
||||
}
|
||||
if (outstream != NULL) {
|
||||
/* if autoresume is wanted seek to end */
|
||||
@@ -623,10 +623,10 @@ PHP_FUNCTION(ftp_get)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, "wb", NULL);
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL);
|
||||
}
|
||||
|
||||
if (outstream == NULL) {
|
||||
@@ -674,15 +674,15 @@ PHP_FUNCTION(ftp_nb_get)
|
||||
}
|
||||
|
||||
if (ftp->autoseek && resumepos) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, "rb+", NULL);
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", NULL);
|
||||
if (outstream == NULL) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, "wb", NULL);
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL);
|
||||
}
|
||||
if (outstream != NULL) {
|
||||
/* if autoresume is wanted seek to end */
|
||||
@@ -694,10 +694,10 @@ PHP_FUNCTION(ftp_nb_get)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, "wb", NULL);
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL);
|
||||
}
|
||||
|
||||
if (outstream == NULL) {
|
||||
@@ -881,11 +881,11 @@ PHP_FUNCTION(ftp_put)
|
||||
if (php_check_open_basedir(local TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "rb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt" : "rb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
instream = php_stream_fopen(local, "rb", NULL);
|
||||
instream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt" : "rb", NULL);
|
||||
|
||||
if (instream == NULL) {
|
||||
RETURN_FALSE;
|
||||
@@ -943,11 +943,11 @@ PHP_FUNCTION(ftp_nb_put)
|
||||
if (php_check_open_basedir(local TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "rb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt" : "rb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
instream = php_stream_fopen(local, "rb", NULL);
|
||||
instream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt" : "rb", NULL);
|
||||
|
||||
if (instream == NULL) {
|
||||
RETURN_FALSE;
|
||||
@@ -1161,7 +1161,7 @@ PHP_FUNCTION(ftp_set_option)
|
||||
RETURN_TRUE;
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%d'", option);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option);
|
||||
RETURN_FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -1190,7 +1190,7 @@ PHP_FUNCTION(ftp_get_option)
|
||||
RETURN_BOOL(ftp->autoseek);
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%d'", option);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option);
|
||||
RETURN_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ PHP_MINIT_FUNCTION(ftp);
|
||||
PHP_MINFO_FUNCTION(ftp);
|
||||
|
||||
PHP_FUNCTION(ftp_connect);
|
||||
#if HAVE_OPENSSL_EXT
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
PHP_FUNCTION(ftp_ssl_connect);
|
||||
#endif
|
||||
PHP_FUNCTION(ftp_login);
|
||||
|
||||
+16
-13
@@ -50,8 +50,8 @@ dnl
|
||||
AC_DEFUN(PHP_GD_JPEG,[
|
||||
if test "$PHP_JPEG_DIR" != "no"; then
|
||||
|
||||
for i in /usr /usr/local $PHP_JPEG_DIR; do
|
||||
test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i
|
||||
for i in $PHP_JPEG_DIR /usr/local /usr; do
|
||||
test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i && break
|
||||
done
|
||||
|
||||
if test -z "$GD_JPEG_DIR"; then
|
||||
@@ -75,8 +75,8 @@ AC_DEFUN(PHP_GD_JPEG,[
|
||||
AC_DEFUN(PHP_GD_PNG,[
|
||||
if test "$PHP_PNG_DIR" != "no"; then
|
||||
|
||||
for i in /usr /usr/local $PHP_PNG_DIR; do
|
||||
test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i
|
||||
for i in $PHP_PNG_DIR /usr/local /usr; do
|
||||
test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i && break
|
||||
done
|
||||
|
||||
if test -z "$GD_PNG_DIR"; then
|
||||
@@ -110,8 +110,8 @@ AC_DEFUN(PHP_GD_PNG,[
|
||||
AC_DEFUN(PHP_GD_XPM,[
|
||||
if test "$PHP_XPM_DIR" != "no"; then
|
||||
|
||||
for i in /usr /usr/local /usr/X11R6 $PHP_XPM_DIR; do
|
||||
test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i
|
||||
for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
|
||||
test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i && break
|
||||
done
|
||||
|
||||
if test -z "$GD_XPM_DIR"; then
|
||||
@@ -144,9 +144,9 @@ AC_DEFUN(PHP_GD_XPM,[
|
||||
AC_DEFUN(PHP_GD_FREETYPE1,[
|
||||
if test "$PHP_TTF" != "no"; then
|
||||
if test "$PHP_FREETYPE_DIR" = "no" -o "$PHP_FREETYPE_DIR" = ""; then
|
||||
if test -n "$PHP_TTF" ; then
|
||||
for i in /usr /usr/local $PHP_TTF; do
|
||||
if test -f "$i/include/freetype.h" ; then
|
||||
if test -n "$PHP_TTF"; then
|
||||
for i in $PHP_TTF /usr/local /usr; do
|
||||
if test -f "$i/include/freetype.h"; then
|
||||
TTF_DIR=$i
|
||||
unset TTF_INC_DIR
|
||||
fi
|
||||
@@ -158,6 +158,7 @@ AC_DEFUN(PHP_GD_FREETYPE1,[
|
||||
TTF_DIR=$i
|
||||
TTF_INC_DIR=$i/include/freetype1/freetype
|
||||
fi
|
||||
test -n "$TTF_DIR" && break
|
||||
done
|
||||
fi
|
||||
if test -n "$TTF_DIR" ; then
|
||||
@@ -177,10 +178,11 @@ AC_DEFUN(PHP_GD_FREETYPE1,[
|
||||
AC_DEFUN(PHP_GD_FREETYPE2,[
|
||||
if test "$PHP_FREETYPE_DIR" != "no"; then
|
||||
|
||||
for i in /usr /usr/local $PHP_FREETYPE_DIR; do
|
||||
for i in $PHP_FREETYPE_DIR /usr/local /usr; do
|
||||
if test -f "$i/include/freetype2/freetype/freetype.h"; then
|
||||
FREETYPE2_DIR=$i
|
||||
FREETYPE2_INC_DIR=$i/include/freetype2
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -201,8 +203,8 @@ AC_DEFUN(PHP_GD_FREETYPE2,[
|
||||
AC_DEFUN(PHP_GD_T1LIB,[
|
||||
if test "$PHP_T1LIB" != "no"; then
|
||||
|
||||
for i in /usr /usr/local $PHP_T1LIB; do
|
||||
test -f "$i/include/t1lib.h" && GD_T1_DIR=$i
|
||||
for i in $PHP_T1LIB /usr/local /usr; do
|
||||
test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break
|
||||
done
|
||||
|
||||
if test -z "$GD_T1_DIR"; then
|
||||
@@ -301,7 +303,8 @@ dnl These are always available with bundled library
|
||||
AC_DEFINE(HAVE_GD_PNG, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_XBM, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ])
|
||||
|
||||
dnl Make sure the libgd/ is first in the include path
|
||||
GDLIB_CFLAGS="-DHAVE_LIBPNG"
|
||||
|
||||
+3
-2
@@ -3012,8 +3012,9 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
|
||||
do {
|
||||
zval ** item;
|
||||
char * key;
|
||||
ulong num_key;
|
||||
|
||||
if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, NULL, 0, &pos) == FAILURE)
|
||||
if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING)
|
||||
continue;
|
||||
|
||||
if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void**)&item, &pos) == FAILURE)
|
||||
@@ -3165,7 +3166,7 @@ PHP_FUNCTION(imagepscopyfont)
|
||||
of_ind = zend_list_find(Z_LVAL_PP(fnt), &type);
|
||||
|
||||
if (type != le_ps_font) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Type 1 font index", Z_LVAL_PP(fnt));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Type 1 font index", Z_LVAL_PP(fnt));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
+45
-6
@@ -43,8 +43,8 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -56,7 +56,7 @@ BSC32=bscmake.exe
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 php4ts.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 php4ts.lib freetype2.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# ADD LINK32 php4ts.lib freetype2.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\zlib\Release"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
@@ -73,8 +73,8 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
|
||||
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -86,7 +86,7 @@ BSC32=bscmake.exe
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 php4ts_debug.lib libjpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 php4ts_debug.lib libpng.lib zlib.lib libjpeg.lib freetype2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS"
|
||||
# ADD LINK32 php4ts_debug.lib libpng.lib zlib.lib libjpeg.lib freetype2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\zlib\Debug"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
@@ -144,6 +144,7 @@ SOURCE=.\libgd\gd.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -159,6 +160,7 @@ SOURCE=.\libgd\gd2copypal.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -174,6 +176,7 @@ SOURCE=.\libgd\gd_arc_f_buggy.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -189,6 +192,7 @@ SOURCE=.\libgd\gd_gd.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -204,6 +208,7 @@ SOURCE=.\libgd\gd_gd2.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -211,6 +216,18 @@ SOURCE=.\libgd\gd_gd2.c
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libgd\gd_gif_in.c
|
||||
|
||||
!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Release_TS_bundled"
|
||||
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -223,6 +240,7 @@ SOURCE=.\libgd\gd_io.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -238,6 +256,7 @@ SOURCE=.\libgd\gd_io_dp.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -253,6 +272,7 @@ SOURCE=.\libgd\gd_io_file.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -268,6 +288,7 @@ SOURCE=.\libgd\gd_io_ss.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -283,6 +304,7 @@ SOURCE=.\libgd\gd_jpeg.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -298,6 +320,7 @@ SOURCE=.\libgd\gd_png.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -313,6 +336,7 @@ SOURCE=.\libgd\gd_ss.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -328,6 +352,7 @@ SOURCE=.\libgd\gd_topal.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -343,6 +368,7 @@ SOURCE=.\libgd\gd_wbmp.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -358,6 +384,7 @@ SOURCE=.\libgd\gdcache.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -373,6 +400,7 @@ SOURCE=.\libgd\gdfontg.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -388,6 +416,7 @@ SOURCE=.\libgd\gdfontl.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -403,6 +432,7 @@ SOURCE=.\libgd\gdfontmb.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -418,6 +448,7 @@ SOURCE=.\libgd\gdfonts.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -433,6 +464,7 @@ SOURCE=.\libgd\gdfontt.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -448,6 +480,7 @@ SOURCE=.\libgd\gdft.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -463,6 +496,7 @@ SOURCE=.\libgd\gdhelpers.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -478,6 +512,7 @@ SOURCE=.\libgd\gdkanji.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -493,6 +528,7 @@ SOURCE=.\libgd\gdtables.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -508,6 +544,7 @@ SOURCE=.\libgd\gdxpm.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -523,6 +560,7 @@ SOURCE=.\libgd\wbmp.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -538,6 +576,7 @@ SOURCE=.\libgd\xbm.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
+315
-170
@@ -9,8 +9,8 @@
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# if _MSC_VER >= 1300
|
||||
/* in MSVC.NET the these are available but only for __cplusplus and not _MSC_EXTENSIONS */
|
||||
# ifdef _MSC_EXTENSIONS
|
||||
/* in MSVC.NET these are available but only for __cplusplus and not _MSC_EXTENSIONS */
|
||||
# if !defined(_MSC_EXTENSIONS) && defined(__cplusplus)
|
||||
# define HAVE_FABSF 1
|
||||
extern float fabsf(float x);
|
||||
# define HAVE_FLOORF 1
|
||||
@@ -868,6 +868,36 @@ static void gdImageTileApply (gdImagePtr im, int x, int y)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int gdImageTileGet (gdImagePtr im, int x, int y)
|
||||
{
|
||||
int srcx, srcy;
|
||||
int tileColor,p;
|
||||
if (!im->tile) {
|
||||
return -1;
|
||||
}
|
||||
srcx = x % gdImageSX(im->tile);
|
||||
srcy = y % gdImageSY(im->tile);
|
||||
p = gdImageGetPixel(im->tile, srcx, srcy);
|
||||
|
||||
if (im->trueColor) {
|
||||
if (im->tile->trueColor) {
|
||||
tileColor = p;
|
||||
} else {
|
||||
tileColor = gdTrueColorAlpha( gdImageRed(im->tile,p), gdImageGreen(im->tile,p), gdImageBlue (im->tile,p), gdImageAlpha (im->tile,p));
|
||||
}
|
||||
} else {
|
||||
if (im->tile->trueColor) {
|
||||
tileColor = gdImageColorResolveAlpha(im, gdTrueColorGetRed (p), gdTrueColorGetGreen (p), gdTrueColorGetBlue (p), gdTrueColorGetAlpha (p));
|
||||
} else {
|
||||
tileColor = p;
|
||||
tileColor = gdImageColorResolveAlpha(im, gdImageRed (im->tile,p), gdImageGreen (im->tile,p), gdImageBlue (im->tile,p), gdImageAlpha (im->tile,p));
|
||||
}
|
||||
}
|
||||
return tileColor;
|
||||
}
|
||||
|
||||
|
||||
static void gdImageAntiAliasedApply (gdImagePtr im, int px, int py)
|
||||
{
|
||||
float p_dist, p_alpha;
|
||||
@@ -1799,107 +1829,173 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
|
||||
}
|
||||
}
|
||||
|
||||
void gdImageFill (gdImagePtr im, int x, int y, int color)
|
||||
|
||||
/*
|
||||
* set the pixel at (x,y) and its 4-connected neighbors
|
||||
* with the same pixel value to the new pixel value nc (new color).
|
||||
* A 4-connected neighbor: pixel above, below, left, or right of a pixel.
|
||||
* ideas from comp.graphics discussions.
|
||||
* For tiled fill, the use of a flag buffer is mandatory. As the tile image can
|
||||
* contain the same color as the color to fill. To do not bloat normal filling
|
||||
* code I added a 2nd private function.
|
||||
*/
|
||||
|
||||
/* horizontal segment of scan line y */
|
||||
struct seg {int y, xl, xr, dy;};
|
||||
|
||||
/* max depth of stack */
|
||||
#define FILL_MAX 1200000
|
||||
#define FILL_PUSH(Y, XL, XR, DY) \
|
||||
if (sp<stack+FILL_MAX*10 && Y+(DY)>=0 && Y+(DY)<wy2) \
|
||||
{sp->y = Y; sp->xl = XL; sp->xr = XR; sp->dy = DY; sp++;}
|
||||
|
||||
#define FILL_POP(Y, XL, XR, DY) \
|
||||
{sp--; Y = sp->y+(DY = sp->dy); XL = sp->xl; XR = sp->xr;}
|
||||
|
||||
void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
|
||||
|
||||
void gdImageFill(gdImagePtr im, int x, int y, int nc)
|
||||
{
|
||||
int lastBorder;
|
||||
int old;
|
||||
int leftLimit, rightLimit;
|
||||
int i;
|
||||
|
||||
if (x >= im->sx) {
|
||||
x = im->sx - 1;
|
||||
}
|
||||
|
||||
if (y >= im->sy) {
|
||||
y = im->sy - 1;
|
||||
}
|
||||
|
||||
old = gdImageGetPixel(im, x, y);
|
||||
if (color == gdTiled) {
|
||||
/* Tile fill -- got to watch out! */
|
||||
int p, tileColor;
|
||||
int srcx, srcy;
|
||||
if (!im->tile) {
|
||||
return;
|
||||
}
|
||||
/* Refuse to flood-fill with a transparent pattern I can't do it without allocating another image */
|
||||
if (gdImageGetTransparent(im->tile) != (-1)) {
|
||||
return;
|
||||
}
|
||||
srcx = x % gdImageSX(im->tile);
|
||||
srcy = y % gdImageSY(im->tile);
|
||||
p = gdImageGetPixel(im->tile, srcx, srcy);
|
||||
if (im->trueColor) {
|
||||
tileColor = p;
|
||||
} else {
|
||||
if (im->tile->trueColor) {
|
||||
tileColor = gdImageColorResolveAlpha(im, gdTrueColorGetRed (p), gdTrueColorGetGreen (p), gdTrueColorGetBlue (p), gdTrueColorGetAlpha (p));
|
||||
} else {
|
||||
tileColor = im->tileColorMap[p];
|
||||
}
|
||||
}
|
||||
if (old == tileColor) {
|
||||
/* Nothing to be done */
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (old == color) {
|
||||
/* Nothing to be done */
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* Seek left */
|
||||
leftLimit = (-1);
|
||||
for (i = x; i >= 0; i--) {
|
||||
if (gdImageGetPixel(im, i, y) != old) {
|
||||
break;
|
||||
}
|
||||
gdImageSetPixel(im, i, y, color);
|
||||
leftLimit = i;
|
||||
}
|
||||
if (leftLimit == (-1)) {
|
||||
int l, x1, x2, dy;
|
||||
int oc; /* old pixel value */
|
||||
int wx2,wy2;
|
||||
/* stack of filled segments */
|
||||
//struct seg stack[FILL_MAX],*sp = stack;;
|
||||
struct seg *stack;
|
||||
struct seg *sp;
|
||||
|
||||
if (nc==gdTiled){
|
||||
_gdImageFillTiled(im,x,y,nc);
|
||||
return;
|
||||
}
|
||||
/* Seek right */
|
||||
rightLimit = x;
|
||||
for (i = (x + 1); i < im->sx; i++) {
|
||||
if (gdImageGetPixel(im, i, y) != old) {
|
||||
break;
|
||||
|
||||
wx2=im->sx;wy2=im->sy;
|
||||
oc = gdImageGetPixel(im, x, y);
|
||||
if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) return;
|
||||
|
||||
stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1);
|
||||
sp = stack;
|
||||
|
||||
/* required! */
|
||||
FILL_PUSH(y,x,x,1);
|
||||
/* seed segment (popped 1st) */
|
||||
FILL_PUSH(y+1, x, x, -1);
|
||||
while (sp>stack) {
|
||||
FILL_POP(y, x1, x2, dy);
|
||||
|
||||
for (x=x1; x>=0 && gdImageGetPixel(im,x, y)==oc; x--) {
|
||||
gdImageSetPixel(im,x, y, nc);
|
||||
}
|
||||
gdImageSetPixel(im, i, y, color);
|
||||
rightLimit = i;
|
||||
}
|
||||
/* Look at lines above and below and start paints */
|
||||
/* Above */
|
||||
if (y > 0) {
|
||||
lastBorder = 1;
|
||||
for (i = leftLimit; i <= rightLimit; i++) {
|
||||
int c;
|
||||
c = gdImageGetPixel(im, i, y - 1);
|
||||
if (lastBorder && c == old) {
|
||||
gdImageFill (im, i, y - 1, color);
|
||||
lastBorder = 0;
|
||||
} else if (c != old) {
|
||||
lastBorder = 1;
|
||||
if (x>=x1) {
|
||||
goto skip;
|
||||
}
|
||||
l = x+1;
|
||||
|
||||
/* leak on left? */
|
||||
if (l<x1) {
|
||||
FILL_PUSH(y, l, x1-1, -dy);
|
||||
}
|
||||
x = x1+1;
|
||||
do {
|
||||
for (; x<=wx2 && gdImageGetPixel(im,x, y)==oc; x++) {
|
||||
gdImageSetPixel(im, x, y, nc);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Below */
|
||||
if (y < (im->sy - 1)) {
|
||||
lastBorder = 1;
|
||||
for (i = leftLimit; i <= rightLimit; i++) {
|
||||
int c;
|
||||
c = gdImageGetPixel(im, i, y + 1);
|
||||
if (lastBorder && c == old) {
|
||||
gdImageFill(im, i, y + 1, color);
|
||||
lastBorder = 0;
|
||||
} else if (c != old) {
|
||||
lastBorder = 1;
|
||||
FILL_PUSH(y, l, x-1, dy);
|
||||
/* leak on right? */
|
||||
if (x>x2+1) {
|
||||
FILL_PUSH(y, x2+1, x-1, -dy);
|
||||
}
|
||||
}
|
||||
skip: for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++);
|
||||
|
||||
l = x;
|
||||
} while (x<=x2);
|
||||
}
|
||||
efree(stack);
|
||||
}
|
||||
|
||||
void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
|
||||
{
|
||||
int i,l, x1, x2, dy;
|
||||
int oc; /* old pixel value */
|
||||
int tiled;
|
||||
int wx2,wy2;
|
||||
/* stack of filled segments */
|
||||
struct seg *stack;
|
||||
struct seg *sp;
|
||||
|
||||
int **pts;
|
||||
if(!im->tile){
|
||||
return;
|
||||
}
|
||||
|
||||
wx2=im->sx;wy2=im->sy;
|
||||
tiled = nc==gdTiled;
|
||||
|
||||
nc = gdImageTileGet(im,x,y);
|
||||
pts = (int **) ecalloc(sizeof(int *) * im->sy, sizeof(int));
|
||||
|
||||
for (i=0; i<im->sy;i++) {
|
||||
pts[i] = (int *) ecalloc(im->sx, sizeof(int));
|
||||
}
|
||||
|
||||
stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1);
|
||||
sp = stack;
|
||||
|
||||
oc = gdImageGetPixel(im, x, y);
|
||||
|
||||
/* required! */
|
||||
FILL_PUSH(y,x,x,1);
|
||||
/* seed segment (popped 1st) */
|
||||
FILL_PUSH(y+1, x, x, -1);
|
||||
while (sp>stack) {
|
||||
FILL_POP(y, x1, x2, dy);
|
||||
for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); x--) {
|
||||
if (pts[y][x]){
|
||||
/* we should never be here */
|
||||
break;
|
||||
}
|
||||
nc = gdImageTileGet(im,x,y);
|
||||
pts[y][x]=1;
|
||||
gdImageSetPixel(im,x, y, nc);
|
||||
}
|
||||
if (x>=x1) {
|
||||
goto skip;
|
||||
}
|
||||
l = x+1;
|
||||
|
||||
/* leak on left? */
|
||||
if (l<x1) {
|
||||
FILL_PUSH(y, l, x1-1, -dy);
|
||||
}
|
||||
x = x1+1;
|
||||
do {
|
||||
for (; x<=wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc) ; x++) {
|
||||
if (pts[y][x]){
|
||||
/* we should never be here */
|
||||
break;
|
||||
}
|
||||
nc = gdImageTileGet(im,x,y);
|
||||
pts[y][x]=1;
|
||||
gdImageSetPixel(im, x, y, nc);
|
||||
}
|
||||
FILL_PUSH(y, l, x-1, dy);
|
||||
/* leak on right? */
|
||||
if (x>x2+1) {
|
||||
FILL_PUSH(y, x2+1, x-1, -dy);
|
||||
}
|
||||
skip: for (x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, y)!=oc); x++);
|
||||
l = x;
|
||||
} while (x<=x2);
|
||||
}
|
||||
for (i=0; i<im->sy;i++) {
|
||||
efree(pts[i]);
|
||||
}
|
||||
efree(pts);
|
||||
efree(stack);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
{
|
||||
int x1h = x1, x1v = x1, y1h = y1, y1v = y1, x2h = x2, x2v = x2, y2h = y2, y2v = y2;
|
||||
@@ -2075,9 +2171,9 @@ void gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int s
|
||||
} else {
|
||||
dc = gdImageGetPixel(dst, tox, toy);
|
||||
|
||||
ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f));
|
||||
ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f));
|
||||
ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f));
|
||||
ncR = (int)(gdImageRed (src, c) * (pct / 100.0) + gdImageRed (dst, dc) * ((100 - pct) / 100.0));
|
||||
ncG = (int)(gdImageGreen (src, c) * (pct / 100.0) + gdImageGreen (dst, dc) * ((100 - pct) / 100.0));
|
||||
ncB = (int)(gdImageBlue (src, c) * (pct / 100.0) + gdImageBlue (dst, dc) * ((100 - pct) / 100.0));
|
||||
|
||||
/* Find a reasonable color */
|
||||
nc = gdImageColorResolve (dst, ncR, ncG, ncB);
|
||||
@@ -2368,14 +2464,22 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
|
||||
void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double dWeight, int clrBack)
|
||||
{
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
int i, r, g, b, a;
|
||||
int i, r, g, b, a, clrBackR, clrBackG, clrBackB, clrBackA;
|
||||
FuncPtr f;
|
||||
|
||||
int pxlOldLeft, pxlLeft=0, pxlSrc;
|
||||
|
||||
/* Keep clrBack as color index if required */
|
||||
if (src->trueColor) {
|
||||
pxlOldLeft = clrBack;
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
pxlOldLeft = clrBack;
|
||||
clrBackR = gdImageRed(src, clrBack);
|
||||
clrBackG = gdImageGreen(src, clrBack);
|
||||
clrBackB = gdImageBlue(src, clrBack);
|
||||
clrBackA = gdImageAlpha(src, clrBack);
|
||||
clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
|
||||
@@ -2387,8 +2491,6 @@ void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double
|
||||
gdImageSetPixel (dst, i, uRow, clrBack);
|
||||
}
|
||||
|
||||
pxlOldLeft = clrBack;
|
||||
|
||||
for (i = 0; i < src->sx; i++) {
|
||||
pxlSrc = f (src,i,uRow);
|
||||
|
||||
@@ -2398,30 +2500,30 @@ void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double
|
||||
a = (int)(gdImageAlpha(src,pxlSrc) * dWeight);
|
||||
|
||||
pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a);
|
||||
|
||||
|
||||
if (pxlLeft == -1) {
|
||||
pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a);
|
||||
}
|
||||
|
||||
|
||||
r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft));
|
||||
g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft));
|
||||
b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft));
|
||||
a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft));
|
||||
|
||||
if (r>255) {
|
||||
r = 255;
|
||||
}
|
||||
|
||||
if (r>255) {
|
||||
r = 255;
|
||||
}
|
||||
|
||||
if (g>255) {
|
||||
g = 255;
|
||||
}
|
||||
|
||||
if(b>255) {
|
||||
b = 255;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (b>255) {
|
||||
b = 255;
|
||||
}
|
||||
|
||||
if (a>127) {
|
||||
b = 127;
|
||||
a = 127;
|
||||
}
|
||||
|
||||
pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
|
||||
@@ -2438,7 +2540,7 @@ void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double
|
||||
}
|
||||
|
||||
i += iOffset;
|
||||
|
||||
|
||||
if (i < dst->sx) {
|
||||
gdImageSetPixel (dst, i, uRow, pxlLeft);
|
||||
}
|
||||
@@ -2465,46 +2567,50 @@ void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
|
||||
for (i = 0; i<iOffset; i++) {
|
||||
for (i = 0; i<=iOffset; i++) {
|
||||
gdImageSetPixel (dst, uCol, i, clrBack);
|
||||
}
|
||||
r = (int)((double)gdImageRed(src,clrBack) * dWeight);
|
||||
g = (int)((double)gdImageGreen(src,clrBack) * dWeight);
|
||||
b = (int)((double)gdImageBlue(src,clrBack) * dWeight);
|
||||
a = (int)((double)gdImageAlpha(src,clrBack) * dWeight);
|
||||
|
||||
pxlOldLeft = clrBack;
|
||||
pxlOldLeft = gdImageColorAllocateAlpha(dst, r, g, b, a);
|
||||
|
||||
for (i = 0; i < src->sy; i++) {
|
||||
pxlSrc = f (src, uCol, i);
|
||||
iYPos = i + iOffset;
|
||||
|
||||
r = (int)(gdImageRed(src,pxlSrc) * dWeight);
|
||||
g = (int)(gdImageGreen(src,pxlSrc) * dWeight);
|
||||
b = (int)(gdImageBlue(src,pxlSrc) * dWeight);
|
||||
a = (int)(gdImageAlpha(src,pxlSrc) * dWeight);
|
||||
|
||||
r = (int)((double)gdImageRed(src,pxlSrc) * dWeight);
|
||||
g = (int)((double)gdImageGreen(src,pxlSrc) * dWeight);
|
||||
b = (int)((double)gdImageBlue(src,pxlSrc) * dWeight);
|
||||
a = (int)((double)gdImageAlpha(src,pxlSrc) * dWeight);
|
||||
|
||||
pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a);
|
||||
|
||||
|
||||
if (pxlLeft == -1) {
|
||||
pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a);
|
||||
}
|
||||
|
||||
r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft));
|
||||
r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft));
|
||||
g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft));
|
||||
b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft));
|
||||
a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft));
|
||||
|
||||
|
||||
if (r>255) {
|
||||
r = 255;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (g>255) {
|
||||
g = 255;
|
||||
}
|
||||
|
||||
if(b>255) {
|
||||
b = 255;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (b>255) {
|
||||
b = 255;
|
||||
}
|
||||
|
||||
if (a>127) {
|
||||
b = 127;
|
||||
a = 127;
|
||||
}
|
||||
|
||||
pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
|
||||
@@ -2516,7 +2622,7 @@ void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double
|
||||
if ((iYPos >= 0) && (iYPos < dst->sy)) {
|
||||
gdImageSetPixel (dst, uCol, iYPos, pxlSrc);
|
||||
}
|
||||
|
||||
|
||||
pxlOldLeft = pxlLeft;
|
||||
}
|
||||
|
||||
@@ -2535,30 +2641,36 @@ void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double
|
||||
gdImagePtr gdImageRotate90 (gdImagePtr src)
|
||||
{
|
||||
int uY, uX;
|
||||
int c;
|
||||
int c, r,g,b,a;
|
||||
gdImagePtr dst;
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
FuncPtr f;
|
||||
|
||||
if (src->trueColor) {
|
||||
dst = gdImageCreateTrueColor(src->sy, src->sx);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst = gdImageCreate (src->sy, src->sx);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst = gdImageCreateTrueColor(src->sy, src->sx);
|
||||
|
||||
if (dst != NULL) {
|
||||
gdImagePaletteCopy (dst, src);
|
||||
|
||||
|
||||
for (uY = 0; uY<src->sy; uY++) {
|
||||
for (uX = 0; uX<src->sx; uX++) {
|
||||
c = f (src, uX, uY);
|
||||
if (!src->trueColor) {
|
||||
r = gdImageRed(src,c);
|
||||
g = gdImageGreen(src,c);
|
||||
b = gdImageBlue(src,c);
|
||||
a = gdImageAlpha(src,c);
|
||||
c = gdTrueColorAlpha(r, g, b, a);
|
||||
}
|
||||
gdImageSetPixel(dst, uY, (dst->sy - uX - 1), c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
@@ -2566,25 +2678,31 @@ gdImagePtr gdImageRotate90 (gdImagePtr src)
|
||||
gdImagePtr gdImageRotate180 (gdImagePtr src)
|
||||
{
|
||||
int uY, uX;
|
||||
int c;
|
||||
int c,r,g,b,a;
|
||||
gdImagePtr dst;
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
FuncPtr f;
|
||||
|
||||
if (src->trueColor) {
|
||||
dst = gdImageCreateTrueColor ( src->sx,src->sy);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst = gdImageCreate (src->sx, src->sy);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst = gdImageCreateTrueColor(src->sx, src->sy);
|
||||
|
||||
if (dst != NULL) {
|
||||
gdImagePaletteCopy (dst, src);
|
||||
|
||||
|
||||
for (uY = 0; uY<src->sy; uY++) {
|
||||
for (uX = 0; uX<src->sx; uX++) {
|
||||
c = f (src, uX, uY);
|
||||
if (!src->trueColor) {
|
||||
r = gdImageRed(src,c);
|
||||
g = gdImageGreen(src,c);
|
||||
b = gdImageBlue(src,c);
|
||||
a = gdImageAlpha(src,c);
|
||||
c = gdTrueColorAlpha(r, g, b, a);
|
||||
}
|
||||
gdImageSetPixel(dst, (dst->sx - uX - 1), (dst->sy - uY - 1), c);
|
||||
}
|
||||
}
|
||||
@@ -2597,30 +2715,36 @@ gdImagePtr gdImageRotate180 (gdImagePtr src)
|
||||
gdImagePtr gdImageRotate270 ( gdImagePtr src )
|
||||
{
|
||||
int uY, uX;
|
||||
int c;
|
||||
int c,r,g,b,a;
|
||||
gdImagePtr dst;
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
FuncPtr f;
|
||||
|
||||
if (src->trueColor) {
|
||||
dst = gdImageCreateTrueColor (src->sy, src->sx);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst = gdImageCreate (src->sy, src->sx);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst = gdImageCreateTrueColor(src->sy, src->sx);
|
||||
|
||||
if (dst != NULL) {
|
||||
gdImagePaletteCopy (dst, src);
|
||||
|
||||
|
||||
for (uY = 0; uY<src->sy; uY++) {
|
||||
for (uX = 0; uX<src->sx; uX++) {
|
||||
c = f (src, uX, uY);
|
||||
if (!src->trueColor) {
|
||||
r = gdImageRed(src,c);
|
||||
g = gdImageGreen(src,c);
|
||||
b = gdImageBlue(src,c);
|
||||
a = gdImageAlpha(src,c);
|
||||
c = gdTrueColorAlpha(r, g, b, a);
|
||||
}
|
||||
gdImageSetPixel(dst, (dst->sx - uY - 1), uX, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
@@ -2632,6 +2756,7 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
double dRadAngle, dSinE, dTan, dShear;
|
||||
double dOffset; /* Variable skew offset */
|
||||
int u, iShear, newx, newy;
|
||||
int clrBackR, clrBackG, clrBackB, clrBackA;
|
||||
|
||||
/* See GEMS I for the algorithm details */
|
||||
dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
|
||||
@@ -2643,25 +2768,26 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
|
||||
/* 1st shear */
|
||||
if (src->trueColor) {
|
||||
dst1 = gdImageCreateTrueColor (newx, newy);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst1 = gdImageCreate (newx, newy);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst1 = gdImageCreateTrueColor(newx, newy);
|
||||
|
||||
/******* Perform 1st shear (horizontal) ******/
|
||||
if (dst1 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
dst1->alphaBlendingFlag = gdEffectReplace;
|
||||
|
||||
if (dAngle == 0.0) {
|
||||
/* Returns copy of src */
|
||||
gdImageCopy (dst1, src,0,0,0,0,src->sx,src->sy);
|
||||
return dst1;
|
||||
}
|
||||
|
||||
|
||||
gdImagePaletteCopy (dst1, src);
|
||||
|
||||
dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
|
||||
dSinE = sin (dRadAngle);
|
||||
dTan = tan (dRadAngle / 2.0);
|
||||
@@ -2674,37 +2800,46 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
}
|
||||
|
||||
iShear = (int)floor(dShear);
|
||||
|
||||
gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack);
|
||||
}
|
||||
|
||||
/*
|
||||
The 1st shear may use the original clrBack as color index
|
||||
Convert it once here
|
||||
*/
|
||||
if(!src->trueColor) {
|
||||
clrBackR = gdImageRed(src, clrBack);
|
||||
clrBackG = gdImageGreen(src, clrBack);
|
||||
clrBackB = gdImageBlue(src, clrBack);
|
||||
clrBackA = gdImageAlpha(src, clrBack);
|
||||
clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA);
|
||||
}
|
||||
/* 2nd shear */
|
||||
newx = dst1->sx;
|
||||
|
||||
|
||||
if (dSinE > 0.0) {
|
||||
dOffset = (src->sx ) * dSinE;
|
||||
dOffset = (src->sx-1) * dSinE;
|
||||
} else {
|
||||
dOffset = -dSinE * (src->sx - newx);
|
||||
}
|
||||
|
||||
newy = (int) ((double) src->sx * fabs( dSinE ) + (double) src->sy * cos (dRadAngle));
|
||||
newy = (int) ((double) src->sx * fabs( dSinE ) + (double) src->sy * cos (dRadAngle))+1;
|
||||
|
||||
if (src->trueColor) {
|
||||
dst2 = gdImageCreateTrueColor (newx, newy);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst2 = gdImageCreate (newx, newy);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
|
||||
dst2 = gdImageCreateTrueColor(newx, newy);
|
||||
if (dst2 == NULL) {
|
||||
gdImageDestroy(dst1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dst2->alphaBlendingFlag = gdEffectReplace;
|
||||
|
||||
for (u = 0; u < dst2->sx; u++, dOffset -= dSinE) {
|
||||
iShear = (int)floor (dOffset);
|
||||
gdImageSkewY(dst2, dst1, u, iShear, (dOffset - iShear), clrBack);
|
||||
gdImageSkewY(dst2, dst1, u, iShear, (dOffset - (double)iShear), clrBack);
|
||||
}
|
||||
|
||||
/* 3rd shear */
|
||||
@@ -2712,15 +2847,13 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
|
||||
newx = (int) ((double)src->sy * fabs (dSinE) + (double)src->sx * cos (dRadAngle)) + 1;
|
||||
newy = dst2->sy;
|
||||
|
||||
|
||||
if (src->trueColor) {
|
||||
dst3 = gdImageCreateTrueColor (newx, newy);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst3 = gdImageCreate (newx, newy);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
|
||||
dst3 = gdImageCreateTrueColor(newx, newy);
|
||||
if (dst3 == NULL) {
|
||||
gdImageDestroy(dst2);
|
||||
return NULL;
|
||||
@@ -2737,7 +2870,7 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
}
|
||||
|
||||
gdImageDestroy(dst2);
|
||||
|
||||
|
||||
return dst3;
|
||||
}
|
||||
|
||||
@@ -2745,11 +2878,15 @@ gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack)
|
||||
{
|
||||
gdImagePtr pMidImg;
|
||||
gdImagePtr rotatedImg;
|
||||
|
||||
int r,g,b,a;
|
||||
if (src == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!gdImageTrueColor(src) && clrBack>=gdImageColorsTotal(src)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while (dAngle >= 360.0) {
|
||||
dAngle -= 360.0;
|
||||
}
|
||||
@@ -2757,7 +2894,7 @@ gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack)
|
||||
while (dAngle < 0) {
|
||||
dAngle += 360.0;
|
||||
}
|
||||
|
||||
|
||||
if (dAngle == 90.00) {
|
||||
return gdImageRotate90(src);
|
||||
}
|
||||
@@ -2780,14 +2917,22 @@ gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack)
|
||||
} else {
|
||||
return gdImageRotate45 (src, dAngle, clrBack);
|
||||
}
|
||||
|
||||
|
||||
if (pMidImg == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if(!src->trueColor) {
|
||||
r = gdImageRed(src, clrBack);
|
||||
g = gdImageGreen(src, clrBack);
|
||||
b = gdImageBlue(src, clrBack);
|
||||
a = gdImageAlpha(src, clrBack);
|
||||
clrBack = gdTrueColorAlpha(r,g,b,a);
|
||||
}
|
||||
|
||||
rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack);
|
||||
gdImageDestroy(pMidImg);
|
||||
|
||||
|
||||
return rotatedImg;
|
||||
}
|
||||
/* End Rotate function */
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
--TEST--
|
||||
Bug #24594 (Filling an area using tiles).
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not available\n");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die('skip external GD libraries may fail');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$tile = imagecreate(36,36);
|
||||
$base = imagecreate(150,150);
|
||||
$white = imagecolorallocate($tile,255,255,255);
|
||||
$black = imagecolorallocate($tile,0,0,0);
|
||||
$white = imagecolorallocate($base,255,255,255);
|
||||
$black = imagecolorallocate($base,0,0,0);
|
||||
|
||||
/* create the dots pattern */
|
||||
for ($x=0;$x<36;$x+=2) {
|
||||
for ($y=0;$y<36;$y+=2) {
|
||||
imagesetpixel($tile,$x,$y,$black);
|
||||
}
|
||||
}
|
||||
|
||||
imagesettile($base,$tile);
|
||||
imagerectangle($base, 9,9,139,139,$black);
|
||||
imageline($base, 9,9,139,139,$black);
|
||||
imagefill($base,11,12,IMG_COLOR_TILED);
|
||||
|
||||
$res = imagecolorat($base,0,10)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,20)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,30)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,40)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,50)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,60)==$black?'1':'0';
|
||||
|
||||
$res .= imagecolorat($base,11,12)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,12,13)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,13,14)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,14,15)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,15,16)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,16,17)==$white?'1':'0';
|
||||
|
||||
$res .= imagecolorat($base,10,12)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,11,13)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,12,14)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,13,15)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,14,16)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,15,17)==$black?'1':'0';
|
||||
echo "$res\n";
|
||||
|
||||
imagefilledrectangle($base,0,0,149,149,$white);
|
||||
imagerectangle($base, 9,9,139,139,$black);
|
||||
imageline($base, 9,9,139,139,$black);
|
||||
imagefill($base,0,0,IMG_COLOR_TILED);
|
||||
|
||||
$res = imagecolorat($base,0,10)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,20)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,30)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,40)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,50)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,60)==$black?'1':'0';
|
||||
|
||||
$res .= imagecolorat($base,11,12)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,12,13)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,13,14)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,14,15)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,15,16)==$white?'1':'0';
|
||||
$res .= imagecolorat($base,16,17)==$white?'1':'0';
|
||||
|
||||
$res .= imagecolorat($base,0,16)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,2,42)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,4,44)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,146,146)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,148,146)==$black?'1':'0';
|
||||
$res .= imagecolorat($base,0,0)==$black?'1':'0';
|
||||
|
||||
echo "$res\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
000000111111101010
|
||||
111111111111111111
|
||||
@@ -6,10 +6,8 @@ PHP_ARG_WITH(gettext,for GNU gettext support,
|
||||
[ --with-gettext[=DIR] Include GNU gettext support.])
|
||||
|
||||
if test "$PHP_GETTEXT" != "no"; then
|
||||
for i in /usr /usr/local $PHP_GETTEXT; do
|
||||
if test -r $i/include/libintl.h; then
|
||||
GETTEXT_DIR=$i
|
||||
fi
|
||||
for i in $PHP_GETTEXT /usr/local /usr; do
|
||||
test -r $i/include/libintl.h && GETTEXT_DIR=$i && break
|
||||
done
|
||||
|
||||
if test -z "$GETTEXT_DIR"; then
|
||||
|
||||
+26
-27
@@ -18,56 +18,55 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
#include "php_gettext.h"
|
||||
|
||||
#if HAVE_LIBINTL
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libintl.h>
|
||||
#include "ext/standard/info.h"
|
||||
#include "php_gettext.h"
|
||||
|
||||
/* {{{ php_gettext_functions[]
|
||||
*/
|
||||
function_entry php_gettext_functions[] = {
|
||||
PHP_FE(textdomain, NULL)
|
||||
PHP_FE(gettext, NULL)
|
||||
PHP_FALIAS(_, gettext, NULL)
|
||||
PHP_FE(dgettext, NULL)
|
||||
PHP_FE(dcgettext, NULL)
|
||||
PHP_FE(bindtextdomain, NULL)
|
||||
PHP_NAMED_FE(textdomain, zif_textdomain, NULL)
|
||||
PHP_NAMED_FE(gettext, zif_gettext, NULL)
|
||||
/* Alias for gettext() */
|
||||
PHP_NAMED_FE(_, zif_gettext, NULL)
|
||||
PHP_NAMED_FE(dgettext, zif_dgettext, NULL)
|
||||
PHP_NAMED_FE(dcgettext, zif_dcgettext, NULL)
|
||||
PHP_NAMED_FE(bindtextdomain, zif_bindtextdomain, NULL)
|
||||
#if HAVE_NGETTEXT
|
||||
PHP_FE(ngettext, NULL)
|
||||
PHP_NAMED_FE(ngettext, zif_ngettext, NULL)
|
||||
#endif
|
||||
#if HAVE_DNGETTEXT
|
||||
PHP_FE(dngettext, NULL)
|
||||
PHP_NAMED_FE(dngettext, zif_dngettext, NULL)
|
||||
#endif
|
||||
#if HAVE_DCNGETTEXT
|
||||
PHP_FE(dcngettext, NULL)
|
||||
PHP_NAMED_FE(dcngettext, zif_dcngettext, NULL)
|
||||
#endif
|
||||
#if HAVE_BIND_TEXTDOMAIN_CODESET
|
||||
PHP_FE(bind_textdomain_codeset, NULL)
|
||||
PHP_NAMED_FE(bind_textdomain_codeset, zif_bind_textdomain_codeset, NULL)
|
||||
#endif
|
||||
|
||||
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
zend_module_entry php_gettext_module_entry = {
|
||||
STANDARD_MODULE_HEADER,
|
||||
STANDARD_MODULE_HEADER,
|
||||
"gettext",
|
||||
php_gettext_functions,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(gettext),
|
||||
NO_VERSION_YET,
|
||||
PHP_MINFO(php_gettext),
|
||||
NO_VERSION_YET,
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
@@ -75,7 +74,7 @@ zend_module_entry php_gettext_module_entry = {
|
||||
ZEND_GET_MODULE(php_gettext)
|
||||
#endif
|
||||
|
||||
PHP_MINFO_FUNCTION(gettext)
|
||||
PHP_MINFO_FUNCTION(php_gettext)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "GetText Support", "enabled");
|
||||
@@ -84,7 +83,7 @@ PHP_MINFO_FUNCTION(gettext)
|
||||
|
||||
/* {{{ proto string textdomain(string domain)
|
||||
Set the textdomain to "domain". Returns the current domain */
|
||||
PHP_FUNCTION(textdomain)
|
||||
PHP_NAMED_FUNCTION(zif_textdomain)
|
||||
{
|
||||
zval **domain;
|
||||
char *domain_name, *retval;
|
||||
@@ -110,7 +109,7 @@ PHP_FUNCTION(textdomain)
|
||||
|
||||
/* {{{ proto string gettext(string msgid)
|
||||
Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist */
|
||||
PHP_FUNCTION(gettext)
|
||||
PHP_NAMED_FUNCTION(zif_gettext)
|
||||
{
|
||||
zval **msgid;
|
||||
char *msgstr;
|
||||
@@ -128,7 +127,7 @@ PHP_FUNCTION(gettext)
|
||||
|
||||
/* {{{ proto string dgettext(string domain_name, string msgid)
|
||||
Return the translation of msgid for domain_name, or msgid unaltered if a translation does not exist */
|
||||
PHP_FUNCTION(dgettext)
|
||||
PHP_NAMED_FUNCTION(zif_dgettext)
|
||||
{
|
||||
zval **domain_name, **msgid;
|
||||
char *msgstr;
|
||||
@@ -147,7 +146,7 @@ PHP_FUNCTION(dgettext)
|
||||
|
||||
/* {{{ proto string dcgettext(string domain_name, string msgid, long category)
|
||||
Return the translation of msgid for domain_name and category, or msgid unaltered if a translation does not exist */
|
||||
PHP_FUNCTION(dcgettext)
|
||||
PHP_NAMED_FUNCTION(zif_dcgettext)
|
||||
{
|
||||
zval **domain_name, **msgid, **category;
|
||||
char *msgstr;
|
||||
@@ -167,7 +166,7 @@ PHP_FUNCTION(dcgettext)
|
||||
|
||||
/* {{{ proto string bindtextdomain(string domain_name, string dir)
|
||||
Bind to the text domain domain_name, looking for translations in dir. Returns the current domain */
|
||||
PHP_FUNCTION(bindtextdomain)
|
||||
PHP_NAMED_FUNCTION(zif_bindtextdomain)
|
||||
{
|
||||
zval **domain_name, **dir;
|
||||
char *retval, dir_name[MAXPATHLEN];
|
||||
@@ -198,7 +197,7 @@ PHP_FUNCTION(bindtextdomain)
|
||||
#if HAVE_NGETTEXT
|
||||
/* {{{ proto string ngettext(string MSGID1, string MSGID2, int N)
|
||||
Plural version of gettext() */
|
||||
PHP_FUNCTION(ngettext)
|
||||
PHP_NAMED_FUNCTION(zif_ngettext)
|
||||
{
|
||||
zval **msgid1, **msgid2, **count;
|
||||
char *msgstr;
|
||||
@@ -224,7 +223,7 @@ PHP_FUNCTION(ngettext)
|
||||
#if HAVE_DNGETTEXT
|
||||
/* {{{ proto string dngettext (string domain, string msgid1, string msgid2, int count)
|
||||
Plural version of dgettext() */
|
||||
PHP_FUNCTION(dngettext)
|
||||
PHP_NAMED_FUNCTION(zif_dngettext)
|
||||
{
|
||||
zval **domain, **msgid1, **msgid2, **count;
|
||||
|
||||
@@ -252,7 +251,7 @@ PHP_FUNCTION(dngettext)
|
||||
#if HAVE_DCNGETTEXT
|
||||
/* {{{ proto string dcngettext (string domain, string msgid1, string msgid2, int n, int category)
|
||||
Plural version of dcgettext() */
|
||||
PHP_FUNCTION(dcngettext)
|
||||
PHP_NAMED_FUNCTION(zif_dcngettext)
|
||||
{
|
||||
zval **domain, **msgid1, **msgid2, **count, **category;
|
||||
|
||||
@@ -283,7 +282,7 @@ PHP_FUNCTION(dcngettext)
|
||||
|
||||
/* {{{ proto string bind_textdomain_codeset (string domain, string codeset)
|
||||
Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. */
|
||||
PHP_FUNCTION(bind_textdomain_codeset)
|
||||
PHP_NAMED_FUNCTION(zif_bind_textdomain_codeset)
|
||||
{
|
||||
zval **domain, **codeset;
|
||||
char *retval;
|
||||
|
||||
+10
-13
@@ -22,31 +22,28 @@
|
||||
#define PHP_GETTEXT_H
|
||||
|
||||
#if HAVE_LIBINTL
|
||||
#ifndef INIT_FUNC_ARGS
|
||||
#include "zend_modules.h"
|
||||
#endif
|
||||
|
||||
extern zend_module_entry php_gettext_module_entry;
|
||||
#define gettext_module_ptr &php_gettext_module_entry
|
||||
|
||||
PHP_MINFO_FUNCTION(gettext);
|
||||
PHP_MINFO_FUNCTION(php_gettext);
|
||||
|
||||
PHP_FUNCTION(textdomain);
|
||||
PHP_FUNCTION(gettext);
|
||||
PHP_FUNCTION(dgettext);
|
||||
PHP_FUNCTION(dcgettext);
|
||||
PHP_FUNCTION(bindtextdomain);
|
||||
PHP_NAMED_FUNCTION(zif_textdomain);
|
||||
PHP_NAMED_FUNCTION(zif_gettext);
|
||||
PHP_NAMED_FUNCTION(zif_dgettext);
|
||||
PHP_NAMED_FUNCTION(zif_dcgettext);
|
||||
PHP_NAMED_FUNCTION(zif_bindtextdomain);
|
||||
#if HAVE_NGETTEXT
|
||||
PHP_FUNCTION(ngettext);
|
||||
PHP_NAMED_FUNCTION(zif_ngettext);
|
||||
#endif
|
||||
#if HAVE_DNGETTEXT
|
||||
PHP_FUNCTION(dngettext);
|
||||
PHP_NAMED_FUNCTION(zif_dngettext);
|
||||
#endif
|
||||
#if HAVE_DCNGETTEXT
|
||||
PHP_FUNCTION(dcngettext);
|
||||
PHP_NAMED_FUNCTION(zif_dcngettext);
|
||||
#endif
|
||||
#if HAVE_BIND_TEXTDOMAIN_CODESET
|
||||
PHP_FUNCTION(bind_textdomain_codeset);
|
||||
PHP_NAMED_FUNCTION(zif_bind_textdomain_codeset);
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Gettext basic test
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("gettext")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php // $Id$
|
||||
|
||||
chdir(dirname(__FILE__));
|
||||
setlocale(LC_ALL, 'fi_FI');
|
||||
bindtextdomain ("messages", "./locale");
|
||||
textdomain ("messages");
|
||||
echo gettext("Basic test"), "\n";
|
||||
echo _("Basic test"), "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Perustesti
|
||||
Perustesti
|
||||
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=ISO-8859-1\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: gettext_basic.phpt:11
|
||||
msgid "Basic test"
|
||||
msgstr "Perustesti"
|
||||
+5
-6
@@ -7,19 +7,18 @@ PHP_ARG_WITH(gmp, for GNU MP support,
|
||||
|
||||
if test "$PHP_GMP" != "no"; then
|
||||
|
||||
for i in /usr/local /usr $PHP_GMP; do
|
||||
if test -f $i/include/gmp.h; then
|
||||
GMP_DIR=$i
|
||||
fi
|
||||
for i in $PHP_GMP /usr/local /usr; do
|
||||
test -f $i/include/gmp.h && GMP_DIR=$i && break
|
||||
done
|
||||
|
||||
if test -z "$GMP_DIR"; then
|
||||
AC_MSG_ERROR(Unable to locate gmp.h)
|
||||
fi
|
||||
|
||||
PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/lib, GMP_SHARED_LIBADD)
|
||||
PHP_ADD_INCLUDE($GMP_DIR/include)
|
||||
|
||||
PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared)
|
||||
AC_DEFINE(HAVE_GMP, 1, [ ])
|
||||
PHP_SUBST(GMP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/lib, GMP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_GMP, 1, [ ])
|
||||
fi
|
||||
+1
-1
@@ -311,7 +311,7 @@ static inline void gmp_zval_binary_ui_op2_ex(zval *return_value, zval **a_arg, z
|
||||
mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result1, *gmpnum_result2;
|
||||
zval r;
|
||||
int use_ui=0;
|
||||
unsigned long long_result;
|
||||
unsigned long long_result = 0;
|
||||
|
||||
FETCH_GMP_ZVAL(gmpnum_a, a_arg);
|
||||
if(gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) {
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef PHP_WIN32
|
||||
# include <winsock2.h>
|
||||
# include <winsock.h>
|
||||
# define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
# define ETIMEDOUT WSAETIMEDOUT
|
||||
# define bcopy memcpy
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@
|
||||
#include "SAPI.h"
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#include <winsock2.h>
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
|
||||
#if HYPERWAVE
|
||||
@@ -766,7 +766,7 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
list_entry new_le;
|
||||
|
||||
if (HwSG(max_links)!=-1 && HwSG(num_links)>=HwSG(max_links)) {
|
||||
php_error(E_ERROR, "%s(): Too many open links (%d)", get_active_function_name(TSRMLS_C), HwSG(num_links));
|
||||
php_error(E_ERROR, "%s(): Too many open links (%ld)", get_active_function_name(TSRMLS_C), HwSG(num_links));
|
||||
if(host) efree(host);
|
||||
if(username) efree(username);
|
||||
if(password) efree(password);
|
||||
@@ -774,7 +774,7 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (HwSG(max_persistent!=-1) && HwSG(num_persistent)>=HwSG(max_persistent)) {
|
||||
php_error(E_ERROR, "%s(): Too many open persistent links (%d)", get_active_function_name(TSRMLS_C), HwSG(num_persistent));
|
||||
php_error(E_ERROR, "%s(): Too many open persistent links (%ld)", get_active_function_name(TSRMLS_C), HwSG(num_persistent));
|
||||
if(host) efree(host);
|
||||
if(username) efree(username);
|
||||
if(password) efree(password);
|
||||
|
||||
+58
-39
@@ -15,44 +15,22 @@ if test "$PHP_ICONV" != "no"; then
|
||||
|
||||
if test "$iconv_avail" != "no"; then
|
||||
iconv_cflags_save="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $INCLUDES"
|
||||
AC_MSG_CHECKING([if iconv supports errno])
|
||||
AC_TRY_RUN([
|
||||
#define LIBICONV_PLUG
|
||||
#include <iconv.h>
|
||||
#include <errno.h>
|
||||
#if defined(_LIBICONV_H)
|
||||
#define icv_open(a, b) libiconv_open(a, b)
|
||||
#define icv_close(a) libiconv_close(a)
|
||||
#define icv(a, b, c, d, e) libiconv(a, b, c, d, e)
|
||||
#else
|
||||
#define icv_open(a, b) iconv_open(a, b)
|
||||
#define icv_close(a) iconv_close(a)
|
||||
#define icv(a, b, c, d, e) iconv(a, b, c, d, e)
|
||||
#endif
|
||||
iconv_ldflags_save="$LDFLAGS"
|
||||
|
||||
int main() {
|
||||
iconv_t cd;
|
||||
cd = icv_open( "*blahblah*", "*blahblah*" );
|
||||
if( cd == (iconv_t)(-1) ) {
|
||||
if( errno == EINVAL ) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
icv_close( cd );
|
||||
return 2;
|
||||
}
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1)
|
||||
AC_DEFINE([ICONV_SUPPORTS_ERRNO],1,[Whether iconv supports error no or not])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0)
|
||||
AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
|
||||
])
|
||||
if test -z "$ICONV_DIR"; then
|
||||
PHP_ICONV_PREFIX="/usr"
|
||||
else
|
||||
PHP_ICONV_PREFIX="$ICONV_DIR"
|
||||
fi
|
||||
|
||||
CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
|
||||
LDFLAGS="-L$PHP_ICONV_PREFIX/lib $LDFLAGS"
|
||||
|
||||
if test -r $PHP_ICONV_PREFIX/include/giconv.h; then
|
||||
PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
|
||||
else
|
||||
PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
|
||||
fi
|
||||
|
||||
if test -z "$iconv_lib_name"; then
|
||||
AC_MSG_CHECKING([if iconv is glibc's])
|
||||
@@ -108,9 +86,50 @@ int main() {
|
||||
;;
|
||||
esac
|
||||
|
||||
CFLAGS="$iconv_cflags_save"
|
||||
AC_MSG_CHECKING([if iconv supports errno])
|
||||
AC_TRY_RUN([
|
||||
#include <$PHP_ICONV_H_PATH>
|
||||
#include <errno.h>
|
||||
|
||||
PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared)
|
||||
int main() {
|
||||
iconv_t cd;
|
||||
cd = iconv_open( "*blahblah*", "*blahblah*" );
|
||||
if (cd == (iconv_t)(-1)) {
|
||||
if (errno == EINVAL) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
iconv_close( cd );
|
||||
return 2;
|
||||
}
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1)
|
||||
AC_DEFINE([ICONV_SUPPORTS_ERRNO],1,[Whether iconv supports error no or not])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0)
|
||||
AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([if your cpp allows macro usage in include lines])
|
||||
AC_TRY_COMPILE([
|
||||
#define FOO <$PHP_ICONV_H_PATH>
|
||||
#include FOO
|
||||
], [], [
|
||||
AC_MSG_RESULT([yes])
|
||||
PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>])
|
||||
AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
CFLAGS="$iconv_cflags_save"
|
||||
LDFLAGS="$iconv_ldflags_save"
|
||||
|
||||
PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared,, [-I\"$PHP_ICONV_PREFIX/include\"])
|
||||
PHP_SUBST(ICONV_SHARED_LIBADD)
|
||||
else
|
||||
AC_MSG_ERROR(Please reinstall the iconv library.)
|
||||
|
||||
+10
-21
@@ -36,8 +36,8 @@
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
|
||||
#ifdef HAVE_GICONV_H
|
||||
#include <giconv.h>
|
||||
#ifdef PHP_ICONV_H_PATH
|
||||
#include PHP_ICONV_H_PATH
|
||||
#else
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
@@ -46,17 +46,6 @@
|
||||
#include <gnu/libc-version.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBICONV
|
||||
#define LIBICONV_PLUG
|
||||
#define icv_open(a, b) libiconv_open(a, b)
|
||||
#define icv_close(a) libiconv_close(a)
|
||||
#define icv(a, b, c, d, e) libiconv(a, b, c, d, e)
|
||||
#else
|
||||
#define icv_open(a, b) iconv_open(a, b)
|
||||
#define icv_close(a) iconv_close(a)
|
||||
#define icv(a, b, c, d, e) iconv(a, (char **) b, c, d, e)
|
||||
#endif
|
||||
|
||||
/* {{{ iconv_functions[]
|
||||
*/
|
||||
function_entry iconv_functions[] = {
|
||||
@@ -213,7 +202,7 @@ php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
|
||||
in_size = in_len;
|
||||
|
||||
cd = icv_open(out_charset, in_charset);
|
||||
cd = iconv_open(out_charset, in_charset);
|
||||
|
||||
if (cd == (iconv_t)(-1)) {
|
||||
return PHP_ICONV_ERR_UNKNOWN;
|
||||
@@ -222,7 +211,7 @@ php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
out_buffer = (char *) emalloc(out_size + 1);
|
||||
out_p = out_buffer;
|
||||
|
||||
result = icv(cd, (const char **) &in_p, &in_size, (char **)
|
||||
result = iconv(cd, (const char **) &in_p, &in_size, (char **)
|
||||
&out_p, &out_left);
|
||||
|
||||
if (result == (size_t)(-1)) {
|
||||
@@ -235,7 +224,7 @@ php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
}
|
||||
|
||||
/* flush the shift-out sequences */
|
||||
result = icv(cd, NULL, NULL, &out_p, &out_left);
|
||||
result = iconv(cd, NULL, NULL, &out_p, &out_left);
|
||||
|
||||
if (result == (size_t)(-1)) {
|
||||
efree(out_buffer);
|
||||
@@ -246,7 +235,7 @@ php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
out_buffer[*out_len] = '\0';
|
||||
*out = out_buffer;
|
||||
|
||||
icv_close(cd);
|
||||
iconv_close(cd);
|
||||
|
||||
return PHP_ICONV_ERR_SUCCESS;
|
||||
|
||||
@@ -263,7 +252,7 @@ php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
*out = NULL;
|
||||
*out_len = 0;
|
||||
|
||||
cd = icv_open(out_charset, in_charset);
|
||||
cd = iconv_open(out_charset, in_charset);
|
||||
|
||||
if (cd == (iconv_t)(-1)) {
|
||||
if (errno == EINVAL) {
|
||||
@@ -280,7 +269,7 @@ php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
out_p = out_buf;
|
||||
|
||||
while (in_left > 0) {
|
||||
result = icv(cd, (const char **) &in_p, &in_left, (char **) &out_p, &out_left);
|
||||
result = iconv(cd, (char **) &in_p, &in_left, (char **) &out_p, &out_left);
|
||||
out_size = bsz - out_left;
|
||||
if (result == (size_t)(-1)) {
|
||||
if (errno == E2BIG && in_left > 0) {
|
||||
@@ -303,7 +292,7 @@ php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
if (result != (size_t)(-1)) {
|
||||
/* flush the shift-out sequences */
|
||||
for (;;) {
|
||||
result = icv(cd, NULL, NULL, (char **) &out_p, &out_left);
|
||||
result = iconv(cd, NULL, NULL, (char **) &out_p, &out_left);
|
||||
out_size = bsz - out_left;
|
||||
|
||||
if (result != (size_t)(-1)) {
|
||||
@@ -327,7 +316,7 @@ php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
|
||||
}
|
||||
}
|
||||
|
||||
icv_close(cd);
|
||||
iconv_close(cd);
|
||||
|
||||
if (result == (size_t)(-1)) {
|
||||
switch (errno) {
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Revision$ */
|
||||
|
||||
#ifndef PHP_ICONV_H
|
||||
#define PHP_ICONV_H
|
||||
|
||||
@@ -29,6 +31,11 @@
|
||||
#ifdef PHP_ATOM_INC
|
||||
#include "php_have_iconv.h"
|
||||
#include "php_have_libiconv.h"
|
||||
#include "php_have_glibc_iconv.h"
|
||||
#include "php_have_bsd_iconv.h"
|
||||
#include "php_iconv_supports_errno.h"
|
||||
#include "php_php_iconv_impl.h"
|
||||
#include "php_php_iconv_h_path.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -25,9 +25,7 @@ set_time_limit(5);
|
||||
|
||||
$test = 'Écrit par %s.';
|
||||
|
||||
if (!@iconv("ISO-8859-1", "ASCII//TRANSLIT", $test)) {
|
||||
echo 'wrong is right';
|
||||
}
|
||||
var_dump(iconv("ISO-8859-1", "ASCII//TRANSLIT", $test));
|
||||
?>
|
||||
--EXPECT--
|
||||
wrong is right
|
||||
string(14) "'Ecrit par %s."
|
||||
+4
-5
@@ -6,18 +6,17 @@ AC_DEFUN(IMAP_INC_CHK,[if test -r "$i$1/c-client.h"; then
|
||||
AC_DEFINE(HAVE_IMAP2000, 1, [ ])
|
||||
IMAP_DIR=$i
|
||||
IMAP_INC_DIR=$i$1
|
||||
break
|
||||
elif test -r "$i$1/rfc822.h"; then
|
||||
IMAP_DIR=$i;
|
||||
IMAP_INC_DIR=$i$1
|
||||
break
|
||||
])
|
||||
|
||||
AC_DEFUN(IMAP_LIB_CHK,[
|
||||
str="$IMAP_DIR/$1/lib$lib.*"
|
||||
for i in `echo $str`; do
|
||||
if test -r $i; then
|
||||
IMAP_LIBDIR=$IMAP_DIR/$1
|
||||
break 2
|
||||
fi
|
||||
test -r $i && IMAP_LIBDIR=$IMAP_DIR/$1 && break 2
|
||||
done
|
||||
])
|
||||
|
||||
@@ -137,7 +136,7 @@ if test "$PHP_IMAP" != "no"; then
|
||||
PHP_NEW_EXTENSION(imap, php_imap.c, $ext_shared)
|
||||
AC_DEFINE(HAVE_IMAP,1,[ ])
|
||||
|
||||
for i in /usr/local /usr $PHP_IMAP; do
|
||||
for i in $PHP_IMAP /usr/local /usr; do
|
||||
IMAP_INC_CHK()
|
||||
el[]IMAP_INC_CHK(/include/c-client)
|
||||
el[]IMAP_INC_CHK(/include/imap)
|
||||
|
||||
+3
-1
@@ -578,6 +578,7 @@ PHP_MINIT_FUNCTION(imap)
|
||||
REGISTER_LONG_CONSTANT("TYPEAUDIO", TYPEAUDIO , CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_LONG_CONSTANT("TYPEIMAGE", TYPEIMAGE , CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_LONG_CONSTANT("TYPEVIDEO", TYPEVIDEO , CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_LONG_CONSTANT("TYPEMODEL", TYPEMODEL , CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_LONG_CONSTANT("TYPEOTHER", TYPEOTHER , CONST_PERSISTENT | CONST_CS);
|
||||
/*
|
||||
TYPETEXT unformatted text
|
||||
@@ -587,6 +588,7 @@ PHP_MINIT_FUNCTION(imap)
|
||||
TYPEAUDIO audio
|
||||
TYPEIMAGE static image (GIF, JPEG, etc.)
|
||||
TYPEVIDEO video
|
||||
TYPEMODEL model
|
||||
TYPEOTHER unknown
|
||||
*/
|
||||
|
||||
@@ -632,7 +634,7 @@ PHP_RSHUTDOWN_FUNCTION(imap)
|
||||
if (EG(error_reporting) & E_NOTICE) {
|
||||
ecur = IMAPG(imap_errorstack);
|
||||
while (ecur != NIL) {
|
||||
php_error(E_NOTICE, "%s(): %s (errflg=%d)", get_active_function_name(TSRMLS_C), ecur->LTEXT, ecur->errflg);
|
||||
php_error(E_NOTICE, "%s(): %s (errflg=%ld)", get_active_function_name(TSRMLS_C), ecur->LTEXT, ecur->errflg);
|
||||
ecur = ecur->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /D HAVE_IFX=1 /D HAVE_IUS=1 /D "ZTS" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D IFX_VERSION=921 /D COMPILE_DL_INFORMIX=1 /D ZEND_DEBUG=0 /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /D HAVE_IFX=1 /D HAVE_IUS=1 /D "ZTS" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D IFX_VERSION=921 /D COMPILE_DL_INFORMIX=1 /D ZEND_DEBUG=0 /D HAVE_IFX_IUS=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
@@ -69,7 +69,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /D HAVE_IFX=1 /D HAVE_IUS=1 /D "ZTS" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D IFX_VERSION=921 /D COMPILE_DL_INFORMIX=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL" /D HAVE_IFX=1 /D HAVE_IUS=1 /D "ZTS" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D IFX_VERSION=921 /D COMPILE_DL_INFORMIX=1 /D HAVE_IFX_IUS=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x406 /d "_DEBUG"
|
||||
@@ -104,7 +104,7 @@ SOURCE=.\ifx.ec
|
||||
InputPath=.\ifx.ec
|
||||
|
||||
".\ifx.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
esql.exe -dcmdl -p -G -subsystem:windows -thread -I..\.. ifx.ec
|
||||
esql.exe -dcmdl -p -G -subsystem:windows -EDHAVE_IFX_IUS=1 -thread -I..\.. ifx.ec
|
||||
|
||||
# End Custom Build
|
||||
|
||||
@@ -114,7 +114,7 @@ InputPath=.\ifx.ec
|
||||
InputPath=.\ifx.ec
|
||||
|
||||
".\ifx.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
esql.exe -dcmdl -p -G -subsystem:windows -thread -I..\.. ifx.ec
|
||||
esql.exe -dcmdl -p -G -subsystem:windows -EDHAVE_IFX_IUS=1 -thread -I..\.. ifx.ec
|
||||
|
||||
# End Custom Build
|
||||
|
||||
@@ -129,6 +129,10 @@ InputPath=.\ifx.ec
|
||||
|
||||
SOURCE=.\php_informix.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_informix_includes.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
+68
-33
@@ -278,36 +278,70 @@ EXEC SQL END DECLARE SECTION;
|
||||
return(ifx_err_msg);
|
||||
}
|
||||
|
||||
static void ifx_do_close(link)
|
||||
EXEC SQL BEGIN DECLARE SECTION;
|
||||
PARAMETER char *link;
|
||||
EXEC SQL END DECLARE SECTION;
|
||||
{
|
||||
|
||||
EXEC SQL SET CONNECTION :link;
|
||||
|
||||
if (ifx_check() >= 0) {
|
||||
EXEC SQL DISCONNECT :link;
|
||||
|
||||
/* check if were in a transaction */
|
||||
if (SQLCODE == -1800) {
|
||||
EXEC SQL SET CONNECTION :link;
|
||||
EXEC SQL ROLLBACK WORK;
|
||||
if (ifx_check() == 0) {
|
||||
/* DISCONNECT again, after rollback */
|
||||
EXEC SQL DISCONNECT :link;
|
||||
if (ifx_check() < 0) {
|
||||
IFXG(sv_sqlcode) = SQLCODE;
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Disconnect link %s after Automatic Rollback fails (%s)", link, ifx_error(link));
|
||||
}
|
||||
}
|
||||
if (ifx_check() < 0) {
|
||||
/* CLOSE database if rollback or disconnect fails */
|
||||
EXEC SQL CLOSE DATABASE;
|
||||
if (ifx_check() < 0) {
|
||||
IFXG(sv_sqlcode) = SQLCODE;
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Close database fails %s (%s)", link, ifx_error(link));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (SQLCODE < 0) {
|
||||
IFXG(sv_sqlcode) = SQLCODE;
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Disconnect link %s fails (%s)", link, ifx_error(link));
|
||||
}
|
||||
}
|
||||
else {
|
||||
IFXG(sv_sqlcode) = SQLCODE;
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set connection %s fails (%s)", link, ifx_error(link));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void _close_ifx_link(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
EXEC SQL BEGIN DECLARE SECTION;
|
||||
char *link;
|
||||
EXEC SQL END DECLARE SECTION;
|
||||
|
||||
link=(char *)rsrc->ptr;
|
||||
|
||||
EXEC SQL SET CONNECTION :link;
|
||||
if (ifx_check() >= 0) {
|
||||
EXEC SQL close database;
|
||||
EXEC SQL DISCONNECT CURRENT;
|
||||
}
|
||||
ifx_do_close(link);
|
||||
|
||||
efree(link);
|
||||
IFXG(num_links)--;
|
||||
}
|
||||
|
||||
static void _close_ifx_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
EXEC SQL BEGIN DECLARE SECTION;
|
||||
char *link;
|
||||
EXEC SQL END DECLARE SECTION;
|
||||
|
||||
link = (char *)rsrc->ptr;
|
||||
|
||||
EXEC SQL SET CONNECTION :link;
|
||||
if (ifx_check() >= 0) {
|
||||
EXEC SQL close database;
|
||||
EXEC SQL DISCONNECT CURRENT;
|
||||
}
|
||||
ifx_do_close(link);
|
||||
|
||||
free(link);
|
||||
IFXG(num_persistent)--;
|
||||
IFXG(num_links)--;
|
||||
@@ -923,7 +957,7 @@ EXEC SQL END DECLARE SECTION;
|
||||
}
|
||||
len++;
|
||||
|
||||
EXEC SQL SET DESCRIPTOR :descrpid VALUE :i
|
||||
EXEC SQL SET DESCRIPTOR :i_descrpid VALUE :i
|
||||
DATA= :char_tmp,
|
||||
LENGTH= :len,
|
||||
INDICATOR= :indicator,
|
||||
@@ -2486,9 +2520,9 @@ EXEC SQL END DECLARE SECTION;
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
|
||||
IFXG(sv_sqlcode) = 0;
|
||||
|
||||
|
||||
ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result);
|
||||
|
||||
if (strcmp(Ifx_Result->cursorid, "") == 0) {
|
||||
@@ -2883,7 +2917,7 @@ EXEC SQL END DECLARE SECTION;
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &result) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
|
||||
IFXG(sv_sqlcode = 0);
|
||||
|
||||
ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result);
|
||||
@@ -2899,8 +2933,8 @@ EXEC SQL END DECLARE SECTION;
|
||||
cursorid = Ifx_Result->cursorid;
|
||||
statemid = Ifx_Result->statemid;
|
||||
descrpid = Ifx_Result->descrpid;
|
||||
|
||||
EXEC SQL set connection :ifx;
|
||||
|
||||
EXEC SQL set connection :ifx;
|
||||
PHP_IFX_CHECK_CONNECTION(ifx);
|
||||
|
||||
EXEC SQL free :statemid;
|
||||
@@ -3043,20 +3077,19 @@ static long php_intifx_create_blob(long type, long mode, char* param, long len,
|
||||
|
||||
if (*param && param != "") {
|
||||
|
||||
char *filename;
|
||||
|
||||
/*
|
||||
* copy the filename in param to filename in loc_fname
|
||||
* otherwise we'll unlink non-temporary files
|
||||
*
|
||||
* loc_fname gets filled by php_intifx_init_blob_infile
|
||||
*/
|
||||
if (Ifx_blob->BLOB.blob_data.loc_fname != NULL) {
|
||||
unlink(Ifx_blob->BLOB.blob_data.loc_fname);
|
||||
efree(Ifx_blob->BLOB.blob_data.loc_fname);
|
||||
if (php_copy_file(param, Ifx_blob->BLOB.blob_data.loc_fname TSRMLS_CC) == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create blob-resource file. File copy failed: %s", param);
|
||||
return -1;
|
||||
}
|
||||
Ifx_blob->BLOB.blob_data.loc_size = -1;
|
||||
}
|
||||
if ((filename = emalloc(len + 1)) == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource");
|
||||
return -1;
|
||||
}
|
||||
memcpy(filename, param, len);
|
||||
filename[len] = 0;
|
||||
Ifx_blob->BLOB.blob_data.loc_fname = filename;
|
||||
Ifx_blob->BLOB.blob_data.loc_size = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3103,6 +3136,8 @@ static long php_intifx_init_blob_infile(loc_t *blob, long new TSRMLS_DC)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
blob->loc_loctype = LOCFNAME;
|
||||
|
||||
if (new) {
|
||||
|
||||
filename = php_intifx_create_tmpfile(TSRMLS_C);
|
||||
@@ -3646,7 +3681,7 @@ static long php_intifx_count_descriptors(char *p_statemid TSRMLS_DC)
|
||||
if (ifx_check() >= 0) {
|
||||
|
||||
ret = s_da->sqld;
|
||||
|
||||
|
||||
/*
|
||||
* Thanks to DBD-Informix
|
||||
*/
|
||||
|
||||
+605
-660
File diff suppressed because it is too large.
Load diff
Loaded 100 of 674 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user