mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-10 10:40:50 +00:00
Compare commits
633
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5643fd201 | ||
|
|
712be66d05 | ||
|
|
ae054ae502 | ||
|
|
6c841dfda3 | ||
|
|
095cbc48a8 | ||
|
|
b8a08bf263 | ||
|
|
0d1998e34f | ||
|
|
2f0d084ab8 | ||
|
|
f16c10898b | ||
|
|
536e675bfa | ||
|
|
63ded0f5e9 | ||
|
|
8a65304a01 | ||
|
|
83841052e0 | ||
|
|
141905ce54 | ||
|
|
848d71da29 | ||
|
|
8e54a63133 | ||
|
|
603bfaaff4 | ||
|
|
3a68270fcf | ||
|
|
4e03e70575 | ||
|
|
52e77c9bc8 | ||
|
|
7eee6fa759 | ||
|
|
aa37291e20 | ||
|
|
ec9b8149e1 | ||
|
|
c0ba404054 | ||
|
|
1a7f05705f | ||
|
|
a4ecf57a30 | ||
|
|
9cbf9472b6 | ||
|
|
74d2b2f0bd | ||
|
|
c55f9258b9 | ||
|
|
fbe48da396 | ||
|
|
183493d624 | ||
|
|
77b821d3c5 | ||
|
|
e8eab79ac8 | ||
|
|
0a7fd1962b | ||
|
|
451263f7d0 | ||
|
|
4307bd57db | ||
|
|
52169a44af | ||
|
|
109cc0bfab | ||
|
|
60d195dc44 | ||
|
|
bc8fc80049 | ||
|
|
4093e5e797 | ||
|
|
2ae3a4d849 | ||
|
|
361c162058 | ||
|
|
7e2d5315ec | ||
|
|
c46e5a1b7d | ||
|
|
0c4915d580 | ||
|
|
4a91e36366 | ||
|
|
d2fad53032 | ||
|
|
b84d8a5050 | ||
|
|
9aaec1c6e0 | ||
|
|
5b2ce47f2e | ||
|
|
2a0343fb18 | ||
|
|
9f78bca569 | ||
|
|
2679ccc50b | ||
|
|
300b3efff5 | ||
|
|
70b782bc9a | ||
|
|
0dcf098efd | ||
|
|
a204f8fcfd | ||
|
|
8222ae737c | ||
|
|
109346779a | ||
|
|
3fe47ef089 | ||
|
|
78742a33a7 | ||
|
|
5fdb19fba0 | ||
|
|
d1432d434c | ||
|
|
43a373437d | ||
|
|
6f8518fbf5 | ||
|
|
350325d42a | ||
|
|
06bc6bdc29 | ||
|
|
3ee878169b | ||
|
|
92e9a0bd91 | ||
|
|
1324d5d9c5 | ||
|
|
016e57a712 | ||
|
|
45ae82d3f1 | ||
|
|
aa5ce0b58d | ||
|
|
7411ae09f5 | ||
|
|
fb573462ca | ||
|
|
e9087c9d4a | ||
|
|
91983739e7 | ||
|
|
fb53dd80d8 | ||
|
|
fe96e8e64c | ||
|
|
0f799cc410 | ||
|
|
1d1d88bec0 | ||
|
|
2bfd24071b | ||
|
|
b5054a7c7b | ||
|
|
6c1f4e58ce | ||
|
|
48a5ab0eca | ||
|
|
b6137f4cb1 | ||
|
|
c446440235 | ||
|
|
b0b58c3d08 | ||
|
|
09a9df8d59 | ||
|
|
692e7f2bd9 | ||
|
|
72ad61733a | ||
|
|
8a4d75fe85 | ||
|
|
4fffb5f5e0 | ||
|
|
735dc01811 | ||
|
|
0f26db6956 | ||
|
|
a1f1e0bcf9 | ||
|
|
f7048d0925 | ||
|
|
0d73c76bec | ||
|
|
1260d8e1c3 | ||
|
|
72004f29c2 | ||
|
|
1e8fc920e1 | ||
|
|
0c5bb1702b | ||
|
|
b3b3eb8c2f | ||
|
|
31ef559712 | ||
|
|
75adcc8db0 | ||
|
|
17b39638d0 | ||
|
|
b7e84d6b83 | ||
|
|
449907fb76 | ||
|
|
1d0d8abc5f | ||
|
|
1dfbe61e2a | ||
|
|
57de041b14 | ||
|
|
f7278c161f | ||
|
|
092a21cde3 | ||
|
|
c3b83e833d | ||
|
|
7735ef1c2d | ||
|
|
48b853c82f | ||
|
|
56728f11a8 | ||
|
|
badd6a91d4 | ||
|
|
e5ccae408e | ||
|
|
772164446a | ||
|
|
bc169ba823 | ||
|
|
bf4cc0d564 | ||
|
|
42776c0259 | ||
|
|
b6530d8978 | ||
|
|
5f0e6a74ba | ||
|
|
bb6835f727 | ||
|
|
7cac52f58f | ||
|
|
2ec0a9c5c8 | ||
|
|
d0c1bd9457 | ||
|
|
cf2803d463 | ||
|
|
edea1c7b45 | ||
|
|
2c970a52e8 | ||
|
|
9a03ce581f | ||
|
|
72a133f155 | ||
|
|
0c00f3a15c | ||
|
|
1437890872 | ||
|
|
152aaba03f | ||
|
|
b44adcd5ce | ||
|
|
acd96cdebe | ||
|
|
2e6db16f51 | ||
|
|
52e836611f | ||
|
|
01317b6915 | ||
|
|
635e2c28fe | ||
|
|
0e25118cc4 | ||
|
|
98dfe36852 | ||
|
|
60937c2cf6 | ||
|
|
c819de692b | ||
|
|
a391535e00 | ||
|
|
6c01aacc0d | ||
|
|
6781f17575 | ||
|
|
e3269e029e | ||
|
|
19a0522a42 | ||
|
|
fe5f6f9188 | ||
|
|
e95bb57da9 | ||
|
|
8b4890e18e | ||
|
|
67e148a2ff | ||
|
|
09f8573a77 | ||
|
|
6972b94ae5 | ||
|
|
28faed47c4 | ||
|
|
bb4f96b2a1 | ||
|
|
5a2a02f655 | ||
|
|
677c7c974b | ||
|
|
89a4d34646 | ||
|
|
f6dfff1081 | ||
|
|
117b150360 | ||
|
|
03b39896a6 | ||
|
|
b7354a30cd | ||
|
|
c18a8bfe63 | ||
|
|
b38d56616b | ||
|
|
6c67aa07b4 | ||
|
|
1b556f6114 | ||
|
|
a7a5776be7 | ||
|
|
263ab7e2d4 | ||
|
|
8bbbfadcfe | ||
|
|
dc31f1e99e | ||
|
|
d2c8d30bb9 | ||
|
|
6da5dfd0ac | ||
|
|
5117bf657e | ||
|
|
199b52c1d4 | ||
|
|
1619ebbec6 | ||
|
|
f1eaaa5dc6 | ||
|
|
1694d78769 | ||
|
|
83ca3c8ff9 | ||
|
|
68ce999e18 | ||
|
|
f3d88a7bba | ||
|
|
777a29fce2 | ||
|
|
92039e00b0 | ||
|
|
f58cf75068 | ||
|
|
3982cda83b | ||
|
|
e7c6f9c62d | ||
|
|
95bd5f1872 | ||
|
|
0c2752169c | ||
|
|
4d554c45b9 | ||
|
|
3701485d97 | ||
|
|
dd243e5c75 | ||
|
|
509629d8b5 | ||
|
|
4e396d7333 | ||
|
|
93c3c0abfa | ||
|
|
7fc36a5210 | ||
|
|
4ef746ae25 | ||
|
|
9018d9434e | ||
|
|
c6b633a32a | ||
|
|
c4e961f06e | ||
|
|
a0f2d34b19 | ||
|
|
eccb940419 | ||
|
|
eb2878ceb7 | ||
|
|
4a0cd3946f | ||
|
|
e1ad60d3d5 | ||
|
|
c9b5d92821 | ||
|
|
48077f321f | ||
|
|
7a7b550003 | ||
|
|
192511f75d | ||
|
|
b2287a42a0 | ||
|
|
347a04711b | ||
|
|
554dd6cd02 | ||
|
|
f40e5204d4 | ||
|
|
f9745282f3 | ||
|
|
d3fdacb99f | ||
|
|
cb33a3a2c0 | ||
|
|
74cc4c8cc6 | ||
|
|
d25f2d4e06 | ||
|
|
c0edddbebd | ||
|
|
0db9b9b141 | ||
|
|
3945c4f9a6 | ||
|
|
60093a0ca5 | ||
|
|
779ca152bf | ||
|
|
b2f1ae9673 | ||
|
|
43f215a463 | ||
|
|
5ad03cd41a | ||
|
|
fe6bd56020 | ||
|
|
56c96790bb | ||
|
|
0f78629c28 | ||
|
|
aeee365d72 | ||
|
|
3e0e2820b8 | ||
|
|
a7410ea03d | ||
|
|
127d7bc79e | ||
|
|
3d888412da | ||
|
|
d296cea9f1 | ||
|
|
55573c1418 | ||
|
|
dbc999c6e1 | ||
|
|
92f68921cf | ||
|
|
ce68c06ece | ||
|
|
d26af683c9 | ||
|
|
f3af205bcb | ||
|
|
ee0ecceb80 | ||
|
|
bb10815f7e | ||
|
|
2ec2b9e9f9 | ||
|
|
08201e11fe | ||
|
|
1ec077e060 | ||
|
|
3d34acbb5f | ||
|
|
bf9933573a | ||
|
|
ee534ac62f | ||
|
|
5382f03c9f | ||
|
|
ef83bd744c | ||
|
|
77bda2614d | ||
|
|
59ad27b0aa | ||
|
|
e98759eecf | ||
|
|
9457ed351c | ||
|
|
da4a27333d | ||
|
|
29bba1fd42 | ||
|
|
1acb5b2b0c | ||
|
|
6f39604ff3 | ||
|
|
4fffbad733 | ||
|
|
14300717d8 | ||
|
|
65be07be67 | ||
|
|
98171e881b | ||
|
|
09507f0ba4 | ||
|
|
ec820e1454 | ||
|
|
4c7cd475dc | ||
|
|
71c9674e1c | ||
|
|
07a2b4817f | ||
|
|
3331bfb604 | ||
|
|
1bbda643f2 | ||
|
|
8815e14451 | ||
|
|
68365b6d32 | ||
|
|
12c3dc1b00 | ||
|
|
12864e4769 | ||
|
|
08a25c405e | ||
|
|
f19a112185 | ||
|
|
2ef05a8fa4 | ||
|
|
5236225cb2 | ||
|
|
b509ba6dbd | ||
|
|
e29302576c | ||
|
|
019e96a7f6 | ||
|
|
f86bd3407b | ||
|
|
27c73aa542 | ||
|
|
75c4d6f888 | ||
|
|
c4de2c8654 | ||
|
|
43d20bca91 | ||
|
|
496d6d45e9 | ||
|
|
5e661cf904 | ||
|
|
ddac8c1789 | ||
|
|
0a90ea4dcd | ||
|
|
e3aaeaa857 | ||
|
|
e43c21e53a | ||
|
|
8ed1dc2fa9 | ||
|
|
0cac42b482 | ||
|
|
23010d52ad | ||
|
|
260df5e802 | ||
|
|
4840a4a28b | ||
|
|
e77138f7ae | ||
|
|
1c809df001 | ||
|
|
33bee161f6 | ||
|
|
e1357bdbd1 | ||
|
|
26255062b1 | ||
|
|
f81a30961e | ||
|
|
255913f5f4 | ||
|
|
41db75ccbe | ||
|
|
19d13e2521 | ||
|
|
d8a0b1a9e3 | ||
|
|
797a1ce88f | ||
|
|
565cf8b76a | ||
|
|
5d8a5ed33d | ||
|
|
a6c07ae0d3 | ||
|
|
618d638898 | ||
|
|
631055c459 | ||
|
|
c038ac2251 | ||
|
|
d80adbcc93 | ||
|
|
4426bfee51 | ||
|
|
bd858f3b3c | ||
|
|
08d015d1db | ||
|
|
34eebd4f58 | ||
|
|
8fca015947 | ||
|
|
cb621bf1a0 | ||
|
|
5687180f61 | ||
|
|
1a166b2100 | ||
|
|
4bb816605a | ||
|
|
8affe814ed | ||
|
|
16d0023daf | ||
|
|
0f672ac0ba | ||
|
|
fd4fc39dc9 | ||
|
|
c74679be0a | ||
|
|
58e167974c | ||
|
|
9554e24547 | ||
|
|
1ffe46c020 | ||
|
|
78b2f1c488 | ||
|
|
cc24c30307 | ||
|
|
8e330affd6 | ||
|
|
f6bdb6ff61 | ||
|
|
661a69b873 | ||
|
|
e21ea5e7ce | ||
|
|
79b605a89b | ||
|
|
85e6b8141d | ||
|
|
64cca9fb95 | ||
|
|
1e30a4ecb0 | ||
|
|
23006f5089 | ||
|
|
c5741472b0 | ||
|
|
1159cd2002 | ||
|
|
df2504b0ff | ||
|
|
423816ef64 | ||
|
|
3d107d07ee | ||
|
|
f15401086b | ||
|
|
30d1410817 | ||
|
|
3901f5abb8 | ||
|
|
13eb205d6c | ||
|
|
84954e1869 | ||
|
|
09e3a1c2de | ||
|
|
e240c51632 | ||
|
|
b660f32dab | ||
|
|
9fa90f8a90 | ||
|
|
f438a87d90 | ||
|
|
c97a56e77f | ||
|
|
9d33b167af | ||
|
|
24f71e30cb | ||
|
|
7bdb10f479 | ||
|
|
9a6b6f3dc7 | ||
|
|
8f7fab9358 | ||
|
|
0295d0d1aa | ||
|
|
17f78b92c4 | ||
|
|
8ab88f2e72 | ||
|
|
7e9bc5f70b | ||
|
|
d6e15cc517 | ||
|
|
3a510c616d | ||
|
|
13c5106f43 | ||
|
|
491df98386 | ||
|
|
5d62cd1530 | ||
|
|
07fae45eb7 | ||
|
|
af203fc7c4 | ||
|
|
3c3fa89bf5 | ||
|
|
60a0348ccc | ||
|
|
8acede547d | ||
|
|
df4515dec8 | ||
|
|
ddb7740944 | ||
|
|
4a99471b07 | ||
|
|
c6f9556f37 | ||
|
|
a65e04be53 | ||
|
|
fae3000d44 | ||
|
|
4b17810a7a | ||
|
|
a1ecf8c887 | ||
|
|
25b4dfdc51 | ||
|
|
cd8f903d7e | ||
|
|
cc9483f19e | ||
|
|
dbe8c7c4fa | ||
|
|
cc45ce4586 | ||
|
|
08f78070a5 | ||
|
|
d7be9cf675 | ||
|
|
fdb22b418d | ||
|
|
c70b78c445 | ||
|
|
c3380e42c8 | ||
|
|
8d0096e2d9 | ||
|
|
9ef72e259b | ||
|
|
e0792c2590 | ||
|
|
7170a996c5 | ||
|
|
1313220640 | ||
|
|
43e4d8cade | ||
|
|
c6d59bd2fa | ||
|
|
920fa567bd | ||
|
|
ab99790eca | ||
|
|
b23baaf0fc | ||
|
|
0c4e2acbe3 | ||
|
|
e35e394a79 | ||
|
|
d96e924b25 | ||
|
|
864f8106be | ||
|
|
248a9a7f4d | ||
|
|
65a3b6e0bb | ||
|
|
fbb4b70bad | ||
|
|
9bb94d26f8 | ||
|
|
ec4eb7ab17 | ||
|
|
286d8afda9 | ||
|
|
afb0cce4c9 | ||
|
|
e58f72b6a3 | ||
|
|
46910fd722 | ||
|
|
e1813b69c5 | ||
|
|
3c15d50c80 | ||
|
|
f079dffe07 | ||
|
|
3eb3eb406e | ||
|
|
958326c843 | ||
|
|
1f8c94b7e2 | ||
|
|
ddf760eb60 | ||
|
|
80ec77df04 | ||
|
|
1cef55952f | ||
|
|
d763969344 | ||
|
|
04b6ce21d2 | ||
|
|
2da2b54899 | ||
|
|
53ee01975f | ||
|
|
d66630f625 | ||
|
|
48c69c378a | ||
|
|
5d09938423 | ||
|
|
953b10c59c | ||
|
|
f4e100e47f | ||
|
|
96abb9d611 | ||
|
|
df3cb6f2a0 | ||
|
|
8b76f0f0d3 | ||
|
|
38eec652ce | ||
|
|
323ee1fe4c | ||
|
|
fa8a1c387a | ||
|
|
c25f0424c8 | ||
|
|
6612bb1073 | ||
|
|
5fcfc528c5 | ||
|
|
262cc2f37a | ||
|
|
c05bfdf490 | ||
|
|
a7500f1c81 | ||
|
|
4c3115a011 | ||
|
|
bb988ee300 | ||
|
|
8e679c2fcf | ||
|
|
ae896ddce4 | ||
|
|
1cb8c01f0d | ||
|
|
3d74cffc20 | ||
|
|
84fc76e94c | ||
|
|
9bedfa520b | ||
|
|
3853e85a79 | ||
|
|
bbecdf57d3 | ||
|
|
d892a4299c | ||
|
|
73eac3e5a2 | ||
|
|
18b8a3bcb7 | ||
|
|
850d865551 | ||
|
|
a84c667e0e | ||
|
|
63fa1fb1ca | ||
|
|
84adf49281 | ||
|
|
a6a08dc322 | ||
|
|
e481f05470 | ||
|
|
f117d56170 | ||
|
|
1e1bfba576 | ||
|
|
9d504da334 | ||
|
|
e723c7631c | ||
|
|
269724ebcc | ||
|
|
9e20746611 | ||
|
|
abbf8be0d6 | ||
|
|
5250f01d15 | ||
|
|
8348d96656 | ||
|
|
78a46b87e3 | ||
|
|
9756f766b6 | ||
|
|
ec5b65473b | ||
|
|
864774c5b2 | ||
|
|
6feb8cb74b | ||
|
|
344136e8e9 | ||
|
|
04b5bb7d3c | ||
|
|
e04fe7986d | ||
|
|
7473a889ec | ||
|
|
9fb62f3382 | ||
|
|
5f38ffb167 | ||
|
|
8c007d8179 | ||
|
|
c27da034d0 | ||
|
|
dbf744ad78 | ||
|
|
e4a83170c7 | ||
|
|
5f502879ff | ||
|
|
952b9a9695 | ||
|
|
e63bf6e63e | ||
|
|
0d2a921916 | ||
|
|
4e2cd3ee63 | ||
|
|
18aac27b28 | ||
|
|
36c11fcaf3 | ||
|
|
1da5b05dbd | ||
|
|
ef48624cd3 | ||
|
|
0bea1fea8f | ||
|
|
408d0a0420 | ||
|
|
81ad401604 | ||
|
|
0d82e0c266 | ||
|
|
2c0ab6fc33 | ||
|
|
eb1470aa3f | ||
|
|
6e284c6ce7 | ||
|
|
f2b8b4879d | ||
|
|
aa480a4f4f | ||
|
|
d3d7da14e6 | ||
|
|
12954aa27d | ||
|
|
e0cc7032f1 | ||
|
|
6051aa795c | ||
|
|
d090061f5e | ||
|
|
db472c60cf | ||
|
|
cc93e8e51f | ||
|
|
beea66d595 | ||
|
|
cea8df3af5 | ||
|
|
de90c602e1 | ||
|
|
9fd373d8b6 | ||
|
|
4ef26e2379 | ||
|
|
56d6f23196 | ||
|
|
6ddfa33aad | ||
|
|
8f54a74d60 | ||
|
|
e34dc6c6f7 | ||
|
|
1488704098 | ||
|
|
d091516c31 | ||
|
|
409022b742 | ||
|
|
0630945ac4 | ||
|
|
79aa564f8d | ||
|
|
929e0f185c | ||
|
|
a60513240f | ||
|
|
6290b8814c | ||
|
|
f6c2511748 | ||
|
|
fa161f96fa | ||
|
|
baf2e822cc | ||
|
|
e2e96913bf | ||
|
|
92d68c62af | ||
|
|
19b6735d86 | ||
|
|
cbd4f7602e | ||
|
|
6c0c4896b3 | ||
|
|
08a499f142 | ||
|
|
44e2c266c3 | ||
|
|
42f3972e61 | ||
|
|
34f08a3715 | ||
|
|
04b575f409 | ||
|
|
f4f7a32121 | ||
|
|
159635f4f5 | ||
|
|
37c18f5ebe | ||
|
|
2449c41698 | ||
|
|
bcf8485ef5 | ||
|
|
57ec3758b7 | ||
|
|
b2110c3eea | ||
|
|
4c2e6c1cf6 | ||
|
|
bfd10cfee9 | ||
|
|
029d7f4c6c | ||
|
|
757a32cd0c | ||
|
|
f2bc53b88b | ||
|
|
b61c50a004 | ||
|
|
636c61c1d5 | ||
|
|
14e1bc89bc | ||
|
|
997f323e3a | ||
|
|
13eb47a8bc | ||
|
|
edfa1988fc | ||
|
|
741f41ff18 | ||
|
|
2b6a290d55 | ||
|
|
ae1baaa592 | ||
|
|
0c2bbe47b2 | ||
|
|
8a929d8942 | ||
|
|
32319a142f | ||
|
|
8b27b6d559 | ||
|
|
bb78412b07 | ||
|
|
395ebb5c8b | ||
|
|
4a7bf95c90 | ||
|
|
66bba32627 | ||
|
|
0ea2ef125b | ||
|
|
b0e5d35202 | ||
|
|
44add6d195 | ||
|
|
6e246ad0d5 | ||
|
|
caf6a6dc7a | ||
|
|
673fe19b39 | ||
|
|
363b56f261 | ||
|
|
5b0373b060 | ||
|
|
d69796f23f | ||
|
|
a3796f27fb | ||
|
|
c8a621b191 | ||
|
|
b3ccd26eb4 | ||
|
|
d3fd31b6dd | ||
|
|
7ec6d3ae47 | ||
|
|
a20deb1607 | ||
|
|
8535adfb31 | ||
|
|
42c4b86c88 | ||
|
|
0e3ec21e6f | ||
|
|
94ccf70c77 | ||
|
|
cf8bf9f2f0 | ||
|
|
e2ad8e9c1c | ||
|
|
823de19461 | ||
|
|
61b2568310 | ||
|
|
ac9708ccf2 | ||
|
|
987db5f747 | ||
|
|
2df7afeb1c | ||
|
|
fc83d523b8 | ||
|
|
99049e2fdd | ||
|
|
a10e7fe11d | ||
|
|
23e438594d | ||
|
|
054e1cafa0 | ||
|
|
04c2df66a3 | ||
|
|
fcb9e4b2b3 | ||
|
|
3c63a836cf | ||
|
|
22710d1c44 | ||
|
|
83b69f4034 | ||
|
|
5dc5c26a5f | ||
|
|
7acdad749c | ||
|
|
74d6fe4f00 | ||
|
|
292abd1240 | ||
|
|
d31c5e8a4d | ||
|
|
946456425e | ||
|
|
c3c761ffeb | ||
|
|
23e564762a | ||
|
|
e825d1b579 | ||
|
|
8280b0a710 | ||
|
|
627540cc0b | ||
|
|
8d1012b2c3 | ||
|
|
1d3696eecb | ||
|
|
577d81faa2 | ||
|
|
9c2b6c7b58 | ||
|
|
0b9be2918d | ||
|
|
329449f799 |
No files matched your search
+1
-1
@@ -337,7 +337,7 @@ MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: curl
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>,Ilia Alshanetsky <iliaa@php.net>
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>, Ilia Alshanetsky <iliaa@php.net>, Pierrick Charron <pierrick@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
|
||||
@@ -1,67 +1,298 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
14 Jul 2011, PHP 5.3.7 RC3
|
||||
22 Dec 2011, PHP 5.3.9RC4
|
||||
|
||||
- Core:
|
||||
. Added max_input_vars directive to prevent attacks based on hash collisions
|
||||
(Dmitry).
|
||||
|
||||
- OpenSSL:
|
||||
. Fix segfault with older versions of OpenSSL. (Scott)
|
||||
|
||||
- Streams:
|
||||
. Fixed bug #60455 (stream_get_line misbehaves if EOF is not detected together
|
||||
with the last read). (Gustavo)
|
||||
|
||||
08 Dec 2011, PHP 5.3.9RC3
|
||||
|
||||
- Filter:
|
||||
. Fixed Bug #55478 (FILTER_VALIDATE_EMAIL fails with internationalized
|
||||
domain name addresses containing >1 -). (Ilia)
|
||||
|
||||
- cURL:
|
||||
. Fixed bug #60439 (curl_copy_handle segfault when used with
|
||||
CURLOPT_PROGRESSFUNCTION). (Pierrick)
|
||||
|
||||
|
||||
- Date:
|
||||
. Fixed bug #54851 (DateTime::createFromFormat() doesn't interpret "D").
|
||||
(Derick)
|
||||
. Fixed bug #53502 (strtotime with timezone memory leak). (Derick)
|
||||
. Fixed bug #52062 (large timestamps with DateTime::getTimestamp and
|
||||
DateTime::setTimestamp). (Derick)
|
||||
. Fixed bug #51994 (date_parse_from_format is parsing invalid date using 'yz'
|
||||
format). (Derick)
|
||||
. Fixed bug #52113 (Seg fault while creating (by unserialization)
|
||||
DatePeriod). (Derick)
|
||||
|
||||
- SOAP
|
||||
. Fixed bug #54911 (Access to a undefined member in inherit SoapClient may
|
||||
cause Segmentation Fault). (Dmitry)
|
||||
|
||||
24 Nov 2011, PHP 5.3.9RC2
|
||||
|
||||
- Core:
|
||||
. Fixed bug #60138 (GC crash with referenced array in RecursiveArrayIterator)
|
||||
(Dmitry).
|
||||
. Fixed bug #60099 (__halt_compiler() works in braced namespaces). (Felipe)
|
||||
. Fixed bug #55874 (GCC does not provide __sync_fetch_and_add on some archs).
|
||||
(klightspeed at netspace dot net dot au)
|
||||
. Fixed bug #52624 (tempnam() by-pass open_basedir with nonnexistent
|
||||
directory). (Felipe)
|
||||
. Fixed invalid free in call_user_method() function. (Felipe)
|
||||
|
||||
- Zend Engine:
|
||||
. Fixed bug #43200 (Interface implementation / inheritence not possible in
|
||||
abstract classes). (Felipe)
|
||||
|
||||
- PHP-FPM SAPI:
|
||||
. Fixed bug #60179 (php_flag and php_value does not work properly). (fat)
|
||||
. Enhance error log when the primary script can't be open. FR #60199. (fat)
|
||||
. Added .phar to default authorized extensions. (fat)
|
||||
|
||||
- BCmath:
|
||||
. Fixed bug #60377 (bcscale related crashes on 64bits platforms). (shm)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #60373 (Startup errors with log_errors on cause segfault).
|
||||
(Derick)
|
||||
. Fixed bug #60236 (TLA timezone dates are not converted properly from
|
||||
timestamp). (Derick)
|
||||
. Fixed bug #55253 (DateTime::add() and sub() result -1 hour on objects with
|
||||
time zone type 2). (Derick)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #60150 (Integer overflow during the parsing of invalid exif
|
||||
header). (Stas, flolechaud at gmail dot com)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed possible memory leak in finfo_open(). (Felipe)
|
||||
. Fixed memory leak when calling the Finfo constructor twice. (Felipe)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #60192 (SegFault when Collator not constructed
|
||||
properly). (Florian)
|
||||
. Fixed memory leak in several Intl locale functions. (Felipe)
|
||||
|
||||
- Gd:
|
||||
. Fixed bug #60160 (imagefill() doesn't work correctly
|
||||
for small images). (Florian)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed possible crash in mb_ereg_search_init() using empty pattern. (Felipe)
|
||||
|
||||
- MS SQL:
|
||||
. Fixed bug #60267 (Compile failure with freetds 0.91). (Felipe)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #60279 (Fixed NULL pointer dereference in
|
||||
stream_socket_enable_crypto, case when ssl_handle of session_stream is not
|
||||
initialized.) (shm)
|
||||
|
||||
- Oracle Database extension (OCI8):
|
||||
. Fixed bug #59985 (show normal warning text for OCI_NO_DATA).
|
||||
(Chris Jones)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #60261 (NULL pointer dereference in phar). (Felipe)
|
||||
. Fixed bug #60164 (Stubs of a specific length break phar_open_from_fp
|
||||
scanning for __HALT_COMPILER). (Ralph Schindler)
|
||||
|
||||
- Postgres:
|
||||
. Fixed bug #60244 (pg_fetch_* functions do not validate that row param
|
||||
is >0). (Ilia)
|
||||
|
||||
- SOAP
|
||||
. Fixed bug #48216 (PHP Fatal error: SOAP-ERROR: Parsing WSDL:
|
||||
Extra content at the end of the doc, when server uses chunked transfer
|
||||
encoding with spaces after chunk size). (Dmitry)
|
||||
. Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references). (Dmitry)
|
||||
|
||||
- Tidy:
|
||||
. Fixed bug #54682 (Tidy::diagnose() NULL pointer dereference).
|
||||
(Maksymilian Arciemowicz, Felipe)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #60367 (Reflection and Late Static Binding). (Laruence)
|
||||
|
||||
03 Nov 2011, PHP 5.3.9RC1
|
||||
|
||||
- Core:
|
||||
. Fixed bug #60139 (Anonymous functions create cycles not detected by the
|
||||
GC). (Dmitry)
|
||||
. Fixed bug #60120 (proc_open's streams may hang with stdin/out/err when
|
||||
the data exceeds or is equal to 2048 bytes). (Pierre, Pascal Borreli)
|
||||
. Fixed bug #60019 (Function time_nanosleep() is undefined on OS X). (Ilia)
|
||||
. Fixed bug #55798 (serialize followed by unserialize with numeric object
|
||||
prop. gives integer prop). (Gustavo)
|
||||
. Fixed bug #55749 (TOCTOU issue in getenv() on Windows builds). (Pierre)
|
||||
. Fixed bug #55707 (undefined reference to `__sync_fetch_and_add_4' on Linux
|
||||
parisc). (Felipe)
|
||||
. Fixed bug #55674 (fgetcsv & str_getcsv skip empty fields in some
|
||||
tab-separated records). (Laruence)
|
||||
. Fixed bug #55649 (Undefined function Bug()). (Laruence)
|
||||
. Fixed bug #55622 (memory corruption in parse_ini_string). (Pierre)
|
||||
. Fixed bug #55576 (Cannot conditionally move uploaded file without race
|
||||
condition). (Gustavo)
|
||||
. Fixed bug #55510: $_FILES 'name' missing first character after upload.
|
||||
(Arpad)
|
||||
. Fixed bug #55509 (segfault on x86_64 using more than 2G memory). (Laruence)
|
||||
. Fixed bug #55504 (Content-Type header is not parsed correctly on
|
||||
HTTP POST request). (Hannes)
|
||||
. Fixed bug #55475 (is_a() triggers autoloader, new optional 3rd argument to
|
||||
is_a and is_subclass_of). (alan_k)
|
||||
. Fixed bug #52461 (Incomplete doctype and missing xmlns).
|
||||
(virsacer at web dot de, Pierre)
|
||||
. Fixed bug #55366 (keys lost when using substr_replace an array). (Arpad)
|
||||
. Fixed bug #55273 (base64_decode() with strict rejects whitespace after
|
||||
pad). (Ilia)
|
||||
. Fixed bug #50982 (incorrect assumption of PAGE_SIZE size). (Dmitry)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #55797 (Integer overflow in SdnToGregorian leads to segfault (in
|
||||
optimized builds). (Gustavo)
|
||||
|
||||
- Curl:
|
||||
. Fixed bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed
|
||||
before calling curl_exec). (Hannes)
|
||||
. Fixed issues were curl_copy_handle() would sometimes lose copied
|
||||
preferences. (Hannes)
|
||||
|
||||
- DateTime:
|
||||
. Fixed bug #48476 (cloning extended DateTime class without calling
|
||||
parent::__constr crashed PHP). (Hannes)
|
||||
|
||||
- Json:
|
||||
. Fixed bug #55543 (json_encode() with JSON_NUMERIC_CHECK fails on objects
|
||||
with numeric string properties). (Ilia, dchurch at sciencelogic dot com)
|
||||
|
||||
- MySQL:
|
||||
. Fixed bug #55550 (mysql.trace_mode miscounts result sets). (Johannes)
|
||||
|
||||
- MySQLi extension:
|
||||
. Fixed bug #55859 (mysqli->stat property access gives error). (Andrey)
|
||||
. Fixed bug #55582 (mysqli_num_rows() returns always 0 for unbuffered, when
|
||||
mysqlnd is used). (Andrey)
|
||||
. Fixed bug #55703 (PHP crash when calling mysqli_fetch_fields).
|
||||
(eran at zend dot com, Laruence)
|
||||
|
||||
- mysqlnd
|
||||
. Fixed bug #55609 (mysqlnd cannot be built shared). (Johannes)
|
||||
. Fixed bug #55067 (MySQL doesn't support compression - wrong config option).
|
||||
(Andrey)
|
||||
|
||||
- Oracle Database extension (OCI8):
|
||||
. Increased maximum Oracle error message buffer length for new 11.2.0.3 size.
|
||||
(Chris Jones)
|
||||
. Improve internal initalization failure error messages. (Chris Jones)
|
||||
|
||||
- PDO
|
||||
. Fixed bug #55776 (PDORow to session bug). (Johannes)
|
||||
|
||||
- PDO MySQL driver:
|
||||
. Fixed bug #60155 (pdo_mysql.default_socket ignored). (Johannes)
|
||||
. Fixed bug #55870 (PDO ignores all SSL parameters when used with mysql
|
||||
native driver). (Pierre)
|
||||
. Fixed bug #54158 (MYSQLND+PDO MySQL requires #define
|
||||
MYSQL_OPT_LOCAL_INFILE). (Andrey)
|
||||
|
||||
- PDO OCI driver:
|
||||
. Fixed bug #55768 (PDO_OCI can't resume Oracle session after it's been
|
||||
killed). (mikhail dot v dot gavrilov at gmail dot com, Chris Jones, Tony)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #52013 (Unable to decompress files in a compressed phar). (Hannes)
|
||||
. Fixed bug #53872 (internal corruption of phar). (Hannes)
|
||||
|
||||
- PHP-FPM SAPI:
|
||||
. Fixed bug #55526 (Heartbeat causes a lot of unnecessary events). (fat)
|
||||
. Fixed bug #55533 (The -d parameter doesn't work). (fat)
|
||||
. Implemented FR #52569 (Add the "ondemand" process-manager
|
||||
to allow zero children). (fat)
|
||||
. Fixed bug #55486 (status show BIG processes number). (fat)
|
||||
. Fixed bug #55577 (status.html does not install). (fat)
|
||||
. Backported from 5.4 branch (Dropped restriction of not setting the same
|
||||
value multiple times, the last one holds).
|
||||
(giovanni at giacobbi dot net, fat)
|
||||
. Backported FR #55166 from 5.4 branch (Added process.max to control
|
||||
the number of process FPM can fork). (fat)
|
||||
. Backported FR #55181 from 5.4 branch (Enhance security by limiting access
|
||||
to user defined extensions). (fat)
|
||||
. Backported FR #54098 from 5.4 branch (Lowered process manager
|
||||
default value). (fat)
|
||||
. Backported FR #52052 from 5.4 branch (Added partial syslog support). (fat)
|
||||
. Implemented FR #54577 (Enhanced status page with full status and details
|
||||
about each processes. Also provide a web page (status.html) for
|
||||
real-time FPM status. (fat)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #55267 (session_regenerate_id fails after header sent). (Hannes)
|
||||
|
||||
- NSAPI SAPI:
|
||||
. Don't set $_SERVER['HTTPS'] on unsecure connection (bug #55403). (Uwe
|
||||
Schindler)
|
||||
|
||||
- SimpleXML:
|
||||
. Reverted the SimpleXML->query() behaviour to returning empty arrays
|
||||
instead of false when no nodes are found as it was since 5.3.3
|
||||
(bug #48601). (chregu, rrichards)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #60048 (sa_len a #define on IRIX). (china at thewrittenword dot
|
||||
com)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #60082 (Crash in ArrayObject() when using recursive references).
|
||||
(Tony)
|
||||
. Fixed bug #55807 (Wrong value for splFileObject::SKIP_EMPTY).
|
||||
(jgotti at modedemploi dot fr, Hannes)
|
||||
. Fixed bug #54304 (RegexIterator::accept() doesn't work with scalar values).
|
||||
(Hannes)
|
||||
|
||||
- XSL:
|
||||
. Added xsl.security_prefs ini option to define forbidden operations within
|
||||
XSLT stylesheets, default is not to enable write operations. This option
|
||||
won't be in 5.4, since there's a new method. Fixes Bug #54446. (Chregu,
|
||||
Nicolas Gregoire)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #60094 (C++ comment fails in c89). (Laruence)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #60183 (out of sync ftp responses). (bram at ebskamp dot me,
|
||||
rasmus)
|
||||
|
||||
- SAPI:
|
||||
. Fixed bug #60205 (possible integer overflow in content_length). (Laruence)
|
||||
|
||||
|
||||
23 Aug 2011, PHP 5.3.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #55439 (crypt() returns only the salt for MD5). (Stas)
|
||||
|
||||
- OpenSSL:
|
||||
. Reverted a change in timeout handling restoring PHP 5.3.6 behavior,
|
||||
as the new behavior caused mysqlnd SSL connections to hang (#55283).
|
||||
(Pierre, Andrey, Johannes)
|
||||
|
||||
18 Aug 2011, PHP 5.3.7
|
||||
- Upgraded bundled SQLite to version 3.7.7.1. (Scott)
|
||||
- Upgraded bundled PCRE to version 8.12. (Scott)
|
||||
|
||||
- Zend Engine:
|
||||
. Fixed bug #55156 (ReflectionClass::getDocComment() returns comment even
|
||||
though the class has none). (Felipe)
|
||||
|
||||
- Core
|
||||
. Fixed bug #55187 (readlink returns weird characters when false result).
|
||||
(Pierre)
|
||||
. Fixed bug #55014 (Compile failure due to improper use of ctime_r()). (Ilia)
|
||||
. Fixed bug #54332 (Crash in zend_mm_check_ptr // Heap corruption). (Dmitry)
|
||||
. Fixed bug #54305 (Crash in gc_remove_zval_from_buffer). (Dmitry)
|
||||
. Fixed bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
|
||||
(Ralph Schindler, Dmitry)
|
||||
. Fixed buffer overflow on overlog salt in crypt(). (Clément LECIGNE, Stas)
|
||||
. Fixed bug #52935 (call exit in user_error_handler cause stream relate
|
||||
core). (Gustavo)
|
||||
|
||||
|
||||
- MCrypt
|
||||
. Change E_ERROR to E_WARNING in mcrypt_create_iv when not enough data
|
||||
has been fetched (Windows). (Pierre)
|
||||
. Fixed bug #55169 (mcrypt_create_iv always fails to gather sufficient random
|
||||
data on Windows). (Pierre)
|
||||
|
||||
- PDO DBlib:
|
||||
. Fixed bug #54329 (MSSql extension memory leak).
|
||||
(dotslashpok at gmail dot com)
|
||||
|
||||
30 Jun 2011, PHP 5.3.7 RC2
|
||||
- Core:
|
||||
. Fixed crash in error_log(). (Felipe) Reported by Mateusz Kocielski.
|
||||
. Fixed bug #55082 (var_export() doesn't escape properties properly).
|
||||
(Gustavo)
|
||||
|
||||
- DateTime extension:
|
||||
. Fixed bug where the DateTime object got changed while using date_diff().
|
||||
(Derick)
|
||||
|
||||
- DBA extension:
|
||||
. Supress warning on non-existent file open with Berkeley DB 5.2 (Chris Jones)
|
||||
|
||||
- PDO ODBC driver:
|
||||
. Fixed data type usage in 64bit. (leocsilva at gmail dot com)
|
||||
|
||||
- PHP-FPM SAPI:
|
||||
. Implemented FR #54499 (FPM ping and status_path should handle HEAD request). (fat)
|
||||
. Implemented FR #54172 (Overriding the pid file location of php-fpm). (fat)
|
||||
. Fixed missing Expires and Cache-Control headers for ping and status pages.
|
||||
(fat)
|
||||
. Fixed memory leak. (fat) Reported and fixed by Giovanni Giacobbi.
|
||||
. Fixed wrong value of log_level when invoking fpm with -tt. (fat)
|
||||
|
||||
- SPL extension:
|
||||
. Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys
|
||||
on true). (Pierrick)
|
||||
|
||||
16 Jun 2011, PHP 5.3.7 RC1
|
||||
- Upgraded bundled SQLite to version 3.7.6.3. (Scott)
|
||||
- Upgraded bundled PCRE to version 8.12. (Scott)
|
||||
- Increased the backtrack limit from 100000 to 1000000 (Rasmus)
|
||||
|
||||
- Zend Engine:
|
||||
. Fixed bug #55007 (compiler fail after previous fail). (Felipe)
|
||||
. Fixed bug #54910 (Crash when calling call_user_func with unknown function
|
||||
name). (Dmitry)
|
||||
@@ -73,45 +304,72 @@ PHP NEWS
|
||||
(Tony, Dmitry)
|
||||
. Fixed bug #54372 (Crash accessing global object itself returned from its
|
||||
__get() handle). (Dmitry)
|
||||
. Fixed bug #54358 (Closure, use and reference). (Dmitry)
|
||||
. Fixed bug #54367 (Use of closure causes problem in ArrayAccess). (Dmitry)
|
||||
. Fixed bug #54039 (use() of static variables in lambda functions can break
|
||||
staticness). (Dmitry)
|
||||
. Fixed bug #54358 (Closure, use and reference). (Dmitry)
|
||||
. Fixed bug #54262 (Crash when assigning value to a dimension in a non-array).
|
||||
(Dmitry)
|
||||
. Fixed bug #54039 (use() of static variables in lambda functions can break
|
||||
staticness). (Dmitry)
|
||||
|
||||
- Core:
|
||||
. Implemented FR #54459 (Range function accuracy). (Adam)
|
||||
- Core
|
||||
. Updated crypt_blowfish to 1.2. ((CVE-2011-2483) (Solar Designer)
|
||||
. Removed warning when argument of is_a() or is_subclass_of() is not
|
||||
a known class. (Stas)
|
||||
. Fixed crash in error_log(). (Felipe) Reported by Mateusz Kocielski.
|
||||
. Added PHP_MANDIR constant telling where the manpages were installed into,
|
||||
and an --man-dir argument to php-config. (Hannes)
|
||||
|
||||
. Fixed a crash inside dtor for error handling. (Ilia)
|
||||
. Fixed buffer overflow on overlog salt in crypt(). (Clément LECIGNE, Stas)
|
||||
. Implemented FR #54459 (Range function accuracy). (Adam)
|
||||
|
||||
. Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path).
|
||||
(Ilia)
|
||||
. Fixed bug #55339 (Segfault with allow_call_time_pass_reference = Off).
|
||||
(Dmitry)
|
||||
. Fixed bug #55295 [NEW]: popen_ex on windows, fixed possible heap overflow
|
||||
(Pierre)
|
||||
. Fixed bug #55258 (Windows Version Detecting Error).
|
||||
( xiaomao5 at live dot com, Pierre)
|
||||
. Fixed bug #55187 (readlink returns weird characters when false result).
|
||||
(Pierre)
|
||||
. Fixed bug #55082 (var_export() doesn't escape properties properly).
|
||||
(Gustavo)
|
||||
. Fixed bug #55014 (Compile failure due to improper use of ctime_r()). (Ilia)
|
||||
. Fixed bug #54939 (File path injection vulnerability in RFC1867 File upload
|
||||
filename). (Felipe) Reported by Krzysztof Kotowicz. (CVE-2011-2202)
|
||||
|
||||
. Fixed bug #54935 php_win_err can lead to crash. (Pierre)
|
||||
. Fixed bug #54924 (assert.* is not being reset upon request shutdown). (Ilia)
|
||||
. Fixed bug #54895 (Fix compiling with older gcc version without need for
|
||||
membar_producer macro). (mhei at heimpold dot de)
|
||||
. Fixed bug #54866 (incorrect accounting for realpath_cache_size).
|
||||
(Dustin Ward)
|
||||
. Fixed bug #54723 (getimagesize() doesn't check the full ico signature).
|
||||
(Scott)
|
||||
. Fixed bug #54721 (Different Hashes on Windows, BSD and Linux on wrong Salt
|
||||
size). (Pierre, os at irj dot ru)
|
||||
. Fixed bug #54580 (get_browser() segmentation fault when browscap ini
|
||||
directive is set through php_admin_value). (Gustavo)
|
||||
. Fixed bug #54332 (Crash in zend_mm_check_ptr // Heap corruption). (Dmitry)
|
||||
. Fixed bug #54305 (Crash in gc_remove_zval_from_buffer). (Dmitry)
|
||||
. Fixed bug #54238 (use-after-free in substr_replace()). (Stas)
|
||||
(CVE-2011-1148)
|
||||
. Fixed bug #54204 (Can't set a value with a PATH section in php.ini).
|
||||
(Pierre)
|
||||
. Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment).
|
||||
(tomas dot brastavicius at quantum dot lt, Pierrick)
|
||||
. Fixed bug #54137 (file_get_contents POST request sends additional line
|
||||
break). (maurice-php at mertinkat dot net, Ilia)
|
||||
. Fixed bug #54866 (incorrect accounting for realpath_cache_size).
|
||||
(Dustin Ward)
|
||||
. Fixed bug #54721 (Different Hashes on Windows, BSD and Linux on wrong Salt
|
||||
size). (Pierre, os at irj dot ru)
|
||||
. Fixed bug #53848 (fgetcsv() ignores spaces at beginnings of fields). (Ilia)
|
||||
. Alternative fix for bug #52550, as applied to the round() function (signed
|
||||
overflow), as the old fix impacted the algorithm for numbers with magnitude
|
||||
smaller than 0. (Gustavo)
|
||||
. Fixed bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
|
||||
(Ralph Schindler, Dmitry)
|
||||
. Fixed bug #52935 (call exit in user_error_handler cause stream relate
|
||||
core). (Gustavo)
|
||||
. Fixed bug #51997 (SEEK_CUR with 0 value, returns a warning). (Ilia)
|
||||
. Fixed bug #50816 (Using class constants in array definition fails).
|
||||
(Pierrick, Dmitry)
|
||||
. Fixed bug #50363 (Invalid parsing in convert.quoted-printable-decode
|
||||
filter). (slusarz at curecanti dot org)
|
||||
. Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using
|
||||
@@ -124,13 +382,15 @@ PHP NEWS
|
||||
- CLI SAPI:
|
||||
. Fixed bug #52496 (Zero exit code on option parsing failure). (Ilia)
|
||||
|
||||
- cURL:
|
||||
- cURL extension:
|
||||
. Added ini option curl.cainfo (support for custom cert db). (Pierre)
|
||||
. Added CURLINFO_REDIRECT_URL support. (Daniel Stenberg, Pierre)
|
||||
. Added support for CURLOPT_MAX_RECV_SPEED_LARGE and
|
||||
CURLOPT_MAX_SEND_SPEED_LARGE. FR #51815. (Pierrick)
|
||||
|
||||
- DateTime extension:
|
||||
. Fixed bug where the DateTime object got changed while using date_diff().
|
||||
(Derick)
|
||||
. Fixed bug #54340 (DateTime::add() method bug). (Adam)
|
||||
. Fixed bug #54316 (DateTime::createFromFormat does not handle trailing '|'
|
||||
correctly). (Adam)
|
||||
@@ -139,6 +399,7 @@ PHP NEWS
|
||||
exception and fatal error). (Hannes)
|
||||
|
||||
- DBA extension:
|
||||
. Supress warning on non-existent file open with Berkeley DB 5.2. (Chris Jones)
|
||||
. Fixed bug #54242 (dba_insert returns true if key already exists). (Felipe)
|
||||
|
||||
- Exif extesion:
|
||||
@@ -156,9 +417,13 @@ PHP NEWS
|
||||
. Fixed bug #54269 (Short exception message buffer causes crash). (Felipe)
|
||||
|
||||
- intl extension:
|
||||
. Implemented FR #54561 (Expose ICU version info). (David Zuelke, Ilia)
|
||||
. Implemented FR #54540 (Allow loading of arbitrary resource bundles when
|
||||
fallback is disabled). (David Zuelke, Stas)
|
||||
. Implemented FR #54561 (Expose ICU version info). (David Zuelke, Ilia)
|
||||
|
||||
- Imap extension:
|
||||
. Fixed bug #55313 (Number of retries not set when params specified).
|
||||
(kevin at kevinlocke dot name)
|
||||
|
||||
- json extension:
|
||||
. Fixed bug #54484 (Empty string in json_decode doesn't reset
|
||||
@@ -175,9 +440,11 @@ PHP NEWS
|
||||
- mbstring extension:
|
||||
. Fixed bug #54494 (mb_substr() mishandles UTF-32LE and UCS-2LE). (Gustavo)
|
||||
|
||||
- MySQL Improved extension:
|
||||
. Fixed Bug #54221 (mysqli::get_warnings segfault when used in multi queries).
|
||||
(Andrey)
|
||||
- MCrypt extension:
|
||||
. Change E_ERROR to E_WARNING in mcrypt_create_iv when not enough data
|
||||
has been fetched (Windows). (Pierre)
|
||||
. Fixed bug #55169 (mcrypt_create_iv always fails to gather sufficient random
|
||||
data on Windows). (Pierre)
|
||||
|
||||
- mysqlnd
|
||||
. Fixed crash when using more than 28,000 bound parameters. Workaround is to
|
||||
@@ -185,23 +452,41 @@ PHP NEWS
|
||||
. Fixed bug #54674 mysqlnd valid_sjis_(head|tail) is using invalid operator
|
||||
and range). (nihen at megabbs dot com, Andrey)
|
||||
|
||||
- OpenSSL extension
|
||||
- MySQLi extension:
|
||||
. Fixed bug #55283 (SSL options set by mysqli_ssl_set ignored for MySQLi
|
||||
persistent connections). (Andrey)
|
||||
. Fixed Bug #54221 (mysqli::get_warnings segfault when used in multi queries).
|
||||
(Andrey)
|
||||
|
||||
- OpenSSL extension:
|
||||
. openssl_encrypt()/openssl_decrypt() truncated keys of variable length
|
||||
ciphers to the OpenSSL default for the algorithm. (Scott)
|
||||
. On blocking SSL sockets respect the timeout option where possible.
|
||||
(Scott)
|
||||
. Fixed bug #54992 (Stream not closed and error not returned when SSL
|
||||
CN_match fails). (Gustavo, laird_ngrps at dodo dot com dot au)
|
||||
|
||||
- Oracle Database extension (OCI8):
|
||||
. Added oci_client_version() returning the runtime Oracle client library
|
||||
version (Chris Jones)
|
||||
version. (Chris Jones)
|
||||
|
||||
. PCRE extension:
|
||||
. Increased the backtrack limit from 100000 to 1000000 (Rasmus)
|
||||
|
||||
- PDO extension:
|
||||
. Fixed bug #54929 (Parse error with single quote in sql comment). (Felipe)
|
||||
. Fixed bug #52104 (bindColumn creates Warning regardless of ATTR_ERRMODE
|
||||
settings). (Ilia)
|
||||
|
||||
|
||||
- PDO DBlib driver:
|
||||
. Fixed bug #54329 (MSSql extension memory leak).
|
||||
(dotslashpok at gmail dot com)
|
||||
. Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field).
|
||||
(mjh at hodginsmedia dot com, Felipe)
|
||||
|
||||
- PDO ODBC driver:
|
||||
. Fixed data type usage in 64bit. (leocsilva at gmail dot com)
|
||||
|
||||
- PDO MySQL driver:
|
||||
. Fixed bug #54644 (wrong pathes in php_pdo_mysql_int.h). (Tony, Johannes)
|
||||
. Fixed bug #53782 (foreach throws irrelevant exception). (Johannes, Andrey)
|
||||
@@ -221,6 +506,12 @@ PHP NEWS
|
||||
(Felipe)
|
||||
|
||||
- PHP-FPM SAPI:
|
||||
. Implemented FR #54499 (FPM ping and status_path should handle HEAD request). (fat)
|
||||
. Implemented FR #54172 (Overriding the pid file location of php-fpm). (fat)
|
||||
. Fixed missing Expires and Cache-Control headers for ping and status pages.
|
||||
(fat)
|
||||
. Fixed memory leak. (fat) Reported and fixed by Giovanni Giacobbi.
|
||||
. Fixed wrong value of log_level when invoking fpm with -tt. (fat)
|
||||
. Added xml format to the status page. (fat)
|
||||
. Removed timestamp in logs written by children processes. (fat)
|
||||
. Fixed exit at FPM startup on fpm_resources_prepare() errors. (fat)
|
||||
@@ -236,6 +527,8 @@ PHP NEWS
|
||||
name). (Felipe, laruence at yahoo dot com dot cn)
|
||||
|
||||
- SOAP extension:
|
||||
. Fixed bug #55323 (SoapClient segmentation fault when XSD_TYPEKIND_EXTENSION
|
||||
contains itself). (Dmitry)
|
||||
. Fixed bug #54312 (soap_version logic bug). (tom at samplonius dot org)
|
||||
|
||||
- Sockets extension:
|
||||
@@ -246,6 +539,8 @@ PHP NEWS
|
||||
. Fixed bug #51958 (socket_accept() fails on IPv6 server sockets). (Gustavo)
|
||||
|
||||
- SPL extension:
|
||||
. Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys
|
||||
on true). (Pierrick)
|
||||
. Fixed bug #54970 (SplFixedArray::setSize() isn't resizing). (Felipe)
|
||||
. Fixed bug #54609 (Certain implementation(s) of SplFixedArray cause hard
|
||||
crash). (Felipe)
|
||||
@@ -263,10 +558,9 @@ PHP NEWS
|
||||
. Fixed bug #54946 (stream_get_contents infinite loop). (Hannes)
|
||||
. Fixed bug #54623 (Segfault when writing to a persistent socket after
|
||||
closing a copy of the socket). (Gustavo)
|
||||
|
||||
. Zip extension:
|
||||
. Fixed bug #54681 (addGlob() crashes on invalid flags). (Felipe)
|
||||
|
||||
|
||||
17 Mar 2011, PHP 5.3.6
|
||||
- Upgraded bundled Sqlite3 to version 3.7.4. (Ilia)
|
||||
- Upgraded bundled PCRE to version 8.11. (Ilia)
|
||||
|
||||
+20
-7
@@ -51,27 +51,40 @@ SUCH DAMAGE.
|
||||
|
||||
6. ext/standard crypt's blowfish implementation
|
||||
|
||||
The crypt_blowfish homepage is:
|
||||
|
||||
http://www.openwall.com/crypt/
|
||||
|
||||
This code comes from John the Ripper password cracker, with reentrant
|
||||
and crypt(3) interfaces added, but optimizations specific to password
|
||||
cracking removed.
|
||||
|
||||
Written by Solar Designer <solar at openwall.com> in 1998-2002 and
|
||||
placed in the public domain.
|
||||
Written by Solar Designer <solar at openwall.com> in 1998-2011.
|
||||
No copyright is claimed, and the software is hereby placed in the public
|
||||
domain. In case this attempt to disclaim copyright and place the software
|
||||
in the public domain is deemed null and void, then the software is
|
||||
Copyright (c) 1998-2011 Solar Designer and it is hereby released to the
|
||||
general public under the following terms:
|
||||
|
||||
There's absolutely no warranty.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted.
|
||||
|
||||
There's ABSOLUTELY NO WARRANTY, express or implied.
|
||||
|
||||
It is my intent that you should be able to use this on your system,
|
||||
as a part of a software package, or anywhere else to improve security,
|
||||
as part of a software package, or anywhere else to improve security,
|
||||
ensure compatibility, or for any other purpose. I would appreciate
|
||||
it if you give credit where it is due and keep your modifications in
|
||||
the public domain as well, but I don't require that in order to let
|
||||
you place this code and any modifications you make under a license
|
||||
of your choice.
|
||||
|
||||
This implementation is compatible with OpenBSD bcrypt.c (version 2a)
|
||||
by Niels Provos <provos at citi.umich.edu>, and uses some of his
|
||||
This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
|
||||
"$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
|
||||
ideas. The password hashing algorithm was designed by David Mazieres
|
||||
<dm at lcs.mit.edu>.
|
||||
<dm at lcs.mit.edu>. For more information on the level of compatibility,
|
||||
please refer to the comments in BF_set_key() and to the crypt(3) man page
|
||||
included in the crypt_blowfish tarball.
|
||||
|
||||
There's a paper on the algorithm that explains its design decisions:
|
||||
|
||||
|
||||
+29
-26
@@ -20,12 +20,18 @@ php/QA/bug websites try to have someone from the webmaster team (Bjori) on hand.
|
||||
|
||||
5. Verify the tags to be extra sure everything was tagged properly.
|
||||
|
||||
6. Moving extensions from/to PECL requires root level access to the CVS server.
|
||||
Contact systems@php.net to get this taken care of.
|
||||
6. Moving extensions from/to PECL requires write acces to the destination.
|
||||
Most developers should have this.
|
||||
|
||||
Moving extensions from php-src to PECL
|
||||
- Filesystem: cp -r php-src/ext/foo pecl/foo
|
||||
- cvs rm php-src/ext/foo
|
||||
- Checkout the pecl directory, most likely you want a sparse-root checkout
|
||||
svn co --depth=empty https://svn.php.net/repository/pecl
|
||||
- Create an directory for the extension incl. branch and tag structure,
|
||||
no trunk at this point and commit this to svn
|
||||
cd pecl; mkdir foo foo/tags foo/branches; svn add foo; svn commit
|
||||
- Move the extension from php-src to the new location
|
||||
svn mv https://svn.php.net/repository/php/php-src/trunk/ext/foo \
|
||||
https://svn.php.net/repository/pecl/foo/trunk
|
||||
|
||||
If the extension is still usable or not dead, in cooperation with the extension
|
||||
maintainers if any:
|
||||
@@ -33,26 +39,24 @@ maintainers if any:
|
||||
- create the package.xml, commit
|
||||
- release the package
|
||||
|
||||
Moving extensions from PECL to php-src
|
||||
- Filesystem: cp -r pecl/foo php-src/ext/foo
|
||||
OR depending on the wishes from the PECL extension maintainer.
|
||||
- Filesystem: ln -s pecl/foo php-src/ext/foo
|
||||
For Moving extensions from PECL to php-src the svn mv has to be tone the other
|
||||
way round.
|
||||
|
||||
Rolling a non stable release (alpha/beta/RC)
|
||||
--------------------------------------------
|
||||
|
||||
1. Check windows snapshot builder logs (http://snaps.php.net/win32/snapshot-STABLE.log f.e.)
|
||||
1. Check windows snapshot builder logs (http://windows.php.net/downloads/snaps/ the last revision)
|
||||
|
||||
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
Do not use abbreviations for alpha and beta.
|
||||
|
||||
3. Commit those changes
|
||||
|
||||
4. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
2. run the "scripts/dev/credits" script in php-src and commit the changes in the
|
||||
credits files in ext/standard.
|
||||
|
||||
5. tag the repository with the version f.e. "``cvs tag php_4_4_1RC1``"
|
||||
(of course, you need to change that to the version you're rolling an RC for).
|
||||
3. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
|
||||
Do not use abbreviations for alpha and beta.
|
||||
|
||||
4. Commit those changes and note the revision id.
|
||||
|
||||
5. tag the repository with the version. To do the tag in a fast way do a svn copy on the server using full URLs. You should use the revision id from the above commit to prevent mistakes in case there was a commit in between. f.e. "``svn cp https://svn.php.net/repository/php/php-src/branches/PHP_5_3@308399 https://svn.php.net/repository/php/php-src/tags/php_5_3_6RC1``"
|
||||
(of course, you need to change that to the version you're rolling an RC for). Mail php-internals to announce the tag so tests/validation/check can be done prior to package it. It is especially important for RCs.
|
||||
|
||||
6. Bump up the version numbers in ``main/php_version.h``, ``configure.in``
|
||||
and possibly ``NEWS`` again, to the **next** version. F.e. if the release
|
||||
@@ -65,7 +69,7 @@ correctly work.
|
||||
8. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
|
||||
branch if you're rolling 4.4.x releases).
|
||||
|
||||
9. You do not have to update the tree, but of course you can with "``cvs up -dP``".
|
||||
9. You do not have to update the tree, but of course you can with "``svn up``".
|
||||
|
||||
10. run: ``./makedist php 4.4.1RC1``, this will export the tree, create configure
|
||||
and build two tarballs (one gz and one bz2).
|
||||
@@ -109,22 +113,21 @@ Derick) run the following commands for you:
|
||||
|
||||
Note: Remember to update the MD5 checksum information.
|
||||
|
||||
1. Update in ``php-bugs/trunk/include/functions.inc`` the ``show_version_option``
|
||||
function to include the new RC and commit.
|
||||
|
||||
2. Update ``phpweb/include/version.inc`` (x=major version number)
|
||||
4. Update ``web/php/trunk/include/version.inc`` (x=major version number)
|
||||
|
||||
a. ``$PHP_x_RC`` = "5.3.0RC1"
|
||||
|
||||
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
|
||||
|
||||
3. Commit those changes:
|
||||
5. Commit those changes:
|
||||
|
||||
a. ``cvs commit include/version.inc include/releases.inc``
|
||||
a. ``svn commit web/qa/trunk web/php-bugs/trunk web/php/trunk``
|
||||
|
||||
4. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
|
||||
6. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
|
||||
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
|
||||
|
||||
7. Publish the announce on www.php.net as well (for all releases, alpha, RCs or other)
|
||||
|
||||
Rolling a stable release
|
||||
------------------------
|
||||
|
||||
@@ -162,7 +165,7 @@ and build two tarballs (one gz and one bz2).
|
||||
|
||||
13. Once the release has been tagged, contact the PHP Windows development team
|
||||
(internals-win@lists.php.net) so that Windows binaries can be created. Once
|
||||
those are made, they should be committed to CVS too.
|
||||
those are made, they should be committed to SVN too.
|
||||
|
||||
14. Check if the pear files are updated (phar for 5.1+ or run pear/make-pear-bundle.php with 4.4)
|
||||
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ Having said that, here are the organizational rules::
|
||||
To do so use "make test".
|
||||
|
||||
7. For development use the --enable-maintainer-zts switch to ensure your
|
||||
code handles TSRM correctly and doesn't break for thos who need that.
|
||||
code handles TSRM correctly and doesn't break for those who need that.
|
||||
|
||||
Currently we have the following branches in use::
|
||||
|
||||
|
||||
@@ -532,6 +532,10 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
|
||||
}
|
||||
|
||||
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
|
||||
if (!cmd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
|
||||
if (asuser) {
|
||||
res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
|
||||
|
||||
@@ -153,6 +153,20 @@ UPGRADE NOTES - PHP 5.3
|
||||
|
||||
- SplObjectStorage now has ArrayAccess support. It is also now possible to
|
||||
store associative information with objects in SplObjectStorage.
|
||||
|
||||
=====================
|
||||
4.1 New in PHP 5.3.9
|
||||
=====================
|
||||
|
||||
- Write operations within XSLT (for example with the extension sax:output) are
|
||||
disabled by default. You can define what is forbidden with the INI option
|
||||
xsl.security_prefs. This option will be marked as deprecated in 5.4 again.
|
||||
Use the method XsltProcess::setSecurityPrefs($options) there.
|
||||
|
||||
- the following new directives were added
|
||||
|
||||
- max_input_vars - specifies how many GET/POST/COOKIE input variables may be
|
||||
accepted. default value 1000.
|
||||
|
||||
=============
|
||||
5. Deprecated
|
||||
@@ -334,6 +348,9 @@ UPGRADE NOTES - PHP 5.3
|
||||
|
||||
- A new directive, request_order, controls the behavior of $_REQUEST
|
||||
independently of variables_order.
|
||||
- A new directive, called windows.show_crt_warning, has been introduced.
|
||||
This directive shows the CRT warnings when enabled. These warnings were
|
||||
displayed by default until now. It is disabled by default.
|
||||
|
||||
- New INI directives:
|
||||
- mail.add_x_header
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
Bug #31683 (changes to $name in __get($name) override future parameters)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
--TEST--
|
||||
Bug #43200 (Interface implementation / inheritence not possible in abstract classes)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface a {
|
||||
function foo();
|
||||
function bar();
|
||||
}
|
||||
interface b {
|
||||
function foo();
|
||||
}
|
||||
|
||||
abstract class c {
|
||||
function bar() { }
|
||||
}
|
||||
|
||||
class x extends c implements a, b {
|
||||
function foo() { }
|
||||
}
|
||||
|
||||
ReflectionClass::export('x');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Class [ <user> class x extends c implements a, b ] {
|
||||
@@ %s 15-17
|
||||
|
||||
- Constants [0] {
|
||||
}
|
||||
|
||||
- Static properties [0] {
|
||||
}
|
||||
|
||||
- Static methods [0] {
|
||||
}
|
||||
|
||||
- Properties [0] {
|
||||
}
|
||||
|
||||
- Methods [2] {
|
||||
Method [ <user, prototype b> public method foo ] {
|
||||
@@ %s 16 - 16
|
||||
}
|
||||
|
||||
Method [ <user, inherits c, prototype a> public method bar ] {
|
||||
@@ %s 12 - 12
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #43200.2 (Interface implementation / inheritence not possible in abstract classes)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface A {
|
||||
function foo();
|
||||
}
|
||||
|
||||
abstract class B implements A {
|
||||
abstract public function foo();
|
||||
}
|
||||
|
||||
class C extends B {
|
||||
public function foo() {
|
||||
echo 'works';
|
||||
}
|
||||
}
|
||||
|
||||
$o = new C();
|
||||
$o->foo();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
works
|
||||
@@ -20,5 +20,5 @@ var_dump( ArrayProperty::$array );
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(23)
|
||||
int(42)
|
||||
}
|
||||
@@ -18,9 +18,9 @@ var_dump(
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1
|
||||
Parse error: %s in %s(%d) : runtime-created function on line 1
|
||||
|
||||
Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1
|
||||
Parse error: %s %s(%d) : runtime-created function on line 1
|
||||
bool(false)
|
||||
int(2)
|
||||
bool(false)
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Bug #50816 (Using class constants in array definition fails)
|
||||
--FILE--
|
||||
<?php
|
||||
define("ONE", 1);
|
||||
define("TWO", 1);
|
||||
|
||||
class Foo {
|
||||
const ONE = 1;
|
||||
const TWO = 1;
|
||||
|
||||
public static $mapWithConst = array(self::ONE => 'one', self::TWO => 'two',);
|
||||
|
||||
public static $mapWithConst1 = array(1 => 'one', self::TWO => 'two',);
|
||||
public static $mapWithConst2 = array(self::ONE => 'one', 1 => 'two',);
|
||||
|
||||
public static $mapWithoutConst = array(1 => 'one', 1 => 'two',);
|
||||
}
|
||||
|
||||
$mapWithConst = array(1 => 'one', 1 => 'two',);
|
||||
|
||||
$mapWithoutConst = array(Foo::ONE => 'one', Foo::TWO => 'two',);
|
||||
$mapWithoutConst0 = array(1 => 'one', 1 => 'two',);
|
||||
$mapWithoutConst1 = array(ONE => 'one', 1 => 'two',);
|
||||
$mapWithoutConst2 = array(1 => 'one', TWO => 'two',);
|
||||
$mapWithoutConst3 = array(ONE => 'one', TWO => 'two',);
|
||||
|
||||
var_dump(Foo::$mapWithConst[1]);
|
||||
var_dump(Foo::$mapWithConst1[1]);
|
||||
var_dump(Foo::$mapWithConst2[1]);
|
||||
var_dump(Foo::$mapWithoutConst[1]);
|
||||
var_dump($mapWithConst[1]);
|
||||
var_dump($mapWithoutConst[1]);
|
||||
var_dump($mapWithoutConst0[1]);
|
||||
var_dump($mapWithoutConst1[1]);
|
||||
var_dump($mapWithoutConst2[1]);
|
||||
var_dump($mapWithoutConst3[1]);
|
||||
--EXPECT--
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
string(3) "two"
|
||||
@@ -11,7 +11,7 @@ echo "ok\n";
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
|
||||
Warning: Attempt to modify property of non-object in %s/Zend/tests/bug54262.php on line 4
|
||||
Warning: Attempt to modify property of non-object in %sbug54262.php on line 4
|
||||
|
||||
Warning: Cannot use a scalar value as an array in %s/Zend/tests/bug54262.php on line 5
|
||||
ok
|
||||
Warning: Cannot use a scalar value as an array in %sbug54262.php on line 5
|
||||
ok
|
||||
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #55339 (Segfault with allow_call_time_pass_reference = Off)
|
||||
--INI--
|
||||
allow_call_time_pass_reference=off
|
||||
--FILE--
|
||||
<?php
|
||||
function error_handler($errno, $errstr, $errfile, $errline) {
|
||||
eval(';');
|
||||
}
|
||||
|
||||
set_error_handler('error_handler');
|
||||
|
||||
eval(<<<'EOF'
|
||||
function foo()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($array as $key => $value) {
|
||||
bar($key, &$value);
|
||||
}
|
||||
}
|
||||
|
||||
function bar()
|
||||
{
|
||||
|
||||
}
|
||||
EOF
|
||||
);
|
||||
|
||||
echo "OK\n";
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -0,0 +1,65 @@
|
||||
--TEST--
|
||||
Bug #55509 (segfault on x86_64 using more than 2G memory)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die('skip Not for 32-bits OS');
|
||||
}
|
||||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
|
||||
// check the available memory
|
||||
if (PHP_OS == 'Linux') {
|
||||
$lines = file('/proc/meminfo');
|
||||
$infos = array();
|
||||
foreach ($lines as $line) {
|
||||
$tmp = explode(":", $line);
|
||||
$index = strtolower($tmp[0]);
|
||||
$value = (int)ltrim($tmp[1], " ")*1024;
|
||||
$infos[$index] = $value;
|
||||
}
|
||||
$freeMemory = $infos['memfree']+$infos['buffers']+$infos['cached'];
|
||||
if ($freeMemory < 2100*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
}
|
||||
elseif (PHP_OS == 'FreeBSD') {
|
||||
$lines = explode("\n",`sysctl -a`);
|
||||
$infos = array();
|
||||
foreach ($lines as $line) {
|
||||
if(!$line){
|
||||
continue;
|
||||
}
|
||||
$tmp = explode(":", $line);
|
||||
$index = strtolower($tmp[0]);
|
||||
$value = trim($tmp[1], " ");
|
||||
$infos[$index] = $value;
|
||||
}
|
||||
$freeMemory = ($infos['vm.stats.vm.v_inactive_count']*$infos['hw.pagesize'])
|
||||
+($infos['vm.stats.vm.v_cache_count']*$infos['hw.pagesize'])
|
||||
+($infos['vm.stats.vm.v_free_count']*$infos['hw.pagesize']);
|
||||
if ($freeMemory < 2100*1024*1024) {
|
||||
die('skip Not enough memory.');
|
||||
}
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
memory_limit=2100M
|
||||
--FILE--
|
||||
<?php
|
||||
$a1 = str_repeat("1", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "1\n";
|
||||
$a2 = str_repeat("2", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "2\n";
|
||||
$a3 = str_repeat("3", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "3\n";
|
||||
$a4 = str_repeat("4", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "4\n";
|
||||
$a5 = str_repeat("5", 1024 * 1024 * 1024 * 0.5);
|
||||
echo "5\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
|
||||
Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #60099 (__halt_compiler() works in braced namespaces)
|
||||
--FILE--
|
||||
<?php
|
||||
namespace foo {
|
||||
__halt_compiler();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: __HALT_COMPILER() can only be used from the outermost scope in %s on line %d
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #60138 (GC crash with referenced array in RecursiveArrayIterator)
|
||||
--FILE--
|
||||
<?php
|
||||
$tree = array(array("f"));
|
||||
$category =& $tree[0];
|
||||
|
||||
$iterator = new RecursiveIteratorIterator(
|
||||
new RecursiveArrayIterator($tree),
|
||||
RecursiveIteratorIterator::SELF_FIRST
|
||||
);
|
||||
foreach($iterator as $file);
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
Bug #60139 (Anonymous functions create cycles not detected by the GC)
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
public $x;
|
||||
|
||||
public function __construct() {
|
||||
$this->x = function() {};
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
public $x;
|
||||
|
||||
public function __construct() {
|
||||
$self = $this;
|
||||
$this->x = function() use ($self) {};
|
||||
}
|
||||
}
|
||||
|
||||
gc_collect_cycles();
|
||||
new Foo;
|
||||
var_dump(gc_collect_cycles());
|
||||
new Bar;
|
||||
var_dump(gc_collect_cycles());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(2)
|
||||
@@ -17,4 +17,4 @@ interface a extends d, w { }
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Can't inherit abstract function c::B() (previously declared abstract in d) in %s on line %d
|
||||
Fatal error: Cannot make non static method c::B() static in class d in %s on line %d
|
||||
@@ -14,6 +14,8 @@ interface b {
|
||||
interface c extends a, b {
|
||||
}
|
||||
|
||||
echo "done!\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Can't inherit abstract function b::b() (previously declared abstract in a) in %s on line %d
|
||||
done!
|
||||
@@ -14,6 +14,8 @@ interface Itest2 {
|
||||
interface Itest3 extends Itest, Itest2 {
|
||||
}
|
||||
|
||||
echo "done!\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Can't inherit abstract function Itest2::a() (previously declared abstract in Itest) in %s on line %d
|
||||
done!
|
||||
+44
-3
@@ -821,7 +821,7 @@ void zend_append_version_info(const zend_extension *extension) /* {{{ */
|
||||
char *new_info;
|
||||
uint new_info_length;
|
||||
|
||||
new_info_length = sizeof(" with v, by \n")
|
||||
new_info_length = sizeof(" with v, , by \n")
|
||||
+ strlen(extension->name)
|
||||
+ strlen(extension->version)
|
||||
+ strlen(extension->copyright)
|
||||
@@ -829,10 +829,10 @@ void zend_append_version_info(const zend_extension *extension) /* {{{ */
|
||||
|
||||
new_info = (char *) malloc(new_info_length + 1);
|
||||
|
||||
sprintf(new_info, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author);
|
||||
snprintf(new_info, new_info_length, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author);
|
||||
|
||||
zend_version_info = (char *) realloc(zend_version_info, zend_version_info_length+new_info_length + 1);
|
||||
strcat(zend_version_info, new_info);
|
||||
strncat(zend_version_info, new_info, new_info_length);
|
||||
zend_version_info_length += new_info_length;
|
||||
free(new_info);
|
||||
}
|
||||
@@ -958,6 +958,23 @@ ZEND_API int zend_get_configuration_directive(const char *name, uint name_length
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#define SAVE_STACK(stack) do { \
|
||||
if (CG(stack).top) { \
|
||||
memcpy(&stack, &CG(stack), sizeof(zend_stack)); \
|
||||
CG(stack).top = CG(stack).max = 0; \
|
||||
CG(stack).elements = NULL; \
|
||||
} else { \
|
||||
stack.top = 0; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define RESTORE_STACK(stack) do { \
|
||||
if (stack.top) { \
|
||||
zend_stack_destroy(&CG(stack)); \
|
||||
memcpy(&CG(stack), &stack, sizeof(zend_stack)); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
{
|
||||
va_list args;
|
||||
@@ -970,6 +987,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
zval *orig_user_error_handler;
|
||||
zend_bool in_compilation;
|
||||
zend_class_entry *saved_class_entry;
|
||||
zend_stack bp_stack;
|
||||
zend_stack function_call_stack;
|
||||
zend_stack switch_cond_stack;
|
||||
zend_stack foreach_copy_stack;
|
||||
zend_stack object_stack;
|
||||
zend_stack declare_stack;
|
||||
zend_stack list_stack;
|
||||
zend_stack labels_stack;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
/* Obtain relevant filename and lineno */
|
||||
@@ -1097,6 +1122,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
if (in_compilation) {
|
||||
saved_class_entry = CG(active_class_entry);
|
||||
CG(active_class_entry) = NULL;
|
||||
SAVE_STACK(bp_stack);
|
||||
SAVE_STACK(function_call_stack);
|
||||
SAVE_STACK(switch_cond_stack);
|
||||
SAVE_STACK(foreach_copy_stack);
|
||||
SAVE_STACK(object_stack);
|
||||
SAVE_STACK(declare_stack);
|
||||
SAVE_STACK(list_stack);
|
||||
SAVE_STACK(labels_stack);
|
||||
}
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
|
||||
@@ -1113,6 +1146,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
|
||||
if (in_compilation) {
|
||||
CG(active_class_entry) = saved_class_entry;
|
||||
RESTORE_STACK(bp_stack);
|
||||
RESTORE_STACK(function_call_stack);
|
||||
RESTORE_STACK(switch_cond_stack);
|
||||
RESTORE_STACK(foreach_copy_stack);
|
||||
RESTORE_STACK(object_stack);
|
||||
RESTORE_STACK(declare_stack);
|
||||
RESTORE_STACK(list_stack);
|
||||
RESTORE_STACK(labels_stack);
|
||||
}
|
||||
|
||||
if (!EG(user_error_handler)) {
|
||||
|
||||
+3
-2
@@ -941,6 +941,7 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC,
|
||||
zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
|
||||
ce->name, get_active_function_name(TSRMLS_C), Z_OBJCE_P(this_ptr)->name, get_active_function_name(TSRMLS_C));
|
||||
}
|
||||
va_end(va);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -2307,7 +2308,7 @@ ZEND_API ZEND_FUNCTION(display_disabled_function)
|
||||
|
||||
static zend_function_entry disabled_function[] = {
|
||||
ZEND_FE(display_disabled_function, NULL)
|
||||
{ NULL, NULL, NULL }
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */
|
||||
@@ -2333,7 +2334,7 @@ static zend_object_value display_disabled_class(zend_class_entry *class_type TSR
|
||||
/* }}} */
|
||||
|
||||
static const zend_function_entry disabled_class_new[] = {
|
||||
{ NULL, NULL, NULL }
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
||||
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */
|
||||
|
||||
@@ -96,6 +96,8 @@ typedef struct _zend_fcall_info_cache {
|
||||
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
|
||||
#define ZEND_NS_DEP_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED)
|
||||
|
||||
#define ZEND_FE_END { NULL, NULL, NULL, 0, 0 }
|
||||
|
||||
#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
|
||||
#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
|
||||
#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, 0, allow_null, pass_by_ref, 0, 0 },
|
||||
|
||||
+1
-1
@@ -510,7 +510,7 @@ static unsigned int _zend_mm_cookie = 0;
|
||||
#define ZEND_MM_IS_GUARD_BLOCK(b) (((b)->info._size & ZEND_MM_TYPE_MASK) == ZEND_MM_GUARD_BLOCK)
|
||||
|
||||
#define ZEND_MM_NEXT_BLOCK(b) ZEND_MM_BLOCK_AT(b, ZEND_MM_BLOCK_SIZE(b))
|
||||
#define ZEND_MM_PREV_BLOCK(b) ZEND_MM_BLOCK_AT(b, -(int)((b)->info._prev & ~ZEND_MM_TYPE_MASK))
|
||||
#define ZEND_MM_PREV_BLOCK(b) ZEND_MM_BLOCK_AT(b, -(ssize_t)((b)->info._prev & ~ZEND_MM_TYPE_MASK))
|
||||
|
||||
#define ZEND_MM_PREV_BLOCK_IS_FREE(b) (!((b)->info._prev & ZEND_MM_USED_BLOCK))
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */
|
||||
ZEND_FE(gc_enabled, arginfo_zend__void)
|
||||
ZEND_FE(gc_enable, arginfo_zend__void)
|
||||
ZEND_FE(gc_disable, arginfo_zend__void)
|
||||
{ NULL, NULL, NULL }
|
||||
ZEND_FE_END
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
@@ -816,13 +816,19 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
|
||||
int class_name_len;
|
||||
zend_class_entry *instance_ce;
|
||||
zend_class_entry **ce;
|
||||
zend_bool allow_string = only_subclass;
|
||||
zend_bool retval;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &obj, &class_name, &class_name_len) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|b", &obj, &class_name, &class_name_len, &allow_string) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Z_TYPE_P(obj) == IS_STRING) {
|
||||
/*
|
||||
allow_string - is_a default is no, is_subclass_of is yes.
|
||||
if it's allowed, then the autoloader will be called if the class does not exist.
|
||||
default behaviour is different, as 'is_a' usage is normally to test mixed return values
|
||||
*/
|
||||
|
||||
if (allow_string && Z_TYPE_P(obj) == IS_STRING) {
|
||||
zend_class_entry **the_ce;
|
||||
if (zend_lookup_class(Z_STRVAL_P(obj), Z_STRLEN_P(obj), &the_ce TSRMLS_CC) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
@@ -848,7 +854,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto bool is_subclass_of(object object, string class_name)
|
||||
/* {{{ proto bool is_subclass_of(mixed object_or_string, string class_name [, bool allow_string=true])
|
||||
Returns true if the object has this class as one of its parents */
|
||||
ZEND_FUNCTION(is_subclass_of)
|
||||
{
|
||||
@@ -857,8 +863,8 @@ ZEND_FUNCTION(is_subclass_of)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto bool is_a(object object, string class_name)
|
||||
Returns true if the object is of this class or has this class as one of its parents */
|
||||
/* {{{ proto bool is_a(mixed object_or_string, string class_name [, bool allow_string=false])
|
||||
Returns true if the first argument is an object and is this class or has this class as one of its parents, */
|
||||
ZEND_FUNCTION(is_a)
|
||||
{
|
||||
is_a_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
|
||||
@@ -1713,7 +1719,7 @@ ZEND_FUNCTION(create_function)
|
||||
function_name[0] = '\0';
|
||||
|
||||
do {
|
||||
function_name_length = 1 + sprintf(function_name + 1, "lambda_%d", ++EG(lambda_count));
|
||||
function_name_length = 1 + snprintf(function_name + 1, sizeof("lambda_")+MAX_LENGTH_OF_LONG, "lambda_%d", ++EG(lambda_count));
|
||||
} while (zend_hash_add(EG(function_table), function_name, function_name_length+1, &new_function, sizeof(zend_function), NULL)==FAILURE);
|
||||
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
|
||||
RETURN_STRINGL(function_name, function_name_length, 0);
|
||||
@@ -2047,7 +2053,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
ZEND_PUTS(class_name);
|
||||
ZEND_PUTS(call_type);
|
||||
}
|
||||
zend_printf("%s(", function_name?function_name:"main");
|
||||
zend_printf("%s(", function_name);
|
||||
if (arg_array) {
|
||||
debug_print_backtrace_args(arg_array TSRMLS_CC);
|
||||
zval_ptr_dtor(&arg_array);
|
||||
|
||||
@@ -280,6 +280,18 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static HashTable *zend_closure_get_properties(zval *obj TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
|
||||
|
||||
if (GC_G(gc_active)) {
|
||||
return (closure->func.type == ZEND_USER_FUNCTION) ? closure->func.op_array.static_variables : NULL;
|
||||
}
|
||||
|
||||
return closure->std.properties;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto Closure::__construct()
|
||||
Private constructor preventing instantiation */
|
||||
ZEND_METHOD(Closure, __construct)
|
||||
@@ -316,6 +328,7 @@ void zend_register_closure_ce(TSRMLS_D) /* {{{ */
|
||||
closure_handlers.clone_obj = NULL;
|
||||
closure_handlers.get_debug_info = zend_closure_get_debug_info;
|
||||
closure_handlers.get_closure = zend_closure_get_closure;
|
||||
closure_handlers.get_properties = zend_closure_get_properties;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+13
-1
@@ -2628,7 +2628,8 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
|
||||
return 1; /* method doesn't exist in child, copy from parent */
|
||||
}
|
||||
|
||||
if (parent->common.fn_flags & ZEND_ACC_ABSTRACT
|
||||
if ((parent->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0
|
||||
&& parent->common.fn_flags & ZEND_ACC_ABSTRACT
|
||||
&& parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope)
|
||||
&& child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) {
|
||||
zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)",
|
||||
@@ -3757,6 +3758,11 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */
|
||||
char *name, *cfilename;
|
||||
char haltoff[] = "__COMPILER_HALT_OFFSET__";
|
||||
int len, clen;
|
||||
|
||||
if (CG(has_bracketed_namespaces) && CG(in_namespace)) {
|
||||
zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope");
|
||||
}
|
||||
|
||||
cfilename = zend_get_compiled_filename(TSRMLS_C);
|
||||
clen = strlen(cfilename);
|
||||
zend_mangle_property_name(&name, &len, haltoff, sizeof(haltoff) - 1, cfilename, clen, 0);
|
||||
@@ -5184,6 +5190,12 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC
|
||||
efree(CG(current_import));
|
||||
CG(current_import) = NULL;
|
||||
}
|
||||
|
||||
if (CG(doc_comment)) {
|
||||
efree(CG(doc_comment));
|
||||
CG(doc_comment) = NULL;
|
||||
CG(doc_comment_len) = 0;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -865,10 +865,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
|
||||
&& (EX(function_state).function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) == 0
|
||||
&& !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)
|
||||
ALLOC_ZVAL(param);
|
||||
*param = **(fci->params[i]);
|
||||
INIT_PZVAL(param);
|
||||
zval_copy_ctor(param);
|
||||
} else if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
|
||||
&& !PZVAL_IS_REF(*fci->params[i])) {
|
||||
|
||||
if (Z_REFCOUNT_PP(fci->params[i]) > 1) {
|
||||
|
||||
+99
-74
@@ -735,6 +735,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
|
||||
p = p->pListNext;
|
||||
}
|
||||
if (result & ZEND_HASH_APPLY_STOP) {
|
||||
va_end(args);
|
||||
break;
|
||||
}
|
||||
va_end(args);
|
||||
@@ -1168,12 +1169,12 @@ ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosi
|
||||
}
|
||||
}
|
||||
|
||||
/* This function changes key of currevt element without changing elements'
|
||||
/* This function changes key of current element without changing elements'
|
||||
* order. If element with target key already exists, it will be deleted first.
|
||||
*/
|
||||
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, uint str_length, ulong num_index, int mode, HashPosition *pos)
|
||||
{
|
||||
Bucket *p;
|
||||
Bucket *p, *q;
|
||||
|
||||
p = pos ? (*pos) : ht->pInternalPointer;
|
||||
|
||||
@@ -1186,100 +1187,124 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (mode != HASH_UPDATE_KEY_ANYWAY) {
|
||||
Bucket *q = ht->arBuckets[num_index & ht->nTableMask];
|
||||
int found = 0;
|
||||
|
||||
while (q != NULL) {
|
||||
if (q == p) {
|
||||
found = 1;
|
||||
} else if (!q->nKeyLength && q->h == num_index) {
|
||||
if (found) {
|
||||
if (mode & HASH_UPDATE_KEY_IF_BEFORE) {
|
||||
break;
|
||||
} else {
|
||||
if (p->nKeyLength) {
|
||||
zend_hash_del(ht, p->arKey, p->nKeyLength);
|
||||
} else {
|
||||
zend_hash_index_del(ht, p->h);
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
} else {
|
||||
if (mode & HASH_UPDATE_KEY_IF_AFTER) {
|
||||
break;
|
||||
} else {
|
||||
if (p->nKeyLength) {
|
||||
zend_hash_del(ht, p->arKey, p->nKeyLength);
|
||||
} else {
|
||||
zend_hash_index_del(ht, p->h);
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
q = q->pNext;
|
||||
q = ht->arBuckets[num_index & ht->nTableMask];
|
||||
while (q != NULL) {
|
||||
if (!q->nKeyLength && q->h == num_index) {
|
||||
break;
|
||||
}
|
||||
q = q->pNext;
|
||||
}
|
||||
|
||||
zend_hash_index_del(ht, num_index);
|
||||
} else if (key_type == HASH_KEY_IS_STRING) {
|
||||
ulong h;
|
||||
|
||||
if (p->nKeyLength == str_length &&
|
||||
memcmp(p->arKey, str_index, str_length) == 0) {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (mode != HASH_UPDATE_KEY_ANYWAY) {
|
||||
ulong h = zend_inline_hash_func(str_index, str_length);
|
||||
Bucket *q = ht->arBuckets[h & ht->nTableMask];
|
||||
int found = 0;
|
||||
h = zend_inline_hash_func(str_index, str_length);
|
||||
q = ht->arBuckets[h & ht->nTableMask];
|
||||
|
||||
while (q != NULL) {
|
||||
if (q == p) {
|
||||
found = 1;
|
||||
} else if (q->h == h && q->nKeyLength == str_length &&
|
||||
memcmp(q->arKey, str_index, str_length) == 0) {
|
||||
if (found) {
|
||||
if (mode & HASH_UPDATE_KEY_IF_BEFORE) {
|
||||
break;
|
||||
} else {
|
||||
if (p->nKeyLength) {
|
||||
zend_hash_del(ht, p->arKey, p->nKeyLength);
|
||||
} else {
|
||||
zend_hash_index_del(ht, p->h);
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
} else {
|
||||
if (mode & HASH_UPDATE_KEY_IF_AFTER) {
|
||||
break;
|
||||
} else {
|
||||
if (p->nKeyLength) {
|
||||
zend_hash_del(ht, p->arKey, p->nKeyLength);
|
||||
} else {
|
||||
zend_hash_index_del(ht, p->h);
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
q = q->pNext;
|
||||
while (q != NULL) {
|
||||
if (q->h == h && q->nKeyLength == str_length &&
|
||||
memcmp(q->arKey, str_index, str_length) == 0) {
|
||||
break;
|
||||
}
|
||||
q = q->pNext;
|
||||
}
|
||||
|
||||
zend_hash_del(ht, str_index, str_length);
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
|
||||
if (q) {
|
||||
if (mode != HASH_UPDATE_KEY_ANYWAY) {
|
||||
Bucket *r = p->pListLast;
|
||||
int found = HASH_UPDATE_KEY_IF_BEFORE;
|
||||
|
||||
while (r) {
|
||||
if (r == q) {
|
||||
found = HASH_UPDATE_KEY_IF_AFTER;
|
||||
break;
|
||||
}
|
||||
r = r->pListLast;
|
||||
}
|
||||
if (mode & found) {
|
||||
/* delete current bucket */
|
||||
if (p == ht->arBuckets[p->h & ht->nTableMask]) {
|
||||
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
|
||||
} else {
|
||||
p->pLast->pNext = p->pNext;
|
||||
}
|
||||
if (p->pNext) {
|
||||
p->pNext->pLast = p->pLast;
|
||||
}
|
||||
if (p->pListLast != NULL) {
|
||||
p->pListLast->pListNext = p->pListNext;
|
||||
} else {
|
||||
/* Deleting the head of the list */
|
||||
ht->pListHead = p->pListNext;
|
||||
}
|
||||
if (p->pListNext != NULL) {
|
||||
p->pListNext->pListLast = p->pListLast;
|
||||
} else {
|
||||
ht->pListTail = p->pListLast;
|
||||
}
|
||||
if (ht->pInternalPointer == p) {
|
||||
ht->pInternalPointer = p->pListNext;
|
||||
}
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(p->pData);
|
||||
}
|
||||
if (p->pData != &p->pDataPtr) {
|
||||
pefree(p->pData, ht->persistent);
|
||||
}
|
||||
pefree(p, ht->persistent);
|
||||
ht->nNumOfElements--;
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
/* delete another bucket with the same key */
|
||||
if (q == ht->arBuckets[q->h & ht->nTableMask]) {
|
||||
ht->arBuckets[q->h & ht->nTableMask] = q->pNext;
|
||||
} else {
|
||||
q->pLast->pNext = q->pNext;
|
||||
}
|
||||
if (q->pNext) {
|
||||
q->pNext->pLast = q->pLast;
|
||||
}
|
||||
if (q->pListLast != NULL) {
|
||||
q->pListLast->pListNext = q->pListNext;
|
||||
} else {
|
||||
/* Deleting the head of the list */
|
||||
ht->pListHead = q->pListNext;
|
||||
}
|
||||
if (q->pListNext != NULL) {
|
||||
q->pListNext->pListLast = q->pListLast;
|
||||
} else {
|
||||
ht->pListTail = q->pListLast;
|
||||
}
|
||||
if (ht->pInternalPointer == q) {
|
||||
ht->pInternalPointer = q->pListNext;
|
||||
}
|
||||
if (ht->pDestructor) {
|
||||
ht->pDestructor(q->pData);
|
||||
}
|
||||
if (q->pData != &q->pDataPtr) {
|
||||
pefree(q->pData, ht->persistent);
|
||||
}
|
||||
pefree(q, ht->persistent);
|
||||
ht->nNumOfElements--;
|
||||
}
|
||||
|
||||
if (p->pNext) {
|
||||
p->pNext->pLast = p->pLast;
|
||||
}
|
||||
if (p->pLast) {
|
||||
p->pLast->pNext = p->pNext;
|
||||
} else{
|
||||
} else {
|
||||
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sun Aug 1 12:07:43 2010 */
|
||||
/* Generated by re2c 0.13.5 on Fri Aug 26 18:01:17 2011 */
|
||||
#line 1 "Zend/zend_ini_scanner.l"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sun Aug 1 12:07:43 2010 */
|
||||
/* Generated by re2c 0.13.5 on Fri Aug 26 18:01:17 2011 */
|
||||
#line 3 "Zend/zend_ini_scanner_defs.h"
|
||||
|
||||
enum YYCONDTYPE {
|
||||
|
||||
@@ -113,6 +113,8 @@ struct _zend_module_entry {
|
||||
#define ZEND_MOD_CONFLICTS(name) ZEND_MOD_CONFLICTS_EX(name, NULL, NULL)
|
||||
#define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL)
|
||||
|
||||
#define ZEND_MOD_END { NULL, NULL, NULL, 0 }
|
||||
|
||||
struct _zend_module_dep {
|
||||
const char *name; /* module name */
|
||||
const char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */
|
||||
|
||||
+21
-5
@@ -27,10 +27,24 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#if HAVE_SYS_MMAN_H
|
||||
# include <sys/mman.h>
|
||||
# ifndef PAGE_SIZE
|
||||
# define PAGE_SIZE 4096
|
||||
#if HAVE_MMAP
|
||||
# if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# if defined(_SC_PAGESIZE)
|
||||
# define REAL_PAGE_SIZE sysconf(_SC_PAGESIZE);
|
||||
# elif defined(_SC_PAGE_SIZE)
|
||||
# define REAL_PAGE_SIZE sysconf(_SC_PAGE_SIZE);
|
||||
# endif
|
||||
# endif
|
||||
# if HAVE_SYS_MMAN_H
|
||||
# include <sys/mman.h>
|
||||
# endif
|
||||
# ifndef REAL_PAGE_SIZE
|
||||
# ifdef PAGE_SIZE
|
||||
# define REAL_PAGE_SIZE PAGE_SIZE
|
||||
# else
|
||||
# define REAL_PAGE_SIZE 4096
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -215,9 +229,11 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t
|
||||
|
||||
if (old_type == ZEND_HANDLE_FP && !file_handle->handle.stream.isatty && size) {
|
||||
#if HAVE_MMAP
|
||||
size_t page_size = REAL_PAGE_SIZE;
|
||||
|
||||
if (file_handle->handle.fp &&
|
||||
size != 0 &&
|
||||
((size - 1) % PAGE_SIZE) <= PAGE_SIZE - ZEND_MMAP_AHEAD) {
|
||||
((size - 1) % page_size) <= page_size - ZEND_MMAP_AHEAD) {
|
||||
/* *buf[size] is zeroed automatically by the kernel */
|
||||
*buf = mmap(0, size + ZEND_MMAP_AHEAD, PROT_READ, MAP_PRIVATE, fileno(file_handle->handle.fp), 0);
|
||||
if (*buf != MAP_FAILED) {
|
||||
|
||||
@@ -445,6 +445,12 @@ static MUTEX_T pow5mult_mutex;
|
||||
|
||||
#endif /* ZTS */
|
||||
|
||||
#ifdef DEBUG
|
||||
static void Bug(const char *message) {
|
||||
fprintf(stderr, "%s\n", message);
|
||||
}
|
||||
#endif
|
||||
|
||||
ZEND_API int zend_startup_strtod(void) /* {{{ */
|
||||
{
|
||||
#ifdef ZTS
|
||||
|
||||
+1
-1
@@ -2256,7 +2256,7 @@ AC_DEFUN([PHP_SETUP_KERBEROS],[
|
||||
KERBEROS_LIBS=`$KRB5_CONFIG --libs gssapi`
|
||||
KERBEROS_CFLAGS=`$KRB5_CONFIG --cflags gssapi`
|
||||
|
||||
if test -n "$KERBEROS_LIBS" && test -n "$KERBEROS_CFLAGS"; then
|
||||
if test -n "$KERBEROS_LIBS"; then
|
||||
found_kerberos=yes
|
||||
PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($KERBEROS_CFLAGS)
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ cd $srcdir
|
||||
module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`"
|
||||
|
||||
for ext in ${1+"$@"} ; do
|
||||
header_list="$header_list ext/$ext/*.h"
|
||||
header_list="$header_list ext/$ext/*.h*"
|
||||
done
|
||||
|
||||
includes=`$awk -f ./build/print_include.awk $header_list`
|
||||
|
||||
+10
-2
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=3
|
||||
PHP_RELEASE_VERSION=7
|
||||
PHP_EXTRA_VERSION="RC3"
|
||||
PHP_RELEASE_VERSION=9
|
||||
PHP_EXTRA_VERSION="RC4"
|
||||
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`
|
||||
|
||||
@@ -608,6 +608,7 @@ utime \
|
||||
vsnprintf \
|
||||
vasprintf \
|
||||
asprintf \
|
||||
nanosleep \
|
||||
)
|
||||
|
||||
dnl Some systems (like OpenSolaris) do not have nanosleep in libc
|
||||
@@ -660,6 +661,13 @@ if test "$ac_cv_func_getaddrinfo" = yes; then
|
||||
AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
|
||||
fi
|
||||
|
||||
dnl Check for the __sync_fetch_and_add builtin
|
||||
AC_CACHE_CHECK([for __sync_fetch_and_add], ac_cv_func_sync_fetch_and_add,
|
||||
[AC_TRY_LINK([],[int x;__sync_fetch_and_add(&x,1);],ac_cv_func_sync_fetch_and_add=yes,ac_cv_func_sync_fetch_and_add=no)])
|
||||
if test "$ac_cv_func_sync_fetch_and_add" = yes; then
|
||||
AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD,1,[Define if you have the __sync_fetch_and_add function])
|
||||
fi
|
||||
|
||||
AC_REPLACE_FUNCS(strlcat strlcpy getopt)
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_FUNC_ALLOCA
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ const zend_function_entry bcmath_functions[] = {
|
||||
PHP_FE(bcscale, arginfo_bcscale)
|
||||
PHP_FE(bccomp, arginfo_bccomp)
|
||||
PHP_FE(bcpowmod, arginfo_bcpowmod)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
zend_module_entry bcmath_module_entry = {
|
||||
@@ -560,7 +560,7 @@ PHP_FUNCTION(bcscale)
|
||||
return;
|
||||
}
|
||||
|
||||
BCG(bc_precision) = (new_scale < 0) ? 0 : new_scale;
|
||||
BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale;
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
bcscale related problem on 64bits platforms
|
||||
--SKIPIF--
|
||||
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$var48 = bcscale(634314234334311);
|
||||
$var67 = bcsqrt(false);
|
||||
$var414 = bcadd(false,null,10);
|
||||
die('ALIVE');
|
||||
?>
|
||||
--EXPECTF--
|
||||
ALIVE
|
||||
+1
-1
@@ -107,7 +107,7 @@ static const zend_function_entry bz2_functions[] = {
|
||||
PHP_FE(bzerror, arginfo_bzerror)
|
||||
PHP_FE(bzcompress, arginfo_bzcompress)
|
||||
PHP_FE(bzdecompress, arginfo_bzdecompress)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
zend_module_entry bz2_module_entry = {
|
||||
|
||||
@@ -148,7 +148,7 @@ const zend_function_entry calendar_functions[] = {
|
||||
PHP_FE(cal_from_jd, arginfo_cal_from_jd)
|
||||
PHP_FE(cal_days_in_month, arginfo_cal_days_in_month)
|
||||
PHP_FE(cal_info, arginfo_cal_info)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
|
||||
|
||||
+10
-12
@@ -127,6 +127,7 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "sdncal.h"
|
||||
#include <limits.h>
|
||||
|
||||
#define GREGOR_SDN_OFFSET 32045
|
||||
#define DAYS_PER_5_MONTHS 153
|
||||
@@ -146,21 +147,12 @@ void SdnToGregorian(
|
||||
long int temp;
|
||||
int dayOfYear;
|
||||
|
||||
if (sdn <= 0) {
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
return;
|
||||
if (sdn <= 0 ||
|
||||
sdn > (LONG_MAX - 4 * GREGOR_SDN_OFFSET) / 4) {
|
||||
goto fail;
|
||||
}
|
||||
temp = (sdn + GREGOR_SDN_OFFSET) * 4 - 1;
|
||||
|
||||
if (temp < 0) {
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Calculate the century (year/100). */
|
||||
century = temp / DAYS_PER_400_YEARS;
|
||||
|
||||
@@ -190,6 +182,12 @@ void SdnToGregorian(
|
||||
*pYear = year;
|
||||
*pMonth = month;
|
||||
*pDay = day;
|
||||
return;
|
||||
|
||||
fail:
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
}
|
||||
|
||||
long int GregorianToSdn(
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #53574 (Integer overflow in SdnToJulian; leads to segfault)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (PHP_INT_SIZE != 4) {
|
||||
die("skip this test is for 32bit platform only");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$x = 882858043;
|
||||
|
||||
var_dump(cal_from_jd($x, CAL_JULIAN));
|
||||
--EXPECT--
|
||||
array(9) {
|
||||
["date"]=>
|
||||
string(5) "0/0/0"
|
||||
["month"]=>
|
||||
int(0)
|
||||
["day"]=>
|
||||
int(0)
|
||||
["year"]=>
|
||||
int(0)
|
||||
["dow"]=>
|
||||
int(5)
|
||||
["abbrevdayname"]=>
|
||||
string(3) "Fri"
|
||||
["dayname"]=>
|
||||
string(6) "Friday"
|
||||
["abbrevmonth"]=>
|
||||
string(0) ""
|
||||
["monthname"]=>
|
||||
string(0) ""
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
--TEST--
|
||||
Bug #53574 (Integer overflow in SdnToJulian; leads to segfault)
|
||||
--SKIPIF--
|
||||
<?php include 'skipif.inc'; ?>
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die("skip this test is for 64bit platform only");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
if (PHP_INT_MAX == 0x7FFFFFFF) {
|
||||
$x = 882858043;
|
||||
} else {
|
||||
$x = 3315881921229094912;
|
||||
}
|
||||
$x = 3315881921229094912;
|
||||
|
||||
var_dump(cal_from_jd($x, CAL_JULIAN));
|
||||
--EXPECT--
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #55797: Integer overflow in SdnToGregorian leads to segfault (in optimized builds)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (PHP_INT_SIZE != 4) {
|
||||
die("skip this test is for 32bit platform only");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$x = 882858030;
|
||||
|
||||
var_dump(cal_from_jd($x, CAL_GREGORIAN));
|
||||
--EXPECTF--
|
||||
array(9) {
|
||||
["date"]=>
|
||||
string(5) "0/0/0"
|
||||
["month"]=>
|
||||
int(0)
|
||||
["day"]=>
|
||||
int(0)
|
||||
["year"]=>
|
||||
int(0)
|
||||
["dow"]=>
|
||||
int(%d)
|
||||
["abbrevdayname"]=>
|
||||
string(%d) "%s"
|
||||
["dayname"]=>
|
||||
string(%d) "%s"
|
||||
["abbrevmonth"]=>
|
||||
string(0) ""
|
||||
["monthname"]=>
|
||||
string(0) ""
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
--TEST--
|
||||
Bug #55797: Integer overflow in SdnToGregorian leads to segfault (in optimized builds)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
include 'skipif.inc';
|
||||
if (PHP_INT_SIZE == 4) {
|
||||
die("skip this test is for 64bit platform only");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$x = 9223372036854743639;
|
||||
|
||||
var_dump(cal_from_jd($x, CAL_GREGORIAN));
|
||||
--EXPECTF--
|
||||
array(9) {
|
||||
["date"]=>
|
||||
string(5) "0/0/0"
|
||||
["month"]=>
|
||||
int(0)
|
||||
["day"]=>
|
||||
int(0)
|
||||
["year"]=>
|
||||
int(0)
|
||||
["dow"]=>
|
||||
int(%d)
|
||||
["abbrevdayname"]=>
|
||||
string(%d) "%s"
|
||||
["dayname"]=>
|
||||
string(%d) "%s"
|
||||
["abbrevmonth"]=>
|
||||
string(0) ""
|
||||
["monthname"]=>
|
||||
string(0) ""
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ date.timezone=UTC
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
putenv('TZ=UTC');
|
||||
echo date("Y-m-d", easter_date(2000))."\n";
|
||||
echo date("Y-m-d", easter_date(2001))."\n";
|
||||
echo date("Y-m-d", easter_date(2002))."\n";
|
||||
|
||||
@@ -14,30 +14,37 @@ $jd_days = Array(
|
||||
);
|
||||
|
||||
foreach ($jd_days as $jd_day) {
|
||||
echo "=== ", $jd_day, "\n";
|
||||
var_dump(jdmonthname($jd_day,0));
|
||||
var_dump(jdmonthname($jd_day,1));
|
||||
var_dump(jdmonthname($jd_day,2));
|
||||
var_dump(jdmonthname($jd_day,3));
|
||||
var_dump(jdmonthname($jd_day,4));
|
||||
var_dump(jdmonthname($jd_day,5));
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
echo "Done\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
=== 2453396
|
||||
string(3) "Jan"
|
||||
string(7) "January"
|
||||
string(3) "Jan"
|
||||
string(7) "January"
|
||||
string(6) "Shevat"
|
||||
string(0) ""
|
||||
|
||||
=== 2440588
|
||||
string(3) "Jan"
|
||||
string(7) "January"
|
||||
string(3) "Dec"
|
||||
string(8) "December"
|
||||
string(5) "Tevet"
|
||||
string(0) ""
|
||||
|
||||
=== -1
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
@@ -45,6 +52,8 @@ string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
|
||||
=== Array
|
||||
|
||||
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
@@ -62,10 +71,13 @@ bool(false)
|
||||
|
||||
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
|
||||
bool(false)
|
||||
|
||||
=== 10000000
|
||||
string(3) "Dec"
|
||||
string(8) "December"
|
||||
string(3) "Jul"
|
||||
string(4) "July"
|
||||
string(6) "Tishri"
|
||||
string(0) ""
|
||||
|
||||
Done
|
||||
@@ -4,11 +4,12 @@ unixtojd()
|
||||
<?php include 'skipif.inc'; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
putenv('TZ=UTC');
|
||||
echo unixtojd(40000). "\n";
|
||||
echo unixtojd(1000000000). "\n";
|
||||
echo unixtojd(1152459009). "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
2440588
|
||||
2452161
|
||||
2452162
|
||||
2453926
|
||||
@@ -129,6 +129,9 @@ static HRESULT dotnet_init(char **p_where TSRMLS_DC)
|
||||
char *where = "";
|
||||
|
||||
stuff = malloc(sizeof(*stuff));
|
||||
if (!stuff) {
|
||||
return S_FALSE;
|
||||
}
|
||||
memset(stuff, 0, sizeof(*stuff));
|
||||
|
||||
where = "CoCreateInstance";
|
||||
|
||||
@@ -228,7 +228,7 @@ const zend_function_entry com_dotnet_functions[] = {
|
||||
PHP_FE(com_message_pump, arginfo_com_message_pump)
|
||||
PHP_FE(com_load_typelib, arginfo_com_load_typelib)
|
||||
PHP_FE(com_get_active_object, arginfo_com_get_active_object)
|
||||
{ NULL, NULL, NULL }
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
/* {{{ com_dotnet_module_entry
|
||||
|
||||
@@ -697,7 +697,7 @@ static const zend_function_entry com_persist_helper_methods[] = {
|
||||
CPH_ME(InitNew, NULL)
|
||||
CPH_ME(LoadFromStream, NULL)
|
||||
CPH_ME(SaveToStream, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
static void helper_free_storage(void *obj TSRMLS_DC)
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@ static const zend_function_entry ctype_functions[] = {
|
||||
PHP_FE(ctype_space, arginfo_ctype_space)
|
||||
PHP_FE(ctype_upper, arginfo_ctype_upper)
|
||||
PHP_FE(ctype_xdigit, arginfo_ctype_xdigit)
|
||||
{NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */
|
||||
PHP_FE_END
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
|
||||
+119
-29
@@ -150,6 +150,7 @@ static struct gcry_thread_cbs php_curl_gnutls_tsl = {
|
||||
static void _php_curl_close_ex(php_curl *ch TSRMLS_DC);
|
||||
static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
|
||||
|
||||
|
||||
#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err;
|
||||
|
||||
#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s), (long) v);
|
||||
@@ -197,13 +198,79 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len) /*
|
||||
#else
|
||||
copystr = estrndup(url, len);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_URL, copystr);
|
||||
zend_llist_add_element(&ch->to_free.str, ©str);
|
||||
zend_llist_add_element(&ch->to_free->str, ©str);
|
||||
#endif
|
||||
|
||||
return (error == CURLE_OK ? 1 : 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
php_stream *stream;
|
||||
if (!ch || !ch->handlers) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ch->handlers->std_err) {
|
||||
stream = (php_stream *) zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream == NULL) {
|
||||
if (reporterror) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_STDERR resource has gone away, resetting to stderr");
|
||||
}
|
||||
zval_ptr_dtor(&ch->handlers->std_err);
|
||||
ch->handlers->std_err = NULL;
|
||||
|
||||
curl_easy_setopt(ch->cp, CURLOPT_STDERR, stderr);
|
||||
}
|
||||
}
|
||||
if (ch->handlers->read && ch->handlers->read->stream) {
|
||||
stream = (php_stream *) zend_fetch_resource(&ch->handlers->read->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream == NULL) {
|
||||
if (reporterror) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_INFILE resource has gone away, resetting to default");
|
||||
}
|
||||
zval_ptr_dtor(&ch->handlers->read->stream);
|
||||
ch->handlers->read->fd = 0;
|
||||
ch->handlers->read->fp = 0;
|
||||
ch->handlers->read->stream = NULL;
|
||||
|
||||
curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch);
|
||||
}
|
||||
}
|
||||
if (ch->handlers->write_header && ch->handlers->write_header->stream) {
|
||||
stream = (php_stream *) zend_fetch_resource(&ch->handlers->write_header->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream == NULL) {
|
||||
if (reporterror) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_WRITEHEADER resource has gone away, resetting to default");
|
||||
}
|
||||
zval_ptr_dtor(&ch->handlers->write_header->stream);
|
||||
ch->handlers->write_header->fp = 0;
|
||||
ch->handlers->write_header->stream = NULL;
|
||||
|
||||
ch->handlers->write_header->method = PHP_CURL_IGNORE;
|
||||
curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch);
|
||||
}
|
||||
}
|
||||
if (ch->handlers->write && ch->handlers->write->stream) {
|
||||
stream = (php_stream *) zend_fetch_resource(&ch->handlers->write->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream == NULL) {
|
||||
if (reporterror) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FILE resource has gone away, resetting to default");
|
||||
}
|
||||
zval_ptr_dtor(&ch->handlers->write->stream);
|
||||
ch->handlers->write->fp = 0;
|
||||
ch->handlers->write->stream = NULL;
|
||||
|
||||
ch->handlers->write->method = PHP_CURL_STDOUT;
|
||||
ch->handlers->write->type = PHP_CURL_ASCII;
|
||||
curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ arginfo */
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_version, 0, 0, 0)
|
||||
ZEND_ARG_INFO(0, version)
|
||||
@@ -307,7 +374,7 @@ const zend_function_entry curl_functions[] = {
|
||||
PHP_FE(curl_multi_getcontent, arginfo_curl_multi_getcontent)
|
||||
PHP_FE(curl_multi_info_read, arginfo_curl_multi_info_read)
|
||||
PHP_FE(curl_multi_close, arginfo_curl_multi_close)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
@@ -337,7 +404,6 @@ PHP_INI_BEGIN()
|
||||
PHP_INI_END()
|
||||
/* }}} */
|
||||
|
||||
/* }}} */
|
||||
/* {{{ PHP_MINFO_FUNCTION
|
||||
*/
|
||||
PHP_MINFO_FUNCTION(curl)
|
||||
@@ -821,6 +887,9 @@ PHP_MINIT_FUNCTION(curl)
|
||||
int i, c = CRYPTO_num_locks();
|
||||
|
||||
php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));
|
||||
if (!php_curl_openssl_tsl) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
for (i = 0; i < c; ++i) {
|
||||
php_curl_openssl_tsl[i] = tsrm_mutex_alloc();
|
||||
@@ -1343,6 +1412,7 @@ PHP_FUNCTION(curl_version)
|
||||
static void alloc_curl_handle(php_curl **ch)
|
||||
{
|
||||
*ch = emalloc(sizeof(php_curl));
|
||||
(*ch)->to_free = ecalloc(1, sizeof(struct _php_curl_free));
|
||||
(*ch)->handlers = ecalloc(1, sizeof(php_curl_handlers));
|
||||
(*ch)->handlers->write = ecalloc(1, sizeof(php_curl_write));
|
||||
(*ch)->handlers->write_header = ecalloc(1, sizeof(php_curl_write));
|
||||
@@ -1353,10 +1423,13 @@ static void alloc_curl_handle(php_curl **ch)
|
||||
(*ch)->header.str_len = 0;
|
||||
|
||||
memset(&(*ch)->err, 0, sizeof((*ch)->err));
|
||||
(*ch)->handlers->write->stream = NULL;
|
||||
(*ch)->handlers->write_header->stream = NULL;
|
||||
(*ch)->handlers->read->stream = NULL;
|
||||
|
||||
zend_llist_init(&(*ch)->to_free.str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0);
|
||||
zend_llist_init(&(*ch)->to_free.slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0);
|
||||
zend_llist_init(&(*ch)->to_free.post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0);
|
||||
zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0);
|
||||
zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0);
|
||||
zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1391,6 +1464,7 @@ static void split_certinfo(char *string, zval *hash)
|
||||
efree(org);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ create_certinfo
|
||||
*/
|
||||
@@ -1534,6 +1608,7 @@ PHP_FUNCTION(curl_copy_handle)
|
||||
|
||||
dupch->cp = cp;
|
||||
dupch->uses = 0;
|
||||
ch->uses++;
|
||||
if (ch->handlers->write->stream) {
|
||||
Z_ADDREF_P(dupch->handlers->write->stream);
|
||||
dupch->handlers->write->stream = ch->handlers->write->stream;
|
||||
@@ -1574,18 +1649,21 @@ PHP_FUNCTION(curl_copy_handle)
|
||||
zval_add_ref(&ch->handlers->write_header->func_name);
|
||||
dupch->handlers->write_header->func_name = ch->handlers->write_header->func_name;
|
||||
}
|
||||
|
||||
if (ch->handlers->progress->func_name) {
|
||||
zval_add_ref(&ch->handlers->progress->func_name);
|
||||
dupch->handlers->progress->func_name = ch->handlers->progress->func_name;
|
||||
}
|
||||
dupch->handlers->progress->method = ch->handlers->progress->method;
|
||||
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_ERRORBUFFER, dupch->err.str);
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_FILE, (void *) dupch);
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_INFILE, (void *) dupch);
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch);
|
||||
curl_easy_setopt(dupch->cp, CURLOPT_PROGRESSDATA, (void *) dupch);
|
||||
|
||||
zend_llist_copy(&dupch->to_free.str, &ch->to_free.str);
|
||||
/* Don't try to free copied strings, they're free'd when the original handle is destroyed */
|
||||
dupch->to_free.str.dtor = NULL;
|
||||
|
||||
zend_llist_copy(&dupch->to_free.slist, &ch->to_free.slist);
|
||||
zend_llist_copy(&dupch->to_free.post, &ch->to_free.post);
|
||||
efree(dupch->to_free);
|
||||
dupch->to_free = ch->to_free;
|
||||
|
||||
/* Keep track of cloned copies to avoid invoking curl destructors for every clone */
|
||||
Z_ADDREF_P(ch->clone);
|
||||
@@ -1779,7 +1857,7 @@ string_copy:
|
||||
#endif
|
||||
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
|
||||
error = curl_easy_setopt(ch->cp, option, copystr);
|
||||
zend_llist_add_element(&ch->to_free.str, ©str);
|
||||
zend_llist_add_element(&ch->to_free->str, ©str);
|
||||
} else {
|
||||
#if LIBCURL_VERSION_NUM >= 0x071100
|
||||
/* Strings passed to libcurl as ’char *’ arguments, are copied by the library... NOTE: before 7.17.0 strings were not copied. */
|
||||
@@ -1819,6 +1897,9 @@ string_copy:
|
||||
switch (option) {
|
||||
case CURLOPT_FILE:
|
||||
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
if (ch->handlers->write->stream) {
|
||||
Z_DELREF_P(ch->handlers->write->stream);
|
||||
}
|
||||
Z_ADDREF_PP(zvalue);
|
||||
ch->handlers->write->fp = fp;
|
||||
ch->handlers->write->method = PHP_CURL_FILE;
|
||||
@@ -1831,6 +1912,9 @@ string_copy:
|
||||
break;
|
||||
case CURLOPT_WRITEHEADER:
|
||||
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
|
||||
if (ch->handlers->write_header->stream) {
|
||||
Z_DELREF_P(ch->handlers->write_header->stream);
|
||||
}
|
||||
Z_ADDREF_PP(zvalue);
|
||||
ch->handlers->write_header->fp = fp;
|
||||
ch->handlers->write_header->method = PHP_CURL_FILE;
|
||||
@@ -1842,6 +1926,9 @@ string_copy:
|
||||
}
|
||||
break;
|
||||
case CURLOPT_INFILE:
|
||||
if (ch->handlers->read->stream) {
|
||||
Z_DELREF_P(ch->handlers->read->stream);
|
||||
}
|
||||
Z_ADDREF_PP(zvalue);
|
||||
ch->handlers->read->fp = fp;
|
||||
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
|
||||
@@ -2011,7 +2098,7 @@ string_copy:
|
||||
return 1;
|
||||
}
|
||||
|
||||
zend_llist_add_element(&ch->to_free.post, &first);
|
||||
zend_llist_add_element(&ch->to_free->post, &first);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first);
|
||||
|
||||
} else {
|
||||
@@ -2025,7 +2112,7 @@ string_copy:
|
||||
|
||||
convert_to_string_ex(zvalue);
|
||||
post = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
|
||||
zend_llist_add_element(&ch->to_free.str, &post);
|
||||
zend_llist_add_element(&ch->to_free->str, &post);
|
||||
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, post);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, Z_STRLEN_PP(zvalue));
|
||||
@@ -2061,7 +2148,7 @@ string_copy:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
zend_llist_add_element(&ch->to_free.slist, &slist);
|
||||
zend_llist_add_element(&ch->to_free->slist, &slist);
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, slist);
|
||||
|
||||
@@ -2091,7 +2178,7 @@ string_copy:
|
||||
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, copystr);
|
||||
zend_llist_add_element(&ch->to_free.str, ©str);
|
||||
zend_llist_add_element(&ch->to_free->str, ©str);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -2208,6 +2295,8 @@ PHP_FUNCTION(curl_exec)
|
||||
|
||||
ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl);
|
||||
|
||||
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
|
||||
|
||||
_php_curl_cleanup_handle(ch);
|
||||
|
||||
error = curl_easy_perform(ch->cp);
|
||||
@@ -2220,6 +2309,14 @@ PHP_FUNCTION(curl_exec)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ch->handlers->std_err) {
|
||||
php_stream *stream;
|
||||
stream = (php_stream*)zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream) {
|
||||
php_stream_flush(stream);
|
||||
}
|
||||
}
|
||||
|
||||
if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) {
|
||||
smart_str_0(&ch->handlers->write->buf);
|
||||
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
|
||||
@@ -2497,25 +2594,18 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
|
||||
fprintf(stderr, "DTOR CALLED, ch = %x\n", ch);
|
||||
#endif
|
||||
|
||||
/* Prevent crash inside cURL if passed file has already been closed */
|
||||
if (ch->handlers->std_err && Z_REFCOUNT_P(ch->handlers->std_err) <= 0) {
|
||||
curl_easy_setopt(ch->cp, CURLOPT_STDERR, stderr);
|
||||
}
|
||||
|
||||
_php_curl_verify_handlers(ch, 0 TSRMLS_CC);
|
||||
curl_easy_cleanup(ch->cp);
|
||||
zend_llist_clean(&ch->to_free.str);
|
||||
|
||||
/* 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);
|
||||
zend_llist_clean(&ch->to_free->str);
|
||||
zend_llist_clean(&ch->to_free->slist);
|
||||
zend_llist_clean(&ch->to_free->post);
|
||||
efree(ch->to_free);
|
||||
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) {
|
||||
|
||||
@@ -211,6 +211,19 @@ PHP_FUNCTION(curl_multi_exec)
|
||||
|
||||
ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle);
|
||||
|
||||
{
|
||||
zend_llist_position pos;
|
||||
php_curl *ch;
|
||||
zval *pz_ch;
|
||||
|
||||
for(pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
|
||||
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
|
||||
|
||||
ZEND_FETCH_RESOURCE(ch, php_curl *, &pz_ch, -1, le_curl_name, le_curl);
|
||||
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
convert_to_long_ex(&z_still_running);
|
||||
still_running = Z_LVAL_P(z_still_running);
|
||||
result = curl_multi_perform(mh->multi, &still_running);
|
||||
@@ -324,6 +337,17 @@ void _php_curl_multi_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
php_curlm *mh = (php_curlm *) rsrc->ptr;
|
||||
if (mh) {
|
||||
zend_llist_position pos;
|
||||
php_curl *ch;
|
||||
zval *pz_ch;
|
||||
|
||||
for(pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
|
||||
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
|
||||
|
||||
ch = (php_curl *) zend_fetch_resource(&pz_ch TSRMLS_CC, -1, le_curl_name, NULL, 1, le_curl);
|
||||
_php_curl_verify_handlers(ch, 0 TSRMLS_CC);
|
||||
}
|
||||
|
||||
curl_multi_cleanup(mh->multi);
|
||||
zend_llist_clean(&mh->easyh);
|
||||
efree(mh);
|
||||
|
||||
+2
-1
@@ -131,7 +131,7 @@ struct _php_curl_free {
|
||||
|
||||
typedef struct {
|
||||
struct _php_curl_error err;
|
||||
struct _php_curl_free to_free;
|
||||
struct _php_curl_free *to_free;
|
||||
struct _php_curl_send_headers header;
|
||||
void ***thread_ctx;
|
||||
CURL *cp;
|
||||
@@ -150,6 +150,7 @@ typedef struct {
|
||||
|
||||
void _php_curl_cleanup_handle(php_curl *);
|
||||
void _php_curl_multi_cleanup_list(void *data);
|
||||
int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC);
|
||||
|
||||
/* streams support */
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
--TEST--
|
||||
Bug #27023 (CURLOPT_POSTFIELDS does not parse content types for files)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
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
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=file");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
||||
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt');
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
|
||||
var_dump(curl_exec($ch));
|
||||
|
||||
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt;type=text/plain');
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
|
||||
var_dump(curl_exec($ch));
|
||||
|
||||
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt;filename=foo.txt');
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
|
||||
var_dump(curl_exec($ch));
|
||||
|
||||
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt;type=text/plain;filename=foo.txt');
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
|
||||
var_dump(curl_exec($ch));
|
||||
|
||||
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt;filename=foo.txt;type=text/plain');
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
|
||||
var_dump(curl_exec($ch));
|
||||
|
||||
|
||||
curl_close($ch);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "curl_testdata1.txt|application/octet-stream"
|
||||
string(%d) "curl_testdata1.txt|text/plain"
|
||||
string(%d) "foo.txt|application/octet-stream"
|
||||
string(%d) "foo.txt|text/plain"
|
||||
string(%d) "foo.txt|text/plain"
|
||||
@@ -18,16 +18,19 @@ $ch = curl_init();
|
||||
|
||||
curl_setopt($ch, CURLOPT_VERBOSE, 1);
|
||||
curl_setopt($ch, CURLOPT_STDERR, $fp);
|
||||
curl_setopt($ch, CURLOPT_URL, "");
|
||||
curl_setopt($ch, CURLOPT_URL, getenv('PHP_CURL_HTTP_REMOTE_SERVER'));
|
||||
|
||||
fclose($fp); // <-- premature close of $fp caused a crash!
|
||||
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
echo "Ok\n";
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug48203.php on line %d
|
||||
%A
|
||||
Ok
|
||||
@@ -0,0 +1,90 @@
|
||||
--TEST--
|
||||
Variation of bug #48203 with curl_multi_exec (Crash when file pointers passed to curl are closed before calling curl_multi_exec)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
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
|
||||
|
||||
function checkForClosedFilePointer($curl_option, $description) {
|
||||
$fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w');
|
||||
|
||||
$ch1 = curl_init();
|
||||
$ch2 = curl_init();
|
||||
|
||||
$options = array(
|
||||
CURLOPT_RETURNTRANSFER => 1,
|
||||
$curl_option => $fp,
|
||||
CURLOPT_URL => getenv("PHP_CURL_HTTP_REMOTE_SERVER")
|
||||
);
|
||||
|
||||
// we also need to set CURLOPT_VERBOSE to test CURLOPT_STDERR properly
|
||||
if (CURLOPT_STDERR == $curl_option) {
|
||||
$options[CURLOPT_VERBOSE] = 1;
|
||||
}
|
||||
|
||||
if (CURLOPT_INFILE == $curl_option) {
|
||||
$options[CURLOPT_UPLOAD] = 1;
|
||||
}
|
||||
|
||||
curl_setopt_array($ch1, $options);
|
||||
curl_setopt_array($ch2, $options);
|
||||
|
||||
fclose($fp); // <-- premature close of $fp caused a crash!
|
||||
|
||||
$mh = curl_multi_init();
|
||||
|
||||
curl_multi_add_handle($mh, $ch1);
|
||||
curl_multi_add_handle($mh, $ch2);
|
||||
|
||||
$active = 0;
|
||||
do {
|
||||
curl_multi_exec($mh, $active);
|
||||
} while ($active > 0);
|
||||
|
||||
curl_multi_remove_handle($mh, $ch1);
|
||||
curl_multi_remove_handle($mh, $ch2);
|
||||
curl_multi_close($mh);
|
||||
|
||||
echo "Ok for $description\n";
|
||||
}
|
||||
|
||||
$options_to_check = array(
|
||||
"CURLOPT_STDERR", "CURLOPT_WRITEHEADER", "CURLOPT_FILE", "CURLOPT_INFILE"
|
||||
);
|
||||
|
||||
foreach($options_to_check as $option) {
|
||||
checkForClosedFilePointer(constant($option), $option);
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
|
||||
--EXPECTF--
|
||||
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug48203_multi.php on line 36
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug48203_multi.php on line 36
|
||||
%A
|
||||
Ok for CURLOPT_STDERR
|
||||
%A
|
||||
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug48203_multi.php on line 36
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug48203_multi.php on line 36
|
||||
Ok for CURLOPT_WRITEHEADER
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
|
||||
%A
|
||||
Ok for CURLOPT_FILE
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
|
||||
|
||||
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
|
||||
Ok for CURLOPT_INFILE
|
||||
@@ -0,0 +1,72 @@
|
||||
--TEST--
|
||||
Bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed before calling curl_exec)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
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
|
||||
|
||||
function checkForClosedFilePointer($host, $curl_option, $description) {
|
||||
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');
|
||||
|
||||
$ch = curl_init();
|
||||
|
||||
// we also need CURLOPT_VERBOSE to be set to test CURLOPT_STDERR properly
|
||||
if (CURLOPT_STDERR == $curl_option) {
|
||||
curl_setopt($ch, CURLOPT_VERBOSE, 1);
|
||||
}
|
||||
|
||||
if (CURLOPT_INFILE == $curl_option) {
|
||||
curl_setopt($ch, CURLOPT_UPLOAD, 1);
|
||||
}
|
||||
|
||||
curl_setopt($ch, $curl_option, $fp);
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $host);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
||||
fclose($fp); // <-- premature close of $fp caused a crash!
|
||||
|
||||
curl_exec($ch);
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
echo "Ok for $description\n";
|
||||
}
|
||||
|
||||
$options_to_check = array(
|
||||
"CURLOPT_STDERR",
|
||||
"CURLOPT_WRITEHEADER",
|
||||
"CURLOPT_FILE",
|
||||
"CURLOPT_INFILE"
|
||||
);
|
||||
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
foreach($options_to_check as $option) {
|
||||
checkForClosedFilePointer($host, constant($option), $option);
|
||||
}
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?>
|
||||
--EXPECTF--
|
||||
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug54798.php on line %d
|
||||
* About to connect() %a
|
||||
* Closing connection #%d
|
||||
Ok for CURLOPT_STDERR
|
||||
|
||||
Warning: curl_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug54798.php on line 24
|
||||
Ok for CURLOPT_WRITEHEADER
|
||||
|
||||
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug54798.php on line 24
|
||||
%a
|
||||
Ok for CURLOPT_FILE
|
||||
|
||||
Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug54798.php on line %d
|
||||
Ok for CURLOPT_INFILE
|
||||
@@ -4,7 +4,7 @@ Test CURLOPT_READDATA without a callback function
|
||||
Mattijs Hoitink mattijshoitink@gmail.com
|
||||
#Testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -3,7 +3,13 @@ Test curl_error() & curl_errno() function with problematic host
|
||||
--CREDITS--
|
||||
TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
<?php
|
||||
if (!extension_loaded("curl")) print "skip";
|
||||
$addr = "www.".uniqid().".".uniqid();
|
||||
if (gethostbyname($addr) != $addr) {
|
||||
print "skip catch all dns";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -3,7 +3,13 @@ Test curl_error() & curl_errno() function with problematic proxy
|
||||
--CREDITS--
|
||||
TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
<?php
|
||||
if (!extension_loaded("curl")) print "skip";
|
||||
$addr = "www.".uniqid().".".uniqid();
|
||||
if (gethostbyname($addr) != $addr) {
|
||||
print "skip catch all dns";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Test curl_opt() function with COOKIE
|
||||
--CREDITS--
|
||||
TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv(b'PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv(b'PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
|
||||
@@ -35,4 +35,4 @@ TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
|
||||
*** Testing curl with cookie ***
|
||||
string(3) "bar"
|
||||
===DONE===
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Test curl_copy_handle() with simple get
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -39,4 +39,4 @@ string(106) "array(2) {
|
||||
array(0) {
|
||||
}
|
||||
"
|
||||
===DONE===
|
||||
===DONE===
|
||||
@@ -4,7 +4,7 @@ Test curl_copy_handle() with simple POST
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
@@ -29,8 +29,6 @@ Rick Buitenman <rick@meritos.nl>
|
||||
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) {
|
||||
|
||||
@@ -4,7 +4,7 @@ Test curl_copy_handle() after exec()
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -41,4 +41,4 @@ string(106) "array(2) {
|
||||
array(0) {
|
||||
}
|
||||
"
|
||||
===DONE===
|
||||
===DONE===
|
||||
@@ -4,7 +4,7 @@ Test curl_copy_handle() after exec() with POST
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -32,8 +32,6 @@ Rick Buitenman <rick@meritos.nl>
|
||||
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) {
|
||||
|
||||
@@ -4,7 +4,7 @@ Test curl_copy_handle() with User Agent
|
||||
Rick Buitenman <rick@meritos.nl>
|
||||
#testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() with simple POST
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Test curl_copy_handle() with CURLOPT_PROGRESSFUNCTION
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
|
||||
$url = "{$host}/get.php";
|
||||
$ch = curl_init($url);
|
||||
|
||||
curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function() { });
|
||||
$ch2 = curl_copy_handle($ch);
|
||||
echo curl_exec($ch), PHP_EOL;
|
||||
unset($ch);
|
||||
echo curl_exec($ch2);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Hello World!
|
||||
Hello World!
|
||||
Hello World!
|
||||
Hello World!
|
||||
@@ -4,7 +4,15 @@ curl_error() function - basic test for curl_error using a fake url
|
||||
Mattijs Hoitink mattijshoitink@gmail.com
|
||||
#Testfest Utrecht 2009
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl")) print "skip"; ?>
|
||||
<?php
|
||||
|
||||
if (!extension_loaded("curl")) die("skip\n");
|
||||
|
||||
$url = "fakeURL";
|
||||
$ip = gethostbyname($url);
|
||||
if ($ip != $url) die("skip 'fakeURL' resolves to $ip\n");
|
||||
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
/*
|
||||
@@ -21,13 +29,13 @@ echo "== Testing curl_error with a fake URL ==\n";
|
||||
|
||||
// cURL handler
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
||||
ob_start(); // start output buffering
|
||||
curl_exec($ch);
|
||||
echo "Error: " . curl_error($ch);
|
||||
var_dump(curl_error($ch));
|
||||
curl_close($ch);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
== Testing curl_error with a fake URL ==
|
||||
Error: Couldn't resolve host 'fakeURL'
|
||||
string(%d) "%sfakeURL%s"
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Memory corruption error if fp of just created file is closed before curl_close.
|
||||
--CREDITS--
|
||||
Alexey Shein <confik@gmail.com>
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$ch = curl_init(getenv('PHP_CURL_HTTP_REMOTE_SERVER'));
|
||||
|
||||
$temp_file = dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp';
|
||||
if (file_exists($temp_file)) {
|
||||
unlink($temp_file); // file should not exist before test
|
||||
}
|
||||
|
||||
$handle = fopen($temp_file, 'w');
|
||||
|
||||
curl_setopt($ch, CURLOPT_STDERR, $handle);
|
||||
curl_setopt($ch, CURLOPT_VERBOSE, 1);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
||||
curl_exec($ch);
|
||||
|
||||
fclose($handle); // causes glibc memory error
|
||||
|
||||
//unlink($temp_file); // uncomment to test segfault (file not found on iowrite.c)
|
||||
|
||||
curl_close($ch);
|
||||
echo "Closed correctly\n";
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unlink(dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp');
|
||||
?>
|
||||
--EXPECTF--
|
||||
* Closing connection #%d
|
||||
Closed correctly
|
||||
@@ -5,7 +5,10 @@ Rein Velt (rein@velt.org)
|
||||
#TestFest Utrecht 20090509
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('curl')) print 'skip';
|
||||
if (!extension_loaded('curl')) print 'skip need ext/curl';
|
||||
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -16,7 +19,8 @@ if (!extension_loaded('curl')) print 'skip';
|
||||
$ch2=curl_init();
|
||||
|
||||
//SET URL AND OTHER OPTIONS
|
||||
curl_setopt($ch1, CURLOPT_URL, "http://php.net/robots.txt");
|
||||
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
|
||||
curl_setopt($ch1, CURLOPT_URL, "{$host}/get.php?test=getpost&get_param=Hello%20World");
|
||||
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
@@ -46,19 +50,13 @@ if (!extension_loaded('curl')) print 'skip';
|
||||
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
|
||||
|
||||
Disallow: /harming/humans
|
||||
Disallow: /ignoring/human/orders
|
||||
Disallow: /harm/to/self
|
||||
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
["test"]=>
|
||||
string(7) "getpost"
|
||||
["get_param"]=>
|
||||
string(11) "Hello World"
|
||||
}
|
||||
array(0) {
|
||||
}
|
||||
CURL2
|
||||
|
||||
@@ -46,6 +46,7 @@ $returnContent = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
var_dump($returnContent);
|
||||
isset($tempname) and is_file($tempname) and @unlink($tempname);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -4,7 +4,7 @@ curl_setopt basic tests with CURLOPT_STDERR.
|
||||
Paul Sohier
|
||||
#phptestfest utrecht
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -26,7 +26,7 @@ $curl_content = curl_exec($ch);
|
||||
|
||||
fclose($handle);
|
||||
unset($handle);
|
||||
var_dump( file_get_contents($temp_file) );
|
||||
var_dump(preg_replace('/[\r\n]/', ' ', file_get_contents($temp_file)));
|
||||
@unlink($temp_file);
|
||||
|
||||
ob_start(); // start output buffering
|
||||
@@ -38,7 +38,7 @@ ob_end_clean();
|
||||
|
||||
fclose($handle);
|
||||
unset($handle);
|
||||
var_dump( file_get_contents($temp_file) );
|
||||
var_dump(preg_replace('/[\r\n]/', ' ', file_get_contents($temp_file)));
|
||||
@unlink($temp_file);
|
||||
|
||||
curl_close($ch);
|
||||
@@ -48,3 +48,5 @@ curl_close($ch);
|
||||
*** Testing curl_setopt with CURLOPT_STDERR
|
||||
string(%d) "%S"
|
||||
string(%d) "%S"
|
||||
* Closing connection #%d
|
||||
|
||||
@@ -4,7 +4,7 @@ curl_setopt() call with CURLOPT_HTTPHEADER
|
||||
Paul Sohier
|
||||
#phptestfest utrecht
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ curl_setopt() call with CURLOPT_RETURNTRANSFER
|
||||
Paul Sohier
|
||||
#phptestfest utrecht
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
Test curl_version() function : error conditions
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||
if (!extension_loaded("curl")) {
|
||||
die('skip - curl extension not available in this build');
|
||||
}
|
||||
if (!getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||
echo "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
Test curl_version() function : usage variations - test values for $ascii argument
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||
die('skip - curl extension not available in this build');
|
||||
if (!extension_loaded("curl")) {
|
||||
echo "skip - curl extension not available in this build";
|
||||
}
|
||||
if (!getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||
echo "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
||||
@@ -6,7 +6,14 @@ Dutch UG, TestFest 2009, Utrecht
|
||||
--DESCRIPTION--
|
||||
Hit the host identified by PHP_CURL_HTTP_REMOTE_SERVER and determine that the headers are sent to the callback specified for CURLOPT_HEADERFUNCTION. Different test servers specified for PHP_CURL_HTTP_REMOTE_SERVER might return different sets of headers. Just test for HTTP/1.1 200 OK.
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
|
||||
<?php
|
||||
if (!extension_loaded("curl")) {
|
||||
echo "skip - curl extension not available in this build";
|
||||
}
|
||||
if (!getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
|
||||
echo "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable";
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
switch($_GET['test']) {
|
||||
$test = isset($_GET['test']) ? $_GET['test'] : null;
|
||||
switch($test) {
|
||||
case 'post':
|
||||
var_dump($_POST);
|
||||
break;
|
||||
@@ -25,6 +26,11 @@
|
||||
case 'contenttype':
|
||||
header('Content-Type: text/plain;charset=utf-8');
|
||||
break;
|
||||
case 'file':
|
||||
if (isset($_FILES['file'])) {
|
||||
echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "Hello World!\n";
|
||||
echo "Hello World!";
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "timelib.h"
|
||||
#include <math.h>
|
||||
|
||||
timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
|
||||
{
|
||||
|
||||
+219
-153
File diff suppressed because it is too large.
Load diff
+122
-56
@@ -119,8 +119,8 @@ typedef unsigned char uchar;
|
||||
#define TIMELIB_DEINIT timelib_string_free(str)
|
||||
#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; }
|
||||
|
||||
#define TIMELIB_PROCESS_YEAR(x) { \
|
||||
if ((x) == TIMELIB_UNSET) { \
|
||||
#define TIMELIB_PROCESS_YEAR(x, l) { \
|
||||
if (((x) == TIMELIB_UNSET) || ((l) >= 4)) { \
|
||||
/* (x) = 0; */ \
|
||||
} else if ((x) < 100) { \
|
||||
if ((x) < 70) { \
|
||||
@@ -438,7 +438,7 @@ static char *timelib_string(Scanner *s)
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static timelib_sll timelib_get_nr(char **ptr, int max_length)
|
||||
static timelib_sll timelib_get_nr_ex(char **ptr, int max_length, int *scanned_length)
|
||||
{
|
||||
char *begin, *end, *str;
|
||||
timelib_sll tmp_nr = TIMELIB_UNSET;
|
||||
@@ -456,6 +456,9 @@ static timelib_sll timelib_get_nr(char **ptr, int max_length)
|
||||
++len;
|
||||
}
|
||||
end = *ptr;
|
||||
if (scanned_length) {
|
||||
*scanned_length = end - begin;
|
||||
}
|
||||
str = calloc(1, end - begin + 1);
|
||||
memcpy(str, begin, end - begin);
|
||||
tmp_nr = strtoll(str, NULL, 10);
|
||||
@@ -463,6 +466,11 @@ static timelib_sll timelib_get_nr(char **ptr, int max_length)
|
||||
return tmp_nr;
|
||||
}
|
||||
|
||||
static timelib_sll timelib_get_nr(char **ptr, int max_length)
|
||||
{
|
||||
return timelib_get_nr_ex(ptr, max_length, NULL);
|
||||
}
|
||||
|
||||
static void timelib_skip_day_suffix(char **ptr)
|
||||
{
|
||||
if (isspace(**ptr)) {
|
||||
@@ -775,7 +783,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
|
||||
return value;
|
||||
}
|
||||
|
||||
static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
|
||||
static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
|
||||
{
|
||||
timelib_tzinfo *res;
|
||||
long retval = 0;
|
||||
@@ -824,7 +832,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
|
||||
#endif
|
||||
/* If we have a TimeZone identifier to start with, use it */
|
||||
if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
|
||||
if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) {
|
||||
if ((res = tz_wrapper(tz_abbr, tzdb)) != NULL) {
|
||||
t->tz_info = res;
|
||||
t->zone_type = TIMELIB_ZONETYPE_ID;
|
||||
found++;
|
||||
@@ -853,7 +861,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
|
||||
} \
|
||||
}
|
||||
|
||||
static int scan(Scanner *s)
|
||||
static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
{
|
||||
uchar *cursor = s->cur;
|
||||
char *str, *ptr = NULL;
|
||||
@@ -1186,7 +1194,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
}
|
||||
|
||||
if (*ptr != '\0') {
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
|
||||
if (tz_not_found) {
|
||||
add_error(s, "The timezone could not be found in the database");
|
||||
}
|
||||
@@ -1227,7 +1235,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
s->time->h = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->i = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->s = 0;
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb);
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
|
||||
break;
|
||||
case 1:
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
@@ -1252,7 +1260,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
s->time->s = timelib_get_nr((char **) &ptr, 2);
|
||||
|
||||
if (*ptr != '\0') {
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
|
||||
if (tz_not_found) {
|
||||
add_error(s, "The timezone could not be found in the database");
|
||||
}
|
||||
@@ -1263,14 +1271,15 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
|
||||
americanshort | american
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("americanshort | american");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->m = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->d = timelib_get_nr((char **) &ptr, 2);
|
||||
if (*ptr == '/') {
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
}
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_AMERICAN;
|
||||
@@ -1290,53 +1299,57 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
|
||||
iso8601date2
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("iso8601date2");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
s->time->m = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->d = timelib_get_nr((char **) &ptr, 2);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
|
||||
gnudateshorter
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshorter");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
s->time->m = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->d = 1;
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
|
||||
gnudateshort
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("gnudateshort");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
s->time->m = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->d = timelib_get_nr((char **) &ptr, 2);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_ISO_DATE;
|
||||
}
|
||||
|
||||
datefull
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datefull");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->d = timelib_get_nr((char **) &ptr, 2);
|
||||
timelib_skip_day_suffix((char **) &ptr);
|
||||
s->time->m = timelib_get_month((char **) &ptr);
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL;
|
||||
}
|
||||
@@ -1355,52 +1368,56 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
|
||||
pointeddate2
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pointed date YY");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->d = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->m = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 2);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_FULL_POINTED;
|
||||
}
|
||||
|
||||
datenoday
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenoday");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->m = timelib_get_month((char **) &ptr);
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
s->time->d = 1;
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
|
||||
datenodayrev
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datenodayrev");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
s->time->m = timelib_get_month((char **) &ptr);
|
||||
s->time->d = 1;
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_NO_DAY;
|
||||
}
|
||||
|
||||
datetextual | datenoyear
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("datetextual | datenoyear");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->m = timelib_get_month((char **) &ptr);
|
||||
s->time->d = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_DATE_TEXT;
|
||||
}
|
||||
@@ -1445,7 +1462,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
if (*ptr == '.') {
|
||||
s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
|
||||
if (*ptr) { /* timezone is optional */
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
|
||||
if (tz_not_found) {
|
||||
add_error(s, "The timezone could not be found in the database");
|
||||
}
|
||||
@@ -1457,13 +1474,14 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
|
||||
pgydotd
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgydotd");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
s->time->d = timelib_get_nr((char **) &ptr, 3);
|
||||
s->time->m = 1;
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_YEARDAY;
|
||||
}
|
||||
@@ -1508,26 +1526,28 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
|
||||
pgtextshort
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextshort");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->m = timelib_get_month((char **) &ptr);
|
||||
s->time->d = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
|
||||
pgtextreverse
|
||||
{
|
||||
int length = 0;
|
||||
DEBUG_OUTPUT("pgtextreverse");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_DATE();
|
||||
s->time->y = timelib_get_nr((char **) &ptr, 4);
|
||||
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
|
||||
s->time->m = timelib_get_month((char **) &ptr);
|
||||
s->time->d = timelib_get_nr((char **) &ptr, 2);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
TIMELIB_DEINIT;
|
||||
return TIMELIB_PG_TEXT;
|
||||
}
|
||||
@@ -1545,7 +1565,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
s->time->h = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->i = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->s = timelib_get_nr((char **) &ptr, 2);
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
|
||||
if (tz_not_found) {
|
||||
add_error(s, "The timezone could not be found in the database");
|
||||
}
|
||||
@@ -1658,7 +1678,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
DEBUG_OUTPUT("tzcorrection | tz");
|
||||
TIMELIB_INIT;
|
||||
TIMELIB_HAVE_TZ();
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
|
||||
if (tz_not_found) {
|
||||
add_error(s, "The timezone could not be found in the database");
|
||||
}
|
||||
@@ -1711,7 +1731,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
}
|
||||
|
||||
if (*ptr != '\0') {
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
|
||||
if (tz_not_found) {
|
||||
add_error(s, "The timezone could not be found in the database");
|
||||
}
|
||||
@@ -1757,7 +1777,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
|
||||
|
||||
/*!max:re2c */
|
||||
|
||||
timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb)
|
||||
timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
{
|
||||
Scanner in;
|
||||
int t;
|
||||
@@ -1812,7 +1832,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
|
||||
in.time->zone_type = 0;
|
||||
|
||||
do {
|
||||
t = scan(&in);
|
||||
t = scan(&in, tz_get_wrapper);
|
||||
#ifdef DEBUG_PARSER
|
||||
printf("%d\n", t);
|
||||
#endif
|
||||
@@ -1867,7 +1887,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time)
|
||||
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
|
||||
}
|
||||
|
||||
timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb)
|
||||
timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
|
||||
{
|
||||
char *fptr = format;
|
||||
char *ptr = string;
|
||||
@@ -1875,6 +1895,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
timelib_sll tmp;
|
||||
Scanner in;
|
||||
Scanner *s = ∈
|
||||
int allow_extra = 0;
|
||||
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.errors = malloc(sizeof(struct timelib_error_container));
|
||||
@@ -1903,8 +1924,19 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
switch (*fptr) {
|
||||
case 'D': /* three letter day */
|
||||
case 'l': /* full day */
|
||||
if (!timelib_lookup_relunit((char **) &ptr)) {
|
||||
add_pbf_error(s, "A textual day could not be found", string, begin);
|
||||
{
|
||||
const timelib_relunit* tmprel = 0;
|
||||
|
||||
tmprel = timelib_lookup_relunit((char **) &ptr);
|
||||
if (!tmprel) {
|
||||
add_pbf_error(s, "A textual day could not be found", string, begin);
|
||||
break;
|
||||
} else {
|
||||
in.time->have_relative = 1;
|
||||
in.time->relative.have_weekday_relative = 1;
|
||||
in.time->relative.weekday = tmprel->multiplier;
|
||||
in.time->relative.weekday_behavior = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'd': /* two digit day, with leading zero */
|
||||
@@ -1917,13 +1949,14 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
case 'S': /* day suffix, ignored, nor checked */
|
||||
timelib_skip_day_suffix((char **) &ptr);
|
||||
break;
|
||||
case 'z': /* day of year - resets month (0 based) */
|
||||
case 'z': /* day of year - resets month (0 based) - also initializes everything else to !TIMELIB_UNSET */
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
if ((tmp = timelib_get_nr((char **) &ptr, 3)) == TIMELIB_UNSET) {
|
||||
add_pbf_error(s, "A three digit day-of-year could not be found", string, begin);
|
||||
} else {
|
||||
s->time->m = 1;
|
||||
s->time->d = tmp + 1;
|
||||
timelib_do_normalize(s->time);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1944,11 +1977,14 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
}
|
||||
break;
|
||||
case 'y': /* two digit year */
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
if ((s->time->y = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
|
||||
add_pbf_error(s, "A two digit year could not be found", string, begin);
|
||||
{
|
||||
int length = 0;
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
|
||||
add_pbf_error(s, "A two digit year could not be found", string, begin);
|
||||
}
|
||||
TIMELIB_PROCESS_YEAR(s->time->y, length);
|
||||
}
|
||||
TIMELIB_PROCESS_YEAR(s->time->y);
|
||||
break;
|
||||
case 'Y': /* four digit year */
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
@@ -1984,15 +2020,31 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
}
|
||||
break;
|
||||
case 'i': /* two digit minute, with leading zero */
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
if ((s->time->i = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
|
||||
add_pbf_error(s, "A two digit minute could not be found", string, begin);
|
||||
{
|
||||
int length;
|
||||
timelib_sll min;
|
||||
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
min = timelib_get_nr_ex((char **) &ptr, 2, &length);
|
||||
if (min == TIMELIB_UNSET || length != 2) {
|
||||
add_pbf_error(s, "A two digit minute could not be found", string, begin);
|
||||
} else {
|
||||
s->time->i = min;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 's': /* two digit second, with leading zero */
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
if ((s->time->s = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
|
||||
add_pbf_error(s, "A two digit second could not be found", string, begin);
|
||||
{
|
||||
int length;
|
||||
timelib_sll sec;
|
||||
|
||||
TIMELIB_CHECK_NUMBER;
|
||||
sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
|
||||
if (sec == TIMELIB_UNSET || length != 2) {
|
||||
add_pbf_error(s, "A two second minute could not be found", string, begin);
|
||||
} else {
|
||||
s->time->s = sec;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'u': /* up to six digit millisecond */
|
||||
@@ -2033,7 +2085,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
case 'O': /* timezone */
|
||||
{
|
||||
int tz_not_found;
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
|
||||
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
|
||||
if (tz_not_found) {
|
||||
add_pbf_error(s, "The timezone could not be found in the database", string, begin);
|
||||
}
|
||||
@@ -2088,6 +2140,10 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
timelib_eat_until_separator((char **) &ptr);
|
||||
break;
|
||||
|
||||
case '+': /* allow extra chars in the format */
|
||||
allow_extra = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (*fptr != *ptr) {
|
||||
add_pbf_error(s, "The format separator does not match", string, begin);
|
||||
@@ -2097,11 +2153,20 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
fptr++;
|
||||
}
|
||||
if (*ptr) {
|
||||
add_pbf_error(s, "Trailing data", string, ptr);
|
||||
if (allow_extra) {
|
||||
add_pbf_warning(s, "Trailing data", string, ptr);
|
||||
} else {
|
||||
add_pbf_error(s, "Trailing data", string, ptr);
|
||||
}
|
||||
}
|
||||
/* ignore trailing +'s */
|
||||
while (*fptr == '+') {
|
||||
fptr++;
|
||||
}
|
||||
if (*fptr) {
|
||||
/* Trailing | and ! specifiers are valid. */
|
||||
while (*fptr) {
|
||||
int done = 0;
|
||||
while (*fptr && !done) {
|
||||
switch (*fptr++) {
|
||||
case '!': /* reset all fields to default */
|
||||
timelib_time_reset_fields(s->time);
|
||||
@@ -2113,6 +2178,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
|
||||
|
||||
default:
|
||||
add_pbf_error(s, "Data missing", string, ptr);
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Generated by re2c 0.13.5 on Sat Nov 13 14:57:59 2010 */
|
||||
/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:31 2011 */
|
||||
#line 1 "ext/date/lib/parse_iso_intervals.re"
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
@@ -396,7 +396,7 @@ yy6:
|
||||
break;
|
||||
}
|
||||
|
||||
nr = timelib_get_unsigned_nr((char **) &ptr, 9);
|
||||
nr = timelib_get_unsigned_nr((char **) &ptr, 12);
|
||||
switch (*ptr) {
|
||||
case 'Y': s->period->y = nr; break;
|
||||
case 'W': s->period->d = nr * 7; break;
|
||||
|
||||
@@ -364,7 +364,7 @@ isoweek = year4 "-"? "W" weekofyear;
|
||||
break;
|
||||
}
|
||||
|
||||
nr = timelib_get_unsigned_nr((char **) &ptr, 9);
|
||||
nr = timelib_get_unsigned_nr((char **) &ptr, 12);
|
||||
switch (*ptr) {
|
||||
case 'Y': s->period->y = nr; break;
|
||||
case 'W': s->period->d = nr * 7; break;
|
||||
|
||||
@@ -26,12 +26,14 @@
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#define TIMELIB_VERSION 201101
|
||||
#define TIMELIB_VERSION 201102
|
||||
|
||||
#define TIMELIB_NONE 0x00
|
||||
#define TIMELIB_OVERRIDE_TIME 0x01
|
||||
#define TIMELIB_NO_CLONE 0x02
|
||||
|
||||
#define TIMELIB_UNSET -99999
|
||||
|
||||
#define TIMELIB_SPECIAL_WEEKDAY 0x01
|
||||
#define TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH 0x02
|
||||
#define TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH 0x03
|
||||
@@ -52,6 +54,9 @@
|
||||
#define strncasecmp strnicmp
|
||||
#endif
|
||||
|
||||
/* Function pointers */
|
||||
typedef timelib_tzinfo* (*timelib_tz_get_wrapper)(char *tzname, const timelib_tzdb *tzdb);
|
||||
|
||||
/* From dow.c */
|
||||
timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d);
|
||||
timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d);
|
||||
@@ -63,8 +68,8 @@ int timelib_valid_time(timelib_sll h, timelib_sll i, timelib_sll s);
|
||||
int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d);
|
||||
|
||||
/* From parse_date.re */
|
||||
timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb);
|
||||
timelib_time *timelib_parse_from_format(char *format, char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb);
|
||||
timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
|
||||
timelib_time *timelib_parse_from_format(char *format, char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
|
||||
void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options);
|
||||
char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst);
|
||||
const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void);
|
||||
@@ -78,6 +83,7 @@ void timelib_strtointerval(char *s, int len,
|
||||
|
||||
/* From tm2unixtime.c */
|
||||
void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi);
|
||||
void timelib_do_normalize(timelib_time *base);
|
||||
void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt);
|
||||
|
||||
/* From unixtime2tm.c */
|
||||
|
||||
+769
-753
File diff suppressed because it is too large.
Load diff
@@ -179,11 +179,11 @@ void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt)
|
||||
do {} while (do_range_limit(0, 12, 12, &rt->m, &rt->y));
|
||||
}
|
||||
|
||||
static void do_normalize(timelib_time* time)
|
||||
void timelib_do_normalize(timelib_time* time)
|
||||
{
|
||||
do {} while (do_range_limit(0, 60, 60, &time->s, &time->i));
|
||||
do {} while (do_range_limit(0, 60, 60, &time->i, &time->h));
|
||||
do {} while (do_range_limit(0, 24, 24, &time->h, &time->d));
|
||||
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->s, &time->i));
|
||||
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->i, &time->h));
|
||||
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 24, 24, &time->h, &time->d));
|
||||
do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
|
||||
|
||||
do {} while (do_range_limit_days(&time->y, &time->m, &time->d));
|
||||
@@ -195,7 +195,7 @@ static void do_adjust_relative(timelib_time* time)
|
||||
if (time->relative.have_weekday_relative) {
|
||||
do_adjust_for_weekday(time);
|
||||
}
|
||||
do_normalize(time);
|
||||
timelib_do_normalize(time);
|
||||
|
||||
if (time->have_relative) {
|
||||
time->s += time->relative.s;
|
||||
@@ -215,7 +215,7 @@ static void do_adjust_relative(timelib_time* time)
|
||||
time->m++;
|
||||
break;
|
||||
}
|
||||
do_normalize(time);
|
||||
timelib_do_normalize(time);
|
||||
}
|
||||
|
||||
static void do_adjust_special_weekday(timelib_time* time)
|
||||
@@ -280,7 +280,7 @@ static void do_adjust_special(timelib_time* time)
|
||||
break;
|
||||
}
|
||||
}
|
||||
do_normalize(time);
|
||||
timelib_do_normalize(time);
|
||||
memset(&(time->relative.special), 0, sizeof(time->relative.special));
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ static void do_adjust_special_early(timelib_time* time)
|
||||
break;
|
||||
}
|
||||
}
|
||||
do_normalize(time);
|
||||
timelib_do_normalize(time);
|
||||
}
|
||||
|
||||
static timelib_sll do_years(timelib_sll year)
|
||||
|
||||
@@ -146,7 +146,7 @@ void timelib_update_from_sse(timelib_time *tm)
|
||||
int z = tm->z;
|
||||
signed int dst = tm->dst;
|
||||
|
||||
timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60));
|
||||
timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60) + (tm->dst * 3600));
|
||||
|
||||
tm->z = z;
|
||||
tm->dst = dst;
|
||||
@@ -184,7 +184,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
|
||||
int z = tm->z;
|
||||
signed int dst = tm->dst;
|
||||
|
||||
timelib_unixtime2gmt(tm, ts - (tm->z * 60));
|
||||
timelib_unixtime2gmt(tm, ts - (tm->z * 60) + (tm->dst * 3600));
|
||||
|
||||
tm->z = z;
|
||||
tm->dst = dst;
|
||||
|
||||
+96
-17
@@ -425,7 +425,7 @@ const zend_function_entry date_functions[] = {
|
||||
PHP_FE(date_sunrise, arginfo_date_sunrise)
|
||||
PHP_FE(date_sunset, arginfo_date_sunset)
|
||||
PHP_FE(date_sun_info, arginfo_date_sun_info)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
const zend_function_entry date_funcs_date[] = {
|
||||
@@ -447,7 +447,7 @@ const zend_function_entry date_funcs_date[] = {
|
||||
PHP_ME_MAPPING(setTimestamp, date_timestamp_set, arginfo_date_method_timestamp_set, 0)
|
||||
PHP_ME_MAPPING(getTimestamp, date_timestamp_get, arginfo_date_method_timestamp_get, 0)
|
||||
PHP_ME_MAPPING(diff, date_diff, arginfo_date_method_diff, 0)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
const zend_function_entry date_funcs_timezone[] = {
|
||||
@@ -458,19 +458,21 @@ const zend_function_entry date_funcs_timezone[] = {
|
||||
PHP_ME_MAPPING(getLocation, timezone_location_get, arginfo_timezone_method_location_get, 0)
|
||||
PHP_ME_MAPPING(listAbbreviations, timezone_abbreviations_list, arginfo_timezone_abbreviations_list, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
PHP_ME_MAPPING(listIdentifiers, timezone_identifiers_list, arginfo_timezone_identifiers_list, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
const zend_function_entry date_funcs_interval[] = {
|
||||
PHP_ME(DateInterval, __construct, arginfo_date_interval_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DateInterval, __wakeup, NULL, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(DateInterval, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
PHP_ME_MAPPING(format, date_interval_format, arginfo_date_method_interval_format, 0)
|
||||
PHP_ME_MAPPING(createFromDateString, date_interval_create_from_date_string, arginfo_date_interval_create_from_date_string, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
const zend_function_entry date_funcs_period[] = {
|
||||
PHP_ME(DatePeriod, __construct, arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
|
||||
{NULL, NULL, NULL}
|
||||
PHP_FE_END
|
||||
};
|
||||
|
||||
static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC);
|
||||
@@ -832,6 +834,12 @@ static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_
|
||||
}
|
||||
return tzi;
|
||||
}
|
||||
|
||||
timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib_tzdb *tzdb)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
return php_date_parse_tzfile(formal_tzname, tzdb TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ Helper functions */
|
||||
@@ -1367,7 +1375,7 @@ PHPAPI signed long php_parse_date(char *string, signed long *now)
|
||||
int error2;
|
||||
signed long retval;
|
||||
|
||||
parsed_time = timelib_strtotime(string, strlen(string), &error, DATE_TIMEZONEDB);
|
||||
parsed_time = timelib_strtotime(string, strlen(string), &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
if (error->error_count) {
|
||||
timelib_error_container_dtor(error);
|
||||
return -1;
|
||||
@@ -1404,7 +1412,7 @@ PHP_FUNCTION(strtotime)
|
||||
|
||||
initial_ts = emalloc(25);
|
||||
snprintf(initial_ts, 24, "@%ld UTC", preset_ts);
|
||||
t = timelib_strtotime(initial_ts, strlen(initial_ts), NULL, DATE_TIMEZONEDB); /* we ignore the error here, as this should never fail */
|
||||
t = timelib_strtotime(initial_ts, strlen(initial_ts), NULL, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper); /* we ignore the error here, as this should never fail */
|
||||
timelib_update_ts(t, tzi);
|
||||
now->tz_info = tzi;
|
||||
now->zone_type = TIMELIB_ZONETYPE_ID;
|
||||
@@ -1426,7 +1434,7 @@ PHP_FUNCTION(strtotime)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
t = timelib_strtotime(times, time_len, &error, DATE_TIMEZONEDB);
|
||||
t = timelib_strtotime(times, time_len, &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
error1 = error->error_count;
|
||||
timelib_error_container_dtor(error);
|
||||
timelib_fill_holes(t, now, TIMELIB_NO_CLONE);
|
||||
@@ -2047,6 +2055,9 @@ static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC)
|
||||
zend_object_value new_ov = date_object_new_date_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
|
||||
|
||||
zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
|
||||
if (!old_obj->time) {
|
||||
return new_ov;
|
||||
}
|
||||
|
||||
/* this should probably moved to a new `timelib_time *timelime_time_clone(timelib_time *)` */
|
||||
new_obj->time = timelib_time_ctor();
|
||||
@@ -2168,6 +2179,10 @@ static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC)
|
||||
zend_object_value new_ov = date_object_new_timezone_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
|
||||
|
||||
zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
|
||||
if (!old_obj->initialized) {
|
||||
return new_ov;
|
||||
}
|
||||
|
||||
new_obj->type = old_obj->type;
|
||||
new_obj->initialized = 1;
|
||||
switch (new_obj->type) {
|
||||
@@ -2378,7 +2393,7 @@ static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_D
|
||||
PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC)
|
||||
{
|
||||
timelib_time *now;
|
||||
timelib_tzinfo *tzi;
|
||||
timelib_tzinfo *tzi = NULL;
|
||||
timelib_error_container *err = NULL;
|
||||
int type = TIMELIB_ZONETYPE_ID, new_dst;
|
||||
char *new_abbr;
|
||||
@@ -2388,9 +2403,9 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
|
||||
timelib_time_dtor(dateobj->time);
|
||||
}
|
||||
if (format) {
|
||||
dateobj->time = timelib_parse_from_format(format, time_str_len ? time_str : "", time_str_len ? time_str_len : 0, &err, DATE_TIMEZONEDB);
|
||||
dateobj->time = timelib_parse_from_format(format, time_str_len ? time_str : "", time_str_len ? time_str_len : 0, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
} else {
|
||||
dateobj->time = timelib_strtotime(time_str_len ? time_str : "now", time_str_len ? time_str_len : sizeof("now") -1, &err, DATE_TIMEZONEDB);
|
||||
dateobj->time = timelib_strtotime(time_str_len ? time_str : "now", time_str_len ? time_str_len : sizeof("now") -1, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
}
|
||||
|
||||
/* update last errors and warnings */
|
||||
@@ -2724,7 +2739,7 @@ PHP_FUNCTION(date_parse)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
parsed_time = timelib_strtotime(date, date_len, &error, DATE_TIMEZONEDB);
|
||||
parsed_time = timelib_strtotime(date, date_len, &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
php_date_do_return_parsed_time(INTERNAL_FUNCTION_PARAM_PASSTHRU, parsed_time, error);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2743,7 +2758,7 @@ PHP_FUNCTION(date_parse_from_format)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
parsed_time = timelib_parse_from_format(format, date, date_len, &error, DATE_TIMEZONEDB);
|
||||
parsed_time = timelib_parse_from_format(format, date, date_len, &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
php_date_do_return_parsed_time(INTERNAL_FUNCTION_PARAM_PASSTHRU, parsed_time, error);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2785,7 +2800,7 @@ PHP_FUNCTION(date_modify)
|
||||
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
|
||||
|
||||
tmp_time = timelib_strtotime(modify, modify_len, &err, DATE_TIMEZONEDB);
|
||||
tmp_time = timelib_strtotime(modify, modify_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
|
||||
/* update last errors and warnings */
|
||||
update_errors_warnings(err TSRMLS_CC);
|
||||
@@ -3606,6 +3621,70 @@ PHP_METHOD(DateInterval, __construct)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static long php_date_long_from_hash_element(HashTable *myht, char *element, size_t size)
|
||||
{
|
||||
zval **z_arg = NULL;
|
||||
|
||||
if (zend_hash_find(myht, element, size + 1, (void**) &z_arg) == SUCCESS) {
|
||||
convert_to_long(*z_arg);
|
||||
return Z_LVAL_PP(z_arg);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC)
|
||||
{
|
||||
(*intobj)->diff = timelib_rel_time_ctor();
|
||||
|
||||
(*intobj)->diff->y = php_date_long_from_hash_element(myht, "y", 1);
|
||||
(*intobj)->diff->m = php_date_long_from_hash_element(myht, "m", 1);
|
||||
(*intobj)->diff->d = php_date_long_from_hash_element(myht, "d", 1);
|
||||
(*intobj)->diff->h = php_date_long_from_hash_element(myht, "h", 1);
|
||||
(*intobj)->diff->i = php_date_long_from_hash_element(myht, "i", 1);
|
||||
(*intobj)->diff->s = php_date_long_from_hash_element(myht, "s", 1);
|
||||
(*intobj)->diff->invert = php_date_long_from_hash_element(myht, "invert", 6);
|
||||
(*intobj)->diff->days = php_date_long_from_hash_element(myht, "days", 4);
|
||||
(*intobj)->initialized = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* {{{ proto DateInterval::__set_state()
|
||||
*/
|
||||
PHP_METHOD(DateInterval, __set_state)
|
||||
{
|
||||
php_interval_obj *intobj;
|
||||
zval *array;
|
||||
HashTable *myht;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
myht = HASH_OF(array);
|
||||
|
||||
php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
|
||||
intobj = (php_interval_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto DateInterval::__wakeup()
|
||||
*/
|
||||
PHP_METHOD(DateInterval, __wakeup)
|
||||
{
|
||||
zval *object = getThis();
|
||||
php_interval_obj *intobj;
|
||||
HashTable *myht;
|
||||
|
||||
intobj = (php_interval_obj *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
|
||||
myht = Z_OBJPROP_P(object);
|
||||
|
||||
php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
/* {{{ proto DateInterval date_interval_create_from_date_string(string time)
|
||||
Uses the normal date parsers and sets up a DateInterval from the relative parts of the parsed string
|
||||
*/
|
||||
@@ -3623,7 +3702,7 @@ PHP_FUNCTION(date_interval_create_from_date_string)
|
||||
|
||||
php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
|
||||
|
||||
time = timelib_strtotime(time_str, time_str_len, &err, DATE_TIMEZONEDB);
|
||||
time = timelib_strtotime(time_str, time_str_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
diobj = (php_interval_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
|
||||
diobj->diff = timelib_rel_time_clone(&time->relative);
|
||||
diobj->initialized = 1;
|
||||
@@ -3661,8 +3740,8 @@ static char *date_interval_format(char *format, int format_len, timelib_rel_time
|
||||
case 'I': length = slprintf(buffer, 32, "%02d", (int) t->i); break;
|
||||
case 'i': length = slprintf(buffer, 32, "%d", (int) t->i); break;
|
||||
|
||||
case 'S': length = slprintf(buffer, 32, "%02d", (int) t->s); break;
|
||||
case 's': length = slprintf(buffer, 32, "%d", (int) t->s); break;
|
||||
case 'S': length = slprintf(buffer, 32, "%02ld", (long) t->s); break;
|
||||
case 's': length = slprintf(buffer, 32, "%ld", (long) t->s); break;
|
||||
|
||||
case 'a': {
|
||||
if ((int) t->days != -99999) {
|
||||
|
||||
@@ -82,6 +82,8 @@ PHP_FUNCTION(timezone_abbreviations_list);
|
||||
PHP_FUNCTION(timezone_version_get);
|
||||
|
||||
PHP_METHOD(DateInterval, __construct);
|
||||
PHP_METHOD(DateInterval, __wakeup);
|
||||
PHP_METHOD(DateInterval, __set_state);
|
||||
PHP_FUNCTION(date_interval_format);
|
||||
PHP_FUNCTION(date_interval_create_from_date_string);
|
||||
|
||||
|
||||
@@ -8,10 +8,7 @@ date.timezone=UTC
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!method_exists('DateInterval', 'format')) die("skip: method doesn't exist");
|
||||
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
|
||||
?>
|
||||
--XFAIL--
|
||||
Windows VC6 libs' floor()/ceil() choke on floats
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -29,3 +29,5 @@ test_time_spring_type2_post_type2_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT
|
||||
test_time_spring_type2_post_type2_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type2_post_type2_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type2_post_type2_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_stsec_type2_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
|
||||
test_time_spring_type2_dtsec_type2_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
|
||||
@@ -29,3 +29,5 @@ test_time_spring_type2_post_type3_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT
|
||||
test_time_spring_type2_post_type3_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type2_post_type3_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type2_post_type3_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type2_stsec_type3_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
|
||||
test_time_spring_type2_dtsec_type3_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
|
||||
@@ -29,3 +29,5 @@ test_time_spring_type3_post_type2_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT
|
||||
test_time_spring_type3_post_type2_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type3_post_type2_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type3_post_type2_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_stsec_type2_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
|
||||
test_time_spring_type3_dtsec_type2_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
|
||||
@@ -29,3 +29,5 @@ test_time_spring_type3_post_type3_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT
|
||||
test_time_spring_type3_post_type3_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
|
||||
test_time_spring_type3_post_type3_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
|
||||
test_time_spring_type3_post_type3_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
|
||||
test_time_spring_type3_stsec_type3_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
|
||||
test_time_spring_type3_dtsec_type3_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
|
||||
Loaded 100 of 827 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user