mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 19:20:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4cb0265a1 | ||
|
|
cdcb2d7497 | ||
|
|
f1d11e8e39 | ||
|
|
dd8b782bc8 | ||
|
|
b1997d6557 | ||
|
|
368e8230de | ||
|
|
b3ba19db6b | ||
|
|
bd92b11df6 | ||
|
|
5aaebd65a4 | ||
|
|
b8635add77 | ||
|
|
0915cc1302 | ||
|
|
bc2f6df355 | ||
|
|
4fd26968bc | ||
|
|
915560bb93 | ||
|
|
df2e5b8d25 | ||
|
|
e2d2290c0b | ||
|
|
4f674c6ee4 | ||
|
|
5122938742 | ||
|
|
d3c66d56fa | ||
|
|
eb1db15ac3 | ||
|
|
178a023ce2 | ||
|
|
0234cbb6f8 | ||
|
|
b13b1c94a6 | ||
|
|
ff348d64ee | ||
|
|
70e4bdbbba | ||
|
|
b5c273c916 | ||
|
|
cdcfd12108 | ||
|
|
432f0d1380 | ||
|
|
9fea178a1b | ||
|
|
7b06c28ea2 | ||
|
|
122d4aee9c | ||
|
|
c3cc057418 | ||
|
|
e9c850b1a3 | ||
|
|
6dba114cfd | ||
|
|
f9333d925c | ||
|
|
2b94eccbd2 | ||
|
|
f937a5ac8d | ||
|
|
60926976a1 | ||
|
|
1a95b4a034 | ||
|
|
c6126625e0 | ||
|
|
c631df654b | ||
|
|
b62a6be2ac | ||
|
|
b40451bb33 | ||
|
|
0f74febfad | ||
|
|
fdd16ecd9b | ||
|
|
78cf3608a6 | ||
|
|
f7a4997e48 | ||
|
|
25819c72da | ||
|
|
692e2b7d8b | ||
|
|
22c6c9ac87 | ||
|
|
419ad36db8 | ||
|
|
35381b7f40 | ||
|
|
6425b074be | ||
|
|
3897a8a32a | ||
|
|
957f2e9e5e | ||
|
|
03042693bc | ||
|
|
fc0f16cb5c | ||
|
|
36a817b592 | ||
|
|
04d802a79e | ||
|
|
362b334456 | ||
|
|
a2e7c6d2f0 | ||
|
|
1ed8a4d6d6 | ||
|
|
9058ae8ef0 | ||
|
|
1a57cb01e6 | ||
|
|
883aa84f8a | ||
|
|
2fc07dcac4 | ||
|
|
1aa6a85609 | ||
|
|
e1855006a0 | ||
|
|
8263990a67 | ||
|
|
23dfb5f6f7 | ||
|
|
94655dc8d2 | ||
|
|
6392009183 | ||
|
|
49873a87aa | ||
|
|
65eb7558ba | ||
|
|
6cba66fa78 | ||
|
|
7772923062 | ||
|
|
78f24c74c0 | ||
|
|
83d52ff5e9 | ||
|
|
d8f010ee63 | ||
|
|
b00125dd99 | ||
|
|
e7590db152 | ||
|
|
cdee41505c | ||
|
|
7e262e737d | ||
|
|
d12e89e730 | ||
|
|
a0a40fa408 | ||
|
|
1613a7561c | ||
|
|
4d593727a2 | ||
|
|
511c923785 | ||
|
|
4016bfcd71 | ||
|
|
853c6de65b | ||
|
|
8f8220917e | ||
|
|
a8c40d5b3a | ||
|
|
4417646d72 | ||
|
|
556dde6a34 | ||
|
|
da9aee9703 | ||
|
|
bfd9f29773 | ||
|
|
ddab8be51e | ||
|
|
ad2bb4bcb1 | ||
|
|
39178112fc | ||
|
|
b6882eddf6 | ||
|
|
12a7305e21 | ||
|
|
580c51215f | ||
|
|
74560ac75e | ||
|
|
b3a23c7d88 | ||
|
|
6bb0603c4f | ||
|
|
b964306fd7 | ||
|
|
66990d357c | ||
|
|
6a73387877 | ||
|
|
fe7e08432e | ||
|
|
4cc35aeaaf | ||
|
|
ceb607af13 | ||
|
|
30b7102746 | ||
|
|
b08e82a736 | ||
|
|
d84163c639 | ||
|
|
c0c141d0cf | ||
|
|
6a22ec3eda | ||
|
|
94039c35b9 | ||
|
|
f97132fe1a | ||
|
|
45c58fc449 | ||
|
|
99d3fe5a0c | ||
|
|
037f617a60 | ||
|
|
0e4ce3bcca | ||
|
|
9bf747605d | ||
|
|
5b39f5ca24 | ||
|
|
955a611211 | ||
|
|
67c7a37d9b | ||
|
|
43d33e8a99 | ||
|
|
39fd3a2b3c | ||
|
|
17a4191575 | ||
|
|
b73fe4a9b6 | ||
|
|
137b9210f2 | ||
|
|
5d017c3e2d | ||
|
|
43b4d73dc2 | ||
|
|
0c366503a6 | ||
|
|
46ba563fe1 | ||
|
|
bae3df7505 | ||
|
|
48d031aa6e | ||
|
|
1c98e49afd | ||
|
|
c7167ced0b | ||
|
|
19f11e401d | ||
|
|
b4b9615c0b | ||
|
|
60ef4a1ef6 | ||
|
|
9fe6294cdf | ||
|
|
bea1685a21 | ||
|
|
ef582b5397 | ||
|
|
2dcfcf7387 | ||
|
|
27cbcc6078 | ||
|
|
cc8cacd80e | ||
|
|
eeb9429de5 | ||
|
|
056f0aea30 | ||
|
|
4c85f48c89 | ||
|
|
3db4fe36a4 | ||
|
|
ebd24fc10f | ||
|
|
063196c8aa | ||
|
|
55d26cab56 | ||
|
|
39ba13c3ad | ||
|
|
64918d5168 | ||
|
|
30c4b8ff29 | ||
|
|
64b3f7d45b | ||
|
|
e877e1280c | ||
|
|
609a573b23 | ||
|
|
e4c11010f1 | ||
|
|
193bbbbd59 | ||
|
|
767abb9b66 | ||
|
|
5e733571b3 | ||
|
|
019f4f2c22 | ||
|
|
e1f42c3bbb | ||
|
|
05f86b6edb | ||
|
|
897083659e | ||
|
|
b64e5e6bd0 | ||
|
|
e90f0eda2d | ||
|
|
d6ba6c69fb | ||
|
|
827469c94e | ||
|
|
26f27ad7a8 | ||
|
|
ad3f197c55 | ||
|
|
e6fd4c1fc0 | ||
|
|
f1ab855cfe | ||
|
|
a515259047 | ||
|
|
e9a960bba6 | ||
|
|
fa2310b177 | ||
|
|
6cec8d8ed3 | ||
|
|
918dea038b | ||
|
|
b06436f171 | ||
|
|
5ae549c8fd | ||
|
|
db53d49623 | ||
|
|
46bd9ed597 | ||
|
|
229212c5ca | ||
|
|
718b7d160d | ||
|
|
6c56fd6898 | ||
|
|
1cfc27bb8c | ||
|
|
f694c09a35 | ||
|
|
4687f6e0ba | ||
|
|
88056c6bac | ||
|
|
c336c2e5d0 | ||
|
|
85560842c2 | ||
|
|
5ca166b1d2 | ||
|
|
6e164aa35a | ||
|
|
a8604e2c20 | ||
|
|
e52517d610 | ||
|
|
de65a02f1c | ||
|
|
ce24f04694 | ||
|
|
fbcfcfd8e6 | ||
|
|
c35177b6a4 | ||
|
|
a090cd733a | ||
|
|
b73ac1a57a | ||
|
|
777fb4f911 | ||
|
|
f8d8723ff1 | ||
|
|
050653466f | ||
|
|
6ffe4b2eff | ||
|
|
73fbaa9ee0 | ||
|
|
f578a07128 | ||
|
|
33a93474df | ||
|
|
94976f4694 | ||
|
|
495a5ab005 | ||
|
|
5f962f0e38 | ||
|
|
4f3d67ea89 | ||
|
|
4881a9cff4 | ||
|
|
80696a6f77 | ||
|
|
4a607c147d | ||
|
|
ecfe3ae047 | ||
|
|
a2c564b9e6 | ||
|
|
ecb9a94472 | ||
|
|
3189707681 | ||
|
|
d02332b43f | ||
|
|
4f34f5b0e3 | ||
|
|
53349c7769 | ||
|
|
124a0a5a69 | ||
|
|
4668ca80b5 | ||
|
|
2ee8b65e4e | ||
|
|
934a9037c8 | ||
|
|
d5fd4ecc48 | ||
|
|
6e18b9718d | ||
|
|
7af570b685 | ||
|
|
46505193b2 | ||
|
|
35ad8e6c46 | ||
|
|
46a94ebaa6 | ||
|
|
6704038c73 | ||
|
|
97b1247f2f | ||
|
|
50957fe3a5 | ||
|
|
d35dc78dd3 | ||
|
|
92cb2b634f | ||
|
|
a93fef41c2 | ||
|
|
b124f39010 | ||
|
|
dc74c5136e | ||
|
|
889e8990a2 | ||
|
|
c54f6df978 | ||
|
|
af5df4c813 | ||
|
|
d46ca6d3b5 | ||
|
|
f1521e18c0 | ||
|
|
5a40aa7217 | ||
|
|
8275f0d254 | ||
|
|
e0b0c49ae3 | ||
|
|
3eaa521ed9 | ||
|
|
b312b3af2e | ||
|
|
b053fb5af6 | ||
|
|
5d757fddf5 | ||
|
|
ca8a41215f | ||
|
|
bb8d9fa656 | ||
|
|
307a2259e9 | ||
|
|
35f0411352 | ||
|
|
d03720480f | ||
|
|
a845f681bb | ||
|
|
206cc46aab | ||
|
|
1c2b8b6abb | ||
|
|
ea98d7a72e | ||
|
|
4d8d8d73db | ||
|
|
cfc417af37 | ||
|
|
6bebbf1086 | ||
|
|
08f8621a9f | ||
|
|
d744463d33 | ||
|
|
cac5325aac | ||
|
|
af22257ba4 | ||
|
|
80ec45861a | ||
|
|
1648ab5750 | ||
|
|
952a193f94 | ||
|
|
e3d23b959f | ||
|
|
96498c468c | ||
|
|
847f637497 | ||
|
|
24086c42b6 | ||
|
|
12bad6796f | ||
|
|
f42081c6a2 | ||
|
|
8af64e6f34 | ||
|
|
7e32cc59f7 | ||
|
|
1a6cda905a | ||
|
|
8fd8c65df6 | ||
|
|
9a7bf0436a | ||
|
|
d6a608f7e1 | ||
|
|
4397aa9881 | ||
|
|
8c88903798 | ||
|
|
fb61eaf34a | ||
|
|
7b411d7cdf | ||
|
|
938c1230df | ||
|
|
96d24a59e5 | ||
|
|
085067a9aa | ||
|
|
c75f162165 | ||
|
|
ade24c7e35 | ||
|
|
8ad9bd1930 | ||
|
|
e4e7e2b8ee | ||
|
|
be6338014a | ||
|
|
adf8f72f14 | ||
|
|
0b03346bf8 | ||
|
|
edbf332cea | ||
|
|
8608857c1a | ||
|
|
f56d6b67b5 | ||
|
|
f8ee7db001 | ||
|
|
96a053288f | ||
|
|
10a7066591 | ||
|
|
9fd8469e94 | ||
|
|
fa09704cea | ||
|
|
b16441622e | ||
|
|
99013d8321 | ||
|
|
93054e9b38 | ||
|
|
9e253ac6e7 | ||
|
|
24b973cafc | ||
|
|
3e0d13859a | ||
|
|
06a2acc527 | ||
|
|
e29bccaae2 | ||
|
|
5c4609021f | ||
|
|
4fbc6a54ec | ||
|
|
7ce2bff511 | ||
|
|
9e445b043b | ||
|
|
d1a16fc86d | ||
|
|
cc23b8d600 | ||
|
|
f48cab06ff | ||
|
|
907763a20a | ||
|
|
b5b8303194 | ||
|
|
34d8ee27cc | ||
|
|
48a514673a | ||
|
|
d936dd1802 | ||
|
|
ee01362c98 | ||
|
|
ff766c1de2 | ||
|
|
421b6e0f2c | ||
|
|
75fc702162 | ||
|
|
59ff212783 | ||
|
|
366c261cce | ||
|
|
28add3cbf3 | ||
|
|
2539da79ba | ||
|
|
82cfb15677 | ||
|
|
87dbefa03b | ||
|
|
837732acc5 | ||
|
|
e2d044db40 | ||
|
|
8877a37f3e | ||
|
|
ae492897c6 | ||
|
|
d132b9985d | ||
|
|
6d04f1a141 | ||
|
|
3af4a22a3c | ||
|
|
2fffc2b06c | ||
|
|
0e2af69d55 | ||
|
|
899cb30275 | ||
|
|
1d50248937 | ||
|
|
e8d80c8bfd | ||
|
|
96dd763df4 | ||
|
|
a37d7529ba | ||
|
|
66908185b7 | ||
|
|
732f4af082 | ||
|
|
571dfc1e49 | ||
|
|
39125fdd47 | ||
|
|
7761a39314 | ||
|
|
cfbd6d852f | ||
|
|
42afb1f209 | ||
|
|
310bfadf3c | ||
|
|
bc8155d737 | ||
|
|
badd102c83 | ||
|
|
7c30b3c2dc | ||
|
|
5471bd7f6a | ||
|
|
555b177c83 | ||
|
|
1f0c710ef2 | ||
|
|
776cb8a669 | ||
|
|
57140f7db0 | ||
|
|
ee084018e7 | ||
|
|
5e22b47d05 | ||
|
|
1ca46f5ddd | ||
|
|
57d04afff0 | ||
|
|
4f760d11f8 | ||
|
|
ee992d9ff7 | ||
|
|
dad7c68b27 | ||
|
|
7d114c2e7f | ||
|
|
e8756a3c3c | ||
|
|
4390903e75 | ||
|
|
aa65955c8c | ||
|
|
96740db9ab | ||
|
|
2d549b7bdf | ||
|
|
d6091b2521 | ||
|
|
4892c04168 | ||
|
|
cd23986a7a | ||
|
|
d68cc96ebd | ||
|
|
fb5d7e4748 | ||
|
|
e1962da708 | ||
|
|
42e0e5dfb7 | ||
|
|
f7873d0aee | ||
|
|
b991dfdb1f | ||
|
|
cce5a75b26 | ||
|
|
115e370d6e | ||
|
|
09b8bbc97f | ||
|
|
1723b16898 | ||
|
|
af0c2c4760 | ||
|
|
01659b8b7c | ||
|
|
3bf5d05047 | ||
|
|
6dc86facd0 | ||
|
|
855034b955 | ||
|
|
b89985ac55 | ||
|
|
4744223055 | ||
|
|
667c59abd6 | ||
|
|
fb3adb16fc | ||
|
|
d967e29541 | ||
|
|
9b9363af5b | ||
|
|
7bba051009 | ||
|
|
27dccf7ac0 | ||
|
|
160c88cfa1 | ||
|
|
9ff94c82df | ||
|
|
d671793295 | ||
|
|
36b94bea86 | ||
|
|
569869855e | ||
|
|
3832578522 | ||
|
|
c0aab038ba | ||
|
|
a56e81fe13 | ||
|
|
5c1d0c3eab | ||
|
|
12ef53b204 | ||
|
|
23a423aea0 | ||
|
|
00054412e4 | ||
|
|
2507033c79 | ||
|
|
9f8ff2f968 | ||
|
|
a0e5576f23 | ||
|
|
cdf9cf3033 | ||
|
|
4028b77c34 | ||
|
|
0c9a16ffb7 | ||
|
|
defb5d1f7d | ||
|
|
085daea052 | ||
|
|
ce919053f3 | ||
|
|
4c12299c08 | ||
|
|
38bb4c1099 | ||
|
|
f031901b1b | ||
|
|
7655762e40 | ||
|
|
4526eee6db | ||
|
|
ea2abdc378 | ||
|
|
91841e0987 | ||
|
|
d49b4fa597 | ||
|
|
d7276e46e1 | ||
|
|
a134024ea3 | ||
|
|
98c8c6738a | ||
|
|
3c3c9d544e | ||
|
|
d93cf1f610 | ||
|
|
d09ab2ab42 | ||
|
|
546a927dc8 | ||
|
|
15b0218437 | ||
|
|
fbea458808 | ||
|
|
f3d407964e | ||
|
|
d3e8085c28 | ||
|
|
edb55a4166 | ||
|
|
2673b9be38 | ||
|
|
c803fbe66c | ||
|
|
c08473090c | ||
|
|
eb4446a812 | ||
|
|
5e76a611df | ||
|
|
8503b66cb6 | ||
|
|
785f1bd170 | ||
|
|
4e0b75042a | ||
|
|
6917639217 | ||
|
|
29b557ae61 | ||
|
|
4fdd6bacb7 | ||
|
|
326cb1bb0f | ||
|
|
f4f825a7a5 | ||
|
|
520591607e | ||
|
|
ecdd8ebbb9 | ||
|
|
24f9b1bd1e | ||
|
|
ad3dd7a718 | ||
|
|
2adf42f890 | ||
|
|
0f004989e9 | ||
|
|
67f846c4c3 | ||
|
|
1db1d4ccc8 | ||
|
|
33c42127f6 | ||
|
|
6f9c84f844 | ||
|
|
9c18f65572 | ||
|
|
3e326b91e7 | ||
|
|
07ae04de31 | ||
|
|
aabf4dc30f | ||
|
|
0225d5ef80 | ||
|
|
bffd08072c | ||
|
|
912131b304 | ||
|
|
1020d90072 | ||
|
|
41d1c12978 | ||
|
|
758eca1145 | ||
|
|
c7eb83def9 | ||
|
|
0391dea5be | ||
|
|
81461c78ef | ||
|
|
5e118fdc1a | ||
|
|
fe8bed8394 | ||
|
|
06033b5845 | ||
|
|
95601a1f16 | ||
|
|
dffe3d8d21 | ||
|
|
2b62ffdba7 | ||
|
|
8faa7980f3 | ||
|
|
627061c6a3 | ||
|
|
c71358379d | ||
|
|
28356530cd | ||
|
|
1f53affe7a | ||
|
|
098d0fcf55 | ||
|
|
ba0e26f2c1 | ||
|
|
14f163fd80 | ||
|
|
4bb8672039 | ||
|
|
fb235dc07f | ||
|
|
ddb869d674 | ||
|
|
e98be67b11 | ||
|
|
528ede93df | ||
|
|
d8b465caae | ||
|
|
8f7ce3ae3d | ||
|
|
c16b7585f6 | ||
|
|
2331863a5c | ||
|
|
ba035b47fd | ||
|
|
7a41848cc6 | ||
|
|
f6016c64e5 | ||
|
|
18174e18c9 | ||
|
|
e865c0b4ee | ||
|
|
87f9d62861 | ||
|
|
c408f289be | ||
|
|
8ac02f5926 | ||
|
|
8af2635eab | ||
|
|
759cc732cf | ||
|
|
c79f7e3f6b | ||
|
|
b38fde4694 | ||
|
|
4f0c8ef124 | ||
|
|
0e05af63ed | ||
|
|
44bf860516 | ||
|
|
387fbb2d4e | ||
|
|
43be94f2be | ||
|
|
4645ef2a49 | ||
|
|
bfdeea808a | ||
|
|
f37fabb803 | ||
|
|
c82245dea7 | ||
|
|
6e96ae79a3 | ||
|
|
4186a6e57c | ||
|
|
be7dd36297 | ||
|
|
4786cfa4bf | ||
|
|
556feffbd4 | ||
|
|
f611876b2e | ||
|
|
fa38267833 | ||
|
|
dac8acd1c1 | ||
|
|
b37019f963 | ||
|
|
fc4e43ec3c | ||
|
|
5725982614 | ||
|
|
b90a412302 | ||
|
|
0f60a5d540 | ||
|
|
17aa260703 | ||
|
|
f31fc6df21 | ||
|
|
26e9c79d4c | ||
|
|
a6cbd01d99 | ||
|
|
5ac0398f73 | ||
|
|
8715a7f12e | ||
|
|
9937006ac5 | ||
|
|
305f4984d2 | ||
|
|
84dcca9f48 | ||
|
|
5147f6cf8d | ||
|
|
9adf2ed4aa | ||
|
|
bfad6f6cee | ||
|
|
b26cd6839a | ||
|
|
ed05c54d2e | ||
|
|
b755935771 | ||
|
|
634f233cc0 | ||
|
|
838d359641 | ||
|
|
dc69d9228a | ||
|
|
96f2a45df3 | ||
|
|
09c10856f6 | ||
|
|
485f28aae9 | ||
|
|
e536b2700a | ||
|
|
937809f447 | ||
|
|
21d61978dc | ||
|
|
b6bd0f6806 | ||
|
|
b5455f7a7d | ||
|
|
d9061f95fa | ||
|
|
3d7b3c8bb2 | ||
|
|
db6f5e67a8 | ||
|
|
2361b4ea2a | ||
|
|
b4a43d0d94 | ||
|
|
9dfb40ea8c | ||
|
|
5dd3306551 | ||
|
|
74b8bc2e99 | ||
|
|
27a1ce801c | ||
|
|
ae2c5ee7d4 | ||
|
|
0e294f2121 | ||
|
|
51f8b64752 | ||
|
|
aafaa9c019 | ||
|
|
f0a55e20d5 | ||
|
|
5a8169902a | ||
|
|
ded5d566ad | ||
|
|
52c9cad8e4 |
No files matched your search
@@ -15,6 +15,25 @@ document ____executor_globals
|
||||
ZTS detection is automatically based on ext/standard module struct
|
||||
end
|
||||
|
||||
define print_cvs
|
||||
____executor_globals
|
||||
set $p = $eg.current_execute_data.CVs
|
||||
set $c = $eg.current_execute_data.op_array.last_var
|
||||
set $v = $eg.current_execute_data.op_array.vars
|
||||
set $i = 0
|
||||
|
||||
printf "Compiled variables count: %d\n", $c
|
||||
while $i < $c
|
||||
printf "%d = %s\n", $i, $v[$i].name
|
||||
if $p[$i] != 0
|
||||
printzv *$p[$i]
|
||||
else
|
||||
printf "*uninitialized*\n"
|
||||
end
|
||||
set $i = $i + 1
|
||||
end
|
||||
end
|
||||
|
||||
define dump_bt
|
||||
set $t = $arg0
|
||||
while $t
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>php-5.3</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
+3
-3
@@ -59,8 +59,8 @@ Exceptions:
|
||||
you're calling.
|
||||
|
||||
7. When commenting out code using a #if statement, do NOT use 0 only. Instead
|
||||
use "<cvs username here>_0". For example, #if FOO_0, where FOO is your
|
||||
cvs user foo. This allows easier tracking of why code was commented out,
|
||||
use "<svn username here>_0". For example, #if FOO_0, where FOO is your
|
||||
svn user foo. This allows easier tracking of why code was commented out,
|
||||
especially in bundled libraries.
|
||||
|
||||
8. Do not define functions that are not available. For instance, if a
|
||||
@@ -259,7 +259,7 @@ The file labelled 'EXPERIMENTAL' should include the following
|
||||
information::
|
||||
|
||||
Any authoring information (known bugs, future directions of the module).
|
||||
Ongoing status notes which may not be appropriate for CVS comments.
|
||||
Ongoing status notes which may not be appropriate for SVN comments.
|
||||
|
||||
Aliases & Legacy Documentation
|
||||
-----------------------------------
|
||||
|
||||
@@ -391,7 +391,7 @@ Apache 2.0 on Unix systems
|
||||
http://snaps.php.net/php5-latest.tar.gz or download binaries for
|
||||
Windows http://snaps.php.net/win32/php5-win32-latest.zip.
|
||||
* a prerelease version downloadable from http://qa.php.net/.
|
||||
* you have always the option to obtain PHP through anonymous CVS.
|
||||
* you have always the option to obtain PHP through SVN.
|
||||
|
||||
These versions of PHP are compatible to Apache 2.0.40 and later.
|
||||
|
||||
@@ -1308,8 +1308,8 @@ Introduction to PECL Installations
|
||||
|
||||
When building PHP modules, it's important to have known-good versions
|
||||
of the required tools (autoconf, automake, libtool, etc.) See the
|
||||
Anonymous CVS Instructions for details on the required tools, and
|
||||
required versions.
|
||||
SVN Instructions for details on the required tools, and required
|
||||
versions.
|
||||
__________________________________________________________________
|
||||
|
||||
Downloading PECL extensions
|
||||
@@ -1325,14 +1325,11 @@ Downloading PECL extensions
|
||||
PECL extensions that have releases listed on the PECL web site are
|
||||
available for download and installation using the pecl command.
|
||||
Specific revisions may also be specified.
|
||||
* CVS
|
||||
Most PECL extensions also reside in CVS. A web-based view may be
|
||||
seen at http://cvs.php.net/pecl/. To download straight from CVS,
|
||||
the following sequence of commands may be used. Note that phpfi is
|
||||
the password for user cvsread:
|
||||
* SVN
|
||||
All PECL files reside in SVN. A web-based view may be seen at
|
||||
http://svn.php.net/pecl/. To download straight from SVN, use:
|
||||
|
||||
$ cvs -d:pserver:cvsread@cvs.php.net:/repository login
|
||||
$ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname
|
||||
$ svn co http://svn.php.net/repository/pecl/<extname>/trunk <extname>
|
||||
|
||||
* Windows downloads
|
||||
Windows users may find compiled PECL binaries by downloading the
|
||||
@@ -1380,7 +1377,7 @@ Compiling shared PECL extensions with phpize
|
||||
Sometimes, using the pecl installer is not an option. This could be
|
||||
because you're behind a firewall, or it could be because the extension
|
||||
you want to install is not available as a PECL compatible package, such
|
||||
as unreleased extensions from CVS. If you need to build such an
|
||||
as unreleased extensions from SVN. If you need to build such an
|
||||
extension, you can use the lower-level build tools to perform the build
|
||||
manually.
|
||||
|
||||
@@ -1527,7 +1524,7 @@ The configuration file
|
||||
directives are documented in the manual though. For a complete list of
|
||||
directives available in your PHP version, please read your well
|
||||
commented php.ini file. Alternatively, you may find the the latest
|
||||
php.ini from CVS helpful too.
|
||||
php.ini from SVN helpful too.
|
||||
|
||||
Example 6-1. php.ini example
|
||||
; any text on a line after an unquoted semicolon (;) is ignored
|
||||
|
||||
+3
-4
@@ -89,14 +89,14 @@ test: all
|
||||
elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
|
||||
INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
|
||||
if test "$$INI_FILE"; then \
|
||||
$(EGREP) -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
$(EGREP) -v '^(magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
|
||||
else \
|
||||
echo > $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
INI_SCANNED_PATH=`$(top_builddir)/$(SAPI_CLI_PATH) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
|
||||
if test "$$INI_SCANNED_PATH"; then \
|
||||
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
|
||||
$(EGREP) -h -v '^(zend_)?extension(_debug)?(_ts)?[\t\ ]*=' "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
|
||||
$(EGREP) -h -v '^(magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*=' "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
|
||||
fi; \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
@@ -115,9 +115,8 @@ clean:
|
||||
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
|
||||
|
||||
distclean: clean
|
||||
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
|
||||
$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
|
||||
find . -name Makefile | xargs rm -f
|
||||
|
||||
.PHONY: all clean install distclean test
|
||||
.NOEXPORT:
|
||||
@@ -1,5 +1,253 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
19 Nov 2009, PHP 5.3.1
|
||||
|
||||
- Added "max_file_uploads" INI directive, which can be set to limit the
|
||||
number of file uploads per-request to 20 by default, to prevent possible
|
||||
DOS via temporary file exhaustion. (Ilia)
|
||||
- Added missing sanity checks around exif processing. (Ilia)
|
||||
- Added error constant when json_encode() detects an invalid UTF-8 sequence.
|
||||
(Scott)
|
||||
- Added support for ACL on Windows for thread safe SAPI (Apache2 for example)
|
||||
and fix its support on NTS. (Pierre)
|
||||
|
||||
- Upgraded bundled sqlite to version 3.6.19. (Scott)
|
||||
- Updated timezone database to version 2009.17 (2009q). (Derick)
|
||||
|
||||
- Fixed crash in com_print_typeinfo when an invalid typelib is given. (Pierre)
|
||||
- Fixed a safe_mode bypass in tempnam() identified by Grzegorz Stachowiak.
|
||||
(Rasmus)
|
||||
- Fixed a open_basedir bypass in posix_mkfifo() identified by Grzegorz
|
||||
Stachowiak. (Rasmus)
|
||||
- Fixed certificate validation inside php_openssl_apply_verification_policy
|
||||
(Ryan Sleevi, Ilia)
|
||||
- Fixed crash in SQLiteDatabase::ArrayQuery() and SQLiteDatabase::SingleQuery()
|
||||
when calling using Reflection. (Felipe)
|
||||
- Fixed crash when instantiating PDORow and PDOStatement through Reflection.
|
||||
(Felipe)
|
||||
- Fixed sanity check for the color index in imagecolortransparent. (Pierre)
|
||||
- Fixed scandir/readdir when used mounted points on Windows. (Pierre)
|
||||
- Fixed zlib.deflate compress filter to actually accept level parameter. (Jani)
|
||||
- Fixed leak on error in popen/exec (and related functions) on Windows.
|
||||
(Pierre)
|
||||
- Fixed possible bad caching of symlinked directories in the realpath cache
|
||||
on Windows. (Pierre)
|
||||
- Fixed atime and mtime in stat related functions on Windows. (Pierre)
|
||||
- Fixed spl_autoload_unregister/spl_autoload_functions wrt. Closures and
|
||||
Functors. (Christian Seiler)
|
||||
- Fixed open_basedir circumvention for "mail.log" ini directive.
|
||||
(Maksymilian Arciemowicz, Stas)
|
||||
- Fixed signature generation/validation for zip archives in ext/phar. (Greg)
|
||||
- Fixed memory leak in stream_is_local(). (Felipe, Tony)
|
||||
- Fixed BC break in mime_content_type(), removes the content encoding. (Scott)
|
||||
|
||||
- Changed ini file directives [PATH=](on Win32) and [HOST=](on all) to be case
|
||||
insensitive (garretts)
|
||||
- Restored shebang line check to CGI sapi (not checked by scanner anymore).
|
||||
(Jani)
|
||||
|
||||
- Improve symbolic, mounted volume and junctions support for realpath on
|
||||
Windows. (Pierre)
|
||||
- Improved readlink on Windows, suppress \??\ and use the drive syntax only.
|
||||
(Pierre)
|
||||
- Improved dns_get_record() AAAA support on windows. Always available when
|
||||
IPv6 is support is installed, format is now the same than on unix. (Pierre)
|
||||
- Improved the DNS functions on OSX to use newer APIs, also use Bind 9 API
|
||||
where available on other platforms. (Scott)
|
||||
- Improved shared extension loading on OSX to use the standard Unix dlopen()
|
||||
API. (Scott)
|
||||
|
||||
- Fixed bug #50063 (safe_mode_include_dir fails). (Johannes, christian at
|
||||
elmerot dot se)
|
||||
- Fixed bug #50052 (Different Hashes on Windows and Linux on wrong Salt size).
|
||||
(Pierre)
|
||||
- Fixed bug #49910 (no support for ././@LongLink for long filenames in phar
|
||||
tar support). (Greg)
|
||||
- Fixed bug #49908 (throwing exception in __autoload crashes when interface
|
||||
is not defined). (Felipe)
|
||||
- Fixed bug #49847 (exec() fails to return data inside 2nd parameter, given
|
||||
output lines >4095 bytes). (Ilia)
|
||||
- Fixed bug #49809 (time_sleep_until() is not available on OpenSolaris). (Jani)
|
||||
- Fixed bug #49757 (long2ip() can return wrong value in a multi-threaded
|
||||
applications). (Ilia, Florian Anderiasch)
|
||||
- Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #49732 (crashes when using fileinfo when timestamp conversion
|
||||
fails). (Pierre)
|
||||
- Fixed bug #49698 (Unexpected change in strnatcasecmp()). (Rasmus)
|
||||
- Fixed bug #49630 (imap_listscan function missing). (Felipe)
|
||||
- Fixed bug #49572 (use of C++ style comments causes build failure).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #49531 (CURLOPT_INFILESIZE sometimes causes warning "CURLPROTO_FILE
|
||||
cannot be set"). (Felipe)
|
||||
- Fixed bug #49517 (cURL's CURLOPT_FILE prevents file from being deleted after
|
||||
fclose). (Ilia)
|
||||
- Fixed bug #49470 (FILTER_SANITIZE_EMAIL allows disallowed characters).
|
||||
(Ilia)
|
||||
- Fixed bug #49447 (php engine need to correctly check for socket API
|
||||
return status on windows). (Sriram Natarajan)
|
||||
- Fixed bug #49391 (ldap.c utilizing deprecated ldap_modify_s). (Ilia)
|
||||
- Fixed bug #49361 (wordwrap() wraps incorrectly on end of line boundaries).
|
||||
(Ilia, code-it at mail dot ru)
|
||||
- Fixed bug #49372 (segfault in php_curl_option_curl). (Pierre)
|
||||
- Fixed bug #49306 (inside pdo_mysql default socket settings are ignored).
|
||||
(Ilia)
|
||||
- Fixed bug #49289 (bcmath module doesn't compile with phpize configure).
|
||||
(Jani)
|
||||
- Fixed bug #49286 (php://input (php_stream_input_read) is broken). (Jani)
|
||||
- Fixed bug #49269 (Ternary operator fails on Iterator object when used inside
|
||||
foreach declaration). (Etienne, Dmitry)
|
||||
- Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani)
|
||||
- Fixed bug #49223 (Inconsistency using get_defined_constants). (Garrett)
|
||||
- Fixed bug #49193 (gdJpegGetVersionString() inside gd_compact identifies
|
||||
wrong type in declaration). (Ilia)
|
||||
- Fixed bug #49183 (dns_get_record does not return NAPTR records). (Pierre)
|
||||
- Fixed bug #49144 (Import of schema from different host transmits original
|
||||
authentication details). (Dmitry)
|
||||
- Fixed bug #49142 (crash when exception thrown from __tostring()).
|
||||
(David Soria Parra)
|
||||
- Fixed bug #49986 (Missing ICU DLLs on windows package). (Pierre)
|
||||
- Fixed bug #49132 (posix_times returns false without error).
|
||||
(phpbugs at gunnu dot us)
|
||||
- Fixed bug #49125 (Error in dba_exists C code). (jdornan at stanford dot edu)
|
||||
- Fixed bug #49122 (undefined reference to mysqlnd_stmt_next_result on compile
|
||||
with --with-mysqli and MySQL 6.0). (Jani)
|
||||
- Fixed bug #49108 (2nd scan_dir produces segfault). (Felipe)
|
||||
- Fixed bug #49098 (mysqli segfault on error). (Rasmus)
|
||||
- Fixed bug #49095 (proc_get_status['exitcode'] fails on win32). (Felipe)
|
||||
- Fixed bug #49092 (ReflectionFunction fails to work with functions in fully
|
||||
qualified namespaces). (Kalle, Jani)
|
||||
- Fixed bug #49074 (private class static fields can be modified by using
|
||||
reflection). (Jani)
|
||||
- Fixed bug #49072 (feof never returns true for damaged file in zip). (Pierre)
|
||||
- Fixed bug #49065 ("disable_functions" php.ini option does not work on
|
||||
Zend extensions). (Stas)
|
||||
- Fixed bug #49064 (--enable-session=shared does not work: undefined symbol:
|
||||
php_url_scanner_reset_vars). (Jani)
|
||||
- Fixed bug #49056 (parse_ini_file() regression in 5.3.0 when using non-ASCII
|
||||
strings as option keys). (Jani)
|
||||
- Fixed bug #49052 (context option headers freed too early when using
|
||||
--with-curlwrappers). (Jani)
|
||||
- Fixed bug #49047 (The function touch() fails on directories on Windows).
|
||||
(Pierre)
|
||||
- Fixed bug #49032 (SplFileObject::fscanf() variables passed by reference).
|
||||
(Jani)
|
||||
- Fixed bug #49027 (mysqli_options() doesn't work when using mysqlnd). (Andrey)
|
||||
- Fixed bug #49026 (proc_open() can bypass safe_mode_protected_env_vars
|
||||
restrictions). (Ilia)
|
||||
- Fixed bug #49012 (phar tar signature algorithm reports as Unknown (0) in
|
||||
getSignature() call). (Greg)
|
||||
- Fixed bug #49020 (phar misinterprets ustar long filename standard).
|
||||
(Greg)
|
||||
- Fixed bug #49018 (phar tar stores long filenames wit prefix/name reversed).
|
||||
(Greg)
|
||||
- Fixed bug #49014 (dechunked filter broken when serving more than 8192 bytes
|
||||
in a chunk). (andreas dot streichardt at globalpark dot com, Ilia)
|
||||
- Fixed bug #49000 (PHP CLI in Interactive mode (php -a) crashes
|
||||
when including files from function). (Stas)
|
||||
- Fixed bug #48994 (zlib.output_compression does not output HTTP headers when
|
||||
set to a string value). (Jani)
|
||||
- Fixed bug #48980 (Crash when compiling with pdo_firebird). (Felipe)
|
||||
- Fixed bug #48962 (cURL does not upload files with specified filename).
|
||||
(Ilia)
|
||||
- Fixed bug #48929 (Double \r\n after HTTP headers when "header" context
|
||||
option is an array). (David Zülke)
|
||||
- Fixed bug #48913 (Too long error code strings in pdo_odbc driver).
|
||||
(naf at altlinux dot ru, Felipe)
|
||||
- Fixed bug #48912 (Namespace causes unexpected strict behaviour with
|
||||
extract()). (Dmitry)
|
||||
- Fixed bug #48909 (Segmentation fault in mysqli_stmt_execute()). (Andrey)
|
||||
- Fixed bug #48899 (is_callable returns true even if method does not exist in
|
||||
parent class). (Felipe)
|
||||
- Fixed bug #48893 (Problems compiling with Curl). (Felipe)
|
||||
- Fixed bug #48872 (string.c: errors: duplicate case values). (Kalle)
|
||||
- Fixed bug #48854 (array_merge_recursive modifies arrays after first one).
|
||||
(Felipe)
|
||||
- Fixed bug #48805 (IPv6 socket transport is not working). (Ilia)
|
||||
- Fixed bug #48802 (printf() returns incorrect outputted length). (Jani)
|
||||
- Fixed bug #48880 (Random Appearing open_basedir problem). (Rasmus, Gwynne)
|
||||
- Fixed bug #48791 (open office files always reported as corrupted). (Greg)
|
||||
- Fixed bug #48788 (RecursiveDirectoryIterator doesn't descend into symlinked
|
||||
directories). (Ilia)
|
||||
- Fixed bug #48783 (make install will fail saying phar file exists). (Greg)
|
||||
- Fixed bug #48774 (SIGSEGVs when using curl_copy_handle()).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #48771 (rename() between volumes fails and reports no error on
|
||||
Windows). (Pierre)
|
||||
- Fixed bug #48768 (parse_ini_*() crash with INI_SCANNER_RAW). (Jani)
|
||||
- Fixed bug #48763 (ZipArchive produces corrupt archive). (dani dot church at
|
||||
gmail dot com, Pierre)
|
||||
- Fixed bug #48762 (IPv6 address filter still rejects valid address). (Felipe)
|
||||
- Fixed bug #48757 (ReflectionFunction::invoke() parameter issues). (Kalle)
|
||||
- Fixed bug #48754 (mysql_close() crash php when no handle specified).
|
||||
(Johannes, Andrey)
|
||||
- Fixed bug #48752 (Crash during date parsing with invalid date). (Pierre)
|
||||
- Fixed bug #48746 (Unable to browse directories within Junction Points).
|
||||
(Pierre, Kanwaljeet Singla)
|
||||
- Fixed bug #48745 (mysqlnd: mysql_num_fields returns wrong column count for
|
||||
mysql_list_fields). (Andrey)
|
||||
- Fixed bug #48740 (PHAR install fails when INSTALL_ROOT is not the final
|
||||
install location). (james dot cohen at digitalwindow dot com, Greg)
|
||||
- Fixed bug #48733 (CURLOPT_WRITEHEADER|CURLOPT_FILE|CURLOPT_STDERR warns on
|
||||
files that have been opened with r+). (Ilia)
|
||||
- Fixed bug #48719 (parse_ini_*(): scanner_mode parameter is not checked for
|
||||
sanity). (Jani)
|
||||
- Fixed bug #48718 (FILTER_VALIDATE_EMAIL does not allow numbers in domain
|
||||
components). (Ilia)
|
||||
- Fixed bug #48681 (openssl signature verification for tar archives broken).
|
||||
(Greg)
|
||||
- Fixed bug #48660 (parse_ini_*(): dollar sign as last character of value
|
||||
fails). (Jani)
|
||||
- Fixed bug #48645 (mb_convert_encoding() doesn't understand hexadecimal
|
||||
html-entities). (Moriyoshi)
|
||||
- Fixed bug #48637 ("file" fopen wrapper is overwritten when using
|
||||
--with-curlwrappers). (Jani)
|
||||
- Fixed bug #48608 (Invalid libreadline version not detected during configure).
|
||||
(Jani)
|
||||
- Fixed bug #48400 (imap crashes when closing stream opened with
|
||||
OP_PROTOTYPE flag). (Jani)
|
||||
- Fixed bug #48377 (error message unclear on converting phar with existing
|
||||
file). (Greg)
|
||||
- Fixed bug #48247 (Infinite loop and possible crash during startup with
|
||||
errors when errors are logged). (Jani)
|
||||
- Fixed bug #48198 error: 'MYSQLND_LLU_SPEC' undeclared. Cause for #48780 and
|
||||
#46952 - both fixed too. (Andrey)
|
||||
- Fixed bug #48189 (ibase_execute error in return param). (Kalle)
|
||||
- Fixed bug #48182 (ssl handshake fails during asynchronous socket connection).
|
||||
(Sriram Natarajan)
|
||||
- Fixed bug #48116 (Fixed build with Openssl 1.0). (Pierre,
|
||||
Al dot Smith at aeschi dot ch dot eu dot org)
|
||||
- Fixed bug #48057 (Only the date fields of the first row are fetched, others
|
||||
are empty). (info at programmiernutte dot net)
|
||||
- Fixed bug #47481 (natcasesort() does not sort extended ASCII characters
|
||||
correctly). (Herman Radtke)
|
||||
- Fixed bug #47351 (Memory leak in DateTime). (Derick, Tobias John)
|
||||
- Fixed bug #47273 (Encoding bug in SoapServer->fault). (Dmitry)
|
||||
- Fixed bug #46682 (touch() afield returns different values on windows).
|
||||
(Pierre)
|
||||
- Fixed bug #46614 (Extended MySQLi class gives incorrect empty() result).
|
||||
(Andrey)
|
||||
- Fixed bug #46020 (with Sun Java System Web Server 7.0 on HPUX, #define HPUX).
|
||||
(Uwe Schindler)
|
||||
- Fixed bug #45905 (imagefilledrectangle() clipping error).
|
||||
(markril at hotmail dot com, Pierre)
|
||||
- Fixed bug #45554 (Inconsistent behavior of the u format char). (Derick)
|
||||
- Fixed bug #45141 (setcookie will output expires years of >4 digits). (Ilia)
|
||||
- Fixed bug #44683 (popen crashes when an invalid mode is passed). (Pierre)
|
||||
- Fixed bug #43510 (stream_get_meta_data() does not return same mode as used
|
||||
in fopen). (Jani)
|
||||
- Fixed bug #42434 (ImageLine w/ antialias = 1px shorter). (wojjie at gmail dot
|
||||
com, Kalle)
|
||||
- Fixed bug #40013 (php_uname() does not return nodename on Netware (Guenter
|
||||
Knauf)
|
||||
- Fixed bug #38091 (Mail() does not use FQDN when sending SMTP helo).
|
||||
(Kalle, Rick Yorgason)
|
||||
- Fixed bug #28038 (Sent incorrect RCPT TO commands to SMTP server) (Garrett)
|
||||
- Fixed bug #27051 (Impersonation with FastCGI does not exec process as
|
||||
impersonated user). (Pierre)
|
||||
- Fixed PECL bug #16842 (oci_error return false when NO_DATA_FOUND is raised).
|
||||
(Chris Jones)
|
||||
|
||||
30 Jun 2009, PHP 5.3.0
|
||||
- Upgraded bundled PCRE to version 7.9. (Nuno)
|
||||
- Upgraded bundled sqlite to version 3.6.15. (Scott)
|
||||
|
||||
@@ -210,6 +210,10 @@ f.e. ``ChangeLog-4.php`` from the NEWS file
|
||||
|
||||
III. ``s/Fixed bug #\([0-9]\+\)/<?php bugfix(\1); ?>/``
|
||||
|
||||
IV. ``s/Fixed PECL bug #\([0-9]\+\)/<?php peclbugfix(\1); ?>/``
|
||||
|
||||
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
|
||||
|
||||
4. ``cp releases/4_4_0.php releases/4_4_1.php``
|
||||
|
||||
5. ``cvs add releases/4_4_1.php``
|
||||
@@ -248,9 +252,8 @@ number, and remove the RC from there.
|
||||
|
||||
II. For PHP5: Set $CURRENT_QA_RELEASE_5 to false
|
||||
|
||||
|
||||
Re-releasing the same version (or -pl)
|
||||
------------------------------------
|
||||
--------------------------------------
|
||||
|
||||
1. Commit the new binaries to ``phpweb/distributions/``
|
||||
|
||||
@@ -281,4 +284,3 @@ to upgrade.
|
||||
5. Wait an hour or two, then send a mail to php-announce@lists.php.net,
|
||||
php-general@lists.php.net and internals@lists.php.net with a text similar to
|
||||
the news entry.
|
||||
|
||||
+10
-30
@@ -8,11 +8,11 @@ part is making it acceptable for inclusion into our repository. :-)
|
||||
|
||||
How to create patch?
|
||||
--------------------
|
||||
We are working with CVS. You need to get CVS source to create a patch
|
||||
that we accept. Visit http://www.php.net/anoncvs.php to get CVS
|
||||
source. You can check out older versions, but make sure you get
|
||||
the default branch (i.e. Do not use -r option when you check out the
|
||||
CVS source)
|
||||
We use Subversion (SVN) for revision control. You need to get the
|
||||
source from SVN in order to create a patch. Read
|
||||
http://www.php.net/svn.php for help on using SVN. You can check out
|
||||
older branches, but make sure you get trunk as well and make your
|
||||
patch work there.
|
||||
|
||||
Read CODING_STANDARDS file before you start working.
|
||||
|
||||
@@ -21,7 +21,7 @@ add a new feature to PHP. After you finished editing, please test your
|
||||
patch. Read README.TESTING for testing.
|
||||
|
||||
After you finish testing your patch, take diff file using
|
||||
"cvs diff > your.patch" command.
|
||||
"svn diff > your.patch" command.
|
||||
|
||||
Read README.TESTING for submitting a test script for your patch. This is
|
||||
not strictly required, but it is preferred to submit a test script along
|
||||
@@ -41,25 +41,8 @@ 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.
|
||||
|
||||
If you are new to CVS (Concurrent Versions System), visit
|
||||
http://cvshome.org/ for details.
|
||||
|
||||
|
||||
Recommended CVS client settings for creating patch file
|
||||
------------------------------------------------------
|
||||
Recommended ~/.cvsrc file setting is:
|
||||
------
|
||||
cvs -z3
|
||||
update -d -P
|
||||
checkout -P
|
||||
diff -u
|
||||
|
||||
------
|
||||
diff -u means:
|
||||
-u Use the unified output format.
|
||||
|
||||
With this CVS setting, you don't have to worry about adding/deleting
|
||||
newlines and spaces.
|
||||
If you are new to SVN (Subversion), visit
|
||||
http://svnbook.red-bean.com/ for details.
|
||||
|
||||
|
||||
Check list for submitting patch
|
||||
@@ -70,10 +53,7 @@ Check list for submitting patch
|
||||
web server error logs when you test your patch?
|
||||
- Did you build PHP for multi-threaded web servers. (Optional)
|
||||
- Did you create test script for "make test"? (Recommended)
|
||||
- Did you check your patch is unified format and it does not
|
||||
contain white space changes? (If you are not using recommended
|
||||
cvs setting)
|
||||
- Did you update CVS source before you take final patch?
|
||||
- Did you update SVN source before you take final patch?
|
||||
- Did you read the patch again?
|
||||
|
||||
|
||||
@@ -118,7 +98,7 @@ these questions:
|
||||
|
||||
What happens when your patch is applied?
|
||||
----------------------------------------
|
||||
Your name will be included together with your email address in the CVS
|
||||
Your name will be included together with your email address in the SVN
|
||||
commit log. If your patch affects end-users, a brief description
|
||||
and your name might be added to the NEWS file.
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
====================
|
||||
CVS Commit Rules
|
||||
SVN Commit Rules
|
||||
====================
|
||||
|
||||
This is the first file you should be reading after you get your CVS account.
|
||||
We'll assume you're basically familiar with CVS, but feel free to post
|
||||
This is the first file you should be reading after you get your SVN account.
|
||||
We'll assume you're basically familiar with SVN, but feel free to post
|
||||
your questions on the mailing list. Please have a look at
|
||||
http://cvsbook.red-bean.com/ for more detailed information on CVS.
|
||||
http://svnbook.red-bean.com/ for more detailed information on SVN.
|
||||
|
||||
PHP is developed through the efforts of a large number of people.
|
||||
Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following
|
||||
some basic rules with regards to CVS usage will::
|
||||
Collaboration is a Good Thing(tm), and SVN lets us do this. Thus, following
|
||||
some basic rules with regards to SVN usage will::
|
||||
|
||||
a. Make everybody happier, especially those responsible for maintaining
|
||||
the CVS itself.
|
||||
the SVN itself.
|
||||
|
||||
b. Keep the changes consistently well documented and easily trackable.
|
||||
|
||||
@@ -43,21 +43,21 @@ Having said that, here are the organizational rules::
|
||||
|
||||
Currently we have the following branches in use::
|
||||
|
||||
HEAD Will become PHP 6.0. This CVS branch is for active development.
|
||||
trunk Will become PHP 6.0. This CVS branch is for active development.
|
||||
|
||||
PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
|
||||
larger enhancements.
|
||||
branches/PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
|
||||
larger enhancements.
|
||||
|
||||
PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
branches/PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
|
||||
on this branch (Consult the releasemaster prior to commit).
|
||||
|
||||
PHP_5_1 This branch is closed.
|
||||
branches/PHP_5_1 This branch is closed.
|
||||
|
||||
PHP_4_4 This branch is closed.
|
||||
branches/PHP_4_4 This branch is closed.
|
||||
|
||||
The next few rules are more of a technical nature::
|
||||
|
||||
1. All changes should first go to HEAD and then get merged from HEAD
|
||||
1. All changes should first go to trunk and then get merged from trunk
|
||||
(aka MFH'ed) to all other relevant branches.
|
||||
|
||||
2. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
|
||||
@@ -132,11 +132,11 @@ If you don't see your messages in ChangeLog right away, don't worry!
|
||||
These files are updated once a day, so your stuff will not show up until
|
||||
somewhat later.
|
||||
|
||||
When you change the NEWS file for a bug fix, then please keep the bugs
|
||||
When you change the NEWS file for a bug fix, then please keep the bugs
|
||||
sorted in decreasing order under the fixed version.
|
||||
|
||||
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
|
||||
to look at PHP CVS repository in various ways.
|
||||
to look at PHP SVN repository in various ways.
|
||||
|
||||
To receive daily updates to ChangeLog and NEWS, send an empty message to
|
||||
php-cvs-daily-subscribe@lists.php.net.
|
||||
+139
-26
@@ -271,9 +271,6 @@ CWD_API int php_sys_stat(const char *path, struct stat *buf) /* {{{ */
|
||||
buf->st_atime = FileTimeToUnixTime(data.ftLastAccessTime);
|
||||
buf->st_ctime = FileTimeToUnixTime(data.ftCreationTime);
|
||||
buf->st_mtime = FileTimeToUnixTime(data.ftLastWriteTime);
|
||||
if (buf->st_mtime != buf->st_atime) {
|
||||
buf->st_atime = buf->st_mtime;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -431,6 +428,31 @@ CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
static inline unsigned long realpath_cache_key(const char *path, int path_len TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
register unsigned long h;
|
||||
char *bucket_key = tsrm_win32_get_path_sid_key(path TSRMLS_CC);
|
||||
char *bucket_key_start = (char *)bucket_key;
|
||||
const char *e = bucket_key + strlen(bucket_key);
|
||||
|
||||
if (!bucket_key) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (h = 2166136261U; bucket_key < e;) {
|
||||
h *= 16777619;
|
||||
h ^= *bucket_key++;
|
||||
}
|
||||
/* if no SID were present the path is returned. Otherwise a Heap
|
||||
allocated string is returned. */
|
||||
if (bucket_key_start != path) {
|
||||
LocalFree(bucket_key_start);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
/* }}} */
|
||||
#else
|
||||
static inline unsigned long realpath_cache_key(const char *path, int path_len) /* {{{ */
|
||||
{
|
||||
register unsigned long h;
|
||||
@@ -444,6 +466,7 @@ static inline unsigned long realpath_cache_key(const char *path, int path_len) /
|
||||
return h;
|
||||
}
|
||||
/* }}} */
|
||||
#endif /* defined(PHP_WIN32) */
|
||||
|
||||
CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
@@ -464,7 +487,11 @@ CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */
|
||||
|
||||
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
#ifdef PHP_WIN32
|
||||
unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
|
||||
#else
|
||||
unsigned long key = realpath_cache_key(path, path_len);
|
||||
#endif
|
||||
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
|
||||
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
|
||||
|
||||
@@ -497,8 +524,12 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
|
||||
if (CWDG(realpath_cache_size) + size <= CWDG(realpath_cache_size_limit)) {
|
||||
realpath_cache_bucket *bucket = malloc(size);
|
||||
unsigned long n;
|
||||
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
bucket->key = realpath_cache_key(path, path_len TSRMLS_CC);
|
||||
#else
|
||||
bucket->key = realpath_cache_key(path, path_len);
|
||||
#endif
|
||||
bucket->path = (char*)bucket + sizeof(realpath_cache_bucket);
|
||||
memcpy(bucket->path, path, path_len+1);
|
||||
bucket->path_len = path_len;
|
||||
@@ -527,7 +558,12 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
|
||||
|
||||
static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
#ifdef PHP_WIN32
|
||||
unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC);
|
||||
#else
|
||||
unsigned long key = realpath_cache_key(path, path_len);
|
||||
#endif
|
||||
|
||||
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
|
||||
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
|
||||
|
||||
@@ -564,13 +600,13 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
#ifdef TSRM_WIN32
|
||||
WIN32_FIND_DATA data;
|
||||
HANDLE hFind;
|
||||
TSRM_ALLOCA_FLAG(use_heap_large)
|
||||
#else
|
||||
struct stat st;
|
||||
#endif
|
||||
realpath_cache_bucket *bucket;
|
||||
char *tmp;
|
||||
TSRM_ALLOCA_FLAG(use_heap)
|
||||
TSRM_ALLOCA_FLAG(use_heap_large)
|
||||
|
||||
while (1) {
|
||||
if (len <= start) {
|
||||
@@ -670,9 +706,14 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
/* File is a reparse point. Get the target */
|
||||
HANDLE hLink = NULL;
|
||||
REPARSE_DATA_BUFFER * pbuffer;
|
||||
unsigned int retlength = 0, rname_off = 0;
|
||||
int bufindex = 0, rname_len = 0, isabsolute = 0;
|
||||
unsigned int retlength = 0;
|
||||
int bufindex = 0, isabsolute = 0;
|
||||
wchar_t * reparsetarget;
|
||||
BOOL isVolume = FALSE;
|
||||
char printname[MAX_PATH];
|
||||
char substitutename[MAX_PATH];
|
||||
int printname_len, substitutename_len;
|
||||
int substitutename_off = 0;
|
||||
|
||||
if(++(*ll) > LINK_MAX) {
|
||||
return -1;
|
||||
@@ -693,37 +734,108 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
CloseHandle(hLink);
|
||||
|
||||
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
|
||||
rname_len = pbuffer->SymbolicLinkReparseBuffer.PrintNameLength/2;
|
||||
rname_off = pbuffer->SymbolicLinkReparseBuffer.PrintNameOffset/2;
|
||||
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
|
||||
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
|
||||
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
|
||||
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
|
||||
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
|
||||
printname_len + 1,
|
||||
printname, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
|
||||
printname[printname_len] = 0;
|
||||
|
||||
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
|
||||
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
|
||||
reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
|
||||
substitutename_len + 1,
|
||||
substitutename, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
substitutename[substitutename_len] = 0;
|
||||
}
|
||||
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
|
||||
rname_len = pbuffer->MountPointReparseBuffer.PrintNameLength/2;
|
||||
rname_off = pbuffer->MountPointReparseBuffer.PrintNameOffset/2;
|
||||
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
|
||||
isabsolute = 1;
|
||||
}
|
||||
else {
|
||||
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
|
||||
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
|
||||
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
|
||||
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
|
||||
printname_len + 1,
|
||||
printname, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0;
|
||||
|
||||
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
|
||||
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
|
||||
reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR),
|
||||
substitutename_len + 1,
|
||||
substitutename, MAX_PATH, NULL, NULL
|
||||
)) {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
};
|
||||
substitutename[substitutename_len] = 0;
|
||||
} else {
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Convert wide string to narrow string */
|
||||
for(bufindex = 0; bufindex < rname_len; bufindex++) {
|
||||
*(path + bufindex) = (char)(reparsetarget[rname_off + bufindex]);
|
||||
if(isabsolute && substitutename_len > 4) {
|
||||
/* Do not resolve volumes (for now). A mounted point can
|
||||
target a volume without a drive, it is not certain that
|
||||
all IO functions we use in php and its deps support
|
||||
path with volume GUID instead of the DOS way, like:
|
||||
d:\test\mnt\foo
|
||||
\\?\Volume{62d1c3f8-83b9-11de-b108-806e6f6e6963}\foo
|
||||
*/
|
||||
if (strncmp(substitutename, "\\??\\Volume{",11) == 0
|
||||
|| strncmp(substitutename, "\\\\?\\Volume{",11) == 0) {
|
||||
isVolume = TRUE;
|
||||
substitutename_off = 0;
|
||||
} else
|
||||
/* do not use the \??\ and \\?\ prefix*/
|
||||
if (strncmp(substitutename, "\\??\\", 4) == 0
|
||||
|| strncmp(substitutename, "\\\\?\\", 4) == 0) {
|
||||
substitutename_off = 4;
|
||||
}
|
||||
}
|
||||
|
||||
*(path + bufindex) = 0;
|
||||
if (!isVolume) {
|
||||
char * tmp = substitutename + substitutename_off;
|
||||
for(bufindex = 0; bufindex < (substitutename_len - substitutename_off); bufindex++) {
|
||||
*(path + bufindex) = *(tmp + bufindex);
|
||||
}
|
||||
|
||||
*(path + bufindex) = 0;
|
||||
j = bufindex;
|
||||
} else {
|
||||
j = len;
|
||||
}
|
||||
|
||||
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf(stderr, "reparse: print: %s ", printname);
|
||||
fprintf(stderr, "sub: %s ", substitutename);
|
||||
fprintf(stderr, "resolved: %s ", path);
|
||||
#endif
|
||||
tsrm_free_alloca(pbuffer, use_heap_large);
|
||||
j = bufindex;
|
||||
|
||||
if(isabsolute == 1) {
|
||||
/* use_realpath is 0 in the call below coz path is absolute*/
|
||||
j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory TSRMLS_CC);
|
||||
if(j < 0) {
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
if (!((j == 3) && (path[1] == ':') && (path[2] == '\\'))) {
|
||||
/* use_realpath is 0 in the call below coz path is absolute*/
|
||||
j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory TSRMLS_CC);
|
||||
if(j < 0) {
|
||||
tsrm_free_alloca(tmp, use_heap);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -741,6 +853,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
directory = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
||||
|
||||
if(link_is_dir) {
|
||||
*link_is_dir = directory;
|
||||
@@ -1195,7 +1308,7 @@ static void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
|
||||
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
|
||||
{
|
||||
FILETIME mtime, atime;
|
||||
HANDLE hFile;
|
||||
@@ -1371,7 +1484,7 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC) /* {{{ */
|
||||
/* rename on windows will fail if newname already exists.
|
||||
MoveFileEx has to be used */
|
||||
#ifdef TSRM_WIN32
|
||||
retval = (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING) == 0) ? -1 : 0;
|
||||
retval = (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0) ? -1 : 0;
|
||||
#else
|
||||
retval = rename(oldname, newname);
|
||||
#endif
|
||||
|
||||
@@ -288,7 +288,7 @@ CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_
|
||||
/* rename on windows will fail if newname already exists.
|
||||
MoveFileEx has to be used */
|
||||
#if defined(TSRM_WIN32)
|
||||
# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING) == 0 ? -1 : 0)
|
||||
# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0 ? -1 : 0)
|
||||
#else
|
||||
# define VCWD_RENAME(oldname, newname) rename(oldname, newname)
|
||||
#endif
|
||||
@@ -311,8 +311,13 @@ CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_
|
||||
#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC)
|
||||
|
||||
#if HAVE_UTIME
|
||||
#define VCWD_UTIME(path, time) utime(path, time)
|
||||
# ifdef TSRM_WIN32
|
||||
# define VCWD_UTIME(path, time) win32_utime(path, time)
|
||||
# else
|
||||
# define VCWD_UTIME(path, time) utime(path, time)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define VCWD_CHMOD(path, mode) chmod(path, mode)
|
||||
#if !defined(TSRM_WIN32) && !defined(NETWARE)
|
||||
#define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
|
||||
|
||||
+213
-33
@@ -30,7 +30,7 @@
|
||||
#include "TSRM.h"
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
|
||||
#include <Sddl.h>
|
||||
#include "tsrm_win32.h"
|
||||
#include "tsrm_virtual_cwd.h"
|
||||
|
||||
@@ -42,25 +42,21 @@ static tsrm_win32_globals win32_globals;
|
||||
|
||||
static void tsrm_win32_ctor(tsrm_win32_globals *globals TSRMLS_DC)
|
||||
{
|
||||
HANDLE process_token = NULL;
|
||||
|
||||
globals->process = NULL;
|
||||
globals->shm = NULL;
|
||||
globals->process_size = 0;
|
||||
globals->shm_size = 0;
|
||||
globals->comspec = _strdup((GetVersion()<0x80000000)?"cmd.exe":"command.com");
|
||||
globals->impersonation_token = NULL;
|
||||
|
||||
/* Access check requires impersonation token. Create a duplicate token. */
|
||||
if(OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE | TOKEN_QUERY, &process_token)) {
|
||||
DuplicateToken(process_token, SecurityImpersonation, &globals->impersonation_token);
|
||||
}
|
||||
|
||||
/* impersonation_token will be closed when the process dies */
|
||||
if(process_token != NULL) {
|
||||
CloseHandle(process_token);
|
||||
process_token = NULL;
|
||||
}
|
||||
/* Set it to INVALID_HANDLE_VALUE
|
||||
* It will be initialized correctly in tsrm_win32_access or set to
|
||||
* NULL if no impersonation has been done.
|
||||
* the impersonated token can't be set here as the impersonation
|
||||
* will happen later, in fcgi_accept_request (or whatever is the
|
||||
* SAPI being used).
|
||||
*/
|
||||
globals->impersonation_token = INVALID_HANDLE_VALUE;
|
||||
globals->impersonation_token_sid = NULL;
|
||||
}
|
||||
|
||||
static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC)
|
||||
@@ -83,9 +79,12 @@ static void tsrm_win32_dtor(tsrm_win32_globals *globals TSRMLS_DC)
|
||||
|
||||
free(globals->comspec);
|
||||
|
||||
if(globals->impersonation_token) {
|
||||
if (globals->impersonation_token && globals->impersonation_token != INVALID_HANDLE_VALUE ) {
|
||||
CloseHandle(globals->impersonation_token);
|
||||
}
|
||||
if (globals->impersonation_token_sid) {
|
||||
free(globals->impersonation_token_sid);
|
||||
}
|
||||
}
|
||||
|
||||
TSRM_API void tsrm_win32_startup(void)
|
||||
@@ -104,8 +103,97 @@ TSRM_API void tsrm_win32_shutdown(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
|
||||
{
|
||||
PSID pSid = TWG(impersonation_token_sid);
|
||||
DWORD sid_len = pSid ? GetLengthSid(pSid) : 0;
|
||||
TCHAR *ptcSid = NULL;
|
||||
char *bucket_key = NULL;
|
||||
|
||||
if (!pSid) {
|
||||
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + 1);
|
||||
if (!bucket_key) {
|
||||
return NULL;
|
||||
}
|
||||
memcpy(bucket_key, pathname, strlen(pathname));
|
||||
return bucket_key;
|
||||
}
|
||||
|
||||
if (!ConvertSidToStringSid(pSid, &ptcSid)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + strlen(ptcSid) + 1);
|
||||
if (!bucket_key) {
|
||||
LocalFree(ptcSid);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(bucket_key, ptcSid, strlen(ptcSid));
|
||||
memcpy(bucket_key + strlen(ptcSid), pathname, strlen(pathname) + 1);
|
||||
|
||||
LocalFree(ptcSid);
|
||||
return bucket_key;
|
||||
}
|
||||
|
||||
|
||||
PSID tsrm_win32_get_token_sid(HANDLE hToken)
|
||||
{
|
||||
BOOL bSuccess = FALSE;
|
||||
DWORD dwLength = 0;
|
||||
PTOKEN_USER pTokenUser = NULL;
|
||||
PSID sid;
|
||||
PSID *ppsid = &sid;
|
||||
DWORD sid_len;
|
||||
PSID pResultSid = NULL;
|
||||
|
||||
/* Get the actual size of the TokenUser structure */
|
||||
if (!GetTokenInformation(
|
||||
hToken, TokenUser, (LPVOID) pTokenUser, 0, &dwLength)) {
|
||||
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
pTokenUser = (PTOKEN_USER)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwLength);
|
||||
if (pTokenUser == NULL) {
|
||||
goto Finished;
|
||||
}
|
||||
}
|
||||
|
||||
/* and fetch it now */
|
||||
if (!GetTokenInformation(
|
||||
hToken, TokenUser, (LPVOID) pTokenUser, dwLength, &dwLength)) {
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
sid_len = GetLengthSid(pTokenUser->User.Sid);
|
||||
|
||||
/* ConvertSidToStringSid(pTokenUser->User.Sid, &ptcSidOwner); */
|
||||
pResultSid = malloc(sid_len);
|
||||
if (!pResultSid) {
|
||||
goto Finished;
|
||||
}
|
||||
if (!CopySid(sid_len, pResultSid, pTokenUser->User.Sid)) {
|
||||
goto Finished;
|
||||
}
|
||||
return pResultSid;
|
||||
|
||||
Finished:
|
||||
if (pResultSid) {
|
||||
free(pResultSid);
|
||||
}
|
||||
/* Free the buffer for the token groups. */
|
||||
if (pTokenUser != NULL) {
|
||||
HeapFree(GetProcessHeap(), 0, (LPVOID)pTokenUser);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
{
|
||||
time_t t;
|
||||
HANDLE thread_token;
|
||||
PSID token_sid;
|
||||
SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
|
||||
GENERIC_MAPPING gen_map = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS };
|
||||
DWORD priv_set_length = sizeof(PRIVILEGE_SET);
|
||||
@@ -114,11 +202,10 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
DWORD sec_desc_length = 0, desired_access = 0, granted_access = 0;
|
||||
BYTE * psec_desc = NULL;
|
||||
BOOL fAccess = FALSE;
|
||||
HANDLE process_token = NULL;
|
||||
|
||||
BOOL bucket_key_alloc = FALSE;
|
||||
realpath_cache_bucket * bucket = NULL;
|
||||
char * real_path = NULL;
|
||||
time_t t;
|
||||
|
||||
TSRMLS_FETCH();
|
||||
|
||||
@@ -126,10 +213,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
DWORD type;
|
||||
return GetBinaryType(pathname, &type) ? 0 : -1;
|
||||
} else {
|
||||
if(access(pathname, mode)) {
|
||||
return errno;
|
||||
}
|
||||
|
||||
if(!IS_ABSOLUTE_PATH(pathname, strlen(pathname)+1)) {
|
||||
real_path = (char *)malloc(MAX_PATH);
|
||||
if(tsrm_realpath(pathname, real_path TSRMLS_CC) == NULL) {
|
||||
@@ -138,6 +221,58 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
pathname = real_path;
|
||||
}
|
||||
|
||||
if(access(pathname, mode)) {
|
||||
return errno;
|
||||
}
|
||||
|
||||
/* If only existence check is made, return now */
|
||||
if (mode == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Only in NTS when impersonate==1 (aka FastCGI) */
|
||||
|
||||
/*
|
||||
AccessCheck() requires an impersonation token. We first get a primary
|
||||
token and then create a duplicate impersonation token. The
|
||||
impersonation token is not actually assigned to the thread, but is
|
||||
used in the call to AccessCheck. Thus, this function itself never
|
||||
impersonates, but does use the identity of the thread. If the thread
|
||||
was impersonating already, this function uses that impersonation context.
|
||||
*/
|
||||
if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &thread_token)) {
|
||||
DWORD err = GetLastError();
|
||||
if (GetLastError() == ERROR_NO_TOKEN) {
|
||||
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &thread_token)) {
|
||||
TWG(impersonation_token) = NULL;
|
||||
goto Finished;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* token_sid will be freed in tsrmwin32_dtor */
|
||||
token_sid = tsrm_win32_get_token_sid(thread_token);
|
||||
if (!token_sid) {
|
||||
if (TWG(impersonation_token_sid)) {
|
||||
free(TWG(impersonation_token_sid));
|
||||
}
|
||||
TWG(impersonation_token_sid) = NULL;
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
/* Different identity, we need a new impersontated token as well */
|
||||
if (!TWG(impersonation_token_sid) || !EqualSid(token_sid, TWG(impersonation_token_sid))) {
|
||||
if (TWG(impersonation_token_sid)) {
|
||||
free(TWG(impersonation_token_sid));
|
||||
}
|
||||
TWG(impersonation_token_sid) = token_sid;
|
||||
|
||||
/* Duplicate the token as impersonated token */
|
||||
if (!DuplicateToken(thread_token, SecurityImpersonation, &TWG(impersonation_token))) {
|
||||
goto Finished;
|
||||
}
|
||||
}
|
||||
|
||||
if (CWDG(realpath_cache_size_limit)) {
|
||||
t = time(0);
|
||||
bucket = realpath_cache_lookup(pathname, strlen(pathname), t TSRMLS_CC);
|
||||
@@ -151,7 +286,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Do a full access check because access() will only check read-only attribute */
|
||||
if(mode == 0 || mode > 6) {
|
||||
if(bucket != NULL && bucket->is_rvalid) {
|
||||
@@ -164,13 +299,13 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
fAccess = bucket->is_writable;
|
||||
goto Finished;
|
||||
}
|
||||
desired_access = FILE_GENERIC_WRITE;
|
||||
desired_access = FILE_GENERIC_READ | FILE_GENERIC_WRITE;
|
||||
} else if(mode <= 4) {
|
||||
if(bucket != NULL && bucket->is_rvalid) {
|
||||
fAccess = bucket->is_readable;
|
||||
goto Finished;
|
||||
}
|
||||
desired_access = FILE_GENERIC_READ;
|
||||
desired_access = FILE_GENERIC_READ|FILE_FLAG_BACKUP_SEMANTICS;
|
||||
} else { // if(mode <= 6)
|
||||
if(bucket != NULL && bucket->is_rvalid && bucket->is_wvalid) {
|
||||
fAccess = bucket->is_readable & bucket->is_writable;
|
||||
@@ -194,13 +329,15 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
goto Finished;
|
||||
}
|
||||
|
||||
MapGenericMask(&desired_access, &gen_map);
|
||||
|
||||
if(!AccessCheck((PSECURITY_DESCRIPTOR)psec_desc, TWG(impersonation_token), desired_access, &gen_map, &privilege_set, &priv_set_length, &granted_access, &fAccess)) {
|
||||
goto Finished;
|
||||
goto Finished_Impersonate;
|
||||
}
|
||||
|
||||
/* Keep the result in realpath_cache */
|
||||
if(bucket != NULL) {
|
||||
if(desired_access == FILE_GENERIC_READ) {
|
||||
if(desired_access == (FILE_GENERIC_READ|FILE_FLAG_BACKUP_SEMANTICS)) {
|
||||
bucket->is_rvalid = 1;
|
||||
bucket->is_readable = fAccess;
|
||||
}
|
||||
@@ -210,12 +347,13 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
|
||||
}
|
||||
}
|
||||
|
||||
Finished:
|
||||
Finished_Impersonate:
|
||||
if(psec_desc != NULL) {
|
||||
free(psec_desc);
|
||||
psec_desc = NULL;
|
||||
}
|
||||
|
||||
Finished:
|
||||
if(real_path != NULL) {
|
||||
free(real_path);
|
||||
real_path = NULL;
|
||||
@@ -305,21 +443,45 @@ TSRM_API FILE *popen(const char *command, const char *type)
|
||||
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env)
|
||||
{
|
||||
FILE *stream = NULL;
|
||||
int fno, str_len = strlen(type), read, mode;
|
||||
int fno, type_len = strlen(type), read, mode;
|
||||
STARTUPINFO startup;
|
||||
PROCESS_INFORMATION process;
|
||||
SECURITY_ATTRIBUTES security;
|
||||
HANDLE in, out;
|
||||
DWORD dwCreateFlags = 0;
|
||||
char *cmd;
|
||||
BOOL res;
|
||||
process_pair *proc;
|
||||
char *cmd;
|
||||
int i;
|
||||
char *ptype = (char *)type;
|
||||
HANDLE thread_token = NULL;
|
||||
HANDLE token_user = NULL;
|
||||
BOOL asuser = TRUE;
|
||||
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (!type) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*The following two checks can be removed once we drop XP support */
|
||||
type_len = strlen(type);
|
||||
if (type_len <1 || type_len > 2) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0; i < type_len; i++) {
|
||||
if (!(*ptype == 'r' || *ptype == 'w' || *ptype == 'b' || *ptype == 't')) {
|
||||
return NULL;
|
||||
}
|
||||
ptype++;
|
||||
}
|
||||
|
||||
security.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
security.bInheritHandle = TRUE;
|
||||
security.lpSecurityDescriptor = NULL;
|
||||
|
||||
if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) {
|
||||
if (!type_len || !CreatePipe(&in, &out, &security, 2048L)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -331,7 +493,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
|
||||
read = (type[0] == 'r') ? TRUE : FALSE;
|
||||
mode = ((str_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
|
||||
mode = ((type_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
|
||||
|
||||
if (read) {
|
||||
in = dupHandle(in, FALSE);
|
||||
@@ -348,13 +510,31 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
dwCreateFlags |= CREATE_NO_WINDOW;
|
||||
}
|
||||
|
||||
/* Get a token with the impersonated user. */
|
||||
if(OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &thread_token)) {
|
||||
DuplicateTokenEx(thread_token, MAXIMUM_ALLOWED, &security, SecurityImpersonation, TokenPrimary, &token_user);
|
||||
} else {
|
||||
DWORD err = GetLastError();
|
||||
if (err == ERROR_NO_TOKEN) {
|
||||
asuser = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
|
||||
return NULL;
|
||||
if (asuser) {
|
||||
res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
CloseHandle(token_user);
|
||||
} else {
|
||||
res = CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
}
|
||||
free(cmd);
|
||||
|
||||
if (!res) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CloseHandle(process.hThread);
|
||||
proc = process_get(NULL TSRMLS_CC);
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ typedef struct {
|
||||
int shm_size;
|
||||
char *comspec;
|
||||
HANDLE impersonation_token;
|
||||
PSID impersonation_token_sid;
|
||||
} tsrm_win32_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
@@ -89,6 +90,7 @@ typedef struct {
|
||||
#define SHM_RND FILE_MAP_WRITE
|
||||
#define SHM_REMAP FILE_MAP_COPY
|
||||
|
||||
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC);
|
||||
|
||||
TSRM_API void tsrm_win32_startup(void);
|
||||
TSRM_API void tsrm_win32_shutdown(void);
|
||||
@@ -97,6 +99,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
TSRM_API FILE *popen(const char *command, const char *type);
|
||||
TSRM_API int pclose(FILE *stream);
|
||||
TSRM_API int tsrm_win32_access(const char *pathname, int mode);
|
||||
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf);
|
||||
|
||||
TSRM_API int shmget(int key, int size, int flags);
|
||||
TSRM_API void *shmat(int key, const void *shmaddr, int flags);
|
||||
|
||||
@@ -62,18 +62,6 @@ unix.h \
|
||||
stdlib.h \
|
||||
dlfcn.h)
|
||||
|
||||
dnl Don't use mach-o/dyld.h on Darwin 8+, dl* is recommended by Apple from there on
|
||||
dnl See http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/loading_code.html
|
||||
case $host_alias in
|
||||
*darwin[[89]]*)
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_HEADERS([ \
|
||||
mach-o/dyld.h
|
||||
],[],[][])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ if (function_exists("date_default_timezone_set")) {
|
||||
date_default_timezone_set("UTC");
|
||||
}
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
function simple() {
|
||||
$a = 0;
|
||||
for ($i = 0; $i < 1000000; $i++)
|
||||
|
||||
+12
-11
@@ -359,7 +359,8 @@ var_dump($global_var);
|
||||
|
||||
//Note: No error conditions relating to passing arugments can be tested
|
||||
// because these are not functions but statements, it will result in syntax error.
|
||||
echo "Done\n";
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing unset(), empty() & isset() with scalar variables ***
|
||||
-- Iteration 1 --
|
||||
@@ -1185,11 +1186,11 @@ bool(true)
|
||||
|
||||
*** Testing unset(), emtpy() & isset() with resource variables ***
|
||||
-- Iteration 1 --
|
||||
resource(5) of type (stream)
|
||||
resource(%d) of type (stream)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
resource(5) of type (stream)
|
||||
resource(%d) of type (stream)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -1198,11 +1199,11 @@ bool(false)
|
||||
Notice: Undefined variable: resource in %s on line %d
|
||||
NULL
|
||||
-- Iteration 2 --
|
||||
resource(6) of type (stream)
|
||||
resource(%d) of type (stream)
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
resource(6) of type (stream)
|
||||
resource(%d) of type (stream)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -1217,7 +1218,7 @@ bool(false)
|
||||
bool(true)
|
||||
|
||||
*** Testing unset(), empty() & isset() with objects ***
|
||||
object(Point)#1 (3) {
|
||||
object(Point)#%d (3) {
|
||||
["x"]=>
|
||||
int(30)
|
||||
["y"]=>
|
||||
@@ -1239,7 +1240,7 @@ bool(false)
|
||||
|
||||
Notice: Undefined variable: lable in %s on line %d
|
||||
bool(true)
|
||||
object(Point)#1 (3) {
|
||||
object(Point)#%d (3) {
|
||||
["x"]=>
|
||||
int(30)
|
||||
["y"]=>
|
||||
@@ -1247,7 +1248,7 @@ object(Point)#1 (3) {
|
||||
["lable"]=>
|
||||
string(6) "Point1"
|
||||
}
|
||||
object(Point)#1 (2) {
|
||||
object(Point)#%d (2) {
|
||||
["y"]=>
|
||||
int(40)
|
||||
["lable"]=>
|
||||
@@ -1255,7 +1256,7 @@ object(Point)#1 (2) {
|
||||
}
|
||||
bool(false)
|
||||
bool(true)
|
||||
object(Point)#1 (0) {
|
||||
object(Point)#%d (0) {
|
||||
}
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -1276,7 +1277,7 @@ array(3) {
|
||||
[2]=>
|
||||
string(9) "testPoint"
|
||||
}
|
||||
object(Point)#1 (3) {
|
||||
object(Point)#%d (3) {
|
||||
["x"]=>
|
||||
int(5)
|
||||
["y"]=>
|
||||
@@ -1329,4 +1330,4 @@ bool(false)
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(10)
|
||||
Done
|
||||
===DONE===
|
||||
+4
-4
@@ -18,17 +18,17 @@ var_dump($a->$b->$c[1]);
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined variable: c in %s on line %d
|
||||
Notice: Undefined variable: %s in %s on line %d
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: %s in %s on line %d
|
||||
NULL
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
int(1)
|
||||
|
||||
Notice: Undefined variable: b in %s on line %d
|
||||
Notice: Undefined variable: %s in %s on line %d
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
Notice: Undefined variable: %s in %s on line %d
|
||||
int(0)
|
||||
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
@@ -41,12 +41,14 @@ $db = new hariCow;
|
||||
|
||||
var_dump($db);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: db in %sbug30162.php on line 35
|
||||
NULL
|
||||
object(hariCow)#1 (2) {
|
||||
object(hariCow)#%d (2) {
|
||||
["x"]=>
|
||||
string(1) "x"
|
||||
["y"]=>
|
||||
string(1) "y"
|
||||
}
|
||||
===DONE===
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = create_function('', 'return 1; }');
|
||||
$y = create_function('', 'function a() { }; return 2;');
|
||||
$z = create_function('', '{');
|
||||
$w = create_function('', 'return 3;');
|
||||
|
||||
var_dump(
|
||||
$x,
|
||||
$y(),
|
||||
$z,
|
||||
$w(),
|
||||
$y != $z
|
||||
);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1
|
||||
|
||||
Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1
|
||||
bool(false)
|
||||
int(2)
|
||||
bool(false)
|
||||
int(3)
|
||||
bool(true)
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
Bug #48770 (call_user_func_array() fails to call parent from inheriting class)
|
||||
--XFAIL--
|
||||
See Bug #48770
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public function func($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func22($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public function func($str) {
|
||||
static $avoid_crash = 0;
|
||||
|
||||
if ($avoid_crash++ == 1) {
|
||||
print "This method shouldn't be called when using parent::func!\n";
|
||||
return;
|
||||
}
|
||||
|
||||
call_user_func_array(array($this, 'parent::func'), array($str));
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
public function func($str) {
|
||||
parent::func($str);
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C;
|
||||
$c->func('This should work!');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(26) "A::func: This should work!"
|
||||
@@ -0,0 +1,54 @@
|
||||
--TEST--
|
||||
Bug #48770 (call_user_func_array() fails to call parent from inheriting class)
|
||||
--XFAIL--
|
||||
See Bug #48770
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public function func($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func22($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public function func($str) {
|
||||
call_user_func_array(array($this, 'parent::func2'), array($str));
|
||||
call_user_func_array(array($this, 'parent::func3'), array($str));
|
||||
call_user_func_array(array($this, 'parent::func22'), array($str));
|
||||
call_user_func_array(array($this, 'parent::inexistent'), array($str));
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
public function func($str) {
|
||||
parent::func($str);
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C;
|
||||
$c->func('This should work!');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(27) "A::func2: This should work!"
|
||||
%unicode|string%(27) "A::func3: This should work!"
|
||||
|
||||
Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method A::func22() in %s on line %d
|
||||
|
||||
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'A' does not have a method 'inexistent' in %s on line %d
|
||||
@@ -0,0 +1,51 @@
|
||||
--TEST--
|
||||
Bug #48770 (call_user_func_array() fails to call parent from inheriting class)
|
||||
--XFAIL--
|
||||
See Bug #48770
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
public function func($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
private function func22($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public function func($str) {
|
||||
call_user_func_array(array($this, 'self::func2'), array($str));
|
||||
call_user_func_array(array($this, 'self::func3'), array($str));
|
||||
call_user_func_array(array($this, 'self::inexistent'), array($str));
|
||||
}
|
||||
private function func2($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
protected function func3($str) {
|
||||
var_dump(__METHOD__ .': '. $str);
|
||||
}
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
public function func($str) {
|
||||
parent::func($str);
|
||||
}
|
||||
}
|
||||
|
||||
$c = new C;
|
||||
$c->func('This should work!');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(27) "B::func2: This should work!"
|
||||
%unicode|string%(27) "B::func3: This should work!"
|
||||
|
||||
Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'B' does not have a method 'inexistent' in %s on line %d
|
||||
@@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #48899 (is_callable returns true even if method does not exist in parent class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class ParentClass { }
|
||||
|
||||
class ChildClass extends ParentClass {
|
||||
public function testIsCallable() {
|
||||
var_dump(is_callable(array($this, 'parent::testIsCallable')));
|
||||
}
|
||||
public function testIsCallable2() {
|
||||
var_dump(is_callable(array($this, 'static::testIsCallable2')));
|
||||
}
|
||||
}
|
||||
|
||||
$child = new ChildClass();
|
||||
$child->testIsCallable();
|
||||
$child->testIsCallable2();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(true)
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #48912 (Namespace causes unexpected strict behaviour with extract())
|
||||
--FILE--
|
||||
<?php
|
||||
namespace A;
|
||||
|
||||
function test()
|
||||
{
|
||||
extract(func_get_arg(0));
|
||||
}
|
||||
|
||||
test(array('x' => 1));
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
Bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration).
|
||||
--FILE--
|
||||
<?php
|
||||
class TestObject implements Iterator
|
||||
{
|
||||
public $n = 0;
|
||||
function valid()
|
||||
{
|
||||
return ($this->n < 3);
|
||||
}
|
||||
function current() {return $this->n;}
|
||||
function next() {$this->n++;}
|
||||
function key() { }
|
||||
function rewind() {$this->n = 0;}
|
||||
}
|
||||
|
||||
|
||||
$array_object = new TestObject();
|
||||
|
||||
foreach ((true ? $array_object : $array_object) as $item) echo "$item\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
1
|
||||
2
|
||||
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
Bug #49908 (throwing exception in __autoload crashes when interface is not defined)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function __autoload($className) {
|
||||
var_dump($className);
|
||||
|
||||
if ($className == 'Foo') {
|
||||
class Foo implements Bar {};
|
||||
} else {
|
||||
throw new Exception($className);
|
||||
}
|
||||
}
|
||||
|
||||
new Foo;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(3) "Foo"
|
||||
%unicode|string%(3) "Bar"
|
||||
|
||||
Fatal error: Uncaught exception 'Exception' with message 'Bar' in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(7): __autoload('Bar')
|
||||
#1 %s(13): __autoload('Foo')
|
||||
#2 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -0,0 +1,35 @@
|
||||
--TEST--
|
||||
Testing call_user_func inside namespace
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
namespace testing {
|
||||
function foobar($str) {
|
||||
var_dump($str);
|
||||
}
|
||||
|
||||
abstract class bar {
|
||||
protected function prot($str) {
|
||||
print "Shouldn't be called!\n";
|
||||
}
|
||||
}
|
||||
class foo extends bar {
|
||||
private function priv($str) {
|
||||
print "Shouldn't be called!\n";
|
||||
}
|
||||
}
|
||||
|
||||
call_user_func(__NAMESPACE__ .'\foobar', 'foobar');
|
||||
|
||||
$class = __NAMESPACE__ .'\foo';
|
||||
call_user_func(array(new $class, 'priv'), 'foobar');
|
||||
call_user_func(array(new $class, 'prot'), 'foobar');
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%string|unicode%(6) "foobar"
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access private method testing\foo::priv() in %s on line %d
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access protected method testing\foo::prot() in %s on line %d
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Testing call_user_func() with autoload and passing invalid params
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function __autoload($class) {
|
||||
var_dump($class);
|
||||
}
|
||||
|
||||
call_user_func(array('foo', 'bar'));
|
||||
call_user_func(array('', 'bar'));
|
||||
call_user_func(array($foo, 'bar'));
|
||||
call_user_func(array($foo, ''));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(3) "foo"
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found in %s on line %d
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, class '' not found in %s on line %d
|
||||
|
||||
Notice: Undefined variable: foo in %s on line %d
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d
|
||||
|
||||
Notice: Undefined variable: foo in %s on line %d
|
||||
|
||||
Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Testing call_user_func() with closures
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$foo = function() {
|
||||
static $instance;
|
||||
|
||||
if (is_null($instance)) {
|
||||
$instance = function () {
|
||||
return 'OK!';
|
||||
};
|
||||
}
|
||||
|
||||
return $instance;
|
||||
};
|
||||
|
||||
var_dump(call_user_func(array($foo, '__invoke'))->__invoke());
|
||||
var_dump(call_user_func(function() use (&$foo) { return $foo; }, '__invoke'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
%unicode|string%(3) "OK!"
|
||||
object(Closure)#%d (1) {
|
||||
[%u|b%"static"]=>
|
||||
array(1) {
|
||||
[%u|b%"instance"]=>
|
||||
object(Closure)#%d (0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Closure 033: Recursive var_dump on closures
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = function () use(&$a) {};
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
object(Closure)#1 (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
&object(Closure)#1 (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["a"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
@@ -16,9 +16,3 @@ Warning: Constants may only evaluate to scalar values in %s on line %d
|
||||
Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d
|
||||
string(%d) "foo"
|
||||
resource(%d) of type (stream)
|
||||
--UEXPECTF--
|
||||
Warning: Constants may only evaluate to scalar values in %s on line %d
|
||||
|
||||
Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d
|
||||
unicode(%d) "foo"
|
||||
resource(%d) of type (stream)
|
||||
@@ -22,16 +22,3 @@ array(4) {
|
||||
["key"]=>
|
||||
int(0)
|
||||
}
|
||||
--UEXPECTF--
|
||||
array(4) {
|
||||
[1]=>
|
||||
array(0) {
|
||||
}
|
||||
[u"value"]=>
|
||||
array(0) {
|
||||
}
|
||||
[0]=>
|
||||
int(0)
|
||||
[u"key"]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
--TEST--
|
||||
Test function_exists() function : error conditions
|
||||
--INI--
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
|
||||
@@ -26,6 +26,3 @@ $a->foo();
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
bool(false)
|
||||
--UEXPECT--
|
||||
unicode(3) "bar"
|
||||
bool(false)
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Check if get_required_files works
|
||||
--CREDITS--
|
||||
Sebastian Schürmann
|
||||
sschuermann@chip.de
|
||||
Testfest 2009 Munich
|
||||
--FILE--
|
||||
<?php
|
||||
$files = get_required_files();
|
||||
var_dump($files);
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
%string|unicode%(%d)%s
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
globals in global scope
|
||||
--INIT--
|
||||
--INI--
|
||||
variables_order="egpcs"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
globals in local scope
|
||||
--INIT--
|
||||
--INI--
|
||||
variables_order="egpcs"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
globals in local scope - 2
|
||||
--INIT--
|
||||
--INI--
|
||||
variables_order="egpcs"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
globals in local scope - 3
|
||||
--INIT--
|
||||
--INI--
|
||||
variables_order="egpcs"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -7,5 +7,3 @@ namespace test\foo;
|
||||
var_dump(__NAMESPACE__);
|
||||
--EXPECT--
|
||||
string(8) "test\foo"
|
||||
--UEXPECT--
|
||||
unicode(8) "test\foo"
|
||||
@@ -5,5 +5,3 @@
|
||||
var_dump(__NAMESPACE__);
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
--UEXPECT--
|
||||
unicode(0) ""
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Crash when function parameter modified via unexpected reference
|
||||
--FILE--
|
||||
<?php
|
||||
function my_errorhandler($errno,$errormsg) {
|
||||
global $my_var;
|
||||
$my_var = 0;
|
||||
return true;
|
||||
}
|
||||
set_error_handler("my_errorhandler");
|
||||
$my_var = str_repeat("A",64);
|
||||
$data = call_user_func_array("explode",array(new StdClass(), &$my_var));
|
||||
$my_var=array(1,2,3);
|
||||
$data = call_user_func_array("implode",array(&$my_var, new StdClass()));
|
||||
echo "Done.\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
Done.
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
unset() CV 7 (indirect unset() of global variable in import_request_variables())
|
||||
--SKIPIF--
|
||||
<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
|
||||
--GET--
|
||||
x=2
|
||||
--FILE--
|
||||
|
||||
+9
-3
@@ -1067,9 +1067,15 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
}
|
||||
Z_ARRVAL_P(z_context) = EG(active_symbol_table);
|
||||
Z_TYPE_P(z_context) = IS_ARRAY;
|
||||
zval_copy_ctor(z_context);
|
||||
|
||||
/* during shutdown the symbol table table can be still null */
|
||||
if (!EG(active_symbol_table)) {
|
||||
Z_TYPE_P(z_context) = IS_NULL;
|
||||
} else {
|
||||
Z_ARRVAL_P(z_context) = EG(active_symbol_table);
|
||||
Z_TYPE_P(z_context) = IS_ARRAY;
|
||||
zval_copy_ctor(z_context);
|
||||
}
|
||||
|
||||
params = (zval ***) emalloc(sizeof(zval **)*5);
|
||||
params[0] = &z_error_type;
|
||||
|
||||
+1
-19
@@ -79,18 +79,7 @@
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_MACH_O_DYLD_H
|
||||
#include <mach-o/dyld.h>
|
||||
|
||||
/* MH_BUNDLE loading functions for Mac OS X / Darwin */
|
||||
void *zend_mh_bundle_load (char* bundle_path);
|
||||
int zend_mh_bundle_unload (void *bundle_handle);
|
||||
void *zend_mh_bundle_symbol(void *bundle_handle, const char *symbol_name);
|
||||
const char *zend_mh_bundle_error(void);
|
||||
|
||||
#endif /* HAVE_MACH_O_DYLD_H */
|
||||
|
||||
#if defined(HAVE_LIBDL) && !defined(HAVE_MACH_O_DYLD_H) && !defined(ZEND_WIN32)
|
||||
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
|
||||
|
||||
# ifndef RTLD_LAZY
|
||||
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
|
||||
@@ -116,13 +105,6 @@ const char *zend_mh_bundle_error(void);
|
||||
# define DL_ERROR dlerror
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#elif defined(HAVE_MACH_O_DYLD_H)
|
||||
# define DL_LOAD(libname) zend_mh_bundle_load(libname)
|
||||
# define DL_UNLOAD zend_mh_bundle_unload
|
||||
# define DL_FETCH_SYMBOL(h,s) zend_mh_bundle_symbol(h,s)
|
||||
# define DL_ERROR zend_mh_bundle_error
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#elif defined(ZEND_WIN32)
|
||||
# define DL_LOAD(libname) LoadLibrary(libname)
|
||||
# define DL_FETCH_SYMBOL GetProcAddress
|
||||
|
||||
+8
-8
@@ -1038,13 +1038,13 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
|
||||
Z_SET_ISREF_PP(q);
|
||||
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)q, sizeof(zval*), NULL);
|
||||
} else {
|
||||
zval *q;
|
||||
zval *r;
|
||||
|
||||
ALLOC_ZVAL(q);
|
||||
*q = **p;
|
||||
INIT_PZVAL(q);
|
||||
zval_copy_ctor(q);
|
||||
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)&q, sizeof(zval*), NULL);
|
||||
ALLOC_ZVAL(r);
|
||||
*r = **p;
|
||||
INIT_PZVAL(r);
|
||||
zval_copy_ctor(r);
|
||||
zend_hash_add(CE_STATIC_MEMBERS(class_type), str_index, str_length, (void**)&r, sizeof(zval*), NULL);
|
||||
}
|
||||
zend_hash_move_forward_ex(&class_type->default_static_members, &pos);
|
||||
}
|
||||
@@ -2114,7 +2114,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */
|
||||
zend_unregister_functions(module->functions, -1, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
#if HAVE_LIBDL || defined(HAVE_MACH_O_DYLD_H)
|
||||
#if HAVE_LIBDL
|
||||
#if !(defined(NETWARE) && defined(APACHE_1_BUILD))
|
||||
if (module->handle) {
|
||||
DL_UNLOAD(module->handle);
|
||||
@@ -2519,7 +2519,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
||||
}
|
||||
} else {
|
||||
get_function_via_handler:
|
||||
if (fcc->object_ptr) {
|
||||
if (fcc->object_ptr && fcc->calling_scope == ce_org) {
|
||||
if (Z_OBJ_HT_P(fcc->object_ptr)->get_method) {
|
||||
fcc->function_handler = Z_OBJ_HT_P(fcc->object_ptr)->get_method(&fcc->object_ptr, mname, mlen TSRMLS_CC);
|
||||
if (fcc->function_handler) {
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ typedef struct _zend_fcall_info_cache {
|
||||
#define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags)
|
||||
#define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info)
|
||||
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0)
|
||||
#define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0)
|
||||
#define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
|
||||
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
|
||||
|
||||
+6
-17
@@ -512,20 +512,7 @@ static unsigned int _zend_mm_cookie = 0;
|
||||
/* optimized access */
|
||||
#define ZEND_MM_FREE_BLOCK_SIZE(b) (b)->info._size
|
||||
|
||||
#ifndef ZEND_MM_ALIGNMENT
|
||||
# define ZEND_MM_ALIGNMENT 8
|
||||
# define ZEND_MM_ALIGNMENT_LOG2 3
|
||||
#elif ZEND_MM_ALIGNMENT < 4
|
||||
# undef ZEND_MM_ALIGNMENT
|
||||
# undef ZEND_MM_ALIGNMENT_LOG2
|
||||
# define ZEND_MM_ALIGNMENT 4
|
||||
# define ZEND_MM_ALIGNMENT_LOG2 2
|
||||
#endif
|
||||
|
||||
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
|
||||
|
||||
/* Aligned header size */
|
||||
#define ZEND_MM_ALIGNED_SIZE(size) ((size + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
|
||||
#define ZEND_MM_ALIGNED_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_block))
|
||||
#define ZEND_MM_ALIGNED_FREE_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_small_free_block))
|
||||
#define ZEND_MM_MIN_ALLOC_BLOCK_SIZE ZEND_MM_ALIGNED_SIZE(ZEND_MM_ALIGNED_HEADER_SIZE + END_MAGIC_SIZE)
|
||||
@@ -709,12 +696,14 @@ static inline unsigned int zend_mm_low_bit(size_t _size)
|
||||
unsigned int n;
|
||||
unsigned int index = 0;
|
||||
|
||||
do {
|
||||
n = offset[_size & 15];
|
||||
n = offset[_size & 15];
|
||||
while (n == 4) {
|
||||
_size >>= 4;
|
||||
index += n;
|
||||
} while (n == 4);
|
||||
return index;
|
||||
n = offset[_size & 15];
|
||||
}
|
||||
|
||||
return index + n;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,20 @@
|
||||
#include "../TSRM/TSRM.h"
|
||||
#include "zend.h"
|
||||
|
||||
#ifndef ZEND_MM_ALIGNMENT
|
||||
# define ZEND_MM_ALIGNMENT 8
|
||||
# define ZEND_MM_ALIGNMENT_LOG2 3
|
||||
#elif ZEND_MM_ALIGNMENT < 4
|
||||
# undef ZEND_MM_ALIGNMENT
|
||||
# undef ZEND_MM_ALIGNMENT_LOG2
|
||||
# define ZEND_MM_ALIGNMENT 4
|
||||
# define ZEND_MM_ALIGNMENT_LOG2 2
|
||||
#endif
|
||||
|
||||
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
|
||||
|
||||
#define ZEND_MM_ALIGNED_SIZE(size) (((size) + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
|
||||
|
||||
typedef struct _zend_leak_info {
|
||||
void *addr;
|
||||
size_t size;
|
||||
|
||||
@@ -747,7 +747,7 @@ ZEND_FUNCTION(get_class)
|
||||
zend_uint name_len = 0;
|
||||
int dup;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|o", &obj) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|o!", &obj) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1755,6 +1755,7 @@ ZEND_FUNCTION(create_function)
|
||||
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
|
||||
RETURN_STRINGL(function_name, function_name_length, 0);
|
||||
} else {
|
||||
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
+43
-32
@@ -37,6 +37,7 @@
|
||||
typedef struct _zend_closure {
|
||||
zend_object std;
|
||||
zend_function func;
|
||||
HashTable *debug_info;
|
||||
} zend_closure;
|
||||
|
||||
/* non-static since it needs to be referenced */
|
||||
@@ -179,6 +180,11 @@ static void zend_closure_free_storage(void *object TSRMLS_DC) /* {{{ */
|
||||
destroy_op_array(&closure->func.op_array TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (closure->debug_info != NULL) {
|
||||
zend_hash_destroy(closure->debug_info);
|
||||
efree(closure->debug_info);
|
||||
}
|
||||
|
||||
efree(closure);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -222,48 +228,53 @@ int zend_closure_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function
|
||||
static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(object TSRMLS_CC);
|
||||
HashTable *rv;
|
||||
zval *val;
|
||||
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
|
||||
|
||||
*is_temp = 1;
|
||||
ALLOC_HASHTABLE(rv);
|
||||
zend_hash_init(rv, 1, NULL, ZVAL_PTR_DTOR, 0);
|
||||
if (closure->func.type == ZEND_USER_FUNCTION && closure->func.op_array.static_variables) {
|
||||
HashTable *static_variables = closure->func.op_array.static_variables;
|
||||
MAKE_STD_ZVAL(val);
|
||||
array_init(val);
|
||||
zend_hash_copy(Z_ARRVAL_P(val), static_variables, (copy_ctor_func_t)zval_add_ref, NULL, sizeof(zval*));
|
||||
zend_symtable_update(rv, "static", sizeof("static"), (void *) &val, sizeof(zval *), NULL);
|
||||
*is_temp = 0;
|
||||
|
||||
if (closure->debug_info == NULL) {
|
||||
ALLOC_HASHTABLE(closure->debug_info);
|
||||
zend_hash_init(closure->debug_info, 1, NULL, ZVAL_PTR_DTOR, 0);
|
||||
}
|
||||
if (closure->debug_info->nApplyCount == 0) {
|
||||
if (closure->func.type == ZEND_USER_FUNCTION && closure->func.op_array.static_variables) {
|
||||
HashTable *static_variables = closure->func.op_array.static_variables;
|
||||
MAKE_STD_ZVAL(val);
|
||||
array_init(val);
|
||||
zend_hash_copy(Z_ARRVAL_P(val), static_variables, (copy_ctor_func_t)zval_add_ref, NULL, sizeof(zval*));
|
||||
zend_symtable_update(closure->debug_info, "static", sizeof("static"), (void *) &val, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
if (arg_info) {
|
||||
zend_uint i, required = closure->func.common.required_num_args;
|
||||
if (arg_info) {
|
||||
zend_uint i, required = closure->func.common.required_num_args;
|
||||
|
||||
MAKE_STD_ZVAL(val);
|
||||
array_init(val);
|
||||
MAKE_STD_ZVAL(val);
|
||||
array_init(val);
|
||||
|
||||
for (i = 0; i < closure->func.common.num_args; i++) {
|
||||
char *name, *info;
|
||||
int name_len, info_len;
|
||||
if (arg_info->name) {
|
||||
name_len = zend_spprintf(&name, 0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
arg_info->name);
|
||||
} else {
|
||||
name_len = zend_spprintf(&name, 0, "%s$param%d",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
i + 1);
|
||||
for (i = 0; i < closure->func.common.num_args; i++) {
|
||||
char *name, *info;
|
||||
int name_len, info_len;
|
||||
if (arg_info->name) {
|
||||
name_len = zend_spprintf(&name, 0, "%s$%s",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
arg_info->name);
|
||||
} else {
|
||||
name_len = zend_spprintf(&name, 0, "%s$param%d",
|
||||
arg_info->pass_by_reference ? "&" : "",
|
||||
i + 1);
|
||||
}
|
||||
info_len = zend_spprintf(&info, 0, "%s",
|
||||
i >= required ? "<optional>" : "<required>");
|
||||
add_assoc_stringl_ex(val, name, name_len + 1, info, info_len, 0);
|
||||
efree(name);
|
||||
arg_info++;
|
||||
}
|
||||
info_len = zend_spprintf(&info, 0, "%s",
|
||||
i >= required ? "<optional>" : "<required>");
|
||||
add_assoc_stringl_ex(val, name, name_len + 1, info, info_len, 0);
|
||||
efree(name);
|
||||
arg_info++;
|
||||
zend_symtable_update(closure->debug_info, "parameter", sizeof("parameter"), (void *) &val, sizeof(zval *), NULL);
|
||||
}
|
||||
zend_symtable_update(rv, "parameter", sizeof("parameter"), (void *) &val, sizeof(zval *), NULL);
|
||||
}
|
||||
return rv;
|
||||
|
||||
return closure->debug_info;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+356
-304
File diff suppressed because it is too large.
Load diff
+51
-12
@@ -144,9 +144,11 @@ struct _zend_vm_stack {
|
||||
void **top;
|
||||
void **end;
|
||||
zend_vm_stack prev;
|
||||
void *elements[1];
|
||||
};
|
||||
|
||||
#define ZEND_VM_STACK_ELEMETS(stack) \
|
||||
((void**)(((char*)(stack)) + ZEND_MM_ALIGNED_SIZE(sizeof(struct _zend_vm_stack))))
|
||||
|
||||
#define ZEND_VM_STACK_GROW_IF_NEEDED(count) \
|
||||
do { \
|
||||
if (UNEXPECTED((count) > \
|
||||
@@ -156,10 +158,10 @@ struct _zend_vm_stack {
|
||||
} while (0)
|
||||
|
||||
static inline zend_vm_stack zend_vm_stack_new_page(int count) {
|
||||
zend_vm_stack page = (zend_vm_stack)emalloc(sizeof(*page)+sizeof(page->elements[0])*(count-1));
|
||||
zend_vm_stack page = (zend_vm_stack)emalloc(ZEND_MM_ALIGNED_SIZE(sizeof(*page)) + sizeof(void*) * count);
|
||||
|
||||
page->top = page->elements;
|
||||
page->end = page->elements + count;
|
||||
page->top = ZEND_VM_STACK_ELEMETS(page);
|
||||
page->end = page->top + count;
|
||||
page->prev = NULL;
|
||||
return page;
|
||||
}
|
||||
@@ -207,7 +209,7 @@ static inline void *zend_vm_stack_pop(TSRMLS_D)
|
||||
{
|
||||
void *el = *(--EG(argument_stack)->top);
|
||||
|
||||
if (UNEXPECTED(EG(argument_stack)->top == EG(argument_stack)->elements)) {
|
||||
if (UNEXPECTED(EG(argument_stack)->top == ZEND_VM_STACK_ELEMETS(EG(argument_stack)))) {
|
||||
zend_vm_stack p = EG(argument_stack);
|
||||
EG(argument_stack) = p->prev;
|
||||
efree(p);
|
||||
@@ -221,15 +223,32 @@ static inline void *zend_vm_stack_alloc(size_t size TSRMLS_DC)
|
||||
|
||||
size = (size + (sizeof(void*) - 1)) / sizeof(void*);
|
||||
|
||||
ZEND_VM_STACK_GROW_IF_NEEDED((int)size);
|
||||
/* the following comparison must be optimized out at compile time */
|
||||
if (ZEND_MM_ALIGNMENT > sizeof(void*)) {
|
||||
int extra = (ZEND_MM_ALIGNMENT - ((zend_uintptr_t)EG(argument_stack)->top & (ZEND_MM_ALIGNMENT - 1))) / sizeof(void*);
|
||||
|
||||
if (UNEXPECTED(size + extra + ZEND_MM_ALIGNED_SIZE(sizeof(void*)) / sizeof(void*) >
|
||||
EG(argument_stack)->end - EG(argument_stack)->top)) {
|
||||
zend_vm_stack_extend(size TSRMLS_CC);
|
||||
} else {
|
||||
void **old_top = EG(argument_stack)->top;
|
||||
|
||||
EG(argument_stack)->top += extra;
|
||||
/* store old top on the stack */
|
||||
*EG(argument_stack)->top = (void*)old_top;
|
||||
EG(argument_stack)->top += ZEND_MM_ALIGNED_SIZE(sizeof(void*)) / sizeof(void*);
|
||||
}
|
||||
} else {
|
||||
ZEND_VM_STACK_GROW_IF_NEEDED((int)size);
|
||||
}
|
||||
ret = (void*)EG(argument_stack)->top;
|
||||
EG(argument_stack)->top += size;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void zend_vm_stack_free(void *ptr TSRMLS_DC)
|
||||
static inline void zend_vm_stack_free_int(void *ptr TSRMLS_DC)
|
||||
{
|
||||
if (UNEXPECTED(EG(argument_stack)->elements == (void**)ptr)) {
|
||||
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) {
|
||||
zend_vm_stack p = EG(argument_stack);
|
||||
|
||||
EG(argument_stack) = p->prev;
|
||||
@@ -239,10 +258,28 @@ static inline void zend_vm_stack_free(void *ptr TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void zend_vm_stack_free(void *ptr TSRMLS_DC)
|
||||
{
|
||||
if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) {
|
||||
zend_vm_stack p = EG(argument_stack);
|
||||
|
||||
EG(argument_stack) = p->prev;
|
||||
efree(p);
|
||||
} else {
|
||||
/* the following comparison must be optimized out at compile time */
|
||||
if (ZEND_MM_ALIGNMENT > sizeof(void*)) {
|
||||
ptr = (void*)(((char*)ptr) - ZEND_MM_ALIGNED_SIZE(sizeof(void*)));
|
||||
EG(argument_stack)->top = *(void***)ptr;
|
||||
} else {
|
||||
EG(argument_stack)->top = (void**)ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void** zend_vm_stack_push_args(int count TSRMLS_DC)
|
||||
{
|
||||
|
||||
if (UNEXPECTED(EG(argument_stack)->top - EG(argument_stack)->elements < count) ||
|
||||
if (UNEXPECTED(EG(argument_stack)->top - ZEND_VM_STACK_ELEMETS(EG(argument_stack)) < count) ||
|
||||
UNEXPECTED(EG(argument_stack)->top == EG(argument_stack)->end)) {
|
||||
zend_vm_stack p = EG(argument_stack);
|
||||
|
||||
@@ -253,14 +290,14 @@ static inline void** zend_vm_stack_push_args(int count TSRMLS_DC)
|
||||
while (count-- > 0) {
|
||||
void *data = *(--p->top);
|
||||
|
||||
if (UNEXPECTED(p->top == p->elements)) {
|
||||
if (UNEXPECTED(p->top == ZEND_VM_STACK_ELEMETS(p))) {
|
||||
zend_vm_stack r = p;
|
||||
|
||||
EG(argument_stack)->prev = p->prev;
|
||||
p = p->prev;
|
||||
efree(r);
|
||||
}
|
||||
*(EG(argument_stack)->elements + count) = data;
|
||||
*(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + count) = data;
|
||||
}
|
||||
return EG(argument_stack)->top++;
|
||||
}
|
||||
@@ -278,7 +315,7 @@ static inline void zend_vm_stack_clear_multiple(TSRMLS_D)
|
||||
*p = NULL;
|
||||
zval_ptr_dtor(&q);
|
||||
}
|
||||
zend_vm_stack_free(p TSRMLS_CC);
|
||||
zend_vm_stack_free_int(p TSRMLS_CC);
|
||||
}
|
||||
|
||||
static inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_DC)
|
||||
@@ -351,6 +388,8 @@ ZEND_API zval** zend_get_compiled_variable_value(const zend_execute_data *execut
|
||||
#define ZEND_USER_OPCODE_CONTINUE 0 /* execute next opcode */
|
||||
#define ZEND_USER_OPCODE_RETURN 1 /* exit from executor (return from function) */
|
||||
#define ZEND_USER_OPCODE_DISPATCH 2 /* call original opcode handler */
|
||||
#define ZEND_USER_OPCODE_ENTER 3 /* enter into new op_array without recursion */
|
||||
#define ZEND_USER_OPCODE_LEAVE 4 /* return to calling op_array within the same executor */
|
||||
|
||||
#define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of returned opcode */
|
||||
|
||||
|
||||
@@ -837,6 +837,12 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
|
||||
for (i=0; i<fci->param_count; i++) {
|
||||
zval *param;
|
||||
|
||||
if(EX(function_state).function->type == ZEND_INTERNAL_FUNCTION
|
||||
&& !ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
|
||||
&& PZVAL_IS_REF(*fci->params[i])) {
|
||||
SEPARATE_ZVAL(fci->params[i]);
|
||||
}
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
|
||||
&& !PZVAL_IS_REF(*fci->params[i])) {
|
||||
|
||||
@@ -1148,6 +1154,7 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
|
||||
zval *local_retval_ptr=NULL;
|
||||
zval **original_return_value_ptr_ptr = EG(return_value_ptr_ptr);
|
||||
zend_op **original_opline_ptr = EG(opline_ptr);
|
||||
int orig_interactive = CG(interactive);
|
||||
|
||||
EG(return_value_ptr_ptr) = &local_retval_ptr;
|
||||
EG(active_op_array) = new_op_array;
|
||||
@@ -1155,9 +1162,11 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
}
|
||||
CG(interactive) = 0;
|
||||
|
||||
zend_execute(new_op_array TSRMLS_CC);
|
||||
|
||||
CG(interactive) = orig_interactive;
|
||||
if (local_retval_ptr) {
|
||||
if (retval_ptr) {
|
||||
COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
|
||||
@@ -1216,6 +1225,7 @@ void execute_new_code(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
zend_op *opline, *end;
|
||||
zend_op *ret_opline;
|
||||
int orig_interactive;
|
||||
|
||||
if (!(CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE)
|
||||
|| CG(active_op_array)->backpatch_count>0
|
||||
@@ -1271,7 +1281,10 @@ void execute_new_code(TSRMLS_D) /* {{{ */
|
||||
|
||||
EG(return_value_ptr_ptr) = NULL;
|
||||
EG(active_op_array) = CG(active_op_array);
|
||||
orig_interactive = CG(interactive);
|
||||
CG(interactive) = 0;
|
||||
zend_execute(CG(active_op_array) TSRMLS_CC);
|
||||
CG(interactive) = orig_interactive;
|
||||
|
||||
if (EG(exception)) {
|
||||
zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
|
||||
|
||||
@@ -217,67 +217,6 @@ ZEND_API zend_extension *zend_get_extension(const char *extension_name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Support for dynamic loading of MH_BUNDLEs on Darwin / Mac OS X
|
||||
*
|
||||
*/
|
||||
|
||||
#if HAVE_MACH_O_DYLD_H
|
||||
|
||||
void *zend_mh_bundle_load(char* bundle_path)
|
||||
{
|
||||
NSObjectFileImage bundle_image;
|
||||
NSModule bundle_handle;
|
||||
NSSymbol bundle_init_nssymbol;
|
||||
void (*bundle_init)(void);
|
||||
|
||||
if (NSCreateObjectFileImageFromFile(bundle_path, &bundle_image) != NSObjectFileImageSuccess) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_NONE);
|
||||
NSDestroyObjectFileImage(bundle_image);
|
||||
|
||||
/* call the init function of the bundle */
|
||||
bundle_init_nssymbol = NSLookupSymbolInModule(bundle_handle, "__init");
|
||||
if (bundle_init_nssymbol != NULL) {
|
||||
bundle_init = NSAddressOfSymbol(bundle_init_nssymbol);
|
||||
bundle_init();
|
||||
}
|
||||
|
||||
return bundle_handle;
|
||||
}
|
||||
|
||||
int zend_mh_bundle_unload(void *bundle_handle)
|
||||
{
|
||||
NSSymbol bundle_fini_nssymbol;
|
||||
void (*bundle_fini)(void);
|
||||
|
||||
/* call the fini function of the bundle */
|
||||
bundle_fini_nssymbol = NSLookupSymbolInModule(bundle_handle, "__fini");
|
||||
if (bundle_fini_nssymbol != NULL) {
|
||||
bundle_fini = NSAddressOfSymbol(bundle_fini_nssymbol);
|
||||
bundle_fini();
|
||||
}
|
||||
|
||||
return (int) NSUnLinkModule(bundle_handle, NULL);
|
||||
}
|
||||
|
||||
void *zend_mh_bundle_symbol(void *bundle_handle, const char *symbol_name)
|
||||
{
|
||||
NSSymbol symbol;
|
||||
symbol = NSLookupSymbolInModule(bundle_handle, symbol_name);
|
||||
return NSAddressOfSymbol(symbol);
|
||||
}
|
||||
|
||||
const char *zend_mh_bundle_error(void)
|
||||
{
|
||||
/* Witness the state of the art error reporting */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* HAVE_MACH_O_DYLD_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+12
-3
@@ -46,15 +46,21 @@ static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number
|
||||
|
||||
static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
int result = FAILURE;
|
||||
|
||||
if (ini_entry->modified) {
|
||||
if (ini_entry->on_modify) {
|
||||
zend_try {
|
||||
/* even if on_modify bails out, we have to continue on with restoring,
|
||||
since there can be allocated variables that would be freed on MM shutdown
|
||||
and would lead to memory corruption later ini entry is modified again */
|
||||
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
|
||||
result = ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
|
||||
} zend_end_try();
|
||||
}
|
||||
if (stage == ZEND_INI_STAGE_RUNTIME && result == FAILURE) {
|
||||
/* runtime failure is OK */
|
||||
return 1;
|
||||
}
|
||||
if (ini_entry->value != ini_entry->orig_value) {
|
||||
efree(ini_entry->value);
|
||||
}
|
||||
@@ -309,8 +315,11 @@ ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) /*
|
||||
}
|
||||
|
||||
if (EG(modified_ini_directives)) {
|
||||
zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC);
|
||||
zend_hash_del(EG(modified_ini_directives), name, name_length);
|
||||
if (zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC) == 0) {
|
||||
zend_hash_del(EG(modified_ini_directives), name, name_length);
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
+2331
-2351
File diff suppressed because it is too large.
Load diff
+68
-24
@@ -54,7 +54,9 @@
|
||||
#define YYSTATE YYGETCONDITION()
|
||||
#define yytext ((char*)SCNG(yy_text))
|
||||
#define yyleng SCNG(yy_leng)
|
||||
#define yyless(x) YYCURSOR = yytext + x
|
||||
#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \
|
||||
yyleng = (unsigned int)x; } while(0)
|
||||
|
||||
/* #define yymore() goto yymore_restart */
|
||||
|
||||
/* perform sanity check. If this message is triggered you should
|
||||
@@ -156,12 +158,28 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
|
||||
|
||||
/* {{{ init_ini_scanner()
|
||||
*/
|
||||
static void init_ini_scanner(TSRMLS_D)
|
||||
static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
|
||||
{
|
||||
/* Sanity check */
|
||||
if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) {
|
||||
zend_error(E_WARNING, "Invalid scanner mode");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
SCNG(lineno) = 1;
|
||||
SCNG(scanner_mode) = ZEND_INI_SCANNER_NORMAL;
|
||||
SCNG(scanner_mode) = scanner_mode;
|
||||
SCNG(yy_in) = fh;
|
||||
|
||||
if (fh != NULL) {
|
||||
ini_filename = zend_strndup(fh->filename, strlen(fh->filename));
|
||||
} else {
|
||||
ini_filename = NULL;
|
||||
}
|
||||
|
||||
zend_stack_init(&SCNG(state_stack));
|
||||
BEGIN(INITIAL);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -199,15 +217,14 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRML
|
||||
char *buf;
|
||||
size_t size;
|
||||
|
||||
if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) {
|
||||
if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE ||
|
||||
init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE
|
||||
) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
init_ini_scanner(TSRMLS_C);
|
||||
SCNG(scanner_mode) = scanner_mode;
|
||||
SCNG(yy_in) = fh;
|
||||
yy_scan_buffer(buf, size TSRMLS_CC);
|
||||
ini_filename = zend_strndup(fh->filename, strlen(fh->filename));
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -218,11 +235,12 @@ int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC)
|
||||
{
|
||||
int len = strlen(str);
|
||||
|
||||
init_ini_scanner(TSRMLS_C);
|
||||
SCNG(scanner_mode) = scanner_mode;
|
||||
SCNG(yy_in) = NULL;
|
||||
if (init_ini_scanner(scanner_mode, NULL TSRMLS_CC) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
yy_scan_buffer(str, len TSRMLS_CC);
|
||||
ini_filename = NULL;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -308,19 +326,18 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
TABS_AND_SPACES [ \t]
|
||||
WHITESPACE [ \t]+
|
||||
CONSTANT [a-zA-Z][a-zA-Z0-9_]*
|
||||
LABEL [a-zA-Z0-9*._-]*
|
||||
LABEL [^=\n\r\t ;|&$~(){}!"\[]+
|
||||
TOKENS [:,.\[\]"'()|^&+-/*=%$!~<>?@{}]
|
||||
OPERATORS [&|~()!]
|
||||
DOLLAR_CURLY "${"
|
||||
|
||||
SECTION_RAW_CHARS [^\]\n\r]
|
||||
SINGLE_QUOTED_CHARS [^']
|
||||
RAW_VALUE_CHARS [^=\n\r;]
|
||||
RAW_VALUE_CHARS [^\n\r;]
|
||||
|
||||
LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
|
||||
VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
|
||||
SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
|
||||
DOUBLE_QUOTES_CHARS ([^$"\\]|("\\"[^"])|{LITERAL_DOLLAR}|"\\"["][^\r\n])
|
||||
|
||||
<!*> := yyleng = YYCURSOR - SCNG(yy_text);
|
||||
|
||||
@@ -453,20 +470,47 @@ DOUBLE_QUOTES_CHARS ([^$"\\]|("\\"[^"])|{LITERAL_DOLLAR}|"\\"["][^\r\n])
|
||||
return '"';
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES>{DOUBLE_QUOTES_CHARS}+("\\"["])? { /* Escape double quoted string contents */
|
||||
if(yyleng > 1 && yytext[yyleng-1] == '"' && yytext[yyleng-2] == '\\') {
|
||||
yyless(yyleng-1);
|
||||
yyleng--;
|
||||
}
|
||||
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
|
||||
return TC_QUOTED_STRING;
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES>["]{TABS_AND_SPACES}* { /* Double quoted '"' string ends */
|
||||
yy_pop_state(TSRMLS_C);
|
||||
return '"';
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES>[^] { /* Escape double quoted string contents */
|
||||
if (YYCURSOR > YYLIMIT) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (YYCURSOR < YYLIMIT) {
|
||||
switch (*YYCURSOR++) {
|
||||
case '"':
|
||||
if (YYCURSOR < YYLIMIT && YYCURSOR[-2] == '\\' && *YYCURSOR != '\r' && *YYCURSOR != '\n') {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case '$':
|
||||
if (*YYCURSOR == '{') {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
case '\\':
|
||||
if (YYCURSOR < YYLIMIT && *YYCURSOR != '"') {
|
||||
YYCURSOR++;
|
||||
}
|
||||
/* fall through */
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
YYCURSOR--;
|
||||
break;
|
||||
}
|
||||
|
||||
yyleng = YYCURSOR - SCNG(yy_text);
|
||||
|
||||
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
|
||||
return TC_QUOTED_STRING;
|
||||
}
|
||||
|
||||
<ST_SECTION_VALUE,ST_VALUE,ST_OFFSET>{WHITESPACE} {
|
||||
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Tue May 19 08:53:54 2009 */
|
||||
/* Generated by re2c 0.13.5 on Fri Aug 7 18:29:12 2009 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
|
||||
|
||||
ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC)
|
||||
{
|
||||
zend_function *destructor = object->ce->destructor;
|
||||
zend_function *destructor = object ? object->ce->destructor : NULL;
|
||||
|
||||
if (destructor) {
|
||||
zval *obj;
|
||||
|
||||
+37
-24
@@ -940,6 +940,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type
|
||||
|
||||
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
|
||||
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
|
||||
FREE_OP1();
|
||||
} else {
|
||||
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
|
||||
/*
|
||||
@@ -2328,16 +2329,12 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
|
||||
EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
|
||||
}
|
||||
|
||||
#ifndef ZEND_VM_EXPORT
|
||||
if (zend_execute == execute && !EG(exception)) {
|
||||
EX(call_opline) = opline;
|
||||
ZEND_VM_ENTER();
|
||||
} else {
|
||||
zend_execute(EG(active_op_array) TSRMLS_CC);
|
||||
}
|
||||
#else
|
||||
zend_execute(EG(active_op_array) TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
EG(opline_ptr) = &EX(opline);
|
||||
EG(active_op_array) = EX(op_array);
|
||||
@@ -2662,7 +2659,9 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
|
||||
} else {
|
||||
zval *valptr;
|
||||
|
||||
if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) {
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||
}
|
||||
ALLOC_ZVAL(valptr);
|
||||
@@ -2688,6 +2687,10 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
Z_ADDREF_P(varptr);
|
||||
@@ -3571,28 +3574,33 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else {
|
||||
if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
} else if (OP1_TYPE == IS_CONST ||
|
||||
((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (OP1_TYPE != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
if (ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
@@ -4237,12 +4245,13 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
|
||||
zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry;
|
||||
zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC);
|
||||
|
||||
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
|
||||
if (iface) {
|
||||
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
|
||||
}
|
||||
zend_do_implement_interface(ce, iface TSRMLS_CC);
|
||||
}
|
||||
|
||||
zend_do_implement_interface(ce, iface TSRMLS_CC);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -4254,8 +4263,8 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
|
||||
int catched = 0;
|
||||
zval restored_error_reporting;
|
||||
|
||||
void **stack_frame = (void**)EX(Ts) +
|
||||
(sizeof(temp_variable) * EX(op_array)->T) / sizeof(void*);
|
||||
void **stack_frame = (void**)(((char*)EX(Ts)) +
|
||||
(ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * EX(op_array)->T));
|
||||
|
||||
while (zend_vm_stack_top(TSRMLS_C) != stack_frame) {
|
||||
zval *stack_zval_p = zend_vm_stack_pop(TSRMLS_C);
|
||||
@@ -4351,6 +4360,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
|
||||
case ZEND_USER_OPCODE_ENTER:
|
||||
ZEND_VM_ENTER();
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline));
|
||||
default:
|
||||
|
||||
+104
-69
@@ -52,13 +52,13 @@ ZEND_API void execute(zend_op_array *op_array TSRMLS_DC)
|
||||
zend_vm_enter:
|
||||
/* Initialize execute_data */
|
||||
execute_data = (zend_execute_data *)zend_vm_stack_alloc(
|
||||
sizeof(zend_execute_data) +
|
||||
sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2) +
|
||||
sizeof(temp_variable) * op_array->T TSRMLS_CC);
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T TSRMLS_CC);
|
||||
|
||||
EX(CVs) = (zval***)((char*)execute_data + sizeof(zend_execute_data));
|
||||
EX(CVs) = (zval***)((char*)execute_data + ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)));
|
||||
memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var);
|
||||
EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var * (EG(active_symbol_table) ? 1 : 2));
|
||||
EX(Ts) = (temp_variable *)(((char*)EX(CVs)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)));
|
||||
EX(fbc) = NULL;
|
||||
EX(called_scope) = NULL;
|
||||
EX(object) = NULL;
|
||||
@@ -330,16 +330,12 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
|
||||
EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
|
||||
}
|
||||
|
||||
#if 1
|
||||
if (zend_execute == execute && !EG(exception)) {
|
||||
EX(call_opline) = opline;
|
||||
ZEND_VM_ENTER();
|
||||
} else {
|
||||
zend_execute(EG(active_op_array) TSRMLS_CC);
|
||||
}
|
||||
#else
|
||||
zend_execute(EG(active_op_array) TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
EG(opline_ptr) = &EX(opline);
|
||||
EG(active_op_array) = EX(op_array);
|
||||
@@ -602,8 +598,8 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
|
||||
int catched = 0;
|
||||
zval restored_error_reporting;
|
||||
|
||||
void **stack_frame = (void**)EX(Ts) +
|
||||
(sizeof(temp_variable) * EX(op_array)->T) / sizeof(void*);
|
||||
void **stack_frame = (void**)(((char*)EX(Ts)) +
|
||||
(ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * EX(op_array)->T));
|
||||
|
||||
while (zend_vm_stack_top(TSRMLS_C) != stack_frame) {
|
||||
zval *stack_zval_p = zend_vm_stack_pop(TSRMLS_C);
|
||||
@@ -699,6 +695,10 @@ static int ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
case ZEND_USER_OPCODE_ENTER:
|
||||
ZEND_VM_ENTER();
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline));
|
||||
default:
|
||||
@@ -889,12 +889,13 @@ static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND
|
||||
zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry;
|
||||
zend_class_entry *iface = zend_fetch_class(Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant), opline->extended_value TSRMLS_CC);
|
||||
|
||||
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
|
||||
if (iface) {
|
||||
if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) {
|
||||
zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name);
|
||||
}
|
||||
zend_do_implement_interface(ce, iface TSRMLS_CC);
|
||||
}
|
||||
|
||||
zend_do_implement_interface(ce, iface TSRMLS_CC);
|
||||
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
@@ -2108,28 +2109,33 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else {
|
||||
if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
} else if (IS_CONST == IS_CONST ||
|
||||
((IS_CONST == IS_CV || IS_CONST == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_CONST != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
if (ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
@@ -4602,6 +4608,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_O
|
||||
|
||||
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
|
||||
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
|
||||
zval_dtor(free_op1.var);
|
||||
} else {
|
||||
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
|
||||
/*
|
||||
@@ -5370,28 +5377,33 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else {
|
||||
if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
} else if (IS_TMP_VAR == IS_CONST ||
|
||||
((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TMP_VAR != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
if (ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
@@ -7838,6 +7850,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_O
|
||||
|
||||
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
|
||||
retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC);
|
||||
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
|
||||
} else {
|
||||
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC);
|
||||
/*
|
||||
@@ -8278,7 +8291,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
||||
} else {
|
||||
zval *valptr;
|
||||
|
||||
if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) {
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||
}
|
||||
ALLOC_ZVAL(valptr);
|
||||
@@ -8304,6 +8319,10 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
Z_ADDREF_P(varptr);
|
||||
@@ -8715,28 +8734,33 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else {
|
||||
if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
} else if (IS_VAR == IS_CONST ||
|
||||
((IS_VAR == IS_CV || IS_VAR == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_VAR != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
if (ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
@@ -22128,7 +22152,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
||||
} else {
|
||||
zval *valptr;
|
||||
|
||||
if (!(opline->extended_value & ZEND_ARG_SEND_SILENT)) {
|
||||
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
|
||||
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
|
||||
!ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
zend_error(E_STRICT, "Only variables should be passed by reference");
|
||||
}
|
||||
ALLOC_ZVAL(valptr);
|
||||
@@ -22154,6 +22180,10 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
zend_error_noreturn(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
|
||||
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
Z_ADDREF_P(varptr);
|
||||
@@ -22555,28 +22585,33 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
array_ptr = tmp;
|
||||
if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (ce && ce->get_iterator) {
|
||||
Z_DELREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(array_ptr);
|
||||
if (!ce || !ce->get_iterator) {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
} else {
|
||||
if ((IS_CV == IS_CV || IS_CV == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1) {
|
||||
zval *tmp;
|
||||
} else if (IS_CV == IS_CONST ||
|
||||
((IS_CV == IS_CV || IS_CV == IS_VAR) &&
|
||||
!Z_ISREF_P(array_ptr) &&
|
||||
Z_REFCOUNT_P(array_ptr) > 1)) {
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
ALLOC_ZVAL(tmp);
|
||||
INIT_PZVAL_COPY(tmp, array_ptr);
|
||||
zval_copy_ctor(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
Z_ADDREF_P(array_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_CV != IS_TMP_VAR && ce && ce->get_iterator) {
|
||||
if (ce && ce->get_iterator) {
|
||||
iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC);
|
||||
|
||||
if (iter && !EG(exception)) {
|
||||
|
||||
@@ -18,13 +18,13 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
|
||||
zend_vm_enter:
|
||||
/* Initialize execute_data */
|
||||
execute_data = (zend_execute_data *)zend_vm_stack_alloc(
|
||||
sizeof(zend_execute_data) +
|
||||
sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2) +
|
||||
sizeof(temp_variable) * op_array->T TSRMLS_CC);
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)) +
|
||||
ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T TSRMLS_CC);
|
||||
|
||||
EX(CVs) = (zval***)((char*)execute_data + sizeof(zend_execute_data));
|
||||
EX(CVs) = (zval***)((char*)execute_data + ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)));
|
||||
memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var);
|
||||
EX(Ts) = (temp_variable *)(EX(CVs) + op_array->last_var * (EG(active_symbol_table) ? 1 : 2));
|
||||
EX(Ts) = (temp_variable *)(((char*)EX(CVs)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval**) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)));
|
||||
EX(fbc) = NULL;
|
||||
EX(called_scope) = NULL;
|
||||
EX(object) = NULL;
|
||||
|
||||
+1
-1
@@ -2780,7 +2780,7 @@ AC_DEFUN([PHP_DETECT_SUNCC],[
|
||||
AC_MSG_RESULT([no]),
|
||||
SUNCC="yes"
|
||||
GCC="no"
|
||||
test -n "$auto_cflags" && CFLAGS="-fsimple=2 -xnorunpath -xO4 -xalias_level=basic -xipo=1 -xlibmopt -xprefetch_level=1 -xprefetch=auto -xstrconst -xtarget=native -zlazyload"
|
||||
test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload"
|
||||
GCC=""
|
||||
AC_MSG_RESULT([yes])
|
||||
)
|
||||
|
||||
+18
-10
@@ -1,7 +1,7 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP Version 5 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997-2007 The PHP Group |
|
||||
# | Copyright (c) 1997-2006 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 3.01 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
@@ -20,9 +20,7 @@
|
||||
# Makefile to generate build tools
|
||||
#
|
||||
|
||||
ZENDDIR = Zend
|
||||
|
||||
SUBDIRS = $(ZENDDIR) TSRM
|
||||
SUBDIRS = Zend TSRM
|
||||
|
||||
STAMP = buildmk.stamp
|
||||
|
||||
@@ -33,11 +31,10 @@ all: $(STAMP) $(ALWAYS)
|
||||
@$(MAKE) -s -f build/build2.mk
|
||||
|
||||
generated_lists:
|
||||
@echo makefile_am_files = $(ZENDDIR)/Makefile.am \
|
||||
TSRM/Makefile.am > $@
|
||||
@echo config_h_files = $(ZENDDIR)/acconfig.h TSRM/acconfig.h >> $@
|
||||
@echo config_m4_files = $(ZENDDIR)/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
|
||||
$(ZENDDIR)/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
|
||||
@echo makefile_am_files = Zend/Makefile.am TSRM/Makefile.am > $@
|
||||
@echo config_h_files = Zend/acconfig.h TSRM/acconfig.h >> $@
|
||||
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
|
||||
Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
|
||||
|
||||
$(STAMP): build/buildcheck.sh
|
||||
@build/buildcheck.sh $(STAMP)
|
||||
@@ -67,7 +64,18 @@ snapshot:
|
||||
|
||||
cvsclean-work:
|
||||
@for i in `find . -name .cvsignore`; do \
|
||||
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice | sed 's/[[:space:]]/ /g'` *.o *.a .libs || true); \
|
||||
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice | sed 's/[[:space:]]/ /g'` *.o *.a *.lo *.la *.gcno *.gcda .libs || true); \
|
||||
done
|
||||
|
||||
svnclean-work:
|
||||
@for i in `find . -type d -not -path '*/.svn/*' | grep -v '.svn'`; do \
|
||||
(cd $$i 2>/dev/null && rm -rf `svn propget svn:ignore . | grep -v config.nice` *.o *.a *.lo *.la *.gcno *.gcda .libs || true); \
|
||||
done
|
||||
|
||||
gitclean-work:
|
||||
@if (test ! -f '.git/info/exclude' || grep -s "git-ls-files" .git/info/exclude); then \
|
||||
(echo "Rebuild .git/info/exclude" && echo '*.o' > .git/info/exclude && git svn propget svn:ignore | grep -v config.nice >> .git/info/exclude); \
|
||||
fi; \
|
||||
git clean -X -f -d;
|
||||
|
||||
.PHONY: $(ALWAYS) snapshot
|
||||
+4
-4
@@ -33,14 +33,14 @@ ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//'
|
||||
if test -z "$ac_version"; then
|
||||
echo "buildconf: autoconf not found."
|
||||
echo " You need autoconf version 2.13 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
echo " to build PHP from SVN."
|
||||
exit 1
|
||||
fi
|
||||
IFS=.; set $ac_version; IFS=' '
|
||||
if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then
|
||||
echo "buildconf: autoconf version $ac_version found."
|
||||
echo " You need autoconf version 2.13 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
echo " to build PHP from SVN."
|
||||
exit 1
|
||||
else
|
||||
echo "buildconf: autoconf version $ac_version (ok)"
|
||||
@@ -48,9 +48,9 @@ fi
|
||||
|
||||
if test "$1" = "2" && test "$2" -ge "50"; then
|
||||
echo "buildconf: Your version of autoconf likely contains buggy cache code."
|
||||
echo " Running cvsclean for you."
|
||||
echo " Running vcsclean for you."
|
||||
echo " To avoid this, install autoconf-2.13."
|
||||
./cvsclean
|
||||
./vcsclean
|
||||
stamp=
|
||||
fi
|
||||
|
||||
|
||||
@@ -32,38 +32,11 @@ if test "$dev" = "0" -a "$devok" = "0"; then
|
||||
echo "use buildconf --force to override this check."
|
||||
exit 1
|
||||
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
|
||||
|
||||
rm -f generated_lists
|
||||
|
||||
if test "$debug" = "yes"; then
|
||||
${MAKE:-make} -s -f build/build.mk ZENDDIR="$ZENDDIR" SUPPRESS_WARNINGS=""
|
||||
${MAKE:-make} -s -f build/build.mk SUPPRESS_WARNINGS=""
|
||||
else
|
||||
${MAKE:-make} -s -f build/build.mk ZENDDIR="$ZENDDIR"
|
||||
${MAKE:-make} -s -f build/build.mk
|
||||
fi
|
||||
+18
-24
@@ -31,7 +31,7 @@ dnl Basic autoconf + automake initialization, generation of config.nice.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
AC_PREREQ(2.13)
|
||||
AC_INIT(README.CVS-RULES)
|
||||
AC_INIT(README.SVN-RULES)
|
||||
|
||||
PHP_CONFIG_NICE(config.nice)
|
||||
|
||||
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=0
|
||||
PHP_RELEASE_VERSION=1
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
@@ -170,7 +170,7 @@ dnl Check if bison generated files exist when bison does not..
|
||||
case $php_cv_bison_version in
|
||||
""|invalid[)]
|
||||
if ! test -f "$abs_srcdir/Zend/zend_language_parser.h" || ! test -f "$abs_srcdir/Zend/zend_language_parser.c" ; then
|
||||
AC_MSG_ERROR([bison is required to build PHP/Zend when building a CVS checkout!])
|
||||
AC_MSG_ERROR([bison is required to build PHP/Zend when building a SVN checkout!])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -217,9 +217,7 @@ case $host_cpu in
|
||||
;;
|
||||
sparc*)
|
||||
if test "$SUNCC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -xmemalign=8i"
|
||||
else
|
||||
CFLAGS=""
|
||||
CFLAGS="$CFLAGS -xmemalign=8s"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -256,7 +254,6 @@ case $host_alias in
|
||||
CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
|
||||
fi
|
||||
fi
|
||||
AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther])
|
||||
php_multiple_shlib_versions_ok=yes
|
||||
;;
|
||||
*beos*)
|
||||
@@ -405,6 +402,8 @@ dnl Check for inet_aton
|
||||
dnl in -lc, -lbind and -lresolv
|
||||
PHP_CHECK_FUNC(inet_aton, resolv, bind)
|
||||
|
||||
dnl Some systems (like OpenSolaris) do not have nanosleep in libc
|
||||
PHP_CHECK_FUNC(nanosleep, rt)
|
||||
|
||||
dnl Then headers.
|
||||
dnl -------------------------------------------------------------------------
|
||||
@@ -425,9 +424,11 @@ sys/time.h \
|
||||
netinet/in.h \
|
||||
alloca.h \
|
||||
arpa/inet.h \
|
||||
arpa/nameser_compat.h \
|
||||
arpa/nameser.h \
|
||||
assert.h \
|
||||
crypt.h \
|
||||
dns.h \
|
||||
fcntl.h \
|
||||
grp.h \
|
||||
ieeefp.h \
|
||||
@@ -486,16 +487,6 @@ assert.h
|
||||
#endif
|
||||
])
|
||||
|
||||
dnl Don't use mach-o/dyld.h on Darwin 8+, dl* is recommended by Apple from there on
|
||||
dnl See http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/loading_code.html
|
||||
case $host_alias in
|
||||
*darwin[[89]]*)
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_HEADERS([mach-o/dyld.h],[],[],[])
|
||||
;;
|
||||
esac
|
||||
|
||||
PHP_FOPENCOOKIE
|
||||
PHP_BROKEN_GETCWD
|
||||
PHP_BROKEN_GLIBC_FOPEN_APPEND
|
||||
@@ -601,7 +592,6 @@ putenv \
|
||||
realpath \
|
||||
random \
|
||||
rand_r \
|
||||
res_search \
|
||||
scandir \
|
||||
setitimer \
|
||||
setlocale \
|
||||
@@ -633,7 +623,6 @@ tzset \
|
||||
unlockpt \
|
||||
unsetenv \
|
||||
usleep \
|
||||
nanosleep \
|
||||
utime \
|
||||
vsnprintf \
|
||||
vasprintf \
|
||||
@@ -791,8 +780,8 @@ if test "$PHP_DEBUG" = "yes"; then
|
||||
changequote([,])
|
||||
dnl add -O0 only if GCC or ICC is used
|
||||
if test "$GCC" = "yes" || test "$ICC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -O0"
|
||||
CXXFLAGS="$CXXFLAGS -O0"
|
||||
CFLAGS="$CFLAGS -g -O0"
|
||||
CXXFLAGS="$CXXFLAGS -g -O0"
|
||||
fi
|
||||
if test "$SUNCC" = "yes"; then
|
||||
if test -n "$auto_cflags"; then
|
||||
@@ -1579,13 +1568,18 @@ X
|
||||
fi
|
||||
|
||||
if test "$PHP_SIGCHILD" != "yes"; then
|
||||
if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then
|
||||
cat <<X
|
||||
+--------------------------------------------------------------------+
|
||||
| Notice: |
|
||||
| If you encounter <defunc> processes when using a local Oracle-DB |
|
||||
| please recompile PHP and specify --enable-sigchild when configuring|
|
||||
| (This problem has been reported under Linux using Oracle >= 8.1.5) |
|
||||
| If you encounter <defunc> processes when using a local Oracle |
|
||||
| database, set the value BEQUEATH_DETACH=YES in Oracle Net's |
|
||||
| sqlnet.ora file on the PHP host, or set the environment variable |
|
||||
| BEQUEATH_DETACH to YES before starting Apache. If the problem |
|
||||
| still occurs, then recompile PHP and specify --enable-sigchild |
|
||||
| when configuring. |
|
||||
X
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
+3
-11
@@ -21,8 +21,6 @@
|
||||
#ifndef PHP_BCMATH_H
|
||||
#define PHP_BCMATH_H
|
||||
|
||||
#if HAVE_BCMATH
|
||||
|
||||
#include "libbcmath/src/bcmath.h"
|
||||
|
||||
extern zend_module_entry bcmath_module_entry;
|
||||
@@ -50,18 +48,12 @@ ZEND_BEGIN_MODULE_GLOBALS(bcmath)
|
||||
long bc_precision;
|
||||
ZEND_END_MODULE_GLOBALS(bcmath)
|
||||
|
||||
#if ZTS
|
||||
#define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
|
||||
#ifdef ZTS
|
||||
# define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v)
|
||||
#else
|
||||
#define BCG(v) (bcmath_globals.v)
|
||||
# define BCG(v) (bcmath_globals.v)
|
||||
#endif
|
||||
|
||||
ZEND_EXTERN_MODULE_GLOBALS(bcmath)
|
||||
|
||||
#else
|
||||
|
||||
#define phpext_bcmath_ptr NULL
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PHP_BCMATH_H */
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
bcdiv — Divide two arbitrary precision numbers
|
||||
--CREDITS--
|
||||
TestFest2009
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcdiv('10.99', '0');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcdiv(): Division by zero in %s.php on line %d
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
bcdiv — Divide two arbitrary precision numbers
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcdiv('1', '2', '3', '4');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcdiv() expects at most 3 parameters, 4 given in %s.php on line %d
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
bcmod — Get modulus of an arbitrary precision number
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcmod('1', '2', '3');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcmod() expects exactly 2 parameters, 3 given in %s.php on line %d
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcpowmod('1');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcpowmod() expects at least 3 parameters, 1 given in %s.php on line %d
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcpowmod('1', '2');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcpowmod() expects at least 3 parameters, 2 given in %s.php on line %d
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
bcpowmod — Raise an arbitrary precision number to another, reduced by a specified modulus
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcpowmod('1', '2', '3', '4', '5');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcpowmod() expects at most 4 parameters, 5 given in %s.php on line %d
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
bcsqrt — Get the square root of an arbitrary precision number
|
||||
--CREDITS--
|
||||
Antoni Torrents
|
||||
antoni@solucionsinternet.com
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo bcsqrt('-9');
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: bcsqrt(): Square root of negative number in %s.php on line %d
|
||||
@@ -309,7 +309,7 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
|
||||
}
|
||||
} else if (typelibname) {
|
||||
/* Fetch the typelibrary and use that to look things up */
|
||||
typelib = php_com_load_typelib(typelibname, obj->code_page TSRMLS_CC);
|
||||
typelib = php_com_load_typelib(typelibname, CP_THREAD_ACP TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (!gotguid && dispname && typelib) {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #45280 (Reflection of instantiated COM classes causes PHP to crash)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("reflection")){ echo "skip, no reflection support present"; }
|
||||
if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; }
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$dict = new COM("Scripting.Dictionary");
|
||||
|
||||
ob_start();
|
||||
ReflectionObject::export($dict);
|
||||
ob_get_clean();
|
||||
|
||||
echo 'done';
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
||||
+1
-1
@@ -7,7 +7,7 @@ PHP_ARG_WITH(curl, for cURL support,
|
||||
|
||||
dnl Temporary option while we develop this aspect of the extension
|
||||
PHP_ARG_WITH(curlwrappers, if we should use cURL for url streams,
|
||||
[ --with-curlwrappers Use cURL for url streams], no, no)
|
||||
[ --with-curlwrappers EXPERIMENTAL: Use cURL for url streams], no, no)
|
||||
|
||||
if test "$PHP_CURL" != "no"; then
|
||||
if test -r $PHP_CURL/include/curl/easy.h; then
|
||||
|
||||
+85
-29
@@ -183,7 +183,7 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len) /*
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strncasecmp("file", uri->scheme, sizeof("file"))) {
|
||||
if (uri->scheme && !strncasecmp("file", uri->scheme, sizeof("file"))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol 'file' disabled in cURL");
|
||||
php_url_free(uri);
|
||||
return 0;
|
||||
@@ -781,6 +781,9 @@ PHP_MINIT_FUNCTION(curl)
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x070f01
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FTP_FILEMETHOD);
|
||||
#endif
|
||||
|
||||
#if LIBCURL_VERSION_NUM >= 0x071001
|
||||
REGISTER_CURL_CONSTANT(CURLFTPMETHOD_MULTICWD);
|
||||
REGISTER_CURL_CONSTANT(CURLFTPMETHOD_NOCWD);
|
||||
REGISTER_CURL_CONSTANT(CURLFTPMETHOD_SINGLECWD);
|
||||
@@ -815,13 +818,24 @@ PHP_MINIT_FUNCTION(curl)
|
||||
char **p = (char **)info->protocols;
|
||||
|
||||
while (*p != NULL) {
|
||||
php_register_url_stream_wrapper(*p++, &php_curl_wrapper TSRMLS_CC);
|
||||
/* Do not enable cURL "file" protocol and make sure cURL is always used when --with-curlwrappers is enabled */
|
||||
if (strncasecmp(*p, "file", sizeof("file")-1) != 0) {
|
||||
php_unregister_url_stream_wrapper(*p TSRMLS_CC);
|
||||
php_register_url_stream_wrapper(*p, &php_curl_wrapper TSRMLS_CC);
|
||||
}
|
||||
(void) *p++;
|
||||
}
|
||||
}
|
||||
# else
|
||||
php_unregister_url_stream_wrapper("http");
|
||||
php_register_url_stream_wrapper("http", &php_curl_wrapper TSRMLS_CC);
|
||||
php_unregister_url_stream_wrapper("https");
|
||||
php_register_url_stream_wrapper("https", &php_curl_wrapper TSRMLS_CC);
|
||||
php_unregister_url_stream_wrapper("ftp");
|
||||
php_register_url_stream_wrapper("ftp", &php_curl_wrapper TSRMLS_CC);
|
||||
php_unregister_url_stream_wrapper("ftps");
|
||||
php_register_url_stream_wrapper("ftps", &php_curl_wrapper TSRMLS_CC);
|
||||
php_unregister_url_stream_wrapper("ldap");
|
||||
php_register_url_stream_wrapper("ldap", &php_curl_wrapper TSRMLS_CC);
|
||||
# endif
|
||||
#endif
|
||||
@@ -1328,6 +1342,7 @@ PHP_FUNCTION(curl_init)
|
||||
{
|
||||
php_curl *ch;
|
||||
CURL *cp;
|
||||
zval *clone;
|
||||
char *url = NULL;
|
||||
int url_len = 0;
|
||||
|
||||
@@ -1353,6 +1368,9 @@ PHP_FUNCTION(curl_init)
|
||||
|
||||
ch->uses = 0;
|
||||
|
||||
MAKE_STD_ZVAL(clone);
|
||||
ch->clone = clone;
|
||||
|
||||
curl_easy_setopt(ch->cp, CURLOPT_NOPROGRESS, 1);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_VERBOSE, 0);
|
||||
curl_easy_setopt(ch->cp, CURLOPT_ERRORBUFFER, ch->err.str);
|
||||
@@ -1406,10 +1424,22 @@ PHP_FUNCTION(curl_copy_handle)
|
||||
|
||||
dupch->cp = cp;
|
||||
dupch->uses = 0;
|
||||
if (ch->handlers->write->stream) {
|
||||
Z_ADDREF_P(dupch->handlers->write->stream);
|
||||
dupch->handlers->write->stream = ch->handlers->write->stream;
|
||||
}
|
||||
dupch->handlers->write->method = ch->handlers->write->method;
|
||||
dupch->handlers->write->type = ch->handlers->write->type;
|
||||
if (ch->handlers->read->stream) {
|
||||
Z_ADDREF_P(ch->handlers->read->stream);
|
||||
}
|
||||
dupch->handlers->read->stream = ch->handlers->read->stream;
|
||||
dupch->handlers->read->method = ch->handlers->read->method;
|
||||
dupch->handlers->write_header->method = ch->handlers->write_header->method;
|
||||
if (ch->handlers->write_header->stream) {
|
||||
Z_ADDREF_P(ch->handlers->write_header->stream);
|
||||
}
|
||||
dupch->handlers->write_header->stream = ch->handlers->write_header->stream;
|
||||
|
||||
dupch->handlers->write->fp = ch->handlers->write->fp;
|
||||
dupch->handlers->write_header->fp = ch->handlers->write_header->fp;
|
||||
@@ -1448,6 +1478,10 @@ PHP_FUNCTION(curl_copy_handle)
|
||||
zend_llist_copy(&dupch->to_free.slist, &ch->to_free.slist);
|
||||
zend_llist_copy(&dupch->to_free.post, &ch->to_free.post);
|
||||
|
||||
/* Keep track of cloned copies to avoid invoking curl destructors for every clone */
|
||||
Z_ADDREF_P(ch->clone);
|
||||
dupch->clone = ch->clone;
|
||||
|
||||
ZEND_REGISTER_RESOURCE(return_value, dupch, le_curl);
|
||||
dupch->id = Z_LVAL_P(return_value);
|
||||
}
|
||||
@@ -1541,7 +1575,8 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
#endif
|
||||
convert_to_long_ex(zvalue);
|
||||
#if LIBCURL_VERSION_NUM >= 0x71304
|
||||
if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && (Z_LVAL_PP(zvalue) & CURLPROTO_FILE)) {
|
||||
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
|
||||
((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && (Z_LVAL_PP(zvalue) & CURLPROTO_FILE)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLPROTO_FILE cannot be activated when in safe_mode or an open_basedir is set");
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
@@ -1649,10 +1684,11 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
error = CURLE_OK;
|
||||
switch (option) {
|
||||
case CURLOPT_FILE:
|
||||
if (((php_stream *) what)->mode[0] != 'r') {
|
||||
zend_list_addref(Z_LVAL_PP(zvalue));
|
||||
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
Z_ADDREF_PP(zvalue);
|
||||
ch->handlers->write->fp = fp;
|
||||
ch->handlers->write->method = PHP_CURL_FILE;
|
||||
ch->handlers->write->stream = *zvalue;
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
|
||||
RETVAL_FALSE;
|
||||
@@ -1660,10 +1696,11 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
}
|
||||
break;
|
||||
case CURLOPT_WRITEHEADER:
|
||||
if (((php_stream *) what)->mode[0] != 'r') {
|
||||
zend_list_addref(Z_LVAL_PP(zvalue));
|
||||
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
Z_ADDREF_PP(zvalue);
|
||||
ch->handlers->write_header->fp = fp;
|
||||
ch->handlers->write_header->method = PHP_CURL_FILE;
|
||||
ch->handlers->write_header->stream = *zvalue;
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
|
||||
RETVAL_FALSE;
|
||||
@@ -1671,12 +1708,13 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
}
|
||||
break;
|
||||
case CURLOPT_INFILE:
|
||||
zend_list_addref(Z_LVAL_PP(zvalue));
|
||||
Z_ADDREF_PP(zvalue);
|
||||
ch->handlers->read->fp = fp;
|
||||
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
|
||||
ch->handlers->read->stream = *zvalue;
|
||||
break;
|
||||
case CURLOPT_STDERR:
|
||||
if (((php_stream *) what)->mode[0] != 'r') {
|
||||
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
if (ch->handlers->std_err) {
|
||||
zval_ptr_dtor(&ch->handlers->std_err);
|
||||
}
|
||||
@@ -1797,35 +1835,32 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
|
||||
* must be explicitly cast to long in curl_formadd
|
||||
* use since curl needs a long not an int. */
|
||||
if (*postval == '@') {
|
||||
char *type;
|
||||
char *type, *filename;
|
||||
++postval;
|
||||
|
||||
if ((type = php_memnstr(postval, ";type=", sizeof(";type=") - 1, postval + strlen(postval)))) {
|
||||
if ((type = php_memnstr(postval, ";type=", sizeof(";type=") - 1, postval + Z_STRLEN_PP(current)))) {
|
||||
*type = '\0';
|
||||
}
|
||||
if ((filename = php_memnstr(postval, ";filename=", sizeof(";filename=") - 1, postval + Z_STRLEN_PP(current)))) {
|
||||
*filename = '\0';
|
||||
}
|
||||
/* safe_mode / open_basedir check */
|
||||
if (php_check_open_basedir(postval TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(postval, "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (type) {
|
||||
*type = ';';
|
||||
}
|
||||
RETVAL_FALSE;
|
||||
return 1;
|
||||
}
|
||||
error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, string_key,
|
||||
CURLFORM_NAMELENGTH, (long)string_key_len - 1,
|
||||
CURLFORM_FILENAME, filename ? filename : postval,
|
||||
CURLFORM_CONTENTTYPE, type ? type + sizeof(";type=") - 1 : "application/octet-stream",
|
||||
CURLFORM_FILE, postval,
|
||||
CURLFORM_END);
|
||||
if (type) {
|
||||
error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, string_key,
|
||||
CURLFORM_NAMELENGTH, (long)string_key_len - 1,
|
||||
CURLFORM_FILE, postval,
|
||||
CURLFORM_CONTENTTYPE, type + sizeof(";type=") - 1,
|
||||
CURLFORM_END);
|
||||
*type = ';';
|
||||
} else {
|
||||
error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, string_key,
|
||||
CURLFORM_NAMELENGTH, (long)string_key_len - 1,
|
||||
CURLFORM_FILE, postval,
|
||||
CURLFORM_END);
|
||||
|
||||
}
|
||||
if (filename) {
|
||||
*filename = ';';
|
||||
}
|
||||
} else {
|
||||
error = curl_formadd(&first, &last,
|
||||
@@ -2298,8 +2333,19 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
|
||||
#if LIBCURL_VERSION_NUM < 0x071101
|
||||
zend_llist_clean(&ch->to_free.str);
|
||||
#endif
|
||||
zend_llist_clean(&ch->to_free.slist);
|
||||
zend_llist_clean(&ch->to_free.post);
|
||||
|
||||
/* cURL destructors should be invoked only by last curl handle */
|
||||
if (Z_REFCOUNT_P(ch->clone) <= 1) {
|
||||
zend_llist_clean(&ch->to_free.slist);
|
||||
zend_llist_clean(&ch->to_free.post);
|
||||
FREE_ZVAL(ch->clone);
|
||||
} else {
|
||||
Z_DELREF_P(ch->clone);
|
||||
ch->to_free.slist.dtor = NULL;
|
||||
ch->to_free.post.dtor = NULL;
|
||||
zend_llist_clean(&ch->to_free.slist);
|
||||
zend_llist_clean(&ch->to_free.post);
|
||||
}
|
||||
|
||||
if (ch->handlers->write->buf.len > 0) {
|
||||
smart_str_free(&ch->handlers->write->buf);
|
||||
@@ -2326,6 +2372,16 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
|
||||
efree(ch->header.str);
|
||||
}
|
||||
|
||||
if (ch->handlers->write_header->stream) {
|
||||
zval_ptr_dtor(&ch->handlers->write_header->stream);
|
||||
}
|
||||
if (ch->handlers->write->stream) {
|
||||
zval_ptr_dtor(&ch->handlers->write->stream);
|
||||
}
|
||||
if (ch->handlers->read->stream) {
|
||||
zval_ptr_dtor(&ch->handlers->read->stream);
|
||||
}
|
||||
|
||||
efree(ch->handlers->write);
|
||||
efree(ch->handlers->write_header);
|
||||
efree(ch->handlers->read);
|
||||
|
||||
@@ -86,6 +86,7 @@ typedef struct {
|
||||
smart_str buf;
|
||||
int method;
|
||||
int type;
|
||||
zval *stream;
|
||||
} php_curl_write;
|
||||
|
||||
typedef struct {
|
||||
@@ -94,6 +95,7 @@ typedef struct {
|
||||
FILE *fp;
|
||||
long fd;
|
||||
int method;
|
||||
zval *stream;
|
||||
} php_curl_read;
|
||||
|
||||
typedef struct {
|
||||
@@ -139,6 +141,7 @@ typedef struct {
|
||||
long id;
|
||||
unsigned int uses;
|
||||
zend_bool in_callback;
|
||||
zval *clone;
|
||||
} php_curl;
|
||||
|
||||
typedef struct {
|
||||
|
||||
+12
-4
@@ -474,8 +474,7 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
|
||||
#else
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error mcode=%d", m);
|
||||
#endif
|
||||
php_stream_close(stream);
|
||||
return NULL;
|
||||
goto exit_fail;
|
||||
}
|
||||
|
||||
/* we have only one curl handle here, even though we use multi syntax,
|
||||
@@ -493,14 +492,23 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
|
||||
}
|
||||
}
|
||||
if (msg_found) {
|
||||
php_stream_close(stream);
|
||||
return NULL;
|
||||
goto exit_fail;
|
||||
}
|
||||
}
|
||||
|
||||
/* context headers are not needed anymore */
|
||||
if (slist) {
|
||||
curl_easy_setopt(curlstream->curl, CURLOPT_HTTPHEADER, NULL);
|
||||
curl_slist_free_all(slist);
|
||||
}
|
||||
return stream;
|
||||
|
||||
exit_fail:
|
||||
php_stream_close(stream);
|
||||
if (slist) {
|
||||
curl_slist_free_all(slist);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static php_stream_wrapper_ops php_curl_wrapper_ops = {
|
||||
|
||||
@@ -5,9 +5,6 @@ Bug #46739 (array returned by curl_getinfo should contain content_type key)
|
||||
if (!extension_loaded("curl")) {
|
||||
exit("skip curl extension not loaded");
|
||||
}
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
--TEST--
|
||||
Test curl_setopt() CURLOPT_FILE readonly file handle
|
||||
--CREDITS--
|
||||
Mark van der Velden
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* Description : Adds a file which stores the received data from curl_exec();
|
||||
* Source code : ext/curl/multi.c
|
||||
* Test documentation: http://wiki.php.net/qa/temp/ext/curl
|
||||
*/
|
||||
|
||||
// Figure out what handler to use
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
if(!empty($host)) {
|
||||
|
||||
// Use the set Environment variable
|
||||
$url = "$host/get.php";
|
||||
|
||||
} else {
|
||||
|
||||
// Create a temporary file for the test
|
||||
$tempname = tempnam(sys_get_temp_dir(), 'CURL_HANDLE');
|
||||
$url = 'file://'. $tempname;
|
||||
|
||||
// add the test data to the file
|
||||
file_put_contents($tempname, "Hello World!\nHello World!");
|
||||
}
|
||||
|
||||
|
||||
$tempfile = tempnam(sys_get_temp_dir(), 'CURL_FILE_HANDLE');
|
||||
|
||||
$ch = curl_init($url);
|
||||
$fp = fopen($tempfile, "r"); // Opening 'fubar' with the incorrect readonly flag
|
||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
is_file($tempfile) and @unlink($tempfile);
|
||||
isset($tempname) and is_file($tempname) and @unlink($tempname);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: curl_setopt(): the provided file handle is not writable in %s on line %d
|
||||
Hello World!
|
||||
Hello World!
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Test CURLOPT_READDATA without a callback function
|
||||
--CREDITS--
|
||||
Mattijs Hoitink mattijshoitink@gmail.com
|
||||
#Testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// The URL to POST to
|
||||
$url = getenv('PHP_CURL_HTTP_REMOTE_SERVER') . '/get.php?test=post';
|
||||
|
||||
// Create a temporary file to read the data from
|
||||
$tempname = tempnam(sys_get_temp_dir(), 'CURL_DATA');
|
||||
$datalen = file_put_contents($tempname, "hello=world&smurf=blue");
|
||||
|
||||
ob_start();
|
||||
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_READDATA, fopen($tempname, 'rb'));
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:', "Content-Length: {$datalen}"));
|
||||
|
||||
if (false === $response = curl_exec($ch)) {
|
||||
echo 'Error #' . curl_errno($ch) . ': ' . curl_error($ch);
|
||||
} else {
|
||||
echo $response;
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
// Clean the temporary file
|
||||
@unlink($tempname);
|
||||
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["hello"]=>
|
||||
string(5) "world"
|
||||
["smurf"]=>
|
||||
string(4) "blue"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
curl_close
|
||||
--CREDITS--
|
||||
Stefan Koopmanschap <stefan@php.net>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) print 'skip';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init();
|
||||
curl_close($ch);
|
||||
var_dump($ch);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
resource(%d) of type (Unknown)
|
||||
===DONE===
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() function with basic functionality
|
||||
--CREDITS--
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing curl_copy_handle(): basic ***\n";
|
||||
|
||||
// create a new cURL resource
|
||||
$ch = curl_init();
|
||||
|
||||
// set URL and other appropriate options
|
||||
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
|
||||
// copy the handle
|
||||
$ch2 = curl_copy_handle($ch);
|
||||
|
||||
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl_copy_handle(): basic ***
|
||||
bool(true)
|
||||
===DONE===
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() with simple get
|
||||
--CREDITS--
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
echo '*** Testing curl copy handle with simple GET ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
$copy = curl_copy_handle($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$curl_content = curl_exec($copy);
|
||||
curl_close($copy);
|
||||
|
||||
var_dump( $curl_content );
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl copy handle with simple GET ***
|
||||
string(106) "array(2) {
|
||||
["test"]=>
|
||||
string(7) "getpost"
|
||||
["get_param"]=>
|
||||
string(11) "Hello World"
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
"
|
||||
===DONE===
|
||||
@@ -0,0 +1,49 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() with simple POST
|
||||
--CREDITS--
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
echo '*** Testing curl copy handle with simple POST ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=getpost";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Person=John%20Doe");
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
$copy = curl_copy_handle($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$curl_content = curl_exec($copy);
|
||||
curl_close($copy);
|
||||
|
||||
var_dump( $curl_content );
|
||||
?>
|
||||
===DONE===
|
||||
--XFAIL--
|
||||
This test fails, the copy seems to be missing the CURLOPT_POSTFIELDS after the original is closed
|
||||
--EXPECTF--
|
||||
*** Testing curl copy handle with simple POST ***
|
||||
string(163) "array(1) {
|
||||
["test"]=>
|
||||
string(7) "getpost"
|
||||
}
|
||||
array(3) {
|
||||
["Hello"]=>
|
||||
string(5) "World"
|
||||
["Foo"]=>
|
||||
string(3) "Bar"
|
||||
["Person"]=>
|
||||
string(8) "John Doe"
|
||||
}
|
||||
"
|
||||
===DONE===
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() after exec()
|
||||
--CREDITS--
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
echo '*** Test curl_copy_handle() after exec() ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=getpost&get_param=Hello%20World";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
$copy = curl_copy_handle($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$curl_content_copy = curl_exec($copy);
|
||||
curl_close($copy);
|
||||
|
||||
var_dump( $curl_content_copy );
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Test curl_copy_handle() after exec() ***
|
||||
string(106) "array(2) {
|
||||
["test"]=>
|
||||
string(7) "getpost"
|
||||
["get_param"]=>
|
||||
string(11) "Hello World"
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
"
|
||||
===DONE===
|
||||
@@ -0,0 +1,52 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() after exec() with POST
|
||||
--CREDITS--
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
echo '*** Test curl_copy_handle() after exec() with POST ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=getpost";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, "Hello=World&Foo=Bar&Person=John%20Doe");
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
|
||||
$curl_content = curl_exec($ch);
|
||||
$copy = curl_copy_handle($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$curl_content_copy = curl_exec($copy);
|
||||
curl_close($copy);
|
||||
|
||||
var_dump( $curl_content_copy );
|
||||
?>
|
||||
===DONE===
|
||||
--XFAIL--
|
||||
This test fails, the output of the copy seems to be corrupted if the original is closed after exec()
|
||||
--EXPECTF--
|
||||
*** Test curl_copy_handle() after exec() with POST ***
|
||||
string(163) "array(1) {
|
||||
["test"]=>
|
||||
string(7) "getpost"
|
||||
}
|
||||
array(3) {
|
||||
["Hello"]=>
|
||||
string(5) "World"
|
||||
["Foo"]=>
|
||||
string(3) "Bar"
|
||||
["Person"]=>
|
||||
string(8) "John Doe"
|
||||
}
|
||||
"
|
||||
===DONE===
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() with User Agent
|
||||
--CREDITS--
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
echo '*** Testing curl copy handle with User Agent ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=useragent";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, 'cURL phpt');
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
$copy = curl_copy_handle($ch);
|
||||
|
||||
var_dump( curl_exec($ch) );
|
||||
var_dump( curl_exec($copy) );
|
||||
|
||||
curl_close($ch); // can not close original handle before curl_exec($copy) since it causes char * inputs to be invalid (see also: http://curl.haxx.se/libcurl/c/curl_easy_duphandle.html)
|
||||
curl_close($copy);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl copy handle with User Agent ***
|
||||
string(9) "cURL phpt"
|
||||
string(9) "cURL phpt"
|
||||
===DONE===
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() with simple POST
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
echo '*** Testing curl copy handle with simple POST using array as arguments ***' . "\n";
|
||||
|
||||
$url = "{$host}/get.php?test=getpost";
|
||||
$ch = curl_init();
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, array("Hello" => "World", "Foo" => "Bar", "Person" => "John Doe"));
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); // Disable Expect: header (lighttpd does not support it :)
|
||||
curl_setopt($ch, CURLOPT_URL, $url); //set the url we want to use
|
||||
|
||||
$copy = curl_copy_handle($ch);
|
||||
curl_close($ch);
|
||||
|
||||
$curl_content = curl_exec($copy);
|
||||
curl_close($copy);
|
||||
|
||||
var_dump( $curl_content );
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl copy handle with simple POST using array as arguments ***
|
||||
string(163) "array(1) {
|
||||
["test"]=>
|
||||
string(7) "getpost"
|
||||
}
|
||||
array(3) {
|
||||
["Hello"]=>
|
||||
string(5) "World"
|
||||
["Foo"]=>
|
||||
string(3) "Bar"
|
||||
["Person"]=>
|
||||
string(8) "John Doe"
|
||||
}
|
||||
"
|
||||
===DONE===
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() change options in one handle
|
||||
--CREDITS--
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing curl_copy_handle(): basic ***\n";
|
||||
|
||||
// create a new cURL resource
|
||||
$ch = curl_init();
|
||||
|
||||
// set URL and other appropriate options
|
||||
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
|
||||
|
||||
// copy the handle
|
||||
$ch2 = curl_copy_handle($ch);
|
||||
|
||||
// change the CURLOPT_URL for the second handle
|
||||
curl_setopt($ch2, CURLOPT_URL, 'http://www.bar.com/');
|
||||
|
||||
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl_copy_handle(): basic ***
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() add options to the handles
|
||||
--CREDITS--
|
||||
Francesco Fullone ff@ideato.it
|
||||
#PHPTestFest Cesena Italia on 2009-06-20
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl")) exit("skip curl extension not loaded");
|
||||
?>
|
||||
--COMMENT--
|
||||
the only way to test if a option is setten on a curl handle is using the curl_getinfo() function.
|
||||
but this can only check on a limited amount of options...
|
||||
--FILE--
|
||||
<?php
|
||||
echo "*** Testing curl_copy_handle(): add options after copy ***\n";
|
||||
|
||||
// create a new cURL resource
|
||||
$ch = curl_init();
|
||||
|
||||
// copy the handle
|
||||
$ch2 = curl_copy_handle($ch);
|
||||
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
|
||||
|
||||
// add some CURLOPT to the second handle
|
||||
curl_setopt($ch2, CURLOPT_URL, 'http://www.example.com/');
|
||||
|
||||
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
|
||||
|
||||
// add same CURLOPT to the first handle
|
||||
curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/');
|
||||
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
|
||||
|
||||
// change a CURLOPT in the second handle
|
||||
curl_setopt($ch2, CURLOPT_URL, 'http://www.bar.com/');
|
||||
var_dump(curl_getinfo($ch) === curl_getinfo($ch2));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
*** Testing curl_copy_handle(): add options after copy ***
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
===DONE===
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
curl_error() function - basic test for curl_error using a fake url
|
||||
--CREDITS--
|
||||
Mattijs Hoitink mattijshoitink@gmail.com
|
||||
#Testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
* Prototype: string curl_error(resource $ch)
|
||||
* Description: Returns a clear text error message for the last cURL operation.
|
||||
* Source: ext/curl/interface.c
|
||||
* Documentation: http://wiki.php.net/qa/temp/ext/curl
|
||||
*/
|
||||
|
||||
// Fake URL to trigger an error
|
||||
$url = "fakeURL";
|
||||
|
||||
echo "== Testing curl_error with a fake URL ==\n";
|
||||
|
||||
// cURL handler
|
||||
$ch = curl_init($url);
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_exec($ch);
|
||||
echo "Error: " . curl_error($ch);
|
||||
curl_close($ch);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
== Testing curl_error with a fake URL ==
|
||||
Error: Couldn't resolve host 'fakeURL'
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
curl_multi_close
|
||||
--CREDITS--
|
||||
Stefan Koopmanschap <stefan@php.net>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) print 'skip';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_multi_init();
|
||||
curl_multi_close($ch);
|
||||
var_dump($ch);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
resource(%d) of type (Unknown)
|
||||
===DONE===
|
||||
@@ -0,0 +1,59 @@
|
||||
--TEST--
|
||||
Curl_multi_getcontent() basic test with different sources (local file/http)
|
||||
--CREDITS--
|
||||
Rein Velt (rein@velt.org)
|
||||
#TestFest Utrecht 20090509
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) print 'skip';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
//CURL_MULTI_GETCONTENT TEST
|
||||
|
||||
//CREATE RESOURCES
|
||||
$ch1=curl_init();
|
||||
$ch2=curl_init();
|
||||
|
||||
//SET URL AND OTHER OPTIONS
|
||||
curl_setopt($ch1, CURLOPT_URL, "http://php.net/robots.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
//CREATE MULTIPLE CURL HANDLE
|
||||
$mh=curl_multi_init();
|
||||
|
||||
//ADD THE 2 HANDLES
|
||||
curl_multi_add_handle($mh,$ch1);
|
||||
curl_multi_add_handle($mh,$ch2);
|
||||
|
||||
//EXECUTE
|
||||
$running=0;
|
||||
do {
|
||||
curl_multi_exec($mh,$running);
|
||||
} while ($running>0);
|
||||
|
||||
$results1=curl_multi_getcontent($ch1);
|
||||
$results2=curl_multi_getcontent($ch2);
|
||||
|
||||
//CLOSE
|
||||
curl_multi_remove_handle($mh,$ch1);
|
||||
curl_multi_remove_handle($mh,$ch2);
|
||||
curl_multi_close($mh);
|
||||
|
||||
echo $results1;
|
||||
echo $results2;
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
User-agent: *
|
||||
Disallow: /backend/
|
||||
Disallow: /distributions/
|
||||
Disallow: /stats/
|
||||
Disallow: /source.php
|
||||
Disallow: /search.php
|
||||
Disallow: /mod.php
|
||||
Disallow: /manual/add-note.php
|
||||
CURL2
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
--TEST--
|
||||
Curl_multi_getcontent() error test
|
||||
--CREDITS--
|
||||
Rein Velt (rein@velt.org)
|
||||
#TestFest Utrecht 20090509
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) print 'skip';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
//CURL_MULTI_GETCONTENT TEST
|
||||
|
||||
//CREATE RESOURCES
|
||||
$ch1=curl_init();
|
||||
$ch2=curl_init();
|
||||
|
||||
//SET URL AND OTHER OPTIONS
|
||||
curl_setopt($ch1, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata1.txt");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__)."/curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
//CREATE MULTIPLE CURL HANDLE
|
||||
$mh=curl_multi_init();
|
||||
|
||||
//ADD THE 2 HANDLES
|
||||
curl_multi_add_handle($mh,$ch1);
|
||||
curl_multi_add_handle($mh,$ch2);
|
||||
|
||||
//EXECUTE
|
||||
$running=0;
|
||||
do {
|
||||
curl_multi_exec($mh,$running);
|
||||
} while ($running>0);
|
||||
|
||||
$results1=curl_multi_getcontent(); //no parameter
|
||||
$results2=curl_multi_getcontent($ch2);
|
||||
|
||||
//CLOSE
|
||||
curl_multi_remove_handle($mh,$ch1);
|
||||
curl_multi_remove_handle($mh,$ch2);
|
||||
curl_multi_close($mh);
|
||||
|
||||
echo $results1;
|
||||
echo $results2;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: curl_multi_getcontent() expects exactly 1 parameter, 0 given in %s on line %d
|
||||
CURL2
|
||||
Loaded 100 of 1608 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user