mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-12 11:40:50 +00:00
Compare commits
1413
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3aacc966e2 | ||
|
|
71be1ed5f1 | ||
|
|
1c6896076f | ||
|
|
6a2d265af6 | ||
|
|
6fe9c3735a | ||
|
|
5d43cf4ec4 | ||
|
|
8b3b1eb121 | ||
|
|
836a7b1a88 | ||
|
|
c26edafb17 | ||
|
|
a9bf810ba2 | ||
|
|
a737e92b08 | ||
|
|
54ae55a949 | ||
|
|
5ab53094fa | ||
|
|
aff24aed0d | ||
|
|
b915644ec4 | ||
|
|
28c71a667a | ||
|
|
d45c4f86d3 | ||
|
|
8060534f63 | ||
|
|
80bdf7eae5 | ||
|
|
2dad2b3882 | ||
|
|
aa0a80bea8 | ||
|
|
dec171c4bf | ||
|
|
6d5779844f | ||
|
|
94ed0368b9 | ||
|
|
6c8d9c8c8e | ||
|
|
9de0be49d6 | ||
|
|
5a76218edd | ||
|
|
d84c321376 | ||
|
|
b3262ff512 | ||
|
|
a825563c0b | ||
|
|
da476e0da9 | ||
|
|
46107c39a4 | ||
|
|
a263d88c81 | ||
|
|
9158cd2494 | ||
|
|
2e98f2dd1a | ||
|
|
902b4bda6a | ||
|
|
87b52bb5cd | ||
|
|
e6199b5279 | ||
|
|
e7f995106c | ||
|
|
3bcb1f3af1 | ||
|
|
13a652c81c | ||
|
|
5ddd062e36 | ||
|
|
4bedc6bb31 | ||
|
|
70f94e52ea | ||
|
|
87c3363fa9 | ||
|
|
ca1dc06e04 | ||
|
|
b5ed0a1d3d | ||
|
|
19c8eeb4e8 | ||
|
|
293e62c99d | ||
|
|
2da7dd5982 | ||
|
|
6325b1b630 | ||
|
|
9244e0eee1 | ||
|
|
712d951ffc | ||
|
|
40773632e0 | ||
|
|
88628a2319 | ||
|
|
31120ba5f7 | ||
|
|
75276870db | ||
|
|
fc0b122460 | ||
|
|
d976c362ac | ||
|
|
6c82c26884 | ||
|
|
a0ef3e1865 | ||
|
|
4f91645642 | ||
|
|
46b2bef868 | ||
|
|
26319ee1a1 | ||
|
|
42a8242676 | ||
|
|
57ab773c70 | ||
|
|
219364ee55 | ||
|
|
8b5fc29c7a | ||
|
|
21f4b69b2b | ||
|
|
f76ce400eb | ||
|
|
16204148bb | ||
|
|
1f2d017ae1 | ||
|
|
1b10ad424a | ||
|
|
3e65f6bf57 | ||
|
|
f84d03b2bc | ||
|
|
2db28891e4 | ||
|
|
7adc26fd8b | ||
|
|
fe80df5446 | ||
|
|
8588815ef3 | ||
|
|
a70fc67b0b | ||
|
|
b5c53ae6c7 | ||
|
|
3d018fb061 | ||
|
|
3845e2c145 | ||
|
|
1930c2c33b | ||
|
|
1e2b92b517 | ||
|
|
983fa5a21e | ||
|
|
3ecbb5c314 | ||
|
|
8fa1628958 | ||
|
|
e52b580cad | ||
|
|
4b28e0a8f1 | ||
|
|
91f5ceb3be | ||
|
|
603758b484 | ||
|
|
b6b575c1d5 | ||
|
|
e2f3142c78 | ||
|
|
7623887079 | ||
|
|
1bd6ec4c91 | ||
|
|
33a6aefce8 | ||
|
|
d3f8aaecd8 | ||
|
|
049cca1711 | ||
|
|
a40df45348 | ||
|
|
8f42eaae01 | ||
|
|
ebeefd9f7d | ||
|
|
646f9a4a8b | ||
|
|
b4fa1661af | ||
|
|
ba3c63dbc9 | ||
|
|
350535d498 | ||
|
|
467caa4307 | ||
|
|
01b6956d61 | ||
|
|
61c3a669b4 | ||
|
|
befb6e9b80 | ||
|
|
35e43dabe1 | ||
|
|
b905779950 | ||
|
|
04c32887f1 | ||
|
|
e0a39d68d8 | ||
|
|
92ec8541c1 | ||
|
|
82a7ef78f3 | ||
|
|
236c42c14e | ||
|
|
b8fdc56a8b | ||
|
|
17ad61bd7f | ||
|
|
ec1507ea9d | ||
|
|
69bd1f31fd | ||
|
|
b9d4af72e9 | ||
|
|
fbbc036830 | ||
|
|
c2b0fdd647 | ||
|
|
3706b626fe | ||
|
|
edbfc48fdd | ||
|
|
59c6886c65 | ||
|
|
8091552925 | ||
|
|
1916223883 | ||
|
|
f2377c4d1f | ||
|
|
f20849d12e | ||
|
|
cfc8accd3e | ||
|
|
f6eb507b2c | ||
|
|
a75608c1de | ||
|
|
5a9875f293 | ||
|
|
546e5bbc43 | ||
|
|
90f151470c | ||
|
|
edce707f3b | ||
|
|
446f4d1bc2 | ||
|
|
d673ec0184 | ||
|
|
28d72ce2fd | ||
|
|
51ae1cc7bd | ||
|
|
12c826c2e7 | ||
|
|
c4bf45e39a | ||
|
|
2ec89aa8e1 | ||
|
|
c18badbfbf | ||
|
|
1ea22c9004 | ||
|
|
399e2ca69f | ||
|
|
cfb84391d0 | ||
|
|
bfd3c9ecfb | ||
|
|
d64a00da04 | ||
|
|
971fcd4254 | ||
|
|
f61dbf06a1 | ||
|
|
0b9d614988 | ||
|
|
6284b34e6e | ||
|
|
ad2b89c9a3 | ||
|
|
196259d334 | ||
|
|
ae40d0ef2a | ||
|
|
e532feb29c | ||
|
|
905fbfd85e | ||
|
|
ddb32b11b2 | ||
|
|
11371cd0a8 | ||
|
|
7daa1cfecc | ||
|
|
a8996a8ac6 | ||
|
|
0ad4c5037c | ||
|
|
334ddd1248 | ||
|
|
14a61929b9 | ||
|
|
08486a0ea3 | ||
|
|
83e4bb727b | ||
|
|
c401890d17 | ||
|
|
0eef82a733 | ||
|
|
0e8de752fd | ||
|
|
8c075de7c7 | ||
|
|
268d3d7ba3 | ||
|
|
bc69bdb01a | ||
|
|
7af08c0c34 | ||
|
|
cd75bd4f65 | ||
|
|
a14c66445a | ||
|
|
1e6ccabd5f | ||
|
|
d6c0fdfd2f | ||
|
|
4ebcb2ecfe | ||
|
|
ed6ebf011b | ||
|
|
d46f8078f5 | ||
|
|
a0957e24b7 | ||
|
|
b52f7a01af | ||
|
|
e563b4eafa | ||
|
|
cd732f1a3f | ||
|
|
e5cfb1d05c | ||
|
|
41b639fffe | ||
|
|
69e20cf219 | ||
|
|
79c28f7618 | ||
|
|
c176a0ae20 | ||
|
|
f28b063c28 | ||
|
|
e080db4303 | ||
|
|
5e605e6dc2 | ||
|
|
9db1075c0e | ||
|
|
1d89ed6ee3 | ||
|
|
5201e62d0d | ||
|
|
c144fdf680 | ||
|
|
a2592aa5fb | ||
|
|
1b4e0b81e3 | ||
|
|
b5aa8db6a3 | ||
|
|
8ad22e4279 | ||
|
|
ea5dc3d577 | ||
|
|
7f7f566318 | ||
|
|
2ba792cd0b | ||
|
|
c884ad017c | ||
|
|
82b4d74fd4 | ||
|
|
f51ff68dfa | ||
|
|
8989a96789 | ||
|
|
447223f48a | ||
|
|
d5fc8152f3 | ||
|
|
a41a54f7fa | ||
|
|
c5b9577df8 | ||
|
|
beb3674b7a | ||
|
|
0f2c97f627 | ||
|
|
a92af73136 | ||
|
|
ac3b484388 | ||
|
|
c3e9cd9c91 | ||
|
|
ae5301c5d5 | ||
|
|
2ba0608e48 | ||
|
|
e8f984d77a | ||
|
|
76766f2d31 | ||
|
|
d24e005477 | ||
|
|
e0fe48e8a0 | ||
|
|
2067ce4079 | ||
|
|
bdfd8c60ea | ||
|
|
81dbc2fcef | ||
|
|
690ca62dd3 | ||
|
|
0850c7a348 | ||
|
|
8f435013ff | ||
|
|
2aa678b088 | ||
|
|
ed7d1e82c6 | ||
|
|
b163696106 | ||
|
|
da2a1977b5 | ||
|
|
77804efa77 | ||
|
|
d1efeb2e58 | ||
|
|
16e2d61435 | ||
|
|
98672f41ba | ||
|
|
53bf5ccbea | ||
|
|
91f0369c80 | ||
|
|
46e9abe602 | ||
|
|
99b5263afd | ||
|
|
962b593455 | ||
|
|
d200a703e7 | ||
|
|
3bb7e73656 | ||
|
|
59d55efb17 | ||
|
|
ff716cbd3e | ||
|
|
9e5ea7d229 | ||
|
|
a27d5d842a | ||
|
|
4eccf848ec | ||
|
|
b33f7ab671 | ||
|
|
f125cb60cc | ||
|
|
42f7b8026c | ||
|
|
5aa568254a | ||
|
|
2f94546824 | ||
|
|
a4032b68c6 | ||
|
|
e4e71fd8ba | ||
|
|
476c9a3b3d | ||
|
|
81abbc66fc | ||
|
|
ca14c9b1af | ||
|
|
56b153390b | ||
|
|
9e187415f9 | ||
|
|
f063bdec06 | ||
|
|
dc701bfdab | ||
|
|
391cbac1f2 | ||
|
|
18cd69ef74 | ||
|
|
8327d4e2bd | ||
|
|
2b216967f2 | ||
|
|
d632106e6e | ||
|
|
279770743f | ||
|
|
869a90f015 | ||
|
|
ef81373201 | ||
|
|
e276023d82 | ||
|
|
4ea8f4b9f2 | ||
|
|
c055a54343 | ||
|
|
a3bd8bcd7b | ||
|
|
8f2686df35 | ||
|
|
a2c24ae90e | ||
|
|
dc66fb1f10 | ||
|
|
7fcfa8865e | ||
|
|
d9226a1dd0 | ||
|
|
1fb65c4c29 | ||
|
|
24ec6e5a5c | ||
|
|
8957eac122 | ||
|
|
907bdcbc7e | ||
|
|
a99e4b5969 | ||
|
|
d3de81fb00 | ||
|
|
3df3aedbe0 | ||
|
|
de8b457181 | ||
|
|
9219b746bb | ||
|
|
43b4b086db | ||
|
|
0e6607aa51 | ||
|
|
536e7448f6 | ||
|
|
f4f844af19 | ||
|
|
f0903895c1 | ||
|
|
8586e6505f | ||
|
|
2f7c5d30b5 | ||
|
|
6cc2073d91 | ||
|
|
6d182a8456 | ||
|
|
6910e6432a | ||
|
|
851b6d4475 | ||
|
|
0c72b185fd | ||
|
|
cfbf5b24b7 | ||
|
|
cf8a8a3189 | ||
|
|
96a8b63865 | ||
|
|
ad2651a74a | ||
|
|
23d71171cf | ||
|
|
5232a5afea | ||
|
|
6527a454c6 | ||
|
|
c9908cf81d | ||
|
|
585628ba67 | ||
|
|
47c72816d3 | ||
|
|
4fec06587b | ||
|
|
0f5e09c192 | ||
|
|
98e59d58ba | ||
|
|
350e5aa862 | ||
|
|
196506caa1 | ||
|
|
7c7c353b1e | ||
|
|
f91395898c | ||
|
|
e48d127244 | ||
|
|
313c153274 | ||
|
|
0a896dd987 | ||
|
|
73060a89ee | ||
|
|
afc5a6145c | ||
|
|
2cc63714a0 | ||
|
|
533cdf740f | ||
|
|
2b21476207 | ||
|
|
1d7a4ed492 | ||
|
|
d26ddca966 | ||
|
|
495925381e | ||
|
|
cb4612c735 | ||
|
|
ac772dcf53 | ||
|
|
e73d498947 | ||
|
|
7fefbbb177 | ||
|
|
e1519d6f17 | ||
|
|
c84c5640e7 | ||
|
|
6b3cda310a | ||
|
|
8a3975191e | ||
|
|
a312bb5ee3 | ||
|
|
ad568aab6f | ||
|
|
c8c0ddb73d | ||
|
|
1fb48b5091 | ||
|
|
216c8ffdcd | ||
|
|
15fa07f0f6 | ||
|
|
22fa023c88 | ||
|
|
9873fa5e42 | ||
|
|
37b73ad2d4 | ||
|
|
c29704e066 | ||
|
|
493b89c3b1 | ||
|
|
39a690321a | ||
|
|
50ac5db2b4 | ||
|
|
1e3854597c | ||
|
|
d0c4b3d3ec | ||
|
|
b9fc9a6ad1 | ||
|
|
af5501027f | ||
|
|
7318238236 | ||
|
|
4da11644de | ||
|
|
c756609658 | ||
|
|
eb0cb6f6ed | ||
|
|
2784cf206d | ||
|
|
eefdd0ea49 | ||
|
|
17a363a8f8 | ||
|
|
e8e4ff0aa1 | ||
|
|
0282ad792a | ||
|
|
622f7679f7 | ||
|
|
36702d5f41 | ||
|
|
bd05792560 | ||
|
|
4213153365 | ||
|
|
f0ffe7c85b | ||
|
|
3e638c84c0 | ||
|
|
ccc580f408 | ||
|
|
1f73efcaab | ||
|
|
4713ce294d | ||
|
|
1f20b7a626 | ||
|
|
d14e259823 | ||
|
|
29a09f984c | ||
|
|
628e5530b9 | ||
|
|
b175cdfd71 | ||
|
|
49fb6260b6 | ||
|
|
b8c9e83664 | ||
|
|
4ea43fe019 | ||
|
|
202d2990a9 | ||
|
|
3fc91aff97 | ||
|
|
0bdbbd379e | ||
|
|
ceb70dbc68 | ||
|
|
f05924db37 | ||
|
|
6f47156228 | ||
|
|
ff5b2d27ae | ||
|
|
1b40042b35 | ||
|
|
bcca5b8cb5 | ||
|
|
3838fb99de | ||
|
|
1b80f44cf1 | ||
|
|
d7e86a5669 | ||
|
|
8217b64a33 | ||
|
|
9c1e668593 | ||
|
|
b4ae74ae2c | ||
|
|
9304645cf3 | ||
|
|
84d9651b61 | ||
|
|
f0468116c0 | ||
|
|
fb5cb59035 | ||
|
|
14deb9dd04 | ||
|
|
ff5fca9aa0 | ||
|
|
216eb9f82b | ||
|
|
93bf6517df | ||
|
|
120625548d | ||
|
|
a6276a2414 | ||
|
|
9579de34d7 | ||
|
|
85c9a200fa | ||
|
|
2c97bc2632 | ||
|
|
f9cec029c8 | ||
|
|
a37ffd814d | ||
|
|
0e443166e0 | ||
|
|
f1a4a14ccb | ||
|
|
ceb73ca019 | ||
|
|
89ee6b45ad | ||
|
|
f4777d14e3 | ||
|
|
0223de2c39 | ||
|
|
38030dac08 | ||
|
|
5be358667b | ||
|
|
02032ccf9f | ||
|
|
40b17e6c5c | ||
|
|
bf4af0f4ca | ||
|
|
86aecbbe31 | ||
|
|
f7ca8821b2 | ||
|
|
176f6d8e6e | ||
|
|
c59be44de1 | ||
|
|
39edbe5192 | ||
|
|
6b35037ca2 | ||
|
|
98a6986d97 | ||
|
|
db9f1fafa5 | ||
|
|
b027552ca3 | ||
|
|
5b565c1eb1 | ||
|
|
27a4b575e8 | ||
|
|
cb0b01f7c2 | ||
|
|
a0ebaab052 | ||
|
|
e78e1dd5e8 | ||
|
|
58483c8776 | ||
|
|
472de86f8d | ||
|
|
86953ab0f5 | ||
|
|
0ede231c76 | ||
|
|
6f34d891f5 | ||
|
|
2e19f82a7f | ||
|
|
ff3a363d7a | ||
|
|
302fd9a77f | ||
|
|
5a8a9a59e2 | ||
|
|
95910aa26c | ||
|
|
9b8eee74d9 | ||
|
|
20b60f49d9 | ||
|
|
21315c08b7 | ||
|
|
374ac86e33 | ||
|
|
f6354c3a1a | ||
|
|
9e970ef9a8 | ||
|
|
22dfb88bf1 | ||
|
|
3be22062fa | ||
|
|
e9125d6338 | ||
|
|
5b0f34ae80 | ||
|
|
7d04465b74 | ||
|
|
1d82c42493 | ||
|
|
846c5a252e | ||
|
|
468ae7b88a | ||
|
|
cae0fd23f0 | ||
|
|
fda04a0ed3 | ||
|
|
17da85ba9b | ||
|
|
4a7962b31f | ||
|
|
33d72ede4e | ||
|
|
a2ea2d7173 | ||
|
|
18fa78842d | ||
|
|
e54165e406 | ||
|
|
e11b518c95 | ||
|
|
2e7e8f30fc | ||
|
|
f7ce70672c | ||
|
|
bd2ddd9fae | ||
|
|
56ca01da1f | ||
|
|
8b861ec798 | ||
|
|
43db887482 | ||
|
|
39729083ee | ||
|
|
bd818c0118 | ||
|
|
a865b5d0c7 | ||
|
|
09ee88f9bf | ||
|
|
71e0c354ff | ||
|
|
32fd0f3ffa | ||
|
|
478aff5c22 | ||
|
|
73124c04be | ||
|
|
d4070174d8 | ||
|
|
d87e221f44 | ||
|
|
918d45198a | ||
|
|
8c5c17c3a1 | ||
|
|
1f31e7ddea | ||
|
|
ba2b5623c3 | ||
|
|
7171429f21 | ||
|
|
5f53ee1537 | ||
|
|
6b02a01c20 | ||
|
|
850c6a27f6 | ||
|
|
915a990330 | ||
|
|
6544f8d47e | ||
|
|
e389e255e6 | ||
|
|
23813d603c | ||
|
|
54bbe548fe | ||
|
|
c59471cd1f | ||
|
|
2e3b9ec278 | ||
|
|
27344aaed6 | ||
|
|
f964cc09d2 | ||
|
|
9797f49466 | ||
|
|
0aceba0a8d | ||
|
|
a8ced60e04 | ||
|
|
9d76829963 | ||
|
|
0ef420a71e | ||
|
|
877ecb3c81 | ||
|
|
7489718769 | ||
|
|
df71910d0e | ||
|
|
844e7eb945 | ||
|
|
e51105c6a6 | ||
|
|
b369925372 | ||
|
|
ab34eb7330 | ||
|
|
d470f93506 | ||
|
|
bca3e30484 | ||
|
|
5a9d648f1f | ||
|
|
edae935c26 | ||
|
|
7f887852a6 | ||
|
|
99a0504a6b | ||
|
|
2b3e184245 | ||
|
|
e3e7ef94a5 | ||
|
|
6f5c0992a3 | ||
|
|
dd9ac710f1 | ||
|
|
81efd46186 | ||
|
|
97dee3a8c2 | ||
|
|
b59d5af951 | ||
|
|
190227899a | ||
|
|
de58df089f | ||
|
|
07e4ab6946 | ||
|
|
b5daf7078e | ||
|
|
9cc4fb18b6 | ||
|
|
429bce6519 | ||
|
|
6ef90672d8 | ||
|
|
2fbfcd7482 | ||
|
|
17df3ec21b | ||
|
|
c50a4252cd | ||
|
|
7dc95709c8 | ||
|
|
2e73bbfdc1 | ||
|
|
70bd032076 | ||
|
|
d13d9c6047 | ||
|
|
d2a8d5a80f | ||
|
|
4d232fb17c | ||
|
|
7a87af3321 | ||
|
|
c7a2cf7385 | ||
|
|
16a53a00ea | ||
|
|
7f44f8ee94 | ||
|
|
cf75eb8a6f | ||
|
|
402de24fc4 | ||
|
|
b7ecaca17f | ||
|
|
ff1cbb8460 | ||
|
|
737bc357cb | ||
|
|
0c762dff03 | ||
|
|
2685fad6b7 | ||
|
|
9280b88a8c | ||
|
|
d782abf416 | ||
|
|
2917ff1e7d | ||
|
|
ce3891347f | ||
|
|
6304e5d7cb | ||
|
|
1360e3478c | ||
|
|
6873d6839d | ||
|
|
ff0ee48537 | ||
|
|
7916ef2ee1 | ||
|
|
146255f35c | ||
|
|
c6dff79138 | ||
|
|
32956a25bf | ||
|
|
a4f03b8086 | ||
|
|
e6551f081d | ||
|
|
02884a08f5 | ||
|
|
6704ab4b35 | ||
|
|
db90fc4c90 | ||
|
|
1e36c786ae | ||
|
|
5b71225f1b | ||
|
|
396bf39311 | ||
|
|
81b3231b5d | ||
|
|
9926a97e26 | ||
|
|
0b0c5d3fac | ||
|
|
ef9878647d | ||
|
|
e4c5e85697 | ||
|
|
bd892a164b | ||
|
|
c495c54069 | ||
|
|
e410a0f5b1 | ||
|
|
4760dd4fc5 | ||
|
|
794065776a | ||
|
|
ad99c124c4 | ||
|
|
bed3f4ce0b | ||
|
|
ad57096a8b | ||
|
|
6f7d0b2a6a | ||
|
|
a4de015ec7 | ||
|
|
055848d83a | ||
|
|
8b1fca9e3a | ||
|
|
d39117c234 | ||
|
|
35494bb569 | ||
|
|
ce5e317cc5 | ||
|
|
e136b9311c | ||
|
|
8d9c384f7f | ||
|
|
b4ef3d186a | ||
|
|
84cfbe5efe | ||
|
|
e872491f80 | ||
|
|
88942c9834 | ||
|
|
553698f35d | ||
|
|
758b7f1ad4 | ||
|
|
4d01a5c2d1 | ||
|
|
1ee89e1bea | ||
|
|
518cf77f32 | ||
|
|
dc57cff2a6 | ||
|
|
3a168b52e7 | ||
|
|
342d7b6968 | ||
|
|
df5396677d | ||
|
|
8eac91345b | ||
|
|
b20be6a27b | ||
|
|
640bed4cf5 | ||
|
|
40ab777dc8 | ||
|
|
25049d6cf8 | ||
|
|
9462eb6db5 | ||
|
|
fbccd1438c | ||
|
|
597124e128 | ||
|
|
500922f9a2 | ||
|
|
e419d735c4 | ||
|
|
3a5e5ca4d4 | ||
|
|
798d437b05 | ||
|
|
a53edd047e | ||
|
|
5e408e4ee9 | ||
|
|
42bc9637b2 | ||
|
|
b9bb0d77a0 | ||
|
|
d8d7dd7e14 | ||
|
|
37d8a82b4d | ||
|
|
c6773a06cd | ||
|
|
64f0ec7bde | ||
|
|
8f5b212612 | ||
|
|
ed83c5bee5 | ||
|
|
27c3c301bd | ||
|
|
bf48daa8d5 | ||
|
|
126531a44b | ||
|
|
cb1e4ab6c8 | ||
|
|
bc7ad69fbc | ||
|
|
f30b95fcf0 | ||
|
|
981948641c | ||
|
|
aaa7263bdd | ||
|
|
3d9c47eed0 | ||
|
|
9cccfa57b6 | ||
|
|
221710e820 | ||
|
|
f0a001a953 | ||
|
|
41784bfcff | ||
|
|
e0ac3f66ae | ||
|
|
4cdf143184 | ||
|
|
19d0283ce8 | ||
|
|
44de5a0e8e | ||
|
|
43a04beb46 | ||
|
|
afb3979882 | ||
|
|
ebd608ba18 | ||
|
|
7f6343e60d | ||
|
|
e155ad208a | ||
|
|
15fb957c61 | ||
|
|
5023a7c61c | ||
|
|
726e188cce | ||
|
|
42a2b22a4a | ||
|
|
9cfeb25667 | ||
|
|
e596466a1f | ||
|
|
b7b7bedabd | ||
|
|
c22cb0477c | ||
|
|
3366916203 | ||
|
|
1c2b47c408 | ||
|
|
b7784d96b0 | ||
|
|
cf33729c20 | ||
|
|
f8d045619a | ||
|
|
3ec72d3ed9 | ||
|
|
d16625b803 | ||
|
|
aafb2b1581 | ||
|
|
38eb52b8a7 | ||
|
|
892ec5f535 | ||
|
|
e3e2370490 | ||
|
|
04ccc0134d | ||
|
|
76b7b5d1e2 | ||
|
|
ee9cc68848 | ||
|
|
38ef28e41b | ||
|
|
af2aa721df | ||
|
|
40b04cd54b | ||
|
|
0d6aa20880 | ||
|
|
fbbb41a53b | ||
|
|
e770b2b411 | ||
|
|
d55e20660b | ||
|
|
0699938bc4 | ||
|
|
dcb0ee6ec4 | ||
|
|
d9decf0dfc | ||
|
|
fa1b0a51d3 | ||
|
|
9d6c259988 | ||
|
|
9f5e4a19be | ||
|
|
28aca30c13 | ||
|
|
04c35e3d91 | ||
|
|
e7c72f8455 | ||
|
|
08ce920c9e | ||
|
|
0a242a52b3 | ||
|
|
fd90645613 | ||
|
|
862247693f | ||
|
|
c98a99c263 | ||
|
|
676dfcf581 | ||
|
|
f4b5abc948 | ||
|
|
56abe4de4a | ||
|
|
38a409c02f | ||
|
|
129997216b | ||
|
|
ee1241ab1a | ||
|
|
7c5c0fbbea | ||
|
|
074ba3fbc0 | ||
|
|
5a4c3234b9 | ||
|
|
fd7a92f046 | ||
|
|
a5a908c4bf | ||
|
|
1a91f75193 | ||
|
|
641f2c0c40 | ||
|
|
c328a15469 | ||
|
|
3dddc0bade | ||
|
|
b5f8bd8e9e | ||
|
|
c11d6ca38b | ||
|
|
bbcf09a833 | ||
|
|
e8abbca3a6 | ||
|
|
fd6b885a19 | ||
|
|
6cd27ff8be | ||
|
|
a0b3e87003 | ||
|
|
7a214b66ae | ||
|
|
741e31bdf3 | ||
|
|
777484b561 | ||
|
|
f7de5001e2 | ||
|
|
8759648192 | ||
|
|
4116d9fb0e | ||
|
|
681ded13bc | ||
|
|
29cfd6d24f | ||
|
|
d94136fc30 | ||
|
|
bd29f379e7 | ||
|
|
65e1741d2d | ||
|
|
46eb5401e7 | ||
|
|
aecad9e37b | ||
|
|
cb1239a338 | ||
|
|
007a076cd0 | ||
|
|
c8e72410be | ||
|
|
8d9ced8282 | ||
|
|
f02fb4ada4 | ||
|
|
6882000c53 | ||
|
|
8233053d24 | ||
|
|
5f4cfcb009 | ||
|
|
d80297b251 | ||
|
|
2e4c3ea35f | ||
|
|
c4ca0f3378 | ||
|
|
b54a4dfeeb | ||
|
|
bdd4b84c29 | ||
|
|
df69bf6c06 | ||
|
|
9ec5c3526e | ||
|
|
caed65f547 | ||
|
|
71728cc2b2 | ||
|
|
da26db3054 | ||
|
|
17d009c3b4 | ||
|
|
e37b622d3f | ||
|
|
2a9fa24458 | ||
|
|
85e3a1bc3b | ||
|
|
f76725902b | ||
|
|
b949bfe651 | ||
|
|
70f06be16a | ||
|
|
a97e1a6646 | ||
|
|
3e0cbfb077 | ||
|
|
b1efed9dde | ||
|
|
e489d93abc | ||
|
|
3b64493a3d | ||
|
|
3455498219 | ||
|
|
0460174a0d | ||
|
|
c9f736ab6e | ||
|
|
5a9864ed2b | ||
|
|
940c896e15 | ||
|
|
2e36e9d06d | ||
|
|
636cc3e1dc | ||
|
|
7d40971563 | ||
|
|
2e281baab9 | ||
|
|
12acb64696 | ||
|
|
2653f34210 | ||
|
|
4d7b0e114d | ||
|
|
b094db390e | ||
|
|
d4c5556b8b | ||
|
|
fd73439882 | ||
|
|
0a38683b14 | ||
|
|
cceecdbcdb | ||
|
|
427561446f | ||
|
|
cf4127b6b9 | ||
|
|
dd84731577 | ||
|
|
26eaab7641 | ||
|
|
79c513db96 | ||
|
|
255a5a8a5b | ||
|
|
d6c4dee168 | ||
|
|
1b1ced539b | ||
|
|
684be9cf36 | ||
|
|
3a4f33e31f | ||
|
|
7d15d8cc3e | ||
|
|
9e9576ecfa | ||
|
|
a937ae4762 | ||
|
|
77c75e786b | ||
|
|
425ae98916 | ||
|
|
7bbe13ac4d | ||
|
|
915e9a555e | ||
|
|
d049b24dfd | ||
|
|
59727034b7 | ||
|
|
bb88a86240 | ||
|
|
ed5ce047db | ||
|
|
fbd3e0da40 | ||
|
|
251b627684 | ||
|
|
6d7346f4b9 | ||
|
|
57cf4805a9 | ||
|
|
9e3956b313 | ||
|
|
92c72cb8d8 | ||
|
|
72d12fb320 | ||
|
|
66181dde3b | ||
|
|
e97f733515 | ||
|
|
5b4dc50c01 | ||
|
|
01e92c81e7 | ||
|
|
d24465ba8a | ||
|
|
50260570b4 | ||
|
|
0821f8f7d9 | ||
|
|
f7f966f96f | ||
|
|
6571a32c87 | ||
|
|
fbb28b36b7 | ||
|
|
b30bc204c9 | ||
|
|
aa7454aba4 | ||
|
|
950ddcc9c2 | ||
|
|
88a02ba159 | ||
|
|
c0be906309 | ||
|
|
d6ba95c618 | ||
|
|
ca5c6a1e91 | ||
|
|
8428d0088c | ||
|
|
afc9cb151b | ||
|
|
b4939dfa9a | ||
|
|
ecfd014357 | ||
|
|
8e52e04c30 | ||
|
|
40a9fd5f76 | ||
|
|
05a9f544a7 | ||
|
|
2d6770f0e6 | ||
|
|
8de360fdbe | ||
|
|
bd92164eff | ||
|
|
69b712410b | ||
|
|
500f634db9 | ||
|
|
4f77a021ce | ||
|
|
1842676706 | ||
|
|
9540037bb7 | ||
|
|
97d91c7656 | ||
|
|
d3b364fdc7 | ||
|
|
7f9a606b62 | ||
|
|
68c22fba72 | ||
|
|
428e722d88 | ||
|
|
dbe02eff78 | ||
|
|
33cd5e9b43 | ||
|
|
2224276a13 | ||
|
|
9518107e8e | ||
|
|
b0d27f9e85 | ||
|
|
9a50bd2de1 | ||
|
|
3988ee2df9 | ||
|
|
5cbb4ab242 | ||
|
|
468e834ef1 | ||
|
|
a4c3c3cd47 | ||
|
|
f11d064b6a | ||
|
|
9557b4013a | ||
|
|
d3fda74acf | ||
|
|
6e9c4b3125 | ||
|
|
f8518cc83a | ||
|
|
6f8233897e | ||
|
|
ca47676650 | ||
|
|
7b54f02f25 | ||
|
|
399022f3c5 | ||
|
|
255d87b1b8 | ||
|
|
c9dc23da36 | ||
|
|
28eaa612c1 | ||
|
|
f7afbb9370 | ||
|
|
c7b2568269 | ||
|
|
629a25643c | ||
|
|
a6feb3f405 | ||
|
|
26fea0bd80 | ||
|
|
96132bf4fe | ||
|
|
55ec6950ce | ||
|
|
0953c573ad | ||
|
|
6686b3f722 | ||
|
|
ce05cea7ee | ||
|
|
bfcc12ef78 | ||
|
|
bfc3e689de | ||
|
|
5927a5eb18 | ||
|
|
7388b6b9ac | ||
|
|
af7d85db25 | ||
|
|
592ee79fc1 | ||
|
|
5b5207292b | ||
|
|
8f306fd749 | ||
|
|
c6bec7db3b | ||
|
|
74ab20817a | ||
|
|
0dae58bb2a | ||
|
|
35bdc36c5b | ||
|
|
a9070ba130 | ||
|
|
635052875e | ||
|
|
3e038d4398 | ||
|
|
18d9462a22 | ||
|
|
0180c36951 | ||
|
|
962ab19c99 | ||
|
|
7bddbd7bd0 | ||
|
|
fd0ec1cb45 | ||
|
|
4a645e09af | ||
|
|
263723ec9b | ||
|
|
d056b25c3f | ||
|
|
5b5b10f0ca | ||
|
|
c921ceb49c | ||
|
|
d6838a86f3 | ||
|
|
46f2330c19 | ||
|
|
adeb21cd8e | ||
|
|
711422e1e4 | ||
|
|
173cf83629 | ||
|
|
92d87a6a8d | ||
|
|
8ca144bba5 | ||
|
|
b39a1e5195 | ||
|
|
fc4500f7ec | ||
|
|
c122763bc0 | ||
|
|
e72a305091 | ||
|
|
3317070941 | ||
|
|
6a4e1fff78 | ||
|
|
4d5ce8cd08 | ||
|
|
9216b3d182 | ||
|
|
17a4cea930 | ||
|
|
f571b188f9 | ||
|
|
5fbad6bed5 | ||
|
|
ecf8650a36 | ||
|
|
5c9d3842bd | ||
|
|
d14b94b8df | ||
|
|
11be5f887b | ||
|
|
91e9545f4f | ||
|
|
6f699cea5f | ||
|
|
bf87bf816c | ||
|
|
56d7d95c67 | ||
|
|
e349a5e41d | ||
|
|
94ff299736 | ||
|
|
af03ecf9e1 | ||
|
|
65ecfc28cf | ||
|
|
66f14d696e | ||
|
|
7f01ec57bf | ||
|
|
9aab7d7cdf | ||
|
|
a9bdb2ed88 | ||
|
|
74f21310e3 | ||
|
|
6fd3a52665 | ||
|
|
e81addb5ca | ||
|
|
4b4fae6aa4 | ||
|
|
239ae7b5fc | ||
|
|
bf5f758c93 | ||
|
|
17d544632e | ||
|
|
38795b88ed | ||
|
|
1ee2b46d2f | ||
|
|
1721e5d44e | ||
|
|
69e792ee7b | ||
|
|
1e264fc509 | ||
|
|
4cdc3117c7 | ||
|
|
63a490cd90 | ||
|
|
738aa1099f | ||
|
|
027d450166 | ||
|
|
b97ecc1820 | ||
|
|
1335bc8fb8 | ||
|
|
99b6724a4c | ||
|
|
e44c06c14e | ||
|
|
953a09969f | ||
|
|
32321488ab | ||
|
|
11690da164 | ||
|
|
c56ca79733 | ||
|
|
11ce65aeaf | ||
|
|
7a5380297b | ||
|
|
7f37b3f651 | ||
|
|
c896fa34a8 | ||
|
|
e1cd098925 | ||
|
|
e780c42f21 | ||
|
|
c527cc8708 | ||
|
|
80fd6dcaa4 | ||
|
|
1f22d848e9 | ||
|
|
e744a448ab | ||
|
|
b526220462 | ||
|
|
5ffeb236f4 | ||
|
|
e7d225fda8 | ||
|
|
54e5ad6b6e | ||
|
|
af96ad84b5 | ||
|
|
210244b339 | ||
|
|
c452e275e7 | ||
|
|
be901ebeaf | ||
|
|
e058626c66 | ||
|
|
9238d1bbbc | ||
|
|
5fff6fa361 | ||
|
|
c5abb9b24c | ||
|
|
286f75c891 | ||
|
|
8116ba4249 | ||
|
|
5b755c40ea | ||
|
|
87a9f7bdbb | ||
|
|
1ccf8dde15 | ||
|
|
94c44ea9eb | ||
|
|
df14ec2fe2 | ||
|
|
a4e94e33b3 | ||
|
|
4e4d861046 | ||
|
|
f977f8a90b | ||
|
|
399073f9d4 | ||
|
|
fa2e902436 | ||
|
|
43aed8f70b | ||
|
|
858fc0015f | ||
|
|
191a661f8c | ||
|
|
838d30a5cd | ||
|
|
7a11fe48b6 | ||
|
|
9ee23d7066 | ||
|
|
16f8b66e46 | ||
|
|
eba2aa9bd0 | ||
|
|
d5e0742e8d | ||
|
|
f1bad5dab7 | ||
|
|
af17964ef4 | ||
|
|
9da8328bae | ||
|
|
920e4235a4 | ||
|
|
ddfb337577 | ||
|
|
696663bc3d | ||
|
|
91dc1a516a | ||
|
|
73f49c16f4 | ||
|
|
9833b429d6 | ||
|
|
c50726fa4b | ||
|
|
f52e75742b | ||
|
|
8694cd135d | ||
|
|
d641ba3eae | ||
|
|
1b80b33b87 | ||
|
|
03b4f344a0 | ||
|
|
e9920ede1f | ||
|
|
375b5df63d | ||
|
|
c94f0276b0 | ||
|
|
0fb4bf9771 | ||
|
|
206f0da25a | ||
|
|
40c20d3d72 | ||
|
|
d6cb1431ac | ||
|
|
8090684c5a | ||
|
|
242aa98b0a | ||
|
|
142edcf01f | ||
|
|
42f26b6fae | ||
|
|
8a23a020e9 | ||
|
|
bfdcc96274 | ||
|
|
9909a36992 | ||
|
|
c5f8871734 | ||
|
|
04764e1942 | ||
|
|
8e1391ce49 | ||
|
|
844b4738fd | ||
|
|
71f99771b0 | ||
|
|
173782b73e | ||
|
|
65bc57a81f | ||
|
|
e9c3ac04f5 | ||
|
|
39f820b8b8 | ||
|
|
dddbe6f60e | ||
|
|
f726dc7af1 | ||
|
|
5094e4e67c | ||
|
|
be85c9049b | ||
|
|
daa90c915c | ||
|
|
3326b8790e | ||
|
|
bf937669e0 | ||
|
|
73af3afdbe | ||
|
|
398b4a2fbb | ||
|
|
9bf6b05b87 | ||
|
|
7537d97280 | ||
|
|
60292114a0 | ||
|
|
abff9671fb | ||
|
|
544cdffd90 | ||
|
|
20d52aa8dc | ||
|
|
c8c5e8bbe6 | ||
|
|
d58fe0357d | ||
|
|
57049aff26 | ||
|
|
ba43e31e24 | ||
|
|
2ed9c955b8 | ||
|
|
fb25210072 | ||
|
|
1fb0de4a6d | ||
|
|
355678208d | ||
|
|
43e44e4e9f | ||
|
|
c007130382 | ||
|
|
a455d7846d | ||
|
|
14edc95ff8 | ||
|
|
8307c0204c | ||
|
|
1d444f9ad2 | ||
|
|
702ca7f53f | ||
|
|
dda0dd4825 | ||
|
|
4a45a8e948 | ||
|
|
81835bbf47 | ||
|
|
8d8c50fed3 | ||
|
|
0d42248ad8 | ||
|
|
724a221a7b | ||
|
|
c4435ad7b2 | ||
|
|
1c7fdeac21 | ||
|
|
00da44519c | ||
|
|
6ba2e4bc51 | ||
|
|
4774563966 | ||
|
|
d5c6825241 | ||
|
|
245dd7367d | ||
|
|
acc4cd17ce | ||
|
|
3c28fbd6dd | ||
|
|
66f5637723 | ||
|
|
087ed66b69 | ||
|
|
27aee6b1dd | ||
|
|
f0c91bac50 | ||
|
|
ad2471cbbb | ||
|
|
793140873b | ||
|
|
a7ba08a0bd | ||
|
|
d16ad34368 | ||
|
|
e1c7a424ce | ||
|
|
3c84c9c4bd | ||
|
|
2310acb57a | ||
|
|
4f47f33402 | ||
|
|
979da66118 | ||
|
|
254c8d6ce9 | ||
|
|
9d10977fd7 | ||
|
|
2c259a7979 | ||
|
|
33cdc9ed36 | ||
|
|
67502a2e7d | ||
|
|
9b21e0d0a9 | ||
|
|
15bc137fef | ||
|
|
8075d977e1 | ||
|
|
14e2e82cf5 | ||
|
|
ad4755e257 | ||
|
|
f95488a3c9 | ||
|
|
3feae65f70 | ||
|
|
ff66870b4c | ||
|
|
824f9a4d11 | ||
|
|
7bedd9f824 | ||
|
|
4a24cbe276 | ||
|
|
8a91c1d5b8 | ||
|
|
dfa4a5d927 | ||
|
|
ca8dc5aca3 | ||
|
|
7ab7b99ac1 | ||
|
|
6e3b81e385 | ||
|
|
42370213f7 | ||
|
|
84ddc25df6 | ||
|
|
8ccfca0c41 | ||
|
|
3ec166aba4 | ||
|
|
b2913063e0 | ||
|
|
ba863b4558 | ||
|
|
1f932c30d6 | ||
|
|
b91a947d5e | ||
|
|
5d3900a2e9 | ||
|
|
b3cec4d9d4 | ||
|
|
eaa48d3743 | ||
|
|
6b12a45247 | ||
|
|
fdc1b53183 | ||
|
|
9d4f01a8af | ||
|
|
5e8d0919cf | ||
|
|
61144768ed | ||
|
|
a8757b11e6 | ||
|
|
bb276eb8d4 | ||
|
|
1789e67088 | ||
|
|
456c023e83 | ||
|
|
d3a8b31310 | ||
|
|
31de856abb | ||
|
|
d956e33ed2 | ||
|
|
9a10491752 | ||
|
|
fb39035e77 | ||
|
|
e8340dd2c5 | ||
|
|
e32f012e65 | ||
|
|
c534a9e782 | ||
|
|
99a2a59f01 | ||
|
|
7264ffe50d | ||
|
|
f1823e58da | ||
|
|
59f0817205 | ||
|
|
72e2e4fea3 | ||
|
|
84930ecbdf | ||
|
|
0715add65f | ||
|
|
9a98c38cbd | ||
|
|
e09aff93fb | ||
|
|
f2e8c04e8a | ||
|
|
7b1f927ef5 | ||
|
|
1afef889e2 | ||
|
|
4ee4d27cb4 | ||
|
|
338b9bfb2d | ||
|
|
d1aee77c5a | ||
|
|
18fa461119 | ||
|
|
f9c5fc6ecb | ||
|
|
1bee9e12fb | ||
|
|
94ec5c2a64 | ||
|
|
bebddbdd24 | ||
|
|
bf997c3eb3 | ||
|
|
7f5950ffb7 | ||
|
|
3b27b0f18b | ||
|
|
2680fb4a9d | ||
|
|
f1141d79c6 | ||
|
|
794846e5c5 | ||
|
|
8fd505f4b4 | ||
|
|
1ca4aca8fb | ||
|
|
8838b38fcb | ||
|
|
efb62ea35f | ||
|
|
911922432f | ||
|
|
e7eccf10e6 | ||
|
|
ae73e40808 | ||
|
|
4493bbb809 | ||
|
|
2daf7303b2 | ||
|
|
de56cc51a8 | ||
|
|
1c7cfe739d | ||
|
|
b04eb1d3da | ||
|
|
cd7e8bdf8c | ||
|
|
5367158046 | ||
|
|
53b4597fca | ||
|
|
b79e803a43 | ||
|
|
9d86149b01 | ||
|
|
da4f2be35a | ||
|
|
361951bc01 | ||
|
|
95659890ba | ||
|
|
60baea9671 | ||
|
|
b010daa9c4 | ||
|
|
794358f385 | ||
|
|
6f6ef6deed | ||
|
|
7dae9e6cad | ||
|
|
9a6dad867d | ||
|
|
c85843aec1 | ||
|
|
962c8cc9ef | ||
|
|
b2ed70e4e0 | ||
|
|
0956f5133c | ||
|
|
75df505fe6 | ||
|
|
563e9dd664 | ||
|
|
6a6096ec11 | ||
|
|
f712d46b50 | ||
|
|
9dd0826623 | ||
|
|
0d5a3f0b91 | ||
|
|
1eb428e76d | ||
|
|
40bb734452 | ||
|
|
88c17817a9 | ||
|
|
fac9416797 | ||
|
|
1d5a6d3f9f | ||
|
|
002f7ef393 | ||
|
|
72616e6eae | ||
|
|
29273ca7a9 | ||
|
|
dbc60edabf | ||
|
|
f8708f369d | ||
|
|
010c340f29 | ||
|
|
39a43c994e | ||
|
|
d00b6c7c99 | ||
|
|
1c5ea0d7df | ||
|
|
5de30d1066 | ||
|
|
81cfb1b312 | ||
|
|
8ecdc90763 | ||
|
|
9f8ba2e8a1 | ||
|
|
76ae4e10bf | ||
|
|
1ffa3cf65d | ||
|
|
ec4655f864 | ||
|
|
a5c94d0184 | ||
|
|
b4bc994680 | ||
|
|
5230321731 | ||
|
|
b4f64e7f7b | ||
|
|
07266a10ab | ||
|
|
04d178f79c | ||
|
|
1ed6bb3e63 | ||
|
|
9094dd7a5e | ||
|
|
ddb1fdaaa9 | ||
|
|
dddf796edf | ||
|
|
f7fd3a7dcc | ||
|
|
32be6f268b | ||
|
|
904dac52e2 | ||
|
|
585af2418b | ||
|
|
4dc6fe7f62 | ||
|
|
b6321d4e8a | ||
|
|
0d0fffe98b | ||
|
|
2ce2300d76 | ||
|
|
43d3d8a0a4 | ||
|
|
96b6c7f5f8 | ||
|
|
8b15b46aa8 | ||
|
|
afe794c0d6 | ||
|
|
87779f127a | ||
|
|
8b079070a3 | ||
|
|
c29e9277d0 | ||
|
|
75d1e4ca7d | ||
|
|
775387e32d | ||
|
|
5e3b2e3d31 | ||
|
|
31b042714e | ||
|
|
62c80d5e6e | ||
|
|
16a4376f53 | ||
|
|
4da754e868 | ||
|
|
4f855044c7 | ||
|
|
1bf1b64c37 | ||
|
|
f8ff2ccf20 | ||
|
|
dce131ebcd | ||
|
|
1293330175 | ||
|
|
d7cea0945c | ||
|
|
1ece5eb5ad | ||
|
|
9be3c9388b | ||
|
|
1cc4a69bbe | ||
|
|
d61d11381b | ||
|
|
0019c60902 | ||
|
|
a7b9cb454e | ||
|
|
83675b6622 | ||
|
|
9091bf8e5f | ||
|
|
3b8b43a947 | ||
|
|
bcf30a04f5 | ||
|
|
c331afa267 | ||
|
|
09d1d232fc | ||
|
|
58a52b1641 | ||
|
|
3a836aafd9 | ||
|
|
c9c13a7336 | ||
|
|
63338975d4 | ||
|
|
9018537919 | ||
|
|
437840e85d | ||
|
|
4b82cb500f | ||
|
|
e4a6365181 | ||
|
|
78900ab0f9 | ||
|
|
141049a2e2 | ||
|
|
6424efa54a | ||
|
|
861790dede | ||
|
|
bc0373b880 | ||
|
|
90c80958b8 | ||
|
|
d508cecfe3 | ||
|
|
3d6ca9f2cc | ||
|
|
f956b50f65 | ||
|
|
26b75f56c6 | ||
|
|
aea24b2a79 | ||
|
|
92d8c3d06e | ||
|
|
9a04c0f956 | ||
|
|
86d3e496f0 | ||
|
|
a40518164b | ||
|
|
c52cc1c333 | ||
|
|
33b6d03bfe | ||
|
|
43d04ee291 | ||
|
|
a4fba990a4 | ||
|
|
3450ed948f | ||
|
|
37a44999d3 | ||
|
|
fe576c7acb | ||
|
|
b2ac395957 | ||
|
|
94d68252d3 | ||
|
|
33490fdbaa | ||
|
|
7313bcd1f4 | ||
|
|
e3eb8bdd78 | ||
|
|
7a98f60e1b | ||
|
|
3c3dbc8873 | ||
|
|
d6d52f6f2e | ||
|
|
bca4347064 | ||
|
|
2bbba73606 | ||
|
|
e973875d98 | ||
|
|
cc0894b788 | ||
|
|
8b2a760004 | ||
|
|
55cf45abf5 | ||
|
|
9ff10d086a | ||
|
|
6d9d08bf55 | ||
|
|
550da4ae7c | ||
|
|
b514ab2ee9 | ||
|
|
2face60bef | ||
|
|
7baa132194 | ||
|
|
ec53815b0f | ||
|
|
e001a041f3 | ||
|
|
b9c04fe19a | ||
|
|
b12f5f7e45 | ||
|
|
962b8d480c | ||
|
|
0bdfab022a | ||
|
|
3f8a43989d | ||
|
|
fdcff80c16 | ||
|
|
b6e3da9b65 | ||
|
|
c64376bda5 | ||
|
|
04c36565eb | ||
|
|
eeb172b29f | ||
|
|
82e2b354ac | ||
|
|
e6a1f04677 | ||
|
|
4507e314af | ||
|
|
719d336b4f | ||
|
|
27d7cd8594 | ||
|
|
83e9b7eeee | ||
|
|
fc419f10ef | ||
|
|
34667c4b58 | ||
|
|
94dc9af5a0 | ||
|
|
f34db1b437 | ||
|
|
578c28fb0c | ||
|
|
9b530c04f1 | ||
|
|
57b32bdf57 | ||
|
|
4039adabf4 | ||
|
|
c9a5a75fef | ||
|
|
4ccca568bb | ||
|
|
460ec22808 | ||
|
|
535b190ac1 | ||
|
|
5b0f6b1f34 | ||
|
|
7cf92e79ed | ||
|
|
b372b86b89 | ||
|
|
bd9b600c3c | ||
|
|
ac7283a602 | ||
|
|
f0b5eeb17b | ||
|
|
91e3e2ed5c | ||
|
|
9f4be8d2cd | ||
|
|
af9788eb32 | ||
|
|
bad2a4bca9 | ||
|
|
258f2e3f48 | ||
|
|
dd28c137f6 | ||
|
|
75268270d6 | ||
|
|
dd5d497541 | ||
|
|
edde872904 | ||
|
|
0c8d7457c5 | ||
|
|
3e7a8e08eb | ||
|
|
d45b2c6bc3 | ||
|
|
a145c1b4ce | ||
|
|
85009fd76f | ||
|
|
4180b972ae | ||
|
|
0ba63371ed | ||
|
|
9bd83f2d81 | ||
|
|
9ebaa24aac | ||
|
|
c17d6970b6 | ||
|
|
b176ee99d3 | ||
|
|
7767bacaf8 | ||
|
|
deb84befae | ||
|
|
814000305a | ||
|
|
3d331bc64c | ||
|
|
4f313c79c2 | ||
|
|
aac5c1f6c5 | ||
|
|
b8275175ff | ||
|
|
fcfe11e9e4 | ||
|
|
f52edc19a7 | ||
|
|
e6ac744282 | ||
|
|
848f123645 | ||
|
|
ba7d6efe7b | ||
|
|
254456a4a6 | ||
|
|
6a4099ccdd | ||
|
|
787f0bbbb2 | ||
|
|
6e63ea45c7 | ||
|
|
ed6cbcb480 | ||
|
|
2004c25041 | ||
|
|
d0a4801579 | ||
|
|
5442d722c3 | ||
|
|
9b614ccb5a | ||
|
|
7aa832aba2 | ||
|
|
4341ee6061 | ||
|
|
851c254ef8 | ||
|
|
b967853eb3 | ||
|
|
8cdd2ed319 | ||
|
|
f223262bcd |
No files matched your search
@@ -1,6 +1,179 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? March 2004, PHP 5 Release Candidate 1
|
||||
?? ??? 2004, PHP 5.0.1
|
||||
|
||||
10 Aug 2004, PHP 5.0.1RC1
|
||||
- Rewritten UNIX and Windows install help files. (Documentation Team)
|
||||
- Updated several libraries bundled with the windows release which now
|
||||
includes libxml2-2.6.11, libxslt-1.1.7 and iconv-1.9.1. (Rob, Edin)
|
||||
- Improved and moved ActiveScript SAPI to PECL. (Wez)
|
||||
- Fixed bug #29577 (MYSQLI_CLIENT_FOUND_ROWS undefined) (Georg)
|
||||
- Fixed bug #29573 (Segmentation fault, when exception thrown within
|
||||
PHP function called from XSLT). (Christian)
|
||||
- Fixed bug #29522 (accessing properties without connection) (Georg)
|
||||
- Fixed bug #29505 (get_class_vars() severely broken when used with arrays).
|
||||
(Marcus)
|
||||
- Fixed bug #29490 (.Net object instantiation failed). (Michael Sisolak).
|
||||
- Fixed bug #29474 (win32: usleep() doesn't work). (Wez)
|
||||
- Fixed bug #29449 (win32: feof() hangs on empty tcp stream). (Wez)
|
||||
- Fixed bug #29437 (Possible crash inside array_walk_recursive()). (Ilia)
|
||||
- Fixed bug #29431 (crash when parsing invalid address; invalid address
|
||||
returned by stream_socket_recvfrom(), stream_socket_getname()). (Wez)
|
||||
- Fixed bug #29409 (Segfault in PHP functions called from XSLT). (Rob)
|
||||
- Fixed unloading of dynamically loaded extensions.
|
||||
(Marcus, kameshj at fastmail dot fm)
|
||||
- Fixed bug #29395 (sqlite_escape_string() returns bogus data on empty
|
||||
strings). (Ilia, Tony)
|
||||
- Fixed bug #29392 (com_dotnet crashes when echo'ing an object). (Wez)
|
||||
- Fixed bug #29368 (The destructor is called when an exception is thrown from
|
||||
the constructor). (Marcus)
|
||||
- Fixed bug #29354 (Exception constructor marked as both public and protected).
|
||||
(Marcus)
|
||||
- Fixed bug #29342 (strtotime() does not handle empty date string properly).
|
||||
(Ilia)
|
||||
- Fixed bug #29340 (win32 build produces invalid php_ifx.dll). (Edin)
|
||||
- Fixed bug #29335 (fetch functions now use MYSQLI_BOTH as default) (Georg)
|
||||
- Fixed bug #29291 (get_class_vars() return names with NULLs). (Marcus)
|
||||
- Fixed bug #29264 (gettext extension not working). (Edin)
|
||||
- Fixed buf #29258 (variant_date_from_timestamp() does not honour
|
||||
timezone). (Wez)
|
||||
- Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry)
|
||||
- Fixed bug #29132 ($_SERVER["PHP_AUTH_USER"] isn't defined). (Stefan)
|
||||
- Fixed bug #29119 (html_entity_decode() misbehaves with UTF-8). (Moriyoshi)
|
||||
- Fixed bug #29109 (SoapFault exception: [WSDL] Out of memory). (Dmitry)
|
||||
- Fixed bug #29061 (soap extension segfaults). (Dmitry)
|
||||
- Fixed bug #28985 (__getTypes() returning nothing on complex WSDL). (Dmitry)
|
||||
- Fixed bug #28895 (ReflectionClass::isAbstract always returns false). (Marcus)
|
||||
- Fixed bug #28829 (Thread-unsafety in bcmath elementary values). (Sara)
|
||||
- Fixed bug #28464 (catch() does not catch exceptions by interfaces). (Marcus)
|
||||
- Fixed ReflectionClass::getMethod() and ReflectionClass::getProperty() to
|
||||
raise an ReflectionException instead of returning NULL on failure.
|
||||
(Sebastian)
|
||||
- Fixed convert.* filters to consume remaining buckets_in on flush. (Sara)
|
||||
- Fixed bug in mysqli->client_version (Georg)
|
||||
|
||||
13 Jul 2004, PHP 5.0.0
|
||||
- Updated PCRE to provide better error handling in certain cases. (Andrei)
|
||||
- Changed doc comments to require a single white space after '/**'. (Marcus)
|
||||
- Fixed bug #29019 (Database not closing). (Marcus)
|
||||
- Fixed bug #29008 (array_combine() does not handle non-numeric/string keys).
|
||||
(Ilia)
|
||||
- Fixed bug #28999 (fixed behaviour of exec() to work as it did in 4.X). (Ilia)
|
||||
- Fixed bug #28868 (Internal filter registry not thread safe). (Sara)
|
||||
- Fixed bug #28851 (call_user_func_array has typo in error message). (Marcus)
|
||||
- Fixed bug #28831 (ArrayObject::offsetGet() does the work of offsetUnset()).
|
||||
(Marcus)
|
||||
- Fixed bug #28822 (ArrayObject::offsetExists() works inverted). (Marcus)
|
||||
- Fixed bug #28789 (ReflectionProperty getValue() fails on public static
|
||||
members). (Marcus)
|
||||
- Fixed bug #28771 (Segfault when using xslt and clone). (Rob)
|
||||
- Fixed bug #28751 (SoapServer does not call _autoload()). (Dmitry)
|
||||
- Fixed bug #28739 (array_*diff() and array_*intersect() not clearing the fci
|
||||
cache before work). (Andrey)
|
||||
- Fixed bug #28721 (appendChild() and insertBefore() unset DOMText).(Rob)
|
||||
- Fixed bug #28702 (SOAP does not parse WSDL service address correctly). (Dmitry)
|
||||
- Fixed bug #28699 (Reflection api bugs). (Marcus)
|
||||
- Fixed bug #28694 (ReflectionExtension::getFunctions() crashes PHP). (Marcus)
|
||||
- Fixed bug #28512 (Allocate enough space to store MSSQL data). (Frank)
|
||||
- Fixed bug #28325 (Circular references not properly serialised). (Moriyoshi)
|
||||
- Fixed strip_tags() to correctly handle '\0' characters. (Stefan)
|
||||
|
||||
7 Jun 2004, PHP 5 Release Candidate 3
|
||||
- Moved the PDFLib extension to PECL. (Wez)
|
||||
- Added MySQL 4.1.2-alpha and 4.1.3-beta support to MySQLI extension. (Georg)
|
||||
- Added support for dumping private/protected properties to var_dump().
|
||||
(Andrey)
|
||||
- Added count() support for COM arrays. (Wez)
|
||||
- Added Firebird/InterBase UDF source that allows PHP functions to be called
|
||||
from SQL (Ard)
|
||||
- Removed Firebird/Interbase function ibase_timefmt() (Ard)
|
||||
- Changed user error handler mechanism to relay to built-in error handler if it
|
||||
returns false. (Andrei)
|
||||
- Changed class type hints for function parameters to not allow the passing of
|
||||
NULL values. (Andi)
|
||||
- Changed tidy_node to tidyNode and removed tidy_exception. (John)
|
||||
- Fixed ip2long() to return FALSE if an IP address passed to this function
|
||||
is not valid. (Derick)
|
||||
- Fixed memory leak in memory manager. (Andi)
|
||||
- Fixed problem with exceptions returning from include(). (Dmitry)
|
||||
- Fixed bug #28641 (Instance of Interface). (Marcus)
|
||||
- Fixed bug #28430 (Extending mysqli class). (Georg)
|
||||
- Fixed bug #28311 (Transparency detection code is off by 1).
|
||||
(Ilia, pikeman at pikeman dot sytes dot net)
|
||||
- Fixed bug #28304 (Missing bounds check inside imagefilter()). (Ilia)
|
||||
- Fixed bug #28300 (Userspace stream/filter names forced to lowercase). (Sara)
|
||||
- Fixed bug #28287 (stream_*_register() not calling __autoload()). (Sara)
|
||||
- Fixed bug #28267 (php_image_filter_contrast calls gdImageBrightness). (Ilia)
|
||||
- Fixed bug #28239 (No results returned on SOAP call, no error given). (Dmitry)
|
||||
- Fixed bug #28205 (num_rows property for statement object). (Georg)
|
||||
- Fixed bug #28161 (COM: Array style properties could not be accessed). (Wez)
|
||||
- Fixed bug #28125 (ArrayObject leaks when accessing elements). (Marcus)
|
||||
- Fixed bug #28100 (NULL parameter support for mysqli_ssl_set). (Georg)
|
||||
- Fixed bug #28099 (ArrayObject doesn't implement ArrayAccess). (Marcus)
|
||||
- Fixed bug #27929 (SPL: change visibility of ArrayIterator::__construct).
|
||||
(Marcus)
|
||||
- Fixed bug #27640 (memory leak of registered_zend_ini_directives). (Dmitry)
|
||||
- Fixed bug #27063 (SPL: ArrayObject does not handle PPP correctly). (Marcus)
|
||||
|
||||
25 Apr 2004, PHP 5 Release Candidate 2
|
||||
- Implementing an interface/abstract method with the wrong prototype is now
|
||||
a fatal error. (Zeev)
|
||||
- Reimplemented zend.ze1_compatibility_mode to have better PHP 4 compliance.
|
||||
(Dmitry, Andi)
|
||||
- Under CLI, fclose() on php://stdin, php://stdout and php://stderr will now
|
||||
close the real stream. Please update your CLI scripts to use STDIN, STDOUT
|
||||
and STDERR constants instead of fopen()/fclose(). (Wez)
|
||||
- Moved yaz extension to PECL. (Wez)
|
||||
- Added pty support to proc_open(). (Wez)
|
||||
- Added possibility to check in which extension an internal class was defined
|
||||
in using reflection API. (Marcus)
|
||||
- Changed tidy error handling to no longer use exceptions and
|
||||
renamed the "error_buf" property to errorBuffer. (John)
|
||||
- Changed class and method names to use studlyCaps convention. (Marcus)
|
||||
- Changed language parser to throw errors when a non-empty signature is used in
|
||||
a destructor definition. (Marcus)
|
||||
- Changed HTTP file uploads not to throw E_WARNINGs and E_NOTICEs. The error
|
||||
value in the $_FILES global should be used for error handling. (Derick)
|
||||
- Changed __construct() to always take precedence over old style constructor.
|
||||
(Dmitry)
|
||||
- Fixed handling of return values from storred procedures in mssql_execute()
|
||||
with multiple result sets returned. (Frank)
|
||||
- Fixed bug #28096 (stream_socket_accept() doesn't work with ssl). (Wez)
|
||||
- Fixed bug #28007 (compile mssql extension with old versions of FreeTDS
|
||||
fails). (Frank)
|
||||
- Fixed bug #27997 (SPL: Crash with getInnerIterator()). (Marcus)
|
||||
- Fixed bug #27974 (COM doesn't pass array parameters). (Wez)
|
||||
- Fixed bug #27928 (sqlite incorrectly handles invalid filenames). (Ilia)
|
||||
- Fixed bug $27923 (in some cases using foreach() to iterate over values
|
||||
led to a false error message about the key being a reference). (Adam)
|
||||
- Fixed bug #27865 (STDIN, STDOUT, STDERR are dup()d under CLI). (Wez)
|
||||
- Fixed bug #27821 (xml_parse() segfaults when xml_set_object() is called from
|
||||
class method). (Andi, Rob)
|
||||
- Fixed bug #27742 (WDSL SOAP Parsing Schema bug). (Dmitry)
|
||||
- Fixed bug #27722 (Segfault on schema without targetNamespace). (Dmitry)
|
||||
- Fixed bug #27719 (mktime issues on and around DST changeover). (Rasmus)
|
||||
- Fixed bug #27681 (soap extension fails without HAVE_TM_GMTOFF). (Dmitry)
|
||||
- Fixed bug #27641 (Object cloning in ze1_compatibility_mode was reimplemented)
|
||||
(Dmitry, Andi)
|
||||
- Fixed bug #27628 (Simplify the process of making a POST request via stream
|
||||
context). (Ilia)
|
||||
- Fixed bug #27619 (filters not applied to pre-buffered stream data). (Sara)
|
||||
- Fixed bug #27519 (Reflection_Function constructor crashes with non-existant
|
||||
function's name). (Marcus)
|
||||
- Fixed bug #27469 (serialize() objects of incomplete class). (Dmitry)
|
||||
- Fixed bug #27457 (handling of numeric indexes in strtr()). (Dmitry)
|
||||
- Fixed bug #27397 (debug_backtrace() not showing function arguments). (Zeev)
|
||||
- Fixed bug #27283 (The last catch statement was sometimes skipped). (Andi)
|
||||
- Fixed bug #26441 (When __set() returned a value it corrupted it). (Andi)
|
||||
- Fixed bug #19749 (shouldn't mmap() files larger than memory_limit). (Wez)
|
||||
|
||||
18 March 2004, PHP 5 Release Candidate 1
|
||||
- Fixed numerous bugs with the just-in-time auto-global initialization, that
|
||||
could cause $_SERVER, $argv/$argc and other variables not to work properly.
|
||||
(Zeev)
|
||||
- Fixed data corruption with constant assignments to object properties. (Zeev)
|
||||
- Changed __toString() to be called automatically only with print and echo
|
||||
statements. (Andi)
|
||||
- Replaced the exec_finished hook by the zend_post_deactive hook for
|
||||
extensions. The new hook will be run after the symbol table and destructors
|
||||
are run. (Derick)
|
||||
@@ -75,6 +248,8 @@ PHP NEWS
|
||||
- Fixed bug #27123 (Fix crash caused by bug in get_object_vars()). (Andi)
|
||||
- Fixed bug #26677 (mbstring compile errors with IRIX compiler).
|
||||
(K.Kosako <kosako at sofnec dot co dot jp>, Rui, Moriyoshi)
|
||||
- Fixed bug #26206 (register_long_arrays breaks superglobals). (Zeev)
|
||||
- Fixed bug #25724 (argv and argc not defined). (Zeev)
|
||||
|
||||
12 Feb 2004, PHP 5 Beta 4
|
||||
- Changed exceptions so that they must now inherit from the built-in Exception
|
||||
|
||||
+10
-18
@@ -37,8 +37,11 @@ The next few rules are more of a technical nature.
|
||||
messages every day. Woe be to those who attempt to mess with it.
|
||||
|
||||
2. All news updates intended for public viewing, such as new features,
|
||||
bug fixes, improvements, etc., should go into the NEWS file. Also see
|
||||
the note below about automatically updating NEWS in your commit message.
|
||||
bug fixes, improvements, etc., should go into the NEWS file.
|
||||
|
||||
NB! Lines, starting with @ will go automagically into NEWS file, but
|
||||
this is NOT recommended, though. Please, add news entries directly to
|
||||
NEWS file and don't forget to keep them adjusted and sorted.
|
||||
|
||||
3. Do not commit multiple file and dump all messages in one commit. If you
|
||||
modified several unrelated files, commit each group separately and
|
||||
@@ -59,14 +62,10 @@ The next few rules are more of a technical nature.
|
||||
The format of the commit messages is pretty simple.
|
||||
|
||||
If a line begins with #, it is taken to be a comment and will not appear
|
||||
in the ChangeLog. If the line begins with @, it will be redirected to the
|
||||
NEWS file. Everything else goes into the ChangeLog.
|
||||
in the ChangeLog. Everything else goes into the ChangeLog.
|
||||
|
||||
It is important to note that if your comment or news logline spans multiple
|
||||
lines, you have to put # or @ at the beginning of _every_ such line. Every
|
||||
entry in NEWS has to have a name after it, so if you did it with someone's
|
||||
help, put both your names there. Your name WILL NOT be automatically put
|
||||
at the end of the NEWS entry - so, please provide it yourself.
|
||||
lines, you have to put # at the beginning of _every_ such line.
|
||||
|
||||
Example. Say you modified two files, datetime.c and string.c. In datetime.c
|
||||
you added a new format option for date() function, and in string.c you fixed
|
||||
@@ -78,17 +77,12 @@ For datetime.c:
|
||||
|
||||
(PHP date) Added new 'K' format modifier for printing out number of
|
||||
days until New Year's Eve.
|
||||
@- Added new 'K' format modifier that will output the number of days
|
||||
@ until New Year's Eve. (Bob)
|
||||
|
||||
For string.c:
|
||||
(php_trim) Fixed a memory leak resulting from improper use of zval_dtor().
|
||||
# Man, that thing was leaking all over the place!
|
||||
@- Fixed memory leak in trim(). (Bob)
|
||||
|
||||
The lines above marked with @ will go into NEWS file automagically, and the
|
||||
# lines will be omitted from the ChangeLog. Alternatively, you might want
|
||||
to modify NEWS file directly and not use the @ lines.
|
||||
The # lines will be omitted from the ChangeLog automagically.
|
||||
|
||||
If you fix some bugs, you should note the bug ID numbers in your
|
||||
commit message. Bug ID should be prefixed by "#" for easier access to
|
||||
@@ -97,12 +91,10 @@ bug report when developers are browsing CVS via. LXR or Bonsai.
|
||||
Example:
|
||||
|
||||
Fixed pgsql notice handler double free crash bug. Bug #14016
|
||||
@ Fixed pgsql notice handler double free crash bug. Bug #14016
|
||||
|
||||
If you don't see your messages in ChangeLog and NEWS right away, don't worry!
|
||||
If you don't see your messages in ChangeLog right away, don't worry!
|
||||
These files are updated once a day, so your stuff will not show up until
|
||||
somewhat later. Don't go adding stuff to NEWS by hand if you already put @
|
||||
lines in the commit message.
|
||||
somewhat later.
|
||||
|
||||
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
|
||||
to look at PHP CVS repository in various ways.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
1. strrpos() and strripos() now use the entire string as a needle.
|
||||
Be aware that the existing scripts may no longer work as you expect.
|
||||
1. strrpos() and strripos() now use the entire string as a needle. Be aware
|
||||
that the existing scripts may no longer work as you expect.
|
||||
|
||||
EX :
|
||||
<?php
|
||||
@@ -53,18 +53,55 @@
|
||||
variables_order setting. As in, the CLI version will now always populate
|
||||
the global $argc and $argv variables.
|
||||
|
||||
8. Classes must be declared before used:
|
||||
8. In some cases classes must be declared before used. It only happens only
|
||||
if some of the new features of PHP 5 are used. Otherwise the behaviour is
|
||||
the old.
|
||||
Example 1 (works with no errors):
|
||||
<?php
|
||||
$test = new fubar();
|
||||
$test->barfu();
|
||||
|
||||
class fubar {
|
||||
function barfu() {
|
||||
echo 'fubar';
|
||||
}
|
||||
$a = new a();
|
||||
class a {
|
||||
}
|
||||
?>
|
||||
This script is perfectly valid and works in PHP 4 but with PHP 5 there
|
||||
will be a fatal error like :
|
||||
Fatal error: Class 'fubar' not found in ....
|
||||
If there is defined function __autoload() it will be called.
|
||||
|
||||
Example 2 (throws an error):
|
||||
<?php
|
||||
$a = new a();
|
||||
interface b{
|
||||
}
|
||||
class a implements b {
|
||||
}
|
||||
?>
|
||||
|
||||
Output (example 2) :
|
||||
Fatal error: Class 'a' not found in /tmp/cl.php on line 2
|
||||
|
||||
9. get_class() starting PHP 5 returns the name of the class as it was
|
||||
declared which may lead to problems in older scripts that rely on
|
||||
the previous behaviour - the class name is lowercased.
|
||||
Example :
|
||||
<?php
|
||||
class FooBar {
|
||||
}
|
||||
$a = new FooBar();
|
||||
var_dump(get_class($a));
|
||||
?>
|
||||
|
||||
Output (PHP 4):
|
||||
string(6) "foobar"
|
||||
|
||||
Output (PHP 5):
|
||||
string(6) "FooBar"
|
||||
----------------------------------------------------------------------
|
||||
Example code that will break :
|
||||
//....
|
||||
function someMethod($p) {
|
||||
if (get_class($p) != 'helpingclass') {
|
||||
return FALSE;
|
||||
}
|
||||
//...
|
||||
}
|
||||
//...
|
||||
Possible solution is to search for get_class() in all your scripts and
|
||||
use strtolower().
|
||||
|
||||
|
||||
+11
-2
@@ -1,11 +1,20 @@
|
||||
[IMPORTANT NOTICE]
|
||||
------------------
|
||||
Please do not ask developers why some or all tests are failing in
|
||||
your environment! Let us know if you find why it fails. Thank you.
|
||||
Failed tests usualy indicate a problem with your local system setup
|
||||
and not within PHP itself (at least for official PHP release versions).
|
||||
You may decide to automaticaly submit a test summary to our QA workflow
|
||||
at the end of a test run.
|
||||
Please do *not* submit a failed test as a bug or ask for help on why
|
||||
it failed on your system without providing substantial backup information
|
||||
on *why* the test failed on your special setup. Thank you :-)
|
||||
|
||||
|
||||
[Testing Basics]
|
||||
----------------
|
||||
The easiest way to test your PHP build is to run "make test" from the
|
||||
command line after successfully compiling. This will run the complete
|
||||
tests for all enabled functionalities and extensions using the PHP
|
||||
CLI binary.
|
||||
To execute test scripts, you must build PHP with some SAPI, then you
|
||||
type "make test" to execute all or some test scripts saved under
|
||||
"tests" directory under source root directory.
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ PHP_FUNCTION(my_get_raw)
|
||||
HashTable *hash_ptr;
|
||||
char *raw_var;
|
||||
|
||||
if(zend_parse_parameters(2 TSRMLS_CC, "ls|l", &arg, &var, &var_len) == FAILURE) {
|
||||
if(zend_parse_parameters(2 TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,13 +7,9 @@ Zend
|
||||
dimensional arrays.
|
||||
* Look at replacing c-lib call tolower().
|
||||
* Make hash API functions work with HASH_OF() to save time.
|
||||
* Allow to set a default value for call-by-reference-parameters.
|
||||
eg: function hello (&$pallo = NULL) {}
|
||||
* Add configure test to determine if dlsym() requires underscore and set
|
||||
DLSYM_NEEDS_UNDERSCORE accordingly. Perl and zsh have it in configure,
|
||||
for example. (DONE?)
|
||||
* Allow foreach ($array as $k => &$val) syntax. right now we cannot
|
||||
traverse an array without copying each element.
|
||||
* Native large number support (probably with GNU GMP)
|
||||
* Const'ify APIs. Right now, many functions leave parameters untouched,
|
||||
but don't declare those as const. This makes interaction with other
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
Zend Engine
|
||||
-----------
|
||||
- Look at making zend_constant value member be a zval* instead of zval. (Andi)
|
||||
- Add the patch for referring to existing .ini vars in .ini files. (Andrei)
|
||||
- Implement inheritance rules for type hints. (Marcus)
|
||||
- Implement true/false/NULL as keywords (apply the patch). (Andi, Marcus)
|
||||
- Implement typehinting for arrays (apply the patch). (Andi, Marcus)
|
||||
- Find a keyword for the if-set-or operator (apply the patch). (Marcus, all)
|
||||
- Fix ZTS destruction (apply the patch). (Marcus)
|
||||
|
||||
Build System
|
||||
------------
|
||||
- Implement load order of built-in extensions (apply the patch). (Wez)
|
||||
|
||||
Standard Library
|
||||
----------------
|
||||
- Implement new time/date parsing and handling functions. (Derick)
|
||||
@@ -16,83 +16,6 @@ Responsibility: Andi, Stig?
|
||||
Time frame: ?
|
||||
|
||||
|
||||
Component: Introspection
|
||||
|
||||
get_function_definition(<is_callable> [field]) =>
|
||||
array(
|
||||
file => filename
|
||||
line_start =>
|
||||
line_end =>
|
||||
parameters => array( name, byref, default )
|
||||
static_variables => array( name, value/default )
|
||||
scope => 'namespace' | 'class' | null
|
||||
namespace => classname | namespacename | 'main'
|
||||
protection => protection_flags
|
||||
phpdoc => pre-scanned-phpdoc-string
|
||||
type => 'internal' | 'user'
|
||||
)
|
||||
|
||||
get_class_definition(<class> [field]) =>
|
||||
array(
|
||||
type => 'internal' | 'user'
|
||||
file => filename
|
||||
line_start =>
|
||||
line_end =>
|
||||
name => pretty-name
|
||||
parent => classname | namespace | null
|
||||
flags => bitfield (ABSTRACT)
|
||||
methods => array( array( name, phpdoc ) )
|
||||
default_properties => array( array( name, value, phpdoc ) )
|
||||
private_properties => array( array( name, value, phpdoc ) )
|
||||
protected_properties => array( array( name, value, phpdoc ) )
|
||||
public_properties => array( array( name, value, phpdoc ) )
|
||||
static_members => array( array( name, value, phpdoc ) )
|
||||
constants => array( array( name, value, phpdoc ) )
|
||||
classes => array( array( name, phpdoc ) )
|
||||
phpdoc => pre-scanned-phpdoc-string
|
||||
)
|
||||
|
||||
get_constant_definition(<constant> [field]) =>
|
||||
array(
|
||||
file => filename
|
||||
line_start =>
|
||||
line_end =>
|
||||
name =>
|
||||
value =>
|
||||
phpdoc =>
|
||||
)
|
||||
|
||||
get_global_variable_defintion(<name> [field]) =>
|
||||
array(
|
||||
file =>
|
||||
line_start =>
|
||||
line_end =>
|
||||
name =>
|
||||
phpdoc =>
|
||||
)
|
||||
|
||||
We tried to take into account the implementation of each piece of
|
||||
information, and there are some that are problematic, especially those
|
||||
regarding constants and global variables (where do we store the extra
|
||||
information?)
|
||||
|
||||
With "pre-scanned-phpdoc-string" we mean converting:
|
||||
|
||||
/**
|
||||
* Blah blah blah
|
||||
* @param foo ...
|
||||
*/
|
||||
|
||||
to:
|
||||
|
||||
Blah blah blah
|
||||
@param foo
|
||||
|
||||
The rest of the phpdoc handling should be left to an extension.
|
||||
Responsibility: Stig, Andrei, Harald
|
||||
Time frame: ?
|
||||
|
||||
|
||||
Component: Redesign of API Versioning
|
||||
Responsibility: ?
|
||||
Time frame: 1 month
|
||||
@@ -172,31 +95,6 @@ Responsibility: Sterling, Harald
|
||||
Time frame: ?
|
||||
|
||||
|
||||
Component: MySQL Extension
|
||||
Complete rewrite, leveraging the new MySQL 4 / MySQL 5
|
||||
features.
|
||||
Responsibility: Georg Richter, Zak Greant
|
||||
Timeframe: ?
|
||||
|
||||
|
||||
Component: XML
|
||||
- Rewrite DOMXML and incorporate all (or most of) W3C-DOM2.
|
||||
- Use the new ZE2 features (Exceptions, setter/getter).
|
||||
- Add SAX(2), XML Schema.
|
||||
- XSLT, HTML, XPath, XPointer, DTD Validation will still be
|
||||
supported, have to find a meaningful API for it.
|
||||
- Break BC, warn users now.
|
||||
- Look at the libxml2 patch by lukas schröder and see if we can prevent
|
||||
memory leaks with it (anyway, getting rid of mem-leaks and intelligent
|
||||
memory management is on top prio...)
|
||||
- In the longer term, domxml (or another name, as with todays features
|
||||
domxml is a little bit misleading) shall be the main xml-class, which
|
||||
covers most of what's needed for decent XML support in PHP ;)
|
||||
But there is certainly place for others like Sablotron etc.
|
||||
Responsibility: Christian Stocker
|
||||
Timeframe: ?
|
||||
|
||||
|
||||
Component: Test Suite
|
||||
Extending the test suite with atleast a test for every
|
||||
function in an extension that doesn't require external
|
||||
|
||||
+53
-6
@@ -34,6 +34,9 @@ typedef struct {
|
||||
size_t size;
|
||||
ts_allocate_ctor ctor;
|
||||
ts_allocate_dtor dtor;
|
||||
#ifdef MBO_0
|
||||
int done;
|
||||
#endif
|
||||
} tsrm_resource_type;
|
||||
|
||||
|
||||
@@ -158,10 +161,14 @@ TSRM_API void tsrm_shutdown(void)
|
||||
|
||||
next_p = p->next;
|
||||
for (j=0; j<p->count; j++) {
|
||||
if (resource_types_table && resource_types_table[j].dtor) {
|
||||
resource_types_table[j].dtor(p->storage[j], &p->storage);
|
||||
if (p->storage[j]) {
|
||||
#ifdef MBO_0
|
||||
if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) {
|
||||
resource_types_table[j].dtor(p->storage[j], &p->storage);
|
||||
}
|
||||
#endif
|
||||
free(p->storage[j]);
|
||||
}
|
||||
free(p->storage[j]);
|
||||
}
|
||||
free(p->storage);
|
||||
free(p);
|
||||
@@ -219,6 +226,9 @@ TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate
|
||||
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].size = size;
|
||||
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].ctor = ctor;
|
||||
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].dtor = dtor;
|
||||
#ifdef MBO_0
|
||||
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].done = 0;
|
||||
#endif
|
||||
|
||||
/* enlarge the arrays for the already active threads */
|
||||
for (i=0; i<tsrm_tls_table_size; i++) {
|
||||
@@ -273,9 +283,16 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
|
||||
tsrm_new_thread_begin_handler(thread_id, &((*thread_resources_ptr)->storage));
|
||||
}
|
||||
for (i=0; i<id_count; i++) {
|
||||
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
|
||||
if (resource_types_table[i].ctor) {
|
||||
resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage);
|
||||
#if MBO_0
|
||||
if (resource_types_table[i].done) {
|
||||
(*thread_resources_ptr)->storage[i] = NULL;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
|
||||
if (resource_types_table[i].ctor) {
|
||||
resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,6 +437,36 @@ void ts_free_thread(void)
|
||||
/* deallocates all occurrences of a given id */
|
||||
void ts_free_id(ts_rsrc_id id)
|
||||
{
|
||||
#ifdef MBO_0
|
||||
int i;
|
||||
int j = TSRM_UNSHUFFLE_RSRC_ID(id);
|
||||
|
||||
tsrm_mutex_lock(tsmm_mutex);
|
||||
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Freeing resource id %d", id));
|
||||
|
||||
if (tsrm_tls_table) {
|
||||
for (i=0; i<tsrm_tls_table_size; i++) {
|
||||
tsrm_tls_entry *p = tsrm_tls_table[i];
|
||||
|
||||
while (p) {
|
||||
if (p->count > j && p->storage[j]) {
|
||||
if (resource_types_table && resource_types_table[j].dtor) {
|
||||
resource_types_table[j].dtor(p->storage[j], &p->storage);
|
||||
}
|
||||
free(p->storage[j]);
|
||||
p->storage[j] = NULL;
|
||||
}
|
||||
p = p->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
resource_types_table[j].done = 1;
|
||||
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
|
||||
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully freed resource id %d", id));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
+904
@@ -1,3 +1,907 @@
|
||||
2004-07-14 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_object_handlers.c:
|
||||
be consistent with write_dimension
|
||||
|
||||
* zend_object_handlers.c:
|
||||
fix #28957
|
||||
|
||||
2004-07-13 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend.h:
|
||||
- 5.0.1-dev
|
||||
|
||||
2004-07-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_constants.c:
|
||||
Bugfix #29116 Zend constant warning uses memory after free (jdolecek at
|
||||
NetBSD dot org)
|
||||
|
||||
2004-07-13 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* (php_5_0_0)
|
||||
zend.h:
|
||||
- Roll PHP 5.0.0
|
||||
|
||||
2004-07-12 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
zend_execute.c:
|
||||
Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts).
|
||||
|
||||
2004-07-12 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* (php_5_0_0RC4)
|
||||
zend.c:
|
||||
- Convert zend_class_entry -> zend_class_entry *
|
||||
|
||||
2004-07-10 Jon Parise <jon+php@csh.rit.edu>
|
||||
|
||||
* zend.c:
|
||||
DragonFly BSD is derived from FreeBSD and requires the same floating point
|
||||
precision fix.
|
||||
|
||||
2004-07-10 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_alloc.c
|
||||
zend_hash.c
|
||||
zend_variables.c:
|
||||
- Better stability during premature shutdown of request startup
|
||||
|
||||
2004-07-05 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_mm.h:
|
||||
- Disable zend_mm for 5.0.0
|
||||
|
||||
2004-07-03 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_alloc.c:
|
||||
- Should fix mem leak with ZEND_MM. I made this change a while ago and
|
||||
- rolled it back but I don't remember why. Please test!
|
||||
|
||||
2004-07-01 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* zend_constants.c:
|
||||
Do not use alloca() where it can be easily abused by the users.
|
||||
|
||||
|
||||
2004-06-25 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* zend_stream.c
|
||||
zend_stream.h:
|
||||
export zend stream functions for zend extensions under windows
|
||||
|
||||
2004-06-24 Sara Golemon <php@alphaweb.net>
|
||||
|
||||
* zend_execute.c:
|
||||
Ease off on severity of new error (Using Resources as array offsets)
|
||||
|
||||
2004-06-23 Sara Golemon <php@alphaweb.net>
|
||||
|
||||
* zend_execute.c:
|
||||
BugFix #28879 Inconsistent behavior between explicit and implicit array
|
||||
creation.
|
||||
|
||||
Changes:
|
||||
|
||||
Throw E_WARNING "Illegal offset type" when explicitly creating
|
||||
array elements with objects, arrays, or resorces as indexes.
|
||||
This matches implicit creation w/ obj/arr indices.
|
||||
|
||||
Throw E_WARNING "Resource ID#%ld used as offset, casting to integer (%ld)"
|
||||
when implicitly creating array with resource as index. (BC)
|
||||
|
||||
2004-06-19 Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
Reflection_* -> Reflection*. Patch by Timm Friebe.
|
||||
|
||||
2004-06-18 Sara Golemon <php@alphaweb.net>
|
||||
|
||||
* zend_execute.c:
|
||||
Another typo in converting array index doubles to long.
|
||||
|
||||
2004-06-18 George Schlossnagle <george@omniti.com>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
fix for 28213.
|
||||
|
||||
class_name and call_type should be reinitialized on every loop iter.
|
||||
|
||||
2004-06-17 Sara Golemon <php@alphaweb.net>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
String length in parse_parameters should be int
|
||||
|
||||
2004-06-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
|
||||
|
||||
2004-06-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_language_scanner.l:
|
||||
Need {} here
|
||||
|
||||
2004-06-10 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_language_scanner.l:
|
||||
- Require a single white-space char after /** to start a doc comment that
|
||||
way we prevent /*** from becoming a doc comment (as requested Derick).
|
||||
|
||||
* zend_API.h:
|
||||
Add missing declaration
|
||||
|
||||
* zend_reflection_api.c:
|
||||
Small code layout change
|
||||
|
||||
* zend_language_scanner.l:
|
||||
Do not require NEWLINE at start of doccomment
|
||||
|
||||
* zend_reflection_api.c:
|
||||
Bugfix #28699: Reflection api bugs
|
||||
|
||||
2004-06-09 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP
|
||||
|
||||
2004-06-07 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend.h:
|
||||
- Go back to -dev (Shouldn't need another RC)
|
||||
|
||||
* (php_5_0_0RC3)
|
||||
zend.h:
|
||||
- Roll RC3
|
||||
|
||||
2004-06-06 Stefan Esser <sesser@suspekt.org>
|
||||
|
||||
* zend_compile.h
|
||||
zend_opcode.c:
|
||||
Fixed Zend Function Destructor to use correct TSRM handle.
|
||||
|
||||
2004-06-05 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_API.c:
|
||||
Fix #28641: Instance of Interface
|
||||
|
||||
2004-06-03 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* (php_5_0_0RC3RC2)
|
||||
zend.h:
|
||||
- Prepare for RC3RC2
|
||||
|
||||
2004-06-02 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_mm.h:
|
||||
- Don't use ZEND_MM in Windows
|
||||
|
||||
2004-06-02 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_execute.c:
|
||||
fix incdec - make value's refcount non-zero when passing to
|
||||
write_property - otherwise __set caller cleanup could kill it.
|
||||
|
||||
2004-06-01 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend.c:
|
||||
- If user error handler returns "false" then we relay to the built in error
|
||||
handler
|
||||
|
||||
2004-05-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
Refcount must not be set separatley again.
|
||||
|
||||
* zend_reflection_api.c
|
||||
zend_reflection_api.c:
|
||||
Add missing initialization
|
||||
|
||||
* zend_compile.c:
|
||||
|
||||
|
||||
2004-05-28 Andrei Zmievski <andreiz@gmail.com>
|
||||
|
||||
* zend.c:
|
||||
Allow user-defined error handlers to indicate whether default error
|
||||
handler should be re-invoked, by returning true or false.
|
||||
|
||||
2004-05-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_execute.c:
|
||||
Prevent possible problems with illegal properties
|
||||
|
||||
2004-05-28 Derick Rethans <php@derickrethans.nl>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
- Make the default mask for user defined error handlers include ALL errors,
|
||||
including E_STRICT.
|
||||
|
||||
2004-05-27 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend.h:
|
||||
- Back to RC3-dev until we roll final
|
||||
|
||||
* (php_5_0_0RC3RC1)
|
||||
zend_execute.c:
|
||||
- Fix problem with exceptions returning from include(). (Dmitry)
|
||||
|
||||
* (php_5_0_0RC3RC1)
|
||||
zend.h:
|
||||
- RC3RC1
|
||||
|
||||
2004-05-26 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* zend_object_handlers.c:
|
||||
Fix leak on systems where alloca isn't really alloca.
|
||||
|
||||
2004-05-26 Andrei Zmievski <andreiz@gmail.com>
|
||||
|
||||
* zend_constants.c:
|
||||
Avoid unnecessary and silly copying of constant name when registering.
|
||||
|
||||
2004-05-26 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_alloc.c:
|
||||
- Fix memory manager problem
|
||||
|
||||
2004-05-26 Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
|
||||
* ZEND_CHANGES:
|
||||
Update Reflection API class names. Whitespace fixes.
|
||||
|
||||
2004-05-25 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_objects_API.h:
|
||||
- Nuke unused decleration
|
||||
|
||||
* zend_alloc.c
|
||||
zend_alloc.h:
|
||||
- More fixes
|
||||
|
||||
* zend_alloc.c
|
||||
zend_alloc.h:
|
||||
- Make fix compile.
|
||||
|
||||
* zend_alloc.c
|
||||
zend_alloc.h:
|
||||
- Fix memory leak in mem cache in conjunction with Zend MM. How come no one
|
||||
- noticed this? :)
|
||||
|
||||
2004-05-23 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_objects_API.c:
|
||||
- Fix problem with object being destroyed more than once
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
- Fix the following script (it crashed):
|
||||
<?php
|
||||
class ErrorHandler {
|
||||
function __construct() {
|
||||
set_error_handler(array(&$this, 'handle'));
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
function handle($code, $msg, $file, $line, $locals) {
|
||||
}
|
||||
}
|
||||
|
||||
new ErrorHandler();
|
||||
?>
|
||||
|
||||
2004-05-20 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* zend_exceptions.c
|
||||
zend_exceptions.h:
|
||||
Revert; obviously I missed the function at the bottom of the file...
|
||||
|
||||
* zend_exceptions.c
|
||||
zend_exceptions.h:
|
||||
Export this, so extensions may throw their own exception objects that
|
||||
they have already instantiated.
|
||||
|
||||
2004-05-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_API.c:
|
||||
- Need to operate on module pointer in hash table
|
||||
|
||||
2004-05-18 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* zend_execute_API.c:
|
||||
Fix bug #28438: win32 build fails in non-zts mode
|
||||
|
||||
2004-05-18 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_API.c:
|
||||
Z_TYPE_P is for zvals
|
||||
|
||||
2004-05-18 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* zend_API.c:
|
||||
Register according to the type specified by the module.
|
||||
(Helps to fix dl() bug)
|
||||
|
||||
2004-05-18 Sara Golemon <php@alphaweb.net>
|
||||
|
||||
* zend_execute.c:
|
||||
Bugfix#28404 When type is double we need to access dval, not lval
|
||||
|
||||
2004-05-17 Andrei Zmievski <andreiz@gmail.com>
|
||||
|
||||
* zend_ini_parser.y
|
||||
zend_ini_scanner.l:
|
||||
Revert the .ini vars patch. Will have to try again next Christmas
|
||||
apparently.
|
||||
|
||||
* zend_ini_parser.y:
|
||||
Fix the apparent bug (; at the end of parse rule block).
|
||||
|
||||
2004-05-17 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* zend_objects_API.c
|
||||
zend_objects_API.h:
|
||||
As discussed with Andi, add this helper API for setting the object pointer
|
||||
from
|
||||
within the constructor.
|
||||
|
||||
Please read the comment for notes about how to use it; in general, you
|
||||
don't
|
||||
need it, so don't use it.
|
||||
|
||||
2004-05-14 Andrei Zmievski <andrei@gravitonic.com>
|
||||
|
||||
* zend_ini_parser.y
|
||||
zend_ini_scanner.l:
|
||||
Adding ability to refer to existing .ini variables from within .ini
|
||||
files. Example:
|
||||
|
||||
open_basedir = ${open_basedir} ":/new/dir"
|
||||
|
||||
2004-05-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_API.c:
|
||||
- Centralize register and hash operations for startup/register_module
|
||||
in new zend_register_module_ex().
|
||||
|
||||
* zend_API.c:
|
||||
- Revert to 1.249
|
||||
|
||||
2004-05-11 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_compile.c:
|
||||
- Don't allow passing NULL to type hinted parameter.
|
||||
|
||||
2004-05-10 Zeev Suraski <zeev@zend.com>
|
||||
|
||||
* zend_operators.c:
|
||||
- Fix comparison of objects
|
||||
- Clarify convert_object_to_type()
|
||||
|
||||
2004-05-10 Stefan Esser <sesser@suspekt.org>
|
||||
|
||||
* zend_alloc.c:
|
||||
Checking MEMORY_LIMIT before doing emalloc/erealloc solves several ugly
|
||||
problems.
|
||||
|
||||
2004-05-04 Wez Furlong <wez.php@thebrainroom.net>
|
||||
|
||||
* zend_iterators.c
|
||||
zend_object_handlers.c
|
||||
zend_object_handlers.h
|
||||
zend_objects_API.c:
|
||||
Add count_elements handler for overloaded objects.
|
||||
|
||||
2004-05-02 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_operators.c:
|
||||
- Fix comparison of two objects in non-compatibility mode.
|
||||
|
||||
2004-05-01 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_API.c:
|
||||
Don't load modules twice
|
||||
|
||||
2004-04-29 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_execute.c:
|
||||
Fix bug #27876
|
||||
|
||||
2004-04-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_exceptions.h:
|
||||
Fix c++ builds
|
||||
|
||||
2004-04-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
- Optional parameter to class_exists() that can be used to bypass
|
||||
__autoload() which can be helpfull in __autoload() itself.
|
||||
|
||||
* zend_interfaces.c:
|
||||
- Fix warnings
|
||||
|
||||
* zend_interfaces.c
|
||||
zend_interfaces.h
|
||||
zend_iterators.h:
|
||||
- no unneccessary retval initialization
|
||||
- new c-level iterator handler invalidate_current that is optionally
|
||||
used to clear internal caching like in implementation of Iterator
|
||||
|
||||
2004-04-27 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
- Fix prototypes
|
||||
|
||||
2004-04-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
Fix prototype
|
||||
|
||||
2004-04-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
Skip correct amount of stack entries
|
||||
|
||||
* zend_interfaces.c:
|
||||
Capture potential problem by error message
|
||||
|
||||
* zend_reflection_api.c:
|
||||
Show number of classes
|
||||
|
||||
2004-04-25 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend.h:
|
||||
- RC3-dev
|
||||
|
||||
* (php_5_0_0RC2)
|
||||
zend.h:
|
||||
- RC2
|
||||
|
||||
2004-04-23 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_compile.c:
|
||||
- Fixed bug #27923. foreach() without a key should not check if the key
|
||||
- is a reference (Adam)
|
||||
|
||||
2004-04-21 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend.h:
|
||||
- RC2-dev
|
||||
|
||||
* (php_5_0_0RC2RC2)
|
||||
zend.h:
|
||||
- Prepare for RC2RC2 (if everything is OK especially Zeev's interface
|
||||
- patch I'll roll RC2 tomorrow).
|
||||
|
||||
2004-04-21 Zeev Suraski <zeev@zend.com>
|
||||
|
||||
* (php_5_0_0RC2RC2)
|
||||
zend_compile.c:
|
||||
Restore fatal error in case a method that's supposed to implement an
|
||||
interface/abstract method, breaks its prototype
|
||||
|
||||
2004-04-20 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_language_parser.y:
|
||||
- Fix bug #27283 - Exceptions where the last catch() statement was
|
||||
sometimes
|
||||
- skipped.
|
||||
|
||||
2004-04-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
show ini entries and classes for extensions.
|
||||
|
||||
2004-04-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend.c:
|
||||
Retval may not be set when zend_execute() is overloaded
|
||||
|
||||
2004-04-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_execute.c:
|
||||
Handle failure in get_current_data
|
||||
|
||||
2004-04-14 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_extensions.h:
|
||||
- Add comment
|
||||
|
||||
* zend.h:
|
||||
- RC2-dev
|
||||
|
||||
* (php_5_0_0RC2RC1)
|
||||
zend.h:
|
||||
- RC2RC1
|
||||
|
||||
2004-04-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_exceptions.c:
|
||||
Classnames shall start with an uppercase character
|
||||
|
||||
2004-04-13 Zeev Suraski <zeev@zend.com>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
Fix debug_backtrace to show arguments again
|
||||
We need to merge code from debug_backtrace & debug_print_backtrace at
|
||||
some point!
|
||||
|
||||
2004-04-13 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_extensions.h:
|
||||
- Fix API no of Engine 2. The first number is the engine version and the
|
||||
- rest is the API_NO. This way engine2_api_no is always greater than
|
||||
- engine1_api_no.
|
||||
|
||||
* zend.c
|
||||
zend_exceptions.c
|
||||
zend_exceptions.h:
|
||||
- Add hook for exception handler (Derick)
|
||||
|
||||
2004-04-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_API.h:
|
||||
Fix order of macro parameter (synch with other macros)
|
||||
|
||||
2004-04-12 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* OBJECTS2_HOWTO
|
||||
zend_extensions.h
|
||||
zend_ini.c
|
||||
zend_ini.h
|
||||
zend_modules.h:
|
||||
- modifyable -> modifiable
|
||||
|
||||
2004-04-09 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_object_handlers.c:
|
||||
- Fix bug #26441 (When __set() returned a value it corrupted it)
|
||||
|
||||
2004-04-08 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
Bugfix #27519 Reflection_Function constructor crashes with non-existant
|
||||
function's name
|
||||
|
||||
2004-04-07 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
- Hopefully fix the debug_backtrace() code.
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
- Fix crash bug in zend_debug_backtrace(). No idea how come this survived
|
||||
- for so long....
|
||||
|
||||
2004-04-04 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* zend_objects_API.c:
|
||||
Removed unused variable.
|
||||
|
||||
2004-04-03 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
Patch by Timm Friebe:
|
||||
It changes
|
||||
set_exception_handler() to accept the pseudo-type "callable" (instead of
|
||||
a string referring to a global function).
|
||||
|
||||
|
||||
Examples:
|
||||
set_exception_handler('function_name');
|
||||
set_exception_handler(array('class_name', 'static_method'));
|
||||
set_exception_handler(array($instance, 'instance_method'));
|
||||
|
||||
|
||||
This also makes set_exception_handler() more consistent with all the
|
||||
other callback functionality, e.g. set_error_handler().
|
||||
|
||||
* zend_operators.c:
|
||||
- Nuke more old junk
|
||||
|
||||
* zend.h
|
||||
zend_operators.c
|
||||
zend_operators.h:
|
||||
- Nuke code which hasn't been in use for ages.
|
||||
|
||||
2004-04-01 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
MFB: Revert patch for bug #27782.
|
||||
|
||||
* zend_execute.c
|
||||
tests/bug27731.phpt:
|
||||
Fixed reversed condition for error reporting.
|
||||
|
||||
2004-03-31 Dmitry Stogov <dmitry@zend.com>
|
||||
|
||||
* zend_execute.c:
|
||||
Fixed BUG in zend_post_incdec_property
|
||||
|
||||
2004-03-31 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
- Fix typo
|
||||
|
||||
2004-03-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* tests/bug26695.phpt:
|
||||
Fix test
|
||||
|
||||
2004-03-30 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
Fixed bug #27782 (Wrong behaviour of next(), prev() and each()).
|
||||
|
||||
2004-03-30 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
TSRM fix
|
||||
|
||||
* zend.c
|
||||
zend.h
|
||||
zend_API.c
|
||||
zend_API.h
|
||||
zend_globals.h
|
||||
zend_reflection_api.c:
|
||||
- Fix Reflection class names
|
||||
- Add ability to get the extension an internal class was defined in
|
||||
|
||||
2004-03-29 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* acconfig.h:
|
||||
NAN==NAN doest work (Ard)
|
||||
|
||||
* zend_builtin_functions.c:
|
||||
Allow mixed case search for extensions
|
||||
|
||||
2004-03-29 Sebastian Bergmann <sb@sebastian-bergmann.de>
|
||||
|
||||
* zend_execute.c:
|
||||
-clonning+cloning
|
||||
|
||||
2004-03-29 Dmitry Stogov <dmitry@zend.com>
|
||||
|
||||
* zend_execute.c:
|
||||
Implicit clonning strict warning was added for ze1_compatibility_mode
|
||||
|
||||
2004-03-29 Ilia Alshanetsky <ilia@prohost.org>
|
||||
|
||||
* zend_execute.c
|
||||
tests/bug27731.phpt:
|
||||
Fixed bug #27731 (error_reporting() inside @ block fails to set
|
||||
error_reporting level).
|
||||
|
||||
2004-03-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_API.c:
|
||||
Use lowercasing here
|
||||
|
||||
* zend.c:
|
||||
Initialize the complete struct
|
||||
|
||||
2004-03-28 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_language_parser.y:
|
||||
check writability on =& too
|
||||
|
||||
* zend_execute.c:
|
||||
- call set handler if assigning to object having this handler
|
||||
- cleanup: use macros to access object internal vars
|
||||
|
||||
* zend_interfaces.c:
|
||||
preserve ZEND_API in definition
|
||||
|
||||
* zend_interfaces.h:
|
||||
declare as extern
|
||||
|
||||
2004-03-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_reflection_api.c:
|
||||
Fix memleak found by Timm
|
||||
|
||||
2004-03-28 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_operators.c:
|
||||
centralize object-to-scalar conversion, make it work with get handler
|
||||
|
||||
* zend.c:
|
||||
try get handler on printable conversion
|
||||
|
||||
* zend_object_handlers.h:
|
||||
some more clear comments
|
||||
|
||||
* zend_operators.c:
|
||||
Use macros for object parts access
|
||||
|
||||
2004-03-28 Dmitry Stogov <dmitry@zend.com>
|
||||
|
||||
* zend_execute_API.c:
|
||||
fix of fix related to __autoload. (ext/standard/tests/network/bug20134.phpt
|
||||
passes again)
|
||||
|
||||
2004-03-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend.c:
|
||||
Even though it is uncommented it should be right
|
||||
|
||||
2004-03-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
|
||||
|
||||
* zend_API.c
|
||||
zend_compile.c:
|
||||
Force destructors to have empty signatures
|
||||
|
||||
2004-03-26 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_execute.c:
|
||||
- Fix build (thanks to Timm)
|
||||
|
||||
2004-03-25 Derick Rethans <php@derickrethans.nl>
|
||||
|
||||
* zend_language_scanner.l:
|
||||
- Remove old and deprecated <?php_track_vars?> scanner token.
|
||||
|
||||
2004-03-25 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_compile.c:
|
||||
- If __construct() is defined then it will always take precedence over
|
||||
- old style constructors.
|
||||
|
||||
2004-03-25 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_execute.c:
|
||||
no need to use result for RECV's - as in PHP4
|
||||
|
||||
* zend_execute.c:
|
||||
Use get/set handlers for increment.decrement ops on objects
|
||||
|
||||
2004-03-25 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_execute_API.c:
|
||||
/* The compiler is not-reentrant. Make sure we __autoload() only during
|
||||
run-time
|
||||
* (doesn't impact fuctionality of __autoload()
|
||||
*/
|
||||
|
||||
2004-03-25 Dmitry Stogov <dmitry@zend.com>
|
||||
|
||||
* zend_execute_API.c:
|
||||
Using ALLOC_HASHTABLE/FREE_HASHTABLE instead of emalloc/free.
|
||||
|
||||
2004-03-24 Dmitry Stogov <dmitry@zend.com>
|
||||
|
||||
* zend.c
|
||||
zend_execute_API.c
|
||||
zend_globals.h:
|
||||
New autoload protection schema was implemented (Using HashTable instead of
|
||||
boolean flag)
|
||||
|
||||
2004-03-24 Derick Rethans <php@derickrethans.nl>
|
||||
|
||||
* zend_operators.c:
|
||||
- Revert bogus commit
|
||||
|
||||
* zend_operators.c:
|
||||
- Fixed NEWS
|
||||
|
||||
2004-03-24 Dmitry Stogov <dmitry@zend.com>
|
||||
|
||||
* tests/bug27641.phpt:
|
||||
Fixed bug #27641 (Object cloning in ze1_compatibility_mode was
|
||||
reimplemented)
|
||||
|
||||
* zend_execute.c
|
||||
zend_variables.c:
|
||||
Object cloning in ze1 compatibility mode (zend.ze1_compatibility_mode) was
|
||||
reimplemented (Dmitry, Andi)
|
||||
|
||||
2004-03-22 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_compile.c:
|
||||
- Fix bug
|
||||
|
||||
* zend_execute.c:
|
||||
- Remove whitespace
|
||||
|
||||
2004-03-21 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_execute.c:
|
||||
- Improve consistency
|
||||
|
||||
2004-03-21 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_objects_API.c
|
||||
zend_objects_API.h:
|
||||
return zval *, to make it useful for read_property
|
||||
|
||||
* zend_objects_API.c:
|
||||
update to new API
|
||||
|
||||
* zend_execute.c
|
||||
zend_object_handlers.c
|
||||
zend_object_handlers.h:
|
||||
API change for read_property:
|
||||
instead of bool silent it now gets fetch type
|
||||
This can be used for creating proxy objects for write contexts
|
||||
|
||||
2004-03-21 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_execute.c:
|
||||
- Nuke unused code
|
||||
|
||||
2004-03-18 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend.h:
|
||||
- Back to RC2-dev
|
||||
|
||||
2004-03-18 Zeev Suraski <zeev@zend.com>
|
||||
|
||||
* (php_5_0_0RC1)
|
||||
zend.h:
|
||||
Prepare to roll RC1
|
||||
|
||||
* (php_5_0_0RC1)
|
||||
zend_execute.c:
|
||||
Fix possible data corruption with __set()
|
||||
|
||||
2004-03-18 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* zend_execute.c:
|
||||
Improve error message - on E_STRICT, method is actually called,
|
||||
so the error shouldn't say it cannot be called.
|
||||
|
||||
2004-03-18 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* (php_5_0_0RC1)
|
||||
zend_compile.c:
|
||||
- Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT.
|
||||
|
||||
* (php_5_0_0RC1)
|
||||
ZEND_CHANGES:
|
||||
- Update Changes
|
||||
|
||||
2004-03-17 Sascha Schumann <sascha@schumann.cx>
|
||||
|
||||
* zend_multiply.h:
|
||||
Readd x86 implementation
|
||||
|
||||
2004-03-17 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* (php_5_0_0RC1RC2)
|
||||
zend_multiply.h:
|
||||
- Improved patch for support multiplication on 64bit machines
|
||||
|
||||
* (php_5_0_0RC1RC2)
|
||||
zend_execute.c:
|
||||
- Fix tiny bug (one of the reasons we can't support __toString() for
|
||||
- regular objects).
|
||||
|
||||
* (php_5_0_0RC1RC2)
|
||||
zend.c:
|
||||
- Stop make_printable_zval() from calling __toString()
|
||||
|
||||
* zend_execute.c:
|
||||
- Fixed problem with __toString(). Due to the engine's architecture it is
|
||||
- currently not possible to call __toString() anywhere besides print &
|
||||
eval.
|
||||
- Follow up will be on internals@
|
||||
|
||||
2004-03-17 Stanislav Malyshev <stas@zend.com>
|
||||
|
||||
* (php_5_0_0RC1RC2)
|
||||
zend_compile.c:
|
||||
fix typo
|
||||
|
||||
2004-03-17 Andi Gutmans <andi@zend.com>
|
||||
|
||||
* zend_multiply.h
|
||||
zend_operators.c:
|
||||
- Apply Ard's patch to support multiplication & overflow on both 32bit
|
||||
and 64bit machines
|
||||
|
||||
2004-03-16 Derick Rethans <php@derickrethans.nl>
|
||||
|
||||
* zend.c
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ write_property is used to directly write object's property by
|
||||
name. This handler is used to assign property variables or to change them
|
||||
in operations like += or ++ (unless get_property_zval_ptr is also set).
|
||||
|
||||
get_property_zval_ptr is used to obtain pointer to modifyable zval for
|
||||
get_property_zval_ptr is used to obtain pointer to modifiable zval for
|
||||
operations like += or ++. This should be used only if your object model
|
||||
stores properties as real zval's that can be modified from outside.
|
||||
Otherwise this handler should be NULL and the engine will use
|
||||
|
||||
+101
-101
@@ -21,9 +21,9 @@ Changes in the Zend Engine 2.0
|
||||
|
||||
* $this
|
||||
|
||||
Unlike in Zend Engine 1 the pseudo variable $this cannot be
|
||||
exchanged in Zend Engine 2. You can of course modify or work with
|
||||
an object by using $this but you cannot replace $this with another
|
||||
Unlike in Zend Engine 1 the pseudo variable $this cannot be
|
||||
exchanged in Zend Engine 2. You can of course modify or work with
|
||||
an object by using $this but you cannot replace $this with another
|
||||
object to change the original object.
|
||||
|
||||
Example:
|
||||
@@ -35,17 +35,17 @@ Changes in the Zend Engine 2.0
|
||||
$this = $other;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$object = new Foo;
|
||||
$object->prop = 'Hello';
|
||||
|
||||
$other = new Foo;
|
||||
$other->prop = 'Bye';
|
||||
|
||||
|
||||
$object->replace($other);
|
||||
|
||||
|
||||
print $object->prop; // still shows 'Hello'
|
||||
|
||||
|
||||
?>
|
||||
|
||||
Zend Engine 2.0 will issue a compile error, if an assignment
|
||||
@@ -53,9 +53,9 @@ Changes in the Zend Engine 2.0
|
||||
|
||||
* Private and Protected Members.
|
||||
|
||||
The Zend Engine 2.0 introduces private and protected member
|
||||
variables. Note that for performance reasons no error message is
|
||||
emitted in case of an illegal access to a private or protectecd
|
||||
The Zend Engine 2.0 introduces private and protected member
|
||||
variables. Note that for performance reasons no error message is
|
||||
emitted in case of an illegal access to a private or protectecd
|
||||
member variable.
|
||||
|
||||
Example:
|
||||
@@ -75,7 +75,7 @@ Changes in the Zend Engine 2.0
|
||||
|
||||
class MyClass2 extends MyClass {
|
||||
protected $Foo;
|
||||
|
||||
|
||||
function printHello() {
|
||||
MyClass::printHello(); /* Should print */
|
||||
print "MyClass2::printHello() " . $this->Hello; /* Shouldn't print out anything */
|
||||
@@ -96,9 +96,9 @@ Changes in the Zend Engine 2.0
|
||||
print $obj->Foo; /* Shouldn't print out anything */
|
||||
$obj->printHello();
|
||||
?>
|
||||
|
||||
Protected member variables can be accessed in classes extending the
|
||||
class they are declared in, whereas private member variables can
|
||||
|
||||
Protected member variables can be accessed in classes extending the
|
||||
class they are declared in, whereas private member variables can
|
||||
only be accessed by the class they belong to.
|
||||
|
||||
* Private and protected methods.
|
||||
@@ -130,14 +130,14 @@ Changes in the Zend Engine 2.0
|
||||
$o->aPublicMethod();
|
||||
?>
|
||||
|
||||
Old code that has no user-defined classes or functions named
|
||||
Old code that has no user-defined classes or functions named
|
||||
'public', 'protected' or 'private' should run without modifications.
|
||||
|
||||
* Abstract Classes and Methods.
|
||||
|
||||
The Zend Engine 2.0 introduces abstract classes and methods. An
|
||||
abstract method only declares the method's signature and does not
|
||||
provide an implementation. A class that contains abstract methods
|
||||
The Zend Engine 2.0 introduces abstract classes and methods. An
|
||||
abstract method only declares the method's signature and does not
|
||||
provide an implementation. A class that contains abstract methods
|
||||
needs to be declared abstract.
|
||||
|
||||
Example:
|
||||
@@ -160,7 +160,7 @@ Changes in the Zend Engine 2.0
|
||||
Classes that do not have abstract methods can be declared abstract
|
||||
to prevent them from being instantiated.
|
||||
|
||||
Old code that has no user-defined classes or functions named
|
||||
Old code that has no user-defined classes or functions named
|
||||
'abstract' should run without modifications.
|
||||
|
||||
* Interfaces.
|
||||
@@ -182,13 +182,13 @@ Changes in the Zend Engine 2.0
|
||||
}
|
||||
?>
|
||||
|
||||
Old code that has no user-defined classes or functions named
|
||||
Old code that has no user-defined classes or functions named
|
||||
'interface' or 'implements' should run without modifications.
|
||||
|
||||
An interface may extend one or more base interfaces (but not
|
||||
|
||||
An interface may extend one or more base interfaces (but not
|
||||
implement them). Neither a class nor an interface can inherit
|
||||
methods of the same name from different root interfaces.
|
||||
|
||||
methods of the same name from different root interfaces.
|
||||
|
||||
Interfaces may contain abstract static methods.
|
||||
|
||||
Example:
|
||||
@@ -197,7 +197,7 @@ Changes in the Zend Engine 2.0
|
||||
interface Printable {
|
||||
function dump();
|
||||
}
|
||||
|
||||
|
||||
interface Streamable extends Printable {
|
||||
function writeToStream();
|
||||
static function readFromStream();
|
||||
@@ -215,14 +215,14 @@ Changes in the Zend Engine 2.0
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
A class that does not implement all interface methods must be
|
||||
|
||||
A class that does not implement all interface methods must be
|
||||
declared as an abstract class.
|
||||
|
||||
* Class Type Hints.
|
||||
|
||||
While remaining loosely typed the Zend Engine 2.0 introduces the
|
||||
ability to use class type hints to declare the expected class of
|
||||
While remaining loosely typed the Zend Engine 2.0 introduces the
|
||||
ability to use class type hints to declare the expected class of
|
||||
objects that are passed as parameters to a method.
|
||||
|
||||
Example:
|
||||
@@ -275,7 +275,7 @@ Changes in the Zend Engine 2.0
|
||||
* Final methods and classes.
|
||||
|
||||
The Zend Engine 2.0 introduces the "final" keyword to declare
|
||||
final methods. Those cannot be overridden by sub-classes.
|
||||
final methods. Those cannot be overridden by sub-classes.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -287,8 +287,8 @@ Changes in the Zend Engine 2.0
|
||||
}
|
||||
?>
|
||||
|
||||
It is furthermore possible to make a class final. Doing this
|
||||
prevents a class from being specialized (it cannot be inherited
|
||||
It is furthermore possible to make a class final. Doing this
|
||||
prevents a class from being specialized (it cannot be inherited
|
||||
by another class). There's no need to declare the methods of
|
||||
a final class themselves as final.
|
||||
|
||||
@@ -304,7 +304,7 @@ Changes in the Zend Engine 2.0
|
||||
|
||||
Properties cannot be final. See per-class constants below.
|
||||
|
||||
Old code that has no user-defined classes or functions named
|
||||
Old code that has no user-defined classes or functions named
|
||||
'final' should run without modifications.
|
||||
|
||||
* Object Cloning.
|
||||
@@ -339,9 +339,9 @@ Changes in the Zend Engine 2.0
|
||||
all of the object's properties. If a __clone() method is
|
||||
defined, then it will be responsible to set the necessary
|
||||
properties in the created object. For convenience, the engine
|
||||
ensures, that the clone will be initialized with all of the
|
||||
properties from the source object, so that developers can start
|
||||
with a by-value replica of the source object, and only override
|
||||
ensures, that the clone will be initialized with all of the
|
||||
properties from the source object, so that developers can start
|
||||
with a by-value replica of the source object, and only override
|
||||
properties that need to be changed.
|
||||
|
||||
Example:
|
||||
@@ -374,7 +374,7 @@ Changes in the Zend Engine 2.0
|
||||
print $obj_clone->name . "\n";
|
||||
print $obj_clone->address . "\n";
|
||||
?>
|
||||
|
||||
|
||||
* Unified Constructors.
|
||||
|
||||
The Zend Engine allows developers to declare constructor methods
|
||||
@@ -474,7 +474,7 @@ Changes in the Zend Engine 2.0
|
||||
echo 'Foo::constant = ' . Foo::constant . "\n";
|
||||
?>
|
||||
|
||||
Old code that has no user-defined classes or functions
|
||||
Old code that has no user-defined classes or functions
|
||||
named 'const' will run without modifications.
|
||||
|
||||
* Exceptions.
|
||||
@@ -483,16 +483,16 @@ Changes in the Zend Engine 2.0
|
||||
introduces a exception model similar to that of other programming
|
||||
languages. But there is no catch all and no finally clause.
|
||||
|
||||
Old code that has no user-defined classes or functions 'catch',
|
||||
Old code that has no user-defined classes or functions 'catch',
|
||||
'throw' and 'try' will run without modifications.
|
||||
|
||||
|
||||
Exceptions can be rethrown in catch blocks. Also it is possible to
|
||||
have multiple catch blocks. In that case the caught exception is
|
||||
have multiple catch blocks. In that case the caught exception is
|
||||
compared with the classtype of each catch block from top to bottom
|
||||
and the first block that has a 'instanceof' match gets executed.
|
||||
When the catch block finishes execution continues at the end of
|
||||
When the catch block finishes execution continues at the end of
|
||||
the last catch block. If no catch block has a 'instanceof' match
|
||||
then the next try/catch block is searched until no more try/catch
|
||||
then the next try/catch block is searched until no more try/catch
|
||||
blocks are available. In that case the exception is an uncaught
|
||||
exception and the program terminates with showing the exception.
|
||||
|
||||
@@ -529,23 +529,23 @@ Changes in the Zend Engine 2.0
|
||||
echo $exception;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
Even though the above example shows that it is possible to define
|
||||
exception classes that don't inherit from Exception it is best to
|
||||
do so. This is because the internal Exception class can gather a
|
||||
lot of information otherwise not available. The PHP code emulation
|
||||
code would look something like shown below. The comments show the
|
||||
meaning of each property. As the code shows it is possible to read
|
||||
meaning of each property. As the code shows it is possible to read
|
||||
any available information by using the getter methods. But since
|
||||
some of the methods are used internally they are marked final. All
|
||||
in all the class is very restrictive because it must be ensured
|
||||
some of the methods are used internally they are marked final. All
|
||||
in all the class is very restrictive because it must be ensured
|
||||
that anything used internally always works as expected.
|
||||
|
||||
|
||||
Emulating class Exception:
|
||||
|
||||
<?php
|
||||
class Exception {
|
||||
function __construct(string $message=NULL, int $code=0) {
|
||||
function __construct(/*string*/ $message=NULL, /*int*/ $code=0) {
|
||||
if (func_num_args()) {
|
||||
$this->message = $message;
|
||||
}
|
||||
@@ -555,15 +555,15 @@ Changes in the Zend Engine 2.0
|
||||
$this->trace = debug_backtrace();
|
||||
$this->string = StringFormat($this);
|
||||
}
|
||||
|
||||
protected $message = 'Unknown exception'; // exception message
|
||||
|
||||
protected $message = 'Unknown exception'; // exception message
|
||||
protected $code = 0; // user defined exception code
|
||||
protected $file; // source filename of exception
|
||||
protected $line; // source line of exception
|
||||
|
||||
|
||||
private $trace; // backtrace of exception
|
||||
private $string; // internal only!!
|
||||
|
||||
|
||||
final function getMessage() {
|
||||
return $this->message;
|
||||
}
|
||||
@@ -592,19 +592,19 @@ Changes in the Zend Engine 2.0
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
If you derive your exception classes from this Exception base class
|
||||
your exceptions will be nicely shown in the builtin handler for
|
||||
your exceptions will be nicely shown in the builtin handler for
|
||||
uncaught exceptions.
|
||||
|
||||
Note: The method getMessage() is a final read only access method to
|
||||
|
||||
Note: The method getMessage() is a final read only access method to
|
||||
the private proeprty message that is set in the constructor. If you
|
||||
feel a need to overwrite the exception display then overload method
|
||||
__toString() in your derived class or implement your own extneral
|
||||
__toString() in your derived class or implement your own extneral
|
||||
exception display function to accomplish your desired formatting.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
<?php
|
||||
function display_exception(Exception $ex)
|
||||
{
|
||||
@@ -612,7 +612,7 @@ Changes in the Zend Engine 2.0
|
||||
echo $ex->getTrace();
|
||||
echo '</pre>';
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
// your code here
|
||||
@@ -662,9 +662,9 @@ Changes in the Zend Engine 2.0
|
||||
}
|
||||
|
||||
print foo::$my_static;
|
||||
|
||||
|
||||
$obj = foo;
|
||||
|
||||
|
||||
print $obj->my_prop;
|
||||
?>
|
||||
|
||||
@@ -691,14 +691,14 @@ Changes in the Zend Engine 2.0
|
||||
* instanceof.
|
||||
New support for an instanceof operator which checks if an object
|
||||
is of a certain class or interface type.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
class Foo {
|
||||
}
|
||||
|
||||
|
||||
$obj = new Foo();
|
||||
if ($obj instanceof Foo) {
|
||||
print "Yay!\n";
|
||||
@@ -720,9 +720,9 @@ Changes in the Zend Engine 2.0
|
||||
|
||||
* __autoload().
|
||||
|
||||
The __autoload() interceptor function will be automatically called
|
||||
when an undeclared class is to be instantiated. The name of that
|
||||
class will be passed to the __autoload() interceptor function as its
|
||||
The __autoload() interceptor function will be automatically called
|
||||
when an undeclared class is to be instantiated. The name of that
|
||||
class will be passed to the __autoload() interceptor function as its
|
||||
only argument. __autoload() must succeed in loading the class. If it
|
||||
doesn't then an E_ERROR is emitted.
|
||||
|
||||
@@ -817,24 +817,24 @@ Changes in the Zend Engine 2.0
|
||||
}
|
||||
?>
|
||||
|
||||
Each class whose instances can be iterated with foreach should
|
||||
Each class whose instances can be iterated with foreach should
|
||||
implement the empty interface 'Traversable'. Hence any object
|
||||
that says it implements 'Traversable' can be used with foreach.
|
||||
|
||||
The interfaces 'IteratorAggregate' and 'Iterator' allow to specify
|
||||
how class objects are iterated in PHP code. The first of them simply
|
||||
has a method 'getIterator' which must return an object that either
|
||||
implements the interface 'Iterator' or is instantiated from an
|
||||
has a method 'getIterator' which must return an object that either
|
||||
implements the interface 'Iterator' or is instantiated from an
|
||||
internal class that can be iterated.
|
||||
|
||||
Example:
|
||||
|
||||
<?php
|
||||
class ObjectIterator implements Iterator {
|
||||
|
||||
|
||||
private $obj;
|
||||
private $num;
|
||||
|
||||
|
||||
function __construct($obj) {
|
||||
$this->obj = $obj;
|
||||
}
|
||||
@@ -859,23 +859,23 @@ Changes in the Zend Engine 2.0
|
||||
$this->num++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Object implements IteratorAggregate {
|
||||
|
||||
|
||||
public $max = 3;
|
||||
|
||||
|
||||
function getIterator() {
|
||||
return new ObjectIterator($this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$obj = new Object;
|
||||
|
||||
|
||||
// this foreach ...
|
||||
foreach($obj as $key => $val) {
|
||||
echo "$key = $val\n";
|
||||
}
|
||||
|
||||
|
||||
// matches the following 7 lines with the for directive.
|
||||
$it = $obj->getIterator();
|
||||
for($it->rewind(); $it->valid(); $it->next()) {
|
||||
@@ -886,14 +886,14 @@ Changes in the Zend Engine 2.0
|
||||
unset($it);
|
||||
?>
|
||||
|
||||
The matching for directive is very intersting here since it shows
|
||||
The matching for directive is very intersting here since it shows
|
||||
the use of all abstract methods declared in the interfaces Iterator
|
||||
and IteratorAggregate respectively.
|
||||
|
||||
* __METHOD__
|
||||
|
||||
The pseudo constant __METHOD__ shows the current class and method
|
||||
when used inside a method and the function when used outside of a
|
||||
The pseudo constant __METHOD__ shows the current class and method
|
||||
when used inside a method and the function when used outside of a
|
||||
class.
|
||||
|
||||
Example:
|
||||
@@ -911,12 +911,12 @@ Changes in the Zend Engine 2.0
|
||||
|
||||
* __toString()
|
||||
|
||||
The magic method __toString() allows to overload the object to
|
||||
string conversion. This conversion is only done automatically for
|
||||
printing functions (echo, *printf) but not for other functions
|
||||
The magic method __toString() allows to overload the object to
|
||||
string conversion. This conversion is only done automatically for
|
||||
the printing functions (echo, print) but not for other functions
|
||||
that expect strings. Also the function __toString is not used in
|
||||
places where objects are not allowed but strings are like array
|
||||
indices. Note that specialized objects maybe converted to a string
|
||||
indices. Note that specialized objects may be converted to a string
|
||||
in any place but without calling __toString().
|
||||
|
||||
Example:
|
||||
@@ -940,16 +940,16 @@ Changes in the Zend Engine 2.0
|
||||
?>
|
||||
|
||||
* Reflection API
|
||||
|
||||
PHP5 comes with a complete reflection API that adds the ability to
|
||||
|
||||
PHP 5 comes with a complete Reflection API that adds the ability to
|
||||
reverse-engineer classes, interfaces, functions and methods as well
|
||||
as extensions.
|
||||
|
||||
The reflection API also offers ways of getting doc comments for
|
||||
|
||||
The Reflection API also offers ways of getting doc comments for
|
||||
functions, classes and methods.
|
||||
|
||||
|
||||
Nearly all aspects of object oriented code can be reflected by
|
||||
using the reflection API which is documented separatley:
|
||||
using the Reflection API which is documented separately:
|
||||
http://sitten-polizei.de/php/reflection_api/docs/language.reflection.html
|
||||
|
||||
Example:
|
||||
@@ -962,11 +962,11 @@ Changes in the Zend Engine 2.0
|
||||
}
|
||||
}
|
||||
|
||||
reflection_class::export('Foo');
|
||||
reflection_object::export(new Foo);
|
||||
reflection_method::export('Foo', 'func');
|
||||
reflection_property::export('Foo', 'prop');
|
||||
reflection_extension::export('standard');
|
||||
ReflectionClass::export('Foo');
|
||||
ReflectionObject::export(new Foo);
|
||||
ReflectionMethod::export('Foo', 'func');
|
||||
ReflectionProperty::export('Foo', 'prop');
|
||||
ReflectionExtension::export('standard');
|
||||
?>
|
||||
|
||||
* New memory manager
|
||||
@@ -977,7 +977,7 @@ Changes in the Zend Engine 2.0
|
||||
* Others
|
||||
Probably other changes which we forgot to list. This list will be kept up-to-date
|
||||
as much as possible.
|
||||
|
||||
|
||||
|
||||
Changes in the Zend Engine 1.0
|
||||
|
||||
|
||||
@@ -68,8 +68,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#ifndef zend_isnan
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(NAN)
|
||||
#define zend_isnan(a) (((a)==NAN)?1:0)
|
||||
#elif defined(HAVE_FPCLASS)
|
||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
--TEST--
|
||||
Bug #27641 (zend.ze1_compatibility_mode = On causes object properties to be misreported)
|
||||
--SKIPIF--
|
||||
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public $a = "Default for A";
|
||||
public $b = "Default for B";
|
||||
|
||||
function __construct($a, $b) {
|
||||
$this->a = $a;
|
||||
$this->b = $b;
|
||||
}
|
||||
function A() {
|
||||
$args = func_get_args();
|
||||
call_user_func_array(Array(&$this, '__construct'), $args);
|
||||
}
|
||||
}
|
||||
|
||||
$t = new A("New A", "New B");
|
||||
print_r($t);
|
||||
print_r(get_class_vars(get_class($t)));
|
||||
print_r(get_object_vars($t));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Strict Standards: Redefining already defined constructor for class A in %sbug27641.php on line %d
|
||||
A Object
|
||||
(
|
||||
[a] => New A
|
||||
[b] => New B
|
||||
)
|
||||
Array
|
||||
(
|
||||
[a] => Default for A
|
||||
[b] => Default for B
|
||||
)
|
||||
Array
|
||||
(
|
||||
[a] => New A
|
||||
[b] => New B
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #27731 (error_reporing() call inside @ block does not work correctly)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
@error_reporting(E_WARNING);
|
||||
var_dump(error_reporting());
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
--TEST--
|
||||
Bug #29505 (get_class_vars() severely broken when used with arrays)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public $empty = array();
|
||||
public $three = array(1, "b"=>"c", 3=>array());
|
||||
}
|
||||
|
||||
var_dump(get_class_vars('Test'));
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
["empty"]=>
|
||||
array(0) {
|
||||
}
|
||||
["three"]=>
|
||||
array(3) {
|
||||
[0]=>
|
||||
int(1)
|
||||
["b"]=>
|
||||
string(1) "c"
|
||||
[3]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
+28
-13
@@ -218,16 +218,26 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
|
||||
TSRMLS_FETCH();
|
||||
#if 0
|
||||
/* Standard PHP objects */
|
||||
if (expr->value.obj.handlers == &std_object_handlers) {
|
||||
if (Z_OBJ_HT_P(expr) == &std_object_handlers || !Z_OBJ_HT_P(expr)->cast_object) {
|
||||
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
zend_error(E_NOTICE, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
|
||||
}
|
||||
#endif
|
||||
if (expr->value.obj.handlers->cast_object &&
|
||||
expr->value.obj.handlers->cast_object(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
if (Z_OBJ_HANDLER_P(expr, cast_object)) {
|
||||
if(Z_OBJ_HANDLER_P(expr, cast_object)(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if(Z_OBJ_HANDLER_P(expr, get)) {
|
||||
zval *z = Z_OBJ_HANDLER_P(expr, get)(expr TSRMLS_CC);
|
||||
if(Z_TYPE_P(z) != IS_OBJECT) {
|
||||
zend_make_printable_zval(z, expr_copy, use_copy);
|
||||
FREE_ZVAL(z);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (EG(exception)) {
|
||||
zval_dtor(expr_copy);
|
||||
@@ -395,7 +405,7 @@ static FILE *zend_fopen_wrapper(const char *filename, char **opened_path)
|
||||
|
||||
static void register_standard_class(TSRMLS_D)
|
||||
{
|
||||
zend_standard_class_def = malloc(sizeof(zend_class_entry));
|
||||
zend_standard_class_def = calloc(1, sizeof(zend_class_entry));
|
||||
|
||||
zend_standard_class_def->type = ZEND_INTERNAL_CLASS;
|
||||
zend_standard_class_def->name_length = sizeof("stdClass") - 1;
|
||||
@@ -419,7 +429,7 @@ static void zend_set_default_compile_time_values(TSRMLS_D)
|
||||
static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS_DC)
|
||||
{
|
||||
zend_function tmp_func;
|
||||
zend_class_entry tmp_class;
|
||||
zend_class_entry *tmp_class;
|
||||
|
||||
compiler_globals->compiled_filename = NULL;
|
||||
|
||||
@@ -429,7 +439,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
|
||||
|
||||
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
|
||||
zend_hash_init_ex(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
|
||||
zend_hash_copy(compiler_globals->class_table, global_class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry));
|
||||
zend_hash_copy(compiler_globals->class_table, global_class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry *));
|
||||
|
||||
zend_set_default_compile_time_values(TSRMLS_C);
|
||||
|
||||
@@ -467,8 +477,9 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS
|
||||
EG(user_error_handler) = NULL;
|
||||
EG(user_exception_handler) = NULL;
|
||||
EG(in_execution) = 0;
|
||||
EG(in_autoload) = 0;
|
||||
EG(in_autoload) = NULL;
|
||||
EG(current_execute_data) = NULL;
|
||||
EG(current_module) = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -501,8 +512,8 @@ static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/* FreeBSD floating point precision fix */
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
/* FreeBSD and DragonFly floating point precision fix */
|
||||
#include <floatingpoint.h>
|
||||
#endif
|
||||
|
||||
@@ -543,8 +554,8 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
alloc_globals_ctor(&alloc_globals TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/* FreeBSD floating point precision fix */
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
/* FreeBSD and DragonFly floating point precision fix */
|
||||
fpsetmask(0);
|
||||
#endif
|
||||
|
||||
@@ -570,6 +581,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute = execute;
|
||||
zend_execute_internal = NULL;
|
||||
zend_throw_exception_hook = NULL;
|
||||
|
||||
zend_init_opcodes_handlers();
|
||||
|
||||
@@ -962,6 +974,9 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC)==SUCCESS) {
|
||||
if (retval) {
|
||||
if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) {
|
||||
zend_error_cb(type, error_filename, error_lineno, format, args);
|
||||
}
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
} else {
|
||||
@@ -1080,7 +1095,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
local_retval = NULL;
|
||||
}
|
||||
} else if (!retval) {
|
||||
} else if (!retval && *EG(return_value_ptr_ptr)) {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
local_retval = NULL;
|
||||
}
|
||||
|
||||
+4
-5
@@ -22,7 +22,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "2.0.0-dev"
|
||||
#define ZEND_VERSION "2.0.1RC1"
|
||||
|
||||
#define ZEND_ENGINE_2
|
||||
|
||||
@@ -91,7 +91,7 @@ const char *zend_mh_bundle_error(void);
|
||||
|
||||
#endif /* HAVE_MACH_O_DYLD_H */
|
||||
|
||||
#if defined(HAVE_LIBDL)
|
||||
#if defined(HAVE_LIBDL) && !defined(HAVE_MACH_O_DYLD_H)
|
||||
|
||||
# ifndef RTLD_LAZY
|
||||
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
|
||||
@@ -339,6 +339,8 @@ struct _zend_class_entry {
|
||||
zend_uint line_end;
|
||||
char *doc_comment;
|
||||
zend_uint doc_comment_len;
|
||||
|
||||
struct _zend_module_entry *module;
|
||||
};
|
||||
|
||||
#include "zend_stream.h"
|
||||
@@ -393,9 +395,6 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
|
||||
#define IS_CONSTANT 8
|
||||
#define IS_CONSTANT_ARRAY 9
|
||||
|
||||
/* Special data type to temporarily mark large numbers */
|
||||
#define FLAG_IS_BC 10 /* for parser internal use only */
|
||||
|
||||
/* Ugly hack to support constants as static array indices */
|
||||
#define IS_CONSTANT_INDEX 0x80
|
||||
|
||||
|
||||
+60
-23
@@ -694,6 +694,11 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
|
||||
zval *tmp;
|
||||
zend_object *object;
|
||||
|
||||
if (class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
|
||||
char *what = class_type->ce_flags & ZEND_ACC_INTERFACE ? "interface" : "abstract class";
|
||||
zend_error(E_ERROR, "Cannot instantiate %s %s", what, class_type->name);
|
||||
}
|
||||
|
||||
if (!class_type->constants_updated) {
|
||||
zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
|
||||
zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
|
||||
@@ -1158,22 +1163,57 @@ ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *valu
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC)
|
||||
{
|
||||
int name_len;
|
||||
char *lcname;
|
||||
zend_module_entry *module_ptr;
|
||||
|
||||
if (!module) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
zend_printf("%s: Registering module %d\n", module->name, module->module_number);
|
||||
#endif
|
||||
name_len = strlen(module->name);
|
||||
lcname = zend_str_tolower_dup(module->name, name_len);
|
||||
|
||||
if (zend_hash_add(&module_registry, lcname, name_len+1, (void *)module, sizeof(zend_module_entry), (void**)&module_ptr)==FAILURE) {
|
||||
zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name);
|
||||
efree(lcname);
|
||||
return FAILURE;
|
||||
}
|
||||
efree(lcname);
|
||||
module = module_ptr;
|
||||
|
||||
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type TSRMLS_CC)==FAILURE) {
|
||||
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (!module->module_started && module->module_startup_func) {
|
||||
EG(current_module) = module;
|
||||
if (module->module_startup_func(module->type, module->module_number TSRMLS_CC)==FAILURE) {
|
||||
zend_error(E_CORE_ERROR,"Unable to start %s module", module->name);
|
||||
EG(current_module) = NULL;
|
||||
return FAILURE;
|
||||
}
|
||||
EG(current_module) = NULL;
|
||||
}
|
||||
|
||||
module->module_started=1;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
ZEND_API int zend_startup_module(zend_module_entry *module)
|
||||
{
|
||||
if (module) {
|
||||
module->module_number = zend_next_free_module();
|
||||
if (module->module_startup_func) {
|
||||
TSRMLS_FETCH();
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (module->module_startup_func(MODULE_PERSISTENT, module->module_number TSRMLS_CC)==FAILURE) {
|
||||
zend_error(E_CORE_ERROR,"Unable to start %s module", module->name);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
module->type = MODULE_PERSISTENT;
|
||||
zend_register_module(module);
|
||||
}
|
||||
return SUCCESS;
|
||||
module->module_number = zend_next_free_module();
|
||||
module->type = MODULE_PERSISTENT;
|
||||
return zend_register_module_ex(module TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
@@ -1275,6 +1315,10 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
|
||||
ctor = reg_function;
|
||||
} else if (!strcmp(ptr->fname, ZEND_DESTRUCTOR_FUNC_NAME)) {
|
||||
dtor = reg_function;
|
||||
if (internal_function->num_args) {
|
||||
zend_error(error_type, "Destructor %s::%s() cannot take arguments", scope->name, ptr->fname);
|
||||
}
|
||||
|
||||
} else if (!strcmp(ptr->fname, ZEND_CLONE_FUNC_NAME)) {
|
||||
clone = reg_function;
|
||||
}
|
||||
@@ -1351,16 +1395,8 @@ ZEND_API void zend_unregister_functions(zend_function_entry *functions, int coun
|
||||
ZEND_API int zend_register_module(zend_module_entry *module)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
#if 0
|
||||
zend_printf("%s: Registering module %d\n", module->name, module->module_number);
|
||||
#endif
|
||||
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type TSRMLS_CC)==FAILURE) {
|
||||
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
|
||||
return FAILURE;
|
||||
}
|
||||
module->module_started=1;
|
||||
return zend_hash_add(&module_registry, module->name, strlen(module->name)+1, (void *)module, sizeof(zend_module_entry), NULL);
|
||||
|
||||
return zend_register_module_ex(module TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
@@ -1457,6 +1493,7 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class
|
||||
class_entry->type = ZEND_INTERNAL_CLASS;
|
||||
zend_initialize_class_data(class_entry, 0 TSRMLS_CC);
|
||||
class_entry->ce_flags = ce_flags;
|
||||
class_entry->module = EG(current_module);
|
||||
|
||||
if (class_entry->builtin_functions) {
|
||||
zend_register_functions(class_entry, class_entry->builtin_functions, &class_entry->function_table, MODULE_PERSISTENT TSRMLS_CC);
|
||||
|
||||
+3
-1
@@ -53,7 +53,7 @@ typedef struct _zend_function_entry {
|
||||
#define ZEND_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, 0)
|
||||
#define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_FN(classname##_##name), arg_info, flags)
|
||||
#define ZEND_ABSTRACT_ME(classname, name, arg_info) ZEND_FENTRY(name, NULL, arg_info, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
|
||||
#define ZEND_MALIAS(name, classname, alias, arg_info, flags) \
|
||||
#define ZEND_MALIAS(classname, name, alias, arg_info, flags) \
|
||||
ZEND_FENTRY(name, ZEND_FN(classname##_##alias), arg_info, flags)
|
||||
#define ZEND_ME_MAPPING(name, func_name, arg_types) ZEND_NAMED_FE(name, ZEND_FN(func_name), arg_types)
|
||||
|
||||
@@ -135,6 +135,7 @@ typedef struct _zend_function_entry {
|
||||
class_container.interfaces = NULL; \
|
||||
class_container.get_iterator = NULL; \
|
||||
class_container.iterator_funcs.funcs = NULL; \
|
||||
class_container.module = NULL; \
|
||||
}
|
||||
|
||||
int zend_next_free_module(void);
|
||||
@@ -166,6 +167,7 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC,
|
||||
ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC);
|
||||
ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC);
|
||||
ZEND_API int zend_register_module(zend_module_entry *module_entry);
|
||||
ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
|
||||
|
||||
ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry TSRMLS_DC);
|
||||
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC);
|
||||
|
||||
+54
-52
@@ -75,7 +75,7 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
|
||||
#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\
|
||||
if (AG(memory_limit)<AG(allocated_memory)) {\
|
||||
int php_mem_limit = AG(memory_limit); \
|
||||
if (AG(memory_limit)+1048576 > AG(allocated_memory) - rs) { \
|
||||
if (EG(in_execution) && AG(memory_limit)+1048576 > AG(allocated_memory) - rs) { \
|
||||
AG(memory_limit) = AG(allocated_memory) + 1048576; \
|
||||
if (file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", php_mem_limit, file, lineno, s); \
|
||||
@@ -99,6 +99,7 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
|
||||
#endif
|
||||
|
||||
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
#define REMOVE_POINTER_FROM_LIST(p) \
|
||||
if (p==AG(head)) { \
|
||||
AG(head) = p->pNext; \
|
||||
@@ -108,14 +109,21 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
|
||||
if (p->pNext) { \
|
||||
p->pNext->pLast = p->pLast; \
|
||||
}
|
||||
#else
|
||||
#define REMOVE_POINTER_FROM_LIST(p)
|
||||
#endif
|
||||
|
||||
#define ADD_POINTER_TO_LIST(p) \
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
#define ADD_POINTER_TO_LIST(p) \
|
||||
p->pNext = AG(head); \
|
||||
if (AG(head)) { \
|
||||
AG(head)->pLast = p; \
|
||||
} \
|
||||
AG(head) = p; \
|
||||
p->pLast = (zend_mem_header *) NULL;
|
||||
#else
|
||||
#define ADD_POINTER_TO_LIST(p)
|
||||
#endif
|
||||
|
||||
#define DECLARE_CACHE_VARS() \
|
||||
unsigned int real_size; \
|
||||
@@ -164,6 +172,12 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
if (CACHE_INDEX<MAX_CACHED_MEMORY) {
|
||||
AG(cache_stats)[CACHE_INDEX][0]++;
|
||||
}
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
CHECK_MEMORY_LIMIT(size, SIZE);
|
||||
if (AG(allocated_memory) > AG(allocated_memory_peak)) {
|
||||
AG(allocated_memory_peak) = AG(allocated_memory);
|
||||
}
|
||||
#endif
|
||||
p = (zend_mem_header *) ZEND_DO_MALLOC(sizeof(zend_mem_header) + MEM_HEADER_PADDING + SIZE + END_MAGIC_SIZE);
|
||||
#if !ZEND_DISABLE_MEMORY_CACHE
|
||||
@@ -183,9 +197,7 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
return (void *)p;
|
||||
}
|
||||
p->cached = 0;
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
#endif
|
||||
p->size = size; /* Save real size for correct cache output */
|
||||
#if ZEND_DEBUG
|
||||
p->filename = __zend_filename;
|
||||
@@ -199,12 +211,6 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
# endif
|
||||
memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
CHECK_MEMORY_LIMIT(size, SIZE);
|
||||
if (AG(allocated_memory) > AG(allocated_memory_peak)) {
|
||||
AG(allocated_memory_peak) = AG(allocated_memory);
|
||||
}
|
||||
#endif
|
||||
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING);
|
||||
@@ -272,9 +278,7 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
}
|
||||
#endif
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
#endif
|
||||
|
||||
#if MEMORY_LIMIT
|
||||
AG(allocated_memory) -= SIZE;
|
||||
@@ -331,9 +335,13 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
|
||||
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
#if MEMORY_LIMIT
|
||||
CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size));
|
||||
if (AG(allocated_memory) > AG(allocated_memory_peak)) {
|
||||
AG(allocated_memory_peak) = AG(allocated_memory);
|
||||
}
|
||||
#endif
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
p = (zend_mem_header *) ZEND_DO_REALLOC(p, sizeof(zend_mem_header)+MEM_HEADER_PADDING+SIZE+END_MAGIC_SIZE);
|
||||
if (!p) {
|
||||
if (!allow_failure) {
|
||||
@@ -344,27 +352,17 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
ADD_POINTER_TO_LIST(orig);
|
||||
#endif
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *)NULL;
|
||||
}
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
#endif
|
||||
#if ZEND_DEBUG
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size));
|
||||
if (AG(allocated_memory) > AG(allocated_memory_peak)) {
|
||||
AG(allocated_memory_peak) = AG(allocated_memory);
|
||||
}
|
||||
#endif
|
||||
|
||||
p->size = size;
|
||||
|
||||
@@ -468,7 +466,7 @@ ZEND_API void start_memory_manager(TSRMLS_D)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
|
||||
ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
|
||||
{
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
zend_mem_header *p, *t;
|
||||
@@ -477,13 +475,35 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
|
||||
zend_uint grand_total_leaks=0;
|
||||
#endif
|
||||
|
||||
#if !ZEND_DISABLE_MEMORY_CACHE
|
||||
/* Free memory cache even on partial shutdown to avoid fragmentation */
|
||||
if (1 || full_shutdown) {
|
||||
unsigned int i, j;
|
||||
zend_mem_header *ptr;
|
||||
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<AG(cache_count)[i]; j++) {
|
||||
ptr = (zend_mem_header *) AG(cache)[i][j];
|
||||
# if MEMORY_LIMIT
|
||||
AG(allocated_memory) -= REAL_SIZE(ptr->size);
|
||||
# endif
|
||||
REMOVE_POINTER_FROM_LIST(ptr);
|
||||
ZEND_DO_FREE(ptr);
|
||||
}
|
||||
AG(cache_count)[i] = 0;
|
||||
}
|
||||
}
|
||||
#endif /* !ZEND_DISABLE_MEMORY_CACHE */
|
||||
|
||||
#if defined(ZEND_MM) && !ZEND_DEBUG
|
||||
if (clean_cache) {
|
||||
zend_mm_shutdown(&AG(mm_heap));
|
||||
zend_mm_shutdown(&AG(mm_heap));
|
||||
if (full_shutdown) {
|
||||
return;
|
||||
}
|
||||
zend_mm_startup(&AG(mm_heap), 256*1024);
|
||||
|
||||
#elif defined(ZEND_WIN32) && !ZEND_DEBUG
|
||||
if (clean_cache && AG(memory_heap)) {
|
||||
if (full_shutdown && AG(memory_heap)) {
|
||||
HeapDestroy(AG(memory_heap));
|
||||
return;
|
||||
}
|
||||
@@ -506,32 +526,13 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
|
||||
}
|
||||
#endif /* ZEND_ENABLE_FAST_CACHE */
|
||||
|
||||
#if !ZEND_DISABLE_MEMORY_CACHE && !defined(ZEND_MM)
|
||||
if (1 || clean_cache) {
|
||||
unsigned int i, j;
|
||||
zend_mem_header *ptr;
|
||||
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<AG(cache_count)[i]; j++) {
|
||||
ptr = (zend_mem_header *) AG(cache)[i][j];
|
||||
#if MEMORY_LIMIT
|
||||
AG(allocated_memory) -= REAL_SIZE(ptr->size);
|
||||
#endif
|
||||
REMOVE_POINTER_FROM_LIST(ptr);
|
||||
ZEND_DO_FREE(ptr);
|
||||
}
|
||||
AG(cache_count)[i] = 0;
|
||||
}
|
||||
}
|
||||
#endif /* !ZEND_DISABLE_MEMORY_CACHE */
|
||||
|
||||
#if ZEND_DEBUG || !defined(ZEND_MM)
|
||||
p = AG(head);
|
||||
t = AG(head);
|
||||
while (t) {
|
||||
if (!t->cached) {
|
||||
#if ZEND_DEBUG
|
||||
if (!t->cached && !t->reported) {
|
||||
if (!t->reported) {
|
||||
zend_mem_header *iterator;
|
||||
int total_leak=0, total_leak_count=0;
|
||||
|
||||
@@ -584,7 +585,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
|
||||
zval display_memory_cache_stats;
|
||||
int i, j;
|
||||
|
||||
if (clean_cache) {
|
||||
if (full_shutdown) {
|
||||
/* we're shutting down completely, don't even touch the INI subsystem */
|
||||
break;
|
||||
}
|
||||
@@ -622,12 +623,13 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
|
||||
#endif
|
||||
|
||||
#if defined(ZEND_MM) && ZEND_DEBUG
|
||||
if (clean_cache) {
|
||||
zend_mm_shutdown(&AG(mm_heap));
|
||||
zend_mm_shutdown(&AG(mm_heap));
|
||||
if (full_shutdown) {
|
||||
return;
|
||||
}
|
||||
zend_mm_startup(&AG(mm_heap), 256*1024);
|
||||
#elif defined(ZEND_WIN32) && ZEND_DEBUG
|
||||
if (clean_cache && AG(memory_heap)) {
|
||||
if (full_shutdown && AG(memory_heap)) {
|
||||
HeapDestroy(AG(memory_heap));
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
|
||||
ZEND_API int zend_set_memory_limit(unsigned int memory_limit);
|
||||
|
||||
ZEND_API void start_memory_manager(TSRMLS_D);
|
||||
ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC);
|
||||
ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC);
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
|
||||
@@ -661,7 +661,6 @@ ZEND_FUNCTION(get_class_vars)
|
||||
{
|
||||
zval **class_name;
|
||||
zend_class_entry *ce, **pce;
|
||||
zval *tmp;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
@@ -674,11 +673,41 @@ ZEND_FUNCTION(get_class_vars)
|
||||
} else {
|
||||
ce = *pce;
|
||||
array_init(return_value);
|
||||
if (!ce->constants_updated) {
|
||||
zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
|
||||
ce->constants_updated = 1;
|
||||
|
||||
if (zend_hash_num_elements(&ce->default_properties) > 0) {
|
||||
HashPosition pos;
|
||||
zval **prop;
|
||||
|
||||
zend_hash_internal_pointer_reset_ex(&ce->default_properties, &pos);
|
||||
while (zend_hash_get_current_data_ex(&ce->default_properties, (void **) &prop, &pos) == SUCCESS) {
|
||||
char *key, *class_name, *prop_name;
|
||||
uint key_len;
|
||||
ulong num_index;
|
||||
zval *prop_copy;
|
||||
|
||||
zend_hash_get_current_key_ex(&ce->default_properties, &key, &key_len, &num_index, 0, &pos);
|
||||
zend_hash_move_forward_ex(&ce->default_properties, &pos);
|
||||
zend_unmangle_property_name(key, &class_name, &prop_name);
|
||||
if (class_name && class_name[0] != '*' && strcmp(class_name, ce->name)) {
|
||||
/* filter privates from base classes */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* copy: enforce read only access */
|
||||
ALLOC_ZVAL(prop_copy);
|
||||
*prop_copy = **prop;
|
||||
zval_copy_ctor(prop_copy);
|
||||
INIT_PZVAL(prop_copy);
|
||||
|
||||
/* this is necessary to make it able to work with default array
|
||||
* properties, returned to user */
|
||||
if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || Z_TYPE_P(prop_copy) == IS_CONSTANT) {
|
||||
zval_update_constant(&prop_copy, 0 TSRMLS_CC);
|
||||
}
|
||||
|
||||
add_assoc_zval(return_value, prop_name, prop_copy);
|
||||
}
|
||||
}
|
||||
zend_hash_copy(return_value->value.ht, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -799,20 +828,30 @@ ZEND_FUNCTION(method_exists)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool class_exists(string classname)
|
||||
/* {{{ proto bool class_exists(string classname [, bool autoload])
|
||||
Checks if the class exists */
|
||||
ZEND_FUNCTION(class_exists)
|
||||
{
|
||||
zval **class_name;
|
||||
char *class_name, *lc_name;
|
||||
zend_class_entry **ce;
|
||||
int class_name_len;
|
||||
zend_bool autoload = 1;
|
||||
int found;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &class_name, &class_name_len, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
convert_to_string_ex(class_name);
|
||||
if (!autoload) {
|
||||
lc_name = do_alloca(class_name_len + 1);
|
||||
zend_str_tolower_copy(lc_name, class_name, class_name_len);
|
||||
|
||||
found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce);
|
||||
free_alloca(lc_name);
|
||||
RETURN_BOOL(found == SUCCESS);
|
||||
}
|
||||
|
||||
if (zend_lookup_class(Z_STRVAL_PP(class_name), Z_STRLEN_PP(class_name), &ce TSRMLS_CC) == SUCCESS) {
|
||||
if (zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC) == SUCCESS) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
@@ -950,7 +989,7 @@ ZEND_FUNCTION(set_error_handler)
|
||||
zval *error_handler;
|
||||
zend_bool had_orig_error_handler=0;
|
||||
char *error_handler_name = NULL;
|
||||
long error_type = E_ALL;
|
||||
long error_type = E_ALL | E_STRICT;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &error_handler, &error_type) == FAILURE) {
|
||||
return;
|
||||
@@ -995,8 +1034,12 @@ ZEND_FUNCTION(set_error_handler)
|
||||
ZEND_FUNCTION(restore_error_handler)
|
||||
{
|
||||
if (EG(user_error_handler)) {
|
||||
zval_ptr_dtor(&EG(user_error_handler));
|
||||
zval *zeh = EG(user_error_handler);
|
||||
|
||||
EG(user_error_handler) = NULL;
|
||||
zval_ptr_dtor(&zeh);
|
||||
}
|
||||
|
||||
if (zend_ptr_stack_num_elements(&EG(user_error_handlers))==0) {
|
||||
EG(user_error_handler) = NULL;
|
||||
} else {
|
||||
@@ -1009,18 +1052,26 @@ ZEND_FUNCTION(restore_error_handler)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto string set_exception_handler(string exception_handler)
|
||||
/* {{{ proto string set_exception_handler(callable exception_handler)
|
||||
Sets a user-defined exception handler function. Returns the previously defined exception handler, or false on error */
|
||||
ZEND_FUNCTION(set_exception_handler)
|
||||
{
|
||||
zval **exception_handler;
|
||||
char *exception_handler_name = NULL;
|
||||
zend_bool had_orig_exception_handler=0;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &exception_handler)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
convert_to_string_ex(exception_handler);
|
||||
if (!zend_is_callable(*exception_handler, 0, &exception_handler_name)) {
|
||||
zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback",
|
||||
get_active_function_name(TSRMLS_C), exception_handler_name?exception_handler_name:"unknown");
|
||||
efree(exception_handler_name);
|
||||
return;
|
||||
}
|
||||
efree(exception_handler_name);
|
||||
|
||||
if (EG(user_exception_handler)) {
|
||||
had_orig_exception_handler = 1;
|
||||
*return_value = *EG(user_exception_handler);
|
||||
@@ -1439,14 +1490,14 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
while (--args >= EG(argument_stack).elements) {
|
||||
while (--args > EG(argument_stack).elements) {
|
||||
if (*args--) {
|
||||
break;
|
||||
}
|
||||
args -= *(ulong*)args;
|
||||
frames_on_stack++;
|
||||
|
||||
if (args == EG(argument_stack).elements) {
|
||||
if ((args-1) == EG(argument_stack).elements) {
|
||||
arg_stack_consistent = 1;
|
||||
break;
|
||||
}
|
||||
@@ -1462,6 +1513,7 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
array_init(return_value);
|
||||
|
||||
while (ptr) {
|
||||
class_name = call_type = NULL;
|
||||
if (ptr->op_array) {
|
||||
filename = ptr->op_array->filename;
|
||||
lineno = ptr->opline->lineno;
|
||||
@@ -1559,14 +1611,14 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
int arg_stack_consistent = 0;
|
||||
int frames_on_stack = 0;
|
||||
|
||||
while (--args >= EG(argument_stack).elements) {
|
||||
while (--args > EG(argument_stack).elements) {
|
||||
if (*args--) {
|
||||
break;
|
||||
}
|
||||
args -= *(ulong*)args;
|
||||
frames_on_stack++;
|
||||
|
||||
if (args == EG(argument_stack).elements) {
|
||||
if ((args-1) == EG(argument_stack).elements) {
|
||||
arg_stack_consistent = 1;
|
||||
break;
|
||||
}
|
||||
@@ -1576,8 +1628,9 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
|
||||
/* skip debug_backtrace() */
|
||||
ptr = ptr->prev_execute_data;
|
||||
if (skip_last) {
|
||||
cur_arg_pos -= 2;
|
||||
if (skip_last--) {
|
||||
int arg_count = *((ulong*)(cur_arg_pos - 2));
|
||||
cur_arg_pos -= (arg_count + 2);
|
||||
frames_on_stack--;
|
||||
}
|
||||
|
||||
@@ -1700,17 +1753,20 @@ ZEND_FUNCTION(debug_backtrace)
|
||||
ZEND_FUNCTION(extension_loaded)
|
||||
{
|
||||
zval **extension_name;
|
||||
char *lcname;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &extension_name)) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
convert_to_string_ex(extension_name);
|
||||
if (zend_hash_exists(&module_registry, Z_STRVAL_PP(extension_name), Z_STRLEN_PP(extension_name)+1)) {
|
||||
RETURN_TRUE;
|
||||
lcname = zend_str_tolower_dup(Z_STRVAL_PP(extension_name), Z_STRLEN_PP(extension_name));
|
||||
if (zend_hash_exists(&module_registry, lcname, Z_STRLEN_PP(extension_name)+1)) {
|
||||
RETVAL_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
efree(lcname);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+52
-17
@@ -997,13 +997,14 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
/* Improve after RC: cache the lowercase class name */
|
||||
|
||||
if ((short_class_name_length == name_len) && (!memcmp(short_class_name, lcname, name_len))) {
|
||||
if(CG(active_class_entry)->constructor) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redefine constructor for class %s", CG(active_class_entry)->name);
|
||||
if (CG(active_class_entry)->constructor) {
|
||||
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
|
||||
} else {
|
||||
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
|
||||
}
|
||||
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {
|
||||
if(CG(active_class_entry)->constructor) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redefine constructor for class %s", CG(active_class_entry)->name);
|
||||
if (CG(active_class_entry)->constructor) {
|
||||
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
|
||||
}
|
||||
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
|
||||
} else if ((name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)))) {
|
||||
@@ -1086,16 +1087,37 @@ void zend_do_handle_exception(TSRMLS_D)
|
||||
|
||||
void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
|
||||
{
|
||||
char lcname[16];
|
||||
int name_len;
|
||||
|
||||
zend_do_extended_info(TSRMLS_C);
|
||||
zend_do_return(NULL, 0 TSRMLS_CC);
|
||||
zend_do_handle_exception(TSRMLS_C);
|
||||
|
||||
pass_two(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
if (CG(active_class_entry)
|
||||
&& !strcmp(CG(active_op_array)->function_name, ZEND_CLONE_FUNC_NAME)
|
||||
&& CG(active_op_array)->num_args != 0) {
|
||||
zend_error(E_COMPILE_ERROR, "The clone method cannot accept any arguments");
|
||||
/* we don't care if the function name is longer, in fact lowercasing only
|
||||
* the beginning of the name speeds up the check process */
|
||||
name_len = strlen(CG(active_op_array)->function_name);
|
||||
zend_str_tolower_copy(lcname, CG(active_op_array)->function_name, MIN(name_len, sizeof(lcname)-1));
|
||||
lcname[sizeof(lcname)-1] = '\0'; // zend_str_tolower_copy won't necessarily set the zero byte
|
||||
|
||||
if (CG(active_class_entry)) {
|
||||
if (name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)) && CG(active_op_array)->num_args != 0) {
|
||||
zend_error(E_COMPILE_ERROR, "Destuctor %s::%s() cannot take arguments", CG(active_class_entry)->name, ZEND_DESTRUCTOR_FUNC_NAME);
|
||||
} else if (name_len == sizeof(ZEND_CLONE_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)) && CG(active_op_array)->num_args != 0) {
|
||||
zend_error(E_COMPILE_ERROR, "Method %s::%s() cannot accept any arguments", CG(active_class_entry)->name, ZEND_CLONE_FUNC_NAME);
|
||||
} else if (name_len == sizeof(ZEND_GET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)) && CG(active_op_array)->num_args != 1) {
|
||||
zend_error(E_COMPILE_ERROR, "Method %s::%s() must take exactly 1 argument", CG(active_class_entry)->name, ZEND_GET_FUNC_NAME);
|
||||
} else if (name_len == sizeof(ZEND_SET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)) && CG(active_op_array)->num_args != 2) {
|
||||
zend_error(E_COMPILE_ERROR, "Method %s::%s() must take exactly 2 arguments", CG(active_class_entry)->name, ZEND_SET_FUNC_NAME);
|
||||
} else if (name_len == sizeof(ZEND_CALL_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)) && CG(active_op_array)->num_args != 2) {
|
||||
zend_error(E_COMPILE_ERROR, "Method %s::%s() must take exactly 2 arguments", CG(active_class_entry)->name, ZEND_CALL_FUNC_NAME);
|
||||
}
|
||||
} else {
|
||||
if (name_len == sizeof(ZEND_AUTOLOAD_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)) && CG(active_op_array)->num_args != 1) {
|
||||
zend_error(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
CG(active_op_array)->line_end = zend_get_compiled_lineno(TSRMLS_C);
|
||||
@@ -1133,6 +1155,7 @@ void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initia
|
||||
if (class_type->op_type != IS_UNUSED) {
|
||||
cur_arg_info->class_name = class_type->u.constant.value.str.val;
|
||||
cur_arg_info->class_name_len = class_type->u.constant.value.str.len;
|
||||
cur_arg_info->allow_null = 0;
|
||||
} else {
|
||||
cur_arg_info->class_name = NULL;
|
||||
cur_arg_info->class_name_len = 0;
|
||||
@@ -1706,16 +1729,20 @@ static void do_inherit_method(zend_function *function)
|
||||
}
|
||||
|
||||
|
||||
static zend_bool zend_do_perform_implementation_check(zend_function *fe)
|
||||
static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_function *proto)
|
||||
{
|
||||
zend_uint i;
|
||||
zend_function *proto = fe->common.prototype;
|
||||
|
||||
/* If it's a user function then arg_info == NULL means we don't have any parameters but we still need to do the arg number checks. We are only willing to ignore this for internal functions because extensions don't always define arg_info. */
|
||||
if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* No implementation checks for constructors */
|
||||
if (fe->common.fn_flags & ZEND_ACC_CTOR) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* check number of arguments */
|
||||
if (proto->common.required_num_args != fe->common.required_num_args
|
||||
|| proto->common.num_args > fe->common.num_args) {
|
||||
@@ -1813,15 +1840,21 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
|
||||
}
|
||||
}
|
||||
|
||||
child->common.prototype = parent;
|
||||
if (parent_flags & ZEND_ACC_ABSTRACT) {
|
||||
child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
|
||||
child->common.prototype = parent;
|
||||
} else {
|
||||
child->common.prototype = parent->common.prototype;
|
||||
}
|
||||
|
||||
/* Check E_STRICT before the check so that we save some time */
|
||||
if(EG(error_reporting) & E_STRICT) {
|
||||
if (!(child->common.fn_flags & ZEND_ACC_CTOR) && !zend_do_perform_implementation_check(child)) {
|
||||
zend_error(E_STRICT, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
|
||||
|
||||
if (child->common.prototype) {
|
||||
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
|
||||
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
|
||||
}
|
||||
} else if (EG(error_reporting) & E_STRICT) { /* Check E_STRICT before the check so that we save some time */
|
||||
if (!zend_do_perform_implementation_check(child, parent)) {
|
||||
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(parent), parent->common.function_name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2519,6 +2552,7 @@ static void do_verify_abstract_class(TSRMLS_D)
|
||||
|
||||
opline->opcode = ZEND_VERIFY_ABSTRACT_CLASS;
|
||||
opline->op1 = CG(implementing_class);
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
|
||||
|
||||
@@ -3317,7 +3351,7 @@ void zend_do_foreach_cont(znode *value, znode *key, znode *as_token, znode *fore
|
||||
value = tmp;
|
||||
}
|
||||
|
||||
if (key->u.EA.type & ZEND_PARSED_REFERENCE_VARIABLE) {
|
||||
if ((key->op_type != IS_UNUSED) && (key->u.EA.type & ZEND_PARSED_REFERENCE_VARIABLE)) {
|
||||
zend_error(E_COMPILE_ERROR, "Key element cannot be a reference");
|
||||
}
|
||||
|
||||
@@ -3729,6 +3763,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
|
||||
ce->parent = NULL;
|
||||
ce->num_interfaces = 0;
|
||||
ce->interfaces = NULL;
|
||||
ce->module = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -494,13 +494,14 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC);
|
||||
ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC);
|
||||
|
||||
ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC);
|
||||
ZEND_API void zend_function_dtor(zend_function *function);
|
||||
ZEND_API void destroy_zend_class(zend_class_entry **pce);
|
||||
void zend_class_add_ref(zend_class_entry **ce);
|
||||
|
||||
ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src1, int src1_length, char *src2, int src2_length, int internal);
|
||||
ZEND_API void zend_unmangle_property_name(char *mangled_property, char **prop_name, char **class_name);
|
||||
|
||||
#define ZEND_FUNCTION_DTOR (void (*)(void *)) destroy_zend_function
|
||||
#define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor
|
||||
#define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
|
||||
|
||||
zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC);
|
||||
@@ -839,6 +840,7 @@ END_EXTERN_C()
|
||||
#define ZEND_GET_FUNC_NAME "__get"
|
||||
#define ZEND_SET_FUNC_NAME "__set"
|
||||
#define ZEND_CALL_FUNC_NAME "__call"
|
||||
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
|
||||
|
||||
#endif /* ZEND_COMPILE_H */
|
||||
|
||||
|
||||
+17
-18
@@ -231,10 +231,8 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
|
||||
scope = CG(active_class_entry);
|
||||
}
|
||||
|
||||
class_name = do_alloca(class_name_len+1);
|
||||
memcpy(class_name, name, class_name_len);
|
||||
class_name[class_name_len] = '\0';
|
||||
|
||||
class_name = estrndup(name, class_name_len);
|
||||
|
||||
if (class_name_len == sizeof("self")-1 && strcmp(class_name, "self") == 0) {
|
||||
if (scope) {
|
||||
ce = &scope;
|
||||
@@ -255,7 +253,7 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
|
||||
retval = 0;
|
||||
}
|
||||
}
|
||||
free_alloca(class_name);
|
||||
efree(class_name);
|
||||
|
||||
if (retval && ce) {
|
||||
if (zend_hash_find(&((*ce)->constants_table), constant_name, const_name_len+1, (void **) &ret_constant) != SUCCESS) {
|
||||
@@ -275,9 +273,8 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
|
||||
}
|
||||
|
||||
if (zend_hash_find(EG(zend_constants), name, name_len+1, (void **) &c) == FAILURE) {
|
||||
lookup_name = do_alloca(name_len+1);
|
||||
zend_str_tolower_copy(lookup_name, name, name_len);
|
||||
lookup_name[name_len] = '\0';
|
||||
lookup_name = estrndup(name, name_len);
|
||||
zend_str_tolower(lookup_name, name_len);
|
||||
|
||||
if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) {
|
||||
if ((c->flags & CONST_CS) && memcmp(c->name, name, name_len)!=0) {
|
||||
@@ -286,7 +283,7 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
|
||||
} else {
|
||||
retval=0;
|
||||
}
|
||||
free_alloca(lookup_name);
|
||||
efree(lookup_name);
|
||||
}
|
||||
|
||||
if (retval) {
|
||||
@@ -302,7 +299,8 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
|
||||
|
||||
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
|
||||
{
|
||||
char *lowercase_name;
|
||||
char *lowercase_name = NULL;
|
||||
char *name;
|
||||
int ret = SUCCESS;
|
||||
|
||||
#if 0
|
||||
@@ -311,23 +309,24 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
|
||||
|
||||
if (!(c->flags & CONST_CS)) {
|
||||
/* keep in mind that c->name_len already contains the '\0' */
|
||||
lowercase_name = do_alloca(c->name_len);
|
||||
zend_str_tolower_copy(lowercase_name, c->name, c->name_len - 1);
|
||||
lowercase_name = estrndup(c->name, c->name_len);
|
||||
zend_str_tolower(lowercase_name, c->name_len);
|
||||
name = lowercase_name;
|
||||
} else {
|
||||
lowercase_name = do_alloca(c->name_len + 1);
|
||||
memcpy(lowercase_name, c->name, c->name_len);
|
||||
lowercase_name[c->name_len] = '\0';
|
||||
name = c->name;
|
||||
}
|
||||
|
||||
if (zend_hash_add(EG(zend_constants), lowercase_name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
|
||||
if (zend_hash_add(EG(zend_constants), name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
|
||||
zend_error(E_NOTICE,"Constant %s already defined", name);
|
||||
free(c->name);
|
||||
if (!(c->flags & CONST_PERSISTENT)) {
|
||||
zval_dtor(&c->value);
|
||||
}
|
||||
zend_error(E_NOTICE,"Constant %s already defined", lowercase_name);
|
||||
ret = FAILURE;
|
||||
}
|
||||
free_alloca(lowercase_name);
|
||||
if (lowercase_name) {
|
||||
efree(lowercase_name);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ typedef struct _dynamic_array {
|
||||
} dynamic_array;
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API int zend_dynamic_array_init(dynamic_array *da);
|
||||
ZEND_API int zend_dynamic_array_init(dynamic_array *da, unsigned int element_size, unsigned int size);
|
||||
ZEND_API void *zend_dynamic_array_push(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_pop(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index);
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
zend_class_entry *default_exception_ce;
|
||||
static zend_object_handlers default_exception_handlers;
|
||||
ZEND_API void zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
|
||||
ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
|
||||
|
||||
|
||||
void zend_throw_exception_internal(zval *exception TSRMLS_DC)
|
||||
@@ -45,6 +46,10 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC)
|
||||
zend_error(E_ERROR, "Exception thrown without a stack frame");
|
||||
}
|
||||
|
||||
if (zend_throw_exception_hook) {
|
||||
zend_throw_exception_hook(exception TSRMLS_CC);
|
||||
}
|
||||
|
||||
if ((EG(current_execute_data)->opline+1)->opcode == ZEND_HANDLE_EXCEPTION) {
|
||||
/* no need to rethrow the exception */
|
||||
return;
|
||||
@@ -439,7 +444,7 @@ void zend_register_default_exception(TSRMLS_D)
|
||||
{
|
||||
zend_class_entry ce;
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "exception", default_exception_functions);
|
||||
INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
|
||||
default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
default_exception_ce->create_object = zend_default_exception_new;
|
||||
memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
|
||||
|
||||
@@ -40,6 +40,8 @@ ZEND_API void zend_throw_exception_ex(zend_class_entry *exception_ce, long code
|
||||
ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
|
||||
ZEND_API void zend_clear_exception(TSRMLS_D);
|
||||
|
||||
extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
|
||||
|
||||
/* show an exception using zend_error(E_ERROR,...) */
|
||||
ZEND_API void zend_exception_error(zval *exception TSRMLS_DC);
|
||||
|
||||
|
||||
+176
-112
@@ -52,6 +52,7 @@ static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_
|
||||
#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))
|
||||
#define T(offset) (*(temp_variable *)((char *) Ts + offset))
|
||||
|
||||
#define TEMP_VAR_STACK_LIMIT 2000
|
||||
|
||||
/* former zend_execute_locks.h */
|
||||
static inline void zend_pzval_lock_func(zval *z)
|
||||
@@ -178,7 +179,7 @@ static inline void zend_fetch_property_address_inner(zval *object, znode *op2, z
|
||||
}
|
||||
T(result->u.var).var.ptr_ptr = ptr_ptr;
|
||||
} else if (Z_OBJ_HT_P(object)->read_property) {
|
||||
T(result->u.var).var.ptr = Z_OBJ_HT_P(object)->read_property(object, prop_ptr, 0 TSRMLS_CC);
|
||||
T(result->u.var).var.ptr = Z_OBJ_HT_P(object)->read_property(object, prop_ptr, BP_VAR_W TSRMLS_CC);
|
||||
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr;
|
||||
} else {
|
||||
zend_error(E_WARNING, "This object doesn't support property references");
|
||||
@@ -382,13 +383,21 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
|
||||
}
|
||||
|
||||
/* here we are sure we are dealing with an object */
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
|
||||
object = *object_ptr;
|
||||
}
|
||||
|
||||
/* separate our value if necessary */
|
||||
if (value_op->op_type == IS_TMP_VAR) {
|
||||
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
|
||||
zval *orig_value = value;
|
||||
|
||||
ALLOC_ZVAL(value);
|
||||
*value = *orig_value;
|
||||
value->is_ref = 0;
|
||||
value->refcount = 0;
|
||||
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
|
||||
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_P(orig_value)->name);
|
||||
}
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(orig_value)->name);
|
||||
value->value.obj = Z_OBJ_HANDLER_P(orig_value, clone_obj)(orig_value TSRMLS_CC);
|
||||
} else if (value_op->op_type == IS_TMP_VAR) {
|
||||
zval *orig_value = value;
|
||||
|
||||
ALLOC_ZVAL(value);
|
||||
@@ -404,6 +413,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
|
||||
value->refcount = 0;
|
||||
zval_copy_ctor(value);
|
||||
}
|
||||
|
||||
|
||||
value->refcount++;
|
||||
if (opcode == ZEND_ASSIGN_OBJ) {
|
||||
@@ -434,14 +444,14 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
|
||||
}
|
||||
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
|
||||
}
|
||||
zval_ptr_dtor(&value);
|
||||
|
||||
FREE_OP(Ts, op2, EG(free_op2));
|
||||
if (result) {
|
||||
T(result->u.var).var.ptr = value;
|
||||
T(result->u.var).var.ptr_ptr = NULL; /* see if we can remove this */
|
||||
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; /* this is so that we could use it in FETCH_DIM_R, etc. - see bug #27876 */
|
||||
SELECTIVE_PZVAL_LOCK(value, result);
|
||||
}
|
||||
zval_ptr_dtor(&value);
|
||||
}
|
||||
|
||||
|
||||
@@ -542,12 +552,53 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(Z_TYPE_P(variable_ptr) == IS_OBJECT && Z_OBJ_HANDLER_P(variable_ptr, set)) {
|
||||
/* TODO? ze1_compatibility_mode support */
|
||||
Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr_ptr, value TSRMLS_CC);
|
||||
goto done_setting_var;
|
||||
}
|
||||
|
||||
if (PZVAL_IS_REF(variable_ptr)) {
|
||||
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
|
||||
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
|
||||
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_P(value)->name);
|
||||
} else if (PZVAL_IS_REF(variable_ptr)) {
|
||||
if (variable_ptr != value) {
|
||||
zend_uint refcount = variable_ptr->refcount;
|
||||
zval garbage;
|
||||
|
||||
if (type != IS_TMP_VAR) {
|
||||
value->refcount++;
|
||||
}
|
||||
garbage = *variable_ptr;
|
||||
*variable_ptr = *value;
|
||||
variable_ptr->refcount = refcount;
|
||||
variable_ptr->is_ref = 1;
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(value)->name);
|
||||
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
|
||||
if (type != IS_TMP_VAR) {
|
||||
value->refcount--;
|
||||
}
|
||||
zendi_zval_dtor(garbage);
|
||||
}
|
||||
} else {
|
||||
variable_ptr->refcount--;
|
||||
if (variable_ptr->refcount == 0) {
|
||||
zendi_zval_dtor(*variable_ptr);
|
||||
} else {
|
||||
ALLOC_ZVAL(variable_ptr);
|
||||
*variable_ptr_ptr = variable_ptr;
|
||||
}
|
||||
*variable_ptr = *value;
|
||||
INIT_PZVAL(variable_ptr);
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(value)->name);
|
||||
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
|
||||
}
|
||||
} else if (PZVAL_IS_REF(variable_ptr)) {
|
||||
if (variable_ptr!=value) {
|
||||
zend_uint refcount = variable_ptr->refcount;
|
||||
zval garbage;
|
||||
|
||||
|
||||
if (type!=IS_TMP_VAR) {
|
||||
value->refcount++;
|
||||
}
|
||||
@@ -572,7 +623,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
variable_ptr->refcount++;
|
||||
} else if (PZVAL_IS_REF(value)) {
|
||||
zval tmp;
|
||||
|
||||
|
||||
tmp = *value;
|
||||
zval_copy_ctor(&tmp);
|
||||
tmp.refcount=1;
|
||||
@@ -590,8 +641,8 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
value->refcount=1;
|
||||
*variable_ptr = *value;
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
} else { /* we need to split */
|
||||
switch (type) {
|
||||
case IS_VAR:
|
||||
@@ -613,11 +664,13 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
value->refcount=1;
|
||||
**variable_ptr_ptr = *value;
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
}
|
||||
(*variable_ptr_ptr)->is_ref=0;
|
||||
}
|
||||
|
||||
done_setting_var:
|
||||
if (result) {
|
||||
T(result->u.var).var.ptr_ptr = variable_ptr_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result);
|
||||
@@ -787,8 +840,10 @@ fetch_string_dim:
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
case IS_RESOURCE:
|
||||
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", dim->value.lval, dim->value.lval);
|
||||
/* Fall Through */
|
||||
case IS_DOUBLE:
|
||||
case IS_BOOL:
|
||||
case IS_LONG: {
|
||||
long index;
|
||||
@@ -1058,7 +1113,7 @@ static void zend_fetch_property_address_read(znode *result, znode *op1, znode *o
|
||||
{
|
||||
zval *container;
|
||||
zval **retval;
|
||||
|
||||
|
||||
retval = &T(result->u.var).var.ptr;
|
||||
T(result->u.var).var.ptr_ptr = retval;
|
||||
|
||||
@@ -1070,7 +1125,7 @@ static void zend_fetch_property_address_read(znode *result, znode *op1, znode *o
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (container->type != IS_OBJECT) {
|
||||
zend_error(E_NOTICE, "Trying to get property of non-object");
|
||||
|
||||
@@ -1082,7 +1137,7 @@ static void zend_fetch_property_address_read(znode *result, znode *op1, znode *o
|
||||
} else {
|
||||
zval *offset;
|
||||
zval tmp;
|
||||
|
||||
|
||||
offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
|
||||
switch (op2->op_type) {
|
||||
case IS_CONST:
|
||||
@@ -1100,7 +1155,7 @@ static void zend_fetch_property_address_read(znode *result, znode *op1, znode *o
|
||||
}
|
||||
|
||||
/* here we are sure we are dealing with an object */
|
||||
*retval = Z_OBJ_HT_P(container)->read_property(container, offset, (zend_bool) ((type==BP_VAR_IS) ? 1 : 0) TSRMLS_CC);
|
||||
*retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC);
|
||||
if (offset == &tmp) {
|
||||
zval_dtor(offset);
|
||||
}
|
||||
@@ -1151,7 +1206,7 @@ static void zend_pre_incdec_property(znode *result, znode *op1, znode *op2, temp
|
||||
}
|
||||
|
||||
if (!have_get_ptr) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, 0 TSRMLS_CC);
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC);
|
||||
|
||||
if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
@@ -1209,10 +1264,10 @@ static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, tem
|
||||
}
|
||||
|
||||
if (!have_get_ptr) {
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, 0 TSRMLS_CC);
|
||||
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC);
|
||||
|
||||
if (z->type == IS_OBJECT && Z_OBJ_HT_P(object)->get) {
|
||||
zval *value = Z_OBJ_HT_P(object)->get(z TSRMLS_CC);
|
||||
if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
|
||||
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
|
||||
|
||||
if (z->refcount == 0) {
|
||||
zval_dtor(z);
|
||||
@@ -1223,11 +1278,9 @@ static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, tem
|
||||
*retval = *z;
|
||||
zendi_zval_copy_ctor(*retval);
|
||||
incdec_op(z);
|
||||
z->refcount++;
|
||||
Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
|
||||
if (z->refcount == 0) {
|
||||
zval_dtor(z);
|
||||
FREE_ZVAL(z);
|
||||
}
|
||||
zval_ptr_dtor(&z);
|
||||
}
|
||||
|
||||
FREE_OP(Ts, op2, EG(free_op2));
|
||||
@@ -1278,7 +1331,11 @@ static int zend_check_symbol(zval **pz TSRMLS_DC)
|
||||
}
|
||||
|
||||
#define RETURN_FROM_EXECUTE_LOOP(execute_data) \
|
||||
free_alloca(EX(Ts)); \
|
||||
if (EX(op_array)->T < TEMP_VAR_STACK_LIMIT) { \
|
||||
free_alloca(EX(Ts)); \
|
||||
} else { \
|
||||
efree(EX(Ts)); \
|
||||
} \
|
||||
EG(in_execution) = EX(original_in_execution); \
|
||||
EG(current_execute_data) = EX(prev_execute_data); \
|
||||
return 1; /* CHECK_ME */
|
||||
@@ -1297,7 +1354,11 @@ ZEND_API void execute(zend_op_array *op_array TSRMLS_DC)
|
||||
/* Initialize execute_data */
|
||||
EX(fbc) = NULL;
|
||||
EX(object) = NULL;
|
||||
EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable)*op_array->T);
|
||||
if (op_array->T < TEMP_VAR_STACK_LIMIT) {
|
||||
EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable) * op_array->T);
|
||||
} else {
|
||||
EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0);
|
||||
}
|
||||
EX(op_array) = op_array;
|
||||
EX(original_in_execution) = EG(in_execution);
|
||||
EX(prev_execute_data) = EG(current_execute_data);
|
||||
@@ -1624,10 +1685,10 @@ static inline int zend_binary_assign_op_obj_helper(int (*binary_op)(zval *result
|
||||
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_ASSIGN_OBJ:
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, 0 TSRMLS_CC);
|
||||
z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC);
|
||||
break;
|
||||
case ZEND_ASSIGN_DIM:
|
||||
z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_W TSRMLS_CC);
|
||||
z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC);
|
||||
break;
|
||||
}
|
||||
if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
|
||||
@@ -1687,12 +1748,12 @@ static inline int zend_binary_assign_op_helper(int (*binary_op)(zval *result, zv
|
||||
if ((*object_ptr)->type == IS_OBJECT) {
|
||||
return zend_binary_assign_op_obj_helper(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
|
||||
} else {
|
||||
zend_op *data_opline = opline+1;
|
||||
zend_op *op_data = opline+1;
|
||||
|
||||
zend_fetch_dimension_address(&data_opline->op2, &opline->op1, &opline->op2, EX(Ts), BP_VAR_RW TSRMLS_CC);
|
||||
zend_fetch_dimension_address(&op_data->op2, &opline->op1, &opline->op2, EX(Ts), BP_VAR_RW TSRMLS_CC);
|
||||
|
||||
value = get_zval_ptr(&data_opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
|
||||
var_ptr = get_zval_ptr_ptr(&data_opline->op2, EX(Ts), BP_VAR_RW);
|
||||
value = get_zval_ptr(&op_data->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
|
||||
var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), BP_VAR_RW);
|
||||
EG(free_op2) = 0;
|
||||
increment_opline = 1;
|
||||
}
|
||||
@@ -1719,7 +1780,18 @@ static inline int zend_binary_assign_op_helper(int (*binary_op)(zval *result, zv
|
||||
|
||||
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
|
||||
|
||||
binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
|
||||
if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get)
|
||||
&& Z_OBJ_HANDLER_PP(var_ptr, set)) {
|
||||
/* proxy object */
|
||||
zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
|
||||
objval->refcount++;
|
||||
binary_op(objval, objval, value TSRMLS_CC);
|
||||
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC);
|
||||
zval_ptr_dtor(&objval);
|
||||
} else {
|
||||
binary_op(*var_ptr, *var_ptr, value TSRMLS_CC);
|
||||
}
|
||||
|
||||
EX_T(opline->result.u.var).var.ptr_ptr = var_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*var_ptr, &opline->result);
|
||||
FREE_OP(Ex(Ts), &opline->op1, EG(free_op1));
|
||||
@@ -1852,7 +1924,17 @@ static inline int zend_incdec_op_helper(incdec_t incdec_op_arg, ZEND_OPCODE_HAND
|
||||
|
||||
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
|
||||
|
||||
incdec_op(*var_ptr);
|
||||
if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get)
|
||||
&& Z_OBJ_HANDLER_PP(var_ptr, set)) {
|
||||
/* proxy object */
|
||||
zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC);
|
||||
val->refcount++;
|
||||
incdec_op(val);
|
||||
Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC);
|
||||
zval_ptr_dtor(&val);
|
||||
} else {
|
||||
incdec_op(*var_ptr);
|
||||
}
|
||||
|
||||
switch (opline->opcode) {
|
||||
case ZEND_PRE_INC:
|
||||
@@ -2110,36 +2192,6 @@ int zend_fetch_dim_tmp_var_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
|
||||
|
||||
int zend_make_var_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
zval *value, *value2;
|
||||
|
||||
value = get_zval_ptr(&opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
|
||||
switch (opline->op1.op_type) {
|
||||
case IS_TMP_VAR:
|
||||
value2 = value;
|
||||
ALLOC_ZVAL(value);
|
||||
*value = *value2;
|
||||
value->is_ref = 0;
|
||||
value->refcount = 0; /* lock will increase this */
|
||||
break;
|
||||
case IS_CONST:
|
||||
value2 = value;
|
||||
ALLOC_ZVAL(value);
|
||||
*value = *value2;
|
||||
zval_copy_ctor(value);
|
||||
value->is_ref = 0;
|
||||
value->refcount = 0; /* lock will increase this */
|
||||
break;
|
||||
}
|
||||
|
||||
EX_T(opline->result.u.var).var.ptr = value;
|
||||
PZVAL_LOCK(EX_T(opline->result.u.var).var.ptr);
|
||||
|
||||
NEXT_OPCODE();
|
||||
}
|
||||
|
||||
|
||||
int zend_assign_obj_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
zend_op *op_data = opline+1;
|
||||
@@ -2168,15 +2220,14 @@ int zend_assign_dim_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC);
|
||||
} else {
|
||||
zval *value;
|
||||
zend_op *data_opline = opline+1;
|
||||
|
||||
if (object_ptr) {
|
||||
(*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */
|
||||
}
|
||||
zend_fetch_dimension_address(&data_opline->op2, &opline->op1, &opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC);
|
||||
zend_fetch_dimension_address(&op_data->op2, &opline->op1, &opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC);
|
||||
|
||||
value = get_zval_ptr(&data_opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
|
||||
zend_assign_to_variable(&opline->result, &data_opline->op2, &data_opline->op1, value, (EG(free_op1)?IS_TMP_VAR:opline->op1.op_type), EX(Ts) TSRMLS_CC);
|
||||
value = get_zval_ptr(&op_data->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
|
||||
zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (EG(free_op1)?IS_TMP_VAR:opline->op1.op_type), EX(Ts) TSRMLS_CC);
|
||||
}
|
||||
/* assign_dim has two opcodes! */
|
||||
INC_OPCODE();
|
||||
@@ -2207,7 +2258,7 @@ int zend_assign_ref_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
|
||||
int zend_jmp_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
{
|
||||
#if DEBUG_ZEND>=2
|
||||
printf("Jumping to %d\n", opline->op1.u.opline_num);
|
||||
#endif
|
||||
@@ -2417,17 +2468,9 @@ int zend_init_ctor_call_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
/* We are not handling overloaded classes right now */
|
||||
EX(object) = get_zval_ptr(&opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
|
||||
if (!PZVAL_IS_REF(EX(object)) || !EG(ze1_compatibility_mode)) {
|
||||
EX(object)->refcount++; /* For $this pointer */
|
||||
} else {
|
||||
zval *this_ptr;
|
||||
|
||||
ALLOC_ZVAL(this_ptr);
|
||||
*this_ptr = *EX(object);
|
||||
INIT_PZVAL(this_ptr);
|
||||
zval_copy_ctor(this_ptr);
|
||||
EX(object) = this_ptr;
|
||||
}
|
||||
/* New always returns the object as is_ref=0, therefore, we can just increment the reference count */
|
||||
EX(object)->refcount++; /* For $this pointer */
|
||||
|
||||
EX(fbc) = EX(fbc_constructor);
|
||||
|
||||
@@ -2479,7 +2522,7 @@ int zend_init_method_call_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) {
|
||||
EX(object) = NULL;
|
||||
} else {
|
||||
if (!PZVAL_IS_REF(EX(object)) || !EG(ze1_compatibility_mode)) {
|
||||
if (!PZVAL_IS_REF(EX(object))) {
|
||||
EX(object)->refcount++; /* For $this pointer */
|
||||
} else {
|
||||
zval *this_ptr;
|
||||
@@ -2488,7 +2531,7 @@ int zend_init_method_call_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
INIT_PZVAL(this_ptr);
|
||||
zval_copy_ctor(this_ptr);
|
||||
EX(object) = this_ptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (EX(fbc)->type == ZEND_USER_FUNCTION) {
|
||||
@@ -2632,12 +2675,15 @@ int zend_do_fcall_common_helper(ZEND_OPCODE_HANDLER_ARGS)
|
||||
if (EX(function_state).function->common.scope) {
|
||||
if (!EG(This) && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
int severity;
|
||||
char *severity_word;
|
||||
if (EX(function_state).function->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
|
||||
severity = E_STRICT;
|
||||
severity_word = "should not";
|
||||
} else {
|
||||
severity = E_ERROR;
|
||||
severity_word = "cannot";
|
||||
}
|
||||
zend_error(severity, "Non-static method %s::%s() cannot be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
|
||||
zend_error(severity, "Non-static method %s::%s() %s be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name, severity_word);
|
||||
}
|
||||
}
|
||||
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
|
||||
@@ -2740,6 +2786,9 @@ int zend_do_fcall_common_helper(ZEND_OPCODE_HANDLER_ARGS)
|
||||
if (EG(This)) {
|
||||
if (EG(exception) && EX(fbc) && EX(fbc)->common.fn_flags&ZEND_ACC_CTOR) {
|
||||
EG(This)->refcount--;
|
||||
if (EG(This)->refcount == 1) {
|
||||
zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
|
||||
}
|
||||
zval_ptr_dtor(&EG(This));
|
||||
} else if (should_change_scope) {
|
||||
zval_ptr_dtor(&EG(This));
|
||||
@@ -2827,7 +2876,16 @@ int zend_return_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
return_by_value:
|
||||
retval_ptr = get_zval_ptr(&opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
|
||||
|
||||
if (!EG(free_op1)) { /* Not a temp var */
|
||||
if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) {
|
||||
ALLOC_ZVAL(*(EG(return_value_ptr_ptr)));
|
||||
**EG(return_value_ptr_ptr) = *retval_ptr;
|
||||
INIT_PZVAL(*EG(return_value_ptr_ptr));
|
||||
if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) {
|
||||
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_P(retval_ptr)->name);
|
||||
}
|
||||
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(retval_ptr)->name);
|
||||
(*EG(return_value_ptr_ptr))->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC);
|
||||
} else if (!EG(free_op1)) { /* Not a temp var */
|
||||
if (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0) {
|
||||
ALLOC_ZVAL(*(EG(return_value_ptr_ptr)));
|
||||
**EG(return_value_ptr_ptr) = *retval_ptr;
|
||||
@@ -2883,21 +2941,16 @@ int zend_catch_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
ce = Z_OBJCE_P(EG(exception));
|
||||
if (ce != EX_T(opline->op1.u.var).class_entry) {
|
||||
while (ce->parent) {
|
||||
if (ce->parent == EX_T(opline->op1.u.var).class_entry) {
|
||||
goto exception_should_be_taken;
|
||||
if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) {
|
||||
if (opline->op1.u.EA.type) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
NEXT_OPCODE();
|
||||
}
|
||||
ce = ce->parent;
|
||||
SET_OPCODE(&op_array->opcodes[opline->extended_value]);
|
||||
return 0; /* CHECK_ME */
|
||||
}
|
||||
if (opline->op1.u.EA.type) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
NEXT_OPCODE();
|
||||
}
|
||||
SET_OPCODE(&op_array->opcodes[opline->extended_value]);
|
||||
return 0; /* CHECK_ME */
|
||||
}
|
||||
|
||||
exception_should_be_taken:
|
||||
zend_hash_update(EG(active_symbol_table), opline->op2.u.constant.value.str.val,
|
||||
opline->op2.u.constant.value.str.len+1, &EG(exception), sizeof(zval *), (void **) NULL);
|
||||
EG(exception) = NULL;
|
||||
@@ -3025,9 +3078,9 @@ int zend_recv_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
} else {
|
||||
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param TSRMLS_CC);
|
||||
if (PZVAL_IS_REF(*param)) {
|
||||
zend_assign_to_variable_reference(&opline->result, get_zval_ptr_ptr(&opline->result, EX(Ts), BP_VAR_W), param, NULL TSRMLS_CC);
|
||||
zend_assign_to_variable_reference(NULL, get_zval_ptr_ptr(&opline->result, EX(Ts), BP_VAR_W), param, NULL TSRMLS_CC);
|
||||
} else {
|
||||
zend_assign_to_variable(&opline->result, &opline->result, NULL, *param, IS_VAR, EX(Ts) TSRMLS_CC);
|
||||
zend_assign_to_variable(NULL, &opline->result, NULL, *param, IS_VAR, EX(Ts) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3060,14 +3113,14 @@ int zend_recv_init_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
assignment_value = &opline->op2.u.constant;
|
||||
}
|
||||
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC);
|
||||
zend_assign_to_variable(&opline->result, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC);
|
||||
zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC);
|
||||
} else {
|
||||
assignment_value = *param;
|
||||
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC);
|
||||
if (PZVAL_IS_REF(assignment_value)) {
|
||||
zend_assign_to_variable_reference(&opline->result, get_zval_ptr_ptr(&opline->result, EX(Ts), BP_VAR_W), param, NULL TSRMLS_CC);
|
||||
zend_assign_to_variable_reference(NULL, get_zval_ptr_ptr(&opline->result, EX(Ts), BP_VAR_W), param, NULL TSRMLS_CC);
|
||||
} else {
|
||||
zend_assign_to_variable(&opline->result, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC);
|
||||
zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3199,7 +3252,7 @@ int zend_new_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
|
||||
object_init_ex(EX_T(opline->result.u.var).var.ptr, EX_T(opline->op1.u.var).class_entry);
|
||||
EX_T(opline->result.u.var).var.ptr->refcount=1;
|
||||
EX_T(opline->result.u.var).var.ptr->is_ref=1;
|
||||
EX_T(opline->result.u.var).var.ptr->is_ref=0;
|
||||
|
||||
NEXT_OPCODE();
|
||||
}
|
||||
@@ -3358,6 +3411,7 @@ static inline int zend_init_add_array_helper(ZEND_OPCODE_HANDLER_ARGS)
|
||||
zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal offset type");
|
||||
zval_ptr_dtor(&expr_ptr);
|
||||
/* do nothing */
|
||||
break;
|
||||
@@ -3528,6 +3582,9 @@ int zend_include_or_eval_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
EG(function_state_ptr) = &EX(function_state);
|
||||
destroy_op_array(new_op_array TSRMLS_CC);
|
||||
efree(new_op_array);
|
||||
if (EG(exception)) {
|
||||
zend_throw_exception_internal(NULL TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
if (return_value_used) {
|
||||
ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
|
||||
@@ -3612,7 +3669,7 @@ int zend_unset_dim_obj_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
if (offset->type == IS_DOUBLE) {
|
||||
index = (long) offset->value.lval;
|
||||
index = (long) offset->value.dval;
|
||||
} else {
|
||||
index = offset->value.lval;
|
||||
}
|
||||
@@ -3747,7 +3804,7 @@ int zend_fe_fetch_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
|
||||
zend_hash_move_forward(fe_ht);
|
||||
} while (zend_check_property_access(zobj, str_key TSRMLS_CC) != SUCCESS);
|
||||
} while (key_type != HASH_KEY_IS_STRING || zend_check_property_access(zobj, str_key TSRMLS_CC) != SUCCESS);
|
||||
zend_unmangle_property_name(str_key, &class_name, &prop_name);
|
||||
str_key_len = strlen(prop_name);
|
||||
str_key = estrndup(prop_name, str_key_len);
|
||||
@@ -3779,6 +3836,11 @@ int zend_fe_fetch_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
return 0; /* CHECK_ME */
|
||||
}
|
||||
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
|
||||
if (!value) {
|
||||
/* failure in get_current_data */
|
||||
SET_OPCODE(op_array->opcodes+opline->op2.u.opline_num);
|
||||
return 0; /* CHECK_ME */
|
||||
}
|
||||
if (iter->funcs->get_current_key) {
|
||||
key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
|
||||
} else {
|
||||
@@ -3921,7 +3983,7 @@ static int zend_isset_isempty_dim_prop_obj_handler(int prop_dim, ZEND_OPCODE_HAN
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
if (offset->type == IS_DOUBLE) {
|
||||
index = (long) offset->value.lval;
|
||||
index = (long) offset->value.dval;
|
||||
} else {
|
||||
index = offset->value.lval;
|
||||
}
|
||||
@@ -4050,11 +4112,13 @@ int zend_end_silence_handler(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
zval restored_error_reporting;
|
||||
|
||||
restored_error_reporting.type = IS_LONG;
|
||||
restored_error_reporting.value.lval = EX_T(opline->op1.u.var).tmp_var.value.lval;
|
||||
convert_to_string(&restored_error_reporting);
|
||||
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
|
||||
zendi_zval_dtor(restored_error_reporting);
|
||||
if (!EG(error_reporting)) {
|
||||
restored_error_reporting.type = IS_LONG;
|
||||
restored_error_reporting.value.lval = EX_T(opline->op1.u.var).tmp_var.value.lval;
|
||||
convert_to_string(&restored_error_reporting);
|
||||
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
|
||||
zendi_zval_dtor(restored_error_reporting);
|
||||
}
|
||||
NEXT_OPCODE();
|
||||
}
|
||||
|
||||
|
||||
+28
-13
@@ -137,7 +137,7 @@ void init_executor(TSRMLS_D)
|
||||
EG(class_table) = CG(class_table);
|
||||
|
||||
EG(in_execution) = 0;
|
||||
EG(in_autoload) = 0;
|
||||
EG(in_autoload) = NULL;
|
||||
|
||||
zend_ptr_stack_init(&EG(argument_stack));
|
||||
zend_ptr_stack_push(&EG(argument_stack), (void *) NULL);
|
||||
@@ -293,6 +293,10 @@ void shutdown_executor(TSRMLS_D)
|
||||
zend_ptr_stack_destroy(&EG(user_error_handlers));
|
||||
zend_ptr_stack_destroy(&EG(user_exception_handlers));
|
||||
zend_objects_store_destroy(&EG(objects_store));
|
||||
if (EG(in_autoload)) {
|
||||
zend_hash_destroy(EG(in_autoload));
|
||||
FREE_HASHTABLE(EG(in_autoload));
|
||||
}
|
||||
} zend_end_try();
|
||||
}
|
||||
|
||||
@@ -879,7 +883,8 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
|
||||
int retval;
|
||||
char *lc_name;
|
||||
zval *exception;
|
||||
|
||||
char dummy = 1;
|
||||
|
||||
lc_name = do_alloca(name_length + 1);
|
||||
zend_str_tolower_copy(lc_name, name, name_length);
|
||||
|
||||
@@ -888,13 +893,25 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (EG(in_autoload)) {
|
||||
/* The compiler is not-reentrant. Make sure we __autoload() only during run-time
|
||||
* (doesn't impact fuctionality of __autoload()
|
||||
*/
|
||||
if (zend_is_compiling(TSRMLS_C)) {
|
||||
free_alloca(lc_name);
|
||||
return FAILURE;
|
||||
}
|
||||
EG(in_autoload) = 1;
|
||||
|
||||
ZVAL_STRINGL(&autoload_function, "__autoload", sizeof("__autoload")-1, 0);
|
||||
if (EG(in_autoload) == NULL) {
|
||||
ALLOC_HASHTABLE(EG(in_autoload));
|
||||
zend_hash_init(EG(in_autoload), 0, NULL, NULL, 0);
|
||||
}
|
||||
|
||||
if (zend_hash_add(EG(in_autoload), lc_name, name_length+1, (void**)&dummy, sizeof(char), NULL) == FAILURE) {
|
||||
free_alloca(lc_name);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
ZVAL_STRINGL(&autoload_function, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)-1, 0);
|
||||
|
||||
INIT_PZVAL(class_name_ptr);
|
||||
ZVAL_STRINGL(class_name_ptr, name, name_length, 0);
|
||||
@@ -905,7 +922,7 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
|
||||
EG(exception) = NULL;
|
||||
retval = call_user_function_ex(EG(function_table), NULL, &autoload_function, &retval_ptr, 1, args, 0, NULL TSRMLS_CC);
|
||||
|
||||
EG(in_autoload) = 0;
|
||||
zend_hash_del(EG(in_autoload), lc_name, name_length+1);
|
||||
|
||||
if (retval == FAILURE) {
|
||||
EG(exception) = exception;
|
||||
@@ -915,7 +932,7 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
|
||||
|
||||
if (EG(exception)) {
|
||||
free_alloca(lc_name);
|
||||
zend_error(E_ERROR, "__autoload(%s) threw an exception of type '%s'", name, Z_OBJCE_P(EG(exception))->name);
|
||||
zend_error(E_ERROR, "Function %s(%s) threw an exception of type '%s'", ZEND_AUTOLOAD_FUNC_NAME, name, Z_OBJCE_P(EG(exception))->name);
|
||||
return FAILURE;
|
||||
}
|
||||
EG(exception) = exception;
|
||||
@@ -1084,14 +1101,17 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa
|
||||
if (lParam==0) {
|
||||
KillTimer(timeout_window, wParam);
|
||||
} else {
|
||||
#ifdef ZTS
|
||||
void ***tsrm_ls;
|
||||
|
||||
#endif
|
||||
SetTimer(timeout_window, wParam, lParam*1000, NULL);
|
||||
#ifdef ZTS
|
||||
tsrm_ls = ts_resource_ex(0, &wParam);
|
||||
if (!tsrm_ls) {
|
||||
/* shouldn't normally happen */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
EG(timed_out) = 0;
|
||||
}
|
||||
break;
|
||||
@@ -1229,7 +1249,6 @@ void zend_unset_timeout(TSRMLS_D)
|
||||
zend_class_entry *zend_fetch_class(char *class_name, uint class_name_len, int fetch_type TSRMLS_DC)
|
||||
{
|
||||
zend_class_entry **pce;
|
||||
zend_bool in_autoload;
|
||||
|
||||
check_fetch_type:
|
||||
switch (fetch_type) {
|
||||
@@ -1255,13 +1274,9 @@ check_fetch_type:
|
||||
break;
|
||||
}
|
||||
|
||||
in_autoload = EG(in_autoload);
|
||||
EG(in_autoload) = 0;
|
||||
if (zend_lookup_class(class_name, class_name_len, &pce TSRMLS_CC)==FAILURE) {
|
||||
EG(in_autoload) = in_autoload;
|
||||
zend_error(E_ERROR, "Class '%s' not found", class_name);
|
||||
}
|
||||
EG(in_autoload) = in_autoload;
|
||||
return *pce;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,10 @@
|
||||
|
||||
#include "zend_compile.h"
|
||||
|
||||
#define ZEND_EXTENSION_API_NO 90021012
|
||||
/* The first number is the engine version and the rest is the date.
|
||||
* This way engine 2 API no. is always greater than engine 1 API no..
|
||||
*/
|
||||
#define ZEND_EXTENSION_API_NO 220040412
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
|
||||
+3
-1
@@ -34,6 +34,7 @@
|
||||
#include "zend_fast_cache.h"
|
||||
#include "zend_objects.h"
|
||||
#include "zend_objects_API.h"
|
||||
#include "zend_modules.h"
|
||||
|
||||
#ifdef ZEND_MULTIBYTE
|
||||
#include "zend_multibyte.h"
|
||||
@@ -190,7 +191,7 @@ struct _zend_executor_globals {
|
||||
int ticks_count;
|
||||
|
||||
zend_bool in_execution;
|
||||
zend_bool in_autoload;
|
||||
HashTable *in_autoload;
|
||||
zend_bool bailout_set;
|
||||
zend_bool full_tables_cleanup;
|
||||
zend_bool ze1_compatibility_mode;
|
||||
@@ -232,6 +233,7 @@ struct _zend_executor_globals {
|
||||
|
||||
struct _zend_execute_data *current_execute_data;
|
||||
|
||||
struct _zend_module_entry *current_module;
|
||||
|
||||
zend_property_info std_property_info;
|
||||
|
||||
|
||||
+17
-11
@@ -137,6 +137,7 @@ ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength)
|
||||
ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
|
||||
{
|
||||
uint i = 3;
|
||||
Bucket **tmp;
|
||||
|
||||
SET_INCONSISTENT(HT_OK);
|
||||
|
||||
@@ -146,18 +147,8 @@ ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunctio
|
||||
|
||||
ht->nTableSize = 1 << i;
|
||||
ht->nTableMask = ht->nTableSize - 1;
|
||||
|
||||
/* Uses ecalloc() so that Bucket* == NULL */
|
||||
if (persistent) {
|
||||
ht->arBuckets = (Bucket **) calloc(ht->nTableSize, sizeof(Bucket *));
|
||||
if (!ht->arBuckets) {
|
||||
return FAILURE;
|
||||
}
|
||||
} else {
|
||||
ht->arBuckets = (Bucket **) ecalloc_rel(ht->nTableSize, sizeof(Bucket *));
|
||||
}
|
||||
|
||||
ht->pDestructor = pDestructor;
|
||||
ht->arBuckets = NULL;
|
||||
ht->pListHead = NULL;
|
||||
ht->pListTail = NULL;
|
||||
ht->nNumOfElements = 0;
|
||||
@@ -166,6 +157,21 @@ ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunctio
|
||||
ht->persistent = persistent;
|
||||
ht->nApplyCount = 0;
|
||||
ht->bApplyProtection = 1;
|
||||
|
||||
/* Uses ecalloc() so that Bucket* == NULL */
|
||||
if (persistent) {
|
||||
tmp = (Bucket **) calloc(ht->nTableSize, sizeof(Bucket *));
|
||||
if (!tmp) {
|
||||
return FAILURE;
|
||||
}
|
||||
ht->arBuckets = tmp;
|
||||
} else {
|
||||
tmp = (Bucket **) ecalloc_rel(ht->nTableSize, sizeof(Bucket *));
|
||||
if (tmp) {
|
||||
ht->arBuckets = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
+17
-2
@@ -147,10 +147,25 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num
|
||||
zend_ini_entry *p = ini_entry;
|
||||
zend_ini_entry *hashed_ini_entry;
|
||||
zval default_value;
|
||||
HashTable *directives = registered_zend_ini_directives;
|
||||
|
||||
#ifdef ZTS
|
||||
/* if we are called during the request, eg: from dl(),
|
||||
* then we should not touch the global directives table,
|
||||
* and should update the per-(request|thread) version instead.
|
||||
* This solves two problems: one is that ini entries for dl()'d
|
||||
* extensions will now work, and the second is that updating the
|
||||
* global hash here from dl() is not mutex protected and can
|
||||
* lead to death.
|
||||
*/
|
||||
if (directives != EG(ini_directives)) {
|
||||
directives = EG(ini_directives);
|
||||
}
|
||||
#endif
|
||||
|
||||
while (p->name) {
|
||||
p->module_number = module_number;
|
||||
if (zend_hash_add(registered_zend_ini_directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
|
||||
if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
|
||||
zend_unregister_ini_entries(module_number TSRMLS_CC);
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -202,7 +217,7 @@ ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value,
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (!(ini_entry->modifyable & modify_type)) {
|
||||
if (!(ini_entry->modifiable & modify_type)) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
+30
-30
@@ -64,7 +64,7 @@ typedef struct _zend_ini_entry zend_ini_entry;
|
||||
|
||||
struct _zend_ini_entry {
|
||||
int module_number;
|
||||
int modifyable;
|
||||
int modifiable;
|
||||
char *name;
|
||||
uint name_length;
|
||||
ZEND_INI_MH((*on_modify));
|
||||
@@ -113,44 +113,44 @@ END_EXTERN_C()
|
||||
#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = {
|
||||
#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } };
|
||||
|
||||
#define ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, displayer) \
|
||||
{ 0, modifyable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer },
|
||||
#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer) \
|
||||
{ 0, modifiable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer },
|
||||
|
||||
#define ZEND_INI_ENTRY3(name, default_value, modifyable, on_modify, arg1, arg2, arg3) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, NULL)
|
||||
#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL)
|
||||
|
||||
#define ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, displayer) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL, displayer)
|
||||
#define ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, displayer) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL, displayer)
|
||||
|
||||
#define ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, arg1, arg2) \
|
||||
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL)
|
||||
#define ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, arg1, arg2) \
|
||||
ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL)
|
||||
|
||||
#define ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, displayer) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, NULL, NULL, displayer)
|
||||
#define ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, displayer) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, NULL, NULL, displayer)
|
||||
|
||||
#define ZEND_INI_ENTRY1(name, default_value, modifyable, on_modify, arg1) \
|
||||
ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, NULL)
|
||||
#define ZEND_INI_ENTRY1(name, default_value, modifiable, on_modify, arg1) \
|
||||
ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL)
|
||||
|
||||
#define ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, displayer) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, NULL, NULL, NULL, displayer)
|
||||
#define ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, displayer) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer)
|
||||
|
||||
#define ZEND_INI_ENTRY(name, default_value, modifyable, on_modify) \
|
||||
ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, NULL)
|
||||
#define ZEND_INI_ENTRY(name, default_value, modifiable, on_modify) \
|
||||
ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, NULL)
|
||||
|
||||
#ifdef ZTS
|
||||
#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id)
|
||||
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \
|
||||
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer)
|
||||
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb)
|
||||
#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id)
|
||||
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \
|
||||
ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer)
|
||||
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb)
|
||||
#else
|
||||
#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr)
|
||||
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \
|
||||
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer)
|
||||
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)
|
||||
#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr)
|
||||
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \
|
||||
ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer)
|
||||
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \
|
||||
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)
|
||||
#endif
|
||||
|
||||
#define INI_INT(name) zend_ini_long((name), sizeof(name), 0)
|
||||
@@ -192,7 +192,7 @@ END_EXTERN_C()
|
||||
/* INI parsing engine */
|
||||
typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg);
|
||||
BEGIN_EXTERN_C()
|
||||
int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
|
||||
ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZEND_INI_PARSER_ENTRY 1
|
||||
|
||||
@@ -139,7 +139,7 @@ static void ini_error(char *str)
|
||||
}
|
||||
|
||||
|
||||
int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg)
|
||||
ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg)
|
||||
{
|
||||
int retval;
|
||||
zend_ini_parser_param ini_parser_param;
|
||||
|
||||
+15
-17
@@ -22,10 +22,10 @@
|
||||
#include "zend_API.h"
|
||||
#include "zend_interfaces.h"
|
||||
|
||||
zend_class_entry *zend_ce_traversable;
|
||||
zend_class_entry *zend_ce_aggregate;
|
||||
zend_class_entry *zend_ce_iterator;
|
||||
zend_class_entry *zend_ce_arrayaccess;
|
||||
ZEND_API zend_class_entry *zend_ce_traversable;
|
||||
ZEND_API zend_class_entry *zend_ce_aggregate;
|
||||
ZEND_API zend_class_entry *zend_ce_iterator;
|
||||
ZEND_API zend_class_entry *zend_ce_arrayaccess;
|
||||
|
||||
/* {{{ zend_call_method
|
||||
Only returns the returned zval if retval_ptr != NULL */
|
||||
@@ -108,7 +108,7 @@ static zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS
|
||||
/* }}} */
|
||||
|
||||
/* {{{ zend_user_it_dtor */
|
||||
ZEND_API void zend_user_it_free_current(zend_object_iterator *_iter TSRMLS_DC)
|
||||
static void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC)
|
||||
{
|
||||
zend_user_iterator *iter = (zend_user_iterator*)_iter;
|
||||
|
||||
@@ -125,10 +125,7 @@ static void zend_user_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
|
||||
zend_user_iterator *iter = (zend_user_iterator*)_iter;
|
||||
zval *object = (zval*)iter->it.data;
|
||||
|
||||
if (iter->value) {
|
||||
zval_ptr_dtor(&iter->value);
|
||||
iter->value = NULL;
|
||||
}
|
||||
zend_user_it_invalidate_current(_iter TSRMLS_CC);
|
||||
zval_ptr_dtor(&object);
|
||||
efree(iter);
|
||||
}
|
||||
@@ -186,12 +183,15 @@ static int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_
|
||||
|
||||
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval);
|
||||
|
||||
if (!retval) {
|
||||
*int_key = 0;
|
||||
zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name);
|
||||
return HASH_KEY_IS_LONG;
|
||||
}
|
||||
switch (retval->type) {
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal type returned from %s::key()", iter->ce->name);
|
||||
case IS_NULL:
|
||||
*str_key = "";
|
||||
*str_key_len = 0;
|
||||
*int_key = 0;
|
||||
zval_ptr_dtor(&retval);
|
||||
return HASH_KEY_IS_LONG;
|
||||
@@ -199,7 +199,6 @@ static int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_
|
||||
case IS_STRING:
|
||||
*str_key = estrndup(retval->value.str.val, retval->value.str.len);
|
||||
*str_key_len = retval->value.str.len+1;
|
||||
*int_key = 0;
|
||||
zval_ptr_dtor(&retval);
|
||||
return HASH_KEY_IS_STRING;
|
||||
|
||||
@@ -225,10 +224,7 @@ static void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC)
|
||||
zend_user_iterator *iter = (zend_user_iterator*)_iter;
|
||||
zval *object = (zval*)iter->it.data;
|
||||
|
||||
if (iter->value) {
|
||||
zval_ptr_dtor(&iter->value);
|
||||
iter->value = NULL;
|
||||
}
|
||||
zend_user_it_invalidate_current(_iter TSRMLS_CC);
|
||||
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -239,6 +235,7 @@ static void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC)
|
||||
zend_user_iterator *iter = (zend_user_iterator*)_iter;
|
||||
zval *object = (zval*)iter->it.data;
|
||||
|
||||
zend_user_it_invalidate_current(_iter TSRMLS_CC);
|
||||
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -249,7 +246,8 @@ zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = {
|
||||
zend_user_it_get_current_data,
|
||||
zend_user_it_get_current_key,
|
||||
zend_user_it_move_forward,
|
||||
zend_user_it_rewind
|
||||
zend_user_it_rewind,
|
||||
zend_user_it_invalidate_current
|
||||
};
|
||||
|
||||
/* {{{ zend_user_it_get_iterator */
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
ZEND_API zend_class_entry *zend_ce_traversable;
|
||||
ZEND_API zend_class_entry *zend_ce_aggregate;
|
||||
ZEND_API zend_class_entry *zend_ce_iterator;
|
||||
ZEND_API zend_class_entry *zend_ce_arrayaccess;
|
||||
extern ZEND_API zend_class_entry *zend_ce_traversable;
|
||||
extern ZEND_API zend_class_entry *zend_ce_aggregate;
|
||||
extern ZEND_API zend_class_entry *zend_ce_iterator;
|
||||
extern ZEND_API zend_class_entry *zend_ce_arrayaccess;
|
||||
|
||||
typedef struct _zend_user_iterator {
|
||||
zend_object_iterator it;
|
||||
@@ -37,8 +37,6 @@ typedef struct _zend_user_iterator {
|
||||
zval *value;
|
||||
} zend_user_iterator;
|
||||
|
||||
ZEND_API void zend_user_it_free_current(zend_object_iterator *_iter TSRMLS_DC);
|
||||
|
||||
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC);
|
||||
|
||||
#define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \
|
||||
|
||||
@@ -44,7 +44,8 @@ static zend_object_handlers iterator_object_handlers = {
|
||||
NULL, /* get_ce */
|
||||
NULL, /* get class name */
|
||||
NULL, /* compare */
|
||||
NULL /* cast */
|
||||
NULL, /* cast */
|
||||
NULL /* count */
|
||||
};
|
||||
|
||||
ZEND_API void zend_register_iterator_wrapper(TSRMLS_D)
|
||||
|
||||
@@ -46,6 +46,9 @@ typedef struct _zend_object_iterator_funcs {
|
||||
|
||||
/* rewind to start of data (optional, may be NULL) */
|
||||
void (*rewind)(zend_object_iterator *iter TSRMLS_DC);
|
||||
|
||||
/* invalidate current value/key (optional, may be NULL) */
|
||||
void (*invalidate_current)(zend_object_iterator *iter TSRMLS_DC);
|
||||
} zend_object_iterator_funcs;
|
||||
|
||||
struct _zend_object_iterator {
|
||||
|
||||
@@ -229,8 +229,13 @@ additional_catches:
|
||||
;
|
||||
|
||||
non_empty_additional_catches:
|
||||
non_empty_additional_catches T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$2, &$4, &$6, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$2 TSRMLS_CC); }
|
||||
| T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
|
||||
additional_catch { $$ = $1; }
|
||||
| non_empty_additional_catches additional_catch { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
additional_catch:
|
||||
T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -537,7 +542,7 @@ non_empty_for_expr:
|
||||
expr_without_variable:
|
||||
T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); }
|
||||
| variable '=' expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); }
|
||||
| variable '=' '&' variable { zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); }
|
||||
| variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); }
|
||||
| variable '=' '&' T_NEW class_name_reference { zend_error(E_STRICT, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
|
||||
| T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
|
||||
| T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); }
|
||||
|
||||
@@ -1382,16 +1382,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
return T_OPEN_TAG;
|
||||
}
|
||||
|
||||
|
||||
<INITIAL>"<?php_track_vars?>"{NEWLINE}? {
|
||||
zend_error(E_WARNING, "<?php_track_vars?> is no longer supported - please use the track_vars INI directive instead");
|
||||
HANDLE_NEWLINE(yytext[yyleng-1]);
|
||||
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
|
||||
zendlval->value.str.len = yyleng;
|
||||
zendlval->type = IS_STRING;
|
||||
return T_INLINE_HTML;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING,ST_DOUBLE_QUOTES,ST_HEREDOC,ST_BACKQUOTE>"$"{LABEL} {
|
||||
zend_copy_value(zendlval, (yytext+1), (yyleng-1));
|
||||
zendlval->type = IS_STRING;
|
||||
@@ -1455,7 +1445,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
}
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"/**"{NEWLINE} {
|
||||
<ST_IN_SCRIPTING>"/**"{WHITESPACE} {
|
||||
CG(comment_start_line) = CG(zend_lineno);
|
||||
BEGIN(ST_DOC_COMMENT);
|
||||
yymore();
|
||||
|
||||
+8
-2
@@ -24,10 +24,16 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_types.h"
|
||||
|
||||
/* Define this to enable Zend MM */
|
||||
#define ZEND_MM
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
#undef ZEND_MM
|
||||
#else
|
||||
/* #define ZEND_MM */
|
||||
#undef ZEND_MM
|
||||
#endif
|
||||
|
||||
/* mm block type */
|
||||
typedef struct _zend_mm_block {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ extern struct _zend_arg_info third_arg_force_ref[4];
|
||||
extern struct _zend_arg_info fourth_arg_force_ref[5];
|
||||
extern struct _zend_arg_info all_args_by_ref[1];
|
||||
|
||||
#define ZEND_MODULE_API_NO 20040316
|
||||
#define ZEND_MODULE_API_NO 20040412
|
||||
#ifdef ZTS
|
||||
#define USING_ZTS 1
|
||||
#else
|
||||
|
||||
+18
-1
@@ -12,12 +12,27 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Ard Biesheuvel <ard@ard.nu> |
|
||||
| Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
| Ard Biesheuvel <ard@ard.nu> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#if defined(__i386__) && defined(__GNUC__)
|
||||
|
||||
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
|
||||
long __tmpvar; \
|
||||
__asm__ ("imul %3,%0\n" \
|
||||
"adc $0,%1" \
|
||||
: "=r"(__tmpvar),"=r"(usedval) \
|
||||
: "0"(a), "r"(b), "1"(0)); \
|
||||
if (usedval) (dval) = (double) (a) * (double) (b); \
|
||||
else (lval) = __tmpvar; \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
|
||||
long __lres = (a) * (b); \
|
||||
double __dres = (double)(a) * (double)(b); \
|
||||
@@ -28,3 +43,5 @@
|
||||
(lval) = __lres; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
@@ -141,7 +141,7 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D
|
||||
|
||||
zval_ptr_dtor(&value);
|
||||
|
||||
if (retval && zval_is_true(retval)) {
|
||||
if (retval && zend_is_true(retval)) {
|
||||
ret = SUCCESS;
|
||||
} else {
|
||||
ret = FAILURE;
|
||||
@@ -261,14 +261,16 @@ ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name
|
||||
return zend_verify_property_access(property_info, zobj->ce TSRMLS_CC) ? SUCCESS : FAILURE;
|
||||
}
|
||||
|
||||
zval *zend_std_read_property(zval *object, zval *member, zend_bool silent TSRMLS_DC)
|
||||
zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
|
||||
{
|
||||
zend_object *zobj;
|
||||
zval tmp_member;
|
||||
zval **retval;
|
||||
zval *rv = NULL;
|
||||
zend_property_info *property_info;
|
||||
|
||||
int silent;
|
||||
|
||||
silent = (type == BP_VAR_IS);
|
||||
zobj = Z_OBJ_P(object);
|
||||
|
||||
if (member->type != IS_STRING) {
|
||||
@@ -379,7 +381,14 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
|
||||
zval *retval;
|
||||
|
||||
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
|
||||
if(offset == NULL) {
|
||||
/* [] construct */
|
||||
zval offset_null;
|
||||
INIT_ZVAL(offset_null);
|
||||
offset = &offset_null;
|
||||
}
|
||||
zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset);
|
||||
|
||||
if (!retval) {
|
||||
if (!EG(exception)) {
|
||||
zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name);
|
||||
@@ -669,6 +678,7 @@ static union _zend_function *zend_std_get_method(zval *object, char *method_name
|
||||
|
||||
zobj = Z_OBJ_P(object);
|
||||
if (zend_hash_find(&zobj->ce->function_table, lc_method_name, method_len+1, (void **)&fbc) == FAILURE) {
|
||||
free_alloca(lc_method_name);
|
||||
if (zobj->ce->__call) {
|
||||
zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function));
|
||||
call_user_call->type = ZEND_INTERNAL_FUNCTION;
|
||||
@@ -679,7 +689,6 @@ static union _zend_function *zend_std_get_method(zval *object, char *method_name
|
||||
call_user_call->fn_flags = 0;
|
||||
call_user_call->function_name = estrndup(method_name, method_len);
|
||||
|
||||
free_alloca(lc_method_name);
|
||||
return (union _zend_function *)call_user_call;
|
||||
} else {
|
||||
return NULL;
|
||||
@@ -970,6 +979,7 @@ ZEND_API zend_object_handlers std_object_handlers = {
|
||||
zend_std_object_get_class_name, /* get_class_name */
|
||||
zend_std_compare_objects, /* compare_objects */
|
||||
NULL, /* cast_object */
|
||||
NULL, /* count_elements */
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -29,7 +29,7 @@ union _zend_function;
|
||||
symbol table, its reference count should be 0.
|
||||
*/
|
||||
/* Used to fetch property from the object, read-only */
|
||||
typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, zend_bool silent TSRMLS_DC);
|
||||
typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type TSRMLS_DC);
|
||||
|
||||
/* Used to fetch dimension from the object, read-only */
|
||||
typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC);
|
||||
@@ -50,14 +50,12 @@ typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *
|
||||
/* Used to create pointer to the property of the object, for future direct r/w access */
|
||||
typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member TSRMLS_DC);
|
||||
|
||||
/* Used to set object value (most probably used in combination with
|
||||
* typedef the result of the get_property_ptr)
|
||||
*/
|
||||
/* Used to set object value. Can be used to override assignments and scalar
|
||||
write ops (like ++, +=) on the object */
|
||||
typedef void (*zend_object_set_t)(zval **property, zval *value TSRMLS_DC);
|
||||
|
||||
/* Used to get object value (most probably used in combination with
|
||||
* the result of the get_property_ptr or when converting object value to
|
||||
* one of the basic types)
|
||||
/* Used to get object value. Can be used when converting object value to
|
||||
* one of the basic types and when using scalar ops (like ++, +=) on the object
|
||||
*/
|
||||
typedef zval* (*zend_object_get_t)(zval *property TSRMLS_DC);
|
||||
|
||||
@@ -95,6 +93,9 @@ typedef int (*zend_object_get_class_name_t)(zval *object, char **class_name, zen
|
||||
typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC);
|
||||
typedef int (*zend_object_cast_t)(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC);
|
||||
|
||||
/* updates *count to hold the number of elements present and returns SUCCESS.
|
||||
* Returns FAILURE if the object does not have any sense of overloaded dimensions */
|
||||
typedef int (*zend_object_count_elements_t)(zval *object, long *count TSRMLS_DC);
|
||||
|
||||
typedef struct _zend_object_handlers {
|
||||
/* general object functions */
|
||||
@@ -121,6 +122,7 @@ typedef struct _zend_object_handlers {
|
||||
zend_object_get_class_name_t get_class_name;
|
||||
zend_object_compare_t compare_objects;
|
||||
zend_object_cast_t cast_object;
|
||||
zend_object_count_elements_t count_elements;
|
||||
} zend_object_handlers;
|
||||
|
||||
extern ZEND_API zend_object_handlers std_object_handlers;
|
||||
|
||||
+33
-9
@@ -48,10 +48,12 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
|
||||
if (objects->object_buckets[i].valid) {
|
||||
struct _store_object *obj = &objects->object_buckets[i].bucket.obj;
|
||||
|
||||
if (obj->dtor && !objects->object_buckets[i].destructor_called) {
|
||||
obj->dtor(obj->object, i TSRMLS_CC);
|
||||
if (!objects->object_buckets[i].destructor_called) {
|
||||
objects->object_buckets[i].destructor_called = 1;
|
||||
if (obj->dtor) {
|
||||
obj->dtor(obj->object, i TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
objects->object_buckets[i].destructor_called = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,6 +192,29 @@ ZEND_API void *zend_object_store_get_object(zval *zobject TSRMLS_DC)
|
||||
return EG(objects_store).object_buckets[handle].bucket.obj.object;
|
||||
}
|
||||
|
||||
/* zend_object_store_set_object:
|
||||
* It is ONLY valid to call this function from within the constructor of an
|
||||
* overloaded object. Its purpose is to set the object pointer for the object
|
||||
* when you can't possibly know its value until you have parsed the arguments
|
||||
* from the constructor function. You MUST NOT use this function for any other
|
||||
* weird games, or call it at any other time after the object is constructed.
|
||||
* */
|
||||
ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC)
|
||||
{
|
||||
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
|
||||
|
||||
EG(objects_store).object_buckets[handle].bucket.obj.object = object;
|
||||
}
|
||||
|
||||
|
||||
/* Called when the ctor was terminated by an exception */
|
||||
ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC)
|
||||
{
|
||||
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
|
||||
|
||||
EG(objects_store).object_buckets[handle].destructor_called = 1;
|
||||
}
|
||||
|
||||
|
||||
/* Proxy objects workings */
|
||||
typedef struct _zend_proxy_object {
|
||||
@@ -215,10 +240,10 @@ ZEND_API void zend_objects_proxy_clone(zend_proxy_object *object, zend_proxy_obj
|
||||
zval_add_ref(&(*object_clone)->object);
|
||||
}
|
||||
|
||||
ZEND_API zval **zend_object_create_proxy(zval *object, zval *member TSRMLS_DC)
|
||||
ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC)
|
||||
{
|
||||
zend_proxy_object *pobj = emalloc(sizeof(zend_proxy_object));
|
||||
zval *retval, **pretval;
|
||||
zval *retval;
|
||||
|
||||
pobj->object = object;
|
||||
pobj->property = member;
|
||||
@@ -229,10 +254,8 @@ ZEND_API zval **zend_object_create_proxy(zval *object, zval *member TSRMLS_DC)
|
||||
retval->type = IS_OBJECT;
|
||||
Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(pobj, NULL, (zend_objects_free_object_storage_t) zend_objects_proxy_free_storage, (zend_objects_store_clone_t) zend_objects_proxy_clone TSRMLS_CC);
|
||||
Z_OBJ_HT_P(retval) = &zend_object_proxy_handlers;
|
||||
pretval = emalloc(sizeof(zval *));
|
||||
*pretval = retval;
|
||||
|
||||
return pretval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
ZEND_API void zend_object_proxy_set(zval **property, zval *value TSRMLS_DC)
|
||||
@@ -251,7 +274,7 @@ ZEND_API zval* zend_object_proxy_get(zval *property TSRMLS_DC)
|
||||
zend_proxy_object *probj = zend_object_store_get_object(property TSRMLS_CC);
|
||||
|
||||
if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->read_property) {
|
||||
return Z_OBJ_HT_P(probj->object)->read_property(probj->object, probj->property, 0 TSRMLS_CC);
|
||||
return Z_OBJ_HT_P(probj->object)->read_property(probj->object, probj->property, BP_VAR_R TSRMLS_CC);
|
||||
} else {
|
||||
zend_error(E_WARNING, "Cannot read property of object - no read handler defined");
|
||||
}
|
||||
@@ -286,6 +309,7 @@ static zend_object_handlers zend_object_proxy_handlers = {
|
||||
NULL, /* get_class_name */
|
||||
NULL, /* compare_objects */
|
||||
NULL, /* cast_object */
|
||||
NULL, /* count_elements */
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -64,14 +64,17 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st
|
||||
|
||||
ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC);
|
||||
ZEND_API void zend_objects_store_del_ref(zval *object TSRMLS_DC);
|
||||
ZEND_API void zend_objects_store_delete_obj(zval *object TSRMLS_DC);
|
||||
ZEND_API zend_object_value zend_objects_store_clone_obj(zval *object TSRMLS_DC);
|
||||
ZEND_API void *zend_object_store_get_object(zval *object TSRMLS_DC);
|
||||
/* See comment in zend_objects_API.c before you use this */
|
||||
ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC);
|
||||
ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC);
|
||||
|
||||
#define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_clone_obj
|
||||
|
||||
ZEND_API zval **zend_object_create_proxy(zval *object, zval *member TSRMLS_DC);
|
||||
ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC);
|
||||
|
||||
ZEND_API zend_object_handlers *zend_get_std_object_handlers();
|
||||
END_EXTERN_C()
|
||||
|
||||
@@ -108,6 +108,13 @@ ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API void zend_function_dtor(zend_function *function)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
destroy_zend_function(function TSRMLS_CC);
|
||||
}
|
||||
|
||||
static void zend_cleanup_op_array_data(zend_op_array *op_array)
|
||||
{
|
||||
if (op_array->static_variables) {
|
||||
|
||||
+114
-108
@@ -30,10 +30,6 @@
|
||||
#include "zend_API.h"
|
||||
#include "zend_multiply.h"
|
||||
|
||||
#if 0&&HAVE_BCMATH
|
||||
#include "ext/bcmath/number.h"
|
||||
#endif
|
||||
|
||||
#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1))
|
||||
|
||||
ZEND_API int zend_atoi(const char *str, int str_len)
|
||||
@@ -118,11 +114,6 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
case IS_DOUBLE:
|
||||
case IS_LONG:
|
||||
break;
|
||||
#if 0 && HAVE_BCMATH
|
||||
case FLAG_IS_BC:
|
||||
op->type = IS_DOUBLE; /* may have lost significant digits */
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
op->value.lval = strtol(op->value.str.val, NULL, 10);
|
||||
op->type = IS_LONG;
|
||||
@@ -138,6 +129,9 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
zend_list_delete(op->value.lval);
|
||||
op->type = IS_LONG;
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
convert_to_long_base(op, 10);
|
||||
break;
|
||||
case IS_NULL:
|
||||
op->type = IS_LONG;
|
||||
op->value.lval = 0;
|
||||
@@ -158,9 +152,6 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
case IS_DOUBLE: \
|
||||
case IS_LONG: \
|
||||
break; \
|
||||
case FLAG_IS_BC: \
|
||||
(holder).type = IS_DOUBLE; /* may have lost significant digits */ \
|
||||
break; \
|
||||
default: \
|
||||
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
|
||||
(holder).type = IS_LONG; \
|
||||
@@ -180,6 +171,14 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
(holder).type = IS_LONG; \
|
||||
(op) = &(holder); \
|
||||
break; \
|
||||
case IS_OBJECT: \
|
||||
(holder) = (*(op)); \
|
||||
zval_copy_ctor(&(holder)); \
|
||||
convert_to_long_base(&(holder), 10); \
|
||||
if ((holder).type == IS_LONG) { \
|
||||
(op) = &(holder); \
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -206,7 +205,7 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
case IS_OBJECT: \
|
||||
(holder) = (*(op)); \
|
||||
zval_copy_ctor(&(holder)); \
|
||||
convert_to_long(&(holder)); \
|
||||
convert_to_long_base(&(holder), 10); \
|
||||
break; \
|
||||
case IS_BOOL: \
|
||||
case IS_RESOURCE: \
|
||||
@@ -262,6 +261,25 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
}
|
||||
|
||||
|
||||
#define convert_object_to_type(op, ctype, conv_func) \
|
||||
if (Z_OBJ_HT_P(op)->cast_object) { \
|
||||
if (Z_OBJ_HT_P(op)->cast_object(op, op, ctype, 1 TSRMLS_CC) == SUCCESS) { \
|
||||
op->type = ctype; \
|
||||
} \
|
||||
} else { \
|
||||
if(Z_OBJ_HT_P(op)->get) { \
|
||||
zval *newop = Z_OBJ_HT_P(op)->get(op TSRMLS_CC); \
|
||||
if(Z_TYPE_P(newop) != IS_OBJECT) { \
|
||||
/* for safety - avoid loop */ \
|
||||
zval_dtor(op); \
|
||||
*op = *newop; \
|
||||
FREE_ZVAL(newop); \
|
||||
conv_func(op); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void convert_to_long(zval *op)
|
||||
{
|
||||
convert_to_long_base(op, 10);
|
||||
@@ -301,28 +319,27 @@ ZEND_API void convert_to_long_base(zval *op, int base)
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
{
|
||||
int retval = 1;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (op->value.obj.handlers->cast_object) {
|
||||
if (op->value.obj.handlers->cast_object(op, op, IS_LONG, 1 TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
int retval = 1;
|
||||
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
HashTable *ht = Z_OBJPROP_P(op);
|
||||
if (ht) {
|
||||
retval = (zend_hash_num_elements(ht)?1:0);
|
||||
}
|
||||
} else {
|
||||
zend_error(E_NOTICE, "Object of class %s could not be converted to integer", Z_OBJCE_P(op)->name);
|
||||
}
|
||||
convert_object_to_type(op, IS_LONG, convert_to_long);
|
||||
|
||||
if (op->type == IS_LONG) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
HashTable *ht = Z_OBJPROP_P(op);
|
||||
if (ht) {
|
||||
retval = (zend_hash_num_elements(ht)?1:0);
|
||||
}
|
||||
zval_dtor(op);
|
||||
ZVAL_LONG(op, retval);
|
||||
return;
|
||||
} else {
|
||||
/* we cannot convert it to long */
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
zend_error(E_WARNING, "Cannot convert to ordinal value");
|
||||
@@ -369,28 +386,26 @@ ZEND_API void convert_to_double(zval *op)
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
{
|
||||
double retval = 1.0;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
convert_object_to_type(op, IS_DOUBLE, convert_to_double);
|
||||
|
||||
if (op->value.obj.handlers->cast_object) {
|
||||
TSRMLS_FETCH();
|
||||
if (op->value.obj.handlers->cast_object(op, op, IS_DOUBLE, 1 TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
if (op->type == IS_DOUBLE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
HashTable *ht = Z_OBJPROP_P(op);
|
||||
if (ht) {
|
||||
retval = (zend_hash_num_elements(ht)?1.0:0.0);
|
||||
}
|
||||
} else {
|
||||
double retval = 1.0;
|
||||
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
HashTable *ht = Z_OBJPROP_P(op);
|
||||
if (ht) {
|
||||
retval = (zend_hash_num_elements(ht)?1.0:0.0);
|
||||
}
|
||||
} else {
|
||||
zend_error(E_NOTICE, "Object of class %s could not be converted to double", Z_OBJCE_P(op)->name);
|
||||
}
|
||||
|
||||
zval_dtor(op);
|
||||
ZVAL_DOUBLE(op, retval);
|
||||
zend_error(E_NOTICE, "Object of class %s could not be converted to double", Z_OBJCE_P(op)->name);
|
||||
}
|
||||
|
||||
zval_dtor(op);
|
||||
ZVAL_DOUBLE(op, retval);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -406,9 +421,9 @@ ZEND_API void convert_to_double(zval *op)
|
||||
ZEND_API void convert_to_null(zval *op)
|
||||
{
|
||||
if (op->type == IS_OBJECT) {
|
||||
if (op->value.obj.handlers->cast_object) {
|
||||
if (Z_OBJ_HT_P(op)->cast_object) {
|
||||
TSRMLS_FETCH();
|
||||
if (op->value.obj.handlers->cast_object(op, op, IS_NULL, 1 TSRMLS_CC) == SUCCESS) {
|
||||
if (Z_OBJ_HT_P(op)->cast_object(op, op, IS_NULL, 1 TSRMLS_CC) == SUCCESS) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -460,25 +475,24 @@ ZEND_API void convert_to_boolean(zval *op)
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
{
|
||||
zend_bool retval = 1;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (op->value.obj.handlers->cast_object) {
|
||||
if (op->value.obj.handlers->cast_object(op, op, IS_BOOL, 1 TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
zend_bool retval = 1;
|
||||
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
HashTable *ht = Z_OBJPROP_P(op);
|
||||
if (ht) {
|
||||
retval = (zend_hash_num_elements(ht)?1:0);
|
||||
}
|
||||
}
|
||||
convert_object_to_type(op, IS_BOOL, convert_to_double);
|
||||
|
||||
zval_dtor(op);
|
||||
ZVAL_BOOL(op, retval);
|
||||
if (op->type == IS_BOOL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
HashTable *ht = Z_OBJPROP_P(op);
|
||||
if (ht) {
|
||||
retval = (zend_hash_num_elements(ht)?1:0);
|
||||
}
|
||||
}
|
||||
|
||||
zval_dtor(op);
|
||||
ZVAL_BOOL(op, retval);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -489,7 +503,6 @@ ZEND_API void convert_to_boolean(zval *op)
|
||||
op->type = IS_BOOL;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
|
||||
{
|
||||
long lval;
|
||||
@@ -542,14 +555,14 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
|
||||
break;
|
||||
case IS_OBJECT: {
|
||||
TSRMLS_FETCH();
|
||||
if (op->value.obj.handlers->cast_object) {
|
||||
if (op->value.obj.handlers->cast_object(op, op, IS_STRING, 1 TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
zend_error(E_NOTICE, "Object of class %s could not be converted to string", Z_OBJCE_P(op)->name);
|
||||
} else {
|
||||
zend_error(E_NOTICE, "Object of class %s to string conversion", Z_OBJCE_P(op)->name);
|
||||
|
||||
convert_object_to_type(op, IS_STRING, convert_to_string);
|
||||
|
||||
if (op->type == IS_STRING) {
|
||||
return;
|
||||
}
|
||||
|
||||
zend_error(E_NOTICE, "Object of class %s to string conversion", Z_OBJCE_P(op)->name);
|
||||
zval_dtor(op);
|
||||
op->value.str.val = estrndup_rel("Object", sizeof("Object")-1);
|
||||
op->value.str.len = sizeof("Object")-1;
|
||||
@@ -609,7 +622,16 @@ ZEND_API void convert_to_array(zval *op)
|
||||
ALLOC_HASHTABLE(ht);
|
||||
zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
if (Z_OBJ_HT_P(op)->get_properties) {
|
||||
zend_hash_copy(ht, Z_OBJ_HT_P(op)->get_properties(op TSRMLS_CC), (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
HashTable *obj_ht = Z_OBJ_HT_P(op)->get_properties(op TSRMLS_CC);
|
||||
if(obj_ht) {
|
||||
zend_hash_copy(ht, obj_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
} else {
|
||||
convert_object_to_type(op, IS_ARRAY, convert_to_array);
|
||||
|
||||
if (op->type == IS_ARRAY) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
zval_dtor(op);
|
||||
op->type = IS_ARRAY;
|
||||
@@ -1278,6 +1300,16 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
COMPARE_RETURN_AND_FREE(SUCCESS);
|
||||
}
|
||||
|
||||
if (op1->type==IS_OBJECT && op2->type==IS_OBJECT) {
|
||||
/* If the handlers array is not identical, fall through
|
||||
* and perform get() or cast() if implemented
|
||||
*/
|
||||
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
|
||||
zend_compare_objects(result, op1, op2 TSRMLS_CC);
|
||||
COMPARE_RETURN_AND_FREE(SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
|
||||
@@ -1298,11 +1330,6 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
COMPARE_RETURN_AND_FREE(SUCCESS);
|
||||
}
|
||||
|
||||
if (op1->type==IS_OBJECT && op2->type==IS_OBJECT) {
|
||||
zend_compare_objects(result, op1, op2 TSRMLS_CC);
|
||||
COMPARE_RETURN_AND_FREE(SUCCESS);
|
||||
}
|
||||
|
||||
if (op1->type==IS_ARRAY) {
|
||||
result->value.lval = 1;
|
||||
result->type = IS_LONG;
|
||||
@@ -1381,8 +1408,16 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
}
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2) && Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) {
|
||||
result->value.lval = 1;
|
||||
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
zend_compare_objects(result, op1, op2 TSRMLS_CC);
|
||||
/* comparison returns 0 in case of equality and
|
||||
* 1 in case of ineqaulity, we need to reverse it
|
||||
*/
|
||||
result->value.lval = !result->value.lval;
|
||||
} else {
|
||||
result->value.lval = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2));
|
||||
}
|
||||
} else {
|
||||
result->value.lval = 0;
|
||||
}
|
||||
@@ -1641,10 +1676,6 @@ ZEND_API int increment_function(zval *op1)
|
||||
op1->type = IS_DOUBLE;
|
||||
efree(strval); /* should never be empty_string */
|
||||
break;
|
||||
#if 0
|
||||
case FLAG_IS_BC:
|
||||
/* Not implemented */
|
||||
#endif
|
||||
default:
|
||||
/* Perl style string increment */
|
||||
increment_string(op1);
|
||||
@@ -1834,22 +1865,6 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
|
||||
if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1, 0)) &&
|
||||
(ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2, 0))) {
|
||||
#if 0&&HAVE_BCMATH
|
||||
if ((ret1==FLAG_IS_BC) || (ret2==FLAG_IS_BC)) {
|
||||
bc_num first, second;
|
||||
|
||||
/* use the BC math library to compare the numbers */
|
||||
init_num(&first);
|
||||
init_num(&second);
|
||||
str2num(&first, s1->value.str.val, 100); /* this scale should do */
|
||||
str2num(&second, s2->value.str.val, 100); /* ditto */
|
||||
result->value.lval = bc_compare(first, second);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
} else
|
||||
#endif
|
||||
if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) {
|
||||
if (ret1!=IS_DOUBLE) {
|
||||
dval1 = strtod(s1->value.str.val, NULL);
|
||||
@@ -1906,15 +1921,6 @@ ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC)
|
||||
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC)
|
||||
{
|
||||
result->type = IS_LONG;
|
||||
if (Z_OBJ_HT_P(o1) != Z_OBJ_HT_P(o2)) {
|
||||
result->value.lval = 1; /* Comparing objects of different types is pretty much meaningless */
|
||||
return;
|
||||
}
|
||||
|
||||
if (EG(ze1_compatibility_mode) && Z_OBJPROP_P(o1) && Z_OBJPROP_P(o2)) {
|
||||
zend_compare_symbol_tables(result, Z_OBJPROP_P(o1), Z_OBJPROP_P(o2) TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Z_OBJ_HT_P(o1)->compare_objects == NULL) {
|
||||
if (Z_OBJ_HANDLE_P(o1) == Z_OBJ_HANDLE_P(o2)) {
|
||||
|
||||
+4
-23
@@ -87,6 +87,8 @@ static inline zend_bool is_numeric_string(char *str, int length, long *lval, dou
|
||||
*lval = local_lval;
|
||||
}
|
||||
return IS_LONG;
|
||||
} else if (end_ptr_long == str && *end_ptr_long != '\0') { /* ignore partial string matches */
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
end_ptr_long=NULL;
|
||||
@@ -98,9 +100,9 @@ static inline zend_bool is_numeric_string(char *str, int length, long *lval, dou
|
||||
|
||||
errno=0;
|
||||
local_dval = strtod(str, &end_ptr_double);
|
||||
if (errno!=ERANGE) {
|
||||
if (errno != ERANGE) {
|
||||
if (end_ptr_double == str+length) { /* floating point string */
|
||||
if (! zend_finite(local_dval)) {
|
||||
if (!zend_finite(local_dval)) {
|
||||
/* "inf","nan" and maybe other weird ones */
|
||||
return 0;
|
||||
}
|
||||
@@ -108,28 +110,7 @@ static inline zend_bool is_numeric_string(char *str, int length, long *lval, dou
|
||||
if (dval) {
|
||||
*dval = local_dval;
|
||||
}
|
||||
#if 0&&HAVE_BCMATH
|
||||
if (length>16) {
|
||||
register char *ptr=str, *end=str+length;
|
||||
|
||||
while (ptr<end) {
|
||||
switch (*ptr++) {
|
||||
case 'e':
|
||||
case 'E':
|
||||
/* scientific notation, not handled by the BC library */
|
||||
return IS_DOUBLE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FLAG_IS_BC;
|
||||
} else {
|
||||
return IS_DOUBLE;
|
||||
}
|
||||
#else
|
||||
return IS_DOUBLE;
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
end_ptr_double=NULL;
|
||||
|
||||
+363
-144
File diff suppressed because it is too large.
Load diff
+4
-4
@@ -49,7 +49,7 @@ ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSR
|
||||
return (handle->handle.fp) ? SUCCESS : FAILURE;
|
||||
}
|
||||
|
||||
int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC)
|
||||
ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC)
|
||||
{
|
||||
switch (file_handle->type) {
|
||||
case ZEND_HANDLE_FILENAME:
|
||||
@@ -90,7 +90,7 @@ int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC)
|
||||
ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC)
|
||||
{
|
||||
if (file_handle->handle.stream.interactive) {
|
||||
int c = '*', n;
|
||||
@@ -105,7 +105,7 @@ size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSR
|
||||
return file_handle->handle.stream.reader(file_handle->handle.stream.handle, buf, len TSRMLS_CC);
|
||||
}
|
||||
|
||||
int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC)
|
||||
ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC)
|
||||
{
|
||||
char buf;
|
||||
|
||||
@@ -115,7 +115,7 @@ int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC)
|
||||
return EOF;
|
||||
}
|
||||
|
||||
int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC)
|
||||
ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
+4
-4
@@ -49,10 +49,10 @@ typedef struct _zend_file_handle {
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC);
|
||||
int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC);
|
||||
int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC);
|
||||
size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC);
|
||||
int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC);
|
||||
ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC);
|
||||
ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC);
|
||||
ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC);
|
||||
ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC);
|
||||
END_EXTERN_C()
|
||||
|
||||
#define zend_stream_close(handle) zend_file_handle_dtor((handle))
|
||||
|
||||
@@ -140,25 +140,22 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
case IS_CONSTANT_ARRAY: {
|
||||
zval *tmp;
|
||||
HashTable *original_ht = zvalue->value.ht;
|
||||
HashTable *tmp_ht = NULL;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (zvalue->value.ht == &EG(symbol_table)) {
|
||||
return SUCCESS; /* do nothing */
|
||||
}
|
||||
ALLOC_HASHTABLE_REL(zvalue->value.ht);
|
||||
zend_hash_init(zvalue->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(zvalue->value.ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
ALLOC_HASHTABLE_REL(tmp_ht);
|
||||
zend_hash_init(tmp_ht, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zvalue->value.ht = tmp_ht;
|
||||
}
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
zvalue->value.obj = zvalue->value.obj.handlers->clone_obj(zvalue TSRMLS_CC);
|
||||
} else {
|
||||
Z_OBJ_HT_P(zvalue)->add_ref(zvalue TSRMLS_CC);
|
||||
}
|
||||
Z_OBJ_HT_P(zvalue)->add_ref(zvalue TSRMLS_CC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+3
-1
@@ -1794,7 +1794,6 @@ AC_DEFUN([PHP_SETUP_LIBXML], [
|
||||
PHP_TEST_BUILD(xmlInitParser,
|
||||
[
|
||||
php_cv_libxml_build_works=yes
|
||||
AC_DEFINE(HAVE_LIBXML, 1, [ ])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR([build test failed. Please check the config.log for details.])
|
||||
@@ -1802,6 +1801,9 @@ AC_DEFUN([PHP_SETUP_LIBXML], [
|
||||
[$]$1
|
||||
])
|
||||
])
|
||||
if test "$php_cv_libxml_build_works" = "yes"; then
|
||||
AC_DEFINE(HAVE_LIBXML, 1, [ ])
|
||||
fi
|
||||
$2
|
||||
else
|
||||
AC_MSG_ERROR([libxml2 version 2.5.10 or greater required.])
|
||||
|
||||
+12
-6
@@ -40,8 +40,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
MAJOR_VERSION=5
|
||||
MINOR_VERSION=0
|
||||
RELEASE_VERSION=0
|
||||
EXTRA_VERSION="RC1-dev"
|
||||
RELEASE_VERSION=1
|
||||
EXTRA_VERSION="RC1"
|
||||
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
|
||||
|
||||
dnl Define where extension directories are located in the configure context
|
||||
@@ -351,6 +351,7 @@ stdlib.h \
|
||||
string.h \
|
||||
syslog.h \
|
||||
sysexits.h \
|
||||
sys/ioctl.h \
|
||||
sys/file.h \
|
||||
sys/mman.h \
|
||||
sys/mount.h \
|
||||
@@ -364,6 +365,7 @@ sys/vfs.h \
|
||||
sys/sysexits.h \
|
||||
sys/varargs.h \
|
||||
sys/wait.h \
|
||||
termios.h \
|
||||
unistd.h \
|
||||
unix.h \
|
||||
utime.h \
|
||||
@@ -479,6 +481,7 @@ getservbyport \
|
||||
getrusage \
|
||||
gettimeofday \
|
||||
gmtime_r \
|
||||
grantpt \
|
||||
inet_ntoa \
|
||||
inet_ntop \
|
||||
inet_pton \
|
||||
@@ -494,6 +497,7 @@ mmap \
|
||||
nl_langinfo \
|
||||
perror \
|
||||
poll \
|
||||
ptsname \
|
||||
putenv \
|
||||
realpath \
|
||||
random \
|
||||
@@ -504,6 +508,7 @@ scandir \
|
||||
setitimer \
|
||||
setlocale \
|
||||
localeconv \
|
||||
setpgid \
|
||||
setsockopt \
|
||||
setvbuf \
|
||||
shutdown \
|
||||
@@ -524,6 +529,7 @@ strtok_r \
|
||||
symlink \
|
||||
tempnam \
|
||||
tzset \
|
||||
unlockpt \
|
||||
unsetenv \
|
||||
usleep \
|
||||
nanosleep \
|
||||
@@ -868,15 +874,15 @@ if test "$PHP_PEAR" != "no"; then
|
||||
dnl
|
||||
if test "$PHP_SAPI_CLI" = "no"; then
|
||||
pear_error_msg="$pear_error_msg
|
||||
PEAR requires CLI to be enabled. Add --enable-cli to the configure line."
|
||||
PEAR requires CLI to be enabled. Add --enable-cli to the configure line. (or --disable-pear)"
|
||||
fi
|
||||
if test "$PHP_PCRE_REGEX" = "no"; then
|
||||
pear_error_msg="$pear_error_msg
|
||||
PEAR requires PCRE to be enabled. Add --with-pcre-regex to the configure line."
|
||||
PEAR requires PCRE to be enabled. Add --with-pcre-regex to the configure line. (or --disable-pear)"
|
||||
fi
|
||||
if test "$PHP_XML" = "no"; then
|
||||
pear_error_msg="$pear_error_msg
|
||||
PEAR requires XML to be enabled. Add --enable-xml to the configure line."
|
||||
PEAR requires XML to be enabled. Add --enable-xml to the configure line. (or --disable-pear)"
|
||||
fi
|
||||
|
||||
dnl
|
||||
@@ -884,7 +890,7 @@ dnl ext/xmlrpc is not really there yet to be a requirement..
|
||||
dnl
|
||||
dnl if test "$PHP_XMLRPC" = "no"; then
|
||||
dnl pear_error_msg="$pear_error_msg
|
||||
dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line."
|
||||
dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line. (or --disable-pear)"
|
||||
dnl fi
|
||||
dnl
|
||||
|
||||
|
||||
+23
-5
@@ -53,8 +53,8 @@ zend_module_entry bcmath_module_entry = {
|
||||
bcmath_functions,
|
||||
PHP_MINIT(bcmath),
|
||||
PHP_MSHUTDOWN(bcmath),
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_RINIT(bcmath),
|
||||
PHP_RSHUTDOWN(bcmath),
|
||||
PHP_MINFO(bcmath),
|
||||
NO_VERSION_YET,
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
@@ -86,8 +86,6 @@ PHP_MINIT_FUNCTION(bcmath)
|
||||
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
bc_init_numbers(TSRMLS_C);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -95,6 +93,26 @@ PHP_MINIT_FUNCTION(bcmath)
|
||||
/* {{{ PHP_MSHUTDOWN_FUNCTION
|
||||
*/
|
||||
PHP_MSHUTDOWN_FUNCTION(bcmath)
|
||||
{
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ PHP_RINIT_FUNCTION
|
||||
*/
|
||||
PHP_RINIT_FUNCTION(bcmath)
|
||||
{
|
||||
bc_init_numbers(TSRMLS_C);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ PHP_RSHUTDOWN_FUNCTION
|
||||
*/
|
||||
PHP_RSHUTDOWN_FUNCTION(bcmath)
|
||||
{
|
||||
_bc_free_num_ex(&BCG(_zero_), 1);
|
||||
_bc_free_num_ex(&BCG(_one_), 1);
|
||||
@@ -102,7 +120,7 @@ PHP_MSHUTDOWN_FUNCTION(bcmath)
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
/* }}} */
|
||||
|
||||
/* {{{ PHP_MINFO_FUNCTION
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE package SYSTEM "../pear/package.dtd">
|
||||
<package>
|
||||
<name>bcmath</name>
|
||||
<summary>Arbitrary Precision Mathematics Functions</summary>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>andi</user>
|
||||
<name>Andi Gutmans</name>
|
||||
<email>andi@php.net</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<description>
|
||||
For arbitrary precision mathematics PHP offers the Binary Calculator
|
||||
which supports numbers of any size and precision, represented as strings.
|
||||
</description>
|
||||
<license>PHP</license>
|
||||
<release>
|
||||
<state>beta</state>
|
||||
<version>5.0.0rc1</version>
|
||||
<date>2004-03-19</date>
|
||||
<notes>
|
||||
package.xml added to support intallation using pear installer
|
||||
</notes>
|
||||
<filelist>
|
||||
<file role="doc" name="CREDITS"/>
|
||||
<file role="src" name="config.m4"/>
|
||||
<file role="src" name="config.w32"/>
|
||||
<file role="src" name="bcmath.c"/>
|
||||
<file role="src" name="php_bcmath.h"/>
|
||||
<file role="src" name="number.c"/>
|
||||
<file role="src" name="number.h"/>
|
||||
<file role="doc" name="libbcmath/AUTHORS"/>
|
||||
<file role="doc" name="libbcmath/COPYING.LIB"/>
|
||||
<file role="doc" name="libbcmath/ChangeLog"/>
|
||||
<file role="doc" name="libbcmath/FAQ"/>
|
||||
<file role="doc" name="libbcmath/INSTALL"/>
|
||||
<file role="doc" name="libbcmath/NEWS"/>
|
||||
<file role="doc" name="libbcmath/README"/>
|
||||
<file role="src" name="libbcmath/src/Makefile.am"/>
|
||||
<file role="src" name="libbcmath/src/add.c"/>
|
||||
<file role="src" name="libbcmath/src/bcmath.h"/>
|
||||
<file role="src" name="libbcmath/src/compare.c"/>
|
||||
<file role="src" name="libbcmath/src/config.h"/>
|
||||
<file role="src" name="libbcmath/src/debug.c"/>
|
||||
<file role="src" name="libbcmath/src/div.c"/>
|
||||
<file role="src" name="libbcmath/src/divmod.c"/>
|
||||
<file role="src" name="libbcmath/src/doaddsub.c"/>
|
||||
<file role="src" name="libbcmath/src/init.c"/>
|
||||
<file role="src" name="libbcmath/src/int2num.c"/>
|
||||
<file role="src" name="libbcmath/src/nearzero.c"/>
|
||||
<file role="src" name="libbcmath/src/neg.c"/>
|
||||
<file role="src" name="libbcmath/src/num2long.c"/>
|
||||
<file role="src" name="libbcmath/src/num2str.c"/>
|
||||
<file role="src" name="libbcmath/src/outofmem.c"/>
|
||||
<file role="src" name="libbcmath/src/output.c"/>
|
||||
<file role="src" name="libbcmath/src/private.h"/>
|
||||
<file role="src" name="libbcmath/src/raise.c"/>
|
||||
<file role="src" name="libbcmath/src/raisemod.c"/>
|
||||
<file role="src" name="libbcmath/src/recmul.c"/>
|
||||
<file role="src" name="libbcmath/src/rmzero.c"/>
|
||||
<file role="src" name="libbcmath/src/rt.c"/>
|
||||
<file role="src" name="libbcmath/src/sqrt.c"/>
|
||||
<file role="src" name="libbcmath/src/str2num.c"/>
|
||||
<file role="src" name="libbcmath/src/sub.c"/>
|
||||
<file role="src" name="libbcmath/src/zero.c"/>
|
||||
<file role="src" name="libbcmath/Makefile.am"/>
|
||||
<file role="src" name="libbcmath/acconfig.h"/>
|
||||
<file role="src" name="libbcmath/aclocal.m4"/>
|
||||
<file role="src" name="libbcmath/config.h.in"/>
|
||||
<file role="src" name="libbcmath/configure"/>
|
||||
<file role="src" name="libbcmath/configure.in"/>
|
||||
<file role="src" name="libbcmath/install-sh"/>
|
||||
<file role="src" name="libbcmath/missing"/>
|
||||
<file role="src" name="libbcmath/mkinstalldirs"/>
|
||||
<file role="test" name="tests/bcadd.phpt"/>
|
||||
<file role="test" name="tests/bccomp.phpt"/>
|
||||
<file role="test" name="tests/bcdiv.phpt"/>
|
||||
<file role="test" name="tests/bcmod.phpt"/>
|
||||
<file role="test" name="tests/bcmul.phpt"/>
|
||||
<file role="test" name="tests/bcpow.phpt"/>
|
||||
<file role="test" name="tests/bcscale.phpt"/>
|
||||
<file role="test" name="tests/bcsqrt.phpt"/>
|
||||
<file role="test" name="tests/bcsub.phpt"/>
|
||||
</filelist>
|
||||
<deps>
|
||||
<dep type="php" rel="ge" version="5" />
|
||||
</deps>
|
||||
</release>
|
||||
</package>
|
||||
<!--
|
||||
vim:et:ts=1:sw=1
|
||||
-->
|
||||
@@ -30,6 +30,8 @@ extern zend_module_entry bcmath_module_entry;
|
||||
|
||||
PHP_MINIT_FUNCTION(bcmath);
|
||||
PHP_MSHUTDOWN_FUNCTION(bcmath);
|
||||
PHP_RINIT_FUNCTION(bcmath);
|
||||
PHP_RSHUTDOWN_FUNCTION(bcmath);
|
||||
PHP_MINFO_FUNCTION(bcmath);
|
||||
|
||||
PHP_FUNCTION(bcadd);
|
||||
|
||||
@@ -23,6 +23,9 @@ Bz2 is an extension to create and parse bzip2 compressed data.
|
||||
Initial Release in PECL
|
||||
</notes>
|
||||
</release>
|
||||
<configureoptions>
|
||||
<configureoption name="with-bz2" default="autodetect" prompt="path to bz2 installation?"/>
|
||||
</configureoptions>
|
||||
<filelist>
|
||||
<dir role="src" name="/">
|
||||
<file role="doc">CREDITS</file>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
EXPORTS
|
||||
BZ2_bzCompressInit
|
||||
BZ2_bzCompress
|
||||
BZ2_bzCompressEnd
|
||||
BZ2_bzDecompressInit
|
||||
BZ2_bzDecompress
|
||||
BZ2_bzDecompressEnd
|
||||
@@ -2,8 +2,6 @@
|
||||
BZ2 with files
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("bz2")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php // $Id$
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
BZ2 with strings
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("bz2")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php // $Id$
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE package SYSTEM "../pear/package.dtd">
|
||||
<package>
|
||||
<name>calendar</name>
|
||||
<summary>Date conversion between different calendar formats</summary>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>hholzgra</user>
|
||||
<name>Hartmut Holzgraefe</name>
|
||||
<email>hartmut@php.net</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
<maintainer>
|
||||
<user>shane</user>
|
||||
<name>Shane Caraveo</name>
|
||||
<role>developer</role>
|
||||
<email>shane@caraveo.com</email>
|
||||
</maintainer>
|
||||
<maintainer>
|
||||
<user>colin</user>
|
||||
<name>Colin Viebrock</name>
|
||||
<role>developer</role>
|
||||
<email>colin@easydns.com</email>
|
||||
</maintainer>
|
||||
<maintainer>
|
||||
<user>wez</user>
|
||||
<name>Wez Furlong</name>
|
||||
<role>developer</role>
|
||||
<email>wez@php.net</email>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<description>
|
||||
The calendar extension presents a series of functions to simplify
|
||||
converting between different calendar formats. The intermediary or
|
||||
standard it is based on is the Julian Day Count. The Julian Day Count
|
||||
is a count of days starting from January 1st, 4713 B.C. To convert
|
||||
between calendar systems, you must first convert to Julian Day Count,
|
||||
then to the calendar system of your choice. Julian Day Count is very
|
||||
different from the Julian Calendar!
|
||||
</description>
|
||||
<license>PHP</license>
|
||||
<release>
|
||||
<state>beta</state>
|
||||
<version>5.0.0rc1</version>
|
||||
<date>2004-03-19</date>
|
||||
<notes>
|
||||
package.xml added to support intallation using pear installer
|
||||
</notes>
|
||||
<filelist>
|
||||
<file role="doc" name="CREDITS"/>
|
||||
<file role="src" name="config.m4"/>
|
||||
<file role="src" name="config.w32"/>
|
||||
<file role="src" name="cal_unix.c"/>
|
||||
<file role="src" name="calendar.c"/>
|
||||
<file role="src" name="dow.c"/>
|
||||
<file role="src" name="easter.c"/>
|
||||
<file role="src" name="french.c"/>
|
||||
<file role="src" name="gregor.c"/>
|
||||
<file role="src" name="jewish.c"/>
|
||||
<file role="src" name="julian.c"/>
|
||||
<file role="src" name="package.xml"/>
|
||||
<file role="src" name="php_calendar.h"/>
|
||||
<file role="src" name="sdncal.h"/>
|
||||
<file role="test" name="tests/jdtojewish.phpt"/>
|
||||
</filelist>
|
||||
<deps>
|
||||
<dep type="php" rel="ge" version="5" />
|
||||
</deps>
|
||||
</release>
|
||||
</package>
|
||||
<!--
|
||||
vim:et:ts=1:sw=1
|
||||
-->
|
||||
@@ -65,9 +65,6 @@ $word->Quit();
|
||||
|
||||
TODO:
|
||||
|
||||
- Mapping PHP arrays as SafeArray's. This is currently not done.
|
||||
Probably will implement this into $a = new variant($php_array, VT_ARRAY)
|
||||
or something similar.
|
||||
- documentation
|
||||
|
||||
* dotnet support requires that you have the mscoree.h header from the .net sdk
|
||||
|
||||
@@ -37,7 +37,7 @@ PHP_FUNCTION(com_create_instance)
|
||||
php_com_dotnet_object *obj;
|
||||
char *module_name, *typelib_name = NULL, *server_name = NULL;
|
||||
char *user_name = NULL, *domain_name = NULL, *password = NULL;
|
||||
long module_name_len, typelib_name_len, server_name_len,
|
||||
int module_name_len, typelib_name_len, server_name_len,
|
||||
user_name_len, domain_name_len, password_len;
|
||||
OLECHAR *moniker;
|
||||
CLSID clsid;
|
||||
@@ -281,6 +281,58 @@ PHP_FUNCTION(com_create_instance)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto object com_get_active_object(string progid [, int code_page ])
|
||||
Returns a handle to an already running instance of a COM object */
|
||||
PHP_FUNCTION(com_get_active_object)
|
||||
{
|
||||
CLSID clsid;
|
||||
char *module_name;
|
||||
int module_name_len;
|
||||
long code_page = COMG(code_page);
|
||||
IUnknown *unk = NULL;
|
||||
IDispatch *obj = NULL;
|
||||
HRESULT res;
|
||||
OLECHAR *module = NULL;
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
|
||||
&module_name, &module_name_len, &code_page)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "Invalid arguments!" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
module = php_com_string_to_olestring(module_name, module_name_len, code_page TSRMLS_CC);
|
||||
|
||||
res = CLSIDFromString(module, &clsid);
|
||||
|
||||
if (FAILED(res)) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
} else {
|
||||
res = GetActiveObject(&clsid, NULL, &unk);
|
||||
|
||||
if (FAILED(res)) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
} else {
|
||||
res = IUnknown_QueryInterface(unk, &IID_IDispatch, &obj);
|
||||
|
||||
if (FAILED(res)) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
} else if (obj) {
|
||||
/* we got our dispatchable object */
|
||||
php_com_wrap_dispatch(return_value, obj, code_page TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (obj) {
|
||||
IDispatch_Release(obj);
|
||||
}
|
||||
if (unk) {
|
||||
IUnknown_Release(obj);
|
||||
}
|
||||
efree(module);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* Performs an Invoke on the given com object.
|
||||
* returns a failure code and creates an exception if there was an error */
|
||||
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
|
||||
@@ -333,6 +385,17 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
|
||||
spprintf(&msg, 0, "Parameter %d: %s", arg_err, desc);
|
||||
LocalFree(desc);
|
||||
break;
|
||||
|
||||
case DISP_E_BADPARAMCOUNT:
|
||||
if ((disp_params->cArgs + disp_params->cNamedArgs == 0) && (flags == DISPATCH_PROPERTYGET)) {
|
||||
/* if getting a property and they are missing all parameters,
|
||||
* we want to create a proxy object for them; so lets not create an
|
||||
* exception here */
|
||||
msg = NULL;
|
||||
break;
|
||||
}
|
||||
/* else fall through */
|
||||
|
||||
default:
|
||||
desc = php_win_err(hr);
|
||||
spprintf(&msg, 0, "Error %s", desc);
|
||||
@@ -557,6 +620,10 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
|
||||
efree(vargs);
|
||||
}
|
||||
|
||||
/* a bit strange this, but... */
|
||||
if (hr == DISP_E_BADPARAMCOUNT)
|
||||
return hr;
|
||||
|
||||
return SUCCEEDED(hr) ? SUCCESS : FAILURE;
|
||||
}
|
||||
|
||||
@@ -732,7 +799,7 @@ PHP_FUNCTION(com_message_pump)
|
||||
PHP_FUNCTION(com_load_typelib)
|
||||
{
|
||||
char *name;
|
||||
long namelen;
|
||||
int namelen;
|
||||
ITypeLib *pTL = NULL;
|
||||
zend_bool cs = TRUE;
|
||||
int codepage = COMG(code_page);
|
||||
|
||||
@@ -98,10 +98,11 @@ PHP_FUNCTION(com_dotnet_create_instance)
|
||||
zval *object = getThis();
|
||||
php_com_dotnet_object *obj;
|
||||
char *assembly_name, *datatype_name;
|
||||
long assembly_name_len, datatype_name_len;
|
||||
int assembly_name_len, datatype_name_len;
|
||||
struct dotnet_runtime_stuff *stuff;
|
||||
IObjectHandle *handle;
|
||||
DISPPARAMS params;
|
||||
OLECHAR *olestring;
|
||||
VARIANT vargs[2];
|
||||
VARIANT retval;
|
||||
HRESULT hr;
|
||||
@@ -138,10 +139,14 @@ PHP_FUNCTION(com_dotnet_create_instance)
|
||||
VariantInit(&retval);
|
||||
|
||||
V_VT(&vargs[0]) = VT_BSTR;
|
||||
V_BSTR(&vargs[0]) = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page TSRMLS_CC);
|
||||
olestring = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page TSRMLS_CC);
|
||||
V_BSTR(&vargs[0]) = SysAllocStringByteLen((char*)olestring, datatype_name_len * sizeof(OLECHAR));
|
||||
efree(olestring);
|
||||
|
||||
V_VT(&vargs[1]) = VT_BSTR;
|
||||
V_BSTR(&vargs[1]) = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page TSRMLS_CC);
|
||||
olestring = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page TSRMLS_CC);
|
||||
V_BSTR(&vargs[1]) = SysAllocStringByteLen((char*)olestring, assembly_name_len * sizeof(OLECHAR));
|
||||
efree(olestring);
|
||||
|
||||
hr = IDispatch_Invoke(stuff->dotnet_domain, stuff->create_instance, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
|
||||
DISPATCH_METHOD, ¶ms, &retval, NULL, NULL);
|
||||
|
||||
@@ -70,6 +70,7 @@ function_entry com_dotnet_functions[] = {
|
||||
PHP_FE(com_print_typeinfo, NULL)
|
||||
PHP_FE(com_message_pump, NULL)
|
||||
PHP_FE(com_load_typelib, NULL)
|
||||
PHP_FE(com_get_active_object, NULL)
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -187,12 +188,13 @@ PHP_MINIT_FUNCTION(com_dotnet)
|
||||
ZEND_INIT_MODULE_GLOBALS(com_dotnet, php_com_dotnet_init_globals, NULL);
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU);
|
||||
php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU);
|
||||
php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "com_exception", NULL);
|
||||
php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(), NULL TSRMLS_CC);
|
||||
php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
|
||||
php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED;
|
||||
// php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED;
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "com_safearray_proxy", NULL);
|
||||
php_com_saproxy_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
@@ -202,13 +204,11 @@ PHP_MINIT_FUNCTION(com_dotnet)
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "variant", NULL);
|
||||
ce.create_object = php_com_object_new;
|
||||
// ce.get_iterator = php_com_iter_get;
|
||||
php_com_variant_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
php_com_variant_class_entry->get_iterator = php_com_iter_get;
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "com", NULL);
|
||||
ce.create_object = php_com_object_new;
|
||||
// ce.get_iterator = php_com_iter_get;
|
||||
tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry, "variant" TSRMLS_CC);
|
||||
tmp->get_iterator = php_com_iter_get;
|
||||
|
||||
@@ -217,7 +217,6 @@ PHP_MINIT_FUNCTION(com_dotnet)
|
||||
#if HAVE_MSCOREE_H
|
||||
INIT_CLASS_ENTRY(ce, "dotnet", NULL);
|
||||
ce.create_object = php_com_object_new;
|
||||
// ce.get_iterator = php_com_iter_get;
|
||||
tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry, "variant" TSRMLS_CC);
|
||||
tmp->get_iterator = php_com_iter_get;
|
||||
#endif
|
||||
@@ -231,9 +230,11 @@ PHP_MINIT_FUNCTION(com_dotnet)
|
||||
COM_CONST(CLSCTX_SERVER);
|
||||
COM_CONST(CLSCTX_ALL);
|
||||
|
||||
#if 0
|
||||
COM_CONST(DISPATCH_METHOD);
|
||||
COM_CONST(DISPATCH_PROPERTYGET);
|
||||
COM_CONST(DISPATCH_PROPERTYPUT);
|
||||
#endif
|
||||
|
||||
COM_CONST(VT_NULL);
|
||||
COM_CONST(VT_EMPTY);
|
||||
@@ -272,6 +273,19 @@ PHP_MINIT_FUNCTION(com_dotnet)
|
||||
COM_CONST(VARCMP_GT);
|
||||
COM_CONST(VARCMP_NULL);
|
||||
|
||||
COM_CONST(NORM_IGNORECASE);
|
||||
COM_CONST(NORM_IGNORENONSPACE);
|
||||
COM_CONST(NORM_IGNORESYMBOLS);
|
||||
COM_CONST(NORM_IGNOREWIDTH);
|
||||
COM_CONST(NORM_IGNOREKANATYPE);
|
||||
#ifdef NORM_IGNOREKASHIDA
|
||||
COM_CONST(NORM_IGNOREKASHIDA);
|
||||
#endif
|
||||
COM_CONST(DISP_E_DIVBYZERO);
|
||||
COM_CONST(DISP_E_OVERFLOW);
|
||||
COM_CONST(DISP_E_BADINDEX);
|
||||
COM_CONST(MK_E_UNAVAILABLE);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
+107
-23
@@ -29,11 +29,12 @@
|
||||
#include "php_com_dotnet_internal.h"
|
||||
#include "Zend/zend_exceptions.h"
|
||||
|
||||
static zval *com_property_read(zval *object, zval *member, zend_bool silent TSRMLS_DC)
|
||||
static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC)
|
||||
{
|
||||
zval *return_value;
|
||||
php_com_dotnet_object *obj;
|
||||
VARIANT v;
|
||||
HRESULT res;
|
||||
|
||||
MAKE_STD_ZVAL(return_value);
|
||||
ZVAL_NULL(return_value);
|
||||
@@ -46,15 +47,18 @@ static zval *com_property_read(zval *object, zval *member, zend_bool silent TSRM
|
||||
VariantInit(&v);
|
||||
|
||||
convert_to_string_ex(&member);
|
||||
if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
|
||||
DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC)) {
|
||||
|
||||
res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
|
||||
DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC);
|
||||
|
||||
if (res == SUCCESS) {
|
||||
php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC);
|
||||
VariantClear(&v);
|
||||
} else if (res == DISP_E_BADPARAMCOUNT) {
|
||||
php_com_saproxy_create(object, return_value, member TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
if (!silent) {
|
||||
php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC);
|
||||
}
|
||||
php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
@@ -139,7 +143,7 @@ static zval *com_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
|
||||
VariantClear(&v);
|
||||
}
|
||||
} else {
|
||||
php_com_saproxy_create(object, return_value, Z_LVAL_P(offset) TSRMLS_CC);
|
||||
php_com_saproxy_create(object, return_value, offset TSRMLS_CC);
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -154,6 +158,7 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
|
||||
php_com_dotnet_object *obj;
|
||||
zval *args[2];
|
||||
VARIANT v;
|
||||
HRESULT res;
|
||||
|
||||
obj = CDNO_FETCH(object);
|
||||
|
||||
@@ -172,12 +177,47 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
|
||||
DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, args TSRMLS_CC)) {
|
||||
VariantClear(&v);
|
||||
}
|
||||
} else if (V_ISARRAY(&obj->v)) {
|
||||
LONG indices = 0;
|
||||
VARTYPE vt;
|
||||
|
||||
if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) {
|
||||
if (FAILED(SafeArrayGetVartype(V_ARRAY(&obj->v), &vt)) || vt == VT_EMPTY) {
|
||||
vt = V_VT(&obj->v) & ~VT_ARRAY;
|
||||
}
|
||||
|
||||
convert_to_long(offset);
|
||||
indices = Z_LVAL_P(offset);
|
||||
|
||||
VariantInit(&v);
|
||||
php_com_variant_from_zval(&v, value, obj->code_page TSRMLS_CC);
|
||||
|
||||
if (V_VT(&v) != vt) {
|
||||
VariantChangeType(&v, &v, 0, vt);
|
||||
}
|
||||
|
||||
if (vt == VT_VARIANT) {
|
||||
res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v);
|
||||
} else {
|
||||
res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v.lVal);
|
||||
}
|
||||
|
||||
VariantClear(&v);
|
||||
|
||||
if (FAILED(res)) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
} else {
|
||||
php_com_throw_exception(DISP_E_BADINDEX, "this variant has multiple dimensions; you can't set a new value without specifying *all* dimensions" TSRMLS_CC);
|
||||
}
|
||||
|
||||
} else {
|
||||
/* TODO: check for safearray */
|
||||
php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void com_object_set(zval **property, zval *value TSRMLS_DC)
|
||||
{
|
||||
/* Not yet implemented in the engine */
|
||||
@@ -188,6 +228,7 @@ static zval *com_object_get(zval *property TSRMLS_DC)
|
||||
/* Not yet implemented in the engine */
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int com_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
|
||||
{
|
||||
@@ -245,11 +286,19 @@ static void function_dtor(void *pDest)
|
||||
}
|
||||
}
|
||||
|
||||
static PHP_FUNCTION(com_method_handler)
|
||||
{
|
||||
Z_OBJ_HANDLER_P(getThis(), call_method)(
|
||||
((zend_internal_function*)EG(function_state_ptr)->function)->function_name,
|
||||
INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
}
|
||||
|
||||
static union _zend_function *com_method_get(zval *object, char *name, int len TSRMLS_DC)
|
||||
{
|
||||
zend_internal_function f, *fptr = NULL;
|
||||
php_com_dotnet_object *obj;
|
||||
union _zend_function *func;
|
||||
DISPID dummy;
|
||||
|
||||
obj = CDNO_FETCH(object);
|
||||
|
||||
@@ -257,6 +306,10 @@ static union _zend_function *com_method_get(zval *object, char *name, int len TS
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (FAILED(php_com_get_id_of_name(obj, name, len, &dummy TSRMLS_CC))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* check cache */
|
||||
if (obj->method_cache == NULL || FAILURE == zend_hash_find(obj->method_cache, name, len, (void**)&fptr)) {
|
||||
f.type = ZEND_OVERLOADED_FUNCTION;
|
||||
@@ -265,7 +318,10 @@ static union _zend_function *com_method_get(zval *object, char *name, int len TS
|
||||
f.scope = obj->ce;
|
||||
f.fn_flags = 0;
|
||||
f.function_name = estrndup(name, len);
|
||||
f.handler = PHP_FN(com_method_handler);
|
||||
|
||||
fptr = &f;
|
||||
|
||||
if (obj->typeinfo) {
|
||||
/* look for byref params */
|
||||
ITypeComp *comp;
|
||||
@@ -305,6 +361,9 @@ static union _zend_function *com_method_get(zval *object, char *name, int len TS
|
||||
case DESCKIND_TYPECOMP:
|
||||
ITypeComp_Release(bindptr.lptcomp);
|
||||
break;
|
||||
|
||||
case DESCKIND_NONE:
|
||||
break;
|
||||
}
|
||||
if (TI) {
|
||||
ITypeInfo_Release(TI);
|
||||
@@ -315,21 +374,27 @@ static union _zend_function *com_method_get(zval *object, char *name, int len TS
|
||||
}
|
||||
}
|
||||
|
||||
/* save this method in the cache */
|
||||
if (!obj->method_cache) {
|
||||
ALLOC_HASHTABLE(obj->method_cache);
|
||||
zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0);
|
||||
}
|
||||
if (fptr) {
|
||||
/* save this method in the cache */
|
||||
if (!obj->method_cache) {
|
||||
ALLOC_HASHTABLE(obj->method_cache);
|
||||
zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0);
|
||||
}
|
||||
|
||||
zend_hash_update(obj->method_cache, name, len, &f, sizeof(f), (void**)&fptr);
|
||||
zend_hash_update(obj->method_cache, name, len, &f, sizeof(f), (void**)&fptr);
|
||||
}
|
||||
}
|
||||
|
||||
/* duplicate this into a new chunk of emalloc'd memory,
|
||||
* since the engine will efree it */
|
||||
func = emalloc(sizeof(*fptr));
|
||||
memcpy(func, fptr, sizeof(*fptr));
|
||||
if (fptr) {
|
||||
/* duplicate this into a new chunk of emalloc'd memory,
|
||||
* since the engine will efree it */
|
||||
func = emalloc(sizeof(*fptr));
|
||||
memcpy(func, fptr, sizeof(*fptr));
|
||||
|
||||
return func;
|
||||
return func;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int com_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
|
||||
@@ -507,6 +572,25 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static int com_object_count(zval *object, long *count TSRMLS_DC)
|
||||
{
|
||||
php_com_dotnet_object *obj;
|
||||
LONG ubound = 0, lbound = 0;
|
||||
|
||||
obj = CDNO_FETCH(object);
|
||||
|
||||
if (!V_ISARRAY(&obj->v)) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
SafeArrayGetLBound(V_ARRAY(&obj->v), 1, &lbound);
|
||||
SafeArrayGetUBound(V_ARRAY(&obj->v), 1, &ubound);
|
||||
|
||||
*count = ubound - lbound + 1;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
zend_object_handlers php_com_object_handlers = {
|
||||
ZEND_OBJECTS_STORE_HANDLERS,
|
||||
com_property_read,
|
||||
@@ -514,8 +598,8 @@ zend_object_handlers php_com_object_handlers = {
|
||||
com_read_dimension,
|
||||
com_write_dimension,
|
||||
NULL,
|
||||
com_object_get,
|
||||
com_object_set,
|
||||
NULL, //com_object_get,
|
||||
NULL, //com_object_set,
|
||||
com_property_exists,
|
||||
com_property_delete,
|
||||
com_dimension_exists,
|
||||
@@ -527,7 +611,8 @@ zend_object_handlers php_com_object_handlers = {
|
||||
com_class_entry_get,
|
||||
com_class_name_get,
|
||||
com_objects_compare,
|
||||
com_object_cast
|
||||
com_object_cast,
|
||||
com_object_count
|
||||
};
|
||||
|
||||
void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC)
|
||||
@@ -616,7 +701,6 @@ zend_object_value php_com_object_new(zend_class_entry *ce TSRMLS_DC)
|
||||
obj->code_page = CP_ACP;
|
||||
obj->ce = ce;
|
||||
|
||||
|
||||
retval.handle = zend_objects_store_put(obj, NULL, php_com_object_free_storage, php_com_object_clone TSRMLS_CC);
|
||||
retval.handlers = &php_com_object_handlers;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
|
||||
}
|
||||
zend_throw_exception(php_com_exception_class_entry, message, (long)code TSRMLS_CC);
|
||||
if (free_msg) {
|
||||
efree(message);
|
||||
LocalFree(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 T
|
||||
|
||||
/* check bounds */
|
||||
if (dim1 < lbound || dim1 > ubound) {
|
||||
php_com_throw_exception(E_INVALIDARG, "index out of bounds" TSRMLS_CC);
|
||||
php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Executable
+789
@@ -0,0 +1,789 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2004 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.0 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_0.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Wez Furlong <wez@thebrainroom.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Infrastructure for working with persistent COM objects.
|
||||
* Implements: IStream* wrapper for PHP streams.
|
||||
* TODO: Magic __wakeup and __sleep handlers for serialization
|
||||
* (can wait till 5.1) */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
#include "php_ini.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "php_com_dotnet.h"
|
||||
#include "php_com_dotnet_internal.h"
|
||||
#include "Zend/zend_exceptions.h"
|
||||
|
||||
/* {{{ expose php_stream as a COM IStream */
|
||||
|
||||
typedef struct {
|
||||
CONST_VTBL struct IStreamVtbl *lpVtbl;
|
||||
THREAD_T engine_thread;
|
||||
LONG refcount;
|
||||
php_stream *stream;
|
||||
int id;
|
||||
} php_istream;
|
||||
|
||||
static int le_istream;
|
||||
static void istream_destructor(php_istream *stm);
|
||||
|
||||
static void istream_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
php_istream *stm = (php_istream *)rsrc->ptr;
|
||||
istream_destructor(stm);
|
||||
}
|
||||
|
||||
#define FETCH_STM() \
|
||||
php_istream *stm = (php_istream*)This; \
|
||||
if (tsrm_thread_id() != stm->engine_thread) \
|
||||
return E_UNEXPECTED;
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_queryinterface(
|
||||
IStream *This,
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void **ppvObject)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
FETCH_STM();
|
||||
|
||||
if (IsEqualGUID(&IID_IUnknown, riid) ||
|
||||
IsEqualGUID(&IID_IStream, riid)) {
|
||||
*ppvObject = This;
|
||||
InterlockedIncrement(&stm->refcount);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
*ppvObject = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE stm_addref(IStream *This)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
FETCH_STM();
|
||||
|
||||
return InterlockedIncrement(&stm->refcount);
|
||||
}
|
||||
|
||||
static ULONG STDMETHODCALLTYPE stm_release(IStream *This)
|
||||
{
|
||||
ULONG ret;
|
||||
TSRMLS_FETCH();
|
||||
FETCH_STM();
|
||||
|
||||
ret = InterlockedDecrement(&stm->refcount);
|
||||
if (ret == 0) {
|
||||
/* destroy it */
|
||||
if (stm->id)
|
||||
zend_list_delete(stm->id);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULONG *pcbRead)
|
||||
{
|
||||
int nread;
|
||||
TSRMLS_FETCH();
|
||||
FETCH_STM();
|
||||
|
||||
nread = php_stream_read(stm->stream, pv, cb);
|
||||
|
||||
if (pcbRead) {
|
||||
*pcbRead = nread > 0 ? nread : 0;
|
||||
}
|
||||
if (nread > 0) {
|
||||
return S_OK;
|
||||
}
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_write(IStream *This, void const *pv, ULONG cb, ULONG *pcbWritten)
|
||||
{
|
||||
int nwrote;
|
||||
TSRMLS_FETCH();
|
||||
FETCH_STM();
|
||||
|
||||
nwrote = php_stream_write(stm->stream, pv, cb);
|
||||
|
||||
if (pcbWritten) {
|
||||
*pcbWritten = nwrote > 0 ? nwrote : 0;
|
||||
}
|
||||
if (nwrote > 0) {
|
||||
return S_OK;
|
||||
}
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_seek(IStream *This, LARGE_INTEGER dlibMove,
|
||||
DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
|
||||
{
|
||||
off_t offset;
|
||||
int whence;
|
||||
int ret;
|
||||
TSRMLS_FETCH();
|
||||
FETCH_STM();
|
||||
|
||||
switch (dwOrigin) {
|
||||
case STREAM_SEEK_SET: whence = SEEK_SET; break;
|
||||
case STREAM_SEEK_CUR: whence = SEEK_CUR; break;
|
||||
case STREAM_SEEK_END: whence = SEEK_END; break;
|
||||
default:
|
||||
return STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
|
||||
if (dlibMove.HighPart) {
|
||||
/* we don't support 64-bit offsets */
|
||||
return STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
|
||||
offset = dlibMove.QuadPart;
|
||||
|
||||
ret = php_stream_seek(stm->stream, offset, whence);
|
||||
|
||||
if (plibNewPosition) {
|
||||
plibNewPosition->QuadPart = (ULONGLONG)(ret >= 0 ? ret : 0);
|
||||
}
|
||||
|
||||
return ret >= 0 ? S_OK : STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_set_size(IStream *This, ULARGE_INTEGER libNewSize)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
FETCH_STM();
|
||||
|
||||
if (libNewSize.HighPart) {
|
||||
return STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
|
||||
if (php_stream_truncate_supported(stm->stream)) {
|
||||
int ret = php_stream_truncate_set_size(stm->stream, (size_t)libNewSize.QuadPart);
|
||||
|
||||
if (ret == 0) {
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
return STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_copy_to(IStream *This, IStream *pstm, ULARGE_INTEGER cb,
|
||||
ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
FETCH_STM();
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_commit(IStream *This, DWORD grfCommitFlags)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
FETCH_STM();
|
||||
|
||||
php_stream_flush(stm->stream);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_revert(IStream *This)
|
||||
{
|
||||
/* NOP */
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_lock_region(IStream *This,
|
||||
ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD lockType)
|
||||
{
|
||||
return STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_unlock_region(IStream *This,
|
||||
ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD lockType)
|
||||
{
|
||||
return STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_stat(IStream *This,
|
||||
STATSTG *pstatstg, DWORD grfStatFlag)
|
||||
{
|
||||
return STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE stm_clone(IStream *This, IStream **ppstm)
|
||||
{
|
||||
return STG_E_INVALIDFUNCTION;
|
||||
}
|
||||
|
||||
static struct IStreamVtbl php_istream_vtbl = {
|
||||
stm_queryinterface,
|
||||
stm_addref,
|
||||
stm_release,
|
||||
stm_read,
|
||||
stm_write,
|
||||
stm_seek,
|
||||
stm_set_size,
|
||||
stm_copy_to,
|
||||
stm_commit,
|
||||
stm_revert,
|
||||
stm_lock_region,
|
||||
stm_unlock_region,
|
||||
stm_stat,
|
||||
stm_clone
|
||||
};
|
||||
|
||||
static void istream_destructor(php_istream *stm)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (stm->id) {
|
||||
int id = stm->id;
|
||||
stm->id = 0;
|
||||
zend_list_delete(id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (stm->refcount > 0) {
|
||||
CoDisconnectObject((IUnknown*)stm, 0);
|
||||
}
|
||||
|
||||
zend_list_delete(stm->stream->rsrc_id);
|
||||
|
||||
CoTaskMemFree(stm);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
|
||||
{
|
||||
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
|
||||
|
||||
if (stm == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(stm, 0, sizeof(*stm));
|
||||
stm->engine_thread = tsrm_thread_id();
|
||||
stm->lpVtbl = &php_istream_vtbl;
|
||||
stm->refcount = 1;
|
||||
stm->stream = stream;
|
||||
|
||||
zend_list_addref(stream->rsrc_id);
|
||||
stm->id = zend_list_insert(stm, le_istream);
|
||||
|
||||
return (IStream*)stm;
|
||||
}
|
||||
|
||||
#define CPH_ME(fname, arginfo) PHP_ME(com_persist, fname, arginfo, ZEND_ACC_PUBLIC)
|
||||
#define CPH_SME(fname, arginfo) PHP_ME(com_persist, fname, arginfo, ZEND_ACC_ALLOW_STATIC|ZEND_ACC_PUBLIC)
|
||||
#define CPH_METHOD(fname) static PHP_METHOD(com_persist, fname)
|
||||
|
||||
#define CPH_FETCH() php_com_persist_helper *helper = (php_com_persist_helper*)zend_object_store_get_object(getThis() TSRMLS_CC);
|
||||
|
||||
#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance" TSRMLS_CC); return; }
|
||||
|
||||
typedef struct {
|
||||
zend_object std;
|
||||
long codepage;
|
||||
IUnknown *unk;
|
||||
IPersistStream *ips;
|
||||
IPersistStreamInit *ipsi;
|
||||
IPersistFile *ipf;
|
||||
} php_com_persist_helper;
|
||||
|
||||
static zend_object_handlers helper_handlers;
|
||||
static zend_class_entry *helper_ce;
|
||||
|
||||
static inline HRESULT get_persist_stream(php_com_persist_helper *helper)
|
||||
{
|
||||
if (!helper->ips && helper->unk) {
|
||||
return IUnknown_QueryInterface(helper->unk, &IID_IPersistStream, &helper->ips);
|
||||
}
|
||||
return helper->ips ? S_OK : E_NOTIMPL;
|
||||
}
|
||||
|
||||
static inline HRESULT get_persist_stream_init(php_com_persist_helper *helper)
|
||||
{
|
||||
if (!helper->ipsi && helper->unk) {
|
||||
return IUnknown_QueryInterface(helper->unk, &IID_IPersistStreamInit, &helper->ipsi);
|
||||
}
|
||||
return helper->ipsi ? S_OK : E_NOTIMPL;
|
||||
}
|
||||
|
||||
static inline HRESULT get_persist_file(php_com_persist_helper *helper)
|
||||
{
|
||||
if (!helper->ipf && helper->unk) {
|
||||
return IUnknown_QueryInterface(helper->unk, &IID_IPersistFile, &helper->ipf);
|
||||
}
|
||||
return helper->ipf ? S_OK : E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto string COMPersistHelper::GetCurFile()
|
||||
Determines the filename into which an object will be saved, or false if none is set, via IPersistFile::GetCurFile */
|
||||
CPH_METHOD(GetCurFileName)
|
||||
{
|
||||
HRESULT res;
|
||||
OLECHAR *olename = NULL;
|
||||
CPH_FETCH();
|
||||
|
||||
CPH_NO_OBJ();
|
||||
|
||||
res = get_persist_file(helper);
|
||||
if (helper->ipf) {
|
||||
res = IPersistFile_GetCurFile(helper->ipf, &olename);
|
||||
|
||||
if (res == S_OK) {
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
Z_STRVAL_P(return_value) = php_com_olestring_to_string(olename,
|
||||
&Z_STRLEN_P(return_value), helper->codepage TSRMLS_CC);
|
||||
CoTaskMemFree(olename);
|
||||
return;
|
||||
} else if (res == S_FALSE) {
|
||||
CoTaskMemFree(olename);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
} else {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto bool COMPersistHelper::SaveToFile(string filename [, bool remember])
|
||||
Persist object data to file, via IPersistFile::Save */
|
||||
CPH_METHOD(SaveToFile)
|
||||
{
|
||||
HRESULT res;
|
||||
char *filename, *fullpath = NULL;
|
||||
int filename_len;
|
||||
zend_bool remember = TRUE;
|
||||
OLECHAR *olefilename = NULL;
|
||||
CPH_FETCH();
|
||||
|
||||
CPH_NO_OBJ();
|
||||
|
||||
res = get_persist_file(helper);
|
||||
if (helper->ipf) {
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!|b",
|
||||
&filename, &filename_len, &remember)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
if (filename) {
|
||||
fullpath = expand_filepath(filename, NULL TSRMLS_CC);
|
||||
|
||||
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (php_check_open_basedir(fullpath TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage TSRMLS_CC);
|
||||
efree(fullpath);
|
||||
}
|
||||
res = IPersistFile_Save(helper->ipf, olefilename, remember);
|
||||
if (SUCCEEDED(res)) {
|
||||
if (!olefilename) {
|
||||
res = IPersistFile_GetCurFile(helper->ipf, &olefilename);
|
||||
if (S_OK == res) {
|
||||
IPersistFile_SaveCompleted(helper->ipf, olefilename);
|
||||
CoTaskMemFree(olefilename);
|
||||
olefilename = NULL;
|
||||
}
|
||||
} else if (remember) {
|
||||
IPersistFile_SaveCompleted(helper->ipf, olefilename);
|
||||
}
|
||||
}
|
||||
|
||||
if (olefilename) {
|
||||
efree(olefilename);
|
||||
}
|
||||
|
||||
if (FAILED(res)) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
} else {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool COMPersistHelper::LoadFromFile(string filename [, int flags])
|
||||
Load object data from file, via IPersistFile::Load */
|
||||
CPH_METHOD(LoadFromFile)
|
||||
{
|
||||
HRESULT res;
|
||||
char *filename, *fullpath;
|
||||
int filename_len;
|
||||
long flags = 0;
|
||||
OLECHAR *olefilename;
|
||||
CPH_FETCH();
|
||||
|
||||
CPH_NO_OBJ();
|
||||
|
||||
res = get_persist_file(helper);
|
||||
if (helper->ipf) {
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
|
||||
&filename, &filename_len, &flags)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
fullpath = expand_filepath(filename, NULL TSRMLS_CC);
|
||||
|
||||
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (php_check_open_basedir(fullpath TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage TSRMLS_CC);
|
||||
efree(fullpath);
|
||||
|
||||
res = IPersistFile_Load(helper->ipf, olefilename, flags);
|
||||
efree(olefilename);
|
||||
|
||||
if (FAILED(res)) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
} else {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int COMPersistHelper::GetMaxStreamSize()
|
||||
Gets maximum stream size required to store the object data, via IPersistStream::GetSizeMax (or IPersistStreamInit::GetSizeMax) */
|
||||
CPH_METHOD(GetMaxStreamSize)
|
||||
{
|
||||
HRESULT res;
|
||||
ULARGE_INTEGER size;
|
||||
CPH_FETCH();
|
||||
|
||||
CPH_NO_OBJ();
|
||||
|
||||
res = get_persist_stream_init(helper);
|
||||
if (helper->ipsi) {
|
||||
res = IPersistStreamInit_GetSizeMax(helper->ipsi, &size);
|
||||
} else {
|
||||
res = get_persist_stream(helper);
|
||||
if (helper->ips) {
|
||||
res = IPersistStream_GetSizeMax(helper->ips, &size);
|
||||
} else {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (res != S_OK) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
} else {
|
||||
/* TODO: handle 64 bit properly */
|
||||
RETURN_LONG((LONG)size.QuadPart);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int COMPersistHelper::InitNew()
|
||||
Initializes the object to a default state, via IPersistStreamInit::InitNew */
|
||||
CPH_METHOD(InitNew)
|
||||
{
|
||||
HRESULT res;
|
||||
CPH_FETCH();
|
||||
|
||||
CPH_NO_OBJ();
|
||||
|
||||
res = get_persist_stream_init(helper);
|
||||
if (helper->ipsi) {
|
||||
res = IPersistStreamInit_InitNew(helper->ipsi);
|
||||
|
||||
if (res != S_OK) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
} else {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
} else {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto mixed COMPersistHelper::LoadFromStream(resource stream)
|
||||
Initializes an object from the stream where it was previously saved, via IPersistStream::Load or OleLoadFromStream */
|
||||
CPH_METHOD(LoadFromStream)
|
||||
{
|
||||
zval *zstm;
|
||||
php_stream *stream;
|
||||
IStream *stm = NULL;
|
||||
HRESULT res;
|
||||
CPH_FETCH();
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
php_stream_from_zval_no_verify(stream, &zstm);
|
||||
|
||||
if (stream == NULL) {
|
||||
php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
stm = php_com_wrapper_export_stream(stream TSRMLS_CC);
|
||||
if (stm == NULL) {
|
||||
php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
res = S_OK;
|
||||
RETVAL_TRUE;
|
||||
|
||||
if (helper->unk == NULL) {
|
||||
IDispatch *disp = NULL;
|
||||
|
||||
/* we need to create an object and load using OleLoadFromStream */
|
||||
res = OleLoadFromStream(stm, &IID_IDispatch, &disp);
|
||||
|
||||
if (SUCCEEDED(res)) {
|
||||
php_com_wrap_dispatch(return_value, disp, COMG(code_page) TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
res = get_persist_stream_init(helper);
|
||||
if (helper->ipsi) {
|
||||
res = IPersistStreamInit_Load(helper->ipsi, stm);
|
||||
} else {
|
||||
res = get_persist_stream(helper);
|
||||
if (helper->ips) {
|
||||
res = IPersistStreamInit_Load(helper->ipsi, stm);
|
||||
}
|
||||
}
|
||||
}
|
||||
IStream_Release(stm);
|
||||
|
||||
if (FAILED(res)) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
RETURN_NULL();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int COMPersistHelper::SaveToStream(resource stream)
|
||||
Saves the object to a stream, via IPersistStream::Save */
|
||||
CPH_METHOD(SaveToStream)
|
||||
{
|
||||
zval *zstm;
|
||||
php_stream *stream;
|
||||
IStream *stm = NULL;
|
||||
HRESULT res;
|
||||
CPH_FETCH();
|
||||
|
||||
CPH_NO_OBJ();
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
php_stream_from_zval_no_verify(stream, &zstm);
|
||||
|
||||
if (stream == NULL) {
|
||||
php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
stm = php_com_wrapper_export_stream(stream TSRMLS_CC);
|
||||
if (stm == NULL) {
|
||||
php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
res = get_persist_stream_init(helper);
|
||||
if (helper->ipsi) {
|
||||
res = IPersistStreamInit_Save(helper->ipsi, stm, TRUE);
|
||||
} else {
|
||||
res = get_persist_stream(helper);
|
||||
if (helper->ips) {
|
||||
res = IPersistStream_Save(helper->ips, stm, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
IStream_Release(stm);
|
||||
|
||||
if (FAILED(res)) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int COMPersistHelper::__construct([object com_object])
|
||||
Creates a persistence helper object, usually associated with a com_object */
|
||||
CPH_METHOD(__construct)
|
||||
{
|
||||
php_com_dotnet_object *obj = NULL;
|
||||
zval *zobj = NULL;
|
||||
CPH_FETCH();
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|O!",
|
||||
&zobj, php_com_variant_class_entry)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!zobj) {
|
||||
return;
|
||||
}
|
||||
|
||||
obj = CDNO_FETCH(zobj);
|
||||
|
||||
if (V_VT(&obj->v) != VT_DISPATCH || V_DISPATCH(&obj->v) == NULL) {
|
||||
php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object" TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
|
||||
/* it is always safe to cast an interface to IUnknown */
|
||||
helper->unk = (IUnknown*)V_DISPATCH(&obj->v);
|
||||
IUnknown_AddRef(helper->unk);
|
||||
helper->codepage = obj->code_page;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
|
||||
|
||||
static zend_function_entry com_persist_helper_methods[] = {
|
||||
CPH_ME(__construct, NULL)
|
||||
CPH_ME(GetCurFileName, NULL)
|
||||
CPH_ME(SaveToFile, NULL)
|
||||
CPH_ME(LoadFromFile, NULL)
|
||||
CPH_ME(GetMaxStreamSize, NULL)
|
||||
CPH_ME(InitNew, NULL)
|
||||
CPH_ME(LoadFromStream, NULL)
|
||||
CPH_ME(SaveToStream, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
static void helper_free_storage(void *obj TSRMLS_DC)
|
||||
{
|
||||
php_com_persist_helper *object = (php_com_persist_helper*)obj;
|
||||
|
||||
if (object->ipf) {
|
||||
IPersistFile_Release(object->ipf);
|
||||
}
|
||||
if (object->ips) {
|
||||
IPersistStream_Release(object->ips);
|
||||
}
|
||||
if (object->ipsi) {
|
||||
IPersistStreamInit_Release(object->ipsi);
|
||||
}
|
||||
if (object->unk) {
|
||||
IUnknown_Release(object->unk);
|
||||
}
|
||||
zend_hash_destroy(object->std.properties);
|
||||
FREE_HASHTABLE(object->std.properties);
|
||||
efree(object);
|
||||
}
|
||||
|
||||
|
||||
static void helper_clone(void *obj, void **clone_ptr TSRMLS_DC)
|
||||
{
|
||||
php_com_persist_helper *clone, *object = (php_com_persist_helper*)obj;
|
||||
zval *tmp;
|
||||
|
||||
clone = emalloc(sizeof(*object));
|
||||
memcpy(clone, object, sizeof(*object));
|
||||
*clone_ptr = clone;
|
||||
|
||||
ALLOC_HASHTABLE(clone->std.properties);
|
||||
zend_hash_init(clone->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
|
||||
if (clone->ipf) {
|
||||
IPersistFile_AddRef(clone->ipf);
|
||||
}
|
||||
if (clone->ips) {
|
||||
IPersistStream_AddRef(clone->ips);
|
||||
}
|
||||
if (clone->ipsi) {
|
||||
IPersistStreamInit_AddRef(clone->ipsi);
|
||||
}
|
||||
if (clone->unk) {
|
||||
IUnknown_AddRef(clone->unk);
|
||||
}
|
||||
}
|
||||
|
||||
static zend_object_value helper_new(zend_class_entry *ce TSRMLS_DC)
|
||||
{
|
||||
php_com_persist_helper *helper;
|
||||
zend_object_value retval;
|
||||
zval *tmp;
|
||||
|
||||
helper = emalloc(sizeof(*helper));
|
||||
memset(helper, 0, sizeof(*helper));
|
||||
|
||||
ALLOC_HASHTABLE(helper->std.properties);
|
||||
zend_hash_init(helper->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
helper->std.ce = helper_ce;
|
||||
|
||||
retval.handle = zend_objects_store_put(helper, NULL, helper_free_storage, helper_clone TSRMLS_CC);
|
||||
retval.handlers = &helper_handlers;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int php_com_persist_minit(INIT_FUNC_ARGS)
|
||||
{
|
||||
zend_class_entry ce;
|
||||
|
||||
memcpy(&helper_handlers, zend_get_std_object_handlers(), sizeof(helper_handlers));
|
||||
helper_handlers.clone_obj = NULL;
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "COMPersistHelper", com_persist_helper_methods);
|
||||
ce.create_object = helper_new;
|
||||
helper_ce = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
helper_ce->ce_flags |= ZEND_ACC_FINAL;
|
||||
|
||||
le_istream = zend_register_list_destructors_ex(istream_dtor,
|
||||
NULL, "com_dotnet_istream_wrapper", module_number);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: noet sw=4 ts=4 fdm=marker
|
||||
* vim<600: noet sw=4 ts=4
|
||||
*/
|
||||
+185
-31
@@ -20,7 +20,9 @@
|
||||
|
||||
/* This module implements a SafeArray proxy which is used internally
|
||||
* by the engine when resolving multi-dimensional array accesses on
|
||||
* SafeArray types
|
||||
* SafeArray types.
|
||||
* In addition, the proxy is now able to handle properties of COM objects
|
||||
* that smell like PHP arrays.
|
||||
* */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -43,7 +45,7 @@ typedef struct {
|
||||
LONG dimensions;
|
||||
|
||||
/* this is an array whose size_is(dimensions) */
|
||||
LONG *indices;
|
||||
zval **indices;
|
||||
|
||||
} php_com_saproxy;
|
||||
|
||||
@@ -58,16 +60,25 @@ typedef struct {
|
||||
|
||||
#define SA_FETCH(zv) (php_com_saproxy*)zend_object_store_get_object(zv TSRMLS_CC)
|
||||
|
||||
static zval *saproxy_property_read(zval *object, zval *member, zend_bool silent TSRMLS_DC)
|
||||
static inline void clone_indices(php_com_saproxy *dest, php_com_saproxy *src, int ndims)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ndims; i++) {
|
||||
MAKE_STD_ZVAL(dest->indices[i]);
|
||||
*dest->indices[i] = *src->indices[i];
|
||||
zval_copy_ctor(dest->indices[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static zval *saproxy_property_read(zval *object, zval *member, int type TSRMLS_DC)
|
||||
{
|
||||
zval *return_value;
|
||||
|
||||
MAKE_STD_ZVAL(return_value);
|
||||
ZVAL_NULL(return_value);
|
||||
|
||||
if (!silent) {
|
||||
php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC);
|
||||
}
|
||||
php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
@@ -84,15 +95,50 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
|
||||
UINT dims;
|
||||
SAFEARRAY *sa;
|
||||
LONG ubound, lbound;
|
||||
int i;
|
||||
HRESULT res;
|
||||
|
||||
MAKE_STD_ZVAL(return_value);
|
||||
ZVAL_NULL(return_value);
|
||||
|
||||
if (!V_ISARRAY(&proxy->obj->v)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "proxied object is no longer a safe array!" TSRMLS_CC);
|
||||
if (V_VT(&proxy->obj->v) == VT_DISPATCH) {
|
||||
VARIANT v;
|
||||
zval **args;
|
||||
|
||||
/* prop-get using first dimension as the property name,
|
||||
* all subsequent dimensions and the offset as parameters */
|
||||
|
||||
args = safe_emalloc(proxy->dimensions + 1, sizeof(zval *), 0);
|
||||
|
||||
for (i = 1; i < proxy->dimensions; i++) {
|
||||
args[i-1] = proxy->indices[i];
|
||||
}
|
||||
args[i-1] = offset;
|
||||
|
||||
convert_to_string(proxy->indices[0]);
|
||||
VariantInit(&v);
|
||||
|
||||
res = php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]),
|
||||
Z_STRLEN_P(proxy->indices[0]), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v,
|
||||
proxy->dimensions, args TSRMLS_CC);
|
||||
|
||||
if (res == SUCCESS) {
|
||||
php_com_zval_from_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC);
|
||||
VariantClear(&v);
|
||||
} else if (res == DISP_E_BADPARAMCOUNT) {
|
||||
/* return another proxy */
|
||||
php_com_saproxy_create(object, return_value, offset TSRMLS_CC);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
|
||||
} else if (!V_ISARRAY(&proxy->obj->v)) {
|
||||
php_com_throw_exception(E_INVALIDARG, "invalid read from com proxy object" TSRMLS_CC);
|
||||
return return_value;
|
||||
}
|
||||
|
||||
/* the SafeArray case */
|
||||
|
||||
/* offset/index must be an integer */
|
||||
convert_to_long(offset);
|
||||
|
||||
@@ -110,7 +156,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
|
||||
SafeArrayGetUBound(sa, proxy->dimensions, &ubound);
|
||||
|
||||
if (Z_LVAL_P(offset) < lbound || Z_LVAL_P(offset) > ubound) {
|
||||
php_com_throw_exception(E_INVALIDARG, "index out of bounds" TSRMLS_CC);
|
||||
php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC);
|
||||
return return_value;
|
||||
}
|
||||
|
||||
@@ -122,10 +168,13 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
|
||||
VariantInit(&v);
|
||||
|
||||
/* we can return a real value */
|
||||
indices = do_alloca(dims * sizeof(LONG));
|
||||
indices = emalloc(dims * sizeof(LONG));
|
||||
|
||||
/* copy indices from proxy */
|
||||
memcpy(indices, proxy->indices, (dims-1) * sizeof(LONG));
|
||||
for (i = 0; i < dims; i++) {
|
||||
convert_to_long(proxy->indices[i]);
|
||||
indices[i] = Z_LVAL_P(proxy->indices[i]);
|
||||
}
|
||||
|
||||
/* add user-supplied index */
|
||||
indices[dims-1] = Z_LVAL_P(offset);
|
||||
@@ -136,21 +185,25 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
|
||||
}
|
||||
|
||||
if (vt == VT_VARIANT) {
|
||||
SafeArrayGetElement(sa, indices, &v);
|
||||
res = SafeArrayGetElement(sa, indices, &v);
|
||||
} else {
|
||||
V_VT(&v) = vt;
|
||||
SafeArrayGetElement(sa, indices, &v.lVal);
|
||||
res = SafeArrayGetElement(sa, indices, &v.lVal);
|
||||
}
|
||||
|
||||
free_alloca(indices);
|
||||
efree(indices);
|
||||
|
||||
php_com_wrap_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC);
|
||||
if (SUCCEEDED(res)) {
|
||||
php_com_wrap_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC);
|
||||
} else {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
VariantClear(&v);
|
||||
|
||||
} else {
|
||||
/* return another proxy */
|
||||
php_com_saproxy_create(object, return_value, Z_LVAL_P(offset) TSRMLS_CC);
|
||||
php_com_saproxy_create(object, return_value, offset TSRMLS_CC);
|
||||
}
|
||||
|
||||
return return_value;
|
||||
@@ -158,9 +211,79 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
|
||||
|
||||
static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
|
||||
{
|
||||
php_com_throw_exception(E_NOTIMPL, "writing to safearray not yet implemented" TSRMLS_CC);
|
||||
php_com_saproxy *proxy = SA_FETCH(object);
|
||||
UINT dims;
|
||||
int i;
|
||||
HRESULT res;
|
||||
VARIANT v;
|
||||
|
||||
if (V_VT(&proxy->obj->v) == VT_DISPATCH) {
|
||||
/* We do a prop-set using the first dimension as the property name,
|
||||
* all subsequent dimensions and offset as parameters, with value as
|
||||
* the final value */
|
||||
zval **args = safe_emalloc(proxy->dimensions + 2, sizeof(zval *), 0);
|
||||
|
||||
for (i = 1; i < proxy->dimensions; i++) {
|
||||
args[i-1] = proxy->indices[i];
|
||||
}
|
||||
args[i-1] = offset;
|
||||
args[i] = value;
|
||||
|
||||
convert_to_string(proxy->indices[0]);
|
||||
VariantInit(&v);
|
||||
if (SUCCESS == php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]),
|
||||
Z_STRLEN_P(proxy->indices[0]), DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1,
|
||||
args TSRMLS_CC)) {
|
||||
VariantClear(&v);
|
||||
}
|
||||
|
||||
efree(args);
|
||||
|
||||
} else if (V_ISARRAY(&proxy->obj->v)) {
|
||||
LONG *indices;
|
||||
VARTYPE vt;
|
||||
|
||||
dims = SafeArrayGetDim(V_ARRAY(&proxy->obj->v));
|
||||
indices = emalloc(dims * sizeof(LONG));
|
||||
/* copy indices from proxy */
|
||||
for (i = 0; i < dims; i++) {
|
||||
convert_to_long(proxy->indices[i]);
|
||||
indices[i] = Z_LVAL_P(proxy->indices[i]);
|
||||
}
|
||||
|
||||
/* add user-supplied index */
|
||||
convert_to_long(offset);
|
||||
indices[dims-1] = Z_LVAL_P(offset);
|
||||
|
||||
if (FAILED(SafeArrayGetVartype(V_ARRAY(&proxy->obj->v), &vt)) || vt == VT_EMPTY) {
|
||||
vt = V_VT(&proxy->obj->v) & ~VT_ARRAY;
|
||||
}
|
||||
|
||||
VariantInit(&v);
|
||||
php_com_variant_from_zval(&v, value, proxy->obj->code_page TSRMLS_CC);
|
||||
|
||||
if (V_VT(&v) != vt) {
|
||||
VariantChangeType(&v, &v, 0, vt);
|
||||
}
|
||||
|
||||
if (vt == VT_VARIANT) {
|
||||
res = SafeArrayPutElement(V_ARRAY(&proxy->obj->v), indices, &v);
|
||||
} else {
|
||||
res = SafeArrayPutElement(V_ARRAY(&proxy->obj->v), indices, &v.lVal);
|
||||
}
|
||||
|
||||
efree(indices);
|
||||
VariantClear(&v);
|
||||
|
||||
if (FAILED(res)) {
|
||||
php_com_throw_exception(res, NULL TSRMLS_CC);
|
||||
}
|
||||
} else {
|
||||
php_com_throw_exception(E_NOTIMPL, "invalid write to com proxy object" TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void saproxy_object_set(zval **property, zval *value TSRMLS_DC)
|
||||
{
|
||||
}
|
||||
@@ -170,6 +293,7 @@ static zval *saproxy_object_get(zval *property TSRMLS_DC)
|
||||
/* Not yet implemented in the engine */
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int saproxy_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
|
||||
{
|
||||
@@ -212,7 +336,7 @@ static int saproxy_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
|
||||
|
||||
static union _zend_function *saproxy_constructor_get(zval *object TSRMLS_DC)
|
||||
{
|
||||
/* user cannot instanciate */
|
||||
/* user cannot instantiate */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -238,6 +362,23 @@ static int saproxy_object_cast(zval *readobj, zval *writeobj, int type, int shou
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
static int saproxy_count_elements(zval *object, long *count TSRMLS_DC)
|
||||
{
|
||||
php_com_saproxy *proxy = SA_FETCH(object);
|
||||
LONG ubound, lbound;
|
||||
|
||||
if (!V_ISARRAY(&proxy->obj->v)) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &lbound);
|
||||
SafeArrayGetUBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &ubound);
|
||||
|
||||
*count = ubound - lbound + 1;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
zend_object_handlers php_com_saproxy_handlers = {
|
||||
ZEND_OBJECTS_STORE_HANDLERS,
|
||||
saproxy_property_read,
|
||||
@@ -245,8 +386,8 @@ zend_object_handlers php_com_saproxy_handlers = {
|
||||
saproxy_read_dimension,
|
||||
saproxy_write_dimension,
|
||||
NULL,
|
||||
saproxy_object_get,
|
||||
saproxy_object_set,
|
||||
NULL, //saproxy_object_get,
|
||||
NULL, //saproxy_object_set,
|
||||
saproxy_property_exists,
|
||||
saproxy_property_delete,
|
||||
saproxy_dimension_exists,
|
||||
@@ -258,12 +399,20 @@ zend_object_handlers php_com_saproxy_handlers = {
|
||||
saproxy_class_entry_get,
|
||||
saproxy_class_name_get,
|
||||
saproxy_objects_compare,
|
||||
saproxy_object_cast
|
||||
saproxy_object_cast,
|
||||
saproxy_count_elements
|
||||
};
|
||||
|
||||
static void saproxy_free_storage(void *object TSRMLS_DC)
|
||||
{
|
||||
php_com_saproxy *proxy = (php_com_saproxy *)object;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < proxy->dimensions; i++) {
|
||||
if (proxy->indices) {
|
||||
FREE_ZVAL(proxy->indices[i]);
|
||||
}
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&proxy->zobj);
|
||||
efree(proxy->indices);
|
||||
@@ -279,38 +428,39 @@ static void saproxy_clone(void *object, void **clone_ptr TSRMLS_DC)
|
||||
memcpy(cloneproxy, proxy, sizeof(*cloneproxy));
|
||||
|
||||
ZVAL_ADDREF(cloneproxy->zobj);
|
||||
cloneproxy->indices = safe_emalloc(cloneproxy->dimensions, sizeof(LONG), 0);
|
||||
memcpy(cloneproxy->indices, proxy->indices, cloneproxy->dimensions * sizeof(LONG));
|
||||
cloneproxy->indices = safe_emalloc(cloneproxy->dimensions, sizeof(zval *), 0);
|
||||
clone_indices(cloneproxy, proxy, proxy->dimensions);
|
||||
|
||||
*clone_ptr = cloneproxy;
|
||||
}
|
||||
|
||||
int php_com_saproxy_create(zval *com_object, zval *proxy_out, long index TSRMLS_DC)
|
||||
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC)
|
||||
{
|
||||
php_com_saproxy *proxy, *rel = NULL;
|
||||
php_com_dotnet_object *obj;
|
||||
|
||||
proxy = ecalloc(1, sizeof(*proxy));
|
||||
proxy->dimensions = 1;
|
||||
|
||||
if (Z_OBJCE_P(com_object) == php_com_saproxy_class_entry) {
|
||||
rel = SA_FETCH(com_object);
|
||||
obj = rel->obj;
|
||||
proxy->obj = rel->obj;
|
||||
proxy->zobj = rel->zobj;
|
||||
proxy->dimensions += rel->dimensions;
|
||||
} else {
|
||||
obj = CDNO_FETCH(com_object);
|
||||
proxy->obj = CDNO_FETCH(com_object);
|
||||
proxy->zobj = com_object;
|
||||
}
|
||||
|
||||
ZVAL_ADDREF(proxy->zobj);
|
||||
proxy->indices = safe_emalloc(proxy->dimensions, sizeof(LONG), 0);
|
||||
proxy->indices = safe_emalloc(proxy->dimensions, sizeof(zval *), 0);
|
||||
|
||||
if (rel) {
|
||||
memcpy(proxy->indices, rel->indices, (proxy->dimensions-1) * sizeof(LONG));
|
||||
clone_indices(proxy, rel, rel->dimensions);
|
||||
}
|
||||
|
||||
proxy->indices[proxy->dimensions-1] = index;
|
||||
MAKE_STD_ZVAL(proxy->indices[proxy->dimensions-1]);
|
||||
*proxy->indices[proxy->dimensions-1] = *index;
|
||||
zval_copy_ctor(proxy->indices[proxy->dimensions-1]);
|
||||
|
||||
Z_TYPE_P(proxy_out) = IS_OBJECT;
|
||||
Z_OBJ_HANDLE_P(proxy_out) = zend_objects_store_put(proxy, NULL, saproxy_free_storage, saproxy_clone TSRMLS_CC);
|
||||
@@ -408,6 +558,7 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
|
||||
{
|
||||
php_com_saproxy *proxy = SA_FETCH(object);
|
||||
php_com_saproxy_iter *I;
|
||||
int i;
|
||||
|
||||
I = ecalloc(1, sizeof(*I));
|
||||
I->iter.funcs = &saproxy_iter_funcs;
|
||||
@@ -418,7 +569,10 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
|
||||
ZVAL_ADDREF(I->proxy_obj);
|
||||
|
||||
I->indices = safe_emalloc(proxy->dimensions + 1, sizeof(LONG), 0);
|
||||
memcpy(I->indices, proxy->indices, proxy->dimensions * sizeof(LONG));
|
||||
for (i = 0; i < proxy->dimensions; i++) {
|
||||
convert_to_long(proxy->indices[i]);
|
||||
I->indices[i] = Z_LVAL_P(proxy->indices[i]);
|
||||
}
|
||||
|
||||
SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imin);
|
||||
SafeArrayGetUBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imax);
|
||||
|
||||
@@ -489,7 +489,7 @@ int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int pri
|
||||
unsigned int funcdesclen, cnames = 0;
|
||||
BSTR *names;
|
||||
|
||||
names = (BSTR*)emalloc((func->cParams + 1) * sizeof(BSTR));
|
||||
names = (BSTR*)safe_emalloc((func->cParams + 1), sizeof(BSTR), 0);
|
||||
|
||||
ITypeInfo_GetNames(typeinfo, func->memid, names, func->cParams + 1, &cnames);
|
||||
/* first element is the function name */
|
||||
|
||||
@@ -28,6 +28,76 @@
|
||||
#include "php_com_dotnet.h"
|
||||
#include "php_com_dotnet_internal.h"
|
||||
|
||||
/* create an automation SafeArray from a PHP array.
|
||||
* Only creates a single-dimensional array of variants.
|
||||
* The keys of the PHP hash MUST be numeric. If the array
|
||||
* is sparse, then the gaps will be filled with NULL variants */
|
||||
static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
|
||||
{
|
||||
SAFEARRAY *sa = NULL;
|
||||
SAFEARRAYBOUND bound;
|
||||
HashPosition pos;
|
||||
int keytype;
|
||||
char *strindex;
|
||||
int strindexlen;
|
||||
long intindex;
|
||||
long max_index = 0;
|
||||
VARIANT *va;
|
||||
zval **item;
|
||||
|
||||
/* find the largest array index, and assert that all keys are integers */
|
||||
zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos);
|
||||
for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) {
|
||||
|
||||
keytype = zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &strindexlen, &intindex, 0, &pos);
|
||||
|
||||
if (HASH_KEY_IS_STRING == keytype) {
|
||||
goto bogus;
|
||||
} else if (HASH_KEY_NON_EXISTANT == keytype) {
|
||||
break;
|
||||
}
|
||||
if (intindex > max_index) {
|
||||
max_index = intindex;
|
||||
}
|
||||
}
|
||||
|
||||
/* allocate the structure */
|
||||
bound.lLbound = 0;
|
||||
bound.cElements = intindex + 1;
|
||||
sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
|
||||
|
||||
/* get a lock on the array itself */
|
||||
SafeArrayAccessData(sa, &va);
|
||||
va = (VARIANT*)sa->pvData;
|
||||
|
||||
/* now fill it in */
|
||||
zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos);
|
||||
for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) {
|
||||
if (FAILURE == zend_hash_get_current_data_ex(HASH_OF(z), (void**)&item, &pos)) {
|
||||
break;
|
||||
}
|
||||
zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &strindexlen, &intindex, 0, &pos);
|
||||
php_com_variant_from_zval(&va[intindex], *item, codepage TSRMLS_CC);
|
||||
}
|
||||
|
||||
/* Unlock it and stuff it into our variant */
|
||||
SafeArrayUnaccessData(sa);
|
||||
V_VT(v) = VT_ARRAY|VT_VARIANT;
|
||||
V_ARRAY(v) = sa;
|
||||
|
||||
return;
|
||||
|
||||
bogus:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: converting from PHP array to VARIANT array; only arrays with numeric keys are allowed");
|
||||
|
||||
V_VT(v) = VT_NULL;
|
||||
|
||||
if (sa) {
|
||||
SafeArrayUnlock(sa);
|
||||
SafeArrayDestroy(sa);
|
||||
}
|
||||
}
|
||||
|
||||
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
|
||||
{
|
||||
OLECHAR *olestring;
|
||||
@@ -66,8 +136,8 @@ PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_D
|
||||
break;
|
||||
|
||||
case IS_ARRAY:
|
||||
V_VT(v) = VT_NULL;
|
||||
/* TODO: map as safe array ? */
|
||||
/* map as safe array */
|
||||
safe_array_from_zval(v, z, codepage TSRMLS_CC);
|
||||
break;
|
||||
|
||||
case IS_LONG:
|
||||
@@ -190,7 +260,7 @@ PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC
|
||||
/* {{{ com_variant_create_instance - ctor for new VARIANT() */
|
||||
PHP_FUNCTION(com_variant_create_instance)
|
||||
{
|
||||
VARTYPE vt = VT_EMPTY;
|
||||
/* VARTYPE == unsigned short */ long vt = VT_EMPTY;
|
||||
long codepage = CP_ACP;
|
||||
zval *object = getThis();
|
||||
php_com_dotnet_object *obj;
|
||||
@@ -214,11 +284,13 @@ PHP_FUNCTION(com_variant_create_instance)
|
||||
obj->code_page = codepage;
|
||||
}
|
||||
|
||||
php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC);
|
||||
if (zvalue) {
|
||||
php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (ZEND_NUM_ARGS() >= 2) {
|
||||
|
||||
res = VariantChangeType(&obj->v, &obj->v, 0, vt);
|
||||
res = VariantChangeType(&obj->v, &obj->v, 0, (VARTYPE)vt);
|
||||
|
||||
if (FAILED(res)) {
|
||||
char *werr, *msg;
|
||||
@@ -240,7 +312,7 @@ PHP_FUNCTION(com_variant_create_instance)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void variant_set(object variant, mixed value)
|
||||
Assigns a new value for a variant object (like "set" in VB) */
|
||||
Assigns a new value for a variant object */
|
||||
PHP_FUNCTION(variant_set)
|
||||
{
|
||||
zval *zobj, *zvalue = NULL;
|
||||
@@ -371,6 +443,8 @@ static void variant_binary_operation(enum variant_binary_opcode op, INTERNAL_FUN
|
||||
|
||||
if (SUCCEEDED(result)) {
|
||||
php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
|
||||
} else {
|
||||
php_com_throw_exception(result, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
VariantClear(&vres);
|
||||
@@ -396,7 +470,7 @@ PHP_FUNCTION(variant_cat)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto mixed variant_sub(mixed left, mixed right)
|
||||
subjects the value of the right variant from the left variant value and returns the result */
|
||||
subtracts the value of the right variant from the left variant value and returns the result */
|
||||
PHP_FUNCTION(variant_sub)
|
||||
{
|
||||
variant_binary_operation(VOP_SUB, INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
@@ -436,7 +510,7 @@ PHP_FUNCTION(variant_eqv)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto mixed variant_idiv(mixed left, mixed right)
|
||||
Converts variants to operands and then returns the result from dividing them */
|
||||
Converts variants to integers and then returns the result from dividing them */
|
||||
PHP_FUNCTION(variant_idiv)
|
||||
{
|
||||
variant_binary_operation(VOP_IDIV, INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
@@ -528,6 +602,8 @@ static void variant_unary_operation(enum variant_unary_opcode op, INTERNAL_FUNCT
|
||||
|
||||
if (SUCCEEDED(result)) {
|
||||
php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
|
||||
} else {
|
||||
php_com_throw_exception(result, NULL TSRMLS_CC);
|
||||
}
|
||||
|
||||
VariantClear(&vres);
|
||||
@@ -544,7 +620,7 @@ PHP_FUNCTION(variant_abs)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto mixed variant_fix(mixed left)
|
||||
Returns the ? of a variant */
|
||||
Returns the integer part ? of a variant */
|
||||
PHP_FUNCTION(variant_fix)
|
||||
{
|
||||
variant_unary_operation(VOP_FIX, INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
@@ -712,7 +788,7 @@ PHP_FUNCTION(variant_date_to_timestamp)
|
||||
Returns a variant date representation of a unix timestamp */
|
||||
PHP_FUNCTION(variant_date_from_timestamp)
|
||||
{
|
||||
int timestamp;
|
||||
long timestamp;
|
||||
SYSTEMTIME systime;
|
||||
struct tm *tmv;
|
||||
VARIANT res;
|
||||
@@ -723,7 +799,8 @@ PHP_FUNCTION(variant_date_from_timestamp)
|
||||
}
|
||||
|
||||
VariantInit(&res);
|
||||
tmv = gmtime(×tamp);
|
||||
tzset();
|
||||
tmv = localtime(×tamp);
|
||||
memset(&systime, 0, sizeof(systime));
|
||||
|
||||
systime.wDay = tmv->tm_mday;
|
||||
@@ -754,7 +831,7 @@ PHP_FUNCTION(variant_get_type)
|
||||
return;
|
||||
}
|
||||
obj = CDNO_FETCH(zobj);
|
||||
|
||||
|
||||
RETURN_LONG(V_VT(&obj->v));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -765,7 +842,7 @@ PHP_FUNCTION(variant_set_type)
|
||||
{
|
||||
zval *zobj;
|
||||
php_com_dotnet_object *obj;
|
||||
VARTYPE vt;
|
||||
/* VARTYPE == unsigned short */ long vt;
|
||||
HRESULT res;
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
|
||||
@@ -774,7 +851,7 @@ PHP_FUNCTION(variant_set_type)
|
||||
}
|
||||
obj = CDNO_FETCH(zobj);
|
||||
|
||||
res = VariantChangeType(&obj->v, &obj->v, 0, vt);
|
||||
res = VariantChangeType(&obj->v, &obj->v, 0, (VARTYPE)vt);
|
||||
|
||||
if (SUCCEEDED(res)) {
|
||||
if (vt != VT_DISPATCH && obj->typeinfo) {
|
||||
@@ -800,7 +877,7 @@ PHP_FUNCTION(variant_cast)
|
||||
{
|
||||
zval *zobj;
|
||||
php_com_dotnet_object *obj;
|
||||
VARTYPE vt;
|
||||
/* VARTYPE == unsigned short */ long vt;
|
||||
VARIANT vres;
|
||||
HRESULT res;
|
||||
|
||||
@@ -811,7 +888,7 @@ PHP_FUNCTION(variant_cast)
|
||||
obj = CDNO_FETCH(zobj);
|
||||
|
||||
VariantInit(&vres);
|
||||
res = VariantChangeType(&vres, &obj->v, 0, vt);
|
||||
res = VariantChangeType(&vres, &obj->v, 0, (VARTYPE)vt);
|
||||
|
||||
if (SUCCEEDED(res)) {
|
||||
php_com_wrap_variant(return_value, &vres, obj->code_page TSRMLS_CC);
|
||||
@@ -830,19 +907,3 @@ PHP_FUNCTION(variant_cast)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto mixed variant_index_get(object variant, mixed index1 [, mixed index2 [, ...]])
|
||||
Get the value of a multi dimensional array property */
|
||||
PHP_FUNCTION(variant_index_get)
|
||||
{
|
||||
zval *zobj;
|
||||
php_com_dotnet_object *obj;
|
||||
|
||||
if (FAILURE == zend_parse_parameters(1 TSRMLS_CC,
|
||||
"O", &zobj, php_com_variant_class_entry)) {
|
||||
return;
|
||||
}
|
||||
obj = CDNO_FETCH(zobj);
|
||||
|
||||
/* TODO: finish... */
|
||||
}
|
||||
/* }}} */
|
||||
@@ -272,7 +272,7 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
|
||||
|
||||
/* convert args into zvals.
|
||||
* Args are in reverse order */
|
||||
params = (zval ***)emalloc(sizeof(zval **) * pdp->cArgs);
|
||||
params = (zval ***)safe_emalloc(sizeof(zval **), pdp->cArgs, 0);
|
||||
for (i = 0; i < pdp->cArgs; i++) {
|
||||
VARIANT *arg;
|
||||
zval *zarg;
|
||||
@@ -296,12 +296,16 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
|
||||
} else if (wFlags & DISPATCH_PROPERTYPUT) {
|
||||
zend_update_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, *params[0] TSRMLS_CC);
|
||||
} else if (wFlags & DISPATCH_METHOD) {
|
||||
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name,
|
||||
&retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) {
|
||||
ret = S_OK;
|
||||
} else {
|
||||
zend_try {
|
||||
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name,
|
||||
&retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) {
|
||||
ret = S_OK;
|
||||
} else {
|
||||
ret = DISP_E_EXCEPTION;
|
||||
}
|
||||
} zend_catch {
|
||||
ret = DISP_E_EXCEPTION;
|
||||
}
|
||||
} zend_end_try();
|
||||
} else {
|
||||
trace("Don't know how to handle this invocation %08x\n", wFlags);
|
||||
}
|
||||
@@ -314,14 +318,8 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
|
||||
/* return value */
|
||||
if (retval) {
|
||||
if (pvarRes) {
|
||||
if (Z_TYPE_P(retval) == IS_OBJECT) {
|
||||
/* export the object using a dispatch like ourselves */
|
||||
VariantInit(pvarRes);
|
||||
V_VT(pvarRes) = VT_DISPATCH;
|
||||
V_DISPATCH(pvarRes) = php_com_wrapper_export(retval TSRMLS_CC);
|
||||
} else {
|
||||
php_com_variant_from_zval(pvarRes, retval, COMG(code_page) TSRMLS_CC);
|
||||
}
|
||||
VariantInit(pvarRes);
|
||||
php_com_variant_from_zval(pvarRes, retval, COMG(code_page) TSRMLS_CC);
|
||||
}
|
||||
zval_ptr_dtor(&retval);
|
||||
} else if (pvarRes) {
|
||||
@@ -344,6 +342,8 @@ static HRESULT STDMETHODCALLTYPE disp_deletememberbyname(
|
||||
|
||||
FETCH_DISP("DeleteMemberByName");
|
||||
|
||||
/* TODO: unset */
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
@@ -355,6 +355,8 @@ static HRESULT STDMETHODCALLTYPE disp_deletememberbydispid(
|
||||
|
||||
FETCH_DISP("DeleteMemberByDispID");
|
||||
|
||||
/* TODO: unset */
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ if (PHP_COM_DOTNET == "yes") {
|
||||
CHECK_LIB('oleaut32.lib', 'com_dotnet');
|
||||
EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \
|
||||
com_handlers.c com_iterator.c com_misc.c com_olechar.c \
|
||||
com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c");
|
||||
com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c");
|
||||
AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support');
|
||||
CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET');
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE package SYSTEM "../pear/package.dtd">
|
||||
<package>
|
||||
<name>com_dotnet</name>
|
||||
<summary>Com and .NET support functions for Windows</summary>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>wez</user>
|
||||
<name>Wez Furlong</name>
|
||||
<email>wez@php.net</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<description>
|
||||
...
|
||||
</description>
|
||||
<license>PHP</license>
|
||||
<release>
|
||||
<state>beta</state>
|
||||
<version>5.0.0rc1</version>
|
||||
<date>2004-03-19</date>
|
||||
<notes>
|
||||
package.xml added to support intallation using pear installer
|
||||
</notes>
|
||||
<filelist>
|
||||
<file role="doc" name="CREDITS"/>
|
||||
<file role="doc" name="README"/>
|
||||
<file role="src" name="config.w32"/>
|
||||
<file role="src" name="com_com.c"/>
|
||||
<file role="src" name="com_dotnet.c"/>
|
||||
<file role="src" name="com_extension.c"/>
|
||||
<file role="src" name="com_handlers.c"/>
|
||||
<file role="src" name="com_misc.c"/>
|
||||
<file role="src" name="com_olechar.c"/>
|
||||
<file role="src" name="com_typeinfo.c"/>
|
||||
<file role="src" name="com_variant.c"/>
|
||||
<file role="src" name="com_iterator.c"/>
|
||||
<file role="src" name="com_saproxy.c"/>
|
||||
<file role="src" name="com_wrapper.c"/>
|
||||
<file role="src" name="php_com_dotnet.h"/>
|
||||
<file role="src" name="php_com_dotnet_internal.h"/>
|
||||
<file role="test" name="tests/variants.phpt"/>
|
||||
</filelist>
|
||||
<deps>
|
||||
<dep type="php" rel="ge" version="5" />
|
||||
<!-- doesn't work yet <dep type="os" rel="has" name="windows"/> -->
|
||||
</deps>
|
||||
</release>
|
||||
</package>
|
||||
<!--
|
||||
vim:et:ts=1:sw=1
|
||||
-->
|
||||
@@ -36,7 +36,7 @@ typedef struct _php_com_dotnet_object {
|
||||
VARIANT v;
|
||||
|
||||
ITypeInfo *typeinfo;
|
||||
int code_page;
|
||||
long code_page;
|
||||
unsigned int have_default_bind:1;
|
||||
|
||||
zend_class_entry *ce;
|
||||
@@ -83,7 +83,7 @@ void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSR
|
||||
|
||||
/* com_saproxy.c */
|
||||
zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC);
|
||||
int php_com_saproxy_create(zval *com_object, zval *proxy_out, long index TSRMLS_DC);
|
||||
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
|
||||
|
||||
/* com_olechar.c */
|
||||
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring,
|
||||
@@ -99,6 +99,7 @@ PHP_FUNCTION(com_create_guid);
|
||||
PHP_FUNCTION(com_print_typeinfo);
|
||||
PHP_FUNCTION(com_message_pump);
|
||||
PHP_FUNCTION(com_load_typelib);
|
||||
PHP_FUNCTION(com_get_active_object);
|
||||
|
||||
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
|
||||
WORD flags, DISPPARAMS *disp_params, VARIANT *v TSRMLS_DC);
|
||||
@@ -116,6 +117,9 @@ int php_com_wrapper_minit(INIT_FUNC_ARGS);
|
||||
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
|
||||
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
|
||||
|
||||
/* com_persist.c */
|
||||
int php_com_persist_minit(INIT_FUNC_ARGS);
|
||||
|
||||
/* com_variant.c */
|
||||
PHP_FUNCTION(com_variant_create_instance);
|
||||
PHP_FUNCTION(variant_set);
|
||||
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
--TEST--
|
||||
COM: mapping a safearray
|
||||
--SKIPIF--
|
||||
<?php # vim:ft=php
|
||||
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
|
||||
--FILE--
|
||||
<?php // $Id$
|
||||
error_reporting(E_ALL);
|
||||
|
||||
try {
|
||||
$v = new VARIANT(array("123", "456", "789"));
|
||||
var_dump($v);
|
||||
print $v[0] . "\n";
|
||||
print $v[1] . "\n";
|
||||
print $v[2] . "\n";
|
||||
$v[1] = "hello";
|
||||
foreach ($v as $item) {
|
||||
var_dump($item);
|
||||
}
|
||||
try {
|
||||
$v[3] = "shouldn't work";
|
||||
} catch (com_exception $e) {
|
||||
if ($e->getCode() != DISP_E_BADINDEX) {
|
||||
throw $e;
|
||||
}
|
||||
echo "Got BADINDEX exception OK!\n";
|
||||
}
|
||||
echo "OK!";
|
||||
} catch (Exception $e) {
|
||||
print $e;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
object(variant)#1 (0) {
|
||||
}
|
||||
123
|
||||
456
|
||||
789
|
||||
string(3) "123"
|
||||
string(5) "hello"
|
||||
string(3) "789"
|
||||
Got BADINDEX exception OK!
|
||||
OK!
|
||||
@@ -19,14 +19,22 @@ $binary_ops = array('add', 'cat', 'sub', 'mul', 'and', 'div',
|
||||
foreach ($values as $t => $val) {
|
||||
$v = new VARIANT($val);
|
||||
if ($t != variant_get_type($v)) {
|
||||
printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), (string)$v);
|
||||
printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val);
|
||||
print $v . "\n";
|
||||
}
|
||||
$results = array();
|
||||
|
||||
foreach ($values as $op2) {
|
||||
echo "--\n";
|
||||
foreach ($binary_ops as $op) {
|
||||
echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n";
|
||||
try {
|
||||
echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n";
|
||||
} catch (com_exception $e) {
|
||||
echo "$op:\n";
|
||||
echo "\tvariant_$op($v, $op2)\n";
|
||||
echo "\texception " . $e->getMessage();
|
||||
printf("\tcode %08x\n\n", $e->getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,30 +71,90 @@ or: 46
|
||||
pow: 480145.116863642
|
||||
xor: 46
|
||||
--
|
||||
add:
|
||||
add:
|
||||
variant_add(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
cat: 42hello
|
||||
sub:
|
||||
mul:
|
||||
and:
|
||||
div:
|
||||
eqv:
|
||||
idiv:
|
||||
imp:
|
||||
mod:
|
||||
or:
|
||||
pow:
|
||||
xor:
|
||||
sub:
|
||||
variant_sub(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mul:
|
||||
variant_mul(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
and:
|
||||
variant_and(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
div:
|
||||
variant_div(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
eqv:
|
||||
variant_eqv(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
idiv:
|
||||
variant_idiv(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
imp:
|
||||
variant_imp(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mod:
|
||||
variant_mod(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
or:
|
||||
variant_or(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
pow:
|
||||
variant_pow(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
xor:
|
||||
variant_xor(42, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
--
|
||||
add: 42
|
||||
cat: 42False
|
||||
sub: 42
|
||||
mul: 0
|
||||
and: 0
|
||||
div:
|
||||
div:
|
||||
variant_div(42, )
|
||||
exception Division by zero.
|
||||
code 80020012
|
||||
|
||||
eqv: -43
|
||||
idiv:
|
||||
idiv:
|
||||
variant_idiv(42, )
|
||||
exception Division by zero.
|
||||
code 80020012
|
||||
|
||||
imp: -43
|
||||
mod:
|
||||
mod:
|
||||
variant_mod(42, )
|
||||
exception Division by zero.
|
||||
code 80020012
|
||||
|
||||
or: 42
|
||||
pow: 1
|
||||
xor: 42
|
||||
@@ -119,89 +187,337 @@ or: 4
|
||||
pow: 80.2117802289664
|
||||
xor: 0
|
||||
--
|
||||
add:
|
||||
add:
|
||||
variant_add(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
cat: 3.5hello
|
||||
sub:
|
||||
mul:
|
||||
and:
|
||||
div:
|
||||
eqv:
|
||||
idiv:
|
||||
imp:
|
||||
mod:
|
||||
or:
|
||||
pow:
|
||||
xor:
|
||||
sub:
|
||||
variant_sub(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mul:
|
||||
variant_mul(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
and:
|
||||
variant_and(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
div:
|
||||
variant_div(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
eqv:
|
||||
variant_eqv(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
idiv:
|
||||
variant_idiv(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
imp:
|
||||
variant_imp(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mod:
|
||||
variant_mod(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
or:
|
||||
variant_or(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
pow:
|
||||
variant_pow(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
xor:
|
||||
variant_xor(3.5, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
--
|
||||
add: 3.5
|
||||
cat: 3.5False
|
||||
sub: 3.5
|
||||
mul: 0
|
||||
and: 0
|
||||
div:
|
||||
div:
|
||||
variant_div(3.5, )
|
||||
exception Division by zero.
|
||||
code 80020012
|
||||
|
||||
eqv: -5
|
||||
idiv:
|
||||
idiv:
|
||||
variant_idiv(3.5, )
|
||||
exception Division by zero.
|
||||
code 80020012
|
||||
|
||||
imp: -5
|
||||
mod:
|
||||
mod:
|
||||
variant_mod(3.5, )
|
||||
exception Division by zero.
|
||||
code 80020012
|
||||
|
||||
or: 4
|
||||
pow: 1
|
||||
xor: 4
|
||||
--
|
||||
add:
|
||||
add:
|
||||
variant_add(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
cat: hello42
|
||||
sub:
|
||||
mul:
|
||||
and:
|
||||
div:
|
||||
eqv:
|
||||
idiv:
|
||||
imp:
|
||||
mod:
|
||||
or:
|
||||
pow:
|
||||
xor:
|
||||
sub:
|
||||
variant_sub(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mul:
|
||||
variant_mul(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
and:
|
||||
variant_and(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
div:
|
||||
variant_div(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
eqv:
|
||||
variant_eqv(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
idiv:
|
||||
variant_idiv(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
imp:
|
||||
variant_imp(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mod:
|
||||
variant_mod(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
or:
|
||||
variant_or(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
pow:
|
||||
variant_pow(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
xor:
|
||||
variant_xor(hello, 42)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
--
|
||||
add:
|
||||
add:
|
||||
variant_add(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
cat: hello3.5
|
||||
sub:
|
||||
mul:
|
||||
and:
|
||||
div:
|
||||
eqv:
|
||||
idiv:
|
||||
imp:
|
||||
mod:
|
||||
or:
|
||||
pow:
|
||||
xor:
|
||||
sub:
|
||||
variant_sub(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mul:
|
||||
variant_mul(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
and:
|
||||
variant_and(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
div:
|
||||
variant_div(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
eqv:
|
||||
variant_eqv(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
idiv:
|
||||
variant_idiv(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
imp:
|
||||
variant_imp(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mod:
|
||||
variant_mod(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
or:
|
||||
variant_or(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
pow:
|
||||
variant_pow(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
xor:
|
||||
variant_xor(hello, 3.5)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
--
|
||||
add: hellohello
|
||||
cat: hellohello
|
||||
sub:
|
||||
mul:
|
||||
and:
|
||||
div:
|
||||
eqv:
|
||||
idiv:
|
||||
imp:
|
||||
mod:
|
||||
or:
|
||||
pow:
|
||||
xor:
|
||||
sub:
|
||||
variant_sub(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mul:
|
||||
variant_mul(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
and:
|
||||
variant_and(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
div:
|
||||
variant_div(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
eqv:
|
||||
variant_eqv(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
idiv:
|
||||
variant_idiv(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
imp:
|
||||
variant_imp(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mod:
|
||||
variant_mod(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
or:
|
||||
variant_or(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
pow:
|
||||
variant_pow(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
xor:
|
||||
variant_xor(hello, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
--
|
||||
add:
|
||||
add:
|
||||
variant_add(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
cat: helloFalse
|
||||
sub:
|
||||
mul:
|
||||
and:
|
||||
div:
|
||||
eqv:
|
||||
idiv:
|
||||
imp:
|
||||
mod:
|
||||
or:
|
||||
pow:
|
||||
xor:
|
||||
sub:
|
||||
variant_sub(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mul:
|
||||
variant_mul(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
and:
|
||||
variant_and(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
div:
|
||||
variant_div(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
eqv:
|
||||
variant_eqv(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
idiv:
|
||||
variant_idiv(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
imp:
|
||||
variant_imp(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mod:
|
||||
variant_mod(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
or:
|
||||
variant_or(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
pow:
|
||||
variant_pow(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
xor:
|
||||
variant_xor(hello, )
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
--
|
||||
add: 42
|
||||
cat: False42
|
||||
@@ -231,30 +547,90 @@ or: 4
|
||||
pow: 0
|
||||
xor: 4
|
||||
--
|
||||
add:
|
||||
add:
|
||||
variant_add(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
cat: Falsehello
|
||||
sub:
|
||||
mul:
|
||||
and:
|
||||
div:
|
||||
eqv:
|
||||
idiv:
|
||||
imp:
|
||||
mod:
|
||||
or:
|
||||
pow:
|
||||
xor:
|
||||
sub:
|
||||
variant_sub(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mul:
|
||||
variant_mul(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
and:
|
||||
variant_and(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
div:
|
||||
variant_div(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
eqv:
|
||||
variant_eqv(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
idiv:
|
||||
variant_idiv(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
imp:
|
||||
variant_imp(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
mod:
|
||||
variant_mod(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
or:
|
||||
variant_or(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
pow:
|
||||
variant_pow(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
xor:
|
||||
variant_xor(0, hello)
|
||||
exception Type mismatch.
|
||||
code 80020005
|
||||
|
||||
--
|
||||
add: 0
|
||||
cat: FalseFalse
|
||||
sub: 0
|
||||
mul: 0
|
||||
and: 0
|
||||
div:
|
||||
div:
|
||||
variant_div(0, )
|
||||
exception Out of present range.
|
||||
code 8002000a
|
||||
|
||||
eqv: -1
|
||||
idiv:
|
||||
idiv:
|
||||
variant_idiv(0, )
|
||||
exception Division by zero.
|
||||
code 80020012
|
||||
|
||||
imp: -1
|
||||
mod:
|
||||
mod:
|
||||
variant_mod(0, )
|
||||
exception Division by zero.
|
||||
code 80020012
|
||||
|
||||
or: 0
|
||||
pow: 1
|
||||
xor: 0
|
||||
|
||||
+21
-7
@@ -726,7 +726,7 @@ PHP_FUNCTION(cpdf_set_font)
|
||||
int id, type;
|
||||
CPDFdoc *pdf;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
|
||||
if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
@@ -2056,16 +2056,30 @@ PHP_FUNCTION(cpdf_place_inline_image)
|
||||
}
|
||||
|
||||
count = 3 * im->sx * im->sy;
|
||||
if(NULL == (buffer = (unsigned char *) emalloc(count)))
|
||||
RETURN_FALSE;
|
||||
buffer = (unsigned char *) safe_emalloc(3 * im->sx, im->sy, 0);
|
||||
|
||||
ptr = buffer;
|
||||
for(i=0; i<im->sy; i++) {
|
||||
for(j=0; j<im->sx; j++) {
|
||||
color = im->pixels[i][j];
|
||||
*ptr++ = im->red[color];
|
||||
*ptr++ = im->green[color];
|
||||
*ptr++ = im->blue[color];
|
||||
#if HAVE_LIBGD20
|
||||
if(gdImageTrueColor(im)) {
|
||||
if (im->tpixels && gdImageBoundsSafe(im, j, i)) {
|
||||
color = gdImageTrueColorPixel(im, j, i);
|
||||
*ptr++ = (color >> 16) & 0xFF;
|
||||
*ptr++ = (color >> 8) & 0xFF;
|
||||
*ptr++ = color & 0xFF;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
if (im->pixels && gdImageBoundsSafe(im, j, i)) {
|
||||
color = im->pixels[i][j];
|
||||
*ptr++ = im->red[color];
|
||||
*ptr++ = im->green[color];
|
||||
*ptr++ = im->blue[color];
|
||||
}
|
||||
#if HAVE_LIBGD20
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE package SYSTEM "../pear/package.dtd">
|
||||
<package>
|
||||
<name>cpdf</name>
|
||||
<summary>Clib PDF functions</summary>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>steinm</user>
|
||||
<name>Uwe Steinmann</name>
|
||||
<email>steinm@php.net</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<description>
|
||||
ClibPDF lets you create PDF documents with PHP.
|
||||
ClibPDF functionality and API are similar to PDFlib.
|
||||
</description>
|
||||
<license>PHP</license>
|
||||
<release>
|
||||
<state>beta</state>
|
||||
<version>5.0rc1</version>
|
||||
<date>2004-03-19</date>
|
||||
<notes>
|
||||
package.xml added to support intallation using pear installer
|
||||
</notes>
|
||||
<configureoptions>
|
||||
<configureoption name="with-cpdf" default="autodetect" prompt="path to cpdf installation?"/>
|
||||
</configureoptions>
|
||||
<filelist>
|
||||
<file role="doc" name="CREDITS"/>
|
||||
<file role="src" name="config.m4"/>
|
||||
<file role="src" name="config.mw32"/>
|
||||
<file role="src" name="cpdf.dsp"/>
|
||||
<file role="src" name="cpdf.c"/>
|
||||
<file role="src" name="php_cpdf.h"/>
|
||||
</filelist>
|
||||
<deps>
|
||||
<dep type="php" rel="ge" version="5" />
|
||||
</deps>
|
||||
</release>
|
||||
</package>
|
||||
<!--
|
||||
vim:et:ts=1:sw=1
|
||||
-->
|
||||
+7
-1
@@ -97,7 +97,13 @@ PHP_MINFO_FUNCTION(ctype)
|
||||
return; \
|
||||
switch (Z_TYPE_P(c)) { \
|
||||
case IS_LONG: \
|
||||
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
|
||||
if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
|
||||
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
|
||||
} else if (Z_LVAL_P(c) >= -128) { \
|
||||
RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
|
||||
} \
|
||||
SEPARATE_ZVAL(&c); \
|
||||
convert_to_string(c); \
|
||||
case IS_STRING: \
|
||||
{ \
|
||||
char *p; \
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE package SYSTEM "../pear/package.dtd">
|
||||
<package>
|
||||
<name>ctype</name>
|
||||
<summary>Character type detection</summary>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>hholzgra</user>
|
||||
<name>Hartmut Holzgraefe</name>
|
||||
<email>hartmut@php.net</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<description>
|
||||
The functions provided by this extension check whether a
|
||||
character or string falls into a certain character class
|
||||
according to the current locale.
|
||||
</description>
|
||||
<license>PHP</license>
|
||||
<release>
|
||||
<state>beta</state>
|
||||
<version>5.0.0rc1</version>
|
||||
<date>2004-03-19</date>
|
||||
<notes>
|
||||
package.xml added to support intallation using pear installer
|
||||
</notes>
|
||||
<filelist>
|
||||
<file role="doc" name="CREDITS"/>
|
||||
<file role="doc" name="README"/>
|
||||
<file role="src" name="config.m4"/>
|
||||
<file role="src" name="config.w32"/>
|
||||
<file role="src" name="ctype.dsp"/>
|
||||
<file role="src" name="ctype.c"/>
|
||||
<file role="src" name="php_ctype.h"/>
|
||||
<file role="test" name="tests/001.phpt"/>
|
||||
<file role="test" name="tests/002.phpt"/>
|
||||
<file role="test" name="tests/bug25745.phpt"/>
|
||||
</filelist>
|
||||
<deps>
|
||||
<dep type="php" rel="ge" version="5" />
|
||||
</deps>
|
||||
</release>
|
||||
</package>
|
||||
<!--
|
||||
vim:et:ts=1:sw=1
|
||||
-->
|
||||
@@ -2,8 +2,6 @@
|
||||
ctype on integers
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("ctype")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
setlocale(LC_ALL,"C");
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
ctype on strings
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("ctype")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
+34
-2
@@ -39,6 +39,11 @@
|
||||
#include <curl/curl.h>
|
||||
#include <curl/easy.h>
|
||||
|
||||
/* As of curl 7.11.1 this is no longer defined inside curl.h */
|
||||
#ifndef HttpPost
|
||||
#define HttpPost curl_httppost
|
||||
#endif
|
||||
|
||||
#define SMART_STR_PREALLOC 4096
|
||||
|
||||
#include "ext/standard/php_smart_str.h"
|
||||
@@ -146,7 +151,9 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_PUT);
|
||||
#if CURLOPT_MUTE != 0
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_MUTE);
|
||||
#endif
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_USERPWD);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERPWD);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_RANGE);
|
||||
@@ -316,6 +323,25 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX);
|
||||
REGISTER_CURL_CONSTANT(CURLE_OBSOLETE);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE);
|
||||
REGISTER_CURL_CONSTANT(CURLE_GOT_NOTHING);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_NOTFOUND);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_SETFAILED);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SEND_ERROR);
|
||||
REGISTER_CURL_CONSTANT(CURLE_RECV_ERROR);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SHARE_IN_USE);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_CERTPROBLEM);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_CIPHER);
|
||||
REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT);
|
||||
REGISTER_CURL_CONSTANT(CURLE_BAD_CONTENT_ENCODING);
|
||||
#ifdef CURLE_LDAP_INVALID_URL
|
||||
REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL);
|
||||
#endif
|
||||
#ifdef CURLE_FILESIZE_EXCEEDED
|
||||
REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED);
|
||||
#endif
|
||||
#ifdef CURLE_FTP_SSL_FAILED
|
||||
REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED);
|
||||
#endif
|
||||
|
||||
REGISTER_CURL_CONSTANT(CURLPROXY_HTTP);
|
||||
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5);
|
||||
@@ -597,6 +623,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if CURLOPT_PASSWDFUNCTION != 0
|
||||
/* {{{ curl_passwd
|
||||
*/
|
||||
static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
|
||||
@@ -639,6 +666,7 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
/* {{{ curl_free_string
|
||||
*/
|
||||
@@ -850,7 +878,9 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_NETRC:
|
||||
case CURLOPT_FOLLOWLOCATION:
|
||||
case CURLOPT_PUT:
|
||||
case CURLOPT_MUTE:
|
||||
#if CURLOPT_MUTE != 0
|
||||
case CURLOPT_MUTE:
|
||||
#endif
|
||||
case CURLOPT_TIMEOUT:
|
||||
case CURLOPT_FTP_USE_EPSV:
|
||||
case CURLOPT_LOW_SPEED_LIMIT:
|
||||
@@ -1005,6 +1035,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
ch->handlers->write_header->func_name = *zvalue;
|
||||
ch->handlers->write_header->method = PHP_CURL_USER;
|
||||
break;
|
||||
#if CURLOPT_PASSWDFUNCTION != 0
|
||||
case CURLOPT_PASSWDFUNCTION:
|
||||
if (ch->handlers->passwd) {
|
||||
zval_ptr_dtor(&ch->handlers->passwd);
|
||||
@@ -1014,6 +1045,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDFUNCTION, curl_passwd);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) ch);
|
||||
break;
|
||||
#endif
|
||||
case CURLOPT_POSTFIELDS:
|
||||
if (Z_TYPE_PP(zvalue) == IS_ARRAY || Z_TYPE_PP(zvalue) == IS_OBJECT) {
|
||||
zval **current;
|
||||
@@ -1052,7 +1084,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, string_key,
|
||||
CURLFORM_NAMELENGTH, string_key_len - 1,
|
||||
(ZVAL_REFCOUNT(*zvalue) > 1 ? CURLFORM_PTRCONTENTS : CURLFORM_COPYCONTENTS), postval,
|
||||
CURLFORM_COPYCONTENTS, postval,
|
||||
CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current),
|
||||
CURLFORM_END);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE package SYSTEM "../pear/package.dtd">
|
||||
<package>
|
||||
<name>curl</name>
|
||||
<summary>Clib PDF functions</summary>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>sterling</user>
|
||||
<name>Sterling Hughes</name>
|
||||
<email>sterling@php.net</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<description>
|
||||
PHP supports libcurl, a library created by Daniel Stenberg,
|
||||
that allows you to connect and communicate to many different
|
||||
types of servers with many different types of protocols.
|
||||
libcurl currently supports the http, https, ftp, gopher,
|
||||
telnet, dict, file, and ldap protocols. libcurl also supports
|
||||
HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this
|
||||
can also be done with PHP's ftp extension), HTTP form based
|
||||
upload, proxies, cookies, and user+password authentication.
|
||||
</description>
|
||||
<license>PHP</license>
|
||||
<release>
|
||||
<state>beta</state>
|
||||
<version>5.0rc1</version>
|
||||
<date>2004-03-19</date>
|
||||
<notes>
|
||||
package.xml added to support intallation using pear installer
|
||||
</notes>
|
||||
<configureoptions>
|
||||
<configureoption name="with-curl" default="autodetect" prompt="path to curl installation?"/>
|
||||
</configureoptions>
|
||||
<filelist>
|
||||
<file role="doc" name="CREDITS"/>
|
||||
<file role="src" name="config.m4"/>
|
||||
<file role="src" name="config.mw32"/>
|
||||
<file role="src" name="curl.dsp"/>
|
||||
<file role="src" name="interface.c"/>
|
||||
<file role="src" name="multi.c"/>
|
||||
<file role="src" name="streams.c"/>
|
||||
<file role="src" name="php_curl.h"/>
|
||||
</filelist>
|
||||
<deps>
|
||||
<dep type="php" rel="ge" version="5" />
|
||||
</deps>
|
||||
</release>
|
||||
</package>
|
||||
<!--
|
||||
vim:et:ts=1:sw=1
|
||||
-->
|
||||
@@ -53,6 +53,10 @@ DBA_OPEN_FUNC(db2)
|
||||
struct stat check_stat;
|
||||
int s = VCWD_STAT(info->path, &check_stat);
|
||||
|
||||
if (!s && !check_stat.st_size) {
|
||||
info->mode = DBA_TRUNC; /* force truncate */
|
||||
}
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
info->mode == DBA_TRUNC ? DB_BTREE :
|
||||
s ? DB_BTREE : DB_UNKNOWN;
|
||||
|
||||
+6
-2
@@ -62,9 +62,13 @@ DBA_OPEN_FUNC(db3)
|
||||
struct stat check_stat;
|
||||
int s = VCWD_STAT(info->path, &check_stat);
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
if (!s && !check_stat.st_size) {
|
||||
info->mode = DBA_TRUNC; /* force truncate */
|
||||
}
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
info->mode == DBA_TRUNC ? DB_BTREE :
|
||||
s? DB_BTREE : DB_UNKNOWN;
|
||||
s ? DB_BTREE : DB_UNKNOWN;
|
||||
|
||||
gmode = info->mode == DBA_READER ? DB_RDONLY :
|
||||
(info->mode == DBA_CREAT && s) ? DB_CREATE :
|
||||
|
||||
+6
-2
@@ -63,9 +63,13 @@ DBA_OPEN_FUNC(db4)
|
||||
struct stat check_stat;
|
||||
int s = VCWD_STAT(info->path, &check_stat);
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
if (!s && !check_stat.st_size) {
|
||||
info->mode = DBA_TRUNC; /* force truncate */
|
||||
}
|
||||
|
||||
type = info->mode == DBA_READER ? DB_UNKNOWN :
|
||||
info->mode == DBA_TRUNC ? DB_BTREE :
|
||||
s? DB_BTREE : DB_UNKNOWN;
|
||||
s ? DB_BTREE : DB_UNKNOWN;
|
||||
|
||||
gmode = info->mode == DBA_READER ? DB_RDONLY :
|
||||
(info->mode == DBA_CREAT && s) ? DB_CREATE :
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE package SYSTEM "../pear/package.dtd">
|
||||
<package>
|
||||
<name>dbase</name>
|
||||
<summary>dBase database file access functions</summary>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>jimw</user>
|
||||
<name>Jim Winstead</name>
|
||||
<email>jimw@php.net</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<description>
|
||||
These functions allow you to access records stored
|
||||
in dBase-format (dbf) databases.
|
||||
|
||||
There is no support for indexes or memo fields.
|
||||
There is no support for locking, too.
|
||||
Two concurrent webserver processes modifying the
|
||||
same dBase file will very likely ruin your database.
|
||||
|
||||
dBase files are simple sequential files of fixed length records.
|
||||
Records are appended to the end of the file and delete records
|
||||
are kept until you call dbase_pack().
|
||||
</description>
|
||||
<license>PHP</license>
|
||||
<release>
|
||||
<state>beta</state>
|
||||
<version>5.0rc1</version>
|
||||
<date>2004-03-19</date>
|
||||
<notes>
|
||||
package.xml added to support intallation using pear installer
|
||||
</notes>
|
||||
<filelist>
|
||||
<file role="doc" name="CREDITS"/>
|
||||
<file role="src" name="config.m4"/>
|
||||
<file role="src" name="dbase.c"/>
|
||||
<file role="src" name="dbf.h"/>
|
||||
<file role="src" name="dbf_head.c"/>
|
||||
<file role="src" name="dbf_head.h"/>
|
||||
<file role="src" name="dbf_misc.c"/>
|
||||
<file role="src" name="dbf_misc.h"/>
|
||||
<file role="src" name="dbf_ndx.c"/>
|
||||
<file role="src" name="dbf_ndx.h"/>
|
||||
<file role="src" name="dbf_rec.c"/>
|
||||
<file role="src" name="dbf_rec.h"/>
|
||||
<file role="src" name="php_dbase.h"/>
|
||||
</filelist>
|
||||
<deps>
|
||||
<dep type="php" rel="ge" version="5" />
|
||||
</deps>
|
||||
</release>
|
||||
</package>
|
||||
<!--
|
||||
vim:et:ts=1:sw=1
|
||||
-->
|
||||
+23
-31
@@ -40,7 +40,7 @@ int dbx_oci8_connect(zval **rv, zval **host, zval **db, zval **username, zval **
|
||||
arguments[0]=username;
|
||||
arguments[1]=password;
|
||||
arguments[2]=db;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCILogon", &returned_zval, number_of_arguments, arguments);
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_connect", &returned_zval, number_of_arguments, arguments);
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
return 0;
|
||||
@@ -59,7 +59,7 @@ int dbx_oci8_pconnect(zval **rv, zval **host, zval **db, zval **username, zval *
|
||||
arguments[0]=username;
|
||||
arguments[1]=password;
|
||||
arguments[2]=db;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIPLogon", &returned_zval, number_of_arguments, arguments);
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_pconnect", &returned_zval, number_of_arguments, arguments);
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
return 0;
|
||||
@@ -71,14 +71,14 @@ int dbx_oci8_pconnect(zval **rv, zval **host, zval **db, zval **username, zval *
|
||||
int dbx_oci8_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
|
||||
{
|
||||
/* returns 1 as long on success or 0 as long on failure */
|
||||
/* actually, ocilogoff officially does nothing, so what should I return? */
|
||||
/* actually, oci_close officially does nothing, so what should I return? */
|
||||
/* I will just return NULL right now and change the test accordingly */
|
||||
int number_of_arguments=1;
|
||||
zval **arguments[1];
|
||||
zval *returned_zval=NULL;
|
||||
|
||||
arguments[0]=dbx_handle;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCILogOff", &returned_zval, number_of_arguments, arguments);
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_close", &returned_zval, number_of_arguments, arguments);
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
return 0;
|
||||
@@ -98,16 +98,16 @@ int dbx_oci8_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_stat
|
||||
|
||||
arguments[0]=dbx_handle;
|
||||
arguments[1]=sql_statement;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIParse", &returned_zval, number_of_arguments, arguments);
|
||||
/* OCIParse returns a bool for failure, or a statement_identifier for valid sql_statements */
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_parse", &returned_zval, number_of_arguments, arguments);
|
||||
/* oci_parse returns a bool for failure, or a statement_identifier for valid sql_statements */
|
||||
if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
return 0;
|
||||
}
|
||||
number_of_arguments=1;
|
||||
arguments[0]=&returned_zval;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIExecute", &execute_zval, number_of_arguments, arguments);
|
||||
/* OCIExecute returns a bool for success or failure */
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_execute", &execute_zval, number_of_arguments, arguments);
|
||||
/* oci_execute returns a bool for success or failure */
|
||||
if (!execute_zval || Z_TYPE_P(execute_zval)!=IS_BOOL || Z_BVAL_P(execute_zval)==0) {
|
||||
if (execute_zval) zval_ptr_dtor(&execute_zval);
|
||||
zval_ptr_dtor(&returned_zval);
|
||||
@@ -115,8 +115,8 @@ int dbx_oci8_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_stat
|
||||
}
|
||||
number_of_arguments=1;
|
||||
arguments[0]=&returned_zval;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIStatementType", &statementtype_zval, number_of_arguments, arguments);
|
||||
/* OCIStatementType returns a string. 'SELECT' means there are results */
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_statement_type", &statementtype_zval, number_of_arguments, arguments);
|
||||
/* oci_statement_type returns a string. 'SELECT' means there are results */
|
||||
if (!statementtype_zval || Z_TYPE_P(statementtype_zval)!=IS_STRING) {
|
||||
if (statementtype_zval) zval_ptr_dtor(&statementtype_zval);
|
||||
if (execute_zval) zval_ptr_dtor(&execute_zval);
|
||||
@@ -148,7 +148,7 @@ int dbx_oci8_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_P
|
||||
zval *returned_zval=NULL;
|
||||
|
||||
arguments[0]=result_handle;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCINumCols", &returned_zval, number_of_arguments, arguments);
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_num_fields", &returned_zval, number_of_arguments, arguments);
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
return 0;
|
||||
@@ -170,8 +170,8 @@ int dbx_oci8_getcolumnname(zval **rv, zval **result_handle, long column_index, I
|
||||
ZVAL_LONG(zval_column_index, column_index+1);
|
||||
arguments[0]=result_handle;
|
||||
arguments[1]=&zval_column_index;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIColumnName", &returned_zval, number_of_arguments, arguments);
|
||||
/* OCIColumnName returns a string */
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_field_name", &returned_zval, number_of_arguments, arguments);
|
||||
/* oci_field_name returns a string */
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
FREE_ZVAL(zval_column_index);
|
||||
@@ -195,8 +195,8 @@ int dbx_oci8_getcolumntype(zval **rv, zval **result_handle, long column_index, I
|
||||
ZVAL_LONG(zval_column_index, column_index+1);
|
||||
arguments[0]=result_handle;
|
||||
arguments[1]=&zval_column_index;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIColumnType", &returned_zval, number_of_arguments, arguments);
|
||||
/* OCIColumnType returns a string??? */
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_field_type", &returned_zval, number_of_arguments, arguments);
|
||||
/* oci_field_type returns a string??? */
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
FREE_ZVAL(zval_column_index);
|
||||
@@ -211,31 +211,23 @@ int dbx_oci8_getcolumntype(zval **rv, zval **result_handle, long column_index, I
|
||||
int dbx_oci8_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
|
||||
{
|
||||
/* returns array[0..columncount-1] as strings on success or 0 as long on failure */
|
||||
int number_of_arguments=3;
|
||||
zval **arguments[3];
|
||||
int number_of_arguments=2;
|
||||
zval **arguments[2];
|
||||
zval *zval_resulttype=NULL;
|
||||
zval *zval_returned_array=NULL;
|
||||
zval *returned_zval=NULL;
|
||||
|
||||
MAKE_STD_ZVAL(zval_returned_array); /* no value needed, it will be overwritten anyway */
|
||||
ZVAL_EMPTY_STRING(zval_returned_array); /* there seems to be some weird mem-bug, so assigning a value anyway */
|
||||
MAKE_STD_ZVAL(zval_resulttype);
|
||||
ZVAL_LONG(zval_resulttype, OCI_NUM | OCI_RETURN_NULLS | OCI_RETURN_LOBS); /* no ASSOC, dbx handles that part */
|
||||
arguments[0]=result_handle;
|
||||
arguments[1]=&zval_returned_array;
|
||||
arguments[2]=&zval_resulttype;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIFetchInto", &returned_zval, number_of_arguments, arguments);
|
||||
/* OCIFetchInto returns the number of columns as an integer on success and FALSE */
|
||||
/* on failure. The actual array is passed back in arg[1] */
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG || Z_LVAL_P(returned_zval)==0) {
|
||||
arguments[1]=&zval_resulttype;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_fetch_array", &returned_zval, number_of_arguments, arguments);
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
FREE_ZVAL(zval_resulttype);
|
||||
FREE_ZVAL(zval_returned_array);
|
||||
return 0;
|
||||
}
|
||||
FREE_ZVAL(zval_resulttype);
|
||||
zval_ptr_dtor(&returned_zval);
|
||||
MOVE_RETURNED_TO_RV(rv, zval_returned_array);
|
||||
MOVE_RETURNED_TO_RV(rv, returned_zval);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -251,8 +243,8 @@ int dbx_oci8_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
|
||||
zval *returned_message_zval=NULL;
|
||||
arguments[0]=dbx_handle;
|
||||
if (!dbx_handle) number_of_arguments=0;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIError", &returned_zval, number_of_arguments, arguments);
|
||||
/* OCIError should returns an assoc array containing code & message, dbx needs the message */
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_error", &returned_zval, number_of_arguments, arguments);
|
||||
/* oci_error should returns an assoc array containing code & message, dbx needs the message */
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
return 0;
|
||||
|
||||
+5
-5
@@ -148,7 +148,7 @@ int dbx_pgsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_sta
|
||||
/* db_name is not used in this function */
|
||||
args[0]=dbx_handle;
|
||||
args[1]=sql_statement;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_exec", &returned_zval, nargs, args);
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_query", &returned_zval, nargs, args);
|
||||
/* pg_query returns a bool for success or failure,
|
||||
or a result_identifier for select statements */
|
||||
if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
|
||||
@@ -167,7 +167,7 @@ int dbx_pgsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_
|
||||
zval *returned_zval=NULL;
|
||||
|
||||
arguments[0]=result_handle;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_numfields", &returned_zval, number_of_arguments, arguments);
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_num_fields", &returned_zval, number_of_arguments, arguments);
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
return 0;
|
||||
@@ -188,7 +188,7 @@ int dbx_pgsql_getcolumnname(zval **rv, zval **result_handle, long column_index,
|
||||
ZVAL_LONG(zval_column_index, column_index);
|
||||
arguments[0]=result_handle;
|
||||
arguments[1]=&zval_column_index;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fieldname", &returned_zval, number_of_arguments, arguments);
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_field_name", &returned_zval, number_of_arguments, arguments);
|
||||
/* pg_fieldname returns a string */
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
@@ -212,7 +212,7 @@ int dbx_pgsql_getcolumntype(zval **rv, zval **result_handle, long column_index,
|
||||
ZVAL_LONG(zval_column_index, column_index);
|
||||
arguments[0]=result_handle;
|
||||
arguments[1]=&zval_column_index;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fieldtype", &returned_zval, number_of_arguments, arguments);
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_field_type", &returned_zval, number_of_arguments, arguments);
|
||||
/* pg_fieldtype returns a string */
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
@@ -252,7 +252,7 @@ int dbx_pgsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
|
||||
|
||||
arguments[0]=dbx_handle;
|
||||
if (!dbx_handle) number_of_arguments=0;
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_errormessage", &returned_zval, number_of_arguments, arguments);
|
||||
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_last_error", &returned_zval, number_of_arguments, arguments);
|
||||
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
|
||||
if (returned_zval) zval_ptr_dtor(&returned_zval);
|
||||
return 0;
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE package SYSTEM "../pear/package.dtd">
|
||||
<package>
|
||||
<name>dbx</name>
|
||||
<summary>Database abstraction functions</summary>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>mboeren</user>
|
||||
<name>Marc Boeren</name>
|
||||
<email>marc@guidance.nl</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
<maintainer>
|
||||
<user>hirokawa</user>
|
||||
<name>Rui Hirokawa</name>
|
||||
<email>hirokawa@php.net</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
<maintainer>
|
||||
<user>???</user>
|
||||
<name>Frank M. Kromann</name>
|
||||
<email>frank@kromann.info</email>
|
||||
<role>lead</role>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<description>
|
||||
The dbx module is a database abstraction layer (db 'X', where 'X'
|
||||
is a supported database). The dbx functions allow you to access all
|
||||
supported databases using a single calling convention. The
|
||||
dbx-functions themselves do not interface directly to the databases,
|
||||
but interface to the modules that are used to support these databases.
|
||||
</description>
|
||||
<license>PHP</license>
|
||||
<release>
|
||||
<state>beta</state>
|
||||
<version>5.0.0rc1</version>
|
||||
<date>2004-03-19</date>
|
||||
<notes>
|
||||
package.xml added to support intallation using pear installer
|
||||
</notes>
|
||||
<filelist>
|
||||
<file role="doc" name="CREDITS"/>
|
||||
<file role="doc" name="INSTALL"/>
|
||||
<file role="doc" name="howto_extend_dbx.html"/>
|
||||
<file role="src" name="config.m4"/>
|
||||
<file role="src" name="config.w32"/>
|
||||
<file role="src" name="dbx.dsp"/>
|
||||
<file role="src" name="dbx.c"/>
|
||||
<file role="src" name="dbx.h"/>
|
||||
<file role="src" name="dbx_fbsql.c"/>
|
||||
<file role="src" name="dbx_fbsql.h"/>
|
||||
<file role="src" name="dbx_mssql.c"/>
|
||||
<file role="src" name="dbx_mssql.h"/>
|
||||
<file role="src" name="dbx_mysql.c"/>
|
||||
<file role="src" name="dbx_mysql.h"/>
|
||||
<file role="src" name="dbx_oci8.c"/>
|
||||
<file role="src" name="dbx_oci8.h"/>
|
||||
<file role="src" name="dbx_odbc.c"/>
|
||||
<file role="src" name="dbx_odbc.h"/>
|
||||
<file role="src" name="dbx_pgsql.c"/>
|
||||
<file role="src" name="dbx_pgsql.h"/>
|
||||
<file role="src" name="dbx_sybasect.c"/>
|
||||
<file role="src" name="dbx_sybasect.h"/>
|
||||
<file role="src" name="php_dbx.h"/>
|
||||
<file role="src" name="dbx_sqlite.c"/>
|
||||
<file role="src" name="dbx_sqlite.h"/>
|
||||
<file role="test" name="tests/001.phpt"/>
|
||||
<file role="test" name="tests/002.phpt"/>
|
||||
<file role="test" name="tests/003.phpt"/>
|
||||
<file role="test" name="tests/004.phpt"/>
|
||||
<file role="test" name="tests/005.phpt"/>
|
||||
<file role="test" name="tests/006.phpt"/>
|
||||
<file role="test" name="tests/007.phpt"/>
|
||||
<file role="test" name="tests/008.phpt"/>
|
||||
<file role="test" name="tests/009.phpt"/>
|
||||
<file role="test" name="tests/dbx_test.p"/>
|
||||
<file role="test" name="tests/dbx_test.pgsql.script"/>
|
||||
<file role="test" name="tests/dbx_test.script"/>
|
||||
<file role="test" name="tests/skipif.inc"/>
|
||||
<file role="test" name="tests/010.phpt"/>
|
||||
</filelist>
|
||||
<deps>
|
||||
<dep type="php" rel="ge" version="5" />
|
||||
</deps>
|
||||
</release>
|
||||
</package>
|
||||
<!--
|
||||
vim:et:ts=1:sw=1
|
||||
-->
|
||||
Loaded 100 of 985 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user