mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-22 00:16:38 +00:00
Compare commits
1027
Commits
PEAR_1_4DEV
...
php-5.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c1949d4e7 | ||
|
|
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 |
No files matched your search
@@ -8,7 +8,7 @@ up to date instructions in the online manual, located here:
|
||||
|
||||
http://www.php.net/manual/en/install.apache.php
|
||||
|
||||
For Apache 2, instructions and up-to-date information regarding it's
|
||||
For Apache 2, instructions and up-to-date information regarding its
|
||||
support status, is available here:
|
||||
|
||||
http://www.php.net/manual/en/install.apache2.php
|
||||
|
||||
@@ -1,24 +1,120 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ????? 2004, PHP 5 Release Candidate 2
|
||||
- Force destructors to have empty signatures. (Marcus)
|
||||
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 #28895 (ReflectionClass::isAbstract always returns false). (Marcus)
|
||||
- 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 SQLite extension to use studlyCaps convention in its OO API. (Marcus)
|
||||
- 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
|
||||
|
||||
+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
-14
@@ -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,18 +161,14 @@ TSRM_API void tsrm_shutdown(void)
|
||||
|
||||
next_p = p->next;
|
||||
for (j=0; j<p->count; j++) {
|
||||
/*
|
||||
Disabled calling dtors on tsrm_shutdown - calling dtors
|
||||
in tsrm_shutdown makes modules registering TSRM ids
|
||||
to crash, if they have dtors, since the module is unloaded
|
||||
before tsrm_shutdown is called. Can be re-enabled after
|
||||
tsrm_free_id is implemented.
|
||||
|
||||
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);
|
||||
@@ -227,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++) {
|
||||
@@ -281,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -428,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
|
||||
}
|
||||
|
||||
|
||||
|
||||
+553
@@ -1,3 +1,556 @@
|
||||
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:
|
||||
|
||||
+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
|
||||
|
||||
+99
-99
@@ -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,18 +529,18 @@ 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
|
||||
@@ -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,9 +911,9 @@ 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
|
||||
the printing functions (echo, print) 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 may be converted to a string
|
||||
@@ -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
|
||||
|
||||
|
||||
+11
-7
@@ -429,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;
|
||||
|
||||
@@ -439,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);
|
||||
|
||||
@@ -512,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
|
||||
|
||||
@@ -554,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
|
||||
|
||||
@@ -581,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();
|
||||
|
||||
@@ -973,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 {
|
||||
@@ -1091,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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "2.0.0RC2-dev"
|
||||
#define ZEND_VERSION "2.0.0"
|
||||
|
||||
#define ZEND_ENGINE_2
|
||||
|
||||
|
||||
+55
-32
@@ -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,25 +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();
|
||||
|
||||
EG(current_module) = module;
|
||||
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);
|
||||
EG(current_module) = NULL;
|
||||
return FAILURE;
|
||||
}
|
||||
EG(current_module) = NULL;
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1357,23 +1394,9 @@ ZEND_API void zend_unregister_functions(zend_function_entry *functions, int coun
|
||||
|
||||
ZEND_API int zend_register_module(zend_module_entry *module)
|
||||
{
|
||||
int retval, name_len;
|
||||
char *lcname;
|
||||
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;
|
||||
name_len = strlen(module->name);
|
||||
lcname = zend_str_tolower_dup(module->name, name_len);
|
||||
retval = zend_hash_add(&module_registry, lcname, name_len+1, (void *)module, sizeof(zend_module_entry), NULL);
|
||||
efree(lcname);
|
||||
return retval;
|
||||
|
||||
return zend_register_module_ex(module TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-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)
|
||||
|
||||
@@ -167,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);
|
||||
|
||||
@@ -799,20 +799,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 +960,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 +1005,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 {
|
||||
@@ -1447,14 +1461,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;
|
||||
}
|
||||
@@ -1470,6 +1484,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;
|
||||
@@ -1567,14 +1582,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;
|
||||
}
|
||||
@@ -1584,8 +1599,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--;
|
||||
}
|
||||
|
||||
|
||||
+20
-8
@@ -1138,6 +1138,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;
|
||||
@@ -1711,16 +1712,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) {
|
||||
@@ -1818,15 +1823,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3323,7 +3334,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");
|
||||
}
|
||||
|
||||
@@ -3735,6 +3746,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-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);
|
||||
|
||||
+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) {
|
||||
free(c->name);
|
||||
if (!(c->flags & CONST_PERSISTENT)) {
|
||||
zval_dtor(&c->value);
|
||||
}
|
||||
zend_error(E_NOTICE,"Constant %s already defined", lowercase_name);
|
||||
zend_error(E_NOTICE,"Constant %s already defined", name);
|
||||
ret = FAILURE;
|
||||
}
|
||||
free_alloca(lowercase_name);
|
||||
if (lowercase_name) {
|
||||
efree(lowercase_name);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+20
-11
@@ -447,7 +447,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
|
||||
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);
|
||||
@@ -839,8 +839,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;
|
||||
@@ -1275,11 +1277,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));
|
||||
@@ -1330,7 +1330,7 @@ static int zend_check_symbol(zval **pz TSRMLS_DC)
|
||||
}
|
||||
|
||||
#define RETURN_FROM_EXECUTE_LOOP(execute_data) \
|
||||
free_alloca(EX(Ts)); \
|
||||
efree(EX(Ts)); \
|
||||
EG(in_execution) = EX(original_in_execution); \
|
||||
EG(current_execute_data) = EX(prev_execute_data); \
|
||||
return 1; /* CHECK_ME */
|
||||
@@ -1349,7 +1349,7 @@ 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);
|
||||
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);
|
||||
@@ -3404,6 +3404,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;
|
||||
@@ -3574,6 +3575,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);
|
||||
@@ -3658,7 +3662,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;
|
||||
}
|
||||
@@ -3793,7 +3797,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);
|
||||
@@ -3825,6 +3829,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 {
|
||||
@@ -3967,7 +3976,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;
|
||||
}
|
||||
|
||||
@@ -1101,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -202,7 +202,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;
|
||||
}
|
||||
|
||||
|
||||
+29
-29
@@ -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)
|
||||
|
||||
+11
-13
@@ -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 */
|
||||
|
||||
@@ -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); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -1445,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
|
||||
|
||||
@@ -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;
|
||||
@@ -671,6 +671,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;
|
||||
@@ -681,7 +682,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;
|
||||
@@ -972,6 +972,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 */
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -93,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 */
|
||||
@@ -119,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;
|
||||
|
||||
+20
-3
@@ -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,20 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
/* Proxy objects workings */
|
||||
typedef struct _zend_proxy_object {
|
||||
@@ -284,6 +300,7 @@ static zend_object_handlers zend_object_proxy_handlers = {
|
||||
NULL, /* get_class_name */
|
||||
NULL, /* compare_objects */
|
||||
NULL, /* cast_object */
|
||||
NULL, /* count_elements */
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -64,9 +64,11 @@ 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_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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+49
-24
@@ -175,6 +175,9 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
(holder) = (*(op)); \
|
||||
zval_copy_ctor(&(holder)); \
|
||||
convert_to_long_base(&(holder), 10); \
|
||||
if ((holder).type == IS_LONG) { \
|
||||
(op) = &(holder); \
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
@@ -262,7 +265,6 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
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; \
|
||||
return; \
|
||||
} \
|
||||
} else { \
|
||||
if(Z_OBJ_HT_P(op)->get) { \
|
||||
@@ -273,7 +275,6 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
|
||||
*op = *newop; \
|
||||
FREE_ZVAL(newop); \
|
||||
conv_func(op); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
@@ -322,19 +323,23 @@ ZEND_API void convert_to_long_base(zval *op, int base)
|
||||
TSRMLS_FETCH();
|
||||
|
||||
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 {
|
||||
zend_error(E_NOTICE, "Object of class %s could not be converted to integer", Z_OBJCE_P(op)->name);
|
||||
/* we cannot convert it to long */
|
||||
return;
|
||||
}
|
||||
|
||||
zval_dtor(op);
|
||||
ZVAL_LONG(op, retval);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
zend_error(E_WARNING, "Cannot convert to ordinal value");
|
||||
@@ -386,6 +391,10 @@ ZEND_API void convert_to_double(zval *op)
|
||||
|
||||
convert_object_to_type(op, IS_DOUBLE, convert_to_double);
|
||||
|
||||
if (op->type == IS_DOUBLE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
HashTable *ht = Z_OBJPROP_P(op);
|
||||
if (ht) {
|
||||
@@ -470,6 +479,10 @@ ZEND_API void convert_to_boolean(zval *op)
|
||||
TSRMLS_FETCH();
|
||||
|
||||
convert_object_to_type(op, IS_BOOL, convert_to_double);
|
||||
|
||||
if (op->type == IS_BOOL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (EG(ze1_compatibility_mode)) {
|
||||
HashTable *ht = Z_OBJPROP_P(op);
|
||||
@@ -545,6 +558,10 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
|
||||
|
||||
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);
|
||||
@@ -611,6 +628,10 @@ ZEND_API void convert_to_array(zval *op)
|
||||
}
|
||||
} else {
|
||||
convert_object_to_type(op, IS_ARRAY, convert_to_array);
|
||||
|
||||
if (op->type == IS_ARRAY) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
zval_dtor(op);
|
||||
op->type = IS_ARRAY;
|
||||
@@ -1279,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);
|
||||
|
||||
@@ -1299,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;
|
||||
@@ -1382,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;
|
||||
}
|
||||
@@ -1887,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)) {
|
||||
|
||||
+215
-119
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,14 +140,16 @@ 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:
|
||||
|
||||
+11
-7
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
MAJOR_VERSION=5
|
||||
MINOR_VERSION=0
|
||||
RELEASE_VERSION=0
|
||||
EXTRA_VERSION="RC2-dev"
|
||||
EXTRA_VERSION=""
|
||||
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
|
||||
|
||||
@@ -1055,8 +1061,6 @@ if test "$PHP_SAPI_CLI" != "no"; then
|
||||
PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
|
||||
PHP_INSTALL_CLI_TARGET="install-cli"
|
||||
PHP_ADD_SOURCES(sapi/cli, php_cli.c getopt.c,, cli)
|
||||
else
|
||||
with_pear=no
|
||||
fi
|
||||
|
||||
PHP_SUBST(PHP_CLI_TARGET)
|
||||
|
||||
@@ -100,6 +100,8 @@ PHP_MSHUTDOWN_FUNCTION(bcmath)
|
||||
_bc_free_num_ex(&BCG(_one_), 1);
|
||||
_bc_free_num_ex(&BCG(_two_), 1);
|
||||
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -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$
|
||||
|
||||
|
||||
@@ -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,7 +98,7 @@ 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;
|
||||
|
||||
@@ -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,7 +188,8 @@ 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);
|
||||
@@ -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;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -34,6 +34,7 @@ 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,10 +47,15 @@ static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC)
|
||||
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 {
|
||||
php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC);
|
||||
@@ -137,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 {
|
||||
@@ -152,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);
|
||||
|
||||
@@ -170,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 */
|
||||
@@ -186,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)
|
||||
{
|
||||
@@ -505,6 +548,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,
|
||||
@@ -512,8 +574,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,
|
||||
@@ -525,7 +587,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)
|
||||
@@ -614,7 +677,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);
|
||||
|
||||
@@ -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;
|
||||
@@ -754,7 +830,7 @@ PHP_FUNCTION(variant_get_type)
|
||||
return;
|
||||
}
|
||||
obj = CDNO_FETCH(zobj);
|
||||
|
||||
|
||||
RETURN_LONG(V_VT(&obj->v));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -765,7 +841,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 +850,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 +876,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 +887,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 +906,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... */
|
||||
}
|
||||
/* }}} */
|
||||
@@ -314,14 +314,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 +338,8 @@ static HRESULT STDMETHODCALLTYPE disp_deletememberbyname(
|
||||
|
||||
FETCH_DISP("DeleteMemberByName");
|
||||
|
||||
/* TODO: unset */
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
@@ -355,6 +351,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');
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+20
-1
@@ -323,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);
|
||||
@@ -1065,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);
|
||||
}
|
||||
|
||||
@@ -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 :
|
||||
|
||||
+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,9 @@
|
||||
// $Id$
|
||||
// vim:ft=javascript
|
||||
|
||||
ARG_ENABLE("dio", "Enable the direct I/O support", "no");
|
||||
|
||||
if (PHP_DIO != "no") {
|
||||
EXTENSION("dio", "dio.c");
|
||||
AC_DEFINE('HAVE_DIO', 1, 'dio support');
|
||||
}
|
||||
@@ -27,9 +27,15 @@
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <fcntl.h>
|
||||
#ifndef PHP_WIN32
|
||||
#include <termios.h>
|
||||
#endif
|
||||
|
||||
/* e.g. IRIX does not have CRTSCTS */
|
||||
#ifndef CRTSCTS
|
||||
@@ -45,14 +51,20 @@ static int le_fd;
|
||||
|
||||
function_entry dio_functions[] = {
|
||||
PHP_FE(dio_open, NULL)
|
||||
#ifndef PHP_WIN32
|
||||
PHP_FE(dio_truncate, NULL)
|
||||
#endif
|
||||
PHP_FE(dio_stat, NULL)
|
||||
PHP_FE(dio_seek, NULL)
|
||||
#ifndef PHP_WIN32
|
||||
PHP_FE(dio_fcntl, NULL)
|
||||
#endif
|
||||
PHP_FE(dio_read, NULL)
|
||||
PHP_FE(dio_write, NULL)
|
||||
PHP_FE(dio_close, NULL)
|
||||
#ifndef PHP_WIN32
|
||||
PHP_FE(dio_tcsetattr, NULL)
|
||||
#endif
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -94,15 +106,22 @@ PHP_MINIT_FUNCTION(dio)
|
||||
RDIOC(O_EXCL);
|
||||
RDIOC(O_TRUNC);
|
||||
RDIOC(O_APPEND);
|
||||
#ifdef O_NONBLOCK
|
||||
RDIOC(O_NONBLOCK);
|
||||
#endif
|
||||
#ifdef O_NDELAY
|
||||
RDIOC(O_NDELAY);
|
||||
#endif
|
||||
#ifdef O_SYNC
|
||||
RDIOC(O_SYNC);
|
||||
#endif
|
||||
#ifdef O_ASYNC
|
||||
RDIOC(O_ASYNC);
|
||||
#endif
|
||||
#ifdef O_NOCTTY
|
||||
RDIOC(O_NOCTTY);
|
||||
#endif
|
||||
#ifndef PHP_WIN32
|
||||
RDIOC(S_IRWXU);
|
||||
RDIOC(S_IRUSR);
|
||||
RDIOC(S_IWUSR);
|
||||
@@ -127,6 +146,7 @@ PHP_MINIT_FUNCTION(dio)
|
||||
RDIOC(F_UNLCK);
|
||||
RDIOC(F_RDLCK);
|
||||
RDIOC(F_WRLCK);
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -235,6 +255,7 @@ PHP_FUNCTION(dio_write)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifndef PHP_WIN32
|
||||
/* {{{ proto bool dio_truncate(resource fd, int offset)
|
||||
Truncate file descriptor fd to offset bytes */
|
||||
PHP_FUNCTION(dio_truncate)
|
||||
@@ -257,6 +278,7 @@ PHP_FUNCTION(dio_truncate)
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
#define ADD_FIELD(f, v) add_assoc_long_ex(return_value, (f), sizeof(f), v);
|
||||
|
||||
@@ -288,8 +310,10 @@ PHP_FUNCTION(dio_stat)
|
||||
ADD_FIELD("gid", s.st_gid);
|
||||
ADD_FIELD("device_type", s.st_rdev);
|
||||
ADD_FIELD("size", s.st_size);
|
||||
#ifndef PHP_WIN32
|
||||
ADD_FIELD("block_size", s.st_blksize);
|
||||
ADD_FIELD("blocks", s.st_blocks);
|
||||
#endif
|
||||
ADD_FIELD("atime", s.st_atime);
|
||||
ADD_FIELD("mtime", s.st_mtime);
|
||||
ADD_FIELD("ctime", s.st_ctime);
|
||||
@@ -315,6 +339,7 @@ PHP_FUNCTION(dio_seek)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifndef PHP_WIN32
|
||||
/* {{{ proto mixed dio_fcntl(resource fd, int cmd[, mixed arg])
|
||||
Perform a c library fcntl on fd */
|
||||
PHP_FUNCTION(dio_fcntl)
|
||||
@@ -415,7 +440,9 @@ PHP_FUNCTION(dio_fcntl)
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
#ifndef PHP_WIN32
|
||||
/* {{{ proto mixed dio_tcsetattr(resource fd, array args )
|
||||
Perform a c library tcsetattr on fd */
|
||||
PHP_FUNCTION(dio_tcsetattr)
|
||||
@@ -576,6 +603,7 @@ PHP_FUNCTION(dio_tcsetattr)
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
/* {{{ proto void dio_close(resource fd)
|
||||
Close the file descriptor given by fd */
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
Check for dio presence
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("dio")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
echo "dio extension is available";
|
||||
|
||||
+4
-12
@@ -1,12 +1,4 @@
|
||||
1) Change _node_list_pointer to something faster than just a linked list.
|
||||
Currently there to test that unlinked node tracking works
|
||||
2) Possible create new object type for documents as these are the only types which need to track nodes
|
||||
- Would also require its own dtor functionality
|
||||
3) Define correct behavior. When certain types of nodes are destroyed,
|
||||
do we unlink children (if referenced) or just destroy them. (Element/Attribute nodes)
|
||||
4) Find out where XPath goes (this extension or its own)
|
||||
5) What DOM object types are really needed (i.e. not currently using DOMString)
|
||||
6) Determine how to handle non speced functionality.
|
||||
i.e validation (add method or implement as property for processing)
|
||||
|
||||
|
||||
For 5.1
|
||||
1) enhance XPath functionality
|
||||
2) look at auto encoding support for in/output
|
||||
3) What DOM object types are really needed (i.e. not currently using DOMString)
|
||||
+15
-9
@@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domattr extends domnode
|
||||
* class DOMAttr extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-637646024
|
||||
* Since:
|
||||
@@ -43,7 +43,7 @@ zend_function_entry php_dom_attr_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ proto void DomAttr::__construct(string name, [string value]); */
|
||||
/* {{{ proto void DOMAttr::__construct(string name, [string value]); */
|
||||
PHP_METHOD(domattr, __construct)
|
||||
{
|
||||
|
||||
@@ -52,23 +52,29 @@ PHP_METHOD(domattr, __construct)
|
||||
xmlNodePtr oldnode = NULL;
|
||||
dom_object *intern;
|
||||
char *name, *value = NULL;
|
||||
int name_len, value_len;
|
||||
int name_len, value_len, name_valid;
|
||||
|
||||
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
|
||||
php_std_error_handling();
|
||||
return;
|
||||
}
|
||||
|
||||
php_std_error_handling();
|
||||
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
|
||||
|
||||
if (name_len == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute name is required");
|
||||
name_valid = xmlValidateName((xmlChar *) name, 0);
|
||||
if (name_valid != 0) {
|
||||
php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
nodep = xmlNewProp(NULL, (xmlChar *) name, value);
|
||||
|
||||
if (!nodep)
|
||||
if (!nodep) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (intern != NULL) {
|
||||
oldnode = (xmlNodePtr)intern->ptr;
|
||||
@@ -79,7 +85,7 @@ PHP_METHOD(domattr, __construct)
|
||||
}
|
||||
}
|
||||
|
||||
/* }}} end DomAttr::__construct */
|
||||
/* }}} end DOMAttr::__construct */
|
||||
|
||||
|
||||
/* {{{ proto name string
|
||||
@@ -194,7 +200,7 @@ int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto ownerElement element
|
||||
/* {{{ proto ownerElement DOMElement
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-ownerElement
|
||||
Since: DOM Level 2
|
||||
@@ -230,7 +236,7 @@ int dom_attr_owner_element_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto schemaTypeInfo typeinfo
|
||||
/* {{{ proto schemaTypeInfo DOMTypeInfo
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-schemaTypeInfo
|
||||
Since: DOM Level 3
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domcdatasection extends domtext
|
||||
* class DOMCdataSection extends DOMText
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-667469212
|
||||
* Since:
|
||||
@@ -40,7 +40,7 @@ zend_function_entry php_dom_cdatasection_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ proto void DomCDataSection::__construct(string value); */
|
||||
/* {{{ proto void DOMCdataSection::__construct(string value); */
|
||||
PHP_METHOD(domcdatasection, __construct)
|
||||
{
|
||||
|
||||
@@ -50,14 +50,19 @@ PHP_METHOD(domcdatasection, __construct)
|
||||
char *value = NULL;
|
||||
int value_len;
|
||||
|
||||
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) {
|
||||
php_std_error_handling();
|
||||
return;
|
||||
}
|
||||
|
||||
php_std_error_handling();
|
||||
nodep = xmlNewCDataBlock(NULL, (xmlChar *) value, value_len);
|
||||
|
||||
if (!nodep)
|
||||
if (!nodep) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
|
||||
if (intern != NULL) {
|
||||
@@ -68,6 +73,6 @@ PHP_METHOD(domcdatasection, __construct)
|
||||
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} end DomCDataSection::__construct */
|
||||
/* }}} end DOMCdataSection::__construct */
|
||||
|
||||
#endif
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domcharacterdata extends domnode
|
||||
* class DOMCharacterData extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-FF21A306
|
||||
* Since:
|
||||
@@ -105,7 +105,7 @@ int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto length unsigned long
|
||||
/* {{{ proto length long
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7D61178C
|
||||
Since:
|
||||
@@ -140,7 +140,7 @@ int dom_characterdata_length_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto domstring dom_characterdata_substring_data(unsigned long offset, unsigned long count);
|
||||
/* {{{ proto string dom_characterdata_substring_data(long offset, long count);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6531BCCF
|
||||
Since:
|
||||
*/
|
||||
@@ -190,7 +190,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
|
||||
/* }}} end dom_characterdata_substring_data */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_characterdata_append_data(string arg);
|
||||
/* {{{ proto void dom_characterdata_append_data(string arg);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-32791A2F
|
||||
Since:
|
||||
*/
|
||||
@@ -215,7 +215,7 @@ PHP_FUNCTION(dom_characterdata_append_data)
|
||||
/* }}} end dom_characterdata_append_data */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_characterdata_insert_data(unsigned long offset, string arg);
|
||||
/* {{{ proto void dom_characterdata_insert_data(long offset, string arg);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3EDB695F
|
||||
Since:
|
||||
*/
|
||||
@@ -264,7 +264,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
|
||||
/* }}} end dom_characterdata_insert_data */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_characterdata_delete_data(unsigned long offset, unsigned long count);
|
||||
/* {{{ proto void dom_characterdata_delete_data(long offset, long count);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7C603781
|
||||
Since:
|
||||
*/
|
||||
@@ -320,7 +320,7 @@ PHP_FUNCTION(dom_characterdata_delete_data)
|
||||
/* }}} end dom_characterdata_delete_data */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_characterdata_replace_data(unsigned long offset, unsigned long count, string arg);
|
||||
/* {{{ proto void dom_characterdata_replace_data(long offset, long count, string arg);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-E5CBA7FB
|
||||
Since:
|
||||
*/
|
||||
|
||||
+9
-4
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domcomment extends domcharacterdata
|
||||
* class DOMComment extends DOMCharacterData
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1728279322
|
||||
* Since:
|
||||
@@ -40,7 +40,7 @@ zend_function_entry php_dom_comment_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ proto void DomComment::__construct([string value]); */
|
||||
/* {{{ proto void DOMComment::__construct([string value]); */
|
||||
PHP_METHOD(domcomment, __construct)
|
||||
{
|
||||
|
||||
@@ -50,14 +50,19 @@ PHP_METHOD(domcomment, __construct)
|
||||
char *value = NULL;
|
||||
int value_len;
|
||||
|
||||
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) {
|
||||
php_std_error_handling();
|
||||
return;
|
||||
}
|
||||
|
||||
php_std_error_handling();
|
||||
nodep = xmlNewComment((xmlChar *) value);
|
||||
|
||||
if (!nodep)
|
||||
if (!nodep) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
|
||||
if (intern != NULL) {
|
||||
@@ -68,5 +73,5 @@ PHP_METHOD(domcomment, __construct)
|
||||
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} end DomComment::__construct */
|
||||
/* }}} end DOMComment::__construct */
|
||||
#endif
|
||||
+82
-68
@@ -42,7 +42,7 @@ struct _idsIterator {
|
||||
#define DOM_LOAD_FILE 1
|
||||
|
||||
/*
|
||||
* class domdocument extends domnode
|
||||
* class DOMDocument extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-i-Document
|
||||
* Since:
|
||||
@@ -88,7 +88,7 @@ zend_function_entry php_dom_document_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ proto doctype documenttype
|
||||
/* {{{ proto docType DOMDocumentType
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
|
||||
Since:
|
||||
@@ -124,7 +124,7 @@ int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto implementation domimplementation
|
||||
/* {{{ proto implementation DOMImplementation
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
|
||||
Since:
|
||||
@@ -140,7 +140,7 @@ int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto domelement document_element documentElement
|
||||
/* {{{ proto documentElement DOMElement
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
|
||||
Since:
|
||||
@@ -174,7 +174,7 @@ int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto actual_encoding string
|
||||
/* {{{ proto actualEncoding string
|
||||
readonly=no
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-actualEncoding
|
||||
Since: DOM Level 3
|
||||
@@ -399,7 +399,7 @@ int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto strict_error_checking boolean
|
||||
/* {{{ proto strictErrorChecking boolean
|
||||
readonly=no
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
|
||||
Since: DOM Level 3
|
||||
@@ -486,7 +486,7 @@ int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto validateonParse boolean
|
||||
/* {{{ proto validateOnParse boolean
|
||||
readonly=no
|
||||
*/
|
||||
int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
@@ -658,7 +658,7 @@ int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_D
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto document_uri string
|
||||
/* {{{ proto documentURI string
|
||||
readonly=no
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
|
||||
Since: DOM Level 3
|
||||
@@ -724,7 +724,7 @@ int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto config domconfiguration
|
||||
/* {{{ proto config DOMConfiguration
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
|
||||
Since: DOM Level 3
|
||||
@@ -740,7 +740,7 @@ int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto domelement dom_document_create_element(string tagName);
|
||||
/* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547
|
||||
Since:
|
||||
*/
|
||||
@@ -759,8 +759,8 @@ PHP_FUNCTION(dom_document_create_element)
|
||||
|
||||
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
|
||||
|
||||
if (name_len == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Element name is required");
|
||||
if (xmlValidateName((xmlChar *) name, 0) != 0) {
|
||||
php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -774,7 +774,7 @@ PHP_FUNCTION(dom_document_create_element)
|
||||
/* }}} end dom_document_create_element */
|
||||
|
||||
|
||||
/* {{{ proto domdocumentfragment dom_document_create_document_fragment();
|
||||
/* {{{ proto DOMDocumentFragment dom_document_create_document_fragment();
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5
|
||||
Since:
|
||||
*/
|
||||
@@ -802,7 +802,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
|
||||
/* }}} end dom_document_create_document_fragment */
|
||||
|
||||
|
||||
/* {{{ proto domtext dom_document_create_text_node(string data);
|
||||
/* {{{ proto DOMText dom_document_create_text_node(string data);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127
|
||||
Since:
|
||||
*/
|
||||
@@ -831,7 +831,7 @@ PHP_FUNCTION(dom_document_create_text_node)
|
||||
/* }}} end dom_document_create_text_node */
|
||||
|
||||
|
||||
/* {{{ proto domcomment dom_document_create_comment(string data);
|
||||
/* {{{ proto DOMComment dom_document_create_comment(string data);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328
|
||||
Since:
|
||||
*/
|
||||
@@ -860,7 +860,7 @@ PHP_FUNCTION(dom_document_create_comment)
|
||||
/* }}} end dom_document_create_comment */
|
||||
|
||||
|
||||
/* {{{ proto domcdatasection dom_document_create_cdatasection(string data);
|
||||
/* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8
|
||||
Since:
|
||||
*/
|
||||
@@ -889,7 +889,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
|
||||
/* }}} end dom_document_create_cdatasection */
|
||||
|
||||
|
||||
/* {{{ proto domprocessinginstruction dom_document_create_processing_instruction(string target, string data);
|
||||
/* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439
|
||||
Since:
|
||||
*/
|
||||
@@ -908,6 +908,11 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
|
||||
|
||||
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
|
||||
|
||||
if (xmlValidateName((xmlChar *) name, 0) != 0) {
|
||||
php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
node = xmlNewPI((xmlChar *) name, (xmlChar *) value);
|
||||
if (!node) {
|
||||
RETURN_FALSE;
|
||||
@@ -920,7 +925,7 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
|
||||
/* }}} end dom_document_create_processing_instruction */
|
||||
|
||||
|
||||
/* {{{ proto domattr dom_document_create_attribute(string name);
|
||||
/* {{{ proto DOMAttr dom_document_create_attribute(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198
|
||||
Since:
|
||||
*/
|
||||
@@ -939,8 +944,8 @@ PHP_FUNCTION(dom_document_create_attribute)
|
||||
|
||||
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
|
||||
|
||||
if (name_len == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute name is required");
|
||||
if (xmlValidateName((xmlChar *) name, 0) != 0) {
|
||||
php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -955,7 +960,7 @@ PHP_FUNCTION(dom_document_create_attribute)
|
||||
/* }}} end dom_document_create_attribute */
|
||||
|
||||
|
||||
/* {{{ proto domentityreference dom_document_create_entity_reference(string name);
|
||||
/* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE
|
||||
Since:
|
||||
*/
|
||||
@@ -974,6 +979,11 @@ PHP_FUNCTION(dom_document_create_entity_reference)
|
||||
|
||||
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
|
||||
|
||||
if (xmlValidateName((xmlChar *) name, 0) != 0) {
|
||||
php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
node = xmlNewReference(docp, name);
|
||||
if (!node) {
|
||||
RETURN_FALSE;
|
||||
@@ -984,7 +994,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
|
||||
/* }}} end dom_document_create_entity_reference */
|
||||
|
||||
|
||||
/* {{{ proto domnodelist dom_document_get_elements_by_tag_name(string tagname);
|
||||
/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094
|
||||
Since:
|
||||
*/
|
||||
@@ -1011,7 +1021,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name)
|
||||
/* }}} end dom_document_get_elements_by_tag_name */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_document_import_node(node importedNode, boolean deep);
|
||||
/* {{{ proto DOMNode dom_document_import_node(DOMNode importedNode, boolean deep);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Core-Document-importNode
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -1053,7 +1063,7 @@ PHP_FUNCTION(dom_document_import_node)
|
||||
/* }}} end dom_document_import_node */
|
||||
|
||||
|
||||
/* {{{ proto domelement dom_document_create_element_ns(string namespaceURI, string qualifiedName);
|
||||
/* {{{ proto DOMElement dom_document_create_element_ns(string namespaceURI, string qualifiedName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrElNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -1073,23 +1083,22 @@ PHP_FUNCTION(dom_document_create_element_ns)
|
||||
return;
|
||||
}
|
||||
|
||||
if (name_len == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Element Name is required");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
|
||||
|
||||
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len);
|
||||
|
||||
if (errorcode == 0) {
|
||||
nodep = xmlNewDocNode (docp, NULL, localname, NULL);
|
||||
if (nodep != NULL && uri != NULL) {
|
||||
nsptr = xmlSearchNsByHref (nodep->doc, nodep, uri);
|
||||
if (nsptr == NULL) {
|
||||
nsptr = dom_get_ns(nodep, uri, &errorcode, prefix);
|
||||
if (xmlValidateName((xmlChar *) localname, 0) == 0) {
|
||||
nodep = xmlNewDocNode (docp, NULL, localname, NULL);
|
||||
if (nodep != NULL && uri != NULL) {
|
||||
nsptr = xmlSearchNsByHref (nodep->doc, nodep, uri);
|
||||
if (nsptr == NULL) {
|
||||
nsptr = dom_get_ns(nodep, uri, &errorcode, prefix);
|
||||
}
|
||||
xmlSetNs(nodep, nsptr);
|
||||
}
|
||||
xmlSetNs(nodep, nsptr);
|
||||
} else {
|
||||
errorcode = INVALID_CHARACTER_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1118,7 +1127,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
|
||||
/* }}} end dom_document_create_element_ns */
|
||||
|
||||
|
||||
/* {{{ proto domattr dom_document_create_attribute_ns(string namespaceURI, string qualifiedName);
|
||||
/* {{{ proto DOMAttr dom_document_create_attribute_ns(string namespaceURI, string qualifiedName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrAttrNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -1138,24 +1147,23 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
|
||||
return;
|
||||
}
|
||||
|
||||
if (name_len == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Qualified Name is required");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
|
||||
|
||||
root = xmlDocGetRootElement(docp);
|
||||
if (root != NULL) {
|
||||
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len);
|
||||
if (errorcode == 0) {
|
||||
nodep = (xmlNodePtr) xmlNewDocProp(docp, localname, NULL);
|
||||
if (nodep != NULL && uri_len > 0) {
|
||||
nsptr = xmlSearchNsByHref (nodep->doc, root, uri);
|
||||
if (nsptr == NULL) {
|
||||
nsptr = dom_get_ns(root, uri, &errorcode, prefix);
|
||||
if (xmlValidateName((xmlChar *) localname, 0) == 0) {
|
||||
nodep = (xmlNodePtr) xmlNewDocProp(docp, localname, NULL);
|
||||
if (nodep != NULL && uri_len > 0) {
|
||||
nsptr = xmlSearchNsByHref (nodep->doc, root, uri);
|
||||
if (nsptr == NULL) {
|
||||
nsptr = dom_get_ns(root, uri, &errorcode, prefix);
|
||||
}
|
||||
xmlSetNs(nodep, nsptr);
|
||||
}
|
||||
xmlSetNs(nodep, nsptr);
|
||||
} else {
|
||||
errorcode = INVALID_CHARACTER_ERR;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1185,7 +1193,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
|
||||
/* }}} end dom_document_create_attribute_ns */
|
||||
|
||||
|
||||
/* {{{ proto domnodelist dom_document_get_elements_by_tag_name_ns(string namespaceURI, string localName);
|
||||
/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name_ns(string namespaceURI, string localName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBTNNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -1213,7 +1221,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns)
|
||||
/* }}} end dom_document_get_elements_by_tag_name_ns */
|
||||
|
||||
|
||||
/* {{{ proto domelement dom_document_get_element_by_id(string elementId);
|
||||
/* {{{ proto DOMElement dom_document_get_element_by_id(string elementId);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBId
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -1244,7 +1252,7 @@ PHP_FUNCTION(dom_document_get_element_by_id)
|
||||
/* }}} end dom_document_get_element_by_id */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_document_adopt_node(node source);
|
||||
/* {{{ proto DOMNode dom_document_adopt_node(DOMNode source);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-adoptNode
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1255,7 +1263,7 @@ PHP_FUNCTION(dom_document_adopt_node)
|
||||
/* }}} end dom_document_adopt_node */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_document_normalize_document();
|
||||
/* {{{ proto void dom_document_normalize_document();
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-normalizeDocument
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1276,7 +1284,7 @@ PHP_FUNCTION(dom_document_normalize_document)
|
||||
/* }}} end dom_document_normalize_document */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_document_rename_node(node n, string namespaceURI, string qualifiedName);
|
||||
/* {{{ proto DOMNode dom_document_rename_node(node n, string namespaceURI, string qualifiedName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-renameNode
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1286,7 +1294,7 @@ PHP_FUNCTION(dom_document_rename_node)
|
||||
}
|
||||
/* }}} end dom_document_rename_node */
|
||||
|
||||
/* {{{ proto void DomDocument::__construct([string version], [string encoding]); */
|
||||
/* {{{ proto void DOMDocument::__construct([string version], [string encoding]); */
|
||||
PHP_METHOD(domdocument, __construct)
|
||||
{
|
||||
|
||||
@@ -1296,13 +1304,19 @@ PHP_METHOD(domdocument, __construct)
|
||||
char *encoding, *version = NULL;
|
||||
int encoding_len = 0, version_len = 0, refcount;
|
||||
|
||||
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) {
|
||||
php_std_error_handling();
|
||||
return;
|
||||
}
|
||||
|
||||
php_std_error_handling();
|
||||
docp = xmlNewDoc(version);
|
||||
if (!docp)
|
||||
|
||||
if (!docp) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (encoding_len > 0) {
|
||||
docp->encoding = (const xmlChar*)xmlStrdup(encoding);
|
||||
@@ -1323,7 +1337,7 @@ PHP_METHOD(domdocument, __construct)
|
||||
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} end dom_document_document */
|
||||
/* }}} end DOMDocument::__construct */
|
||||
|
||||
char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) {
|
||||
xmlURI *uri;
|
||||
@@ -1530,7 +1544,7 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
|
||||
}
|
||||
/* }}} end dom_parser_document */
|
||||
|
||||
/* {{{ proto boolean domnode dom_document_load(string source);
|
||||
/* {{{ proto boolean|DOMNode dom_document_load(string source);
|
||||
URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-load
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1540,7 +1554,7 @@ PHP_METHOD(domdocument, load)
|
||||
}
|
||||
/* }}} end dom_document_load */
|
||||
|
||||
/* {{{ proto boolean domnode dom_document_loadxml(string source);
|
||||
/* {{{ proto boolean|DOMNode dom_document_loadxml(string source);
|
||||
URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-loadXML
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1550,7 +1564,7 @@ PHP_METHOD(domdocument, loadXML)
|
||||
}
|
||||
/* }}} end dom_document_loadxml */
|
||||
|
||||
/* {{{ proto long domnode dom_document_save(string file);
|
||||
/* {{{ proto long dom_document_save(string file);
|
||||
Convenience method to save to file
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_save)
|
||||
@@ -1586,7 +1600,7 @@ PHP_FUNCTION(dom_document_save)
|
||||
}
|
||||
/* }}} end dom_document_save */
|
||||
|
||||
/* {{{ proto string domnode dom_document_savexml([node n]);
|
||||
/* {{{ proto string dom_document_savexml([node n]);
|
||||
URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-saveXML
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1715,7 +1729,7 @@ PHP_FUNCTION(dom_document_xinclude)
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto string domnode dom_document_validate();
|
||||
/* {{{ proto boolean dom_document_validate();
|
||||
Since: DOM extended
|
||||
*/
|
||||
PHP_FUNCTION(dom_document_validate)
|
||||
@@ -1828,19 +1842,19 @@ _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
|
||||
}
|
||||
}
|
||||
|
||||
/* {{{ proto boolean domnode _dom_document_schema_validate(string filename); */
|
||||
/* {{{ proto boolean dom_document_schema_validate_file(string filename); */
|
||||
PHP_FUNCTION(dom_document_schema_validate_file)
|
||||
{
|
||||
_dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE);
|
||||
}
|
||||
/* }}} end _dom_document_schema_validate */
|
||||
/* }}} end dom_document_schema_validate_file */
|
||||
|
||||
/* {{{ proto boolean domnode _dom_document_schema_validate(string source); */
|
||||
/* {{{ proto boolean dom_document_schema_validate(string source); */
|
||||
PHP_FUNCTION(dom_document_schema_validate_xml)
|
||||
{
|
||||
_dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING);
|
||||
}
|
||||
/* }}} end _dom_document_schema_validate */
|
||||
/* }}} end dom_document_schema_validate */
|
||||
|
||||
|
||||
static void
|
||||
@@ -1918,14 +1932,14 @@ _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
|
||||
}
|
||||
}
|
||||
|
||||
/* {{{ proto boolean domnode dom_document_relaxNG_validate_file(string filename); */
|
||||
/* {{{ proto boolean dom_document_relaxNG_validate_file(string filename); */
|
||||
PHP_FUNCTION(dom_document_relaxNG_validate_file)
|
||||
{
|
||||
_dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE);
|
||||
}
|
||||
/* }}} end dom_document_relaxNG_validate_file */
|
||||
|
||||
/* {{{ proto boolean domnode dom_document_relaxNG_validate_xml(string source); */
|
||||
/* {{{ proto boolean dom_document_relaxNG_validate_xml(string source); */
|
||||
PHP_FUNCTION(dom_document_relaxNG_validate_xml)
|
||||
{
|
||||
_dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING);
|
||||
@@ -2008,7 +2022,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
}
|
||||
}
|
||||
|
||||
/* {{{ proto boolean domnode dom_document_load_html_file(string source);
|
||||
/* {{{ proto boolean|DOMNode dom_document_load_html_file(string source);
|
||||
Since: DOM extended
|
||||
*/
|
||||
PHP_METHOD(domdocument, loadHTMLFile)
|
||||
@@ -2017,7 +2031,7 @@ PHP_METHOD(domdocument, loadHTMLFile)
|
||||
}
|
||||
/* }}} end dom_document_load_html_file */
|
||||
|
||||
/* {{{ proto boolean domnode dom_document_load_html(string source);
|
||||
/* {{{ proto boolean|DOMNode dom_document_load_html(string source);
|
||||
Since: DOM extended
|
||||
*/
|
||||
PHP_METHOD(domdocument, loadHTML)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domdocumentfragment extends domnode
|
||||
* class DOMDocumentFragment extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-B63ED1A3
|
||||
* Since:
|
||||
@@ -40,7 +40,7 @@ zend_function_entry php_dom_documentfragment_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ proto void DomDocumentFragment::__construct(); */
|
||||
/* {{{ proto void DOMDocumentFragment::__construct(); */
|
||||
PHP_METHOD(domdocumentfragment, __construct)
|
||||
{
|
||||
|
||||
@@ -48,14 +48,19 @@ PHP_METHOD(domdocumentfragment, __construct)
|
||||
xmlNodePtr nodep = NULL, oldnode = NULL;
|
||||
dom_object *intern;
|
||||
|
||||
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) {
|
||||
php_std_error_handling();
|
||||
return;
|
||||
}
|
||||
|
||||
php_std_error_handling();
|
||||
nodep = xmlNewDocFragment(NULL);
|
||||
|
||||
if (!nodep)
|
||||
if (!nodep) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
|
||||
if (intern != NULL) {
|
||||
@@ -63,9 +68,9 @@ PHP_METHOD(domdocumentfragment, __construct)
|
||||
if (oldnode != NULL) {
|
||||
php_libxml_node_free_resource(oldnode TSRMLS_CC);
|
||||
}
|
||||
//php_dom_set_object(intern, nodep TSRMLS_CC);
|
||||
/* php_dom_set_object(intern, nodep TSRMLS_CC); */
|
||||
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} end DomDocumentFragment::__construct */
|
||||
/* }}} end DOMDocumentFragment::__construct */
|
||||
#endif
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "php_dom.h"
|
||||
|
||||
/*
|
||||
* class domdocumenttype extends domnode
|
||||
* class DOMDocumentType extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-412266927
|
||||
* Since:
|
||||
@@ -38,8 +38,6 @@ zend_function_entry php_dom_documenttype_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ attribute protos, not implemented yet */
|
||||
|
||||
/* {{{ proto name string
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1844763134
|
||||
@@ -66,7 +64,7 @@ int dom_documenttype_name_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto entities namednodemap
|
||||
/* {{{ proto entities DOMNamedNodeMap
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1788794630
|
||||
Since:
|
||||
@@ -99,7 +97,7 @@ int dom_documenttype_entities_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto notations namednodemap
|
||||
/* {{{ proto notations DOMNamedNodeMap
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D46829EF
|
||||
Since:
|
||||
@@ -132,7 +130,7 @@ int dom_documenttype_notations_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto public_id string
|
||||
/* {{{ proto publicId string
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-publicId
|
||||
Since: DOM Level 2
|
||||
@@ -162,7 +160,7 @@ int dom_documenttype_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto system_id string
|
||||
/* {{{ proto systemId string
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-systemId
|
||||
Since: DOM Level 2
|
||||
@@ -191,7 +189,7 @@ int dom_documenttype_system_id_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto internal_subset string
|
||||
/* {{{ proto internalSubset string
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-internalSubset
|
||||
Since: DOM Level 2
|
||||
|
||||
+8
-6
@@ -54,6 +54,8 @@ extern zend_function_entry php_dom_xpath_class_functions[];
|
||||
|
||||
/* domexception errors */
|
||||
typedef enum {
|
||||
/* PHP_ERR is non-spec code for PHP errors: */
|
||||
PHP_ERR = 0,
|
||||
INDEX_SIZE_ERR = 1,
|
||||
DOMSTRING_SIZE_ERR = 2,
|
||||
HIERARCHY_REQUEST_ERR = 3,
|
||||
@@ -64,17 +66,17 @@ typedef enum {
|
||||
NOT_FOUND_ERR = 8,
|
||||
NOT_SUPPORTED_ERR = 9,
|
||||
INUSE_ATTRIBUTE_ERR = 10,
|
||||
// Introduced in DOM Level 2:
|
||||
/* Introduced in DOM Level 2: */
|
||||
INVALID_STATE_ERR = 11,
|
||||
// Introduced in DOM Level 2:
|
||||
/* Introduced in DOM Level 2: */
|
||||
SYNTAX_ERR = 12,
|
||||
// Introduced in DOM Level 2:
|
||||
/* Introduced in DOM Level 2: */
|
||||
INVALID_MODIFICATION_ERR = 13,
|
||||
// Introduced in DOM Level 2:
|
||||
/* Introduced in DOM Level 2: */
|
||||
NAMESPACE_ERR = 14,
|
||||
// Introduced in DOM Level 2:
|
||||
/* Introduced in DOM Level 2: */
|
||||
INVALID_ACCESS_ERR = 15,
|
||||
// Introduced in DOM Level 3:
|
||||
/* Introduced in DOM Level 3: */
|
||||
VALIDATION_ERR = 16
|
||||
} dom_exception_code;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domexception
|
||||
* class DOMException
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-17189187
|
||||
* Since:
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "php_dom.h"
|
||||
|
||||
/*
|
||||
* class domimplementation
|
||||
* class DOMImplementation
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-102161490
|
||||
* Since:
|
||||
@@ -42,9 +42,6 @@ zend_function_entry php_dom_domimplementation_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ attribute protos, not implemented yet */
|
||||
|
||||
|
||||
/* {{{ proto boolean dom_domimplementation_has_feature(string feature, string version);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5CED94D7
|
||||
Since:
|
||||
@@ -67,7 +64,7 @@ PHP_METHOD(domimplementation, hasFeature)
|
||||
/* }}} end dom_domimplementation_has_feature */
|
||||
|
||||
|
||||
/* {{{ proto domdocumenttype dom_domimplementation_create_document_type(string qualifiedName, string publicId, string systemId);
|
||||
/* {{{ proto DOMDocumentType dom_domimplementation_create_document_type(string qualifiedName, string publicId, string systemId);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocType
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -121,7 +118,7 @@ PHP_METHOD(domimplementation, createDocumentType)
|
||||
/* }}} end dom_domimplementation_create_document_type */
|
||||
|
||||
|
||||
/* {{{ proto domdocument dom_domimplementation_create_document(string namespaceURI, string qualifiedName, documenttype doctype);
|
||||
/* {{{ proto DOMDocument dom_domimplementation_create_document(string namespaceURI, string qualifiedName, DOMDocumentType doctype);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocument
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -224,7 +221,7 @@ PHP_METHOD(domimplementation, createDocument)
|
||||
/* }}} end dom_domimplementation_create_document */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_domimplementation_get_feature(string feature, string version);
|
||||
/* {{{ proto DOMNode dom_domimplementation_get_feature(string feature, string version);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementation3-getFeature
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
|
||||
+38
-24
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domelement extends domnode
|
||||
* class DOMElement extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-745549614
|
||||
* Since:
|
||||
@@ -58,7 +58,7 @@ zend_function_entry php_dom_element_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ proto void DomElement::__construct(string name, [string value]); */
|
||||
/* {{{ proto void DOMElement::__construct(string name, [string value], [string uri]); */
|
||||
PHP_METHOD(domelement, __construct)
|
||||
{
|
||||
|
||||
@@ -68,15 +68,19 @@ PHP_METHOD(domelement, __construct)
|
||||
char *name, *value = NULL, *uri = NULL;
|
||||
char *localname = NULL, *prefix = NULL;
|
||||
int errorcode = 0, uri_len = 0;
|
||||
int name_len, value_len = 0;
|
||||
int name_len, value_len = 0, name_valid;
|
||||
xmlNsPtr nsptr = NULL;
|
||||
|
||||
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) {
|
||||
php_std_error_handling();
|
||||
return;
|
||||
}
|
||||
|
||||
if (name_len == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Element name is required");
|
||||
php_std_error_handling();
|
||||
name_valid = xmlValidateName((xmlChar *) name, 0);
|
||||
if (name_valid != 0) {
|
||||
php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -98,15 +102,25 @@ PHP_METHOD(domelement, __construct)
|
||||
if (nodep != NULL) {
|
||||
xmlFree(nodep);
|
||||
}
|
||||
php_dom_throw_error(errorcode, 0 TSRMLS_CC);
|
||||
php_dom_throw_error(errorcode, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
/* If you don't pass a namespace uri, then you can't set a prefix */
|
||||
localname = xmlSplitQName2(name, (xmlChar **) &prefix);
|
||||
if (prefix != NULL) {
|
||||
xmlFree(localname);
|
||||
xmlFree(prefix);
|
||||
php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
nodep = xmlNewNode(NULL, (xmlChar *) name);
|
||||
}
|
||||
|
||||
if (!nodep)
|
||||
if (!nodep) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (value_len > 0) {
|
||||
xmlNodeSetContentLen(nodep, value, value_len);
|
||||
@@ -121,7 +135,7 @@ PHP_METHOD(domelement, __construct)
|
||||
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} end DomElement::__construct */
|
||||
/* }}} end DOMElement::__construct */
|
||||
|
||||
/* {{{ proto tagName string
|
||||
readonly=yes
|
||||
@@ -176,7 +190,7 @@ int dom_element_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto domstring dom_element_get_attribute(string name);
|
||||
/* {{{ proto string dom_element_get_attribute(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-666EE0F9
|
||||
Since:
|
||||
*/
|
||||
@@ -205,7 +219,7 @@ PHP_FUNCTION(dom_element_get_attribute)
|
||||
/* }}} end dom_element_get_attribute */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_element_set_attribute(string name, string value);
|
||||
/* {{{ proto void dom_element_set_attribute(string name, string value);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68F082
|
||||
Since:
|
||||
*/
|
||||
@@ -251,7 +265,7 @@ PHP_FUNCTION(dom_element_set_attribute)
|
||||
/* }}} end dom_element_set_attribute */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_element_remove_attribute(string name);
|
||||
/* {{{ proto void dom_element_remove_attribute(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D6AC0F9
|
||||
Since:
|
||||
*/
|
||||
@@ -294,7 +308,7 @@ PHP_FUNCTION(dom_element_remove_attribute)
|
||||
/* }}} end dom_element_remove_attribute */
|
||||
|
||||
|
||||
/* {{{ proto domattr dom_element_get_attribute_node(string name);
|
||||
/* {{{ proto DOMAttr dom_element_get_attribute_node(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-217A91B8
|
||||
Since:
|
||||
*/
|
||||
@@ -323,7 +337,7 @@ PHP_FUNCTION(dom_element_get_attribute_node)
|
||||
/* }}} end dom_element_get_attribute_node */
|
||||
|
||||
|
||||
/* {{{ proto domattr dom_element_set_attribute_node(attr newAttr);
|
||||
/* {{{ proto DOMAttr dom_element_set_attribute_node(DOMAttr newAttr);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-887236154
|
||||
Since:
|
||||
*/
|
||||
@@ -381,7 +395,7 @@ PHP_FUNCTION(dom_element_set_attribute_node)
|
||||
/* }}} end dom_element_set_attribute_node */
|
||||
|
||||
|
||||
/* {{{ proto domattr dom_element_remove_attribute_node(attr oldAttr);
|
||||
/* {{{ proto DOMAttr dom_element_remove_attribute_node(DOMAttr oldAttr);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D589198
|
||||
Since:
|
||||
*/
|
||||
@@ -419,7 +433,7 @@ PHP_FUNCTION(dom_element_remove_attribute_node)
|
||||
/* }}} end dom_element_remove_attribute_node */
|
||||
|
||||
|
||||
/* {{{ proto domnodelist dom_element_get_elements_by_tag_name(string name);
|
||||
/* {{{ proto DOMNodeList dom_element_get_elements_by_tag_name(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1938918D
|
||||
Since:
|
||||
*/
|
||||
@@ -446,7 +460,7 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name)
|
||||
/* }}} end dom_element_get_elements_by_tag_name */
|
||||
|
||||
|
||||
/* {{{ proto domstring dom_element_get_attribute_ns(string namespaceURI, string localName);
|
||||
/* {{{ proto string dom_element_get_attribute_ns(string namespaceURI, string localName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAttrNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -487,7 +501,7 @@ PHP_FUNCTION(dom_element_get_attribute_ns)
|
||||
/* }}} end dom_element_get_attribute_ns */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_element_set_attribute_ns(string namespaceURI, string qualifiedName, string value);
|
||||
/* {{{ proto void dom_element_set_attribute_ns(string namespaceURI, string qualifiedName, string value);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAttrNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -585,7 +599,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
|
||||
/* }}} end dom_element_set_attribute_ns */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_element_remove_attribute_ns(string namespaceURI, string localName);
|
||||
/* {{{ proto void dom_element_remove_attribute_ns(string namespaceURI, string localName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElRemAtNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -643,7 +657,7 @@ PHP_FUNCTION(dom_element_remove_attribute_ns)
|
||||
/* }}} end dom_element_remove_attribute_ns */
|
||||
|
||||
|
||||
/* {{{ proto domattr dom_element_get_attribute_node_ns(string namespaceURI, string localName);
|
||||
/* {{{ proto DOMAttr dom_element_get_attribute_node_ns(string namespaceURI, string localName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAtNodeNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -674,7 +688,7 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
|
||||
/* }}} end dom_element_get_attribute_node_ns */
|
||||
|
||||
|
||||
/* {{{ proto domattr dom_element_set_attribute_node_ns(attr newAttr);
|
||||
/* {{{ proto DOMAttr dom_element_set_attribute_node_ns(DOMAttr newAttr);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAtNodeNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -740,7 +754,7 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto domnodelist dom_element_get_elements_by_tag_name_ns(string namespaceURI, string localName);
|
||||
/* {{{ proto DOMNodeList dom_element_get_elements_by_tag_name_ns(string namespaceURI, string localName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C90942
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -836,7 +850,7 @@ PHP_FUNCTION(dom_element_has_attribute_ns)
|
||||
/* }}} end dom_element_has_attribute_ns */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_element_set_id_attribute(string name, boolean isId);
|
||||
/* {{{ proto void dom_element_set_id_attribute(string name, boolean isId);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttr
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -847,7 +861,7 @@ PHP_FUNCTION(dom_element_set_id_attribute)
|
||||
/* }}} end dom_element_set_id_attribute */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_element_set_id_attribute_ns(string namespaceURI, string localName, boolean isId);
|
||||
/* {{{ proto void dom_element_set_id_attribute_ns(string namespaceURI, string localName, boolean isId);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNS
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -858,7 +872,7 @@ PHP_FUNCTION(dom_element_set_id_attribute_ns)
|
||||
/* }}} end dom_element_set_id_attribute_ns */
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_element_set_id_attribute_node(attr idAttr, boolean isId);
|
||||
/* {{{ proto void dom_element_set_id_attribute_node(attr idAttr, boolean isId);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNode
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
|
||||
+5
-7
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domentity extends domnode
|
||||
* class DOMEntity extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-527DCFF2
|
||||
* Since:
|
||||
@@ -39,9 +39,7 @@ zend_function_entry php_dom_entity_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ attribute protos, not implemented yet */
|
||||
|
||||
/* {{{ proto public_id string
|
||||
/* {{{ proto publicId string
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7303025
|
||||
Since:
|
||||
@@ -71,7 +69,7 @@ int dom_entity_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto system_id string
|
||||
/* {{{ proto systemId string
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7C29F3E
|
||||
Since:
|
||||
@@ -101,7 +99,7 @@ int dom_entity_system_id_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto notation_name string
|
||||
/* {{{ proto notationName string
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-6ABAEB38
|
||||
Since:
|
||||
@@ -134,7 +132,7 @@ int dom_entity_notation_name_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto actual_encoding string
|
||||
/* {{{ proto actualEncoding string
|
||||
readonly=no
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-actualEncoding
|
||||
Since: DOM Level 3
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domentityreference extends domnode
|
||||
* class DOMEntityReference extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-11C98490
|
||||
* Since:
|
||||
@@ -40,7 +40,7 @@ zend_function_entry php_dom_entityreference_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ proto void DomEntityReference::__construct(string name); */
|
||||
/* {{{ proto void DOMEntityReference::__construct(string name); */
|
||||
PHP_METHOD(domentityreference, __construct)
|
||||
{
|
||||
zval *id;
|
||||
@@ -48,21 +48,28 @@ PHP_METHOD(domentityreference, __construct)
|
||||
xmlNodePtr oldnode = NULL;
|
||||
dom_object *intern;
|
||||
char *name;
|
||||
int name_len;
|
||||
int name_len, name_valid;
|
||||
|
||||
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) {
|
||||
php_std_error_handling();
|
||||
return;
|
||||
}
|
||||
|
||||
if (name_len == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Entity Reference name is required");
|
||||
php_std_error_handling();
|
||||
|
||||
name_valid = xmlValidateName((xmlChar *) name, 0);
|
||||
if (name_valid != 0) {
|
||||
php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
node = xmlNewReference(NULL, name);
|
||||
|
||||
if (!node)
|
||||
if (!node) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
|
||||
if (intern != NULL) {
|
||||
@@ -74,5 +81,5 @@ PHP_METHOD(domentityreference, __construct)
|
||||
}
|
||||
}
|
||||
|
||||
/* }}} end DomEntityReference::__construct */
|
||||
/* }}} end DOMEntityReference::__construct */
|
||||
#endif
|
||||
+9
-11
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domnamednodemap
|
||||
* class DOMNamedNodeMap
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1780488922
|
||||
* Since:
|
||||
@@ -46,9 +46,7 @@ zend_function_entry php_dom_namednodemap_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ attribute protos, not implemented yet */
|
||||
|
||||
/* {{{ proto length unsigned long
|
||||
/* {{{ proto length int
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D0FB19E
|
||||
Since:
|
||||
@@ -90,7 +88,7 @@ int dom_namednodemap_length_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_namednodemap_get_named_item(string name);
|
||||
/* {{{ proto DOMNode dom_namednodemap_get_named_item(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1074577549
|
||||
Since:
|
||||
*/
|
||||
@@ -140,7 +138,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
|
||||
/* }}} end dom_namednodemap_get_named_item */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_namednodemap_set_named_item(node arg);
|
||||
/* {{{ proto DOMNode dom_namednodemap_set_named_item(DOMNode arg);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1025163788
|
||||
Since:
|
||||
*/
|
||||
@@ -151,7 +149,7 @@ PHP_FUNCTION(dom_namednodemap_set_named_item)
|
||||
/* }}} end dom_namednodemap_set_named_item */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_namednodemap_remove_named_item(string name);
|
||||
/* {{{ proto DOMNode dom_namednodemap_remove_named_item(string name);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D58B193
|
||||
Since:
|
||||
*/
|
||||
@@ -162,7 +160,7 @@ PHP_FUNCTION(dom_namednodemap_remove_named_item)
|
||||
/* }}} end dom_namednodemap_remove_named_item */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_namednodemap_item(unsigned long index);
|
||||
/* {{{ proto DOMNode dom_namednodemap_item(int index);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-349467F9
|
||||
Since:
|
||||
*/
|
||||
@@ -217,7 +215,7 @@ PHP_FUNCTION(dom_namednodemap_item)
|
||||
/* }}} end dom_namednodemap_item */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_namednodemap_get_named_item_ns(string namespaceURI, string localName);
|
||||
/* {{{ proto DOMNode dom_namednodemap_get_named_item_ns(string namespaceURI, string localName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getNamedItemNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -267,7 +265,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
|
||||
/* }}} end dom_namednodemap_get_named_item_ns */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_namednodemap_set_named_item_ns(node arg);
|
||||
/* {{{ proto DOMNode dom_namednodemap_set_named_item_ns(DOMNode arg);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-setNamedItemNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
@@ -278,7 +276,7 @@ PHP_FUNCTION(dom_namednodemap_set_named_item_ns)
|
||||
/* }}} end dom_namednodemap_set_named_item_ns */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName);
|
||||
/* {{{ proto DOMNode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-removeNamedItemNS
|
||||
Since: DOM Level 2
|
||||
*/
|
||||
|
||||
+4
-6
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domnamelist
|
||||
* class DOMNameList
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList
|
||||
* Since: DOM Level 3
|
||||
@@ -41,9 +41,7 @@ zend_function_entry php_dom_namelist_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ attribute protos, not implemented yet */
|
||||
|
||||
/* {{{ proto length unsigned long
|
||||
/* {{{ proto length int
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-length
|
||||
Since:
|
||||
@@ -60,7 +58,7 @@ int dom_namelist_length_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto domstring dom_namelist_get_name(unsigned long index);
|
||||
/* {{{ proto string dom_namelist_get_name(int index);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getName
|
||||
Since:
|
||||
*/
|
||||
@@ -71,7 +69,7 @@ PHP_FUNCTION(dom_namelist_get_name)
|
||||
/* }}} end dom_namelist_get_name */
|
||||
|
||||
|
||||
/* {{{ proto domstring dom_namelist_get_namespace_uri(unsigned long index);
|
||||
/* {{{ proto string dom_namelist_get_namespace_uri(int index);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getNamespaceURI
|
||||
Since:
|
||||
*/
|
||||
|
||||
+172
-89
@@ -28,7 +28,7 @@
|
||||
#include "php_dom.h"
|
||||
|
||||
/*
|
||||
* class domnode
|
||||
* class DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1950641247
|
||||
* Since:
|
||||
@@ -260,7 +260,7 @@ int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto nodeType unsigned short
|
||||
/* {{{ proto nodeType int
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-111237558
|
||||
Since:
|
||||
@@ -292,7 +292,7 @@ int dom_node_node_type_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto parentNode node
|
||||
/* {{{ proto parentNode DomNode
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1060184317
|
||||
Since:
|
||||
@@ -327,7 +327,7 @@ int dom_node_parent_node_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto childNodes nodelist
|
||||
/* {{{ proto childNodes DomNodeList
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1451460987
|
||||
Since:
|
||||
@@ -361,7 +361,7 @@ int dom_node_child_nodes_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto firstChild node
|
||||
/* {{{ proto firstChild DomNode
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-169727388
|
||||
Since:
|
||||
@@ -399,7 +399,7 @@ int dom_node_first_child_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto lastChild node
|
||||
/* {{{ proto lastChild DomNode
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-61AD09FB
|
||||
Since:
|
||||
@@ -437,7 +437,7 @@ int dom_node_last_child_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto previousSibling node
|
||||
/* {{{ proto previousSibling DomNode
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-640FB3C8
|
||||
Since:
|
||||
@@ -472,7 +472,7 @@ int dom_node_previous_sibling_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto nextSibling node
|
||||
/* {{{ proto nextSibling DomNode
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6AC54C2F
|
||||
Since:
|
||||
@@ -507,7 +507,7 @@ int dom_node_next_sibling_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto attributes namednodemap
|
||||
/* {{{ proto attributes DomNamedNodeMap
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-84CF096
|
||||
Since:
|
||||
@@ -541,7 +541,7 @@ int dom_node_attributes_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto ownerDocument dom_document
|
||||
/* {{{ proto ownerDocument DomDocument
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-node-ownerDoc
|
||||
Since:
|
||||
@@ -858,7 +858,7 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_node_insert_before(node newChild, node refChild);
|
||||
/* {{{ proto domnode dom_node_insert_before(DomNode newChild, DomNode refChild);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-952280727
|
||||
Since:
|
||||
*/
|
||||
@@ -874,6 +874,11 @@ PHP_FUNCTION(dom_node_insert_before)
|
||||
}
|
||||
|
||||
DOM_GET_OBJ(parentp, id, xmlNodePtr, intern);
|
||||
|
||||
if (dom_node_children_valid(parentp) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
DOM_GET_OBJ(child, node, xmlNodePtr, childobj);
|
||||
|
||||
new_child = NULL;
|
||||
@@ -896,6 +901,11 @@ PHP_FUNCTION(dom_node_insert_before)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (child->doc == NULL && parentp->doc != NULL) {
|
||||
childobj->document = intern->document;
|
||||
php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
|
||||
@@ -912,25 +922,25 @@ PHP_FUNCTION(dom_node_insert_before)
|
||||
xmlUnlinkNode(child);
|
||||
}
|
||||
|
||||
if (child->type == XML_TEXT_NODE) {
|
||||
if (refp->type == XML_TEXT_NODE) {
|
||||
xmlChar *tmp;
|
||||
if (child->type == XML_TEXT_NODE && (refp->type == XML_TEXT_NODE ||
|
||||
(refp->prev != NULL && refp->prev->type == XML_TEXT_NODE))) {
|
||||
if (child->doc == NULL) {
|
||||
xmlSetTreeDoc(child, parentp->doc);
|
||||
}
|
||||
new_child = child;
|
||||
new_child->parent = refp->parent;
|
||||
new_child->next = refp;
|
||||
new_child->prev = refp->prev;
|
||||
refp->prev = new_child;
|
||||
if (new_child->prev != NULL) {
|
||||
new_child->prev->next = new_child;
|
||||
}
|
||||
if (new_child->parent != NULL) {
|
||||
if (new_child->parent->children == refp) {
|
||||
new_child->parent->children = new_child;
|
||||
}
|
||||
}
|
||||
|
||||
tmp = xmlStrdup(child->content);
|
||||
tmp = xmlStrcat(tmp, refp->content);
|
||||
xmlNodeSetContent(refp, tmp);
|
||||
xmlFree(tmp);
|
||||
php_libxml_node_free_resource(child TSRMLS_CC);
|
||||
DOM_RET_OBJ(rv, refp, &ret, intern);
|
||||
return;
|
||||
}
|
||||
if ((refp->prev != NULL) && (refp->prev->type == XML_TEXT_NODE)
|
||||
&& (refp->name == refp->prev->name)) {
|
||||
xmlNodeAddContent(refp->prev, child->content);
|
||||
php_libxml_node_free_resource(child TSRMLS_CC);
|
||||
DOM_RET_OBJ(rv, refp->prev, &ret, intern);
|
||||
return;
|
||||
}
|
||||
} else if (child->type == XML_ATTRIBUTE_NODE) {
|
||||
xmlAttrPtr lastattr;
|
||||
|
||||
@@ -947,29 +957,56 @@ PHP_FUNCTION(dom_node_insert_before)
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
|
||||
xmlNodePtr fragment;
|
||||
|
||||
fragment = child;
|
||||
new_child = child->children;
|
||||
child = new_child;
|
||||
while (child->next != NULL) {
|
||||
child->parent = parentp;
|
||||
if (child->doc != parentp->doc) {
|
||||
xmlSetTreeDoc(child, parentp->doc);
|
||||
}
|
||||
child = child->next;
|
||||
}
|
||||
child->parent = parentp;
|
||||
if (child->doc != parentp->doc) {
|
||||
xmlSetTreeDoc(child, parentp->doc);
|
||||
}
|
||||
|
||||
if (refp->prev != NULL) {
|
||||
refp->prev->next = new_child;
|
||||
} else {
|
||||
parentp->children = new_child;
|
||||
}
|
||||
new_child->prev = refp->prev;
|
||||
refp->prev = child;
|
||||
child->next = refp;
|
||||
fragment->children = NULL;
|
||||
}
|
||||
|
||||
if (new_child == NULL) {
|
||||
new_child = xmlAddPrevSibling(refp, child);
|
||||
}
|
||||
new_child = xmlAddPrevSibling(refp, child);
|
||||
} else {
|
||||
if (child->parent == parentp){
|
||||
xmlUnlinkNode(child);
|
||||
}
|
||||
if (child->type == XML_TEXT_NODE) {
|
||||
if ((parentp->type == XML_TEXT_NODE) &&
|
||||
(parentp->content != NULL) &&
|
||||
(parentp != child)) {
|
||||
xmlNodeAddContent(parentp, child->content);
|
||||
php_libxml_node_free_resource(child TSRMLS_CC);
|
||||
DOM_RET_OBJ(rv, parentp, &ret, intern);
|
||||
return;
|
||||
if (child->type == XML_TEXT_NODE && parentp->last != NULL && parentp->last->type == XML_TEXT_NODE) {
|
||||
child->parent = parentp;
|
||||
if (child->doc == NULL) {
|
||||
xmlSetTreeDoc(child, parentp->doc);
|
||||
}
|
||||
if ((parentp->last != NULL) && (parentp->last->type == XML_TEXT_NODE) &&
|
||||
(parentp->last->name == child->name) &&
|
||||
(parentp->last != child)) {
|
||||
xmlNodeAddContent(parentp->last, child->content);
|
||||
php_libxml_node_free_resource(child TSRMLS_CC);
|
||||
DOM_RET_OBJ(rv, parentp->last, &ret, intern);
|
||||
return;
|
||||
new_child = child;
|
||||
if (parentp->children == NULL) {
|
||||
parentp->children = child;
|
||||
parentp->last = child;
|
||||
} else {
|
||||
child = parentp->last;
|
||||
child->next = new_child;
|
||||
new_child->prev = child;
|
||||
parentp->last = new_child;
|
||||
}
|
||||
} else if (child->type == XML_ATTRIBUTE_NODE) {
|
||||
xmlAttrPtr lastattr;
|
||||
@@ -987,15 +1024,37 @@ PHP_FUNCTION(dom_node_insert_before)
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
|
||||
new_child = xmlAddChildList(parentp, child->children);
|
||||
if (new_child != NULL) {
|
||||
child->children = NULL;
|
||||
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
|
||||
xmlNodePtr fragment;
|
||||
|
||||
fragment = child;
|
||||
|
||||
new_child = child->children;
|
||||
if (parentp->children == NULL) {
|
||||
parentp->children = new_child;
|
||||
} else {
|
||||
child = parentp->last;
|
||||
child->next = new_child;
|
||||
new_child->prev = child;
|
||||
}
|
||||
DOM_RET_OBJ(rv, new_child, &ret, intern);
|
||||
return;
|
||||
child = new_child;
|
||||
while (child->next != NULL) {
|
||||
child->parent = parentp;
|
||||
if (child->doc != parentp->doc) {
|
||||
xmlSetTreeDoc(child, parentp->doc);
|
||||
}
|
||||
child = child->next;
|
||||
}
|
||||
child->parent = parentp;
|
||||
if (child->doc != parentp->doc) {
|
||||
xmlSetTreeDoc(child, parentp->doc);
|
||||
}
|
||||
parentp->last = child;
|
||||
fragment->children = NULL;
|
||||
}
|
||||
if (new_child == NULL) {
|
||||
new_child = xmlAddChild(parentp, child);
|
||||
}
|
||||
new_child = xmlAddChild(parentp, child);
|
||||
}
|
||||
|
||||
if (NULL == new_child) {
|
||||
@@ -1011,7 +1070,7 @@ PHP_FUNCTION(dom_node_insert_before)
|
||||
/* }}} end dom_node_insert_before */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_node_replace_child(node newChild, node oldChild);
|
||||
/* {{{ proto DomNode dom_node_replace_child(DomNode newChild, DomNode oldChild);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-785887307
|
||||
Since:
|
||||
*/
|
||||
@@ -1092,7 +1151,7 @@ PHP_FUNCTION(dom_node_replace_child)
|
||||
/* }}} end dom_node_replace_child */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_node_remove_child(node oldChild);
|
||||
/* {{{ proto DomNode dom_node_remove_child(DomNode oldChild);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1734834066
|
||||
Since:
|
||||
*/
|
||||
@@ -1145,7 +1204,7 @@ PHP_FUNCTION(dom_node_remove_child)
|
||||
/* }}} end dom_node_remove_child */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_node_append_child(node newChild);
|
||||
/* {{{ proto DomNode dom_node_append_child(DomNode newChild);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-184E7107
|
||||
Since:
|
||||
*/
|
||||
@@ -1186,6 +1245,11 @@ PHP_FUNCTION(dom_node_append_child)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (child->doc == NULL && nodep->doc != NULL) {
|
||||
childobj->document = intern->document;
|
||||
php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
|
||||
@@ -1195,20 +1259,20 @@ PHP_FUNCTION(dom_node_append_child)
|
||||
xmlUnlinkNode(child);
|
||||
}
|
||||
|
||||
if (child->type == XML_TEXT_NODE) {
|
||||
if ((nodep->type == XML_TEXT_NODE) &&
|
||||
(nodep->content != NULL)) {
|
||||
xmlNodeAddContent(nodep, child->content);
|
||||
php_libxml_node_free_resource(child TSRMLS_CC);
|
||||
DOM_RET_OBJ(rv, nodep, &ret, intern);
|
||||
return;
|
||||
if (child->type == XML_TEXT_NODE && nodep->last != NULL && nodep->last->type == XML_TEXT_NODE) {
|
||||
child->parent = nodep;
|
||||
if (child->doc == NULL) {
|
||||
xmlSetTreeDoc(child, nodep->doc);
|
||||
}
|
||||
if ((nodep->last != NULL) && (nodep->last->type == XML_TEXT_NODE) &&
|
||||
(nodep->last->name == child->name)) {
|
||||
xmlNodeAddContent(nodep->last, child->content);
|
||||
php_libxml_node_free_resource(child TSRMLS_CC);
|
||||
DOM_RET_OBJ(rv, nodep->last, &ret, intern);
|
||||
return;
|
||||
new_child = child;
|
||||
if (nodep->children == NULL) {
|
||||
nodep->children = child;
|
||||
nodep->last = child;
|
||||
} else {
|
||||
child = nodep->last;
|
||||
child->next = new_child;
|
||||
new_child->prev = child;
|
||||
nodep->last = new_child;
|
||||
}
|
||||
} else if (child->type == XML_ATTRIBUTE_NODE) {
|
||||
xmlAttrPtr lastattr;
|
||||
@@ -1223,20 +1287,40 @@ PHP_FUNCTION(dom_node_append_child)
|
||||
php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
|
||||
new_child = xmlAddChildList(nodep, child->children);
|
||||
if (new_child != NULL) {
|
||||
child->children = NULL;
|
||||
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
|
||||
xmlNodePtr fragment;
|
||||
|
||||
fragment = child;
|
||||
new_child = child->children;
|
||||
if (nodep->children == NULL) {
|
||||
nodep->children = new_child;
|
||||
} else {
|
||||
child = nodep->last;
|
||||
child->next = new_child;
|
||||
new_child->prev = child;
|
||||
}
|
||||
DOM_RET_OBJ(rv, new_child, &ret, intern);
|
||||
return;
|
||||
child = new_child;
|
||||
while (child->next != NULL) {
|
||||
child->parent = nodep;
|
||||
if (child->doc != nodep->doc) {
|
||||
xmlSetTreeDoc(child, nodep->doc);
|
||||
}
|
||||
child = child->next;
|
||||
}
|
||||
child->parent = nodep;
|
||||
if (child->doc != nodep->doc) {
|
||||
xmlSetTreeDoc(child, nodep->doc);
|
||||
}
|
||||
nodep->last = child;
|
||||
fragment->children = NULL;
|
||||
}
|
||||
|
||||
new_child = xmlAddChild(nodep, child);
|
||||
|
||||
if (new_child == NULL) {
|
||||
php_error(E_WARNING, "Couldn't append node");
|
||||
RETURN_FALSE;
|
||||
new_child = xmlAddChild(nodep, child);
|
||||
if (new_child == NULL) {
|
||||
php_error(E_WARNING, "Couldn't append node");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
dom_reconcile_ns(nodep->doc, new_child);
|
||||
@@ -1275,7 +1359,7 @@ PHP_FUNCTION(dom_node_has_child_nodes)
|
||||
/* }}} end dom_node_has_child_nodes */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_node_clone_node(boolean deep);
|
||||
/* {{{ proto DomNode dom_node_clone_node(boolean deep);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3A0ED0A4
|
||||
Since:
|
||||
*/
|
||||
@@ -1339,7 +1423,7 @@ PHP_FUNCTION(dom_node_clone_node)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto dom_void dom_node_normalize();
|
||||
/* {{{ proto void dom_node_normalize();
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-normalize
|
||||
Since:
|
||||
*/
|
||||
@@ -1411,8 +1495,7 @@ PHP_FUNCTION(dom_node_has_attributes)
|
||||
}
|
||||
/* }}} end dom_node_has_attributes */
|
||||
|
||||
|
||||
/* {{{ proto unsigned short dom_node_compare_document_position(node other);
|
||||
/* {{{ proto short dom_node_compare_document_position(DomNode other);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-compareDocumentPosition
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1423,7 +1506,7 @@ PHP_FUNCTION(dom_node_compare_document_position)
|
||||
/* }}} end dom_node_compare_document_position */
|
||||
|
||||
|
||||
/* {{{ proto boolean dom_node_is_same_node(node other);
|
||||
/* {{{ proto boolean dom_node_is_same_node(DomNode other);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isSameNode
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1450,7 +1533,7 @@ PHP_FUNCTION(dom_node_is_same_node)
|
||||
/* }}} end dom_node_is_same_node */
|
||||
|
||||
|
||||
/* {{{ proto domstring dom_node_lookup_prefix(string namespaceURI);
|
||||
/* {{{ proto string dom_node_lookup_prefix(string namespaceURI);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-lookupNamespacePrefix
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1532,7 +1615,7 @@ PHP_FUNCTION(dom_node_is_default_namespace)
|
||||
/* }}} end dom_node_is_default_namespace */
|
||||
|
||||
|
||||
/* {{{ proto domstring dom_node_lookup_namespace_uri(string prefix);
|
||||
/* {{{ proto string dom_node_lookup_namespace_uri(string prefix);
|
||||
URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1563,7 +1646,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
|
||||
/* }}} end dom_node_lookup_namespace_uri */
|
||||
|
||||
|
||||
/* {{{ proto boolean dom_node_is_equal_node(node arg);
|
||||
/* {{{ proto boolean dom_node_is_equal_node(DomNode arg);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isEqualNode
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1574,7 +1657,7 @@ PHP_FUNCTION(dom_node_is_equal_node)
|
||||
/* }}} end dom_node_is_equal_node */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_node_get_feature(string feature, string version);
|
||||
/* {{{ proto DomNode dom_node_get_feature(string feature, string version);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getFeature
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1585,7 +1668,7 @@ PHP_FUNCTION(dom_node_get_feature)
|
||||
/* }}} end dom_node_get_feature */
|
||||
|
||||
|
||||
/* {{{ proto domuserdata dom_node_set_user_data(string key, domuserdata data, userdatahandler handler);
|
||||
/* {{{ proto DomUserData dom_node_set_user_data(string key, DomUserData data, userdatahandler handler);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-setUserData
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
@@ -1596,7 +1679,7 @@ PHP_FUNCTION(dom_node_set_user_data)
|
||||
/* }}} end dom_node_set_user_data */
|
||||
|
||||
|
||||
/* {{{ proto domuserdata dom_node_get_user_data(string key);
|
||||
/* {{{ proto DomUserData dom_node_get_user_data(string key);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getUserData
|
||||
Since: DOM Level 3
|
||||
*/
|
||||
|
||||
+3
-5
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domnodelist
|
||||
* class DOMNodeList
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-536297177
|
||||
* Since:
|
||||
@@ -40,9 +40,7 @@ zend_function_entry php_dom_nodelist_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ attribute protos, not implemented yet */
|
||||
|
||||
/* {{{ proto length unsigned long
|
||||
/* {{{ proto length int
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-203510337
|
||||
Since:
|
||||
@@ -95,7 +93,7 @@ int dom_nodelist_length_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto domnode dom_nodelist_item(unsigned long index);
|
||||
/* {{{ proto DOMNode dom_nodelist_item(int index);
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-844377136
|
||||
Since:
|
||||
*/
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domnotation extends domnode
|
||||
* class DOMNotation extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5431D1B9
|
||||
* Since:
|
||||
@@ -41,7 +41,7 @@ zend_function_entry php_dom_notation_class_functions[] = {
|
||||
|
||||
/* {{{ attribute protos, not implemented yet */
|
||||
|
||||
/* {{{ proto public_id string
|
||||
/* {{{ proto publicId string
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-54F2B4D0
|
||||
Since:
|
||||
@@ -71,7 +71,7 @@ int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
|
||||
|
||||
|
||||
|
||||
/* {{{ proto system_id string
|
||||
/* {{{ proto systemId string
|
||||
readonly=yes
|
||||
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-E8AAB1D0
|
||||
Since:
|
||||
|
||||
+71
-18
@@ -322,6 +322,30 @@ PHP_FUNCTION(dom_import_simplexml)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC)
|
||||
{
|
||||
zend_object_value retval;
|
||||
void *new_object;
|
||||
dom_object *intern;
|
||||
struct _store_object *obj;
|
||||
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
|
||||
|
||||
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
|
||||
|
||||
if (obj->clone == NULL) {
|
||||
zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %s", Z_OBJCE_P(zobject)->name);
|
||||
}
|
||||
|
||||
obj->clone(obj->object, &new_object TSRMLS_CC);
|
||||
|
||||
retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC);
|
||||
intern = (dom_object *) new_object;
|
||||
intern->handle = retval.handle;
|
||||
retval.handlers = Z_OBJ_HT_P(zobject);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static zend_function_entry dom_functions[] = {
|
||||
PHP_FE(dom_import_simplexml, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
@@ -353,7 +377,7 @@ PHP_MINIT_FUNCTION(dom)
|
||||
dom_object_handlers.read_property = dom_read_property;
|
||||
dom_object_handlers.write_property = dom_write_property;
|
||||
dom_object_handlers.get_property_ptr_ptr = NULL;
|
||||
dom_object_handlers.clone_obj = zend_objects_store_clone_obj;
|
||||
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
|
||||
|
||||
zend_hash_init(&classes, 0, NULL, NULL, 1);
|
||||
|
||||
@@ -624,7 +648,8 @@ PHP_MINIT_FUNCTION(dom)
|
||||
REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENUMERATION", XML_ATTRIBUTE_ENUMERATION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NOTATION", XML_ATTRIBUTE_NOTATION, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
/* domException Codes */
|
||||
/* DOMException Codes */
|
||||
REGISTER_LONG_CONSTANT("DOM_PHP_ERR", PHP_ERR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("DOM_INDEX_SIZE_ERR", INDEX_SIZE_ERR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("DOMSTRING_SIZE_ERR", DOMSTRING_SIZE_ERR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("DOM_HIERARCHY_REQUEST_ERR", HIERARCHY_REQUEST_ERR, CONST_CS | CONST_PERSISTENT);
|
||||
@@ -1228,34 +1253,62 @@ void dom_set_old_ns(xmlDoc *doc, xmlNs *ns) {
|
||||
}
|
||||
/* }}} end dom_set_old_ns */
|
||||
|
||||
int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) {
|
||||
int errorcode = 0;
|
||||
/*
|
||||
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS
|
||||
|
||||
if (name_len > 0) {
|
||||
*localname = xmlSplitQName2(qname, (xmlChar **) prefix);
|
||||
if (*localname == NULL) {
|
||||
*localname = xmlStrdup(qname);
|
||||
if (*prefix == NULL && uri_len == 0) {
|
||||
return errorcode;
|
||||
}
|
||||
NAMESPACE_ERR: Raised if
|
||||
|
||||
1. the qualifiedName is a malformed qualified name
|
||||
2. the qualifiedName has a prefix and the namespaceURI is null
|
||||
*/
|
||||
|
||||
/* {{{ int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) */
|
||||
int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) {
|
||||
if (name_len == 0) {
|
||||
return NAMESPACE_ERR;
|
||||
}
|
||||
|
||||
*localname = xmlSplitQName2(qname, (xmlChar **) prefix);
|
||||
if (*localname == NULL) {
|
||||
*localname = xmlStrdup(qname);
|
||||
if (*prefix == NULL && uri_len == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (uri_len == 0 || *localname == NULL || (xmlStrchr(*localname, (xmlChar) ':') != NULL)) {
|
||||
errorcode = NAMESPACE_ERR;
|
||||
}
|
||||
} else {
|
||||
errorcode = NAMESPACE_ERR;
|
||||
}
|
||||
|
||||
return errorcode;
|
||||
/* 1 */
|
||||
if (xmlValidateQName((xmlChar *) qname, 0) != 0) {
|
||||
return NAMESPACE_ERR;
|
||||
}
|
||||
|
||||
/* 2 */
|
||||
if (*prefix != NULL && uri_len == 0) {
|
||||
return NAMESPACE_ERR;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS
|
||||
|
||||
NAMESPACE_ERR: Raised if
|
||||
|
||||
3. the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace" [XML Namespaces]
|
||||
4. the qualifiedName or its prefix is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/"
|
||||
5. the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the qualifiedName nor its prefix is "xmlns".
|
||||
*/
|
||||
|
||||
/* {{{ xmlNsPtr dom_get_ns(xmlNodePtr nodep, char *uri, int *errorcode, char *prefix) */
|
||||
xmlNsPtr dom_get_ns(xmlNodePtr nodep, char *uri, int *errorcode, char *prefix) {
|
||||
xmlNsPtr nsptr = NULL;
|
||||
|
||||
*errorcode = 0;
|
||||
|
||||
if (! (prefix && !strcmp (prefix, "xml") && strcmp(uri, XML_XML_NAMESPACE))) {
|
||||
if (! ((prefix && !strcmp (prefix, "xml" ) && strcmp(uri, XML_XML_NAMESPACE)) ||
|
||||
(prefix && !strcmp (prefix, "xmlns") && strcmp(uri, DOM_XMLNS_NAMESPACE)) ||
|
||||
(prefix && !strcmp(uri, DOM_XMLNS_NAMESPACE) && strcmp (prefix, "xmlns")))) {
|
||||
nsptr = xmlNewNs(nodep, uri, prefix);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* class domprocessinginstruction extends domnode
|
||||
* class DOMProcessingInstruction extends DOMNode
|
||||
*
|
||||
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1004215813
|
||||
* Since:
|
||||
@@ -40,7 +40,7 @@ zend_function_entry php_dom_processinginstruction_class_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
/* {{{ proto void DomProcessingInstruction::__construct(string name, [string value]); */
|
||||
/* {{{ proto void DOMProcessingInstruction::__construct(string name, [string value]); */
|
||||
PHP_METHOD(domprocessinginstruction, __construct)
|
||||
{
|
||||
|
||||
@@ -48,21 +48,28 @@ PHP_METHOD(domprocessinginstruction, __construct)
|
||||
xmlNodePtr nodep = NULL, oldnode = NULL;
|
||||
dom_object *intern;
|
||||
char *name, *value = NULL;
|
||||
int name_len, value_len;
|
||||
int name_len, value_len, name_valid;
|
||||
|
||||
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
|
||||
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
|
||||
php_std_error_handling();
|
||||
return;
|
||||
}
|
||||
|
||||
if (name_len == 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PI name is required");
|
||||
php_std_error_handling();
|
||||
|
||||
name_valid = xmlValidateName((xmlChar *) name, 0);
|
||||
if (name_valid != 0) {
|
||||
php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
nodep = xmlNewPI((xmlChar *) name, (xmlChar *) value);
|
||||
|
||||
if (!nodep)
|
||||
if (!nodep) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
|
||||
if (intern != NULL) {
|
||||
@@ -73,7 +80,7 @@ PHP_METHOD(domprocessinginstruction, __construct)
|
||||
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
/* }}} end DomProcessingInstruction::__construct */
|
||||
/* }}} end DOMProcessingInstruction::__construct */
|
||||
|
||||
/* {{{ proto target string
|
||||
readonly=yes
|
||||
|
||||
Loaded 100 of 752 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user