mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-14 04:30:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3402e4ee84 | ||
|
|
e9887156cf | ||
|
|
0b1b5e3080 | ||
|
|
dee2d85e77 | ||
|
|
48167d2b21 | ||
|
|
dea72ba6a4 | ||
|
|
b3d949852f | ||
|
|
ac0880fd8f | ||
|
|
f3232e99c3 | ||
|
|
84f81c50ba | ||
|
|
57a5bbd387 | ||
|
|
c834cbba59 | ||
|
|
98038f8228 | ||
|
|
1abd99a443 | ||
|
|
9aa38aad45 | ||
|
|
23a96536fa | ||
|
|
f2ddc10685 | ||
|
|
0b7745d713 | ||
|
|
9a0d7a40be | ||
|
|
8fc4200414 | ||
|
|
332b7125de | ||
|
|
be19c812ab | ||
|
|
8716039dec | ||
|
|
83905d9fec | ||
|
|
814639b2fc | ||
|
|
877855a74e | ||
|
|
8759dcc0ce | ||
|
|
a03858c40b | ||
|
|
e9ba352023 | ||
|
|
ab0f48d506 | ||
|
|
a193c9ce3e | ||
|
|
92b3dd06e3 | ||
|
|
046ecab96f | ||
|
|
86f2ad3017 | ||
|
|
bbc37db2f3 | ||
|
|
85d125c22c | ||
|
|
9103cae5e5 | ||
|
|
97bd1845a6 | ||
|
|
09f89187f4 | ||
|
|
d667e05543 | ||
|
|
990a86615d | ||
|
|
f2f5f5a870 | ||
|
|
c99f72d5ea | ||
|
|
683ce541c8 | ||
|
|
6b5441c30f | ||
|
|
b88fc00775 | ||
|
|
996bd9300b | ||
|
|
8520f94796 | ||
|
|
472c1a099b | ||
|
|
a39da32bf0 | ||
|
|
31a5160a0a | ||
|
|
9ece8612b8 | ||
|
|
7292abefc1 | ||
|
|
4b0db9a47b | ||
|
|
348079bc3f | ||
|
|
fb2c23645b | ||
|
|
5ab813e1b6 | ||
|
|
791cda209c | ||
|
|
d84c5a2238 | ||
|
|
f06ee6bdba | ||
|
|
8538f86ac1 | ||
|
|
3dd574bb94 | ||
|
|
b3450c2246 | ||
|
|
47dfaf232f | ||
|
|
6d92ac275d | ||
|
|
5674f1be45 | ||
|
|
de527c2379 | ||
|
|
5bcba1fadf | ||
|
|
da6c94f73b | ||
|
|
cc415d699e | ||
|
|
acc4a8ed6d | ||
|
|
897b701dee | ||
|
|
a1abfb7643 | ||
|
|
94bea2902b | ||
|
|
e97718461b | ||
|
|
3dab84005d | ||
|
|
18f86e7757 | ||
|
|
d37b140601 | ||
|
|
38423a895b | ||
|
|
a648a5c2cc | ||
|
|
641f19c68f | ||
|
|
ff9946b264 | ||
|
|
fe550afba6 | ||
|
|
bf7603cf83 | ||
|
|
cca7178332 | ||
|
|
28c96e89e1 | ||
|
|
b189759bcd | ||
|
|
c26b4d8c9f | ||
|
|
a37b138d7c | ||
|
|
79a898697d | ||
|
|
3f65e03649 | ||
|
|
7482eb6adc | ||
|
|
113b132639 | ||
|
|
82070f1cdf | ||
|
|
eac689a606 | ||
|
|
ba90d5d529 | ||
|
|
4dceb59561 | ||
|
|
5819b6d4a6 | ||
|
|
58294f67d2 | ||
|
|
9ccc11ce50 | ||
|
|
d4b0d7850d | ||
|
|
e597dbd0be | ||
|
|
53535918d0 | ||
|
|
f6c67cec11 | ||
|
|
01927063d5 | ||
|
|
0960b3618f | ||
|
|
27a819c620 | ||
|
|
ef1dea5e1e | ||
|
|
ab8c6ed967 | ||
|
|
3f80efd660 | ||
|
|
2622eba31d | ||
|
|
499507ca0e | ||
|
|
1c4207a1f8 | ||
|
|
c7c8ed155c | ||
|
|
8ef9700499 | ||
|
|
53e1e33045 | ||
|
|
85e2dc34d5 | ||
|
|
1e6ae4496b | ||
|
|
7b5ba2f1fd | ||
|
|
36dc3e1c20 | ||
|
|
974a0ddf65 | ||
|
|
3f72b744e0 | ||
|
|
11c88a0ff5 | ||
|
|
3be464e4ec | ||
|
|
ca1b12c5a1 | ||
|
|
4b89b67d1c | ||
|
|
a68a224efd | ||
|
|
5844b74e22 | ||
|
|
c4fd954b8a | ||
|
|
7fdb466d14 | ||
|
|
23b14d4cfb | ||
|
|
eba5d76078 | ||
|
|
97089c0370 | ||
|
|
aee1a49287 | ||
|
|
e048e34e80 | ||
|
|
56c474cf48 | ||
|
|
7a4e086d7a | ||
|
|
3e0d46d222 | ||
|
|
39752c2ed0 | ||
|
|
045ee57f04 | ||
|
|
7ad1cf5785 | ||
|
|
ee11aabc30 | ||
|
|
b4ac6f4fdd | ||
|
|
9b118c6bb6 | ||
|
|
ec4a36ec12 | ||
|
|
d51fe40c2d | ||
|
|
2e4ab68995 | ||
|
|
3823ad3ec0 | ||
|
|
5bf4e7857d | ||
|
|
1cc3e6b5e6 | ||
|
|
d4cd24c22d | ||
|
|
5b6d752119 | ||
|
|
1e5bf63b6a | ||
|
|
b8dabd3fb8 | ||
|
|
77e7617654 | ||
|
|
58d8ab855f | ||
|
|
abbfbf18bc | ||
|
|
a2f126c351 | ||
|
|
99771d91ce | ||
|
|
7db874096e | ||
|
|
d959c647e2 | ||
|
|
cd151feb19 | ||
|
|
8ef52cabcf | ||
|
|
9ff7f19e32 | ||
|
|
12aca26b5b | ||
|
|
309827ec1d | ||
|
|
59d3eb5f24 | ||
|
|
663666e26a | ||
|
|
0f3ef58fa3 | ||
|
|
9a9e2e72b0 | ||
|
|
0776f7d3d7 | ||
|
|
d9b4f90969 | ||
|
|
71931b05f0 | ||
|
|
09e00183bd | ||
|
|
7b6d8bfc3c | ||
|
|
854c0622f0 | ||
|
|
cfa22547e0 | ||
|
|
16d7cb88fa | ||
|
|
f27f790f29 | ||
|
|
e5bb148d4e | ||
|
|
7aa23d3ca3 | ||
|
|
9c6414d6fa | ||
|
|
cd9ab22f84 | ||
|
|
07e71ce1f1 | ||
|
|
61dc840cdd | ||
|
|
a2dc8a2fa5 | ||
|
|
ceedeb4a7e | ||
|
|
83987c17ac | ||
|
|
d836f5d4c0 | ||
|
|
cc53ad5166 | ||
|
|
dd59d14805 | ||
|
|
c54047b0b0 | ||
|
|
813f7b58d6 | ||
|
|
a7ef1966ac | ||
|
|
95ae21ff1b | ||
|
|
7f86b7224c | ||
|
|
5b0ca1585a | ||
|
|
51498e1d3f | ||
|
|
e07e19f271 | ||
|
|
fd81040420 | ||
|
|
e2efb3cf06 | ||
|
|
c45b1c2c8b | ||
|
|
ade9a02eef | ||
|
|
4208c264d7 | ||
|
|
4b3fb7b05e | ||
|
|
d9d65f18e9 | ||
|
|
2ec043606b | ||
|
|
e986a4b0a3 | ||
|
|
cfa034a07a | ||
|
|
f3f3df734c | ||
|
|
8b23529beb | ||
|
|
b84a1bed0a | ||
|
|
5cec06b1a8 | ||
|
|
1fbc3945a2 | ||
|
|
5918218872 | ||
|
|
08e1c852aa | ||
|
|
27fb7df0d2 | ||
|
|
2158bbfa7f | ||
|
|
e740042363 | ||
|
|
20f43a76ba | ||
|
|
a45553cd57 | ||
|
|
e9d946d374 | ||
|
|
e7b0cd7ad2 | ||
|
|
c4d2d9e14f | ||
|
|
322891a2dd | ||
|
|
618bfebfaf | ||
|
|
17332d6b21 | ||
|
|
15adb9bb42 | ||
|
|
d3ca6394eb | ||
|
|
0e874a094c | ||
|
|
962c163cdf | ||
|
|
5418b59681 | ||
|
|
da3c43182a | ||
|
|
b111463f4c | ||
|
|
28690c3d16 | ||
|
|
856a7b766f | ||
|
|
ce46ccd32b | ||
|
|
c7d31495bf | ||
|
|
a6bb6f5df3 | ||
|
|
409e2e7e98 | ||
|
|
09ac5ed748 | ||
|
|
84908add07 | ||
|
|
119ad66740 | ||
|
|
0f22953a67 | ||
|
|
7c53e635b2 | ||
|
|
63aec84825 | ||
|
|
526d45e95f | ||
|
|
cce70fa84a | ||
|
|
3933ff52a1 | ||
|
|
4ffaf35556 | ||
|
|
f7054b3561 | ||
|
|
5d97102f8f | ||
|
|
6c3d7449e1 | ||
|
|
5286b3971c | ||
|
|
5470222d70 | ||
|
|
34574352be | ||
|
|
b852f3941f | ||
|
|
75d73aaffb | ||
|
|
d23ad61dc3 | ||
|
|
5925071957 | ||
|
|
f6a24fce48 | ||
|
|
44e04f7688 | ||
|
|
e0a5a4813e | ||
|
|
7b892ddf5a | ||
|
|
49cb1d620b | ||
|
|
88b469203c | ||
|
|
aa312ec61c | ||
|
|
e5b4099e43 | ||
|
|
49162267a3 | ||
|
|
f29b5131d3 | ||
|
|
0c1620840f | ||
|
|
71066c12dc | ||
|
|
f5cf7d7eb7 | ||
|
|
b510fcf96e | ||
|
|
4b243ebeeb | ||
|
|
228648397e | ||
|
|
824fc6a084 | ||
|
|
d9e180b9b7 | ||
|
|
f45f6d788f | ||
|
|
95d2ca8a46 | ||
|
|
68611e2d55 | ||
|
|
2e0ae6d25f | ||
|
|
bd616da7ca | ||
|
|
5348058938 | ||
|
|
db1422f10e | ||
|
|
770098eca8 | ||
|
|
6ac728e179 | ||
|
|
1ccac6ed55 | ||
|
|
5abacc5413 | ||
|
|
5ed3e24f47 | ||
|
|
3ab30838d7 | ||
|
|
9559b88894 | ||
|
|
42c5a9dad7 | ||
|
|
d44d114b75 | ||
|
|
43e62ac46e | ||
|
|
7fe41da165 | ||
|
|
e9dd13754b | ||
|
|
585e338e5e | ||
|
|
1d64caac88 | ||
|
|
e8f3025373 | ||
|
|
4237ddadb5 | ||
|
|
e7402d7a50 | ||
|
|
d443fff043 | ||
|
|
a05c35b802 | ||
|
|
bb030e6fa8 | ||
|
|
6ccbc0d37d | ||
|
|
b32ff568e6 | ||
|
|
0b9a78cb1e | ||
|
|
f020f3eaa5 | ||
|
|
1a092713d0 | ||
|
|
98cb18a7d7 | ||
|
|
2d5316a11c | ||
|
|
d993b05a5b | ||
|
|
eba1b6221d | ||
|
|
d8a4a9b1dd | ||
|
|
e6c77fde1d | ||
|
|
04eb5270d6 | ||
|
|
22edfd2b3b | ||
|
|
eb12dfc9e5 | ||
|
|
bc00916346 | ||
|
|
4acff8f37f | ||
|
|
b7ecaacd07 | ||
|
|
242139d5ac | ||
|
|
f802468c2a | ||
|
|
3115a0ccfe | ||
|
|
67f59f7b40 | ||
|
|
6c4cb4c079 | ||
|
|
20fe0a5685 | ||
|
|
971f8b0881 | ||
|
|
7918735b11 | ||
|
|
8d24db9ac0 | ||
|
|
e2cb8ec02c | ||
|
|
3edf46ff73 | ||
|
|
fa6bb59773 | ||
|
|
b409d2f9ea | ||
|
|
75086e3088 | ||
|
|
9a4c654606 | ||
|
|
91c808ecc4 | ||
|
|
d10336ec0e | ||
|
|
522aec4443 | ||
|
|
6426d1c9ce | ||
|
|
24b2feff63 | ||
|
|
df5e0cb0a5 | ||
|
|
4f0842663f | ||
|
|
85f42b7f7a | ||
|
|
9b1aed8323 | ||
|
|
ed8c8539df | ||
|
|
81fb5a7682 | ||
|
|
b0d0a483cc | ||
|
|
51bc85ce5f | ||
|
|
f501979c33 | ||
|
|
f68fb8fad2 | ||
|
|
662c6c6c06 | ||
|
|
0fddc30b7a | ||
|
|
80aa02a197 | ||
|
|
e17614722d | ||
|
|
fe434a05b4 | ||
|
|
204f4adca7 | ||
|
|
f390d7e2ab | ||
|
|
e5d8f20f17 | ||
|
|
677d4b9913 | ||
|
|
51a4b2411d | ||
|
|
b8a95da22a | ||
|
|
180c337885 | ||
|
|
6d32e7e59b | ||
|
|
5669b2dd26 | ||
|
|
4d2515d6be | ||
|
|
89a2e1dbdb | ||
|
|
cb410a2f3c | ||
|
|
5bbddee81e | ||
|
|
4fb5088f89 | ||
|
|
8dad7a5cab | ||
|
|
573fe4346d | ||
|
|
81daa0899e | ||
|
|
0d8812b15c | ||
|
|
57a0fcbe00 | ||
|
|
3f6536d2b8 | ||
|
|
2ffdb3cda4 | ||
|
|
bfa301dfd0 | ||
|
|
ab111470ce | ||
|
|
abdc36cafd | ||
|
|
4eb2481830 | ||
|
|
795083a15c | ||
|
|
dd0ade23cf | ||
|
|
12adebbc3a | ||
|
|
4647bbb71a | ||
|
|
20a6474eae | ||
|
|
eb32144902 | ||
|
|
3c45b97804 | ||
|
|
3fb701add0 | ||
|
|
6f59f8b078 | ||
|
|
81ddcd0b2b | ||
|
|
715774bed7 | ||
|
|
d57e56ab4c | ||
|
|
4a22d2e832 | ||
|
|
24633f5987 | ||
|
|
b83427db64 | ||
|
|
504d44366c | ||
|
|
0fd8685c64 | ||
|
|
be83e732af | ||
|
|
4a7f22123f | ||
|
|
951eb9079c | ||
|
|
a58406c030 | ||
|
|
6d53c16775 | ||
|
|
fd3a436bd3 | ||
|
|
89e6de2308 | ||
|
|
9a2726e208 | ||
|
|
efdd39207c | ||
|
|
ade2c31625 | ||
|
|
9f86ff884f | ||
|
|
5dca99232e | ||
|
|
60825fab88 | ||
|
|
95d92b8be0 | ||
|
|
388170ffa5 | ||
|
|
4396093666 | ||
|
|
b47050630b | ||
|
|
925f7854bb | ||
|
|
ed453cc9b4 | ||
|
|
96128460b7 | ||
|
|
43fefff150 | ||
|
|
6bfed632c7 | ||
|
|
07cfd5754e | ||
|
|
341a0d465a | ||
|
|
85181ac512 | ||
|
|
3ed5b2dadd | ||
|
|
2c051912b3 | ||
|
|
c33ddea610 | ||
|
|
b48b561b97 | ||
|
|
e5394bbafe | ||
|
|
6a5ee2a538 | ||
|
|
e47d4fe249 | ||
|
|
799a00f19a | ||
|
|
4a17400b0a | ||
|
|
f0962c33a1 | ||
|
|
1109b9ab57 | ||
|
|
da19ff78f3 | ||
|
|
03432bf61f | ||
|
|
6c6471b160 | ||
|
|
daf926cf5b | ||
|
|
b378ecda30 | ||
|
|
2183e2b0be | ||
|
|
48f13455be | ||
|
|
7089540ec7 | ||
|
|
ce71143fd0 | ||
|
|
89b77bfb47 | ||
|
|
f34430de8a | ||
|
|
7f8917932f | ||
|
|
ad95450fc4 | ||
|
|
a103b94876 | ||
|
|
c94933b2fa | ||
|
|
bdde2b4303 | ||
|
|
a6aef18606 | ||
|
|
436ca5d9bb | ||
|
|
a666910848 | ||
|
|
6ff7c9afd8 | ||
|
|
459052572f | ||
|
|
299d1295b6 | ||
|
|
cf8e389799 | ||
|
|
77b55ad07d | ||
|
|
570e7e9a13 | ||
|
|
97d509cc95 | ||
|
|
5bc9f72e85 | ||
|
|
8d7faf6c12 | ||
|
|
0240a571c8 | ||
|
|
622b72086b | ||
|
|
5f3d935920 | ||
|
|
a8656beb34 | ||
|
|
d6d8b51b2c | ||
|
|
92cfa27ff0 | ||
|
|
f2b0015c9b | ||
|
|
99a2d5856d | ||
|
|
8d5fe920a5 | ||
|
|
5029ae9fe2 | ||
|
|
2ad0310fd3 | ||
|
|
cd8af6aa44 | ||
|
|
607486391a | ||
|
|
d11012e2c9 | ||
|
|
1b5fff695d | ||
|
|
e065c308e9 | ||
|
|
df273c9d01 | ||
|
|
d60799bf6b | ||
|
|
fd49c6ff05 | ||
|
|
0a004934d4 | ||
|
|
f826cc3bdd | ||
|
|
3d95c23c96 | ||
|
|
7ee05bc6b0 | ||
|
|
27de50012b | ||
|
|
1bb90f5805 | ||
|
|
88979a11c1 | ||
|
|
1b282b3521 | ||
|
|
e8e5c9d97e | ||
|
|
be78a31e2b | ||
|
|
a2ea62d4c9 | ||
|
|
6e849e833f | ||
|
|
ed3c85261b | ||
|
|
6910e92132 | ||
|
|
0bc2bb05d4 | ||
|
|
99af3ed8ef | ||
|
|
a0084d5af9 | ||
|
|
4285af4244 | ||
|
|
0deb623127 | ||
|
|
0b33c074a6 | ||
|
|
74b394640d | ||
|
|
95ee791d97 | ||
|
|
3522012bb2 | ||
|
|
ca5e0330ca | ||
|
|
4a2fa70fc9 | ||
|
|
47f8af85f5 | ||
|
|
0e482b1b30 | ||
|
|
9d62ac18ce | ||
|
|
461f50d50d | ||
|
|
af71ec7915 | ||
|
|
168f1aacef | ||
|
|
694e04bb39 | ||
|
|
7e86b6b305 | ||
|
|
ee222667e3 | ||
|
|
56498d48b4 | ||
|
|
a15887434d | ||
|
|
3a10285392 | ||
|
|
e7f10a41f2 | ||
|
|
e97c8ff013 | ||
|
|
b1d4fcb33c | ||
|
|
1b4d8c0fb6 | ||
|
|
fad9bab629 | ||
|
|
83ba61245c | ||
|
|
4a915571f5 | ||
|
|
9aabb6c08d | ||
|
|
54e911aa4f | ||
|
|
69e2d48738 | ||
|
|
ed50eba46d | ||
|
|
32f6eeb3bd | ||
|
|
8a36eb220e | ||
|
|
5b2719d9b3 | ||
|
|
4c06a45dc5 | ||
|
|
b75610a9f3 | ||
|
|
6e10dc5456 | ||
|
|
fc3acfc4d5 | ||
|
|
0b719aa462 | ||
|
|
e783d75ed3 | ||
|
|
ecbc0255d9 | ||
|
|
827672cd78 | ||
|
|
490de54fb5 | ||
|
|
315f4f5658 | ||
|
|
7eeda99a05 | ||
|
|
390d1cd1b7 | ||
|
|
3f969d0b84 | ||
|
|
626fc9a773 | ||
|
|
ab458219ec | ||
|
|
eea3a56973 | ||
|
|
58abfc5426 | ||
|
|
0b8ca80e57 | ||
|
|
989203cf9c | ||
|
|
1f7b735290 | ||
|
|
39770d99ea | ||
|
|
66dfb8aac1 | ||
|
|
40404d7337 | ||
|
|
bf94671c3c | ||
|
|
c66bc46bb1 | ||
|
|
35a9a1878e | ||
|
|
2eb8688f29 | ||
|
|
b2cecd9d8b | ||
|
|
365edaddd4 | ||
|
|
b79db079a6 | ||
|
|
9d39ada3d0 | ||
|
|
f872296aaf | ||
|
|
280a79a319 | ||
|
|
70ef0577a3 | ||
|
|
d584491ddf | ||
|
|
0435c2e306 | ||
|
|
1192fe545f | ||
|
|
6a8440fb70 | ||
|
|
82d7c4294c | ||
|
|
0e6db7dc82 | ||
|
|
483c99ad73 | ||
|
|
a0b745a053 | ||
|
|
64b8ea5963 | ||
|
|
4f343428d1 | ||
|
|
9893e9316e | ||
|
|
c9b4568f3e | ||
|
|
4a474b8120 | ||
|
|
83d4cbf15e | ||
|
|
4df36948c8 | ||
|
|
c6cd319cd4 | ||
|
|
5905971122 | ||
|
|
ad04898e05 | ||
|
|
c1894bbf96 | ||
|
|
8a1db559b6 | ||
|
|
c708eefcd4 | ||
|
|
e0818297f1 | ||
|
|
f6e38a2e95 | ||
|
|
f1ec9035fc | ||
|
|
681f50bf4e | ||
|
|
03471b21ee | ||
|
|
6cbdaf985f | ||
|
|
b853731aaf | ||
|
|
b224dd96bd | ||
|
|
fbbc249f2b | ||
|
|
51856230d3 | ||
|
|
c542f9a3f4 | ||
|
|
3f97600862 | ||
|
|
b2c2220971 | ||
|
|
04855ca11c | ||
|
|
f08b599821 | ||
|
|
b6f0d041f9 | ||
|
|
681f6d53bb | ||
|
|
d33f42d53f | ||
|
|
7248d68d49 | ||
|
|
c9dfdd38a7 | ||
|
|
d4dd261436 | ||
|
|
9c86c11abf | ||
|
|
d7c43de3ce | ||
|
|
876bac4823 | ||
|
|
693180c1a2 | ||
|
|
a8be2cf641 | ||
|
|
ba4ddf32b4 | ||
|
|
7ca4354c22 | ||
|
|
0181cae318 | ||
|
|
4850e34bf3 | ||
|
|
5875af9372 | ||
|
|
39671d8915 | ||
|
|
9d4081896c | ||
|
|
2ec7ccdf4c | ||
|
|
4694c419cf | ||
|
|
d076f5f2d9 | ||
|
|
8a5ceac253 | ||
|
|
c8eb56cc59 | ||
|
|
a4cf34619d | ||
|
|
4e7ab5ec7b | ||
|
|
0508a61421 | ||
|
|
25b9ee5a74 | ||
|
|
96b221755a | ||
|
|
3cb026db73 | ||
|
|
b28f6eba38 | ||
|
|
2604cb987a | ||
|
|
91944be3f7 | ||
|
|
636c4e81e2 | ||
|
|
4ee0040869 | ||
|
|
bee5b60a22 | ||
|
|
ae49ebf198 | ||
|
|
adfbf4a92f | ||
|
|
1955412c3d | ||
|
|
d89c5b231c | ||
|
|
207814916d | ||
|
|
5d09d7d811 | ||
|
|
69b914e2dd | ||
|
|
3af4ba7e01 | ||
|
|
8ba5d5ef9c | ||
|
|
0222b7ab41 | ||
|
|
60676f19a5 | ||
|
|
d5e9318210 | ||
|
|
381d04e197 | ||
|
|
3c2ec3e5f3 | ||
|
|
b422c552d7 | ||
|
|
d22ebb3cb6 | ||
|
|
000773e7b9 | ||
|
|
3c049ddcdd | ||
|
|
4b1380e31c | ||
|
|
bac08af4cb | ||
|
|
03049aa8ac | ||
|
|
2011db174b | ||
|
|
479a96ed89 | ||
|
|
732f891f3c | ||
|
|
d0e48e92b6 | ||
|
|
3a1b4fda7e | ||
|
|
10247c67fa | ||
|
|
cb3ffd56eb | ||
|
|
7632bca956 | ||
|
|
542d2d623c | ||
|
|
0b686eaa2a | ||
|
|
e4b2f8351e | ||
|
|
c8443dc1b9 | ||
|
|
410ac013e8 | ||
|
|
b43df683ee | ||
|
|
18ded31f4c | ||
|
|
dc2362069e | ||
|
|
4bed072f11 | ||
|
|
02feba6c05 | ||
|
|
6ce467dc13 | ||
|
|
19741cc37a | ||
|
|
8e0ae5d152 | ||
|
|
1bbea8d0eb | ||
|
|
82115ea039 | ||
|
|
99d3b9bfe8 | ||
|
|
6d7cc46e38 | ||
|
|
251b83076e | ||
|
|
849fe880ea | ||
|
|
5ab6783471 | ||
|
|
1d0f45ea6b | ||
|
|
30ccec36b9 | ||
|
|
c799959568 | ||
|
|
892e949196 | ||
|
|
8ef1279f2b | ||
|
|
4d6f3b40a7 | ||
|
|
80d878279b | ||
|
|
45e9e3a9fe | ||
|
|
5a7409ee1a | ||
|
|
50161c9ee8 | ||
|
|
b6978fe1af | ||
|
|
1d68a02df3 | ||
|
|
320105bcd8 | ||
|
|
6358dad0e1 | ||
|
|
c8b8a908ca | ||
|
|
ce0c4a7991 | ||
|
|
d3aeebdd1f | ||
|
|
c86ec8b1a9 | ||
|
|
f75db1e3cb | ||
|
|
67daa655f6 | ||
|
|
42eeda50d4 | ||
|
|
9b9f9fa4dd | ||
|
|
cd599d17c0 | ||
|
|
9e6e64955f | ||
|
|
6aada077a0 | ||
|
|
4ba16a1169 | ||
|
|
1f84023b05 | ||
|
|
e325e06693 | ||
|
|
97c698a178 | ||
|
|
fbdf502307 | ||
|
|
cf8d95b922 | ||
|
|
e103155d92 | ||
|
|
61df257c0f | ||
|
|
705e6f2ec6 | ||
|
|
c2357ccc26 | ||
|
|
cba39bcd9c | ||
|
|
0691afb08c | ||
|
|
48b5c6d900 | ||
|
|
595ca6b588 | ||
|
|
7a45e3cb89 | ||
|
|
f8d74acd93 | ||
|
|
c34f41b7c5 | ||
|
|
79b0a56c51 | ||
|
|
3f4c8e665a | ||
|
|
f112b68668 | ||
|
|
07b5d74022 | ||
|
|
c698e14635 | ||
|
|
90eac6a390 | ||
|
|
0959b16f87 | ||
|
|
0c57780b11 | ||
|
|
53a3f074ab | ||
|
|
c4b2498bae | ||
|
|
ea98567404 | ||
|
|
382dd4a394 | ||
|
|
890ae1e244 | ||
|
|
c80f2bcba2 | ||
|
|
1b8ee02fd6 | ||
|
|
c1ceeaf830 | ||
|
|
867160a751 | ||
|
|
d484ad1d6c | ||
|
|
3aad950735 | ||
|
|
4f96d15f33 | ||
|
|
ba0e3f2145 | ||
|
|
b436f97a53 | ||
|
|
8751bcb8eb | ||
|
|
7c7e5a9081 | ||
|
|
c28eac2f6c | ||
|
|
d93732179b | ||
|
|
1f793fd06c | ||
|
|
56ecc78983 | ||
|
|
056401fa6c | ||
|
|
8a8b5dacc6 | ||
|
|
80612a97eb | ||
|
|
c675a39b73 | ||
|
|
ffad41019e | ||
|
|
41360c24b6 | ||
|
|
9148b4d16b | ||
|
|
9608acbe19 | ||
|
|
e85ba0901a | ||
|
|
81b8e08b13 | ||
|
|
fdd374fddb | ||
|
|
15902929e8 | ||
|
|
ce635bdb3c | ||
|
|
185f6e95d8 | ||
|
|
d06c2d9eb1 | ||
|
|
d06c4b2e3f | ||
|
|
c9dca64075 | ||
|
|
7795aca4ca | ||
|
|
28273dfaa2 | ||
|
|
65bb194d65 | ||
|
|
08c6773691 | ||
|
|
05edda2222 | ||
|
|
92c21585f2 | ||
|
|
f1ed420604 | ||
|
|
636d126e16 | ||
|
|
78dfa91e1f | ||
|
|
61a058f538 | ||
|
|
744dce0da0 | ||
|
|
e46ea8864c | ||
|
|
51fe68fd51 | ||
|
|
159abaa900 | ||
|
|
821042278e | ||
|
|
97c200b170 | ||
|
|
9e750e64b9 | ||
|
|
1a5d90c4ea | ||
|
|
e1a3604103 | ||
|
|
e871d2f036 | ||
|
|
468b509759 | ||
|
|
bba7086ac3 | ||
|
|
6f8f6c521c | ||
|
|
5090b1e8d5 | ||
|
|
93acbedce8 | ||
|
|
20c007b229 | ||
|
|
4992408771 | ||
|
|
caa3b6c9b6 | ||
|
|
4f4e553b6a | ||
|
|
3f158be18a | ||
|
|
2acc8630fe | ||
|
|
85a5e901e8 | ||
|
|
fcb595e4d2 | ||
|
|
04720d3b3b | ||
|
|
bab5db79f6 | ||
|
|
45ab04fa40 | ||
|
|
b78c48f7bc | ||
|
|
a120608807 | ||
|
|
66f9f8bf38 | ||
|
|
17797f951c | ||
|
|
25c8009825 | ||
|
|
2336c0148e | ||
|
|
490de4de57 | ||
|
|
3000566259 | ||
|
|
b47bb87004 | ||
|
|
e5015ed581 | ||
|
|
d6f2f2c396 | ||
|
|
b283eec42a | ||
|
|
23df217463 | ||
|
|
a1adc81f30 | ||
|
|
25240885a5 | ||
|
|
26300a8ebf | ||
|
|
34bee836b1 | ||
|
|
a2cb77aa82 | ||
|
|
5779f26561 | ||
|
|
e67defffbe | ||
|
|
e59bcdbfb8 | ||
|
|
a7e8750446 | ||
|
|
5c8fca1757 | ||
|
|
5e8db7f495 | ||
|
|
0fac6f738f | ||
|
|
9c555fe96a | ||
|
|
7dcf456dd6 | ||
|
|
a6c6f6a5c3 | ||
|
|
0855453e83 | ||
|
|
c06692e9ec | ||
|
|
609577d882 | ||
|
|
f0203f6288 | ||
|
|
01a83f8cb0 | ||
|
|
57faf76605 | ||
|
|
9a2d9b993d | ||
|
|
1030d7a7d8 | ||
|
|
4d692049b2 | ||
|
|
14e86fcf0a | ||
|
|
048717c09c | ||
|
|
7999f6ddf6 | ||
|
|
8a4f3d3973 | ||
|
|
f3b757eead | ||
|
|
472c727186 | ||
|
|
3bc8b9dc9c | ||
|
|
831e15d0d1 | ||
|
|
a2cdb7726f | ||
|
|
40fd4fb21b | ||
|
|
b5f74d44e9 | ||
|
|
ea3a3a1a2d | ||
|
|
bfcd9c4f28 | ||
|
|
46b8f7e38b | ||
|
|
8bf2339870 | ||
|
|
e31a7fcdfc | ||
|
|
6f7eaa5531 | ||
|
|
d8790d9e2c | ||
|
|
5d02c74b6b | ||
|
|
d9960867fd | ||
|
|
5c62b32823 | ||
|
|
4b8823d427 | ||
|
|
55801d5330 | ||
|
|
54e168ce42 | ||
|
|
e05fbd00c2 | ||
|
|
edcbd1862e | ||
|
|
83341c39da | ||
|
|
6de4e2e382 | ||
|
|
b5d39b4820 | ||
|
|
8289c85438 | ||
|
|
635532053e | ||
|
|
6ebea7d35e | ||
|
|
8bd88acada | ||
|
|
1fd0a0eeed | ||
|
|
97893e6a19 | ||
|
|
97cb10bc9e | ||
|
|
f59cbb9ed1 | ||
|
|
c6569921d7 | ||
|
|
05684f2d86 | ||
|
|
a8a1bbe921 | ||
|
|
d9cd56ea76 | ||
|
|
d9ab6333ea | ||
|
|
62043b9a7c | ||
|
|
23ebf6e916 | ||
|
|
57c54a093b | ||
|
|
10f300094b | ||
|
|
c756ae2d9f | ||
|
|
868e3b1db8 | ||
|
|
4e5946adf7 | ||
|
|
da1b7847b3 | ||
|
|
a8f0c5a316 | ||
|
|
640501ab19 | ||
|
|
18cbccdd7c | ||
|
|
be9b8f0613 | ||
|
|
50ddf9e3d5 | ||
|
|
d140a799f7 | ||
|
|
db0872123b | ||
|
|
8b9ecac2dc | ||
|
|
53defde3e2 | ||
|
|
682c58c26f | ||
|
|
34dfe582ff | ||
|
|
282288efe4 | ||
|
|
b3df7086d7 | ||
|
|
b04a02660e | ||
|
|
73db4d5cca | ||
|
|
3da910ae24 | ||
|
|
7b388964ee | ||
|
|
5356c100ee | ||
|
|
9021105c89 | ||
|
|
b19fb9b6bd | ||
|
|
48ef7e52a2 | ||
|
|
90b4600fe8 | ||
|
|
920f6fd1fc | ||
|
|
6a93f284bc | ||
|
|
562e83bc6d | ||
|
|
aadc551965 | ||
|
|
fcdc025d11 | ||
|
|
de486f7897 | ||
|
|
62557742bd | ||
|
|
9f2cd78e67 | ||
|
|
c7d84acbcd | ||
|
|
9cd387439e | ||
|
|
fda23fc253 | ||
|
|
688268727e | ||
|
|
74ca22e9ca | ||
|
|
c438f0abc9 | ||
|
|
a31dd36ab9 | ||
|
|
ff0a08f508 | ||
|
|
76a2d2538c | ||
|
|
f896b9a354 | ||
|
|
5ae343b752 | ||
|
|
a4a0e18ec4 | ||
|
|
5343536429 | ||
|
|
3977f6380f | ||
|
|
b8f6e9dd03 | ||
|
|
4c9709ff0d | ||
|
|
cbc4b24a7a | ||
|
|
f194a3a25d | ||
|
|
ab13d02d53 | ||
|
|
b59e98b87c | ||
|
|
ea5ab044bf | ||
|
|
e109aa30d6 | ||
|
|
7173a63d46 | ||
|
|
c5c973d16f | ||
|
|
89107a221b | ||
|
|
04182c1361 | ||
|
|
0f9eee7662 | ||
|
|
c30d5a8d27 | ||
|
|
0df7721842 | ||
|
|
def1424b12 | ||
|
|
9789895f30 | ||
|
|
a790966b15 | ||
|
|
75bb019760 | ||
|
|
4ca1c611b3 | ||
|
|
a234329535 | ||
|
|
0ca80059c8 | ||
|
|
677df784c1 | ||
|
|
5fdc09fb36 | ||
|
|
51fc3dede2 | ||
|
|
56326195a4 | ||
|
|
52ff887db5 | ||
|
|
d8a4278ab4 | ||
|
|
735a0d148e | ||
|
|
3d1b363967 | ||
|
|
ecb7b4d271 | ||
|
|
d88fe953ae | ||
|
|
90c1689cf0 | ||
|
|
6496e39b53 | ||
|
|
7f41a6c77c | ||
|
|
7c84d6a082 | ||
|
|
9f25b9c1f7 | ||
|
|
40b89f34fb | ||
|
|
4575fe5a7c | ||
|
|
44a46d2a75 | ||
|
|
1a7f851985 | ||
|
|
a525d022ce | ||
|
|
2c95b113bd | ||
|
|
5c2c547d9e | ||
|
|
53738cf408 | ||
|
|
c8b8281e22 | ||
|
|
ed2b68a9c3 | ||
|
|
3bca4e220d | ||
|
|
96a35a3eea | ||
|
|
021ad113ef | ||
|
|
290525fdcd | ||
|
|
29585f985e | ||
|
|
ba8d49dce7 | ||
|
|
5ec120366c | ||
|
|
f24c8c6f4b | ||
|
|
9aa854dc6e | ||
|
|
7afdb75437 | ||
|
|
fde20cea27 | ||
|
|
cd2929aead | ||
|
|
3d3d238021 | ||
|
|
102156298a | ||
|
|
f1f91467fa | ||
|
|
b480b8dace | ||
|
|
a30cde3de5 | ||
|
|
08f7586031 | ||
|
|
30472a1cc1 | ||
|
|
2c42094494 | ||
|
|
e4b7e9e916 | ||
|
|
017a843f0a | ||
|
|
1373a16280 | ||
|
|
9bb4011d06 | ||
|
|
79527dd539 | ||
|
|
4e3f7a44da | ||
|
|
123d745249 | ||
|
|
69a075136f | ||
|
|
c63410f6be | ||
|
|
718b7308c3 | ||
|
|
cc077fd8d0 | ||
|
|
56b7b7a8a9 | ||
|
|
2aff369398 | ||
|
|
aab966a491 | ||
|
|
f98a741404 | ||
|
|
e1615b1882 | ||
|
|
79186d4fe9 | ||
|
|
19687ea1ed | ||
|
|
b3305dab64 | ||
|
|
29ab69a767 | ||
|
|
7d132e6578 | ||
|
|
a9606d1d4e | ||
|
|
104b4f38df | ||
|
|
e5f6dcb9c2 | ||
|
|
bf470dfe6c | ||
|
|
abe372481d | ||
|
|
85eb0bb29d | ||
|
|
aa4f8afc17 | ||
|
|
772c4026bb | ||
|
|
005d4c4deb | ||
|
|
1c2db161bf | ||
|
|
ea49b191aa | ||
|
|
c045d7a581 | ||
|
|
e0b531d5f4 | ||
|
|
c9167fa9df | ||
|
|
f338d8af5f | ||
|
|
fbc947f43f | ||
|
|
576b6e9236 | ||
|
|
cb44d1b30a | ||
|
|
9d6d8bf1fa | ||
|
|
f6d891674d | ||
|
|
e9427bc078 | ||
|
|
d805076ac2 | ||
|
|
ebe6dbbbae | ||
|
|
9f7874ccc5 | ||
|
|
21b2a241db | ||
|
|
96eada8f80 | ||
|
|
e0924de112 | ||
|
|
0f0f1cebcb | ||
|
|
0836e10a15 | ||
|
|
54790b5e63 | ||
|
|
c3fb9680ec | ||
|
|
83513d9580 | ||
|
|
c402d89f94 | ||
|
|
3af341356b | ||
|
|
428eb46f78 | ||
|
|
bf6e7e8034 | ||
|
|
9752d1a089 | ||
|
|
7c296bd9cc | ||
|
|
b410eaf6d4 | ||
|
|
a172147a91 | ||
|
|
a44137974b | ||
|
|
4caea0bb7a | ||
|
|
8aadb68db1 | ||
|
|
e67fa9823d | ||
|
|
51bbc2b4a8 | ||
|
|
f4e94a5030 | ||
|
|
668af98d75 | ||
|
|
d69d04cf75 | ||
|
|
3f4c7c8359 | ||
|
|
7893c72965 | ||
|
|
3e4a4f2376 | ||
|
|
313ca6b5e8 | ||
|
|
a5a9a4928b | ||
|
|
89153d9c05 | ||
|
|
8dd1fdb1a0 | ||
|
|
e007639f2a | ||
|
|
1ca6008767 | ||
|
|
01d5aec3aa | ||
|
|
eb8a55893d | ||
|
|
be6c3d8b62 | ||
|
|
549aec4500 | ||
|
|
f66de59603 | ||
|
|
9ea35f0d28 | ||
|
|
206b83f009 | ||
|
|
d4936d8fcf | ||
|
|
fbced1b9cc | ||
|
|
4773b98ac6 | ||
|
|
f869e47eae | ||
|
|
97863bb153 | ||
|
|
86a36cbd59 | ||
|
|
5390b6a291 | ||
|
|
0690bca499 | ||
|
|
9de5b9e04a | ||
|
|
8a6f3f80f2 | ||
|
|
4638a90a3a | ||
|
|
c7801827e5 | ||
|
|
4e526516e2 | ||
|
|
89874a4b0d | ||
|
|
30c81ea5c5 | ||
|
|
5643850ca4 | ||
|
|
7453e3c898 | ||
|
|
0216ab891b | ||
|
|
6da67bf234 | ||
|
|
327e33972b | ||
|
|
58e1dd2ee8 | ||
|
|
a650dd8a19 | ||
|
|
7edad11a74 | ||
|
|
9d8b0f805b | ||
|
|
feb22cdf5d | ||
|
|
0ca493768b | ||
|
|
7bb67a6200 | ||
|
|
bb5987fe74 | ||
|
|
84d4f5cad4 | ||
|
|
42df8a7401 | ||
|
|
63a31786b6 | ||
|
|
00d67abd30 | ||
|
|
8b824d99fa | ||
|
|
41d3f4dbbf | ||
|
|
15ff1d211b | ||
|
|
896d64be10 | ||
|
|
1237a33c79 | ||
|
|
e2d25ad5c6 | ||
|
|
eb3bc5aba6 | ||
|
|
8f96ea6b20 | ||
|
|
7b9d2e33bf | ||
|
|
f8c07fff2d | ||
|
|
4066a197be | ||
|
|
90ca5c4747 | ||
|
|
6787071417 | ||
|
|
246999a51f | ||
|
|
808f8ed306 | ||
|
|
7761580504 | ||
|
|
bb871497b7 | ||
|
|
7a0d047a68 | ||
|
|
b4266edb07 | ||
|
|
cef6cc1ec0 | ||
|
|
23b56e3c64 | ||
|
|
31dae9e367 | ||
|
|
9194a0fb12 | ||
|
|
6d2d3e7f60 | ||
|
|
09c9d44399 | ||
|
|
9ee9eaab3a | ||
|
|
c1877a3a30 | ||
|
|
467917cbde | ||
|
|
5bd82b6a04 | ||
|
|
3fad10919f | ||
|
|
3c10e038e2 | ||
|
|
2f960d70b9 | ||
|
|
55d313db99 | ||
|
|
2dbc46b7b1 | ||
|
|
e3fd1edc49 | ||
|
|
0bba8eeae1 | ||
|
|
c78d180231 | ||
|
|
99b85d1919 | ||
|
|
23f1e503c1 | ||
|
|
85cb7a2986 | ||
|
|
1d0ae2cde4 | ||
|
|
411280eb9d | ||
|
|
9936548993 | ||
|
|
d041052428 | ||
|
|
28f38ea4fe | ||
|
|
7ad2213278 | ||
|
|
86dfb4c292 | ||
|
|
aa8d04a87c | ||
|
|
155cac35d8 | ||
|
|
4c6ffdb1c2 | ||
|
|
adc4d1e5c8 | ||
|
|
7f4909d9f5 | ||
|
|
2d66c98f28 | ||
|
|
372f71eb1a | ||
|
|
88113794fd | ||
|
|
e1df83e8e0 | ||
|
|
f47760cbb6 | ||
|
|
699d59ea28 | ||
|
|
789897eb66 | ||
|
|
b0fd857c69 | ||
|
|
744a823fd2 | ||
|
|
641b0aa2d3 | ||
|
|
ec6861733b | ||
|
|
4ef7cb0700 | ||
|
|
c9c425d625 | ||
|
|
3ac0ae9dff | ||
|
|
3513866627 | ||
|
|
168ccfc133 | ||
|
|
1263932a0d | ||
|
|
148317f979 | ||
|
|
45c024c7dc | ||
|
|
b74e079ce7 | ||
|
|
c917e170f6 | ||
|
|
3afe39e21f | ||
|
|
f4e2a900d6 | ||
|
|
f5401b43b5 | ||
|
|
e95220e722 | ||
|
|
be8d4ef329 | ||
|
|
87efadc76c | ||
|
|
ece6962f06 | ||
|
|
a58ca45b2e | ||
|
|
96675e9d58 | ||
|
|
6efcc50176 | ||
|
|
42693bb820 | ||
|
|
ac8e3b67d0 | ||
|
|
51692417e8 | ||
|
|
4ecbeb8810 | ||
|
|
4f71062551 | ||
|
|
e8101d4f7b | ||
|
|
06382f01fd | ||
|
|
1722999310 | ||
|
|
dad6ac414e | ||
|
|
eb0cbbd2d9 | ||
|
|
4f1a593ac8 | ||
|
|
1cee6c5b78 | ||
|
|
bab31955c2 | ||
|
|
e51571595c | ||
|
|
c1ed6ef9cc | ||
|
|
1231a3e473 | ||
|
|
40b31d7487 | ||
|
|
d7b554ee11 | ||
|
|
11b749e047 | ||
|
|
fb8de6eec1 | ||
|
|
2cfa840eb5 | ||
|
|
59604815e1 | ||
|
|
ad271a2b33 | ||
|
|
af343ca8a1 | ||
|
|
ccb216ce49 | ||
|
|
a63013bfbf | ||
|
|
629bc67086 | ||
|
|
5c13954eed | ||
|
|
423d9f3868 | ||
|
|
f3f5820c46 | ||
|
|
ee513d6ed5 | ||
|
|
885e40db05 | ||
|
|
2bd5ad3131 | ||
|
|
1cce5ed178 | ||
|
|
81f59f0949 | ||
|
|
ee36612cef | ||
|
|
fd3d84ee52 | ||
|
|
68b639b4f5 | ||
|
|
1df6557b49 | ||
|
|
99c6e63e66 | ||
|
|
be59613ddf | ||
|
|
4d41c8ba49 | ||
|
|
6ace712438 | ||
|
|
ed0fe0e764 | ||
|
|
1e32fddb44 | ||
|
|
4eba5f1d39 | ||
|
|
80121ead56 | ||
|
|
58d1e0a2cc | ||
|
|
db8734c82f | ||
|
|
af5d38214b | ||
|
|
2787a746f4 | ||
|
|
5f893e68ff | ||
|
|
4aef5ef830 | ||
|
|
08011e1701 | ||
|
|
905fb8ef82 | ||
|
|
45ca7ec17d | ||
|
|
5bb19f7a9c | ||
|
|
3247b9a207 | ||
|
|
2b70aaf12d | ||
|
|
81ded022e0 | ||
|
|
6fd156b481 | ||
|
|
e4eb807516 | ||
|
|
e1d9d149ab | ||
|
|
dc7441c2fd | ||
|
|
7f62f74b85 | ||
|
|
344955d020 | ||
|
|
bcb7639fb3 | ||
|
|
37de6635b4 | ||
|
|
46a9e6c23f | ||
|
|
f6347145ff | ||
|
|
9f4c3eac9d | ||
|
|
80f13900f7 | ||
|
|
f2348a4826 | ||
|
|
057264d6ed | ||
|
|
055c523702 | ||
|
|
e805a607cf | ||
|
|
8a2788a5c8 | ||
|
|
68f35d5539 | ||
|
|
ec62b2d1cd | ||
|
|
277b0e15b8 | ||
|
|
94d7e1fa5b | ||
|
|
b784f02c0b | ||
|
|
cd3973612b | ||
|
|
f2457db5f3 | ||
|
|
4604031b84 | ||
|
|
23ca7b9f1a | ||
|
|
f34c1fbee2 | ||
|
|
b9b3aaa62f | ||
|
|
02e636f4c0 | ||
|
|
510adfc2a2 | ||
|
|
017cde1d11 | ||
|
|
6d6d52551e | ||
|
|
bea9651995 | ||
|
|
91130b6a00 | ||
|
|
d58ff645ff | ||
|
|
1a6116c1f2 | ||
|
|
e24f505bf9 | ||
|
|
78ec5a54a0 | ||
|
|
56ff5f7abf | ||
|
|
21abde5ca1 | ||
|
|
7a4d4bcd6b | ||
|
|
a61721741b | ||
|
|
0db7994248 | ||
|
|
cd754d7825 | ||
|
|
b982307dd1 | ||
|
|
16017f6d78 | ||
|
|
8adf849dce | ||
|
|
75879e3f18 | ||
|
|
8a4e08da4f | ||
|
|
5fcf863579 | ||
|
|
712cd89434 | ||
|
|
10342b4b9e | ||
|
|
4d1f03839c | ||
|
|
d3afeb5b4e | ||
|
|
4f88e66167 | ||
|
|
e3c5f6e890 | ||
|
|
b72a2738dc | ||
|
|
b9037f7d69 | ||
|
|
0249137148 | ||
|
|
074f52f382 | ||
|
|
4300d396b4 | ||
|
|
f54fca2cf6 | ||
|
|
b87f5e93a3 | ||
|
|
a43572123c | ||
|
|
2b61d55b1d | ||
|
|
50e9b1fe36 | ||
|
|
f5385608c1 | ||
|
|
8745b71fc6 | ||
|
|
51370ab76c | ||
|
|
440f8ad0a5 | ||
|
|
73908c2804 | ||
|
|
857e80f5c6 | ||
|
|
7f7c14d9f5 | ||
|
|
1ca7f07d1a | ||
|
|
5f81cba573 | ||
|
|
353dcc835f | ||
|
|
aa83dde27b | ||
|
|
5660a80cfc | ||
|
|
f72de266e2 | ||
|
|
397df3ca87 | ||
|
|
b3b67b04b7 | ||
|
|
930b212c23 | ||
|
|
37fb71b9ba | ||
|
|
887495811b | ||
|
|
fde2e61d54 | ||
|
|
33471de02a | ||
|
|
2d8b72535f | ||
|
|
3def9079fd | ||
|
|
69724dbc7c | ||
|
|
7fb72c1726 | ||
|
|
4e5597e061 | ||
|
|
1dcee33866 | ||
|
|
bd8aeb5342 | ||
|
|
f34b9d41be | ||
|
|
a6b31f04cd | ||
|
|
740fc2f5de | ||
|
|
02cad904ee | ||
|
|
85422c3c60 | ||
|
|
e8c219fef2 | ||
|
|
1f828a6e88 | ||
|
|
a1b07b6303 | ||
|
|
1d46433bfa | ||
|
|
64293ba38f | ||
|
|
7f5c13db41 | ||
|
|
a31dc47ae4 | ||
|
|
100196face | ||
|
|
fa5e623e95 | ||
|
|
49365eea79 | ||
|
|
29e8e565c6 | ||
|
|
3860254631 | ||
|
|
01a8f4606e | ||
|
|
da8843aa55 | ||
|
|
b952c2c95a | ||
|
|
993803e997 | ||
|
|
3f4e93f7d0 | ||
|
|
50595370e0 | ||
|
|
e092c0c00c | ||
|
|
8b8f191e59 | ||
|
|
2fdd934f42 | ||
|
|
1dfe76f5f6 | ||
|
|
c860633741 | ||
|
|
130b9e7ef2 | ||
|
|
eaa2a158c8 | ||
|
|
7f059e7255 | ||
|
|
6f2843fa20 | ||
|
|
9322b9d9a5 | ||
|
|
36e57ea2ae | ||
|
|
e216b8918e | ||
|
|
e834812a06 | ||
|
|
9eb2c1efb1 | ||
|
|
2a7b5f9190 | ||
|
|
392e856bc2 | ||
|
|
52dd20177c | ||
|
|
33d4092590 | ||
|
|
229b170885 | ||
|
|
2c94141b12 | ||
|
|
cacbf1ea28 | ||
|
|
8e45536cf4 | ||
|
|
4010b422dd | ||
|
|
bcb308c522 | ||
|
|
fd11a7e13e | ||
|
|
90feef368b | ||
|
|
8fd20c3ec7 | ||
|
|
16c363182d | ||
|
|
0beee41fc6 | ||
|
|
378440f7cf | ||
|
|
c51ba263dd | ||
|
|
91ed009ae2 | ||
|
|
effa42696e | ||
|
|
1a22c1eb86 | ||
|
|
92b963bb2e | ||
|
|
202b8100ab | ||
|
|
2c32d120b2 | ||
|
|
c54fa54e36 | ||
|
|
95afe462bd | ||
|
|
bd41577eb9 | ||
|
|
5be54abf24 | ||
|
|
29e5cf81bf | ||
|
|
ca7d7dbc01 | ||
|
|
ff127799e9 | ||
|
|
794d1bfd15 | ||
|
|
86abde5497 | ||
|
|
2573a5041f | ||
|
|
c9fea52cf9 | ||
|
|
4afe6d0f60 | ||
|
|
7da710c060 | ||
|
|
2eee0aa546 | ||
|
|
00df6fd744 | ||
|
|
1be47784eb | ||
|
|
fabf824eac | ||
|
|
6d67e11514 | ||
|
|
2e9f657aaf | ||
|
|
2deed22e5c | ||
|
|
10e0303620 | ||
|
|
a6b201c18c | ||
|
|
9f0eba9f10 | ||
|
|
f311ab1608 | ||
|
|
6614e8edb4 | ||
|
|
ba69d9958d | ||
|
|
763e1f3a09 | ||
|
|
5f98304f55 | ||
|
|
b0d0aff6a8 | ||
|
|
5a241ca1af | ||
|
|
3d5fd994e7 | ||
|
|
3d75fcae68 | ||
|
|
ff1b4be80c | ||
|
|
4dfdac7fba | ||
|
|
1d4f22bf63 | ||
|
|
b896825e8f | ||
|
|
ac523aa37e | ||
|
|
2a5a064a03 | ||
|
|
66e4f71040 | ||
|
|
515d7e7dae | ||
|
|
cb5891d277 | ||
|
|
8f1ff9e85e | ||
|
|
303dc9e96a | ||
|
|
4b5e7d6618 | ||
|
|
dfaaa8ff95 | ||
|
|
5b315e1304 | ||
|
|
0c03253635 | ||
|
|
d1a6a64675 | ||
|
|
ee5e330bcf | ||
|
|
d47e4b8617 | ||
|
|
b0c7ac2dc1 | ||
|
|
a67157c2c2 | ||
|
|
1c16ed47bc | ||
|
|
50aec09e04 | ||
|
|
89efa59e98 | ||
|
|
e9484d5c37 | ||
|
|
d049d4a6bd | ||
|
|
10249f2dfb | ||
|
|
eadbbec532 | ||
|
|
1702067ac0 | ||
|
|
091dc3840d | ||
|
|
940f58c2de | ||
|
|
e708c0ba70 | ||
|
|
2297f670b1 | ||
|
|
d8a75cf7e5 | ||
|
|
cfa7028d66 | ||
|
|
7d3341bee3 | ||
|
|
234f029727 | ||
|
|
388f7cdccc | ||
|
|
2456af596f | ||
|
|
9b9ab1793f | ||
|
|
684dca9aca | ||
|
|
fd7dc3024c | ||
|
|
947e17b1da | ||
|
|
56adbffdbf | ||
|
|
63526e633e | ||
|
|
cb62c5d5f8 | ||
|
|
e16710f1b5 | ||
|
|
a536df5327 | ||
|
|
3998034acb | ||
|
|
93e9520314 | ||
|
|
22bb1fbe5f | ||
|
|
bb57053f76 | ||
|
|
7f87a319aa | ||
|
|
f9f8691feb | ||
|
|
268a981c3a | ||
|
|
777f8dccca | ||
|
|
de5e2a58df | ||
|
|
322be14458 | ||
|
|
9d640cc990 | ||
|
|
bc8d0782dd | ||
|
|
c80c71f48b | ||
|
|
7c43b6829f | ||
|
|
35e3efbd41 | ||
|
|
d57210fb0b | ||
|
|
cd5b7dd64a | ||
|
|
6a449f2b02 | ||
|
|
a18d4d2085 | ||
|
|
772e4fa41a | ||
|
|
8741aa825d | ||
|
|
ffbb3c8bd8 | ||
|
|
c454a4156e | ||
|
|
ff3b0c84a3 | ||
|
|
f8c0f76881 | ||
|
|
8c9e222689 | ||
|
|
388195de8b | ||
|
|
520602ae4e | ||
|
|
b831ca7d64 | ||
|
|
7d6784d98d | ||
|
|
fe8f752946 | ||
|
|
baadf90fb5 | ||
|
|
c3cc31c745 | ||
|
|
dd43255b27 | ||
|
|
e15172f0e2 | ||
|
|
fce46168d1 | ||
|
|
98087ab562 | ||
|
|
15925864b2 | ||
|
|
0404a02430 | ||
|
|
6e815b76ea | ||
|
|
153ef54498 | ||
|
|
536221be39 | ||
|
|
4a6869c98e | ||
|
|
80a05cd78c | ||
|
|
5b1f7bc8ac | ||
|
|
405d07de96 | ||
|
|
8975f1dceb | ||
|
|
53a5eccf66 | ||
|
|
10b5f74855 | ||
|
|
789aa48043 | ||
|
|
6b8afa5d42 | ||
|
|
fd50caf95a | ||
|
|
0ffda3cc49 | ||
|
|
34c2b0a07c | ||
|
|
66f1be08c8 | ||
|
|
4b57e0e9f7 | ||
|
|
3cda6a750e | ||
|
|
da66298659 | ||
|
|
eb6f625d83 | ||
|
|
6e1dee8c1e | ||
|
|
a4edfc06c5 | ||
|
|
1e5a405c5c | ||
|
|
7957b20b48 | ||
|
|
38cdb8e7b7 | ||
|
|
49b4ac0a1c | ||
|
|
da132274a4 | ||
|
|
d3d350e7ce | ||
|
|
9b509a3bad | ||
|
|
9a63d8af7f | ||
|
|
3fb9b8f42d | ||
|
|
1d92510032 | ||
|
|
34cc1de229 | ||
|
|
5d6516be86 | ||
|
|
80b4f8fa5b | ||
|
|
c141fcbf53 | ||
|
|
21785afbe8 | ||
|
|
39aa0c4d3a | ||
|
|
f14961b005 | ||
|
|
fa9b168161 | ||
|
|
d19a44a6aa | ||
|
|
95ca9db755 | ||
|
|
71d4206074 | ||
|
|
87a491d7b6 | ||
|
|
c6ddfd4440 | ||
|
|
33f9499975 | ||
|
|
84eb48f0a1 | ||
|
|
43d91224f6 | ||
|
|
8f8889d02d | ||
|
|
6c68ac0def | ||
|
|
f5888acfba | ||
|
|
bd900fb66b | ||
|
|
ae11748038 | ||
|
|
a6d9b5ed18 | ||
|
|
b791918443 | ||
|
|
c885f468aa | ||
|
|
090d39b7b1 | ||
|
|
baad58df05 | ||
|
|
ef0bd3d102 | ||
|
|
f29eae1302 | ||
|
|
e3ae196da8 | ||
|
|
f8ecf34bf1 | ||
|
|
b73a6f883d | ||
|
|
70b8e3e8f6 | ||
|
|
cbfa4c88d9 | ||
|
|
2987d5216e | ||
|
|
17ce56825d | ||
|
|
fcefeee914 | ||
|
|
e48192fbb5 | ||
|
|
4c99114a25 | ||
|
|
8b794bb1dd | ||
|
|
e1705c0810 | ||
|
|
e38d7accb7 | ||
|
|
fa02b85082 | ||
|
|
447bf163ef | ||
|
|
7d5cfd3766 | ||
|
|
3ad9d62949 | ||
|
|
565400780b | ||
|
|
a99ca5a64a | ||
|
|
fbbbcdbaa7 | ||
|
|
59b455cf2f | ||
|
|
bd06de9ae9 | ||
|
|
cd40d5df9f | ||
|
|
a35d575ba6 | ||
|
|
785fd93311 | ||
|
|
2db5dc37c8 | ||
|
|
d532ba06c6 | ||
|
|
a5f1a555f3 | ||
|
|
495a957c99 | ||
|
|
9ded807a20 | ||
|
|
f38e760c39 | ||
|
|
7565347ba0 | ||
|
|
988435cf04 | ||
|
|
c532a70746 | ||
|
|
424b2e83b8 | ||
|
|
0b5ca3f7d5 | ||
|
|
79f857b323 | ||
|
|
34a7f94d57 | ||
|
|
4292f89345 | ||
|
|
190e2e73e9 | ||
|
|
988302171a | ||
|
|
e53b791b3e | ||
|
|
177e77fdab | ||
|
|
17fe680117 | ||
|
|
35f43ad274 | ||
|
|
e4e7047e4a | ||
|
|
3ca7eb7485 | ||
|
|
239d30bbee | ||
|
|
7272d029a5 | ||
|
|
f775d18b2c | ||
|
|
aa49d4af62 | ||
|
|
b595b1f01a | ||
|
|
a2bdc522f5 | ||
|
|
aa5c0ffcbf | ||
|
|
727398b2d4 | ||
|
|
e5360259a4 | ||
|
|
111d36a3c8 | ||
|
|
df74f1dfab | ||
|
|
307a234879 | ||
|
|
3ce3e9ba27 | ||
|
|
66175ef9fe | ||
|
|
d1c1e99d98 | ||
|
|
7dca298b21 | ||
|
|
16b6a3f5e4 | ||
|
|
598f9f52b7 | ||
|
|
981e1ae7b8 | ||
|
|
13692ff313 | ||
|
|
6caf633cf7 | ||
|
|
5bbc4114f1 | ||
|
|
165361a515 | ||
|
|
6ebdd64d3c | ||
|
|
c85390a691 | ||
|
|
6303aec7ff | ||
|
|
ce826716d5 | ||
|
|
d6a55b532c | ||
|
|
cefc1f2336 | ||
|
|
6b8059afe9 | ||
|
|
53e19d5102 | ||
|
|
1f0049158a | ||
|
|
6bbf0105af | ||
|
|
8cae0bf725 | ||
|
|
16380b0155 | ||
|
|
3afe0e2ed1 | ||
|
|
0d3085944f | ||
|
|
d973e2c25b | ||
|
|
a52af6cd7c | ||
|
|
66a172c9b4 | ||
|
|
618c98179b | ||
|
|
28b8d17c28 | ||
|
|
e962769fee | ||
|
|
61c0f610dc | ||
|
|
fce92e3ca2 | ||
|
|
2c5c26f205 | ||
|
|
7ef638aa30 | ||
|
|
318a59d302 | ||
|
|
719d995a9d | ||
|
|
5d51452545 | ||
|
|
02c42362ff | ||
|
|
5be482030e | ||
|
|
968d2c5b33 | ||
|
|
ab99eb59fb | ||
|
|
c250702c40 | ||
|
|
e465e94a12 | ||
|
|
1769d69ca3 | ||
|
|
eb4b5ffd22 | ||
|
|
a526b42211 | ||
|
|
62be931c9f | ||
|
|
e008af1364 | ||
|
|
619537208b | ||
|
|
fee1263ca3 | ||
|
|
02d2a5db3a | ||
|
|
fd7153b0f3 | ||
|
|
6df3a21309 | ||
|
|
1f5ee72e2d | ||
|
|
5928970d22 | ||
|
|
cbc8b0f4b4 | ||
|
|
e7c50e4866 | ||
|
|
6caaf70451 | ||
|
|
bcec04f1d9 | ||
|
|
07a8327a0e | ||
|
|
2e738b519f | ||
|
|
b8063c342c | ||
|
|
438e9bdc93 | ||
|
|
bd593d3da6 | ||
|
|
a2ad91df33 | ||
|
|
164cbab7c6 | ||
|
|
cac15508d5 | ||
|
|
d64c9d2823 | ||
|
|
f20194149f | ||
|
|
43793b94f7 | ||
|
|
2ef880c048 | ||
|
|
f18b903d5f | ||
|
|
99f151f1bd | ||
|
|
a1c036b8cf | ||
|
|
390dccacac | ||
|
|
131dfb4a02 | ||
|
|
8df948c5c2 | ||
|
|
97de5b2106 | ||
|
|
8e3fdccb8d | ||
|
|
88426390a8 | ||
|
|
77f4e1c8c7 | ||
|
|
2b0a8049db | ||
|
|
d09ec3261f | ||
|
|
f79e3fa02f | ||
|
|
a9d4cf9023 | ||
|
|
0eeee6b7c8 | ||
|
|
f6c8918a0d | ||
|
|
ce9a9fb1dc | ||
|
|
9097a78187 | ||
|
|
7b89a0037d | ||
|
|
f3c1222da3 | ||
|
|
b54f915280 | ||
|
|
01740bfb0d | ||
|
|
cdb98a04a5 | ||
|
|
0d714115ab | ||
|
|
53bdf0b5cc | ||
|
|
a29791411b | ||
|
|
796ff183b0 | ||
|
|
3c766f379b | ||
|
|
dee9053cb6 | ||
|
|
3570258050 | ||
|
|
b51aa1f36f | ||
|
|
420d668f33 | ||
|
|
ae19180641 | ||
|
|
717acfe9c5 | ||
|
|
8f58728e2b | ||
|
|
b98d2a8261 | ||
|
|
605b1aa394 | ||
|
|
9fb095b50e | ||
|
|
d1a9eca805 | ||
|
|
03e842ccb8 | ||
|
|
fddf89aff7 | ||
|
|
d975678006 | ||
|
|
62adbfc521 | ||
|
|
6bcc8ff0c7 | ||
|
|
eb0e694665 | ||
|
|
ef1d6987fd | ||
|
|
e52889acd9 | ||
|
|
99b4051eca | ||
|
|
cbd3f41ba8 | ||
|
|
edd7025645 | ||
|
|
a712da5cee | ||
|
|
e346a6b538 | ||
|
|
6cac26c21f | ||
|
|
6ce07a85e4 | ||
|
|
a7d1bc96be | ||
|
|
216067b63f | ||
|
|
1868bfdcdf | ||
|
|
a4a4de55f7 | ||
|
|
c9dfab5024 | ||
|
|
897bb1b572 | ||
|
|
1aa01da212 | ||
|
|
cf8545794b | ||
|
|
9c88d20070 | ||
|
|
df2935808e | ||
|
|
4e63aa4566 | ||
|
|
2ffa48b447 | ||
|
|
fb330f795d | ||
|
|
764747ec7f | ||
|
|
0f06ad29a6 | ||
|
|
1326e17536 | ||
|
|
d530b82b26 | ||
|
|
1251445abc | ||
|
|
c5b2c8ba93 | ||
|
|
deff917851 | ||
|
|
c8ffb0ba59 | ||
|
|
eb8cd900a6 | ||
|
|
d180634e07 | ||
|
|
e49ad341bd | ||
|
|
b4e48b952e | ||
|
|
039551788b | ||
|
|
dce9fd0e44 | ||
|
|
5dff860557 | ||
|
|
eea5d09eb9 | ||
|
|
471a07f223 | ||
|
|
66eedaa03d | ||
|
|
467b5e4892 | ||
|
|
169606602b | ||
|
|
01ecd47a05 | ||
|
|
022159a6cd | ||
|
|
4a81e8c111 | ||
|
|
c183168481 | ||
|
|
02b0cef4d8 | ||
|
|
61fcaf564a | ||
|
|
c904bb2b87 | ||
|
|
962d39e86e | ||
|
|
ff843bacf4 | ||
|
|
0ebcdb28af | ||
|
|
b928bdceb8 | ||
|
|
6a8fdc6c5c | ||
|
|
3b649d637d | ||
|
|
34c40031ca | ||
|
|
24b26065e0 | ||
|
|
98bf43f229 | ||
|
|
8e58cc501f | ||
|
|
4f0f3c3ba0 | ||
|
|
0b7fd17c2b | ||
|
|
d7ac0f2c9d | ||
|
|
a14261bc42 | ||
|
|
7864fdfdee | ||
|
|
6dd322874e | ||
|
|
a5418dc0ac | ||
|
|
11fabacc3c | ||
|
|
0e0f3eb097 | ||
|
|
10eb67a3aa | ||
|
|
8ed100e5c5 | ||
|
|
eedf4e973f | ||
|
|
663d46ea23 | ||
|
|
edfd7f9a80 | ||
|
|
458352954d | ||
|
|
88a0832a09 | ||
|
|
32af54f62b | ||
|
|
48ef2d62ba | ||
|
|
e2168491a1 | ||
|
|
d3a7f5be38 | ||
|
|
dd6cccf50e | ||
|
|
45ba649c8e | ||
|
|
45a5555b09 | ||
|
|
102c6ce4b8 | ||
|
|
78d77c1476 | ||
|
|
ad730a374b | ||
|
|
ebe02095df | ||
|
|
ff8a716efe | ||
|
|
7fdfcc28ec | ||
|
|
3701bc4207 | ||
|
|
1cefd77f1c | ||
|
|
9d2bcf2bd0 | ||
|
|
194e8828a1 | ||
|
|
de9f39beda | ||
|
|
2bfe0001da | ||
|
|
e93df14b67 | ||
|
|
a8401a33c6 | ||
|
|
d8d6ff3c4c | ||
|
|
7e0baa7a1d | ||
|
|
50b014b957 | ||
|
|
f8983e467f | ||
|
|
cd9e047d65 | ||
|
|
fe0f40254f | ||
|
|
d5d6c79584 | ||
|
|
1c36e3472f | ||
|
|
4a1da8b6f9 | ||
|
|
bfac4633a5 | ||
|
|
675ce84475 | ||
|
|
b7a8baf1bb | ||
|
|
b9d1b21598 | ||
|
|
7eec1997ef | ||
|
|
8aa6d9cb35 | ||
|
|
a23c64ee8b | ||
|
|
950e7224ad | ||
|
|
5af7dff758 | ||
|
|
375474ce86 | ||
|
|
7f158268aa | ||
|
|
76061b701e | ||
|
|
09d281ff62 | ||
|
|
c012528fe1 | ||
|
|
e46a517ed6 | ||
|
|
1a8da63ca0 | ||
|
|
dae76aa1b5 | ||
|
|
01d478ba56 | ||
|
|
5673378ea6 | ||
|
|
2ffe85ddac | ||
|
|
5a35a6bafc | ||
|
|
d1f1d40527 | ||
|
|
d4b160c0d6 | ||
|
|
b6d29b2347 | ||
|
|
93d51636f7 | ||
|
|
e374f6fd31 | ||
|
|
70345bd222 | ||
|
|
0b7a9cea88 | ||
|
|
1f6c248909 | ||
|
|
1b993610c1 | ||
|
|
746f01802d | ||
|
|
06388f5181 | ||
|
|
ab36e22aeb | ||
|
|
8a8c3eafc8 | ||
|
|
22e9ff476a | ||
|
|
45cfada9a1 | ||
|
|
efc005c078 | ||
|
|
110735c3bb | ||
|
|
a4146cc890 | ||
|
|
4ef2af7c72 | ||
|
|
1db5c7d1e2 | ||
|
|
467c4314b8 | ||
|
|
c106ab8ba0 | ||
|
|
48db9618b8 | ||
|
|
4c818aec33 | ||
|
|
30c5b53ad1 | ||
|
|
a35237795f | ||
|
|
3c51a88d0c | ||
|
|
f27956eb19 | ||
|
|
3bd5d5dc13 | ||
|
|
cf10288201 | ||
|
|
dc5af6decc | ||
|
|
8fe69306dc | ||
|
|
1e7c5b8562 | ||
|
|
1e56dd781a | ||
|
|
a00a1d12ea | ||
|
|
7bb2af41e3 | ||
|
|
898c8ead87 | ||
|
|
13b67621cf | ||
|
|
1e672d4528 | ||
|
|
678508b426 | ||
|
|
ccacfd880b | ||
|
|
b470fe138b | ||
|
|
ecd354ada1 | ||
|
|
6341c60f67 | ||
|
|
c521aeda57 | ||
|
|
640c8226aa | ||
|
|
1c641cfdee | ||
|
|
01a4220954 | ||
|
|
0aed5fd91c | ||
|
|
7fcaa66bcd | ||
|
|
c6449f307a | ||
|
|
8c65f81676 | ||
|
|
5ec49e9c79 | ||
|
|
666a53a247 | ||
|
|
950fb739f8 | ||
|
|
8fb954ae4f | ||
|
|
7213c743f0 | ||
|
|
bc7abb3300 | ||
|
|
ae1043ba0d | ||
|
|
a0e46521e3 | ||
|
|
3637589db1 | ||
|
|
ebd9e89fcf | ||
|
|
949574d027 | ||
|
|
c07a056dac | ||
|
|
56dcb7ed07 | ||
|
|
844938ec4e | ||
|
|
635d7fbfae | ||
|
|
8715b55ce0 | ||
|
|
a982eb2267 | ||
|
|
124fe30f03 | ||
|
|
1ae552c7d1 | ||
|
|
178ae887ab | ||
|
|
181da8f232 | ||
|
|
86920d4c68 | ||
|
|
7744e04b42 | ||
|
|
015884dda5 | ||
|
|
0ebb7335c9 | ||
|
|
2980f7f92d | ||
|
|
9786b16e9f | ||
|
|
833339c692 | ||
|
|
0d9c0616f9 | ||
|
|
9cd4929417 | ||
|
|
1e949e6caa | ||
|
|
e50b33c240 | ||
|
|
44cf237a72 | ||
|
|
90331b27ac | ||
|
|
a603902561 | ||
|
|
f1b988d2af | ||
|
|
3bbc7466fc | ||
|
|
636b8927c6 | ||
|
|
2bd6846adc | ||
|
|
fb39eda0d8 | ||
|
|
afccb58612 | ||
|
|
8c82566b48 | ||
|
|
030c0fd415 | ||
|
|
73bd59943c | ||
|
|
abb31591ff | ||
|
|
81c4fd5efc | ||
|
|
7a2e01c592 | ||
|
|
62227a03b1 | ||
|
|
69d1e788c0 | ||
|
|
9bfd5e5e55 | ||
|
|
fb69f854af | ||
|
|
8e12a0126e | ||
|
|
b5447a4d7a | ||
|
|
ac309e9696 | ||
|
|
d3007a8ca9 | ||
|
|
ce3c002a16 | ||
|
|
0399d94e35 | ||
|
|
51491d06f1 | ||
|
|
5dadceb115 | ||
|
|
8a5bc5b674 | ||
|
|
0a142bb94e | ||
|
|
80db548369 | ||
|
|
bf913cc61d | ||
|
|
a9abc3ab6b | ||
|
|
385d1aa664 | ||
|
|
fcd7794c2b | ||
|
|
36c87e18d6 | ||
|
|
f78e1408c5 | ||
|
|
1895a09749 | ||
|
|
cecfdbe71e | ||
|
|
e5835b63c9 | ||
|
|
cf9ea9d9cd | ||
|
|
ff53dde157 | ||
|
|
e319b5f6a5 | ||
|
|
57735564ec | ||
|
|
148a3396ec | ||
|
|
7bd0936291 | ||
|
|
4197a68602 | ||
|
|
c3bff72209 | ||
|
|
f9d1b16d8b | ||
|
|
8a86e37d69 | ||
|
|
faf4f764b7 | ||
|
|
3d939af4a3 | ||
|
|
69a44fdae8 | ||
|
|
f9fc8f78ab | ||
|
|
a33c135b0a | ||
|
|
25df65b0b8 | ||
|
|
ff4031585a | ||
|
|
3c61d015c2 | ||
|
|
9b916e6a48 | ||
|
|
78a1fdfcaa | ||
|
|
93feb306f8 | ||
|
|
e3e75eb2da | ||
|
|
ec93ec1fb1 | ||
|
|
e191baa1a3 | ||
|
|
fd4e7282fe | ||
|
|
09d2f7e280 | ||
|
|
0f54988877 | ||
|
|
d348a83a72 | ||
|
|
27ca66b410 | ||
|
|
21f77edba0 | ||
|
|
5df3ca812b | ||
|
|
3563e0adba | ||
|
|
f1eefa64ec | ||
|
|
df4547a3df | ||
|
|
0fa7618f7c | ||
|
|
94cca68983 | ||
|
|
cab5f6afb8 | ||
|
|
9a8a9d774e | ||
|
|
3d3d385d37 | ||
|
|
887c672a6c | ||
|
|
7a0855aeb5 | ||
|
|
83d987b48d | ||
|
|
e09b2d0df4 | ||
|
|
58acf7dbe1 | ||
|
|
72c4912f58 | ||
|
|
773e306df2 | ||
|
|
7182e722ca | ||
|
|
ee82f87cbf | ||
|
|
251cda4941 | ||
|
|
5d10b23a78 | ||
|
|
1ea8d6afac | ||
|
|
dec92a445f | ||
|
|
617266e33e | ||
|
|
417f74451f | ||
|
|
112525ea9f | ||
|
|
2aaa538aef | ||
|
|
be6afb3fcc | ||
|
|
22dba603f5 | ||
|
|
4571d8ddea | ||
|
|
521f03c184 | ||
|
|
0eb51100b7 | ||
|
|
6d51f4a788 | ||
|
|
32dffec0f8 | ||
|
|
cd8c4268ec | ||
|
|
03851ced5f | ||
|
|
ae0d73e87d | ||
|
|
c9158aec30 | ||
|
|
34e74f8afe | ||
|
|
cf1d0f1844 | ||
|
|
49b2166e1a | ||
|
|
99133bf4bb | ||
|
|
f51150584c | ||
|
|
30b43665e8 | ||
|
|
3fdc316faf | ||
|
|
4686a3b50e | ||
|
|
0236982d6d | ||
|
|
2472700dd1 | ||
|
|
08bd9586fb | ||
|
|
61ceb9e5ab | ||
|
|
c32de173c3 | ||
|
|
78cec9f33e | ||
|
|
39af86f017 | ||
|
|
d91068a88a | ||
|
|
f9bc6ac04e | ||
|
|
1ec84f9c21 | ||
|
|
22bfb799a7 | ||
|
|
8a3edf2cab | ||
|
|
bd29009c31 | ||
|
|
7741269930 | ||
|
|
3ac4c96641 | ||
|
|
072755ca8d | ||
|
|
6ba87f8cf6 | ||
|
|
398923de53 | ||
|
|
cde504ad27 |
No files matched your search
+8
-9
@@ -43,9 +43,9 @@ Exceptions:
|
||||
for efficiency and in order for them to be binary-safe.
|
||||
Functions that change strings and obtain their new lengths while
|
||||
doing so, should return that new length, so it doesn't have to be
|
||||
recalculated with strlen() (e.g. _php3_addslashes())
|
||||
recalculated with strlen() (e.g. php_addslashes())
|
||||
|
||||
[5] Use php3_error() to report any errors/warnings during code execution.
|
||||
[5] Use php_error() to report any errors/warnings during code execution.
|
||||
Use descriptive error messages, and try to avoid using identical
|
||||
error strings for different stages of an error. For example,
|
||||
if in order to obtain a URL you have to parse the URL, connect,
|
||||
@@ -63,12 +63,11 @@ Exceptions:
|
||||
Naming Conventions
|
||||
------------------
|
||||
|
||||
[1] Function names for user functions implementation should be prefixed with
|
||||
"php3_", and followed by a word or an underscore-delimited list of words,
|
||||
in lowercase letters, that describes the function.
|
||||
[1] Function names for user functions should be enclosed with in
|
||||
the PHP_FUNCTION() macro.
|
||||
|
||||
[2] Function names used by user functions implementations should be prefixed
|
||||
with "_php3_", and followed by a word or an underscore-delimited list of
|
||||
[2] Function names used by user functions should be prefixed
|
||||
with "_php_", and followed by a word or an underscore-delimited list of
|
||||
words, in lowercase letters, that describes the function. If applicable,
|
||||
they should be declared 'static'.
|
||||
|
||||
@@ -80,7 +79,6 @@ Naming Conventions
|
||||
between words.
|
||||
|
||||
|
||||
|
||||
Syntax and indentation
|
||||
----------------------
|
||||
|
||||
@@ -123,7 +121,8 @@ function does. It would look like this:
|
||||
|
||||
/* {{{ proto int abs(int number)
|
||||
Return the absolute value of the number */
|
||||
void php3_abs(INTERNAL_FUNCTION_PARAMETERS) {
|
||||
PHP_FUNCTION(abs)
|
||||
{
|
||||
...
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
For the list of people who've put work into PHP 4.0, please see
|
||||
http://www.php.net/version4/credits.php
|
||||
|
||||
http://www.php.net/credits.php
|
||||
+352
@@ -0,0 +1,352 @@
|
||||
List of PHP maintainers
|
||||
=======================
|
||||
|
||||
Maintenance legend
|
||||
------------------
|
||||
Supported: Someone is actually paid to look after this.
|
||||
Maintained: Someone actually looks after it.
|
||||
Odd Fixes: It has a maintainer but they don't have time to do
|
||||
much other than throw the odd patch in. See below.
|
||||
Orphan: No current maintainer [but maybe you could take the
|
||||
role as you write your new code].
|
||||
Obsolete: Old code. Something tagged obsolete generally means
|
||||
it has been replaced by a better system and you
|
||||
should be using that.
|
||||
Unknown: Not known at this time.
|
||||
|
||||
Status legend
|
||||
-------------
|
||||
Working: Working under both Windows and Unix.
|
||||
Windows: Working only under Windows.
|
||||
Unix: Working only under Unix.
|
||||
Experimental: Under development or initial release.
|
||||
Not Working: Not working.
|
||||
Unknown: Status unknown.
|
||||
|
||||
|
||||
== Server APIs ==
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: aolserver
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: apache
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cgi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fhttpd
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: isapi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: nsapi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: phttpd
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pi3web
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: roxen
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: servlet
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: thttpd
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
== Database extensions ==
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dba
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dbase
|
||||
PRIMARY MAINTAINER: Jim Winstead <jimw@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: filepro
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hyperwave
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: informix
|
||||
PRIMARY MAINTAINER: Danny Heijl <Danny.Heijl@cevi.be>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ingres_ii
|
||||
PRIMARY MAINTAINER: David Hénot <henot@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: interbase
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: msql
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mssql
|
||||
PRIMARY MAINTAINER: Frank M. Kromann <fmk@swwwing.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Tested on phpts and isapi versions
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysql
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pgsql
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sybase
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Not Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sybase_ct
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: odbc
|
||||
PRIMARY MAINTAINER: Andreas Karajannis <Karajannis@gmd.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Working except for persistent connections
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oracle
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Using the new OCI8 driver is encouraged where possible.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
== Other extensions ==
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: aspell
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
COMMENT: For aspell .27 and greater, check out the pspell extension
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: bcmath
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: calendar
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: com
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cpdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: CURL
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cybercash
|
||||
PRIMARY MAINTAINER: Evan Klinger <evan715@sirius.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: domxml
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dotnet
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: exif
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ftp
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gettext
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: icap
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Obsolete
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: imap
|
||||
PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: java
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ldap
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcal
|
||||
PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcrypt
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mhash
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pcre
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pfpro
|
||||
PRIMARY MAINTAINER: David Croft <david@infotrek.co.uk>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: posix
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pspell
|
||||
PRIMARY MAINTAINER: Vlad Krupin <phpdevel@echospace.com>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: readline
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: recode
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: session
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: snmp
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sockets
|
||||
PRIMARY MAINTAINER: Chris Vandomelen <chrisv@b0rked.dhs.org>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: swf
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unix (won't change)
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sysvsem
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sysvshm
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: wddx
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xml
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: yaz
|
||||
PRIMARY MAINTAINER: Adam Dickmeiss <adam@indexdata.dk>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: zlib
|
||||
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
# iptc?
|
||||
@@ -5,15 +5,41 @@ For the impatient here is a quick set of steps that will build PHP as
|
||||
first a dynamic Apache module (DSO) for Apache 1.3.x with MySQL support
|
||||
and then a static module. A more verbose explanation follows.
|
||||
|
||||
For installing PHP on other web servers, refer to one of the following
|
||||
files:
|
||||
|
||||
sapi/aolserver/README
|
||||
sapi/pi3web/README
|
||||
sapi/servlet/README
|
||||
sapi/thttpd/README
|
||||
README.Zeus
|
||||
|
||||
Note! Only install either the static module or the dynamic one. Do not
|
||||
install both.
|
||||
|
||||
Note 2! If you are recompiling PHP to add new extensions or upgrading
|
||||
something like GD, remove the config.cache file before you re-run
|
||||
configure.
|
||||
|
||||
Note 3! If you are on Linux and have installed shared libraries, make
|
||||
sure the location of these shared libraries are listed in your
|
||||
/etc/ld.so.conf file. For example, if you have:
|
||||
|
||||
/usr/local/lib/mysql/libmysqlclient.so
|
||||
|
||||
Make sure /etc/ld.so.conf contains:
|
||||
|
||||
/usr/local/lib/mysql
|
||||
|
||||
Then run ldconfig.
|
||||
|
||||
If you want both PHP 3 and 4 modules in the same Apache server, check the
|
||||
bottom of this file for instructions.
|
||||
|
||||
INSTALLATION WITH THE ZEUS WEB SERVER:
|
||||
--Please see the 'README.Zeus' file included in this distribution
|
||||
|
||||
|
||||
QUICK INSTALL (DSO)
|
||||
|
||||
For this to work your Apache httpd must have mod_so enabled.
|
||||
@@ -36,6 +62,9 @@ If you get an error telling you that the apxs script could not be found,
|
||||
look for it on your system and if you find it, provide the full path to it
|
||||
as: --with-apxs=/path/to/apxs
|
||||
|
||||
Next you must copy php.ini-dist to the appropriate place (normally
|
||||
/usr/local/lib/php.ini) and edit it as necessary to set PHP options.
|
||||
|
||||
The only thing left to do is to edit your httpd.conf file and make sure the
|
||||
PHP 4 mime type is there and uncommented. You need a line that looks like
|
||||
this:
|
||||
@@ -64,10 +93,11 @@ $ cd ../apache_1.3.x
|
||||
$ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
|
||||
(The above line is correct! Yes, we know libphp4.a does not exist at this
|
||||
stage. It isn't supposed to. It will be created.)
|
||||
make
|
||||
(you should now have an httpd binary which you can copy to your Apache bin dir)
|
||||
cd ../php-4.0.x
|
||||
cp php.ini-dist /usr/local/lib/php.ini
|
||||
$ make
|
||||
(you should now have an httpd binary which you can copy to your Apache bin dir if
|
||||
is is your first install then you need to "make install" as well)
|
||||
$ cd ../php-4.0.x
|
||||
$ cp php.ini-dist /usr/local/lib/php.ini
|
||||
You can edit /usr/local/lib/php.ini file to set PHP options.
|
||||
Edit your httpd.conf or srm.conf file and add:
|
||||
AddType application/x-httpd-php .php
|
||||
@@ -263,14 +293,12 @@ Installing PHP can be done in four simple steps:
|
||||
Note! If a line has a # at the beginning, then it is commented out
|
||||
and you need to remove the # for that line to take effect.
|
||||
|
||||
Finally you need to copy php.ini-dist to the appropriate place
|
||||
(normally /usr/local/lib/php.ini) and edit if necessary.
|
||||
|
||||
Once you have made these changes you should be ready to restart your
|
||||
server and try it out. Type: apachectl restart
|
||||
|
||||
The create a test file named test.php in your web tree somewhere and
|
||||
put some test PHP tags in it. <?phpinfo()?> is a good first test.
|
||||
This tag tells PHP to do a braindump and tells you all sorts of things
|
||||
about itself.
|
||||
|
||||
4b. Setting up the server. (Static Module)
|
||||
|
||||
You should now have a new httpd binary. Shut down your existing server,
|
||||
@@ -289,13 +317,66 @@ Installing PHP can be done in four simple steps:
|
||||
Any file ending in .phps will now be displayed with full colour syntax
|
||||
highlighting instead of being executed.
|
||||
|
||||
When you are finished making changes to your httpd.conf file, you can
|
||||
start up your server. Note that on some older server setups, the
|
||||
AddType lines are in the conf/srm.conf file instead of conf/httpd.conf.
|
||||
Note that on some older server setups, the AddType lines are in the
|
||||
conf/srm.conf file instead of conf/httpd.conf.
|
||||
|
||||
Note! If a line has a # at the beginning, then it is commented out
|
||||
and you need to remove the # for that line to take effect.
|
||||
|
||||
When you are finished making changes to your httpd.conf file, you need
|
||||
to copy php.ini-dist to the appropriate place (normally
|
||||
/usr/local/lib/php.ini) and edit if necessary. You can then
|
||||
start up your server.
|
||||
|
||||
5. Testing it all worked
|
||||
|
||||
Create a test file named test.php in your web tree somewhere and
|
||||
put some test PHP tags in it. <?phpinfo()?> is a good first test.
|
||||
This tag tells PHP to do a braindump and tells you all sorts of things
|
||||
about itself.
|
||||
|
||||
|
||||
WHY DISABLING -fPIC WORKS ON LINUX
|
||||
|
||||
From: Martin v. Loewis <martin@loewis.home.cs.tu-berlin.de>
|
||||
To: glibc-linux@ricardo.ecn.wfu.edu
|
||||
Subject: Re: Shared library -shared vs. -fpic
|
||||
|
||||
[In reply to Kaz Kylheku <kaz@ashi.footprints.net>]
|
||||
|
||||
> PIC stands for Position-Independent Code.
|
||||
|
||||
Correct.
|
||||
|
||||
> Code isn't position-independent (or ``relocatable'') cannot be
|
||||
> loaded at an arbitrary address;
|
||||
|
||||
Wrong.
|
||||
|
||||
> it requires some references to be patched at load time.
|
||||
|
||||
Correct.
|
||||
|
||||
> Shared libraries need to be relocatable because it's not known
|
||||
> beforehand what address they will be loaded at
|
||||
|
||||
Correct, depending on the meaning of "relocatable". PIC code typically
|
||||
does not contain relocations; that's why its position-independent.
|
||||
|
||||
> Just because you don't specify -fPIC doesn't mean that the compiler
|
||||
> won't emit position-independent code; the option prevents it from
|
||||
> emitting position-dependent code in situations where it otherwise
|
||||
> would.
|
||||
|
||||
Correct. However, a non-trivial shared library typically won't be
|
||||
position-independent unless explicitly compiled with
|
||||
-fPIC. Linux/glibc indeed does not require a shared library to be
|
||||
position-independent; instead, it will perform the relocations in the
|
||||
binary, even if they refer to code pages. As a result, those relocated
|
||||
pages won't be shared across processes, anymore.
|
||||
|
||||
Regards,
|
||||
Martin
|
||||
|
||||
USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES
|
||||
|
||||
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
List of PHP maintainers
|
||||
=======================
|
||||
|
||||
Status legend
|
||||
-------------
|
||||
Supported: Someone is actually paid to look after this.
|
||||
Maintained: Someone actually looks after it.
|
||||
Odd Fixes: It has a maintainer but they don't have time to do
|
||||
much other than throw the odd patch in. See below..
|
||||
Orphan: No current maintainer [but maybe you could take the
|
||||
role as you write your new code].
|
||||
Obsolete: Old code. Something tagged obsolete generally means
|
||||
it has been replaced by a better system and you
|
||||
should be using that.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: apache
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: cybercash
|
||||
PRIMARY MAINTAINER: Evan Klinger <evan715@sirius.com>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: dba
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: fdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: hyperwave
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: informix
|
||||
PRIMARY MAINTAINER: Danny Heijl <Danny.Heijl@cevi.be>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: interbase
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: java
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: ldap
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: mcrypt
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: mhash
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: mssql
|
||||
PRIMARY MAINTAINER: Frank M. Kromann <fmk@swwwing.com>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: oracle
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
STATUS: Maintained
|
||||
COMMENT: Using the new OCI8 driver is encouraged where possible.
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: pcre
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: pdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: session
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: snmp
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: wddx
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: xml
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: zlib
|
||||
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
@@ -1,25 +0,0 @@
|
||||
Module Status
|
||||
------ ------
|
||||
MySQL Working
|
||||
COM Working
|
||||
WDDX Working
|
||||
PCRE Working
|
||||
DBA Working
|
||||
mcrypt Working
|
||||
mhash Working
|
||||
dbase Working
|
||||
aspell Working
|
||||
imap Working
|
||||
ldap Working
|
||||
oci8 Working
|
||||
oracle Working
|
||||
iptc Working
|
||||
informix Working
|
||||
zlib Working
|
||||
sysvshm Working
|
||||
odbc Working (except for persistent connections)
|
||||
MS SQL Working (tested on phpts and isapi versions)
|
||||
snmp Working
|
||||
gettext Working
|
||||
mcal Working
|
||||
interbase Working
|
||||
+7
-21
@@ -1,19 +1,14 @@
|
||||
|
||||
ZEND_DIR = $(srcdir)/Zend
|
||||
SUBDIRS = Zend ext sapi $(TSRM_DIR) $(REGEX_DIR) . $(PEAR_DIR)
|
||||
SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) . $(PEAR_DIR)
|
||||
|
||||
LTLIBRARY_NAME = libphp4.la
|
||||
|
||||
LTLIBRARY_SOURCES = \
|
||||
main.c internal_functions.c snprintf.c php_sprintf.c \
|
||||
configuration-parser.c configuration-scanner.c \
|
||||
safe_mode.c fopen-wrappers.c php_realpath.c alloca.c \
|
||||
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
|
||||
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c php_virtual_cwd.c
|
||||
LTLIBRARY_SOURCES = stub.c
|
||||
|
||||
LTLIBRARY_DEPENDENCIES = \
|
||||
Zend/libZend.la \
|
||||
sapi/$(PHP_SAPI)/libsapi.la \
|
||||
main/libmain.la \
|
||||
$(REGEX_LIB) \
|
||||
$(EXT_LTLIBS) \
|
||||
$(TSRM_LIB)
|
||||
@@ -21,13 +16,13 @@ LTLIBRARY_DEPENDENCIES = \
|
||||
LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS)
|
||||
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS)
|
||||
|
||||
PROGRAM_NAME = $(PHP_PROGRAM)
|
||||
PROGRAM_NAME = php
|
||||
PROGRAM_SOURCES = stub.c
|
||||
PROGRAM_LDADD = libphp4.la
|
||||
PROGRAM_LDFLAGS = -export-dynamic
|
||||
PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD)
|
||||
|
||||
targets = $(LTLIBRARY_NAME) $(PROGRAM_NAME)
|
||||
targets = $(LTLIBRARY_NAME) $(PHP_PROGRAM)
|
||||
|
||||
install_targets = install-sapi install-modules
|
||||
|
||||
@@ -38,7 +33,7 @@ include $(top_srcdir)/build/program.mk
|
||||
install-sapi:
|
||||
@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
|
||||
-@$(mkinstalldirs) $(bindir)
|
||||
-@if ! test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
|
||||
-@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
|
||||
for i in 0.0.0 0.0 0; do \
|
||||
if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \
|
||||
$(LN_S) $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); \
|
||||
@@ -53,18 +48,9 @@ install-modules:
|
||||
$(mkinstalldirs) $(moduledir) && \
|
||||
echo "installing shared modules into $(moduledir)" && \
|
||||
rm -f modules/*.la && \
|
||||
cp modules/* $(moduledir) || true
|
||||
cp modules/* $(moduledir) >/dev/null 2>&1 || true
|
||||
|
||||
install-su: install-modules
|
||||
(cd pear && $(MAKE) install)
|
||||
|
||||
configuration-parser.h configuration-parser.c: $(srcdir)/configuration-parser.y
|
||||
$(YACC) -p cfg -v -d $< -o configuration-parser.c
|
||||
|
||||
configuration-scanner.c: $(srcdir)/configuration-scanner.l
|
||||
$(LEX) -Pcfg -o$@ -i $<
|
||||
|
||||
internal_functions.c: internal_functions.c.in config.status
|
||||
CONFIG_FILES= CONFIG_HEADERS= ./config.status
|
||||
|
||||
.NOEXPORT:
|
||||
@@ -1,7 +1,405 @@
|
||||
PHP 4.0 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
11 Oct 2000, Version 4.0.3
|
||||
- Fixed a possible crash in -a interactive mode (Zeev, Zend Engine)
|
||||
- Added mysql_escape_string() (Peter A. Savitch and & Brian Wang)
|
||||
- Fixed many possible crash bugs with improper use of the printf() family of
|
||||
functions (Andi)
|
||||
- Fixed a problem that allowed users to override admin_value's and admin_flag's
|
||||
(Zeev)
|
||||
- Fixed PostgreSQL module to work when the link handle is omitted (Zeev)
|
||||
- Fixed returning of empty LOB fields in OCI8. (Thies)
|
||||
- Added Calendar module to default Win32 build (Andi)
|
||||
- Added FTP module to default Win32 build (Andi)
|
||||
- Fixed crash in the POSIX getrlimit() function (alex@zend.com)
|
||||
- Fixed dirname() under certain conditions (Andi)
|
||||
- Added --with-imap-ssl to support SSL'ized imap library in RH7 and others
|
||||
(Rasmus)
|
||||
- Fixed possible crash bug in parse_url() (Andi)
|
||||
- Added support for trans sid under Win32 (Daniel)
|
||||
- IPv6 support in fopen (Stig Venaas)
|
||||
- Added the shmop extension. It allows more general ways of shared memory
|
||||
access. (thanks to Ilia Alshanestky <iliaa@home.com> and Slava Poliakov
|
||||
<slavapl@mailandnews.com> (Derick)
|
||||
- Added the ability for CURLOPT_POSTFIELDS to accept an associative array of
|
||||
HTTP POST variables and values. (Sterling)
|
||||
- Added the CURLOPT_HTTPHEADER option to curl_setopt(). (Sterling)
|
||||
- Added the curl_error() and curl_errno() functions. (Sterling)
|
||||
- Changed ext/db not to be enabled by default (Jani)
|
||||
- Fixed building Apache SAPI module on SCO UnixWare (Sascha)
|
||||
- Fixed writing empty session sets to shared memory (tcarroll@chc-chimes.com)
|
||||
- Added support for BSD/OS make (Sascha)
|
||||
- Added improved URL rewriter (Sascha)
|
||||
- Fixed readdir_r() use on Solaris (Sascha)
|
||||
- Improved HTTP headers for private-caching (jon@csh.rit.edu, Sascha)
|
||||
- Added new function session_cache_limiter (jon@csh.rit.edu, Sascha)
|
||||
- Added ftp_exec to the ftp functions (thanks to <jhennebicq@i-d.net>)
|
||||
(Derick)
|
||||
- PEAR: add last executed query as debug info in DB errors (Stig)
|
||||
- PEAR: allow multiple modes in PEAR_Error (Stig)
|
||||
- Made the Sybase CT module thread safe (Zeev)
|
||||
- Added second argument to array_reverse() that indicatese whether
|
||||
the original array keys should be preserved. (Andrei)
|
||||
- Clean up htmlspecialchars/htmlentities inconsistencies. (Rasmus)
|
||||
- PEAR: renamed DB_GETMODE_* to DB_FETCHMODE_*, added setFetchMode()
|
||||
in DB_common to set the default mode, added some MySQL tests (Stig)
|
||||
- Made eval() and several other runtime-evaluated code portions report the
|
||||
nature and location of errors more accurately (Stas)
|
||||
- Added an optional parameter to wordwrap that cuts a string if the length of a
|
||||
word is longer than the maximum allowed. (Derick)
|
||||
- Added functions pg_put_line and pg_end_copy (Dirk Elmendorf)
|
||||
- Added second parameter for parse_str to save result (John Bafford)
|
||||
- Fixed bug with curl places extra data in the output. (medvitz@medvitz.net)
|
||||
- Added the pathinfo() function. (Sterling)
|
||||
- Updated sybase_ct module and its sybase_query to use high performance API.
|
||||
(Joey)
|
||||
- Added a more configurable error reporting interface to DB. (Stig)
|
||||
- Added is_uploaded_file() and move_uploaded_file() (Zeev)
|
||||
- Added several directives to php.ini - post_max_size, file_uploads,
|
||||
display_startup_errors - see php.ini-dist for further information (Zeev)
|
||||
- Worked around a bug in the libc5 implementation of readdir() (Stas)
|
||||
- Fixed some potential OpenBSD and NetBSD crash bugs when opening files. (Andi)
|
||||
- Added EscapeShellArg() function (Rasmus)
|
||||
- Added a php.ini option session.use_trans_sid to enable/disable trans-sid.
|
||||
(Sterling)
|
||||
- Added the Sablotron extension for XSL parsing. (Sterling)
|
||||
- Fixed a bug in checkdate() which caused < 1 years to be valid (Jani)
|
||||
- Added support for an optional output handler function for output
|
||||
buffering. This enables transparent rendering of XML through XSL,
|
||||
transparent compression, etc. (Zeev)
|
||||
- Added support for user defined 'tick' callback functions. This helps
|
||||
emulate background processing. (Andrei)
|
||||
- Fixed problem with having $this as the XML parser object. (Andrei)
|
||||
- Internal opened_path variable now uses the Zend memory manager so that full
|
||||
paths of files won't leak on unclean shutdown (Andi)
|
||||
- Removed support of print $obj automatically calling the __string_value()
|
||||
method. Instead define yourself a method such as toString() and use
|
||||
print $obj->toString() (Andi, Zend Engine)
|
||||
|
||||
29 Aug 2000, Version 4.0.2
|
||||
- Added PHP API for Zend's ticks. (Stig)
|
||||
- PHP 3 regression testing framework re-born (Stig)
|
||||
- Added php_uname() function (Stig)
|
||||
- Made a minor change to allow building with OpenLDAP 2.0 (Stig Venaas)
|
||||
- Fixed a bug in preg_replace() that would truncate subject string if the
|
||||
first argument was en empty array. (Andrei)
|
||||
- Added ob_get_length function (Stig)
|
||||
- Fixed a bug that did not respect limit parameter in preg_replace() when
|
||||
using /e modifier. (Andrei)
|
||||
- Added ability for each xml_set_*_handler() function to take the
|
||||
array($obj, 'method') syntax for the handler argument as well
|
||||
as the normal function name. (Andrei)
|
||||
- Updated array_walk() to be able to accept array($obj, 'method')
|
||||
syntax for the walk function. (Andrei)
|
||||
- Fixed segfault with fgets(), fgetcsv(), fgetss(), and fread() when
|
||||
called with negative length argument. (Torben)
|
||||
- Fixed by-reference parameters passing for xml_ functions and for scanf
|
||||
functions (Stas)
|
||||
- Added experimental Oracle LDAP SDK support. 8.1.6 or later needed. Configure
|
||||
with something like --with-ldap=/usr/local/oracle/product/8.1.6 (Stig Venaas)
|
||||
- Fixed memory leaks in eval(); A script that used eval() extensively, could
|
||||
end up consuming very large amounts of memory during execution (Zeev, Zend
|
||||
Engine)
|
||||
- Fixed memory_limit feature, which did not work properly in previous versions
|
||||
(Zeev, Zend Engine)
|
||||
- Fixed stdout support with the swf extension. (Sterling)
|
||||
- Fixed byte order for ip2long and long2ip (Stas)
|
||||
- Fixed dbase_add_record. (Sterling)
|
||||
- Added support for libmcrypt 2.4.4 (Derick)
|
||||
- Added strncasecmp function (Andi, Zend Engine)
|
||||
- Fixed FTP module to accept multiline server replies (Jani)
|
||||
- Fixed switch which only has a single default rule. (Andi, Zend Engine)
|
||||
- Fixed problem with nested foreach()'s. (Andi, Zend Engine)
|
||||
- The CCVS module is now stable and compiling. It compiles as a CGI and into
|
||||
Apache cleanly without warnings. (Brendan W. McAdams)
|
||||
- Fixed mSQL_close(). (nick@loman.net)
|
||||
- Made return() in a require()'d file work like return() in an include()'d
|
||||
file (Andi & Zeev, Zend Engine)
|
||||
- Changed require_once() to work using the same table as include_once()
|
||||
(Andi & Zeev, Zend Engine)
|
||||
- Fixed PostgreSQL module to work when the link handle is omitted (Zeev)
|
||||
- Fixed the Sybase modules to work properly with PHP 4.0 (Zeev)
|
||||
- Fixed CLOB handling in OCI8 driver when using variable-width
|
||||
character sets. (Thies)
|
||||
- Added 4th optional parameter to sybase_[p]connect to specify the charset
|
||||
for the connection (alf@alpha.ulatina.ac.cr)
|
||||
- Fixed support for current thttpd releases. (Sascha)
|
||||
- Added support for kerberized IMAP library using --with-kerberos
|
||||
(Rasmus, Sascha)
|
||||
- Virtualize realpath, chmod, chown and utime (Stas)
|
||||
- Support content-encoding headers in file upload MIME parts
|
||||
(Ragnar Kjørstad)
|
||||
- Fixed warning when shutting down OCINLogon() connections. (Thies)
|
||||
- Fixed \n in session variables bug on Win32 (Stas)
|
||||
- OCIError() would sometimes not report failed connections. (Thies)
|
||||
- Fixed HEAD request bug on an Apache ErrorDocument redirect and preserve
|
||||
the status code across the redirect as well. (Rasmus)
|
||||
- Added Olympus-specific tags to read_exif_data() (Rasmus)
|
||||
- Fixed bug in imap_fetchheader() where using FT_PREFETCHTEXT didn't return
|
||||
the body. Bug #4447. (Jani)
|
||||
- Fixed exec() returning "\0" when output is empty
|
||||
- Added XML_Parser class in PEAR (Stig)
|
||||
- Added "make test" target in pear/ and added some regression tests (Stig)
|
||||
- Fixed bug in strip_tags function as per bug #5857 (Rasmus)
|
||||
- Fixed reading of IPTC via GetImageInfo() for certain JPEG files. (Thies)
|
||||
- Improved the output-buffering functions to be re-entrant (Zeev)
|
||||
- Made ldap_add(), ldap_modify(), ldap_mod_add(), ldap_mod_replace()
|
||||
binary-safe. Original patch: Terrence Miao <terrence_miao@email.com> (Jani)
|
||||
- CGI aka. command line version has now an option '-l' for syntax check
|
||||
without execution (Hartmut)
|
||||
- Fixed bug in ldap_get_values_len() which makes it NULL-safe. (Jani)
|
||||
- Bug-report and fix submitted by Michel Alexeline <alexel@dr15.cnrs.fr>
|
||||
- Make ext_skel create a Makefile.in set up to handle shared extension
|
||||
support automatically (Rasmus)
|
||||
- Fixed php_realpath not to die on non-existing files (needed for touch())
|
||||
(Stas and china@thewrittenword.com)
|
||||
- Fixed get_browser() function (Stas)
|
||||
- Fixed symbol clash which caused a DSO problem on OpenBSD (Rob Black and
|
||||
anil@recoil.org)
|
||||
- Added new function: ldap_compare(). (Jani)
|
||||
- Fixed a bug in ldap_get_entries() and ldap_get_attributes(). (Jani)
|
||||
- Ported DB to new error reporting scheme in PEAR. (Stig)
|
||||
- Added sybase and ibase DB backends in PEAR. (Sterling)
|
||||
- New PEAR package Payment_Verisign for use with the Payflow Pro
|
||||
(pfpro) extension. (David Croft)
|
||||
- Added CURL support. (Sterling)
|
||||
- Catch users trying to set "compatibility" parameter in PDF, which is not
|
||||
supported from user-land. (Joey)
|
||||
- Fixed dbase_add_record. (Sterling)
|
||||
- Added new function wordwrap() to wordwrap long strings from Chris
|
||||
Russel <russel@yorku.ca> (David Croft)
|
||||
- Added four additional arguments: attrsonly, sizelimit, timelimit, deref which
|
||||
were missing in ldap_search(), ldap_list() and ldap_read() functions (Jani)
|
||||
- Fixed a bug in ldap_search/list/read() which prevented returning the partial
|
||||
results when 'Sizelimit exceeded' error occurred. (Jani Taskinen)
|
||||
- Fixed preg_replace() to automatically escape quotes in matched
|
||||
strings when using /e modifier. (Andrei)
|
||||
- Itanium patch (Steve Robb)
|
||||
- Set default include_path so PEAR files can be reached (Stig)
|
||||
- Added "pear" executable, requires CGI version installed (Stig)
|
||||
- Added extension ii for Ingres II native support. See README in ext/ingres_ii
|
||||
directory. (David H)
|
||||
- Added Win32 project for the Interbase module (Zeev)
|
||||
- Added ability to perform calls to the parent class without explicitly
|
||||
specifying its name, using parent::func_name(...) (Zeev, Zend Engine)
|
||||
- You can now call Ora_Error() without prameters to get the reason
|
||||
for a failed connection attempt. (Kirill Maximov)
|
||||
- New extension "pfpro" for interface with Verisign Payflow Pro (David Croft)
|
||||
- Added IMG_GIF, IMG_JPG, IMG_JPEG, IMG_PNG and IMG_WBMP constants for
|
||||
imagetypes() function (Rasmus)
|
||||
- Added ImageTypes() function which returns a bitfield with the supported
|
||||
image formats. 1=gif, 2=jpeg, 4=png and 8=wbmp (Rasmus)
|
||||
- Make it possible to specify an empty string as a thousands-seperator
|
||||
in number_format() (Rasmus)
|
||||
- Shared module support for LDAP extension (Troels Arvin)
|
||||
- Fixed a bug with imap_mail where apache would segfault if the rpath
|
||||
parameter was specified.
|
||||
- Use dashes and short day name in cookies since some browsers seem picky
|
||||
about this (Rasmus)
|
||||
- Added pspell module. (Vlad)
|
||||
- Added 3 additional arguments to the user-defined error handler - the file
|
||||
name and line number in which the error occured, and the context (local
|
||||
variables) of the code in which the error occured (Zeev, Zend Engine)
|
||||
- Improved the error handling code to handle an error in a user-defined error
|
||||
handling function (Zeev, Zend Engine)
|
||||
- Fixed leak when using string offsets in the array() construct.
|
||||
(Andi, Zend Engine)
|
||||
- Fixed corruption problem when changing deeply nested values in objects.
|
||||
(Andi & Zeev, Zend Engine)
|
||||
- Improved array_multisort() to be able to specify sort type as well sort
|
||||
order. Incidentally, it can be used to sort multi-dimensional arrays
|
||||
as well. (Andrei)
|
||||
- Fixed a possible data corruption in case of a huge amount of aborted requests
|
||||
(Zeev)
|
||||
- Apache module would sometimes close a wrong file-descriptor. (Sascha)
|
||||
- Fixed use of alternative storage handlers in the session module. (Sascha)
|
||||
- Updated str_pad() to be able to pad on left/right/both sides. (Andrei)
|
||||
- Fixed crash in gzopen(). (Thies)
|
||||
- Multiple character set support in gdttf.c (Rob Goodwin)
|
||||
- When using HTTP auth from PHP, fill in the %u custom log field so the
|
||||
authenticated used id will get logged in the Apache access_log (Rasmus)
|
||||
- Support for pdflib 3.01. (Uwe)
|
||||
- FDF Data is handled properly and can be accessed by reading
|
||||
HTTP_RAW_POST_DATA. (Uwe)
|
||||
- Added new 'O' format modifier that will output the GMT offset as "[+-]HHMM"
|
||||
(eg: Pacific time is -0700). This is useful for things such as Date: mail
|
||||
headers. (Mike W)
|
||||
- Fixed crash on OCI?Logon() failure. (Thies)
|
||||
- Make the special Header("http/...") response be case insensitive like 3.0
|
||||
(Rasmus)
|
||||
- Allow cybercash to compile as a DL module. (Sterling)
|
||||
- Fixed the dbase_create function. (Sterling)
|
||||
- Fixed a problem under some versions of Windows that could cause PHP to hang
|
||||
on startup if errors occured, e.g. in the php.ini file (Zeev)
|
||||
- Fixed opendir() again. It should actually work well continuously now (Zeev)
|
||||
- Added three additional arguments to be sent to a user-defined error handler -
|
||||
the filename and line number in which the error occured, and the context
|
||||
(the local variables) of the error (Zeev, Zend Engine)
|
||||
- Improved the error handling code to handle an error in a user-defined error
|
||||
handling function (Zeev, Zend Engine)
|
||||
- Added an optional parameter to preg_replace() that can be used to
|
||||
specify how many replacements to make. (Andrei)
|
||||
|
||||
28 Jun 2000, Version 4.0.1
|
||||
- Fixed a possible crash in the LDAP modify code. (Eric Kilfoil)
|
||||
- Fixed a bug in opendir(), which prevented readdir() from working properly if
|
||||
the $dir argument wasn't explicitly specified (Zeev)
|
||||
- Made --enable-discard-path work again. (Andi)
|
||||
- Removed 8KB limit on line length of the file() function (Zeev)
|
||||
- Disabled dl() when PHP is being used as a module inside a multithreaded web
|
||||
server - it didn't work before, and caused weird results (Zeev)
|
||||
- Added the ImageColorClosestHWB(), ImageCopyMerge() and ImagePaletteCopy()
|
||||
functions. (Sterling)
|
||||
- Added ImageCreateFromWBMP() function. (Jouni)
|
||||
- Fixed problems with POST requests under the NSAPI module. (Roberto Biancardi)
|
||||
- Added spliti() function. (Thies)
|
||||
- Fixed serializer behaviour with regards to serializing objects whose class
|
||||
definition was not available in the deserializing context. (Sascha)
|
||||
- Improve memory cache performance and increase cache size. (Stas, Zend Engine)
|
||||
- Added a crc32 checksum function - used by the UdmSearch search engine
|
||||
and currently run through a system call. This will speed up the UdmSearch
|
||||
php frontend significantly. (Rasmus)
|
||||
- Modified in_array() to not touch array pointer. (Andrei)
|
||||
- Added restore_error_handler(). (Zeev, Zend engine)
|
||||
- Fixed erroneous file names and line numbers in error situations under the
|
||||
multithreaded version of PHP - most noticeably Win32 (Zeev, Zend Engine)
|
||||
- Fixed problem with CGI crashing on certain servers especially Windows Apache
|
||||
& O'Reilly website (Andi)
|
||||
- Added Pi3Web SAPI module; run ./configure --with-pi3web to enable this.
|
||||
(Holger; zimpel@t-online.de)
|
||||
- Enhanced WDDX functions to call __sleep() and __wakeup() when working on
|
||||
objects. (Andrei)
|
||||
- Changed WDDX to serialize arrays as structs only if needed. (Thies)
|
||||
- Implemented max_execution_time under Win32 (Zeev)
|
||||
- Updated strtotime() to handle many more formats. It now has complete
|
||||
feature parity with GNU date command. (Andrei)
|
||||
- Added support for multiple arguments in unset(). (Faisal, Zend Engine)
|
||||
- Functions that expect a resource but are passed something else now return
|
||||
NULL instead of FALSE. (Thies, Zend Engine)
|
||||
- Fixed gmmktime(), on certain systems it incorrectly adjusted for the timezone
|
||||
offset and daylight savings time. (Andrei)
|
||||
- Moved VC++ Win32 project and workspace files to the win32 directory
|
||||
(Zeev)
|
||||
- Fixed checkdate() to not return true on non-numeric arguments (Rasmus)
|
||||
- Added --enable-c9x-inline option for compilers which support the new C9x
|
||||
standard. If you encounter undefined references to i_zend_is_true and
|
||||
other symbols, you should enable this. (Sascha, Zend Library)
|
||||
- Fixed a problem in ldap_add() and ldap_modify(), sometimes added trailing
|
||||
garbage to the values (Stig Venaas)
|
||||
- Fixed a problem with dbmopen() not handing 'c' correctly with dbm/db/ndbm
|
||||
databases. (JimJag)
|
||||
- Fixed a crash in number_format() when used with locales. (Andrei)
|
||||
- Fixed an initialization problem in the MS-SQL problem that could cause
|
||||
a crash in mssql_query() (Zeev)
|
||||
- Upgraded PCRE to version 3.2 and fixed a bug when anchored pattern
|
||||
matched an empty string. (Andrei)
|
||||
- Fixed a bug that prevented PHP from paying attention to the extension_dir
|
||||
directive with extensions that were loaded from the php.ini file (Zeev)
|
||||
- Changed set_error_handler() to return the name of the previously defined
|
||||
error handler, if any (Zeev, Zend Engine)
|
||||
- Declared <?php_track_vars?> officially dead. It didn't work in PHP 4.0.0
|
||||
either, but now it's gone for good (Zeev)
|
||||
- Make convert_cyr_string() binary safe and stop it from corrupting other
|
||||
PHP variables. (Andi)
|
||||
- Added functions array_unique, array_intersect and array_diff (Stig Venaas)
|
||||
- Fixed problem when using uninitialized values in comparisons with strings.
|
||||
They behave as empty strings again just like in PHP 3.
|
||||
(Andi & Zeev, Zend Engine)
|
||||
- Fixed 'Z' flag in date() to adjust for daylight savings time. (Andrei)
|
||||
- Fixed var_dump() not to modify the internal order of array elements (Zeev)
|
||||
- Fixed stripcslashes() to remove to strip \ in unknown escapes instead of
|
||||
leaving it. (Andrei)
|
||||
- Changed WDDX to always serialize arrays as structs. (Andrei)
|
||||
- Fixed include_once() to issue a warning in case the supplied file name is
|
||||
not found (Zeev, Zend Engine)
|
||||
- Fixed a bug in get_declared_classes() which could return the same class
|
||||
multiple times under certain circumstances (Zeev, Zend Engine)
|
||||
- Fixed a bug in rawurldecode() that would cause in rawurldecode() corrupting
|
||||
its argument (Zeev)
|
||||
- Parse errors (or other errors) in the php.ini files under Windows will no
|
||||
longer mess up the HTTP headers in CGI mode and are now displayed in a
|
||||
message box (Zeev)
|
||||
- Fixed a crash in OCIFetchStatement() when trying to read after all data
|
||||
has already been read. (Thies)
|
||||
- fopen_wrappers() are now extensible via modules (Hartmut Holzgraefe)
|
||||
- Make trim strip \0 to match php 3 (Rasmus)
|
||||
- Added function imagecreatefromxbm(). (Jouni)
|
||||
- Added function imagewbmp(). (Jouni, based on patch from Rune Nordbøe
|
||||
Skillingstad)
|
||||
- Added str_pad() for padding a string with an arbitrary string on left or
|
||||
right. (Andrei)
|
||||
- Made the short_tags, asp_tags and allow_call_time_pass_reference INI
|
||||
directives work on a per-directory basis as well, e.g. from .htaccess
|
||||
files. (Zeev)
|
||||
- Added fflush() function. (Eric Huss)
|
||||
- Fixed a problem with static variables, default function arguments and class
|
||||
member variables, that contained array values. (Andi & Zeev, Zend Engine)
|
||||
- Fixed virtual() when used with output buffering (Marc Pohl)
|
||||
- Clean up constants in flock() function and add optional 3rd arg which
|
||||
is set to true on EWOULDBLOCK (Rasmus)
|
||||
- Added functions pg_loimport(), pg_loexport(). (Jouni)
|
||||
- Added SWF support to getimagesize() function (Derick Rethans)
|
||||
- Added support for both indexed and non-indexed arrays of file uploads
|
||||
eg. name="file[]" type="file" (Rasmus)
|
||||
- Added create_function(), which gives the ability to create functions
|
||||
on-the-fly (Zeev, Zend Engine)
|
||||
- Added support for comparisons of arrays (with arrays) and objects (with
|
||||
objects); The equality operator (==) performs an unordered comparison,
|
||||
whereas the identity operator (===) performs an ordered comparison (Zeev,
|
||||
Zend Engine)
|
||||
- Allow all functions that receive user-defined function callbacks to accept
|
||||
an array that contains an object and a method name, in place of a function
|
||||
name, e.g. usort($array, array($obj, "ObjSort")) (Zeev, Zend Engine)
|
||||
- Added set_error_handler() to allow custom error handling functions,
|
||||
instead of the built-in error handling code (Zeev, Zend Engine)
|
||||
- Renamed user_error() to trigger_error(); user_error() remains
|
||||
defined for compatibility (Zeev, Zend Engine)
|
||||
- Fixed the global/static statements to require a trailing terminating
|
||||
semi-colon ';'. (Andi, Zend Engine)
|
||||
- Cleaned up PCRE extension and made it binary-safe. (Andrei)
|
||||
- Added third argument to in_array(). If it's true, then in_array()
|
||||
will use strict comparison instead of the default one. (Andrei)
|
||||
- Added pg_trace() and pg_untrace (Dominic J. Eidson & Zeev)
|
||||
- ignore_user_abort=Off is now default. (Thies)
|
||||
- Added array_merge_recursive() that will recursively merge values
|
||||
under the same keys. (Andrei)
|
||||
- fixed crash in OCIParse when parsing invalid SQL. (Thies)
|
||||
- Fixed a bug in mysql_connect() that made it ignore the socket argument, in
|
||||
case of non-persistent connects (Zeev)
|
||||
- Added disable_functions php.ini directive, to allow administrators to disable
|
||||
certain functions for security reasons (Zeev)
|
||||
- Fixed sessions on Win32. When setting the directory depth parameter in
|
||||
save_path you need to now delimit it with a ';' instead of ':', e.g
|
||||
"5;/tmp" instead of "5:/tmp" (Andi)
|
||||
- Changed the Apache handler's return status to 'Declined' when a requested
|
||||
PHP file could not be found. Returning 'Not Found' caused problems
|
||||
in the ErrorDocument handler stage in that $REDIRECT_REDIRECT_ERROR_NOTES
|
||||
was not getting set at all. Moving to 'Declined' should fix this and I
|
||||
can't see any other side effects. (Rasmus)
|
||||
- Fixed scanning decimal numbers in internationalized environments. They should
|
||||
always be in standard US format e.g. 23.3. (Andi, Zend Engine)
|
||||
- Added second argument to preg_quote() which allows quoting of
|
||||
one additional character, usually the regex delimiter. (Andrei)
|
||||
- Uncommitted outstanding OCI8 transactions are now rolled back
|
||||
before the connection is closed. (Thies)
|
||||
- ignore_user_abort() & friends should now work in CGI mode as well.
|
||||
(Patch by daniel.braun@ercom.fr)
|
||||
- Added extension YAZ (dickmeiss).
|
||||
- Fixed a crash bug triggered by certain cases of class redeclarations
|
||||
(Stas & Zeev, Zend Engine)
|
||||
- Fixed min()/max() segfault. (Andrei)
|
||||
- New module for reading EXIF header data from JPEG files. Most digital
|
||||
cameras will embed all sorts of information about a picture inside the
|
||||
jpeg images it generates. (Rasmus)
|
||||
- Fixed basename() bug where "file.ext///" would not return the same
|
||||
as "/path/file.ext///" (Rasmus)
|
||||
- Added the swf_ortho function. (Sterling)
|
||||
- Moved to virtual current working directory support. This highly improves the
|
||||
functionality and stability of multi-threaded versions of PHP (Andi, Sascha)
|
||||
|
||||
22 May 2000, Version 4.0.0 Release
|
||||
- Allow the writing of flash files to stdout.
|
||||
- Fixed a crash bug in .phps syntax-highlighted files (Andi)
|
||||
- Improved round() to allow specification of rounding precision.
|
||||
(Andrei, Todd Kirby <kirbyt@yahoo.com>)
|
||||
@@ -31,8 +429,8 @@ PHP 4.0 NEWS
|
||||
- ImagePolygon() is no longer limited by a maximum number of polygons.
|
||||
(Marc Pohl)
|
||||
- Added configure time checking for bcmath package. (Joey, Sascha)
|
||||
- Added get_declared_classes(). (Andrei, Zend library)
|
||||
- Add initial NSAPI module from Jayakumar Muthukumarasamy. (Rasmus)
|
||||
- Added get_declared_classes(). (Andrei, Zend Engine)
|
||||
- Added initial NSAPI module from Jayakumar Muthukumarasamy. (Rasmus)
|
||||
- Added the SWF module which allows you to create Macromedia Flash files via
|
||||
libswf. (Sterling)
|
||||
- Improved UNIX build system to support more vendor make tools (Sascha)
|
||||
@@ -41,7 +439,7 @@ PHP 4.0 NEWS
|
||||
- Fixed a crash in array_multisort() that happened when empty arrays
|
||||
were passed to it. (Andrei)
|
||||
- Added substr_count() from Peter Kovacs. (Andrei)
|
||||
- Add an optional third argument to fseek to indicate where to seek from.
|
||||
- Added an optional third argument to fseek to indicate where to seek from.
|
||||
(Andrei)
|
||||
- OCIBindByName() will no longer complain about bindlength beeing zero. (Thies)
|
||||
- Converted the IMAP module to the high performance API (Zeev)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ Having said that, here are the organizational rules:
|
||||
|
||||
2. Discuss any significant changes on the list before committing.
|
||||
|
||||
3. Look at MAINTANERS file to see who is the primary maintainer of
|
||||
3. Look at EXTENSIONS file to see who is the primary maintainer of
|
||||
the code you want to contribute to.
|
||||
|
||||
4. If you "strongly disagree" about something another person did, don't
|
||||
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
|
||||
WHAT IT IS
|
||||
|
||||
It's a tool for automatically creating the basic framework for a PHP module
|
||||
and writing C code handling arguments passed to your functions from a simple
|
||||
configuration file. See an example at the end of this file.
|
||||
|
||||
HOW TO USE IT
|
||||
|
||||
Very simple. First, cd do directory ext/ in PHP 4 sources. If you just need
|
||||
the basic framework and will be writing all the code in your functions
|
||||
yourself, you can now do
|
||||
|
||||
./ext_skel --extname=module_name
|
||||
|
||||
and everything you need is placed in directory module_name. In fact, if you
|
||||
don't need to test the existence of any external header files, libraries or
|
||||
functions in them, the module is already almost ready to be compiled in PHP.
|
||||
Just remove 3 comments in your_module_name/config.m4, cd back up to PHP
|
||||
sources top directory, and do
|
||||
|
||||
./buildconf; ./configure --enable-module_name; make
|
||||
|
||||
But if you already have planned the overall scheme of your module, what
|
||||
functions it will contain, their return types and the arguments they take
|
||||
(a very good idea) and don't want to bother yourself with creating function
|
||||
definitions and handling arguments passed yourself, it's time to create a
|
||||
function definitions file, which you will give as an argument to ext_skel
|
||||
with option
|
||||
|
||||
--proto=filename.
|
||||
|
||||
FORMAT OF FUNCTION DEFINITIONS FILE
|
||||
|
||||
All the definitions must be on one line. In it's simplest form, it's just
|
||||
the function name, ie.
|
||||
|
||||
my_function
|
||||
|
||||
but then you'll be left with an almost empty function body without any
|
||||
argument handling.
|
||||
|
||||
Arguments are given in parenthesis after the function name, and are of
|
||||
the form 'argument_type argument_name'. Arguments are separated from each
|
||||
other with a comma and optional space. Argument_type can be one of int,
|
||||
bool, double, float, string, array, object or mixed.
|
||||
|
||||
An optional argument is separated from the previous by an optional space,
|
||||
then '[' and of course comma and optional space, like all the other
|
||||
arguments. You should close a row of optional arguments with same amount of
|
||||
']'s as there where '['s. Currently, it does not harm if you forget to do it
|
||||
or there is a wrong amount of ']'s, but this may change in the future.
|
||||
|
||||
An example:
|
||||
|
||||
my_function(int arg1, int arg2 [, int arg3 [, int arg4]])
|
||||
|
||||
Arguments arg3 and arg4 are optional.
|
||||
|
||||
If possible, the function definition should also contain it's return type
|
||||
in front of the definition. It's not actually used for any C code generating
|
||||
purposes but PHP in-source documentation instead, and as such, very useful.
|
||||
It can be any of int, double, string, bool, array, object, resource, mixed
|
||||
or void.
|
||||
|
||||
The file must contain nothing else but function definitions, no comments or
|
||||
empty lines.
|
||||
|
||||
OTHER OPTIONS
|
||||
|
||||
--no-help
|
||||
|
||||
By default, ext_skel creates both comments in the source code and a test
|
||||
function to help first time module writers to get started and testing
|
||||
configuring and compiling their module. This option turns off all such things
|
||||
which may just annoy experienced PHP module coders. Especially useful with
|
||||
|
||||
--stubs=file
|
||||
|
||||
which will leave out also all module specific stuff and write just function
|
||||
stubs with function value declarations and passed argument handling, and
|
||||
function entries and definitions at the end of the file, for copying and
|
||||
pasting into an already existing module.
|
||||
|
||||
--assign-params
|
||||
--string-lens
|
||||
|
||||
By default, function proto 'void foo(string bar)' creates the following:
|
||||
...
|
||||
zval **bar;
|
||||
... (zend_get_parameters_ex() called in the middle...)
|
||||
convert_to_string_ex(bar);
|
||||
|
||||
Specifying both of these options changes the generated code to:
|
||||
...
|
||||
zval **bar_arg;
|
||||
int bar_len;
|
||||
char *bar = NULL;
|
||||
... (zend_get_parameters_ex() called in the middle...)
|
||||
convert_to_string_ex(bar_arg);
|
||||
bar = Z_STRVAL_PP(bar_arg);
|
||||
bar_len = Z_STRLEN_PP(bar_arg);
|
||||
|
||||
You shouldn't have to ask what happens if you leave --string-lens out. If you
|
||||
have to, it's questionable whether you should be reading this document.
|
||||
|
||||
--with-xml[=file]
|
||||
|
||||
Creates the basics for phpdoc .xml file.
|
||||
|
||||
--full-xml
|
||||
|
||||
Not implemented yet. When or if there will ever be created a framework for
|
||||
self-contained extensions to use phpdoc system for their documentation, this
|
||||
option enables it on the created xml file.
|
||||
|
||||
CURRENT LIMITATIONS, BUGS AND OTHER ODDITIES
|
||||
|
||||
Only arguments of types int, bool, double, float, string and array are
|
||||
handled. For other types you must write the code yourself. And for type
|
||||
mixed, it wouldn't even be possible to write anything, because only you
|
||||
know what to expect.
|
||||
|
||||
It can't handle correctly, and probably never will, variable list of
|
||||
of arguments. (void foo(int bar [, ...])
|
||||
|
||||
Don't trust too much the generated code. It tries to be useful in most of
|
||||
the situations you might encounter, but automatic code generating will never
|
||||
beat a programmer who knows the real situation at hand. ext_skel is generally
|
||||
best suited for quickly generating a wrapper for c-library functions you
|
||||
might want to have available in PHP too.
|
||||
|
||||
This program doesn't have a --help option. It has --no-help instead.
|
||||
|
||||
EXAMPLE
|
||||
|
||||
The following _one_ line
|
||||
|
||||
bool my_drawtext(resource image, string text, resource font, int x, int y [, int color])
|
||||
|
||||
will create this function definition for you (note that there are a few
|
||||
question marks to be replaced by you, and you must of course add your own
|
||||
value definitions too):
|
||||
|
||||
/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y[, int color])
|
||||
*/
|
||||
PHP_FUNCTION(my_drawtext)
|
||||
{
|
||||
zval **image, **text, **font, **x, **y, **color;
|
||||
int argc;
|
||||
int image_id = -1;
|
||||
int font_id = -1;
|
||||
???LS_FETCH();
|
||||
|
||||
argc = ZEND_NUM_ARGS();
|
||||
if (argc < 5 || argc > 6 || zend_get_parameters_ex(argc, &image, &text, &font, &x, &y, &color) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(???, ???, image, image_id, "???", ???G());
|
||||
ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???G());
|
||||
|
||||
switch (argc) {
|
||||
case 6:
|
||||
convert_to_long_ex(color);
|
||||
/* Fall-through. */
|
||||
case 5:
|
||||
convert_to_long_ex(y);
|
||||
convert_to_long_ex(x);
|
||||
/* font: fetching resources already handled. */
|
||||
convert_to_string_ex(text);
|
||||
/* image: fetching resources already handled. */
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
php_error(E_WARNING, "my_drawtext: not yet implemented");
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -14,6 +14,19 @@ HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
|
||||
We will describe now how to create these and how to put things
|
||||
together.
|
||||
|
||||
PREPARING YOUR SYSTEM
|
||||
|
||||
While the result will run on any system, a developer's setup needs these
|
||||
tools:
|
||||
|
||||
GNU autoconf
|
||||
GNU automake
|
||||
GNU libtool
|
||||
GNU m4
|
||||
|
||||
All of these are available from
|
||||
|
||||
ftp://ftp.gnu.org/pub/gnu/
|
||||
|
||||
CONVERTING AN EXISTING EXTENSION
|
||||
|
||||
@@ -69,7 +82,7 @@ CREATING THE MAKEFILE TEMPLATE
|
||||
LTLIBRARY_SHARED_NAME = foobar.la
|
||||
LTLIBRARY_SOURCES = foo.c bar.c
|
||||
|
||||
include $(top_srcdir)/build/rules.mk
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
LTLIBRARY_SHARED_NAME specifies the name of the extension.
|
||||
@@ -93,17 +106,27 @@ CREATING THE M4 CONFIGURATION FILE
|
||||
PHP_ARG_ENABLE(foobar,whether to enable foobar,
|
||||
[ --enable-foobar Enable foobar])
|
||||
|
||||
PHP_EXTENSION(foobar, $ext_shared)
|
||||
if test "$PHP_FOOBAR" != "no"; then
|
||||
PHP_EXTENSION(foobar, $ext_shared)
|
||||
fi
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
PHP_ARG_ENABLE will automatically set the correct variables, so
|
||||
that the extension will be enabled by PHP_EXTENSION in shared mode.
|
||||
|
||||
Please use always PHP_ARG_ENABLE or PHP_ARG_WITH. Even if you do not
|
||||
plan to distribute your module with PHP, these facilities allow you
|
||||
to integrate your module easily into the main PHP module framework.
|
||||
|
||||
CREATING SOURCE FILES
|
||||
|
||||
[You are currently alone here. There are a lot of existing modules,
|
||||
use a simply module as a starting point and add your own code.]
|
||||
ext_skel can be of great help when creating the common code for all modules
|
||||
in PHP for you and also writing basic function definitions and C code for
|
||||
handling arguments passed to your functions. See README.EXT_SKEL for further
|
||||
information.
|
||||
|
||||
As for the rest, you are currently alone here. There are a lot of existing
|
||||
modules, use a simple module as a starting point and add your own code.
|
||||
|
||||
|
||||
CREATING THE SELF-CONTAINED EXTENSION
|
||||
@@ -126,4 +149,26 @@ INSTALLING A SELF-CONTAINED EXTENSION
|
||||
$ ./configure \
|
||||
[--with-php-config=/path/to/php-config]
|
||||
$ make install
|
||||
|
||||
|
||||
ADDING SHARED MODULE SUPPORT TO A MODULE
|
||||
|
||||
In order to be useful, a self-contained extension must be loadable
|
||||
as a shared module. I will explain now how you can add shared module
|
||||
support to an existing module called foo.
|
||||
|
||||
1. In config.m4, use PHP_ARG_WITH/PHP_ARG_ENABLE. Then you will
|
||||
automatically be able to use --with-foo=shared or
|
||||
--enable-foo=shared.
|
||||
|
||||
2. In config.m4, use PHP_EXTENSION(foo, $ext_shared) to enable
|
||||
building the extension.
|
||||
|
||||
3. Add the following line to Makefile.in:
|
||||
|
||||
LTLIBRARY_SHARED_NAME = foo.la
|
||||
|
||||
4. Add the following lines to your C source file:
|
||||
|
||||
#ifdef COMPILE_DL_FOO
|
||||
ZEND_GET_MODULE(foo)
|
||||
#endif
|
||||
+16
-1
@@ -51,9 +51,21 @@ that you wish to run PHP on:
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
*) Why does the compile fail at Zend/zend-scanner-cc.cc
|
||||
or Zend/zend-parser.c ?
|
||||
|
||||
These source files are auto-generated from the corresponding .y files.
|
||||
The default distribution of PHP contains pre-generated versions of these
|
||||
files that have caused problems for some people. The simplest solution is
|
||||
to delete the files. They will then be rebuilt correctly. You must have the
|
||||
following GNU tools to do this:
|
||||
|
||||
bison 1.28 or later
|
||||
flex 2.5.4 or later
|
||||
|
||||
*) Why does my PHP library fail to load?
|
||||
|
||||
After configuring Zeus, if you get a '502 Bad Gatway' error when
|
||||
After configuring Zeus, if you get a '502 Bad Gateway' error when
|
||||
accessing a PHP page, there are problems loading the PHP
|
||||
library. Check the error log ($ZEUSHOME/web/log/errors) for errors.
|
||||
|
||||
@@ -81,6 +93,9 @@ Ensure you run ./configure with the `--enable-libgcc' parameter. You
|
||||
may need to set LDFLAGS to '-L/usr/local/egcs/lib' (path depends on
|
||||
your gcc installation)
|
||||
|
||||
FreeBSD 4.0:
|
||||
Some people may find they need to run ./configure with the
|
||||
'--enable-libgcc' compile option too.
|
||||
|
||||
|
||||
For more information and help with Zeus, please visit our website:
|
||||
|
||||
@@ -6,14 +6,17 @@ Zend
|
||||
* allow foreach ($array as $k => &$val) syntax. right now we cannot
|
||||
traverse an array without copying each element.
|
||||
* look at replacing c-lib call tolower().
|
||||
* make hash API functions work with HASH_OF() to save time.
|
||||
|
||||
global
|
||||
------
|
||||
* make everything on the language-level independent of your locale setings.
|
||||
* always build the standalone executable as well as the chosen SAPI
|
||||
target.
|
||||
* make sure all source files have the "right" copyright.
|
||||
* the following modules still use PHP3_TLS_*() macros (and thereby don't
|
||||
work in ZTS mode): ext/dav/dav.c, ext/db/db.c, ext/gd/gd.c, ext/ldap/ldap.c
|
||||
* INI system causes segfaults in ZTS mode (operates on static HashTable)
|
||||
* make sure that all ZTS globals get destructed. Most ts_allocate_id()
|
||||
calls should have a dtor entry.
|
||||
* activate all extensions by default that don't rely on external
|
||||
@@ -35,6 +38,8 @@ global
|
||||
available in ZTS mode.
|
||||
* add aliases to functions to conform to new naming conventions, e.g.
|
||||
str_to_upper().
|
||||
* see what functions might need to be changed to use HashPosition, so
|
||||
that the internal array pointer is not affected.
|
||||
|
||||
documentation
|
||||
-------------
|
||||
@@ -53,24 +58,30 @@ ext/oci8
|
||||
--------
|
||||
* all OCIFetch*() functions should return 0 for no more data and false on error.
|
||||
* have a flag that trims trailing spaces from CHAR fields on retrieval.
|
||||
* make allow_call_time_pass_reference=Off working.
|
||||
|
||||
ext/pcre
|
||||
--------
|
||||
* have a non-greedy option for preg_replace().
|
||||
* have an option for preg_grep() to return keys as well.
|
||||
* update the online docs from version 3.1 man page
|
||||
|
||||
ext/session
|
||||
-----------
|
||||
* implement a call to set a session read-only to overcome
|
||||
the need to serialize frame-loads.
|
||||
* maybe implement finer-grained session variables that could be
|
||||
locked individually.
|
||||
* write a network-transparent storage back-end with fallover
|
||||
facilities
|
||||
|
||||
ext/standard
|
||||
------------
|
||||
* add a version number to data serialized via serialize().
|
||||
* array_add(), array_uniq(). (Andrei)
|
||||
* implement pathinfo() (what the heck is it?)
|
||||
* array_add(). (Andrei)
|
||||
* possibly modify parsing of GPC data to automatically create arrays if
|
||||
variable name is seen more than once.
|
||||
* implement regex-cache for url-functions.
|
||||
* strpad(). (Andrei)
|
||||
* strcase_replace(). (Andrei)
|
||||
* comparing arrays semantically (like Python). (Andrei)
|
||||
* move socket related functions to fsock.c.
|
||||
* get_defined_funcs(), get_defined_vars().
|
||||
* NOT binary safe:
|
||||
@@ -83,7 +94,6 @@ ext/standard
|
||||
|
||||
ext/wddx
|
||||
--------
|
||||
* implement __sleep() and __wakeup() the way serialize()/unserialize() do.
|
||||
* See if we can support the remaining datatypes:
|
||||
dateTime
|
||||
binary
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Neither name of the copyright holders nor the names of their contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
||||
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
## process this file with automake to produce Makefile.am
|
||||
AUTOMAKE_OPTIONS=foreign
|
||||
noinst_LTLIBRARIES=libtsrm.la
|
||||
libtsrm_la_SOURCES = TSRM.c
|
||||
libtsrm_la_SOURCES = TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c
|
||||
|
||||
depend:
|
||||
@@ -0,0 +1,2 @@
|
||||
- Improve the lock in ts_resource_ex() in order to cover less code.
|
||||
This can probably be done by more careful hash table access
|
||||
+21
-15
@@ -2,19 +2,18 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Zeev Suraski |
|
||||
| Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski|
|
||||
| This source file is subject to the TSRM license, that is bundled |
|
||||
| with this package in the file LICENSE |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to the Zend license, that is bundled |
|
||||
| with this package in the file LICENSE. If you did not receive a |
|
||||
| copy of the Zend license, please mail us at zend@zend.com so we can |
|
||||
| send you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Zeev Suraski <zeev@zend.com> |
|
||||
| Authors: Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#include "TSRM.h"
|
||||
|
||||
#ifdef ZTS
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -207,13 +206,18 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
|
||||
|
||||
|
||||
/* fetches the requested resource for the current thread */
|
||||
void *ts_resource(ts_rsrc_id id)
|
||||
TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
|
||||
{
|
||||
THREAD_T thread_id = tsrm_thread_id();
|
||||
THREAD_T thread_id;
|
||||
int hash_value;
|
||||
tsrm_tls_entry *thread_resources;
|
||||
void *resource;
|
||||
|
||||
if (th_id) {
|
||||
thread_id = *th_id;
|
||||
} else {
|
||||
thread_id = tsrm_thread_id();
|
||||
}
|
||||
tsrm_debug("Fetching resource id %d for thread %ld\n", id, (long) thread_id);
|
||||
tsrm_mutex_lock(tsmm_mutex);
|
||||
|
||||
@@ -306,7 +310,7 @@ void ts_free_id(ts_rsrc_id id)
|
||||
/* Obtain the current thread id */
|
||||
TSRM_API THREAD_T tsrm_thread_id(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef TSRM_WIN32
|
||||
return GetCurrentThreadId();
|
||||
#elif defined(GNUPTH)
|
||||
return pth_self();
|
||||
@@ -325,7 +329,7 @@ TSRM_API MUTEX_T tsrm_mutex_alloc( void )
|
||||
{
|
||||
MUTEX_T mutexp;
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef TSRM_WIN32
|
||||
mutexp = malloc(sizeof(CRITICAL_SECTION));
|
||||
InitializeCriticalSection(mutexp);
|
||||
#elif defined(GNUPTH)
|
||||
@@ -350,7 +354,7 @@ TSRM_API MUTEX_T tsrm_mutex_alloc( void )
|
||||
TSRM_API void tsrm_mutex_free( MUTEX_T mutexp )
|
||||
{
|
||||
if (mutexp) {
|
||||
#ifdef WIN32
|
||||
#ifdef TSRM_WIN32
|
||||
DeleteCriticalSection(mutexp);
|
||||
#elif defined(GNUPTH)
|
||||
free(mutexp);
|
||||
@@ -375,7 +379,7 @@ TSRM_API int tsrm_mutex_lock( MUTEX_T mutexp )
|
||||
#if 0
|
||||
tsrm_debug("Mutex locked thread: %ld\n",tsrm_thread_id());
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#ifdef TSRM_WIN32
|
||||
EnterCriticalSection(mutexp);
|
||||
return 1;
|
||||
#elif defined(GNUPTH)
|
||||
@@ -396,7 +400,7 @@ TSRM_API int tsrm_mutex_unlock( MUTEX_T mutexp )
|
||||
#if 0
|
||||
tsrm_debug("Mutex unlocked thread: %ld\n",tsrm_thread_id());
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#ifdef TSRM_WIN32
|
||||
LeaveCriticalSection(mutexp);
|
||||
return 1;
|
||||
#elif defined(GNUPTH)
|
||||
@@ -454,3 +458,5 @@ void tsrm_debug_set(int status)
|
||||
{
|
||||
tsrm_debug_status = status;
|
||||
}
|
||||
|
||||
#endif /* ZTS */
|
||||
+27
-3
@@ -42,7 +42,7 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "C:\Projects\TSRM" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x40d /d "_DEBUG"
|
||||
# ADD RSC /l 0x40d /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -65,7 +65,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "Release_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -88,7 +88,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "Release_TS_inline"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -112,6 +112,14 @@ LIB32=link.exe -lib
|
||||
|
||||
SOURCE=.\TSRM.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_strtok_r.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_virtual_cwd.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
@@ -120,6 +128,22 @@ SOURCE=.\TSRM.c
|
||||
|
||||
SOURCE=.\TSRM.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_config.w32.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_config_common.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_strtok_r.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tsrm_virtual_cwd.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
+21
-15
@@ -2,20 +2,16 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Zeev Suraski |
|
||||
| Copyright (c) 1999, 2000, Andi Gutmans, Sascha Schumann, Zeev Suraski|
|
||||
| This source file is subject to the TSRM license, that is bundled |
|
||||
| with this package in the file LICENSE |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to the Zend license, that is bundled |
|
||||
| with this package in the file LICENSE. If you did not receive a |
|
||||
| copy of the Zend license, please mail us at zend@zend.com so we can |
|
||||
| send you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Zeev Suraski <zeev@zend.com> |
|
||||
| Authors: Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TSRM_H
|
||||
#define _TSRM_H
|
||||
#ifndef TSRM_H
|
||||
#define TSRM_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# undef PACKAGE
|
||||
@@ -25,7 +21,14 @@
|
||||
# undef VERSION
|
||||
#endif
|
||||
|
||||
#if WIN32||WINNT
|
||||
/* Only compile multi-threading functions if we're in ZTS mode */
|
||||
#ifdef ZTS
|
||||
|
||||
#ifdef WIN32
|
||||
# define TSRM_WIN32
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
# include <windows.h>
|
||||
#elif defined(GNUPTH)
|
||||
# include <pth.h>
|
||||
@@ -35,7 +38,7 @@
|
||||
|
||||
typedef int ts_rsrc_id;
|
||||
|
||||
#if WIN32||WINNT
|
||||
#ifdef TSRM_WIN32
|
||||
# ifdef TSRM_EXPORTS
|
||||
# define TSRM_API __declspec(dllexport)
|
||||
# else
|
||||
@@ -47,7 +50,7 @@ typedef int ts_rsrc_id;
|
||||
|
||||
|
||||
/* Define THREAD_T and MUTEX_T */
|
||||
#if defined(WIN32)
|
||||
#ifdef TSRM_WIN32
|
||||
# define THREAD_T DWORD
|
||||
# define MUTEX_T CRITICAL_SECTION *
|
||||
#elif defined(GNUPTH)
|
||||
@@ -81,7 +84,8 @@ TSRM_API void tsrm_shutdown(void);
|
||||
TSRM_API ts_rsrc_id ts_allocate_id(size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor);
|
||||
|
||||
/* fetches the requested resource for the current thread */
|
||||
TSRM_API void *ts_resource(ts_rsrc_id id);
|
||||
TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id);
|
||||
#define ts_resource(id) ts_resource_ex(id, NULL)
|
||||
|
||||
/* frees all resources allocated for the current thread */
|
||||
TSRM_API void ts_free_thread(void);
|
||||
@@ -107,4 +111,6 @@ TSRM_API void *tsrm_set_new_thread_end_handler(void (*new_thread_end_handler)(TH
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TSRM_H */
|
||||
#endif /* ZTS */
|
||||
|
||||
#endif /* TSRM_H */
|
||||
+13
-1
@@ -10,12 +10,24 @@ AM_CONFIG_HEADER(tsrm_config.h)
|
||||
sinclude(tsrm.m4)
|
||||
|
||||
TSRM_BASIC_CHECKS
|
||||
TSRM_THREADS_CHECKS
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
if test "$enable_debug" != "yes"; then
|
||||
AM_SET_LIBTOOL_VARIABLE([--silent])
|
||||
fi
|
||||
|
||||
TSRM_PTHREAD
|
||||
dnl TSRM_PTHREAD
|
||||
|
||||
AC_CHECK_HEADERS(
|
||||
utime.h \
|
||||
dirent.h \
|
||||
stdarg.h \
|
||||
alloca.h \
|
||||
unistd.h \
|
||||
limits.h
|
||||
)
|
||||
|
||||
AC_DEFINE(ZTS,1,[ ])
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
@@ -0,0 +1,44 @@
|
||||
#ifndef READDIR_H
|
||||
#define READDIR_H
|
||||
|
||||
|
||||
/*
|
||||
* Structures and types used to implement opendir/readdir/closedir
|
||||
* on Windows 95/NT.
|
||||
*/
|
||||
|
||||
#include <io.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
/* struct dirent - same as Unix */
|
||||
|
||||
struct dirent {
|
||||
long d_ino; /* inode (always 1 in WIN32) */
|
||||
off_t d_off; /* offset to this dirent */
|
||||
unsigned short d_reclen; /* length of d_name */
|
||||
char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */
|
||||
};
|
||||
|
||||
|
||||
/* typedef DIR - not the same as Unix */
|
||||
typedef struct {
|
||||
long handle; /* _findfirst/_findnext handle */
|
||||
short offset; /* offset into directory */
|
||||
short finished; /* 1 if there are not more files */
|
||||
struct _finddata_t fileinfo; /* from _findfirst/_findnext */
|
||||
char *dir; /* the dir we are reading */
|
||||
struct dirent dent; /* the dirent to return */
|
||||
} DIR;
|
||||
|
||||
/* Function prototypes */
|
||||
DIR *opendir(const char *);
|
||||
struct dirent *readdir(DIR *);
|
||||
int readdir_r(DIR *, struct dirent *, struct dirent **);
|
||||
int closedir(DIR *);
|
||||
void rewinddir(DIR *);
|
||||
|
||||
|
||||
#endif /* READDIR_H */
|
||||
+11
-1
@@ -87,6 +87,16 @@ dnl PTHREADS_CHECK()
|
||||
dnl
|
||||
dnl Try to find a way to enable POSIX threads
|
||||
dnl
|
||||
dnl Magic flags
|
||||
dnl -kthread gcc (FreeBSD)
|
||||
dnl -Kthread UDK cc (UnixWare)
|
||||
dnl -mt WorkShop cc (Solaris)
|
||||
dnl -mthreads gcc (AIX)
|
||||
dnl -pthread gcc (Linux, FreeBSD, NetBSD, OpenBSD)
|
||||
dnl -pthreads gcc (Solaris)
|
||||
dnl -qthreaded AIX cc V5
|
||||
dnl -threads gcc (HP-UX)
|
||||
dnl
|
||||
AC_DEFUN(PTHREADS_CHECK,[
|
||||
|
||||
save_CFLAGS="$CFLAGS"
|
||||
@@ -99,7 +109,7 @@ CFLAGS="$save_CFLAGS"
|
||||
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
|
||||
ac_cv_pthreads_cflags=""
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for flag in -pthreads -pthread -mthreads -Kthread; do
|
||||
for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
|
||||
ac_save="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $flag"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ AC_MSG_RESULT(yes)
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN(TSRM_OTHER_CHECKS,[
|
||||
AC_DEFUN(TSRM_THREADS_CHECKS,[
|
||||
|
||||
dnl For the thread implementations, we always use --with-*
|
||||
dnl to maintain consistency
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef TSRM_CONFIG_W32_H
|
||||
#define TSRM_CONFIG_W32_H
|
||||
|
||||
#define HAVE_UTIME 1
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
#undef inline
|
||||
#ifdef ZEND_WIN32_FORCE_INLINE
|
||||
# define inline __forceinline
|
||||
#else
|
||||
# define inline
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,47 @@
|
||||
#ifndef TSRM_CONFIG_COMMON_H
|
||||
#define TSRM_CONFIG_COMMON_H
|
||||
|
||||
#if WINNT|WIN32
|
||||
# define TSRM_WIN32
|
||||
#endif
|
||||
|
||||
#ifndef TSRM_WIN32
|
||||
# include "tsrm_config.h"
|
||||
# include <sys/param.h>
|
||||
#else
|
||||
# include "tsrm_config.w32.h"
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
# ifdef PATH_MAX
|
||||
# define MAXPATHLEN PATH_MAX
|
||||
# else
|
||||
# define MAXPATHLEN 256
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2))
|
||||
# define tsrm_do_alloca(p) alloca(p)
|
||||
# define tsrm_free_alloca(p)
|
||||
#else
|
||||
# define tsrm_do_alloca(p) malloc(p)
|
||||
# define tsrm_free_alloca(p) free(p)
|
||||
#endif
|
||||
|
||||
#endif /* TSRM_CONFIG_COMMON_H */
|
||||
@@ -0,0 +1,63 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "tsrm_config_common.h"
|
||||
#include "tsrm_strtok_r.h"
|
||||
|
||||
static inline int in_character_class(char ch, const char *delim)
|
||||
{
|
||||
while (*delim) {
|
||||
if (*delim == ch) {
|
||||
return 1;
|
||||
}
|
||||
delim++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *tsrm_strtok_r(char *s, const char *delim, char **last)
|
||||
{
|
||||
char *token;
|
||||
|
||||
if (s == NULL) {
|
||||
s = *last;
|
||||
}
|
||||
|
||||
while (*s && in_character_class(*s, delim)) {
|
||||
s++;
|
||||
}
|
||||
if (!*s) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
token = s;
|
||||
|
||||
while (*s && !in_character_class(*s, delim)) {
|
||||
s++;
|
||||
}
|
||||
if (!*s) {
|
||||
*last = s;
|
||||
} else {
|
||||
*s = '\0';
|
||||
*last = s + 1;
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
main()
|
||||
{
|
||||
char foo[] = "/foo/bar//\\barbara";
|
||||
char *last;
|
||||
char *token;
|
||||
|
||||
token = tsrm_strtok_r(foo, "/\\", &last);
|
||||
while (token) {
|
||||
printf ("Token = '%s'\n", token);
|
||||
token = tsrm_strtok_r(NULL, "/\\", &last);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef TSRM_STRTOK_R
|
||||
#define TSRM_STRTOK_R
|
||||
|
||||
char *tsrm_strtok_r(char *s, const char *delim, char **last);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,759 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Sascha Schumann <sascha@schumann.cx> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "tsrm_virtual_cwd.h"
|
||||
#include "tsrm_strtok_r.h"
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#define VIRTUAL_CWD_DEBUG 0
|
||||
|
||||
#ifdef ZTS
|
||||
#include "TSRM.h"
|
||||
#endif
|
||||
|
||||
/* Only need mutex for popen() in Windows because it doesn't chdir() on UNIX */
|
||||
#if defined(TSRM_WIN32) && defined(ZTS)
|
||||
MUTEX_T cwd_mutex;
|
||||
#endif
|
||||
|
||||
#ifdef ZTS
|
||||
static ts_rsrc_id cwd_globals_id;
|
||||
#else
|
||||
static virtual_cwd_globals cwd_globals;
|
||||
#endif
|
||||
|
||||
cwd_state main_cwd_state; /* True global */
|
||||
|
||||
#ifndef TSRM_WIN32
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(mode) ((mode) & _S_IFDIR)
|
||||
#endif
|
||||
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(mode) ((mode) & _S_IFREG)
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
#define tsrm_strtok_r(a,b,c) strtok((a),(b))
|
||||
#define TOKENIZER_STRING "/\\"
|
||||
|
||||
static int php_check_dots(const char *element, int n)
|
||||
{
|
||||
while (n-- > 0) if (element[n] != '.') break;
|
||||
|
||||
return (n != -1);
|
||||
}
|
||||
|
||||
#define IS_DIRECTORY_UP(element, len) \
|
||||
(len >= 2 && !php_check_dots(element, len))
|
||||
|
||||
#define IS_DIRECTORY_CURRENT(element, len) \
|
||||
(len == 1 && ptr[0] == '.')
|
||||
|
||||
|
||||
#else
|
||||
#define TOKENIZER_STRING "/"
|
||||
#endif
|
||||
|
||||
|
||||
/* default macros */
|
||||
|
||||
#ifndef IS_DIRECTORY_UP
|
||||
#define IS_DIRECTORY_UP(element, len) \
|
||||
(len == 2 && memcmp(element, "..", 2) == 0)
|
||||
#endif
|
||||
|
||||
#ifndef IS_DIRECTORY_CURRENT
|
||||
#define IS_DIRECTORY_CURRENT(element, len) \
|
||||
(len == 1 && ptr[0] == '.')
|
||||
#endif
|
||||
|
||||
/* define this to check semantics */
|
||||
#define IS_DIR_OK(s) (1)
|
||||
|
||||
#ifndef IS_DIR_OK
|
||||
#define IS_DIR_OK(state) (php_is_dir_ok(state) == 0)
|
||||
#endif
|
||||
|
||||
|
||||
#define CWD_STATE_COPY(d, s) \
|
||||
(d)->cwd_length = (s)->cwd_length; \
|
||||
(d)->cwd = (char *) malloc((s)->cwd_length+1); \
|
||||
memcpy((d)->cwd, (s)->cwd, (s)->cwd_length+1);
|
||||
|
||||
#define CWD_STATE_FREE(s) \
|
||||
free((s)->cwd);
|
||||
|
||||
static int php_is_dir_ok(const cwd_state *state)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
static int php_is_file_ok(const cwd_state *state)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals)
|
||||
{
|
||||
CWD_STATE_COPY(&cwd_globals->cwd, &main_cwd_state);
|
||||
}
|
||||
|
||||
static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals)
|
||||
{
|
||||
CWD_STATE_FREE(&cwd_globals->cwd);
|
||||
}
|
||||
|
||||
static char *tsrm_strndup(const char *s, size_t length)
|
||||
{
|
||||
char *p;
|
||||
|
||||
p = (char *) malloc(length+1);
|
||||
if (!p) {
|
||||
return (char *)NULL;
|
||||
}
|
||||
if (length) {
|
||||
memcpy(p,s,length);
|
||||
}
|
||||
p[length]=0;
|
||||
return p;
|
||||
}
|
||||
|
||||
CWD_API void virtual_cwd_startup(void)
|
||||
{
|
||||
char cwd[MAXPATHLEN];
|
||||
char *result;
|
||||
|
||||
result = getcwd(cwd, sizeof(cwd));
|
||||
if (!result) {
|
||||
cwd[0] = '\0';
|
||||
}
|
||||
main_cwd_state.cwd = strdup(cwd);
|
||||
main_cwd_state.cwd_length = strlen(cwd);
|
||||
|
||||
#ifdef ZTS
|
||||
cwd_globals_id = ts_allocate_id(sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor);
|
||||
#else
|
||||
cwd_globals_ctor(&cwd_globals);
|
||||
#endif
|
||||
|
||||
#if defined(TSRM_WIN32) && defined(ZTS)
|
||||
cwd_mutex = tsrm_mutex_alloc();
|
||||
#endif
|
||||
}
|
||||
|
||||
CWD_API void virtual_cwd_shutdown(void)
|
||||
{
|
||||
#ifndef ZTS
|
||||
cwd_globals_dtor(&cwd_globals);
|
||||
#endif
|
||||
#if defined(TSRM_WIN32) && defined(ZTS)
|
||||
tsrm_mutex_free(cwd_mutex);
|
||||
#endif
|
||||
|
||||
free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably use emalloc()/efree() */
|
||||
}
|
||||
|
||||
CWD_API char *virtual_getcwd_ex(int *length)
|
||||
{
|
||||
cwd_state *state;
|
||||
CWDLS_FETCH();
|
||||
|
||||
state = &CWDG(cwd);
|
||||
|
||||
if (state->cwd_length == 0) {
|
||||
char *retval;
|
||||
|
||||
*length = 1;
|
||||
retval = (char *) malloc(2);
|
||||
retval[0] = DEFAULT_SLASH;
|
||||
retval[1] = '\0';
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
/* If we have something like C: */
|
||||
if (state->cwd_length == 2 && state->cwd[state->cwd_length-1] == ':') {
|
||||
char *retval;
|
||||
|
||||
*length = state->cwd_length+1;
|
||||
retval = (char *) malloc(*length+1);
|
||||
memcpy(retval, state->cwd, *length);
|
||||
retval[*length-1] = DEFAULT_SLASH;
|
||||
retval[*length] = '\0';
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
*length = state->cwd_length;
|
||||
return strdup(state->cwd);
|
||||
}
|
||||
|
||||
|
||||
/* Same semantics as UNIX getcwd() */
|
||||
CWD_API char *virtual_getcwd(char *buf, size_t size)
|
||||
{
|
||||
size_t length;
|
||||
char *cwd;
|
||||
|
||||
cwd = virtual_getcwd_ex(&length);
|
||||
|
||||
if (buf == NULL) {
|
||||
return cwd;
|
||||
}
|
||||
if (length > size-1) {
|
||||
free(cwd);
|
||||
errno = ERANGE; /* Is this OK? */
|
||||
return NULL;
|
||||
}
|
||||
memcpy(buf, cwd, length+1);
|
||||
free(cwd);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* Resolve path relatively to state and put the real path into state */
|
||||
/* returns 0 for ok, 1 for error */
|
||||
CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path)
|
||||
{
|
||||
int path_length = strlen(path);
|
||||
char *ptr, *path_copy;
|
||||
char *tok = NULL;
|
||||
int ptr_length;
|
||||
cwd_state *old_state;
|
||||
int ret = 0;
|
||||
int copy_amount = -1;
|
||||
char *free_path;
|
||||
unsigned char is_absolute = 0;
|
||||
#ifndef TSRM_WIN32
|
||||
char resolved_path[MAXPATHLEN];
|
||||
#endif
|
||||
|
||||
if (path_length == 0)
|
||||
return (0);
|
||||
|
||||
#ifndef TSRM_WIN32
|
||||
if (IS_ABSOLUTE_PATH(path, path_length)) {
|
||||
if (realpath(path, resolved_path)) {
|
||||
path = resolved_path;
|
||||
path_length = strlen(path);
|
||||
}
|
||||
} else { /* Concat current directory with relative path and then run realpath() on it */
|
||||
char *tmp;
|
||||
char *ptr;
|
||||
|
||||
ptr = tmp = (char *) malloc(state->cwd_length+path_length+sizeof("/"));
|
||||
if (!tmp) {
|
||||
return 1;
|
||||
}
|
||||
memcpy(ptr, state->cwd, state->cwd_length);
|
||||
ptr += state->cwd_length;
|
||||
*ptr++ = DEFAULT_SLASH;
|
||||
memcpy(ptr, path, path_length);
|
||||
ptr += path_length;
|
||||
*ptr = '\0';
|
||||
if (realpath(tmp, resolved_path)) {
|
||||
path = resolved_path;
|
||||
path_length = strlen(path);
|
||||
}
|
||||
free(tmp);
|
||||
}
|
||||
#endif
|
||||
free_path = path_copy = tsrm_strndup(path, path_length);
|
||||
|
||||
old_state = (cwd_state *) malloc(sizeof(cwd_state));
|
||||
CWD_STATE_COPY(old_state, state);
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path);
|
||||
#endif
|
||||
if (IS_ABSOLUTE_PATH(path_copy, path_length)) {
|
||||
copy_amount = COPY_WHEN_ABSOLUTE;
|
||||
is_absolute = 1;
|
||||
#ifdef TSRM_WIN32
|
||||
} else if(IS_SLASH(path_copy[0])) {
|
||||
copy_amount = 2;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (copy_amount != -1) {
|
||||
state->cwd = (char *) realloc(state->cwd, copy_amount + 1);
|
||||
if (copy_amount) {
|
||||
if (is_absolute) {
|
||||
memcpy(state->cwd, path_copy, copy_amount);
|
||||
path_copy += copy_amount;
|
||||
} else {
|
||||
memcpy(state->cwd, old_state->cwd, copy_amount);
|
||||
}
|
||||
}
|
||||
state->cwd[copy_amount] = '\0';
|
||||
state->cwd_length = copy_amount;
|
||||
}
|
||||
|
||||
|
||||
ptr = tsrm_strtok_r(path_copy, TOKENIZER_STRING, &tok);
|
||||
while (ptr) {
|
||||
ptr_length = strlen(ptr);
|
||||
|
||||
if (IS_DIRECTORY_UP(ptr, ptr_length)) {
|
||||
char save;
|
||||
|
||||
save = DEFAULT_SLASH;
|
||||
|
||||
#define PREVIOUS state->cwd[state->cwd_length - 1]
|
||||
|
||||
while (IS_ABSOLUTE_PATH(state->cwd, state->cwd_length) &&
|
||||
!IS_SLASH(PREVIOUS)) {
|
||||
save = PREVIOUS;
|
||||
PREVIOUS = '\0';
|
||||
state->cwd_length--;
|
||||
}
|
||||
|
||||
if (!IS_ABSOLUTE_PATH(state->cwd, state->cwd_length)) {
|
||||
state->cwd[state->cwd_length++] = save;
|
||||
state->cwd[state->cwd_length] = '\0';
|
||||
} else {
|
||||
PREVIOUS = '\0';
|
||||
state->cwd_length--;
|
||||
}
|
||||
} else if (!IS_DIRECTORY_CURRENT(ptr, ptr_length)) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1);
|
||||
state->cwd[state->cwd_length] = DEFAULT_SLASH;
|
||||
memcpy(&state->cwd[state->cwd_length+1], ptr, ptr_length+1);
|
||||
state->cwd_length += (ptr_length+1);
|
||||
}
|
||||
ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok);
|
||||
}
|
||||
|
||||
if (state->cwd_length == COPY_WHEN_ABSOLUTE) {
|
||||
state->cwd = (char *) realloc(state->cwd, state->cwd_length+1+1);
|
||||
state->cwd[state->cwd_length] = DEFAULT_SLASH;
|
||||
state->cwd[state->cwd_length+1] = '\0';
|
||||
state->cwd_length++;
|
||||
}
|
||||
|
||||
if (verify_path && verify_path(state)) {
|
||||
CWD_STATE_FREE(state);
|
||||
|
||||
*state = *old_state;
|
||||
|
||||
ret = 1;
|
||||
} else {
|
||||
CWD_STATE_FREE(old_state);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
free(old_state);
|
||||
|
||||
free(free_path);
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf (stderr, "virtual_file_ex() = %s\n",state->cwd);
|
||||
#endif
|
||||
return (ret);
|
||||
}
|
||||
|
||||
CWD_API int virtual_chdir(const char *path)
|
||||
{
|
||||
CWDLS_FETCH();
|
||||
|
||||
return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok)?-1:0;
|
||||
}
|
||||
|
||||
CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path))
|
||||
{
|
||||
int length = strlen(path);
|
||||
char *temp;
|
||||
int retval;
|
||||
|
||||
if (length == 0) {
|
||||
return 1; /* Can't cd to empty string */
|
||||
}
|
||||
while(--length >= 0 && !IS_SLASH(path[length])) {
|
||||
}
|
||||
|
||||
if (length == -1) {
|
||||
/* No directory only file name */
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (length == COPY_WHEN_ABSOLUTE && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */
|
||||
length++;
|
||||
}
|
||||
temp = (char *) tsrm_do_alloca(length+1);
|
||||
memcpy(temp, path, length);
|
||||
temp[length] = 0;
|
||||
#if VIRTUAL_CWD_DEBUG
|
||||
fprintf (stderr, "Changing directory to %s\n", temp);
|
||||
#endif
|
||||
retval = p_chdir(temp);
|
||||
tsrm_free_alloca(temp);
|
||||
return retval;
|
||||
}
|
||||
|
||||
CWD_API char *virtual_realpath(const char *path, char *real_path)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
retval = virtual_file_ex(&new_state, path, NULL);
|
||||
|
||||
if(retval) {
|
||||
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
|
||||
memcpy(real_path, new_state.cwd, len);
|
||||
real_path[len] = '\0';
|
||||
return real_path;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CWD_API int virtual_filepath(const char *path, char **filepath)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
retval = virtual_file_ex(&new_state, path, php_is_file_ok);
|
||||
|
||||
*filepath = new_state.cwd;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
CWD_API FILE *virtual_fopen(const char *path, const char *mode)
|
||||
{
|
||||
cwd_state new_state;
|
||||
FILE *f;
|
||||
CWDLS_FETCH();
|
||||
|
||||
if (path[0] == '\0') { /* Fail to open empty path */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, path, NULL);
|
||||
|
||||
f = fopen(new_state.cwd, mode);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return f;
|
||||
}
|
||||
|
||||
#if HAVE_UTIME
|
||||
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int ret;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, filename, NULL);
|
||||
|
||||
ret = utime(new_state.cwd, buf);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
CWD_API int virtual_chmod(const char *filename, mode_t mode)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int ret;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, filename, NULL);
|
||||
|
||||
ret = chmod(new_state.cwd, mode);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifndef TSRM_WIN32
|
||||
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int ret;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, filename, NULL);
|
||||
|
||||
ret = chown(new_state.cwd, owner, group);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
CWD_API int virtual_open(const char *path, int flags, ...)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int f;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, path, NULL);
|
||||
|
||||
if (flags & O_CREAT) {
|
||||
mode_t mode;
|
||||
va_list arg;
|
||||
|
||||
va_start(arg, flags);
|
||||
mode = va_arg(arg, mode_t);
|
||||
va_end(arg);
|
||||
|
||||
f = open(new_state.cwd, flags, mode);
|
||||
} else {
|
||||
f = open(new_state.cwd, flags);
|
||||
}
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return f;
|
||||
}
|
||||
|
||||
CWD_API int virtual_creat(const char *path, mode_t mode)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int f;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, path, NULL);
|
||||
|
||||
f = creat(new_state.cwd, mode);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return f;
|
||||
}
|
||||
|
||||
|
||||
CWD_API int virtual_stat(const char *path, struct stat *buf)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, path, NULL);
|
||||
|
||||
retval = stat(new_state.cwd, buf);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifndef TSRM_WIN32
|
||||
|
||||
CWD_API int virtual_lstat(const char *path, struct stat *buf)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, path, NULL);
|
||||
|
||||
retval = lstat(new_state.cwd, buf);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
CWD_API int virtual_unlink(const char *path)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, path, NULL);
|
||||
|
||||
retval = unlink(new_state.cwd);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
|
||||
CWD_API int virtual_mkdir(const char *pathname, mode_t mode)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, pathname, NULL);
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
retval = mkdir(new_state.cwd);
|
||||
#else
|
||||
retval = mkdir(new_state.cwd, mode);
|
||||
#endif
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
|
||||
CWD_API int virtual_rmdir(const char *pathname)
|
||||
{
|
||||
cwd_state new_state;
|
||||
int retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, pathname, NULL);
|
||||
|
||||
retval = rmdir(new_state.cwd);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
DIR *opendir(const char *name);
|
||||
#endif
|
||||
|
||||
CWD_API DIR *virtual_opendir(const char *pathname)
|
||||
{
|
||||
cwd_state new_state;
|
||||
DIR *retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
virtual_file_ex(&new_state, pathname, NULL);
|
||||
|
||||
retval = opendir(new_state.cwd);
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifndef TSRM_WIN32
|
||||
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type)
|
||||
{
|
||||
int command_length;
|
||||
char *command_line;
|
||||
char *ptr;
|
||||
FILE *retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
command_length = strlen(command);
|
||||
|
||||
ptr = command_line = (char *) malloc(command_length + sizeof("cd ; ") + CWDG(cwd).cwd_length+1);
|
||||
if (!command_line) {
|
||||
return NULL;
|
||||
}
|
||||
memcpy(ptr, "cd ", sizeof("cd ")-1);
|
||||
ptr += sizeof("cd ")-1;
|
||||
|
||||
if (CWDG(cwd).cwd_length == 0) {
|
||||
*ptr++ = DEFAULT_SLASH;
|
||||
} else {
|
||||
memcpy(ptr, CWDG(cwd).cwd, CWDG(cwd).cwd_length);
|
||||
ptr += CWDG(cwd).cwd_length;
|
||||
}
|
||||
|
||||
*ptr++ = ' ';
|
||||
*ptr++ = ';';
|
||||
*ptr++ = ' ';
|
||||
|
||||
memcpy(ptr, command, command_length+1);
|
||||
#ifdef TSRM_WIN32
|
||||
retval = _popen(command_line, type);
|
||||
#else
|
||||
retval = popen(command_line, type);
|
||||
#endif
|
||||
free(command_line);
|
||||
return retval;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* On Windows the trick of prepending "cd cwd; " doesn't work so we need to perform
|
||||
a real chdir() and mutex it
|
||||
*/
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type)
|
||||
{
|
||||
char prev_cwd[MAXPATHLEN];
|
||||
char *getcwd_result;
|
||||
FILE *retval;
|
||||
CWDLS_FETCH();
|
||||
|
||||
getcwd_result = getcwd(prev_cwd, MAXPATHLEN);
|
||||
if (!getcwd_result) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef ZTS
|
||||
tsrm_mutex_lock(cwd_mutex);
|
||||
#endif
|
||||
|
||||
chdir(CWDG(cwd).cwd);
|
||||
retval = _popen(command, type);
|
||||
chdir(prev_cwd);
|
||||
|
||||
#ifdef ZTS
|
||||
tsrm_mutex_unlock(cwd_mutex);
|
||||
#endif
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Sascha Schumann <sascha@schumann.cx> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef VIRTUAL_CWD_H
|
||||
#define VIRTUAL_CWD_H
|
||||
|
||||
#include "tsrm_config_common.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_UTIME_H
|
||||
#include <utime.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifndef TSRM_WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
#include "readdir.h"
|
||||
#include <sys/utime.h>
|
||||
/* mode_t isn't defined on Windows */
|
||||
typedef int mode_t;
|
||||
|
||||
#define DEFAULT_SLASH '\\'
|
||||
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
|
||||
#define COPY_WHEN_ABSOLUTE 2
|
||||
#define IS_ABSOLUTE_PATH(path, len) \
|
||||
(len >= 2 && isalpha(path[0]) && path[1] == ':')
|
||||
|
||||
#else
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#define DEFAULT_SLASH '/'
|
||||
#define IS_SLASH(c) ((c) == '/')
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef COPY_WHEN_ABSOLUTE
|
||||
#define COPY_WHEN_ABSOLUTE 0
|
||||
#endif
|
||||
|
||||
#ifndef IS_ABSOLUTE_PATH
|
||||
#define IS_ABSOLUTE_PATH(path, len) \
|
||||
(IS_SLASH(path[0]))
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_EXPORTS
|
||||
#define CWD_EXPORTS
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
# ifdef CWD_EXPORTS
|
||||
# define CWD_API __declspec(dllexport)
|
||||
# else
|
||||
# define CWD_API __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
#define CWD_API
|
||||
#endif
|
||||
|
||||
typedef struct _cwd_state {
|
||||
char *cwd;
|
||||
int cwd_length;
|
||||
} cwd_state;
|
||||
|
||||
typedef int (*verify_path_func)(const cwd_state *);
|
||||
|
||||
CWD_API void virtual_cwd_startup(void);
|
||||
CWD_API void virtual_cwd_shutdown(void);
|
||||
CWD_API char *virtual_getcwd_ex(int *length);
|
||||
CWD_API char *virtual_getcwd(char *buf, size_t size);
|
||||
CWD_API int virtual_chdir(const char *path);
|
||||
CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path));
|
||||
CWD_API int virtual_filepath(const char *path, char **filepath);
|
||||
CWD_API char *virtual_realpath(const char *path, char *real_path);
|
||||
CWD_API FILE *virtual_fopen(const char *path, const char *mode);
|
||||
CWD_API int virtual_open(const char *path, int flags, ...);
|
||||
CWD_API int virtual_creat(const char *path, mode_t mode);
|
||||
CWD_API int virtual_stat(const char *path, struct stat *buf);
|
||||
#ifndef TSRM_WIN32
|
||||
CWD_API int virtual_lstat(const char *path, struct stat *buf);
|
||||
#endif
|
||||
CWD_API int virtual_unlink(const char *path);
|
||||
CWD_API int virtual_mkdir(const char *pathname, mode_t mode);
|
||||
CWD_API int virtual_rmdir(const char *pathname);
|
||||
CWD_API DIR *virtual_opendir(const char *pathname);
|
||||
CWD_API FILE *virtual_popen(const char *command, const char *type);
|
||||
#if HAVE_UTIME
|
||||
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf);
|
||||
#endif
|
||||
CWD_API int virtual_chmod(const char *filename, mode_t mode);
|
||||
#ifndef TSRM_WIN32
|
||||
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group);
|
||||
#endif
|
||||
|
||||
CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path);
|
||||
|
||||
typedef struct _virtual_cwd_globals {
|
||||
cwd_state cwd;
|
||||
} virtual_cwd_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
# define CWDLS_D virtual_cwd_globals *cwd_globals
|
||||
# define CWDLS_DC , CWDLS_D
|
||||
# define CWDLS_C cwd_globals
|
||||
# define CWDLS_CC , CWDLS_C
|
||||
# define CWDG(v) (cwd_globals->v)
|
||||
# define CWDLS_FETCH() virtual_cwd_globals *cwd_globals = ts_resource(cwd_globals_id)
|
||||
#else
|
||||
# define CWDLS_D void
|
||||
# define CWDLS_DC
|
||||
# define CWDLS_C
|
||||
# define CWDLS_CC
|
||||
# define CWDG(v) (cwd_globals.v)
|
||||
# define CWDLS_FETCH()
|
||||
#endif
|
||||
|
||||
/* The actual macros to be used in programs using TSRM
|
||||
* If the program defines VIRTUAL_DIR it will use the
|
||||
* virtual_* functions
|
||||
*/
|
||||
|
||||
#ifdef VIRTUAL_DIR
|
||||
|
||||
#define V_GETCWD(buff, size) virtual_getcwd(buff,size)
|
||||
#define V_FOPEN(path, mode) virtual_fopen(path, mode)
|
||||
/* The V_OPEN macro will need to be used as V_OPEN((path, flags, ...)) */
|
||||
#define V_OPEN(open_args) virtual_open open_args
|
||||
#define V_CREAT(path, mode) virtual_creat(path, mode)
|
||||
#define V_CHDIR(path) virtual_chdir(path)
|
||||
#define V_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir)
|
||||
#define V_GETWD(buf)
|
||||
#define V_REALPATH(path,real_path) virtual_realpath(path,real_path)
|
||||
#define V_STAT(path, buff) virtual_stat(path, buff)
|
||||
#ifdef TSRM_WIN32
|
||||
#define V_LSTAT(path, buff) virtual_stat(path, buff)
|
||||
#else
|
||||
#define V_LSTAT(path, buff) virtual_lstat(path, buff)
|
||||
#endif
|
||||
#define V_UNLINK(path) virtual_unlink(path)
|
||||
#define V_MKDIR(pathname, mode) virtual_mkdir(pathname, mode)
|
||||
#define V_RMDIR(pathname) virtual_rmdir(pathname)
|
||||
#define V_OPENDIR(pathname) virtual_opendir(pathname)
|
||||
#define V_POPEN(command, type) virtual_popen(command, type)
|
||||
#if HAVE_UTIME
|
||||
#define V_UTIME(path,time) virtual_utime(path,time)
|
||||
#endif
|
||||
#define V_CHMOD(path,mode) virtual_chmod(path,mode)
|
||||
#ifndef TSRM_WIN32
|
||||
#define V_CHOWN(path,owner,group) virtual_chown(path,owner,group)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define V_GETCWD(buff, size) getcwd(buff,size)
|
||||
#define V_FOPEN(path, mode) fopen(path, mode)
|
||||
#define V_OPEN(open_args) open open_args
|
||||
#define V_CREAT(path, mode) creat(path, mode)
|
||||
#define V_CHDIR(path) chdir(path)
|
||||
#define V_CHDIR_FILE(path) virtual_chdir_file(path, chdir)
|
||||
#define V_GETWD(buf) getwd(buf)
|
||||
#define V_STAT(path, buff) stat(path, buff)
|
||||
#define V_LSTAT(path, buff) lstat(path, buff)
|
||||
#define V_UNLINK(path) unlink(path)
|
||||
#define V_MKDIR(pathname, mode) mkdir(pathname, mode)
|
||||
#define V_RMDIR(pathname) rmdir(pathname)
|
||||
#define V_OPENDIR(pathname) opendir(pathname)
|
||||
#define V_POPEN(command, type) popen(command, type)
|
||||
#define V_REALPATH(path,real_path) realpath(path,real_path)
|
||||
#if HAVE_UTIME
|
||||
#define V_UTIME(path,time) utime(path,time)
|
||||
#endif
|
||||
#define V_CHMOD(path,mode) chmod(path,mode)
|
||||
#ifndef TSRM_WIN32
|
||||
#define V_CHOWN(path,owner,group) chown(path,owner,group)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* VIRTUAL_CWD_H */
|
||||
+2
-2
@@ -41,9 +41,9 @@
|
||||
// #include <FlexLexer.h>
|
||||
// ...
|
||||
|
||||
#ifndef __FLEX_LEXER_H
|
||||
#ifndef FLEXLEXER_H
|
||||
// Never included before - need to define base class.
|
||||
#define __FLEX_LEXER_H
|
||||
#define FLEXLEXER_H
|
||||
#include <iostream.h>
|
||||
|
||||
extern "C++" {
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ libZend_la_SOURCES=\
|
||||
libZend_la_LIBADD = $(ZEND_SCANNER)
|
||||
libZend_la_LDFLAGS = @EXTRA_LIBS@
|
||||
libZend_la_DEPENDENCIES = $(ZEND_SCANNER)
|
||||
|
||||
|
||||
# automake isn't too clever about "non-standard" use of lex and yacc
|
||||
|
||||
$(libZend_la_OBJECTS) zend-scanner.lo zend-scanner-cc.lo: zend-parser.h
|
||||
@@ -36,6 +36,6 @@ zend-parser.c: $(srcdir)/zend-parser.y
|
||||
$(YACC) -p zend -v -d $(srcdir)/zend-parser.y -o zend-parser.c
|
||||
|
||||
depend:
|
||||
|
||||
|
||||
zend_execute.lo: $(srcdir)/zend_execute.c
|
||||
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c
|
||||
@@ -151,6 +151,10 @@ SOURCE=.\zend_extensions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_gcc_inline.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
+12
-8
@@ -64,6 +64,10 @@ AC_FUNC_MEMCMP
|
||||
AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite)
|
||||
AC_ZEND_BROKEN_SPRINTF
|
||||
|
||||
AC_CHECK_FUNCS(finite isfinite isinf isnan)
|
||||
|
||||
ZEND_FP_EXCEPT
|
||||
|
||||
AC_SUBST(ZEND_SCANNER)
|
||||
|
||||
@@ -76,10 +80,10 @@ AC_SUBST(ZEND_SCANNER)
|
||||
AC_DEFUN(LIBZEND_ENABLE_DEBUG,[
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --disable-debug Compile without debugging symbols],[
|
||||
[ --enable-debug Compile with debugging symbols],[
|
||||
ZEND_DEBUG=$enableval
|
||||
],[
|
||||
ZEND_DEBUG=yes
|
||||
ZEND_DEBUG=no
|
||||
])
|
||||
|
||||
])
|
||||
@@ -95,9 +99,6 @@ AC_ARG_ENABLE(debug,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AC_DEFUN(LIBZEND_OTHER_CHECKS,[
|
||||
|
||||
AC_ARG_ENABLE(experimental-zts,
|
||||
@@ -135,19 +136,22 @@ AC_MSG_CHECKING(whether to enable Zend debugging)
|
||||
AC_MSG_RESULT($ZEND_DEBUG)
|
||||
|
||||
if test "$ZEND_DEBUG" = "yes"; then
|
||||
AC_DEFINE(ZEND_DEBUG,1)
|
||||
AC_DEFINE(ZEND_DEBUG,1,[ ])
|
||||
echo " $CFLAGS" | grep ' -g' >/dev/null || DEBUG_CFLAGS="-g"
|
||||
if test "$CFLAGS" = "-g -O2"; then
|
||||
CFLAGS=-g
|
||||
fi
|
||||
test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
|
||||
test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
|
||||
DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
|
||||
else
|
||||
AC_DEFINE(ZEND_DEBUG,0)
|
||||
AC_DEFINE(ZEND_DEBUG,0,[ ])
|
||||
fi
|
||||
|
||||
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
|
||||
if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
|
||||
AC_DEFINE(ZTS)
|
||||
AC_DEFINE(ZTS,1,[ ])
|
||||
ZEND_SCANNER_TYPE=cc
|
||||
CPPFLAGS="$CPPFLAGS -I../TSRM"
|
||||
LIBZEND_CPLUSPLUS_CHECKS
|
||||
|
||||
+5
-5
@@ -40,7 +40,7 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDebug_TS" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D ZEND_DEBUG=0 /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /D "PHP_WIN32" /FR /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x40d /d "NDebug_TS"
|
||||
# ADD RSC /l 0x40d /d "NDebug_TS"
|
||||
@@ -62,7 +62,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_Debug_TS" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_Debug_TS" /D "_LIB" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "ZTS" /D "WIN32" /D "_MBCS" /D "PHP_WIN32" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_Debug_TS" /D ZEND_DEBUG=1 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x40d /d "_Debug_TS"
|
||||
# ADD RSC /l 0x40d /d "_Debug_TS"
|
||||
BSC32=bscmake.exe
|
||||
@@ -84,7 +84,7 @@ LIB32=link.exe -lib
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /FD /c
|
||||
# SUBTRACT BASE CPP /YX
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D ZEND_DEBUG=0 /D "ZTS" /D "ZEND_WIN32" /D "ZEND_WIN32_FORCE_INLINE" /D "WIN32" /D "_MBCS" /D "PHP_WIN32" /FR /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x40d /d "NDebug_TS"
|
||||
# ADD RSC /l 0x40d /d "NDebug_TS"
|
||||
@@ -392,7 +392,7 @@ SOURCE=".\zend-scanner.l"
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
@@ -412,7 +412,7 @@ InputPath=".\zend-scanner.l"
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
|
||||
+29
-24
@@ -3,37 +3,16 @@
|
||||
|
||||
@TOP@
|
||||
|
||||
/* This is the default configuration file to read */
|
||||
#define USE_CONFIG_FILE 1
|
||||
|
||||
/* these are defined by automake */
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
/* define uint by configure if it is missed (QNX and BSD derived) */
|
||||
#undef uint
|
||||
|
||||
/* define ulong by configure if it is missed (most probably is) */
|
||||
#undef ulong
|
||||
|
||||
/* Undefine if you want stricter XML/SGML compliance by default */
|
||||
/* (this disables "<?expression?>" by default) */
|
||||
#define T_DEFAULT_SHORT_OPEN_TAG 1
|
||||
|
||||
/* Define both of these if you want the bundled REGEX library */
|
||||
#define REGEX 0
|
||||
#define HSREGEX 0
|
||||
|
||||
#undef ZEND_DEBUG
|
||||
|
||||
/* Define if you want to enable memory limit support */
|
||||
#define MEMORY_LIMIT 0
|
||||
|
||||
/* Define to compile Zend thread safe */
|
||||
#undef ZTS
|
||||
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
@BOTTOM@
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
@@ -50,15 +29,41 @@
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
/* Define if you have stdiostream.h */
|
||||
#undef HAVE_STDIOSTREAM_H
|
||||
|
||||
#if ZEND_BROKEN_SPRINTF
|
||||
int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#else
|
||||
# define zend_sprintf sprintf
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(NAN)
|
||||
#define zend_isnan(a) (((a)==NAN)?1:0)
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FINITE
|
||||
#define zend_finite(a) finite(a)
|
||||
#elif defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(fpclassify)
|
||||
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
|
||||
#else
|
||||
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
@@ -2,6 +2,24 @@ dnl $Id$
|
||||
dnl
|
||||
dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN(ZEND_FP_EXCEPT,[
|
||||
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
|
||||
AC_TRY_COMPILE([
|
||||
#include <floatingpoint.h>
|
||||
],[
|
||||
fp_except x = (fp_except) 0;
|
||||
],[
|
||||
ac_cv_type_fp_except=yes
|
||||
],[
|
||||
ac_cv_type_fp_except=no
|
||||
],[
|
||||
ac_cv_type_fp_except=no
|
||||
])])
|
||||
if test "$ac_cv_type_fp_except" = "yes"; then
|
||||
AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Check for broken sprintf()
|
||||
dnl
|
||||
|
||||
+104
-101
@@ -45,15 +45,15 @@
|
||||
%}
|
||||
|
||||
%pure_parser
|
||||
%expect 7
|
||||
%expect 4
|
||||
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
|
||||
%left ','
|
||||
%left T_LOGICAL_OR
|
||||
%left T_LOGICAL_XOR
|
||||
%left T_LOGICAL_AND
|
||||
%right T_PRINT
|
||||
%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL XT_OR_EQUAL T_SL_EQUAL T_SR_EQUAL
|
||||
%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL
|
||||
%left '?' ':'
|
||||
%left T_BOOLEAN_OR
|
||||
%left T_BOOLEAN_AND
|
||||
@@ -105,8 +105,6 @@
|
||||
%token T_FUNCTION
|
||||
%token T_CONST
|
||||
%token T_RETURN
|
||||
%token T_REQUIRE
|
||||
%token T_REQUIRE_ONCE
|
||||
%token T_USE
|
||||
%token T_GLOBAL
|
||||
%token T_STATIC
|
||||
@@ -133,7 +131,6 @@
|
||||
%token T_DOLLAR_OPEN_CURLY_BRACES
|
||||
%token T_CURLY_OPEN
|
||||
%token T_PAAMAYIM_NEKUDOTAYIM
|
||||
%token T_PHP_TRACK_VARS
|
||||
|
||||
%% /* Rules */
|
||||
|
||||
@@ -181,32 +178,39 @@ unticked_statement:
|
||||
for_expr
|
||||
';' { do_free(&$3 CLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); }
|
||||
for_expr
|
||||
';' { do_for_cond(&$6, &$7 CLS_CC); }
|
||||
';' { do_extended_info(CLS_C); do_for_cond(&$6, &$7 CLS_CC); }
|
||||
for_expr
|
||||
')' { do_free(&$9 CLS_CC); do_for_before_statement(&$4, &$7 CLS_CC); }
|
||||
for_statement { do_for_end(&$7 CLS_CC); }
|
||||
| T_SWITCH '(' expr ')' { do_switch_cond(&$3 CLS_CC); } switch_case_list { do_switch_end(&$6 CLS_CC); }
|
||||
| T_BREAK ';' { do_brk_cont(ZEND_BRK, NULL CLS_CC); }
|
||||
| T_SWITCH '(' expr ')' { do_switch_cond(&$3 CLS_CC); } switch_case_list { do_switch_end(&$6 CLS_CC); }
|
||||
| T_BREAK ';' { do_brk_cont(ZEND_BRK, NULL CLS_CC); }
|
||||
| T_BREAK expr ';' { do_brk_cont(ZEND_BRK, &$2 CLS_CC); }
|
||||
| T_CONTINUE ';' { do_brk_cont(ZEND_CONT, NULL CLS_CC); }
|
||||
| T_CONTINUE expr ';' { do_brk_cont(ZEND_CONT, &$2 CLS_CC); }
|
||||
| T_RETURN ';' { do_return(NULL, 0 CLS_CC); }
|
||||
| T_RETURN expr_without_variable ';' { do_return(&$2, 0 CLS_CC); }
|
||||
| T_RETURN cvar ';' { do_return(&$2, 1 CLS_CC); }
|
||||
| T_GLOBAL global_var_list
|
||||
| T_STATIC static_var_list
|
||||
| T_CONTINUE ';' { do_brk_cont(ZEND_CONT, NULL CLS_CC); }
|
||||
| T_CONTINUE expr ';' { do_brk_cont(ZEND_CONT, &$2 CLS_CC); }
|
||||
| T_RETURN ';' { do_return(NULL, 0 CLS_CC); }
|
||||
| T_RETURN expr_without_variable ';' { do_return(&$2, 0 CLS_CC); }
|
||||
| T_RETURN cvar ';' { do_return(&$2, 1 CLS_CC); }
|
||||
| T_GLOBAL global_var_list ';'
|
||||
| T_STATIC static_var_list ';'
|
||||
| T_ECHO echo_expr_list ';'
|
||||
| T_INLINE_HTML { do_echo(&$1 CLS_CC); }
|
||||
| expr ';' { do_free(&$1 CLS_CC); }
|
||||
| T_REQUIRE expr ';' { do_require(&$2, 0 CLS_CC); }
|
||||
| T_REQUIRE_ONCE use_filename ';' { do_require(&$2, 1 CLS_CC); }
|
||||
| T_USE use_filename ';' { use_filename($2.u.constant.value.str.val, $2.u.constant.value.str.len CLS_CC); zval_dtor(&$2.u.constant); }
|
||||
| T_UNSET '(' cvar ')' ';' { do_end_variable_parse(BP_VAR_UNSET, 0 CLS_CC); do_unset(&$3 CLS_CC); }
|
||||
| T_FOREACH '(' expr T_AS { do_foreach_begin(&$1, &$3, &$2, &$4 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| expr ';' { do_free(&$1 CLS_CC); }
|
||||
| T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); }
|
||||
| T_UNSET '(' unset_variables ')' ';'
|
||||
| T_FOREACH '(' w_cvar T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 1 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_FOREACH '(' expr_without_variable T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 0 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_DECLARE { do_declare_begin(CLS_C); } '(' declare_list ')' declare_statement { do_declare_end(CLS_C); }
|
||||
| ';' /* empty statement */
|
||||
;
|
||||
|
||||
unset_variables:
|
||||
unset_variable
|
||||
| unset_variables ',' unset_variable
|
||||
;
|
||||
|
||||
unset_variable:
|
||||
cvar { do_end_variable_parse(BP_VAR_UNSET, 0 CLS_CC); do_unset(&$1 CLS_CC); }
|
||||
;
|
||||
|
||||
use_filename:
|
||||
T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||
@@ -230,8 +234,8 @@ unticked_declaration_statement:
|
||||
|
||||
|
||||
foreach_optional_arg:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| T_DOUBLE_ARROW w_cvar { $$ = $2; }
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| T_DOUBLE_ARROW w_cvar { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
@@ -254,23 +258,23 @@ declare_statement:
|
||||
|
||||
|
||||
declare_list:
|
||||
T_STRING '=' static_scalar { do_declare_stmt(&$1, &$3 CLS_CC); }
|
||||
| declare_list ',' T_STRING '=' static_scalar { do_declare_stmt(&$3, &$5 CLS_CC); }
|
||||
T_STRING '=' static_scalar { do_declare_stmt(&$1, &$3 CLS_CC); }
|
||||
| declare_list ',' T_STRING '=' static_scalar { do_declare_stmt(&$3, &$5 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
switch_case_list:
|
||||
'{' case_list '}' { $$ = $2; }
|
||||
| '{' ';' case_list '}' { $$ = $3; }
|
||||
| ':' case_list T_ENDSWITCH ';' { $$ = $2; }
|
||||
| ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; }
|
||||
| ':' case_list T_ENDSWITCH ';' { $$ = $2; }
|
||||
| ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; }
|
||||
;
|
||||
|
||||
|
||||
case_list:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| case_list T_CASE expr case_separator { do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST }
|
||||
| case_list T_DEFAULT case_separator { do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
|
||||
| case_list T_CASE expr case_separator { do_extended_info(CLS_C); do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST }
|
||||
| case_list T_DEFAULT case_separator { do_extended_info(CLS_C); do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
|
||||
;
|
||||
|
||||
|
||||
@@ -311,8 +315,6 @@ new_else_single:
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
parameter_list:
|
||||
non_empty_parameter_list
|
||||
| /* empty */
|
||||
@@ -320,35 +322,35 @@ parameter_list:
|
||||
|
||||
|
||||
non_empty_parameter_list:
|
||||
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
function_call_parameter_list:
|
||||
non_empty_function_call_parameter_list { $$ = $1; }
|
||||
| /* empty */ { $$.u.constant.value.lval = 0; }
|
||||
non_empty_function_call_parameter_list { $$ = $1; }
|
||||
| /* empty */ { $$.u.constant.value.lval = 0; }
|
||||
;
|
||||
|
||||
|
||||
non_empty_function_call_parameter_list:
|
||||
expr_without_variable { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| cvar { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| '&' w_cvar { $$.u.constant.value.lval = 1; do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' '&' w_cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
expr_without_variable { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| cvar { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| '&' w_cvar { $$.u.constant.value.lval = 1; do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' '&' w_cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
;
|
||||
|
||||
global_var_list:
|
||||
global_var_list ',' global_var { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
| global_var { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
global_var_list ',' global_var { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
| global_var { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -384,14 +386,14 @@ class_statement:
|
||||
;
|
||||
|
||||
is_reference:
|
||||
/* empty */ { $$.op_type = ZEND_RETURN_VAL; }
|
||||
/* empty */ { $$.op_type = ZEND_RETURN_VAL; }
|
||||
| '&' { $$.op_type = ZEND_RETURN_REF; }
|
||||
|
||||
class_variable_decleration:
|
||||
class_variable_decleration ',' T_VARIABLE { do_declare_property(&$3, NULL CLS_CC); }
|
||||
| class_variable_decleration ',' T_VARIABLE '=' static_scalar { do_declare_property(&$3, &$5 CLS_CC); }
|
||||
| T_VARIABLE { do_declare_property(&$1, NULL CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { do_declare_property(&$1, &$3 CLS_CC); }
|
||||
class_variable_decleration ',' T_VARIABLE { do_declare_property(&$3, NULL CLS_CC); }
|
||||
| class_variable_decleration ',' T_VARIABLE '=' static_scalar { do_declare_property(&$3, &$5 CLS_CC); }
|
||||
| T_VARIABLE { do_declare_property(&$1, NULL CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { do_declare_property(&$1, &$3 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -403,12 +405,12 @@ echo_expr_list:
|
||||
|
||||
for_expr:
|
||||
/* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; }
|
||||
| non_empty_for_expr { $$ = $1; }
|
||||
| non_empty_for_expr { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_for_expr:
|
||||
non_empty_for_expr ',' { do_free(&$1 CLS_CC); } expr { $$ = $4; }
|
||||
| expr { $$ = $1; }
|
||||
non_empty_for_expr ',' { do_free(&$1 CLS_CC); } expr { $$ = $4; }
|
||||
| expr { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
@@ -426,7 +428,7 @@ expr_without_variable:
|
||||
| cvar T_MOD_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_AND_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_OR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar XT_OR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_XOR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_SL_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_SR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_INC { do_post_incdec(&$$, &$1, ZEND_POST_INC CLS_CC); }
|
||||
@@ -447,27 +449,27 @@ expr_without_variable:
|
||||
| expr '*' expr { do_binary_op(ZEND_MUL,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '/' expr { do_binary_op(ZEND_DIV,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '%' expr { do_binary_op(ZEND_MOD,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr T_SL expr { do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_SR expr { do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_SL expr { do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_SR expr { do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); do_binary_op(ZEND_ADD, &$$, &$1, &$2 CLS_CC); }
|
||||
| '-' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); do_binary_op(ZEND_SUB, &$$, &$1, &$2 CLS_CC); }
|
||||
| '!' expr { do_unary_op(ZEND_BOOL_NOT, &$$, &$2 CLS_CC); }
|
||||
| '~' expr { do_unary_op(ZEND_BW_NOT, &$$, &$2 CLS_CC); }
|
||||
| expr T_IS_IDENTICAL expr { do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_IDENTICAL expr { do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_EQUAL expr { do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_EQUAL expr { do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_IDENTICAL expr { do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_IDENTICAL expr { do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_EQUAL expr { do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_EQUAL expr { do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '<' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_SMALLER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_SMALLER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '>' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 CLS_CC); }
|
||||
| expr T_IS_GREATER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); }
|
||||
| expr T_IS_GREATER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
| expr '?' { do_begin_qm_op(&$1, &$2 CLS_CC); }
|
||||
expr ':' { do_qm_true(&$4, &$2, &$5 CLS_CC); }
|
||||
expr { do_qm_false(&$$, &$7, &$2, &$5 CLS_CC); }
|
||||
| function_call { $$ = $1; }
|
||||
| internal_functions_in_yacc { $$ = $1; }
|
||||
| T_INT_CAST expr { do_cast(&$$, &$2, IS_LONG CLS_CC); }
|
||||
| T_INT_CAST expr { do_cast(&$$, &$2, IS_LONG CLS_CC); }
|
||||
| T_DOUBLE_CAST expr { do_cast(&$$, &$2, IS_DOUBLE CLS_CC); }
|
||||
| T_STRING_CAST expr { do_cast(&$$, &$2, IS_STRING CLS_CC); }
|
||||
| T_ARRAY_CAST expr { do_cast(&$$, &$2, IS_ARRAY CLS_CC); }
|
||||
@@ -482,12 +484,11 @@ expr_without_variable:
|
||||
| T_PRINT expr { do_print(&$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
function_call:
|
||||
T_STRING '(' { do_extended_fcall_begin(CLS_C); $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
|
||||
T_STRING '(' { $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num CLS_CC); do_extended_fcall_end(CLS_C); }
|
||||
| r_cvar '(' { do_extended_fcall_begin(CLS_C); do_begin_dynamic_function_call(&$1 CLS_CC); }
|
||||
| cvar '(' { do_begin_dynamic_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
| T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_class_member_function_call(&$1, &$3 CLS_CC); }
|
||||
@@ -497,46 +498,46 @@ function_call:
|
||||
|
||||
|
||||
exit_expr:
|
||||
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
ctor_arguments:
|
||||
/* empty */ { $$.u.constant.value.lval=0; }
|
||||
| '(' function_call_parameter_list ')' { $$ = $2; }
|
||||
/* empty */ { $$.u.constant.value.lval=0; }
|
||||
| '(' function_call_parameter_list ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
class_name:
|
||||
T_STRING { $$ = $1; }
|
||||
| r_cvar { $$ = $1; }
|
||||
| r_cvar { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
|
||||
common_scalar:
|
||||
T_LNUMBER { $$=$1; }
|
||||
| T_DNUMBER { $$=$1; }
|
||||
T_LNUMBER { $$ = $1; }
|
||||
| T_DNUMBER { $$ = $1; }
|
||||
| T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||
| T_LINE { $$ = $1; }
|
||||
| T_FILE { $$ = $1; }
|
||||
| T_LINE { $$ = $1; }
|
||||
| T_FILE { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
static_scalar: /* compile-time evaluated scalars */
|
||||
common_scalar { $$ = $1; }
|
||||
| T_STRING { do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); }
|
||||
| T_STRING { do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); }
|
||||
| '+' static_scalar { $$ = $1; }
|
||||
| '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; }
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; }
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; }
|
||||
;
|
||||
|
||||
|
||||
scalar:
|
||||
T_STRING { do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); }
|
||||
| T_STRING_VARNAME { $$ = $1; }
|
||||
T_STRING { do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); }
|
||||
| T_STRING_VARNAME { $$ = $1; }
|
||||
| common_scalar { $$ = $1; }
|
||||
| '"' encaps_list '"' { $$ = $2; }
|
||||
| '\'' encaps_list '\'' { $$ = $2; }
|
||||
@@ -545,7 +546,7 @@ scalar:
|
||||
|
||||
|
||||
static_array_pair_list:
|
||||
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
|
||||
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
|
||||
| non_empty_static_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
@@ -556,9 +557,9 @@ possible_comma:
|
||||
|
||||
non_empty_static_array_pair_list:
|
||||
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { do_add_static_array_element(&$$, &$3, &$5); }
|
||||
| non_empty_static_array_pair_list ',' static_scalar { do_add_static_array_element(&$$, NULL, &$3); }
|
||||
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); }
|
||||
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, NULL, &$1); }
|
||||
| non_empty_static_array_pair_list ',' static_scalar { do_add_static_array_element(&$$, NULL, &$3); }
|
||||
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); }
|
||||
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, NULL, &$1); }
|
||||
;
|
||||
|
||||
expr:
|
||||
@@ -603,8 +604,8 @@ cvar_without_objects:
|
||||
|
||||
reference_variable:
|
||||
reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
|
||||
| reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| compound_variable { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
| reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| compound_variable { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -659,28 +660,28 @@ assignment_list_element:
|
||||
|
||||
|
||||
array_pair_list:
|
||||
/* empty */ { do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
|
||||
/* empty */ { do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_array_pair_list:
|
||||
non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { do_add_array_element(&$$, &$5, &$3, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr { do_add_array_element(&$$, &$3, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr { do_add_array_element(&$$, &$3, NULL, 0 CLS_CC); }
|
||||
| expr T_DOUBLE_ARROW expr { do_init_array(&$$, &$3, &$1, 0 CLS_CC); }
|
||||
| expr { do_init_array(&$$, &$1, NULL, 0 CLS_CC); }
|
||||
| expr { do_init_array(&$$, &$1, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_cvar { do_add_array_element(&$$, &$6, &$3, 1 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' '&' w_cvar { do_add_array_element(&$$, &$4, NULL, 1 CLS_CC); }
|
||||
| expr T_DOUBLE_ARROW '&' w_cvar { do_init_array(&$$, &$4, &$1, 1 CLS_CC); }
|
||||
| '&' w_cvar { do_init_array(&$$, &$2, NULL, 1 CLS_CC); }
|
||||
| '&' w_cvar { do_init_array(&$$, &$2, NULL, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
encaps_list:
|
||||
encaps_list encaps_var { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); do_add_variable(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_NUM_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_ENCAPSED_AND_WHITESPACE { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_BAD_CHARACTER { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_NUM_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_ENCAPSED_AND_WHITESPACE { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_BAD_CHARACTER { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '[' { $2.u.constant.value.lval = (long) '['; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list ']' { $2.u.constant.value.lval = (long) ']'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '{' { $2.u.constant.value.lval = (long) '{'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
@@ -703,18 +704,20 @@ encaps_var:
|
||||
|
||||
|
||||
encaps_var_offset:
|
||||
T_STRING { $$ = $1; }
|
||||
T_STRING { $$ = $1; }
|
||||
| T_NUM_STRING { $$ = $1; }
|
||||
| T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
| T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
internal_functions_in_yacc:
|
||||
T_ISSET '(' cvar ')' { do_isset_or_isempty(ZEND_ISSET, &$$, &$3 CLS_CC); }
|
||||
| T_EMPTY '(' cvar ')' { do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 CLS_CC); }
|
||||
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
|
||||
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
|
||||
| T_INCLUDE_ONCE expr { do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
|
||||
| T_EVAL '(' expr ')' { do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); }
|
||||
| T_REQUIRE expr { do_include_or_eval(ZEND_REQUIRE, &$$, &$2 CLS_CC); }
|
||||
| T_REQUIRE_ONCE expr { do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
+7
-9
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _LANGUAGE_SCANNER_H
|
||||
#define _LANGUAGE_SCANNER_H
|
||||
#ifndef ZEND_SCANNER_H
|
||||
#define ZEND_SCANNER_H
|
||||
|
||||
#ifdef ZTS
|
||||
class ZendFlexLexer : public yyFlexLexer
|
||||
@@ -33,21 +33,19 @@ public:
|
||||
#endif /* ZTS */
|
||||
|
||||
|
||||
#ifndef ZTS
|
||||
typedef struct _zend_lex_state {
|
||||
#ifndef ZTS
|
||||
YY_BUFFER_STATE buffer_state;
|
||||
int state;
|
||||
uint return_offset;
|
||||
uint lineno;
|
||||
FILE *in;
|
||||
char *filename;
|
||||
} zend_lex_state;
|
||||
#else
|
||||
typedef struct _zend_lex_state {
|
||||
ZendFlexLexer *ZFL;
|
||||
istream *input_file;
|
||||
} zend_lex_state;
|
||||
#endif
|
||||
uint lineno;
|
||||
char *filename;
|
||||
} zend_lex_state;
|
||||
|
||||
|
||||
void zend_fatal_scanner_error(char *);
|
||||
inline void restore_lexical_state(zend_lex_state * CLS_DC);
|
||||
|
||||
+97
-222
@@ -34,7 +34,6 @@
|
||||
%{
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
#include <winsock.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
@@ -92,6 +91,7 @@ private:
|
||||
stdiobuf _file;
|
||||
public:
|
||||
istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
|
||||
stdiobuf* rdbuf()/* const */ { return &_file; }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -148,12 +148,12 @@ static inline void save_lexical_state(zend_lex_state *lex_state CLS_DC)
|
||||
#ifndef ZTS
|
||||
memcpy(&lex_state->buffer_state,&YY_CURRENT_BUFFER,sizeof(YY_BUFFER_STATE));
|
||||
lex_state->in = yyin;
|
||||
lex_state->lineno = CG(zend_lineno);
|
||||
lex_state->state = YYSTATE;
|
||||
lex_state->filename = zend_get_compiled_filename(CLS_C);
|
||||
#else
|
||||
lex_state->ZFL = CG(ZFL);
|
||||
#endif
|
||||
lex_state->filename = zend_get_compiled_filename(CLS_C);
|
||||
lex_state->lineno = CG(zend_lineno);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,20 +170,20 @@ inline void restore_lexical_state(zend_lex_state *lex_state CLS_DC)
|
||||
|
||||
yy_delete_buffer(original_buffer_state);
|
||||
yyin = lex_state->in;
|
||||
CG(zend_lineno) = lex_state->lineno;
|
||||
BEGIN(lex_state->state);
|
||||
zend_restore_compiled_filename(lex_state->filename);
|
||||
#else
|
||||
delete((ZendFlexLexer *) CG(ZFL));
|
||||
CG(ZFL) = lex_state->ZFL;
|
||||
#endif
|
||||
CG(zend_lineno) = lex_state->lineno;
|
||||
zend_restore_compiled_filename(lex_state->filename);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
|
||||
ZEND_API void zend_open_file_dtor(zend_file_handle *fh)
|
||||
ZEND_API void zend_file_handle_dtor(zend_file_handle *fh)
|
||||
{
|
||||
switch (fh->type) {
|
||||
case ZEND_HANDLE_FP:
|
||||
@@ -207,7 +207,7 @@ ZEND_API void zend_open_file_dtor(zend_file_handle *fh)
|
||||
#endif
|
||||
}
|
||||
if (fh->opened_path) {
|
||||
free(fh->opened_path);
|
||||
efree(fh->opened_path);
|
||||
}
|
||||
if (fh->free_filename && fh->filename) {
|
||||
efree(fh->filename);
|
||||
@@ -235,7 +235,7 @@ int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
{
|
||||
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
|
||||
}
|
||||
@@ -243,23 +243,29 @@ ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
|
||||
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
{
|
||||
char *file_path=NULL;
|
||||
|
||||
#ifndef ZTS
|
||||
switch (file_handle->type) {
|
||||
case ZEND_HANDLE_FILENAME:
|
||||
file_handle->handle.fp = zend_fopen(file_handle->filename, &file_handle->opened_path);
|
||||
file_path = file_handle->opened_path;
|
||||
break;
|
||||
case ZEND_HANDLE_FD:
|
||||
file_handle->opened_path = NULL;
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->handle.fp = fdopen(file_handle->handle.fd, "r");
|
||||
break;
|
||||
case ZEND_HANDLE_FP:
|
||||
file_handle->opened_path = NULL;
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->handle.fp = file_handle->handle.fp;
|
||||
break;
|
||||
}
|
||||
if (!file_handle->handle.fp) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (!file_path) {
|
||||
file_path = file_handle->filename;
|
||||
}
|
||||
file_handle->type = ZEND_HANDLE_FP;
|
||||
if (file_handle->handle.fp != stdin) {
|
||||
zend_llist_add_element(&CG(open_files), file_handle);
|
||||
@@ -271,7 +277,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
#else
|
||||
switch (file_handle->type) {
|
||||
case ZEND_HANDLE_FD:
|
||||
file_handle->opened_path = NULL;
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->handle.is = new ifstream(file_handle->handle.fd);
|
||||
file_handle->type = ZEND_HANDLE_FSTREAM;
|
||||
break;
|
||||
@@ -286,7 +292,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
break;
|
||||
}
|
||||
case ZEND_HANDLE_FP:
|
||||
file_handle->opened_path = NULL;
|
||||
/* file_handle->opened_path = NULL; */
|
||||
if (file_handle->handle.fp==stdin) {
|
||||
file_handle->handle.is = &cin;
|
||||
} else {
|
||||
@@ -298,6 +304,9 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
file_path = file_handle->filename;
|
||||
|
||||
if (file_handle->handle.is->fail()) {
|
||||
delete file_handle->handle.is;
|
||||
return FAILURE;
|
||||
@@ -309,38 +318,23 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
CG(ZFL) = new ZendFlexLexer;
|
||||
CG(ZFL)->switch_streams(file_handle->handle.is, &cout);
|
||||
#endif
|
||||
zend_set_compiled_filename(file_handle->filename);
|
||||
zend_set_compiled_filename(file_path);
|
||||
CG(zend_lineno) = 1;
|
||||
return SUCCESS;
|
||||
}
|
||||
END_EXTERN_C()
|
||||
|
||||
|
||||
ZEND_API zend_op_array *zend_compile_files(int type CLS_DC, int file_count, ...)
|
||||
{
|
||||
va_list files;
|
||||
zend_op_array *op_array;
|
||||
|
||||
va_start(files, file_count);
|
||||
op_array = zend_v_compile_files(type CLS_CC, file_count, files);
|
||||
va_end(files);
|
||||
return op_array;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files)
|
||||
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS_DC)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
|
||||
zend_op_array *original_active_op_array = CG(active_op_array);
|
||||
zend_op_array *retval=NULL;
|
||||
int i;
|
||||
int compiler_result;
|
||||
int compiled_files=0;
|
||||
int last_file=0;
|
||||
zend_bool compilation_successful=0;
|
||||
znode retval_znode;
|
||||
zend_bool original_in_compilation = CG(in_compilation);
|
||||
zend_file_handle **file_handles = (zend_file_handle **) do_alloca(file_count * sizeof(zend_file_handle *));
|
||||
|
||||
retval_znode.op_type = IS_CONST;
|
||||
retval_znode.u.constant.type = IS_LONG;
|
||||
@@ -348,55 +342,42 @@ ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list
|
||||
retval_znode.u.constant.is_ref = 0;
|
||||
retval_znode.u.constant.refcount = 1;
|
||||
|
||||
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
|
||||
retval = op_array; /* success oriented */
|
||||
|
||||
for (i=0; i<file_count; i++) {
|
||||
file_handles[i] = va_arg(files, zend_file_handle *);
|
||||
if (file_handles[i]) {
|
||||
last_file = i;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<file_count; i++) {
|
||||
if (!file_handles[i]) {
|
||||
continue;
|
||||
}
|
||||
if (open_file_for_scanning(file_handles[i] CLS_CC)==FAILURE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handles[i]->filename);
|
||||
if (open_file_for_scanning(file_handle CLS_CC)==FAILURE) {
|
||||
if (type==ZEND_REQUIRE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
|
||||
zend_bailout();
|
||||
} else {
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
compiler_result = zendparse(CLS_C);
|
||||
zend_close_file_handle(file_handles[i] CLS_CC);
|
||||
if (i == last_file) {
|
||||
do_return(&retval_znode, 0 CLS_CC);
|
||||
}
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
CG(unclean_shutdown) = 1;
|
||||
retval = NULL;
|
||||
break;
|
||||
}
|
||||
compiled_files++;
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
|
||||
}
|
||||
compilation_successful=0;
|
||||
} else {
|
||||
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE CLS_CC);
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
compiler_result = zendparse(CLS_C);
|
||||
do_return(&retval_znode, 0 CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
CG(unclean_shutdown) = 1;
|
||||
retval = NULL;
|
||||
}
|
||||
compilation_successful=1;
|
||||
}
|
||||
|
||||
if (retval) {
|
||||
if (compiled_files>0) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
if (compilation_successful) {
|
||||
pass_two(op_array);
|
||||
} else {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
destroy_op_array(op_array);
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
}
|
||||
}
|
||||
free_alloca(file_handles);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -406,7 +387,6 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
zend_file_handle file_handle;
|
||||
zval tmp;
|
||||
zend_op_array *retval;
|
||||
int error_reporting=0;
|
||||
|
||||
if (filename->type != IS_STRING) {
|
||||
tmp = *filename;
|
||||
@@ -420,22 +400,12 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
file_handle.opened_path = NULL;
|
||||
|
||||
|
||||
if (type==ZEND_REQUIRE) {
|
||||
/* We don't want to hear about inclusion failures; If we fail,
|
||||
* we'll generate a require failure
|
||||
*/
|
||||
error_reporting = EG(error_reporting);
|
||||
EG(error_reporting) = 0;
|
||||
}
|
||||
retval = zend_compile_files(type CLS_CC, 1, &file_handle);
|
||||
|
||||
if (type==ZEND_REQUIRE) {
|
||||
EG(error_reporting) = error_reporting;
|
||||
if (!retval) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, filename->value.str.val);
|
||||
zend_bailout();
|
||||
}
|
||||
retval = zend_compile_file(&file_handle, type CLS_CC);
|
||||
if (retval && file_handle.opened_path) {
|
||||
int dummy = 1;
|
||||
zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
|
||||
}
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
|
||||
if (filename==&tmp) {
|
||||
zval_dtor(&tmp);
|
||||
@@ -443,8 +413,11 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
static inline int prepare_string_for_scanning(zval *str CLS_DC)
|
||||
#ifndef ZTS
|
||||
static inline int prepare_string_for_scanning(zval *str, char *filename)
|
||||
#else
|
||||
static inline int prepare_string_for_scanning(zval *str, istrstream **input_stream, char *filename CLS_DC)
|
||||
#endif
|
||||
{
|
||||
#ifndef ZTS
|
||||
/* enforce two trailing NULLs for flex... */
|
||||
@@ -455,16 +428,18 @@ static inline int prepare_string_for_scanning(zval *str CLS_DC)
|
||||
yyin=NULL;
|
||||
yy_scan_buffer(str->value.str.val, str->value.str.len+2);
|
||||
#else
|
||||
istrstream *input_stream = new istrstream(str->value.str.val, str->value.str.len);
|
||||
*input_stream = new istrstream(str->value.str.val, str->value.str.len);
|
||||
CG(ZFL) = new ZendFlexLexer;
|
||||
|
||||
CG(ZFL)->switch_streams(input_stream, &cout);
|
||||
CG(ZFL)->switch_streams(*input_stream, &cout);
|
||||
#endif
|
||||
zend_set_compiled_filename(filename);
|
||||
CG(zend_lineno) = 1;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
zend_op_array *compile_string(zval *source_string, char *filename CLS_DC)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
|
||||
@@ -473,6 +448,9 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
zval tmp;
|
||||
int compiler_result;
|
||||
zend_bool original_in_compilation = CG(in_compilation);
|
||||
#ifdef ZTS
|
||||
istrstream *input_stream;
|
||||
#endif
|
||||
|
||||
if (source_string->value.str.len==0) {
|
||||
efree(op_array);
|
||||
@@ -486,13 +464,16 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
convert_to_string(&tmp);
|
||||
source_string = &tmp;
|
||||
|
||||
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
if (prepare_string_for_scanning(source_string CLS_CC)==FAILURE) {
|
||||
destroy_op_array(op_array);
|
||||
#ifndef ZTS
|
||||
if (prepare_string_for_scanning(source_string, filename)==FAILURE) {
|
||||
#else
|
||||
if (prepare_string_for_scanning(source_string, &input_stream, filename CLS_CC)==FAILURE) {
|
||||
#endif
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
} else {
|
||||
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE CLS_CC);
|
||||
CG(active_op_array) = op_array;
|
||||
#ifndef ZTS
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
@@ -510,10 +491,12 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
do_return(NULL, 0 CLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array);
|
||||
pass_include_eval(op_array);
|
||||
retval = op_array;
|
||||
}
|
||||
}
|
||||
#ifdef ZTS
|
||||
delete input_stream;
|
||||
#endif
|
||||
zval_dtor(&tmp);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
return retval;
|
||||
@@ -521,87 +504,6 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
int require_filename(char *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
file_handle.filename = filename;
|
||||
file_handle.free_filename = 0;
|
||||
if (require_file(&file_handle, unique CLS_CC)==FAILURE) {
|
||||
zend_bailout();
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int use_filename(char *filename, uint filename_length CLS_DC)
|
||||
{
|
||||
zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()");
|
||||
return FAILURE;
|
||||
|
||||
#if 0
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.filename = (char *) emalloc(filename_length + zend_uv.import_use_extension_length);
|
||||
memcpy(file_handle.filename, filename, filename_length);
|
||||
memcpy(file_handle.filename+filename_length, zend_uv.import_use_extension, zend_uv.import_use_extension_length);
|
||||
file_handle.filename[filename_length+zend_uv.import_use_extension_length] = 0;
|
||||
file_handle.free_filename = 1;
|
||||
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
if (require_file(&file_handle, 1 CLS_CC)==FAILURE) {
|
||||
efree(file_handle.filename);
|
||||
zend_bailout();
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
return SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
int compiler_result;
|
||||
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
if (open_file_for_scanning(file_handle CLS_CC)==FAILURE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
|
||||
return FAILURE;
|
||||
}
|
||||
if (file_handle->opened_path) {
|
||||
if (unique) {
|
||||
zend_file_handle *pfh;
|
||||
|
||||
if (zend_hash_add(&CG(used_files), file_handle->opened_path, strlen(file_handle->opened_path)+1, file_handle, sizeof(zend_file_handle), (void **) &pfh)==FAILURE) {
|
||||
zend_close_file_handle(file_handle CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
/* pfh is a copy we only save for get_used_files() */
|
||||
pfh->type = ZEND_HANDLE_FILENAME;
|
||||
if (pfh->filename) {
|
||||
pfh->filename = estrdup(pfh->filename);
|
||||
pfh->free_filename = 1;
|
||||
}
|
||||
if (pfh->opened_path) {
|
||||
pfh->opened_path = strdup(pfh->opened_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
compiler_result = zendparse(CLS_C);
|
||||
zend_close_file_handle(file_handle CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
if (compiler_result==1) {
|
||||
zend_bailout();
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
@@ -618,26 +520,35 @@ int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlight
|
||||
return FAILURE;
|
||||
}
|
||||
zend_highlight(syntax_highlighter_ini);
|
||||
zend_close_file_handle(&file_handle CLS_CC);
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini)
|
||||
int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
zval tmp = *str;
|
||||
#ifdef ZTS
|
||||
istrstream *input_stream;
|
||||
#endif
|
||||
CLS_FETCH();
|
||||
|
||||
str = &tmp;
|
||||
zval_copy_ctor(str);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
if (prepare_string_for_scanning(str CLS_CC)==FAILURE) {
|
||||
#ifndef ZTS
|
||||
if (prepare_string_for_scanning(str, str_name)==FAILURE) {
|
||||
#else
|
||||
if (prepare_string_for_scanning(str, &input_stream, str_name CLS_CC)==FAILURE) {
|
||||
#endif
|
||||
return FAILURE;
|
||||
}
|
||||
zend_highlight(syntax_highlighter_ini);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
#ifdef ZTS
|
||||
delete input_stream;
|
||||
#endif
|
||||
zval_dtor(str);
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -686,47 +597,6 @@ int yyFlexLexer::yylex()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* redefine YY_INPUT to handle urls for win32*/
|
||||
#if 0 /*defined(ZEND_WIN32)*/
|
||||
#define YY_INPUT(buf,result,max_size) \
|
||||
if ( yyin->_tmpfname != "url" ){ \
|
||||
if ( yy_current_buffer->yy_is_interactive ) \
|
||||
{ \
|
||||
int c = '*', n; \
|
||||
for ( n = 0; n < max_size && \
|
||||
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
||||
buf[n] = (char) c; \
|
||||
if ( c == '\n' ) \
|
||||
buf[n++] = (char) c; \
|
||||
if ( c == EOF && ferror( yyin ) ) \
|
||||
YY_FATAL_ERROR( "input in flex scanner failed" ); \
|
||||
result = n; \
|
||||
} \
|
||||
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
|
||||
&& ferror( yyin ) ) \
|
||||
YY_FATAL_ERROR( "input in flex scanner failed" ); \
|
||||
}else{ /* this is a url */ \
|
||||
int recv_char=0,socketd=0; \
|
||||
/*memset(buf,0,max_size);*/ \
|
||||
socketd=yyin->_file; \
|
||||
if ( yy_current_buffer->yy_is_interactive ) \
|
||||
{ \
|
||||
int c = '*', n; \
|
||||
for ( n = 0; n < max_size && \
|
||||
( (recv_char=recv( socketd,(char *)&c,1,0 ))) >0 && c != '\n'; ++n ) \
|
||||
buf[n] = (char) c; \
|
||||
if ( c == '\n' ) \
|
||||
buf[n++] = (char) c; \
|
||||
if ( recv_char == SOCKET_ERROR ) \
|
||||
YY_FATAL_ERROR( "input from url in flex scanner failed" ); \
|
||||
result = n; \
|
||||
} \
|
||||
else if ((result = recv( socketd, (char *)buf, max_size, 0)) == SOCKET_ERROR) \
|
||||
YY_FATAL_ERROR( "input from url read in flex scanner failed" ); \
|
||||
}
|
||||
#endif
|
||||
|
||||
%}
|
||||
|
||||
LNUM [0-9]+
|
||||
@@ -739,6 +609,7 @@ TABS_AND_SPACES [ \t]*
|
||||
TOKENS [;:,.\[\]()|^&+-/*=%!~$<>?@]
|
||||
ENCAPSED_TOKENS [\[\]{}$]
|
||||
ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
ANY_CHAR (.|[\n])
|
||||
|
||||
%option noyylineno
|
||||
%option noyywrap
|
||||
@@ -877,7 +748,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
return T_STRING;
|
||||
}
|
||||
|
||||
<ST_LOOKING_FOR_PROPERTY>. {
|
||||
<ST_LOOKING_FOR_PROPERTY>{ANY_CHAR} {
|
||||
/*unput(yytext[0]);*/
|
||||
yyless(0);
|
||||
yy_pop_state();
|
||||
@@ -1053,7 +924,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"^=" {
|
||||
return XT_OR_EQUAL;
|
||||
return T_XOR_EQUAL;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"||" {
|
||||
@@ -1120,7 +991,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
}
|
||||
|
||||
|
||||
<ST_LOOKING_FOR_VARNAME>. {
|
||||
<ST_LOOKING_FOR_VARNAME>{ANY_CHAR} {
|
||||
/*unput(yytext[0]);*/
|
||||
yyless(0);
|
||||
yy_pop_state();
|
||||
@@ -1221,6 +1092,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
zendlval->value.str.len = yyleng;
|
||||
zendlval->type = IS_STRING;
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
return T_OPEN_TAG;
|
||||
} else {
|
||||
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
|
||||
zendlval->value.str.len = yyleng;
|
||||
@@ -1241,9 +1113,12 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
|
||||
|
||||
<INITIAL>"<?php_track_vars?>"([\n]|"\r\n")? {
|
||||
zend_message_dispatcher(ZMSG_ENABLE_TRACK_VARS, NULL);
|
||||
zend_error(E_WARNING, "<?php_track_vars?> is no longer supported - please use the track_vars INI directive instead");
|
||||
HANDLE_NEWLINE(yytext[yyleng-1]);
|
||||
return T_PHP_TRACK_VARS;
|
||||
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
|
||||
zendlval->value.str.len = yyleng;
|
||||
zendlval->type = IS_STRING;
|
||||
return T_INLINE_HTML;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING,ST_DOUBLE_QUOTES,ST_HEREDOC,ST_BACKQUOTE>"$"{LABEL} {
|
||||
@@ -1612,7 +1487,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
return T_CHARACTER;
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\". {
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\"{ANY_CHAR} {
|
||||
switch (yytext[1]) {
|
||||
case 'n':
|
||||
zendlval->value.lval = (long) '\n';
|
||||
@@ -1680,6 +1555,6 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
|
||||
|
||||
|
||||
<ST_IN_SCRIPTING,INITIAL,ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_SINGLE_QUOTE,ST_HEREDOC>. {
|
||||
<ST_IN_SCRIPTING,INITIAL,ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_SINGLE_QUOTE,ST_HEREDOC>{ANY_CHAR} {
|
||||
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d",yytext[0],yytext[0],YYSTATE);
|
||||
}
|
||||
+211
-53
@@ -36,6 +36,10 @@
|
||||
# define GLOBAL_CONSTANTS_TABLE CG(zend_constants)
|
||||
#endif
|
||||
|
||||
#if defined(ZEND_WIN32) && ZEND_DEBUG
|
||||
BOOL WINAPI IsDebuggerPresent(VOID);
|
||||
#endif
|
||||
|
||||
/* true multithread-shared globals */
|
||||
ZEND_API zend_class_entry zend_standard_class_def;
|
||||
ZEND_API int (*zend_printf)(const char *format, ...);
|
||||
@@ -44,14 +48,11 @@ ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
|
||||
ZEND_API void (*zend_block_interruptions)(void);
|
||||
ZEND_API void (*zend_unblock_interruptions)(void);
|
||||
ZEND_API void (*zend_ticks_function)(int ticks);
|
||||
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
|
||||
static void (*zend_message_dispatcher_p)(long message, void *data);
|
||||
static int (*zend_get_ini_entry_p)(char *name, uint name_length, zval *contents);
|
||||
|
||||
#if ZEND_NEW_ERROR_HANDLING
|
||||
static void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
#else
|
||||
ZEND_API void (*zend_error_cb)(int type, const char *format, ...);
|
||||
#endif
|
||||
|
||||
#ifdef ZTS
|
||||
ZEND_API int compiler_globals_id;
|
||||
@@ -142,16 +143,9 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
|
||||
expr_copy->value.str.len = sizeof("Array")-1;
|
||||
expr_copy->value.str.val = estrndup("Array", expr_copy->value.str.len);
|
||||
break;
|
||||
case IS_OBJECT: {
|
||||
zval function_name;
|
||||
ZVAL_STRING(&function_name,"__string_value",1);
|
||||
|
||||
if (call_user_function(NULL, expr, &function_name, expr_copy, 0, NULL)==FAILURE) {
|
||||
expr_copy->value.str.len = sizeof("Object")-1;
|
||||
expr_copy->value.str.val = estrndup("Object", expr_copy->value.str.len);
|
||||
}
|
||||
efree(function_name.value.str.val);
|
||||
}
|
||||
case IS_OBJECT:
|
||||
expr_copy->value.str.len = sizeof("Object")-1;
|
||||
expr_copy->value.str.val = estrndup("Object", expr_copy->value.str.len);
|
||||
break;
|
||||
default:
|
||||
*expr_copy = *expr;
|
||||
@@ -220,9 +214,9 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
|
||||
static FILE *zend_fopen_wrapper(const char *filename, char **opened_path)
|
||||
{
|
||||
if (opened_path) {
|
||||
*opened_path = strdup(filename);
|
||||
*opened_path = estrdup(filename);
|
||||
}
|
||||
return fopen(filename, "r");
|
||||
return fopen(filename, "rb");
|
||||
}
|
||||
|
||||
|
||||
@@ -232,8 +226,8 @@ static void register_standard_class(void)
|
||||
zend_standard_class_def.name_length = sizeof("stdClass") - 1;
|
||||
zend_standard_class_def.name = zend_strndup("stdClass", zend_standard_class_def.name_length);
|
||||
zend_standard_class_def.parent = NULL;
|
||||
zend_hash_init(&zend_standard_class_def.default_properties, 0, NULL, ZVAL_PTR_DTOR, 1);
|
||||
zend_hash_init(&zend_standard_class_def.function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1);
|
||||
zend_hash_init_ex(&zend_standard_class_def.default_properties, 0, NULL, ZVAL_PTR_DTOR, 1, 0);
|
||||
zend_hash_init_ex(&zend_standard_class_def.function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1, 0);
|
||||
zend_standard_class_def.handle_function_call = NULL;
|
||||
zend_standard_class_def.handle_property_get = NULL;
|
||||
zend_standard_class_def.handle_property_set = NULL;
|
||||
@@ -243,21 +237,33 @@ static void register_standard_class(void)
|
||||
}
|
||||
|
||||
|
||||
static void zend_set_default_compile_time_values(CLS_D)
|
||||
{
|
||||
/* default compile-time values */
|
||||
CG(asp_tags) = 0;
|
||||
CG(short_tags) = 1;
|
||||
CG(allow_call_time_pass_reference) = 1;
|
||||
CG(extended_info) = 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ZTS
|
||||
static void compiler_globals_ctor(zend_compiler_globals *compiler_globals)
|
||||
{
|
||||
zend_function tmp_func;
|
||||
zend_class_entry tmp_class;
|
||||
|
||||
compiler_globals->compiled_filename = NULL;
|
||||
|
||||
compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
|
||||
zend_hash_init(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1);
|
||||
zend_hash_init_ex(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
|
||||
zend_hash_copy(compiler_globals->function_table, global_function_table, NULL, &tmp_func, sizeof(zend_function));
|
||||
|
||||
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
|
||||
zend_hash_init(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1);
|
||||
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));
|
||||
|
||||
compiler_globals->extended_info = 0;
|
||||
zend_set_default_compile_time_values(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
@@ -281,6 +287,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals)
|
||||
zend_copy_constants(executor_globals->zend_constants, global_constants_table);
|
||||
}
|
||||
zend_init_rsrc_plist(ELS_C);
|
||||
EG(lambda_count)=0;
|
||||
}
|
||||
|
||||
|
||||
@@ -298,6 +305,10 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/* FreeBSD floating point precision fix */
|
||||
#include <floatingpoint.h>
|
||||
#endif
|
||||
|
||||
int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions)
|
||||
{
|
||||
@@ -310,6 +321,23 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
start_memory_manager(ALS_C);
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
{
|
||||
/* FreeBSD floating point precision fix */
|
||||
#ifdef HAVE_FP_EXCEPT
|
||||
fp_except
|
||||
#else
|
||||
fp_except_t
|
||||
#endif
|
||||
mask;
|
||||
|
||||
mask = fpgetmask();
|
||||
fpsetmask(mask & ~FP_X_IMP);
|
||||
}
|
||||
#endif
|
||||
|
||||
zend_startup_extensions_mechanism();
|
||||
|
||||
/* Set up utility functions and values */
|
||||
zend_error_cb = utility_functions->error_function;
|
||||
zend_printf = utility_functions->printf_function;
|
||||
@@ -324,21 +352,19 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
zend_get_ini_entry_p = utility_functions->get_ini_entry;
|
||||
zend_ticks_function = utility_functions->ticks_function;
|
||||
|
||||
zend_v_compile_files = v_compile_files;
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute = execute;
|
||||
|
||||
zend_startup_extensions();
|
||||
|
||||
/* set up version */
|
||||
zend_version_info = strdup(ZEND_CORE_VERSION_INFO);
|
||||
zend_version_info_length = sizeof(ZEND_CORE_VERSION_INFO)-1;
|
||||
|
||||
GLOBAL_FUNCTION_TABLE = (HashTable *) malloc(sizeof(HashTable));
|
||||
GLOBAL_CLASS_TABLE = (HashTable *) malloc(sizeof(HashTable));
|
||||
zend_hash_init(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1);
|
||||
zend_hash_init(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1);
|
||||
zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
|
||||
zend_hash_init_ex(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
|
||||
register_standard_class();
|
||||
zend_hash_init(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1);
|
||||
zend_hash_init_ex(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1, 0);
|
||||
zend_init_rsrc_list_dtors();
|
||||
|
||||
/* This zval can be used to initialize allocate zval's to an uninit'ed value */
|
||||
@@ -359,6 +385,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
GLOBAL_CONSTANTS_TABLE = EG(zend_constants);
|
||||
#else
|
||||
zend_startup_constants();
|
||||
zend_set_default_compile_time_values(CLS_C);
|
||||
#endif
|
||||
zend_register_standard_constants(ELS_C);
|
||||
|
||||
@@ -376,6 +403,9 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
|
||||
void zend_shutdown()
|
||||
{
|
||||
#ifdef ZEND_WIN32
|
||||
zend_shutdown_timeout_thread();
|
||||
#endif
|
||||
#ifndef ZTS
|
||||
zend_destroy_rsrc_plist();
|
||||
#endif
|
||||
@@ -465,16 +495,26 @@ void zend_deactivate_modules()
|
||||
ELS_FETCH();
|
||||
EG(opline_ptr) = NULL; /* we're no longer executing anything */
|
||||
|
||||
zend_hash_apply(&module_registry, (int (*)(void *)) module_registry_cleanup);
|
||||
if (setjmp(EG(bailout))==0) {
|
||||
zend_hash_apply(&module_registry, (int (*)(void *)) module_registry_cleanup);
|
||||
}
|
||||
}
|
||||
|
||||
void zend_deactivate(CLS_D ELS_DC)
|
||||
{
|
||||
EG(opline_ptr) = NULL; /* we're no longer executing anything */
|
||||
/* we're no longer executing anything */
|
||||
EG(opline_ptr) = NULL;
|
||||
EG(active_symbol_table) = NULL;
|
||||
|
||||
shutdown_scanner(CLS_C);
|
||||
shutdown_executor(ELS_C);
|
||||
shutdown_compiler(CLS_C);
|
||||
if (setjmp(EG(bailout))==0) {
|
||||
shutdown_scanner(CLS_C);
|
||||
}
|
||||
if (setjmp(EG(bailout))==0) {
|
||||
shutdown_executor(ELS_C);
|
||||
}
|
||||
if (setjmp(EG(bailout))==0) {
|
||||
shutdown_compiler(CLS_C);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -498,19 +538,17 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents)
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if ZEND_NEW_ERROR_HANDLING
|
||||
|
||||
#define ZEND_ERROR_BUFFER_SIZE 1024
|
||||
|
||||
ZEND_API void zend_error(int type, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
zval **params;
|
||||
zval retval;
|
||||
zval error_type, error_message;
|
||||
zval ***params;
|
||||
zval *retval;
|
||||
zval *z_error_type, *z_error_message, *z_error_filename, *z_error_lineno, *z_context;
|
||||
char *error_filename;
|
||||
uint error_lineno;
|
||||
zval *orig_user_error_handler;
|
||||
ELS_FETCH();
|
||||
CLS_FETCH();
|
||||
|
||||
@@ -552,6 +590,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
/* if we don't have a user defined error handler */
|
||||
if (!EG(user_error_handler)) {
|
||||
zend_error_cb(type, error_filename, error_lineno, format, args);
|
||||
@@ -567,34 +606,153 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
break;
|
||||
default:
|
||||
/* Handle the error in user space */
|
||||
INIT_PZVAL(&error_message);
|
||||
INIT_PZVAL(&error_type);
|
||||
error_message.value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE);
|
||||
ALLOC_INIT_ZVAL(z_error_message);
|
||||
ALLOC_INIT_ZVAL(z_error_type);
|
||||
ALLOC_INIT_ZVAL(z_error_filename);
|
||||
ALLOC_INIT_ZVAL(z_error_lineno);
|
||||
ALLOC_INIT_ZVAL(z_context);
|
||||
z_error_message->value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE);
|
||||
|
||||
/* error_message.value.str.len = vsnprintf(error_message->value.str.val, error_message->value.str.len-1, format, args); */
|
||||
error_message.value.str.len = vsprintf(error_message.value.str.val, format, args);
|
||||
error_message.type = IS_STRING;
|
||||
#ifdef HAVE_VSNPRINTF
|
||||
z_error_message->value.str.len = vsnprintf(z_error_message->value.str.val, ZEND_ERROR_BUFFER_SIZE, format, args);
|
||||
if (z_error_message->value.str.len > ZEND_ERROR_BUFFER_SIZE-1) {
|
||||
z_error_message->value.str.len = ZEND_ERROR_BUFFER_SIZE-1;
|
||||
}
|
||||
#else
|
||||
strncpy(z_error_message->value.str.val, format, ZEND_ERROR_BUFFER_SIZE);
|
||||
/* This is risky... */
|
||||
/* z_error_message->value.str.len = vsprintf(z_error_message->value.str.val, format, args); */
|
||||
#endif
|
||||
z_error_message->type = IS_STRING;
|
||||
|
||||
error_type.value.lval = type;
|
||||
error_type.type = IS_LONG;
|
||||
z_error_type->value.lval = type;
|
||||
z_error_type->type = IS_LONG;
|
||||
|
||||
params = (zval **) emalloc(sizeof(zval *)*2);
|
||||
params[0] = &error_type;
|
||||
params[1] = &error_message;
|
||||
if (error_filename) {
|
||||
z_error_filename->value.str.len = strlen(error_filename);
|
||||
z_error_filename->value.str.val = estrndup(error_filename, z_error_filename->value.str.len);
|
||||
z_error_filename->type = IS_STRING;
|
||||
}
|
||||
|
||||
z_error_lineno->value.lval = error_lineno;
|
||||
z_error_lineno->type = IS_LONG;
|
||||
|
||||
if (call_user_function(CG(function_table), NULL, EG(user_error_handler), &retval, 2, params)==SUCCESS) {
|
||||
zval_dtor(&retval);
|
||||
z_context->value.ht = EG(active_symbol_table);
|
||||
z_context->type = IS_ARRAY;
|
||||
ZVAL_ADDREF(z_context); /* we don't want this one to be freed */
|
||||
|
||||
params = (zval ***) emalloc(sizeof(zval **)*5);
|
||||
params[0] = &z_error_type;
|
||||
params[1] = &z_error_message;
|
||||
params[2] = &z_error_filename;
|
||||
params[3] = &z_error_lineno;
|
||||
params[4] = &z_context;
|
||||
|
||||
orig_user_error_handler = EG(user_error_handler);
|
||||
EG(user_error_handler) = NULL;
|
||||
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL)==SUCCESS) {
|
||||
zval_ptr_dtor(&retval);
|
||||
} else {
|
||||
/* The user error handler failed, use built-in error handler */
|
||||
zend_error_cb(type, error_filename, error_lineno, format, args);
|
||||
}
|
||||
EG(user_error_handler) = orig_user_error_handler;
|
||||
|
||||
efree(params);
|
||||
efree(error_message.value.str.val);
|
||||
zval_ptr_dtor(&z_error_message);
|
||||
zval_ptr_dtor(&z_error_type);
|
||||
zval_ptr_dtor(&z_error_filename);
|
||||
zval_ptr_dtor(&z_error_lineno);
|
||||
if (ZVAL_REFCOUNT(z_context)==2) {
|
||||
FREE_ZVAL(z_context);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...)
|
||||
{
|
||||
#if ZEND_DEBUG
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
# ifdef ZEND_WIN32
|
||||
{
|
||||
char output_buf[1024];
|
||||
|
||||
vsnprintf(output_buf, 1024, format, args);
|
||||
OutputDebugString(output_buf);
|
||||
OutputDebugString("\n");
|
||||
if (trigger_break && IsDebuggerPresent()) {
|
||||
DebugBreak();
|
||||
}
|
||||
}
|
||||
# else
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
# endif
|
||||
va_end(args);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_execute_scripts(int type CLS_DC ELS_DC, int file_count, ...)
|
||||
{
|
||||
va_list files;
|
||||
int i;
|
||||
zend_file_handle *file_handle;
|
||||
|
||||
va_start(files, file_count);
|
||||
for (i=0; i<file_count; i++) {
|
||||
file_handle = va_arg(files, zend_file_handle *);
|
||||
if (!file_handle) {
|
||||
continue;
|
||||
}
|
||||
EG(active_op_array) = zend_compile_file(file_handle, ZEND_INCLUDE CLS_CC);
|
||||
zend_destroy_file_handle(file_handle CLS_CC);
|
||||
if (EG(active_op_array)) {
|
||||
zend_execute(EG(active_op_array) ELS_CC);
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
EG(return_value_ptr_ptr) = &EG(global_return_value_ptr);
|
||||
EG(global_return_value_ptr) = NULL;
|
||||
destroy_op_array(EG(active_op_array));
|
||||
efree(EG(active_op_array));
|
||||
} else if (type==ZEND_REQUIRE) {
|
||||
va_end(files);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
va_end(files);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
#define COMPILED_STRING_DESCRIPTION_FORMAT "%s(%d) : %s"
|
||||
|
||||
ZEND_API char *zend_make_compiled_string_description(char *name)
|
||||
{
|
||||
char *cur_filename;
|
||||
int cur_lineno;
|
||||
char *compiled_string_description;
|
||||
CLS_FETCH();
|
||||
ELS_FETCH();
|
||||
|
||||
if (zend_is_compiling()) {
|
||||
cur_filename = zend_get_compiled_filename(CLS_C);
|
||||
cur_lineno = zend_get_compiled_lineno(CLS_C);
|
||||
} else if (zend_is_executing()) {
|
||||
cur_filename = zend_get_executed_filename(ELS_C);
|
||||
cur_lineno = zend_get_executed_lineno(ELS_C);
|
||||
} else {
|
||||
cur_filename = "Unknown";
|
||||
cur_lineno = 0;
|
||||
}
|
||||
|
||||
compiled_string_description = emalloc(sizeof(COMPILED_STRING_DESCRIPTION_FORMAT)+strlen(name)+strlen(cur_filename)+MAX_LENGTH_OF_LONG);
|
||||
sprintf(compiled_string_description, COMPILED_STRING_DESCRIPTION_FORMAT, cur_filename, cur_lineno, name);
|
||||
return compiled_string_description;
|
||||
}
|
||||
|
||||
+39
-27
@@ -18,12 +18,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_H
|
||||
#define _ZEND_H
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "1.00"
|
||||
|
||||
#define ZEND_NEW_ERROR_HANDLING 0
|
||||
#define ZEND_VERSION "1.0.3"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_EXTERN_C() extern "C" {
|
||||
@@ -125,6 +123,11 @@
|
||||
#define ZEND_FILE_LINE_ORIG_RELAY_CC
|
||||
#endif /* ZEND_DEBUG */
|
||||
|
||||
#ifdef ZTS
|
||||
#define ZTS_V 1
|
||||
#else
|
||||
#define ZTS_V 0
|
||||
#endif
|
||||
|
||||
#include "zend_errors.h"
|
||||
#include "zend_alloc.h"
|
||||
@@ -132,6 +135,7 @@
|
||||
typedef unsigned char zend_bool;
|
||||
typedef unsigned char zend_uchar;
|
||||
typedef unsigned int zend_uint;
|
||||
typedef unsigned long zend_ulong;
|
||||
typedef unsigned short zend_ushort;
|
||||
|
||||
#undef SUCCESS
|
||||
@@ -221,11 +225,7 @@ struct _zend_class_entry {
|
||||
|
||||
|
||||
typedef struct _zend_utility_functions {
|
||||
#if ZEND_NEW_ERROR_HANDLING
|
||||
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
#else
|
||||
void (*error_function)(int type, const char *format, ...);
|
||||
#endif
|
||||
int (*printf_function)(const char *format, ...);
|
||||
int (*write_function)(const char *str, uint str_length);
|
||||
FILE *(*fopen_function)(const char *filename, char **opened_path);
|
||||
@@ -238,9 +238,6 @@ typedef struct _zend_utility_functions {
|
||||
|
||||
|
||||
typedef struct _zend_utility_values {
|
||||
zend_bool short_tags;
|
||||
zend_bool asp_tags;
|
||||
zend_bool allow_call_time_pass_reference;
|
||||
char *import_use_extension;
|
||||
uint import_use_extension_length;
|
||||
} zend_utility_values;
|
||||
@@ -255,6 +252,8 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#define ZEND_STRL(str) (str), (sizeof(str)-1)
|
||||
#define ZEND_STRS(str) (str), (sizeof(str)
|
||||
#define ZEND_NORMALIZE_BOOL(n) \
|
||||
((n) ? (((n)>0) ? 1 : -1) : 0)
|
||||
|
||||
|
||||
/* data types */
|
||||
@@ -267,9 +266,10 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
|
||||
#define IS_BOOL 6
|
||||
#define IS_RESOURCE 7
|
||||
#define IS_CONSTANT 8
|
||||
#define IS_CONSTANT_ARRAY 9
|
||||
|
||||
/* Special data type to temporarily mark large numbers */
|
||||
#define FLAG_IS_BC 9 /* for parser internal use only */
|
||||
#define FLAG_IS_BC 10 /* for parser internal use only */
|
||||
|
||||
/* overloaded elements data types */
|
||||
#define OE_IS_ARRAY (1<<0)
|
||||
@@ -298,6 +298,13 @@ ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int in
|
||||
ZEND_API void zend_print_zval_r(zval *expr, int indent);
|
||||
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent);
|
||||
|
||||
ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...);
|
||||
#if ZEND_DEBUG
|
||||
#define Z_DBG(expr) (expr)
|
||||
#else
|
||||
#define Z_DBG(expr)
|
||||
#endif
|
||||
|
||||
ZEND_API extern char *empty_string;
|
||||
|
||||
#define STR_FREE(ptr) if (ptr && ptr!=empty_string) { efree(ptr); }
|
||||
@@ -324,14 +331,10 @@ extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
|
||||
extern ZEND_API void (*zend_block_interruptions)(void);
|
||||
extern ZEND_API void (*zend_unblock_interruptions)(void);
|
||||
extern ZEND_API void (*zend_ticks_function)(int ticks);
|
||||
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
|
||||
|
||||
#if ZEND_NEW_ERROR_HANDLING
|
||||
ZEND_API void zend_error(int type, const char *format, ...);
|
||||
#else
|
||||
#define zend_error zend_error_cb
|
||||
ZEND_API void (*zend_error_cb)(int type, const char *format, ...);
|
||||
#endif
|
||||
|
||||
void zenderror(char *error);
|
||||
|
||||
@@ -355,13 +358,17 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
|
||||
|
||||
/* Messages for applications of Zend */
|
||||
#define ZMSG_ENABLE_TRACK_VARS 1L
|
||||
#define ZMSG_FAILED_INCLUDE_FOPEN 2L
|
||||
#define ZMSG_FAILED_REQUIRE_FOPEN 3L
|
||||
#define ZMSG_FAILED_HIGHLIGHT_FOPEN 4L
|
||||
#define ZMSG_MEMORY_LEAK_DETECTED 5L
|
||||
#define ZMSG_MEMORY_LEAK_REPEATED 6L
|
||||
#define ZMSG_LOG_SCRIPT_NAME 7L
|
||||
#define ZMSG_FAILED_INCLUDE_FOPEN 1L
|
||||
#define ZMSG_FAILED_REQUIRE_FOPEN 2L
|
||||
#define ZMSG_FAILED_HIGHLIGHT_FOPEN 3L
|
||||
#define ZMSG_MEMORY_LEAK_DETECTED 4L
|
||||
#define ZMSG_MEMORY_LEAK_REPEATED 5L
|
||||
#define ZMSG_LOG_SCRIPT_NAME 6L
|
||||
|
||||
|
||||
#define ZVAL_ADDREF(pz) (++(pz)->refcount)
|
||||
#define ZVAL_DELREF(pz) (--(pz)->refcount)
|
||||
#define ZVAL_REFCOUNT(pz) ((pz)->refcount)
|
||||
|
||||
#define INIT_PZVAL(z) \
|
||||
(z)->refcount = 1; \
|
||||
@@ -398,6 +405,11 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
}
|
||||
|
||||
#define SEPARATE_ZVAL_TO_MAKE_IS_REF(ppzv) \
|
||||
if (!PZVAL_IS_REF(*ppzv)) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
(*(ppzv))->is_ref = 1; \
|
||||
}
|
||||
|
||||
#define COPY_PZVAL_TO_ZVAL(zv, pzv) \
|
||||
(zv) = *(pzv); \
|
||||
@@ -405,7 +417,7 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
zval_copy_ctor(&(zv)); \
|
||||
(pzv)->refcount--; \
|
||||
} else { \
|
||||
FREE_ZVAL(pzv); \
|
||||
FREE_ZVAL(pzv); \
|
||||
} \
|
||||
INIT_PZVAL(&(zv));
|
||||
|
||||
@@ -422,7 +434,7 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
#define EMPTY_SWITCH_DEFAULT_CASE()
|
||||
#endif
|
||||
|
||||
#endif /* _ZEND_H */
|
||||
#endif /* ZEND_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
+81
-24
@@ -25,7 +25,7 @@
|
||||
#include "zend_constants.h"
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
/* these variables are true statics/globals, and have to be mutex'ed on every access */
|
||||
@@ -50,9 +50,9 @@ ZEND_API int zend_get_parameters(int ht, int param_count, ...)
|
||||
|
||||
va_start(ptr, param_count);
|
||||
|
||||
while (param_count>0) {
|
||||
while (param_count-->0) {
|
||||
param = va_arg(ptr, zval **);
|
||||
param_ptr = *(p-param_count);
|
||||
param_ptr = *(p-arg_count);
|
||||
if (!PZVAL_IS_REF(param_ptr) && param_ptr->refcount>1) {
|
||||
zval *new_tmp;
|
||||
|
||||
@@ -61,11 +61,11 @@ ZEND_API int zend_get_parameters(int ht, int param_count, ...)
|
||||
zval_copy_ctor(new_tmp);
|
||||
INIT_PZVAL(new_tmp);
|
||||
param_ptr = new_tmp;
|
||||
((zval *) *(p-param_count))->refcount--;
|
||||
*(p-param_count) = param_ptr;
|
||||
((zval *) *(p-arg_count))->refcount--;
|
||||
*(p-arg_count) = param_ptr;
|
||||
}
|
||||
*param = param_ptr;
|
||||
param_count--;
|
||||
arg_count--;
|
||||
}
|
||||
va_end(ptr);
|
||||
|
||||
@@ -87,9 +87,8 @@ ZEND_API int zend_get_parameters_array(int ht, int param_count, zval **argument_
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
while (param_count>0) {
|
||||
param_ptr = *(p-param_count);
|
||||
while (param_count-->0) {
|
||||
param_ptr = *(p-arg_count);
|
||||
if (!PZVAL_IS_REF(param_ptr) && param_ptr->refcount>1) {
|
||||
zval *new_tmp;
|
||||
|
||||
@@ -98,11 +97,11 @@ ZEND_API int zend_get_parameters_array(int ht, int param_count, zval **argument_
|
||||
zval_copy_ctor(new_tmp);
|
||||
INIT_PZVAL(new_tmp);
|
||||
param_ptr = new_tmp;
|
||||
((zval *) *(p-param_count))->refcount--;
|
||||
*(p-param_count) = param_ptr;
|
||||
((zval *) *(p-arg_count))->refcount--;
|
||||
*(p-arg_count) = param_ptr;
|
||||
}
|
||||
*(argument_array++) = param_ptr;
|
||||
param_count--;
|
||||
arg_count--;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
@@ -129,9 +128,9 @@ ZEND_API int zend_get_parameters_ex(int param_count, ...)
|
||||
}
|
||||
|
||||
va_start(ptr, param_count);
|
||||
while (param_count>0) {
|
||||
while (param_count-->0) {
|
||||
param = va_arg(ptr, zval ***);
|
||||
*param = (zval **) p-(param_count--);
|
||||
*param = (zval **) p-(arg_count--);
|
||||
}
|
||||
va_end(ptr);
|
||||
|
||||
@@ -152,8 +151,8 @@ ZEND_API int zend_get_parameters_array_ex(int param_count, zval ***argument_arra
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
while (param_count>0) {
|
||||
*(argument_array++) = (zval **) p-(param_count--);
|
||||
while (param_count-->0) {
|
||||
*(argument_array++) = (zval **) p-(arg_count--);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
@@ -189,7 +188,7 @@ ZEND_API inline int _array_init(zval *arg ZEND_FILE_LINE_DC)
|
||||
ALLOC_HASHTABLE_REL(arg->value.ht);
|
||||
|
||||
if (!arg->value.ht || zend_hash_init(arg->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0)) {
|
||||
zend_error(E_CORE_ERROR, "Cannot allocate memory for array");
|
||||
zend_error(E_ERROR, "Cannot allocate memory for array");
|
||||
return FAILURE;
|
||||
}
|
||||
arg->type = IS_ARRAY;
|
||||
@@ -202,7 +201,7 @@ ZEND_API inline int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND
|
||||
zval *tmp;
|
||||
|
||||
if (!class_type->constants_updated) {
|
||||
zend_hash_apply(&class_type->default_properties, (int (*)(void *)) zval_update_constant);
|
||||
zend_hash_apply_with_argument(&class_type->default_properties, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
|
||||
class_type->constants_updated = 1;
|
||||
}
|
||||
|
||||
@@ -708,15 +707,22 @@ ZEND_API int zend_startup_module(zend_module_entry *module)
|
||||
|
||||
|
||||
/* registers all functions in *library_functions in the function hash */
|
||||
int zend_register_functions(zend_function_entry *functions, HashTable *function_table)
|
||||
int zend_register_functions(zend_function_entry *functions, HashTable *function_table, int type)
|
||||
{
|
||||
zend_function_entry *ptr = functions;
|
||||
zend_function function;
|
||||
zend_internal_function *internal_function = (zend_internal_function *)&function;
|
||||
int count=0,unload=0;
|
||||
HashTable *target_function_table = function_table;
|
||||
int error_type;
|
||||
CLS_FETCH();
|
||||
|
||||
if (type==MODULE_PERSISTENT) {
|
||||
error_type = E_CORE_WARNING;
|
||||
} else {
|
||||
error_type = E_WARNING;
|
||||
}
|
||||
|
||||
if (!target_function_table) {
|
||||
target_function_table = CG(function_table);
|
||||
}
|
||||
@@ -727,7 +733,7 @@ int zend_register_functions(zend_function_entry *functions, HashTable *function_
|
||||
internal_function->arg_types = ptr->func_arg_types;
|
||||
internal_function->function_name = ptr->fname;
|
||||
if (!internal_function->handler) {
|
||||
zend_error(E_CORE_WARNING,"Null function defined as active function");
|
||||
zend_error(error_type, "Null function defined as active function");
|
||||
zend_unregister_functions(functions, count, target_function_table);
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -741,7 +747,7 @@ int zend_register_functions(zend_function_entry *functions, HashTable *function_
|
||||
if (unload) { /* before unloading, display all remaining bad function in the module */
|
||||
while (ptr->fname) {
|
||||
if (zend_hash_exists(target_function_table, ptr->fname, strlen(ptr->fname)+1)) {
|
||||
zend_error(E_CORE_WARNING, "Function registration failed - duplicate name - %s",ptr->fname);
|
||||
zend_error(error_type, "Function registration failed - duplicate name - %s",ptr->fname);
|
||||
}
|
||||
ptr++;
|
||||
}
|
||||
@@ -783,7 +789,7 @@ ZEND_API int zend_register_module(zend_module_entry *module)
|
||||
#if 0
|
||||
zend_printf("%s: Registering module %d\n",module->name, module->module_number);
|
||||
#endif
|
||||
if (module->functions && zend_register_functions(module->functions, NULL)==FAILURE) {
|
||||
if (module->functions && zend_register_functions(module->functions, NULL, module->type)==FAILURE) {
|
||||
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load",module->name);
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -867,8 +873,31 @@ int zend_next_free_module(void)
|
||||
return ++module_count;
|
||||
}
|
||||
|
||||
/* If parent_ce is not NULL then it inherits from parent_ce
|
||||
* If parent_ce is NULL and parent_name isn't then it looks for the parent and inherits from it
|
||||
* If both parent_ce and parent_name are NULL it does a regular class registration
|
||||
* If parent_name is specified but not found NULL is returned
|
||||
*/
|
||||
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name)
|
||||
{
|
||||
zend_class_entry *register_class;
|
||||
CLS_FETCH();
|
||||
|
||||
ZEND_API zend_class_entry *register_internal_class(zend_class_entry *class_entry)
|
||||
if (!parent_ce && parent_name) {
|
||||
if (zend_hash_find(CG(class_table), parent_name, strlen(parent_name)+1, (void **) &parent_ce)==FAILURE) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
register_class = zend_register_internal_class(class_entry);
|
||||
|
||||
if (parent_ce) {
|
||||
do_inheritance(register_class, parent_ce);
|
||||
}
|
||||
return register_class;
|
||||
}
|
||||
|
||||
ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry)
|
||||
{
|
||||
zend_class_entry *register_class;
|
||||
char *lowercase_name = zend_strndup(class_entry->name, class_entry->name_length);
|
||||
@@ -886,7 +915,7 @@ ZEND_API zend_class_entry *register_internal_class(zend_class_entry *class_entry
|
||||
|
||||
|
||||
if (class_entry->builtin_functions) {
|
||||
zend_register_functions(class_entry->builtin_functions, &class_entry->function_table);
|
||||
zend_register_functions(class_entry->builtin_functions, &class_entry->function_table, MODULE_PERSISTENT);
|
||||
}
|
||||
|
||||
zend_hash_update(CG(class_table), lowercase_name, class_entry->name_length+1, class_entry, sizeof(zend_class_entry), (void **) ®ister_class);
|
||||
@@ -925,3 +954,31 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
va_end(symbol_table_list);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Disabled functions support */
|
||||
|
||||
static ZEND_FUNCTION(display_disabled_function)
|
||||
{
|
||||
zend_error(E_WARNING, "%s() has been disabled for security reasons.", get_active_function_name());
|
||||
}
|
||||
|
||||
|
||||
static zend_function_entry disabled_function[] = {
|
||||
ZEND_FE(display_disabled_function, NULL)
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length)
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
disabled_function[0].fname = function_name;
|
||||
return zend_register_functions(disabled_function, CG(function_table), MODULE_PERSISTENT);
|
||||
}
|
||||
+14
-9
@@ -18,14 +18,15 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_API_H
|
||||
#define _ZEND_API_H
|
||||
#ifndef ZEND_API_H
|
||||
#define ZEND_API_H
|
||||
|
||||
#include "modules.h"
|
||||
#include "zend_list.h"
|
||||
#include "zend_fast_cache.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_execute.h"
|
||||
|
||||
#define ZEND_FN(name) zend_if_##name
|
||||
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
|
||||
@@ -108,11 +109,15 @@ ZEND_API int zend_get_parameters_array_ex(int param_count, zval ***argument_arra
|
||||
|
||||
ZEND_API int ParameterPassedByReference(int ht, uint n);
|
||||
|
||||
int zend_register_functions(zend_function_entry *functions, HashTable *function_table);
|
||||
int zend_register_functions(zend_function_entry *functions, HashTable *function_table, int type);
|
||||
void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table);
|
||||
ZEND_API int zend_register_module(zend_module_entry *module_entry);
|
||||
ZEND_API zend_class_entry *register_internal_class(zend_class_entry *class_entry);
|
||||
|
||||
ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry);
|
||||
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name);
|
||||
|
||||
ZEND_API zend_module_entry *zend_get_module(int module_number);
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length);
|
||||
|
||||
ZEND_API void wrong_param_count(void);
|
||||
|
||||
@@ -173,7 +178,7 @@ ZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, i
|
||||
ZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate);
|
||||
|
||||
ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
|
||||
ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation);
|
||||
ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table);
|
||||
|
||||
ZEND_API int add_property_long(zval *arg, char *key, long l);
|
||||
ZEND_API int add_property_unset(zval *arg, char *key);
|
||||
@@ -222,7 +227,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define ZVAL_EMPTY_STRING(z) { \
|
||||
(z)->value.str.len = 0; \
|
||||
(z)->value.str.val = empty_string \
|
||||
(z)->value.str.val = empty_string; \
|
||||
(z)->type = IS_STRING; \
|
||||
}
|
||||
|
||||
@@ -263,7 +268,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define RETVAL_EMPTY_STRING() { \
|
||||
return_value->value.str.len = 0; \
|
||||
return_value->value.str.val = empty_string \
|
||||
return_value->value.str.val = empty_string; \
|
||||
return_value->type = IS_STRING; \
|
||||
}
|
||||
|
||||
@@ -314,7 +319,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define RETURN_EMPTY_STRING() { \
|
||||
return_value->value.str.len = 0; \
|
||||
return_value->value.str.val = empty_string \
|
||||
return_value->value.str.val = empty_string; \
|
||||
return_value->type = IS_STRING; \
|
||||
return; \
|
||||
}
|
||||
@@ -411,7 +416,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? (p)->value.obj.properties : NULL)))
|
||||
#define ZVAL_IS_NULL(z) ((z)->type==IS_NULL)
|
||||
|
||||
#endif /* _ZEND_API_H */
|
||||
#endif /* ZEND_API_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
+91
-43
@@ -50,24 +50,31 @@ ZEND_API zend_alloc_globals alloc_globals;
|
||||
|
||||
# if MEMORY_LIMIT
|
||||
# if ZEND_DEBUG
|
||||
#define CHECK_MEMORY_LIMIT(s) _CHECK_MEMORY_LIMIT(s, __zend_filename, __zend_lineno)
|
||||
#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, __zend_filename, __zend_lineno)
|
||||
# else
|
||||
#define CHECK_MEMORY_LIMIT(s) _CHECK_MEMORY_LIMIT(s,NULL,0)
|
||||
#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, NULL,0)
|
||||
# endif
|
||||
|
||||
#define _CHECK_MEMORY_LIMIT(s,file,lineno) { AG(allocated_memory) += (s);\
|
||||
#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\
|
||||
if (AG(memory_limit)<AG(allocated_memory)) {\
|
||||
if (!file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit),s); \
|
||||
} else { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", AG(memory_limit), file, lineno, s); \
|
||||
} \
|
||||
if ((AG(memory_limit)+1048576)<AG(allocated_memory)) { \
|
||||
/* failed to handle this gracefully, exit() */ \
|
||||
exit(1); \
|
||||
} \
|
||||
if (!AG(memory_exhausted)) { \
|
||||
if (!file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit),s); \
|
||||
} else { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", AG(memory_limit), file, lineno, s); \
|
||||
} \
|
||||
AG(memory_exhausted)=1; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
# endif
|
||||
|
||||
#ifndef CHECK_MEMORY_LIMIT
|
||||
#define CHECK_MEMORY_LIMIT(s)
|
||||
#define CHECK_MEMORY_LIMIT(s, rs)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -99,15 +106,30 @@ ZEND_API zend_alloc_globals alloc_globals;
|
||||
} \
|
||||
p->pLast = (zend_mem_header *) NULL;
|
||||
|
||||
#define DECLARE_CACHE_VARS \
|
||||
unsigned int real_size; \
|
||||
unsigned int cache_index;
|
||||
|
||||
#define REAL_SIZE(size) ((size+7) & ~0x7)
|
||||
|
||||
#define CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size) \
|
||||
real_size = REAL_SIZE(size); \
|
||||
cache_index = real_size >> 3;
|
||||
|
||||
#define SIZE real_size
|
||||
|
||||
#define CACHE_INDEX cache_index
|
||||
|
||||
ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
zend_mem_header *p;
|
||||
DECLARE_CACHE_VARS
|
||||
ALS_FETCH();
|
||||
|
||||
if (!ZEND_DISABLE_MEMORY_CACHE && (size < MAX_CACHED_MEMORY) && (AG(cache_count)[size] > 0)) {
|
||||
p = AG(cache)[size][--AG(cache_count)[size]];
|
||||
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
|
||||
|
||||
if (!ZEND_DISABLE_MEMORY_CACHE && (CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] > 0)) {
|
||||
p = AG(cache)[CACHE_INDEX][--AG(cache_count)[CACHE_INDEX]];
|
||||
#if ZEND_DEBUG
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
@@ -115,18 +137,22 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
p->orig_lineno = __zend_orig_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
p->reported = 0;
|
||||
AG(cache_stats)[size][1]++;
|
||||
AG(cache_stats)[CACHE_INDEX][1]++;
|
||||
#endif
|
||||
p->persistent = 0;
|
||||
p->cached = 0;
|
||||
p->size = size;
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *)((char *)p + sizeof(zend_mem_header) + PLATFORM_PADDING);
|
||||
} else {
|
||||
#if ZEND_DEBUG
|
||||
if (size<MAX_CACHED_MEMORY) {
|
||||
AG(cache_stats)[size][0]++;
|
||||
if (CACHE_INDEX<MAX_CACHED_MEMORY) {
|
||||
AG(cache_stats)[CACHE_INDEX][0]++;
|
||||
}
|
||||
#endif
|
||||
p = (zend_mem_header *) malloc(sizeof(zend_mem_header) + size + PLATFORM_PADDING + END_ALIGNMENT(size) + END_MAGIC_SIZE);
|
||||
p = (zend_mem_header *) malloc(sizeof(zend_mem_header) + SIZE + PLATFORM_PADDING + END_ALIGNMENT(SIZE) + END_MAGIC_SIZE);
|
||||
}
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
@@ -143,7 +169,7 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
}
|
||||
p->persistent = p->cached = 0;
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
p->size = size;
|
||||
p->size = size; /* Save real size for correct cache output */
|
||||
#if ZEND_DEBUG
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
@@ -151,10 +177,10 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
p->orig_lineno = __zend_orig_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
p->reported = 0;
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+size+PLATFORM_PADDING+END_ALIGNMENT(size))) = MEM_BLOCK_END_MAGIC;
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE))) = MEM_BLOCK_END_MAGIC;
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
CHECK_MEMORY_LIMIT(size);
|
||||
CHECK_MEMORY_LIMIT(size, SIZE);
|
||||
#endif
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *)((char *)p + sizeof(zend_mem_header) + PLATFORM_PADDING);
|
||||
@@ -164,29 +190,34 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - PLATFORM_PADDING);
|
||||
DECLARE_CACHE_VARS
|
||||
ALS_FETCH();
|
||||
|
||||
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
|
||||
#if ZEND_DEBUG
|
||||
if (!_mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
|
||||
return;
|
||||
}
|
||||
memset(ptr, 0x5a, p->size);
|
||||
memset(ptr, 0x5a, SIZE);
|
||||
#endif
|
||||
|
||||
if (!ZEND_DISABLE_MEMORY_CACHE
|
||||
&& !p->persistent && (p->size < MAX_CACHED_MEMORY) && (AG(cache_count)[p->size] < MAX_CACHED_ENTRIES)) {
|
||||
AG(cache)[p->size][AG(cache_count)[p->size]++] = p;
|
||||
&& !p->persistent && (CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] < MAX_CACHED_ENTRIES)) {
|
||||
AG(cache)[CACHE_INDEX][AG(cache_count)[CACHE_INDEX]++] = p;
|
||||
p->cached = 1;
|
||||
#if ZEND_DEBUG
|
||||
p->magic = MEM_BLOCK_CACHED_MAGIC;
|
||||
#endif
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return;
|
||||
}
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
|
||||
#if MEMORY_LIMIT
|
||||
AG(allocated_memory) -= p->size;
|
||||
AG(allocated_memory) -= SIZE;
|
||||
#endif
|
||||
|
||||
free(p);
|
||||
@@ -198,14 +229,14 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
|
||||
{
|
||||
void *p;
|
||||
int final_size=size*nmemb;
|
||||
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
if (!p) {
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *) p;
|
||||
}
|
||||
memset(p,(int)NULL,final_size);
|
||||
memset(p,(int)NULL, final_size);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return p;
|
||||
}
|
||||
@@ -215,14 +246,18 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
|
||||
{
|
||||
zend_mem_header *p = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-PLATFORM_PADDING);
|
||||
zend_mem_header *orig = p;
|
||||
DECLARE_CACHE_VARS
|
||||
ALS_FETCH();
|
||||
|
||||
if (!ptr) {
|
||||
return _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
p = (zend_mem_header *) realloc(p,sizeof(zend_mem_header)+size+PLATFORM_PADDING+END_ALIGNMENT(size)+END_MAGIC_SIZE);
|
||||
p = (zend_mem_header *) realloc(p,sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE)+END_MAGIC_SIZE);
|
||||
if (!p) {
|
||||
if (!allow_failure) {
|
||||
fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size);
|
||||
@@ -241,10 +276,10 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+size+PLATFORM_PADDING+END_ALIGNMENT(size))) = MEM_BLOCK_END_MAGIC;
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE))) = MEM_BLOCK_END_MAGIC;
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
CHECK_MEMORY_LIMIT(size - p->size);
|
||||
CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size));
|
||||
#endif
|
||||
p->size = size;
|
||||
|
||||
@@ -332,13 +367,8 @@ ZEND_API void start_memory_manager(ALS_D)
|
||||
AG(memory_exhausted)=0;
|
||||
#endif
|
||||
|
||||
#if ZEND_DEBUG
|
||||
memset(AG(cache_stats), 0, sizeof(AG(cache_stats)));
|
||||
memset(AG(fast_cache_stats), 0, sizeof(AG(fast_cache_stats)));
|
||||
#endif
|
||||
|
||||
memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head)));
|
||||
memset(AG(cache_count),0,MAX_CACHED_MEMORY*sizeof(unsigned char));
|
||||
memset(AG(cache_count),0,sizeof(AG(cache_count)));
|
||||
|
||||
#ifndef ZTS
|
||||
/* Initialize cache, to prevent fragmentation */
|
||||
@@ -346,30 +376,34 @@ ZEND_API void start_memory_manager(ALS_D)
|
||||
* will yield an endless recursion calling to alloc_globals_ctor()
|
||||
*/
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<MAX_CACHED_ENTRIES; j++) {
|
||||
cached_entries[i][j] = emalloc(i);
|
||||
for (j=0; j<PRE_INIT_CACHE_ENTRIES; j++) {
|
||||
cached_entries[i][j] = emalloc(8*i);
|
||||
}
|
||||
}
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<MAX_CACHED_ENTRIES; j++) {
|
||||
for (j=0; j<PRE_INIT_CACHE_ENTRIES; j++) {
|
||||
efree(cached_entries[i][j]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ZEND_DEBUG
|
||||
memset(AG(cache_stats), 0, sizeof(AG(cache_stats)));
|
||||
memset(AG(fast_cache_stats), 0, sizeof(AG(fast_cache_stats)));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
{
|
||||
zend_mem_header *p, *t;
|
||||
int fci;
|
||||
unsigned int fci, i, j;
|
||||
#if ZEND_DEBUG
|
||||
int had_leaks=0;
|
||||
#endif
|
||||
zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry;
|
||||
ALS_FETCH();
|
||||
|
||||
|
||||
for (fci=0; fci<MAX_FAST_CACHE_TYPES; fci++) {
|
||||
fast_cache_list_entry = AG(fast_cache_list_head)[fci];
|
||||
while (fast_cache_list_entry) {
|
||||
@@ -407,6 +441,9 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (long) (total_leak_count));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
AG(allocated_memory) -= t->size;
|
||||
#endif
|
||||
p = t->pNext;
|
||||
REMOVE_POINTER_FROM_LIST(t);
|
||||
@@ -417,6 +454,17 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
}
|
||||
}
|
||||
|
||||
if(clean_cache) {
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<AG(cache_count)[i]; j++) {
|
||||
free(AG(cache)[i][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#if MEMORY_LIMIT
|
||||
AG(memory_exhausted)=0;
|
||||
#endif
|
||||
|
||||
#if (ZEND_DEBUG)
|
||||
do {
|
||||
zval display_memory_cache_stats;
|
||||
@@ -472,7 +520,7 @@ void zend_debug_alloc_output(char *format, ...)
|
||||
#ifdef ZEND_WIN32
|
||||
OutputDebugString(output_buf);
|
||||
#else
|
||||
fprintf(stderr, output_buf);
|
||||
fprintf(stderr, "%s", output_buf);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -541,7 +589,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
|
||||
|
||||
|
||||
if (valid_beginning
|
||||
&& *((long *)(((char *) p)+sizeof(zend_mem_header)+p->size+PLATFORM_PADDING+END_ALIGNMENT(p->size))) != MEM_BLOCK_END_MAGIC) {
|
||||
&& *((long *)(((char *) p)+sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING+END_ALIGNMENT(REAL_SIZE(p->size)))) != MEM_BLOCK_END_MAGIC) {
|
||||
long magic_num = MEM_BLOCK_END_MAGIC;
|
||||
char *overflow_ptr, *magic_ptr=(char *) &magic_num;
|
||||
int overflows=0;
|
||||
@@ -551,7 +599,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
|
||||
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
had_problems=1;
|
||||
overflow_ptr = ((char *) p)+sizeof(zend_mem_header)+p->size+PLATFORM_PADDING;
|
||||
overflow_ptr = ((char *) p)+sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING;
|
||||
|
||||
for (i=0; i<sizeof(long); i++) {
|
||||
if (overflow_ptr[i]!=magic_ptr[i]) {
|
||||
@@ -561,7 +609,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
|
||||
|
||||
zend_debug_alloc_output("%10s\t", "End:");
|
||||
zend_debug_alloc_output("Overflown (magic=0x%0.8lX instead of 0x%0.8lX)\n",
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+p->size+PLATFORM_PADDING+END_ALIGNMENT(p->size))), MEM_BLOCK_END_MAGIC);
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING+END_ALIGNMENT(REAL_SIZE(p->size)))), MEM_BLOCK_END_MAGIC);
|
||||
zend_debug_alloc_output("%10s\t","");
|
||||
if (overflows>=sizeof(long)) {
|
||||
zend_debug_alloc_output("At least %d bytes overflown\n", sizeof(long));
|
||||
@@ -633,7 +681,7 @@ ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
/* add the block to the persistent list */
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return p->size+sizeof(zend_mem_header)+PLATFORM_PADDING;
|
||||
return REAL_SIZE(p->size)+sizeof(zend_mem_header)+PLATFORM_PADDING;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+7
-5
@@ -18,15 +18,15 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ALLOC_H
|
||||
#define _ALLOC_H
|
||||
#ifndef ZEND_ALLOC_H
|
||||
#define ZEND_ALLOC_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "zend_globals_macros.h"
|
||||
|
||||
#define MEM_BLOCK_START_MAGIC 0x7312F8DCL
|
||||
#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
|
||||
#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
|
||||
#define MEM_BLOCK_FREED_MAGIC 0x99954317L
|
||||
#define MEM_BLOCK_CACHED_MAGIC 0xFB8277DCL
|
||||
|
||||
@@ -52,8 +52,10 @@ typedef union _align_test {
|
||||
long lng;
|
||||
} align_test;
|
||||
|
||||
#define MAX_CACHED_MEMORY 64
|
||||
#define MAX_CACHED_ENTRIES 16
|
||||
#define MAX_CACHED_MEMORY 11
|
||||
#define MAX_CACHED_ENTRIES 256
|
||||
#define PRE_INIT_CACHE_ENTRIES 32
|
||||
|
||||
#if (defined (__GNUC__) && __GNUC__ >= 2)
|
||||
#define PLATFORM_ALIGNMENT (__alignof__ (align_test))
|
||||
#else
|
||||
|
||||
+211
-57
@@ -33,6 +33,7 @@ static ZEND_FUNCTION(strlen);
|
||||
static ZEND_FUNCTION(strcmp);
|
||||
static ZEND_FUNCTION(strncmp);
|
||||
static ZEND_FUNCTION(strcasecmp);
|
||||
static ZEND_FUNCTION(strncasecmp);
|
||||
static ZEND_FUNCTION(each);
|
||||
static ZEND_FUNCTION(error_reporting);
|
||||
static ZEND_FUNCTION(define);
|
||||
@@ -46,15 +47,20 @@ static ZEND_FUNCTION(leak);
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
static ZEND_FUNCTION(crash);
|
||||
#endif
|
||||
static ZEND_FUNCTION(get_required_files);
|
||||
static ZEND_FUNCTION(get_included_files);
|
||||
static ZEND_FUNCTION(is_subclass_of);
|
||||
static ZEND_FUNCTION(get_class_vars);
|
||||
static ZEND_FUNCTION(get_object_vars);
|
||||
static ZEND_FUNCTION(get_class_methods);
|
||||
static ZEND_FUNCTION(user_error);
|
||||
static ZEND_FUNCTION(set_user_error_handler);
|
||||
static ZEND_FUNCTION(trigger_error);
|
||||
static ZEND_FUNCTION(set_error_handler);
|
||||
static ZEND_FUNCTION(restore_error_handler);
|
||||
static ZEND_FUNCTION(get_declared_classes);
|
||||
static ZEND_FUNCTION(create_function);
|
||||
static ZEND_FUNCTION(get_resource_type);
|
||||
#if ZEND_DEBUG
|
||||
static ZEND_FUNCTION(zend_test_func);
|
||||
#endif
|
||||
|
||||
unsigned char first_arg_force_ref[] = { 1, BYREF_FORCE };
|
||||
unsigned char first_arg_allow_ref[] = { 1, BYREF_ALLOW };
|
||||
@@ -70,6 +76,7 @@ static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(strcmp, NULL)
|
||||
ZEND_FE(strncmp, NULL)
|
||||
ZEND_FE(strcasecmp, NULL)
|
||||
ZEND_FE(strncasecmp, NULL)
|
||||
ZEND_FE(each, first_arg_force_ref)
|
||||
ZEND_FE(error_reporting, NULL)
|
||||
ZEND_FE(define, NULL)
|
||||
@@ -83,22 +90,29 @@ static zend_function_entry builtin_functions[] = {
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
ZEND_FE(crash, NULL)
|
||||
#endif
|
||||
ZEND_FE(get_required_files, NULL)
|
||||
ZEND_FE(get_included_files, NULL)
|
||||
ZEND_FALIAS(get_required_files, get_included_files, NULL)
|
||||
ZEND_FE(is_subclass_of, NULL)
|
||||
ZEND_FE(get_class_vars, NULL)
|
||||
ZEND_FE(get_object_vars, NULL)
|
||||
ZEND_FE(get_class_methods, NULL)
|
||||
ZEND_FE(user_error, NULL)
|
||||
ZEND_FE(set_user_error_handler, NULL)
|
||||
ZEND_FE(trigger_error, NULL)
|
||||
ZEND_FALIAS(user_error, trigger_error, NULL)
|
||||
ZEND_FE(set_error_handler, NULL)
|
||||
ZEND_FE(restore_error_handler, NULL)
|
||||
ZEND_FE(get_declared_classes, NULL)
|
||||
ZEND_FE(create_function, NULL)
|
||||
ZEND_FE(get_resource_type, NULL)
|
||||
#if ZEND_DEBUG
|
||||
ZEND_FE(zend_test_func, NULL)
|
||||
#endif
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
int zend_startup_builtin_functions()
|
||||
{
|
||||
return zend_register_functions(builtin_functions, NULL);
|
||||
return zend_register_functions(builtin_functions, NULL, MODULE_PERSISTENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +222,7 @@ ZEND_FUNCTION(strlen)
|
||||
zval **str;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(str);
|
||||
RETVAL_LONG((*str)->value.str.len);
|
||||
@@ -222,7 +236,7 @@ ZEND_FUNCTION(strcmp)
|
||||
zval **s1, **s2;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
@@ -237,7 +251,7 @@ ZEND_FUNCTION(strncmp)
|
||||
zval **s1, **s2, **s3;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &s1, &s2, &s3) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
@@ -253,7 +267,7 @@ ZEND_FUNCTION(strcasecmp)
|
||||
zval **s1, **s2;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
@@ -261,6 +275,22 @@ ZEND_FUNCTION(strcasecmp)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int strncasecmp(string str1, string str2, int len)
|
||||
Binary safe string comparison */
|
||||
ZEND_FUNCTION(strncasecmp)
|
||||
{
|
||||
zval **s1, **s2, **s3;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &s1, &s2, &s3) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
convert_to_long_ex(s3);
|
||||
RETURN_LONG(zend_binary_zval_strncasecmp(*s1,*s2,*s3));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_FUNCTION(each)
|
||||
{
|
||||
zval **array,*entry,**entry_ptr, *tmp;
|
||||
@@ -270,7 +300,7 @@ ZEND_FUNCTION(each)
|
||||
HashTable *target_hash;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
target_hash = HASH_OF(*array);
|
||||
if (!target_hash) {
|
||||
@@ -328,10 +358,10 @@ ZEND_FUNCTION(error_reporting)
|
||||
EG(error_reporting)=(*arg)->value.lval;
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
RETVAL_LONG(old_error_reporting);
|
||||
}
|
||||
|
||||
@@ -360,9 +390,10 @@ ZEND_FUNCTION(define)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
break;
|
||||
}
|
||||
|
||||
switch((*val)->type) {
|
||||
case IS_LONG:
|
||||
case IS_DOUBLE:
|
||||
@@ -383,8 +414,11 @@ ZEND_FUNCTION(define)
|
||||
c.flags = case_sensitive; /* non persistent */
|
||||
c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len);
|
||||
c.name_len = (*var)->value.str.len+1;
|
||||
zend_register_constant(&c ELS_CC);
|
||||
RETURN_TRUE;
|
||||
if(zend_register_constant(&c ELS_CC) == SUCCESS) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -394,7 +428,7 @@ ZEND_FUNCTION(defined)
|
||||
zval c;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &var)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
convert_to_string_ex(var);
|
||||
@@ -413,7 +447,7 @@ ZEND_FUNCTION(get_class)
|
||||
zval **arg;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
if ((*arg)->type != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
@@ -429,7 +463,7 @@ ZEND_FUNCTION(get_parent_class)
|
||||
zval **arg;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
if (((*arg)->type != IS_OBJECT) || !(*arg)->value.obj.ce->parent) {
|
||||
RETURN_FALSE;
|
||||
@@ -447,7 +481,7 @@ ZEND_FUNCTION(is_subclass_of)
|
||||
zend_class_entry *parent_ce = NULL;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &obj, &class_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if ((*obj)->type != IS_OBJECT) {
|
||||
@@ -480,7 +514,7 @@ ZEND_FUNCTION(get_class_vars)
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
convert_to_string_ex(class_name);
|
||||
@@ -506,7 +540,7 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zval *tmp;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &obj) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if ((*obj)->type != IS_OBJECT) {
|
||||
@@ -533,7 +567,7 @@ ZEND_FUNCTION(get_class_methods)
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
convert_to_string_ex(class_name);
|
||||
@@ -550,7 +584,7 @@ ZEND_FUNCTION(get_class_methods)
|
||||
while ((key_type = zend_hash_get_current_key(&ce->function_table, &string_key, &num_key)) != HASH_KEY_NON_EXISTANT) {
|
||||
if (key_type == HASH_KEY_IS_STRING) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRING(method_name, string_key, 0);
|
||||
ZVAL_STRING(method_name, string_key, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
}
|
||||
zend_hash_move_forward(&ce->function_table);
|
||||
@@ -567,7 +601,7 @@ ZEND_FUNCTION(method_exists)
|
||||
char *lcname;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &klass, &method_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
if ((*klass)->type != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
@@ -594,7 +628,7 @@ ZEND_FUNCTION(class_exists)
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(class_name);
|
||||
lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len);
|
||||
@@ -618,7 +652,7 @@ ZEND_FUNCTION(function_exists)
|
||||
int retval;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &function_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(function_name);
|
||||
lcname = estrndup((*function_name)->value.str.val, (*function_name)->value.str.len);
|
||||
@@ -678,39 +712,30 @@ static int copy_import_use_file(zend_file_handle *fh, zval *array)
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto array get_required_files(void)
|
||||
Returns an array with the file names that were require_once()'d */
|
||||
ZEND_FUNCTION(get_required_files)
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_apply_with_argument(&CG(used_files), (apply_func_arg_t) copy_import_use_file, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto array get_included_files(void)
|
||||
Returns an array with the file names that were include_once()'d */
|
||||
ZEND_FUNCTION(get_included_files)
|
||||
{
|
||||
char *entry;
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_apply_with_argument(&EG(included_files), (apply_func_arg_t) copy_import_use_file, return_value);
|
||||
zend_hash_internal_pointer_reset(&EG(included_files));
|
||||
while(zend_hash_get_current_key(&EG(included_files), &entry,NULL) == HASH_KEY_IS_STRING) {
|
||||
add_next_index_string(return_value,entry,0);
|
||||
zend_hash_move_forward(&EG(included_files));
|
||||
}
|
||||
|
||||
/* zend_hash_apply_with_argument(&EG(included_files), (apply_func_arg_t) copy_import_use_file, return_value); */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto void user_error(string messsage [, int error_type])
|
||||
/* {{{ proto void trigger_error(string messsage [, int error_type])
|
||||
Generates a user-level error/warning/notice message */
|
||||
ZEND_FUNCTION(user_error)
|
||||
ZEND_FUNCTION(trigger_error)
|
||||
{
|
||||
int error_type = E_USER_NOTICE;
|
||||
zval **z_error_type, **z_error_message;
|
||||
@@ -738,17 +763,22 @@ ZEND_FUNCTION(user_error)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(z_error_message);
|
||||
zend_error(error_type, (*z_error_message)->value.str.val);
|
||||
zend_error(error_type, "%s", (*z_error_message)->value.str.val);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_FUNCTION(set_user_error_handler)
|
||||
/* {{{ proto string set_error_handler(string error_handler)
|
||||
Sets a user-defined error handler function. Returns the previously defined error handler, or false on error */
|
||||
ZEND_FUNCTION(set_error_handler)
|
||||
{
|
||||
zval **error_handler;
|
||||
zend_bool had_orig_error_handler=0;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &error_handler)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
@@ -756,20 +786,53 @@ ZEND_FUNCTION(set_user_error_handler)
|
||||
|
||||
convert_to_string_ex(error_handler);
|
||||
if (EG(user_error_handler)) {
|
||||
zval_dtor(EG(user_error_handler));
|
||||
} else {
|
||||
ALLOC_ZVAL(EG(user_error_handler));
|
||||
had_orig_error_handler = 1;
|
||||
*return_value = *EG(user_error_handler);
|
||||
zval_copy_ctor(return_value);
|
||||
zend_ptr_stack_push(&EG(user_error_handlers), EG(user_error_handler));
|
||||
}
|
||||
ALLOC_ZVAL(EG(user_error_handler));
|
||||
|
||||
if (Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */
|
||||
FREE_ZVAL(EG(user_error_handler));
|
||||
EG(user_error_handler) = NULL;
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
*EG(user_error_handler) = **error_handler;
|
||||
zval_copy_ctor(EG(user_error_handler));
|
||||
|
||||
if (!had_orig_error_handler) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
|
||||
/* {{{ proto void restore_error_handler(void)
|
||||
Restores the previously defined error handler function */
|
||||
ZEND_FUNCTION(restore_error_handler)
|
||||
{
|
||||
if (EG(user_error_handler)) {
|
||||
zval_ptr_dtor(&EG(user_error_handler));
|
||||
}
|
||||
if (zend_ptr_stack_num_elements(&EG(user_error_handlers))==0) {
|
||||
EG(user_error_handler) = NULL;
|
||||
} else {
|
||||
EG(user_error_handler) = zend_ptr_stack_pop(&EG(user_error_handlers));
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
static int copy_class_name(zend_class_entry *ce, zval *array)
|
||||
|
||||
static int copy_class_name(zend_class_entry *ce, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
{
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
zval *array = va_arg(args, zval *);
|
||||
|
||||
if (hash_key->nKeyLength==0 || hash_key->arKey[0]!=0) {
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -780,10 +843,101 @@ ZEND_FUNCTION(get_declared_classes)
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
WRONG_PARAM_COUNT;
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_apply_with_argument(CG(class_table), (apply_func_arg_t)copy_class_name, return_value);
|
||||
zend_hash_apply_with_arguments(CG(class_table), (apply_func_args_t)copy_class_name, 1, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
#define LAMBDA_TEMP_FUNCNAME "__lambda_func"
|
||||
|
||||
/* {{{ proto string create_function(string args, string code)
|
||||
Creates an anonymous function, and returns its name (funny, eh?) */
|
||||
ZEND_FUNCTION(create_function)
|
||||
{
|
||||
char *eval_code, *function_name;
|
||||
int eval_code_length, function_name_length;
|
||||
zval **z_function_args, **z_function_code;
|
||||
int retval;
|
||||
char *eval_name;
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &z_function_args, &z_function_code)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
convert_to_string_ex(z_function_args);
|
||||
convert_to_string_ex(z_function_code);
|
||||
|
||||
eval_code_length = sizeof("function " LAMBDA_TEMP_FUNCNAME)
|
||||
+Z_STRLEN_PP(z_function_args)
|
||||
+2 /* for the args parentheses */
|
||||
+2 /* for the curly braces */
|
||||
+Z_STRLEN_PP(z_function_code);
|
||||
|
||||
eval_code = (char *) emalloc(eval_code_length);
|
||||
sprintf(eval_code, "function " LAMBDA_TEMP_FUNCNAME "(%s){%s}", Z_STRVAL_PP(z_function_args), Z_STRVAL_PP(z_function_code));
|
||||
|
||||
eval_name = zend_make_compiled_string_description("runtime-created function");
|
||||
retval = zend_eval_string(eval_code, NULL, eval_name CLS_CC ELS_CC);
|
||||
efree(eval_code);
|
||||
efree(eval_name);
|
||||
|
||||
if (retval==SUCCESS) {
|
||||
zend_function *func;
|
||||
|
||||
if (zend_hash_find(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME), (void **) &func)==FAILURE) {
|
||||
zend_error(E_ERROR, "Unexpected inconsistency in create_function()");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
function_add_ref(func);
|
||||
|
||||
function_name = (char *) emalloc(sizeof("0lambda_")+MAX_LENGTH_OF_LONG);
|
||||
|
||||
do {
|
||||
sprintf(function_name, "%clambda_%d", 0, ++EG(lambda_count));
|
||||
function_name_length = strlen(function_name+1)+1;
|
||||
} while (zend_hash_add(EG(function_table), function_name, function_name_length+1, func, sizeof(zend_function), NULL)==FAILURE);
|
||||
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
|
||||
RETURN_STRINGL(function_name, function_name_length, 0);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_FUNCTION(zend_test_func)
|
||||
{
|
||||
zval *arg1, *arg2;
|
||||
|
||||
zend_get_parameters(ht, 2, &arg1, &arg2);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
ZEND_FUNCTION(get_resource_type)
|
||||
{
|
||||
char *resource_type;
|
||||
zval **z_resource_type;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &z_resource_type)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(z_resource_type) != IS_RESOURCE) {
|
||||
zend_error(E_WARNING, "Supplied argument is not a valid resource handle");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
resource_type = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(z_resource_type));
|
||||
if (resource_type) {
|
||||
RETURN_STRING(resource_type, 1);
|
||||
} else {
|
||||
RETURN_STRING("Unknown", 1);
|
||||
}
|
||||
}
|
||||
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_BUILTIN_FUNCTIONS_H
|
||||
#define _ZEND_BUILTIN_FUNCTIONS_H
|
||||
#ifndef ZEND_BUILTIN_FUNCTIONS_H
|
||||
#define ZEND_BUILTIN_FUNCTIONS_H
|
||||
|
||||
int zend_startup_builtin_functions(void);
|
||||
|
||||
#endif /* _ZEND_BUILTIN_FUNCTIONS_H */
|
||||
#endif /* ZEND_BUILTIN_FUNCTIONS_H */
|
||||
+139
-100
@@ -26,7 +26,7 @@
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
|
||||
ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
|
||||
ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type CLS_DC);
|
||||
|
||||
|
||||
#ifndef ZTS
|
||||
@@ -37,33 +37,21 @@ ZEND_API zend_executor_globals executor_globals;
|
||||
|
||||
#define SET_UNUSED(op) (op).op_type = IS_UNUSED
|
||||
|
||||
static int is_not_internal_function(zend_function *function)
|
||||
{
|
||||
return(function->type != ZEND_INTERNAL_FUNCTION);
|
||||
}
|
||||
|
||||
|
||||
static int is_not_internal_class(zend_class_entry *ce)
|
||||
{
|
||||
return(ce->type != ZEND_INTERNAL_CLASS);
|
||||
}
|
||||
|
||||
|
||||
static void free_filename(void *p)
|
||||
{
|
||||
efree(*((char **) p));
|
||||
}
|
||||
|
||||
|
||||
static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline)
|
||||
static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline CLS_DC)
|
||||
{
|
||||
char lineno_buf[32];
|
||||
uint lineno_len;
|
||||
char *filename;
|
||||
|
||||
lineno_len = zend_sprintf(lineno_buf, "%d", opline->lineno);
|
||||
if (opline->filename) {
|
||||
filename = opline->filename;
|
||||
if (CG(active_op_array)->filename) {
|
||||
filename = CG(active_op_array)->filename;
|
||||
} else {
|
||||
filename = "-";
|
||||
}
|
||||
@@ -77,12 +65,6 @@ static void build_runtime_defined_function_key(zval *result, zval *name, zend_op
|
||||
}
|
||||
|
||||
|
||||
static void zend_open_file_dtor_wrapper(zend_file_handle *fh)
|
||||
{
|
||||
zend_open_file_dtor(fh);
|
||||
}
|
||||
|
||||
|
||||
static void init_compiler_declarables(CLS_D ELS_DC)
|
||||
{
|
||||
CG(declarables).ticks.type = IS_LONG;
|
||||
@@ -101,16 +83,12 @@ void init_compiler(CLS_D ELS_DC)
|
||||
CG(active_class_entry) = NULL;
|
||||
zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0);
|
||||
zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0);
|
||||
zend_llist_init(&CG(filenames_list), sizeof(char *), free_filename, 0);
|
||||
CG(short_tags) = ZEND_UV(short_tags);
|
||||
CG(asp_tags) = ZEND_UV(asp_tags);
|
||||
CG(allow_call_time_pass_reference) = ZEND_UV(allow_call_time_pass_reference);
|
||||
zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_filename, 0);
|
||||
CG(handle_op_arrays) = 1;
|
||||
CG(in_compilation) = 0;
|
||||
zend_init_rsrc_list(ELS_C);
|
||||
CG(unclean_shutdown) = 0;
|
||||
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_open_file_dtor, 0);
|
||||
zend_hash_init(&CG(used_files), 5, NULL, (void (*)(void *)) zend_open_file_dtor_wrapper, 0);
|
||||
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_file_handle_dtor, 0);
|
||||
init_compiler_declarables(CLS_C ELS_CC);
|
||||
}
|
||||
|
||||
@@ -123,20 +101,23 @@ void shutdown_compiler(CLS_D)
|
||||
zend_stack_destroy(&CG(foreach_copy_stack));
|
||||
zend_stack_destroy(&CG(object_stack));
|
||||
zend_stack_destroy(&CG(declare_stack));
|
||||
zend_llist_destroy(&CG(filenames_list));
|
||||
zend_hash_apply(CG(function_table), (int (*)(void *)) is_not_internal_function);
|
||||
zend_hash_apply(CG(class_table), (int (*)(void *)) is_not_internal_class);
|
||||
zend_hash_destroy(&CG(filenames_table));
|
||||
zend_llist_destroy(&CG(open_files));
|
||||
zend_hash_destroy(&CG(used_files));
|
||||
}
|
||||
|
||||
|
||||
ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename)
|
||||
{
|
||||
char *p = estrdup(new_compiled_filename);
|
||||
char **pp, *p;
|
||||
int length = strlen(new_compiled_filename);
|
||||
CLS_FETCH();
|
||||
|
||||
zend_llist_add_element(&CG(filenames_list), &p);
|
||||
if (zend_hash_find(&CG(filenames_table), new_compiled_filename, length+1, (void **) &pp)==SUCCESS) {
|
||||
CG(compiled_filename) = *pp;
|
||||
return *pp;
|
||||
}
|
||||
p = estrndup(new_compiled_filename, length);
|
||||
zend_hash_update(&CG(filenames_table), new_compiled_filename, length+1, &p, sizeof(char *), (void **) &pp);
|
||||
CG(compiled_filename) = p;
|
||||
return p;
|
||||
}
|
||||
@@ -345,7 +326,8 @@ void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC)
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
*result = opline->result;
|
||||
} else {
|
||||
SET_UNUSED(opline->result);
|
||||
/* SET_UNUSED(opline->result); */
|
||||
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
opline->op1 = *lvar;
|
||||
opline->op2 = *rvar;
|
||||
@@ -533,8 +515,6 @@ void do_begin_variable_parse(CLS_D)
|
||||
{
|
||||
zend_llist fetch_list;
|
||||
|
||||
/* zend_llist_init(&fetch_list, sizeof(int), NULL, 0);
|
||||
zend_stack_push(&CG(bp_stack), (void *) &fetch_list, sizeof(zend_llist));*/
|
||||
zend_llist_init(&fetch_list, sizeof(zend_op), NULL, 0);
|
||||
zend_stack_push(&CG(bp_stack), (void *) &fetch_list, sizeof(zend_llist));
|
||||
}
|
||||
@@ -584,6 +564,27 @@ void do_end_variable_parse(int type, int arg_offset CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
static zend_bool is_method_call(CLS_D)
|
||||
{
|
||||
zend_llist *fetch_list_ptr;
|
||||
zend_llist_element *cur;
|
||||
zend_op *cur_opline;
|
||||
|
||||
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
|
||||
|
||||
cur = fetch_list_ptr->head;
|
||||
/* There is always at least one node in the list */
|
||||
while (cur->next) {
|
||||
cur = cur->next;
|
||||
}
|
||||
cur_opline = (zend_op *)cur->data;
|
||||
if (cur_opline->opcode == ZEND_FETCH_OBJ_W) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void do_init_string(znode *result CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -715,7 +716,7 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
function_token->u.op_array = CG(active_op_array);
|
||||
zend_str_tolower(name, name_len);
|
||||
|
||||
init_op_array(&op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
|
||||
init_op_array(&op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE CLS_CC);
|
||||
|
||||
op_array.function_name = name;
|
||||
op_array.arg_types = NULL;
|
||||
@@ -728,7 +729,7 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
|
||||
opline->opcode = ZEND_DECLARE_FUNCTION_OR_CLASS;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &function_name->u.constant, opline);
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &function_name->u.constant, opline CLS_CC);
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.value.str.val = estrndup(name, name_len);
|
||||
@@ -764,6 +765,7 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
|
||||
void do_end_function_declaration(znode *function_token CLS_DC)
|
||||
{
|
||||
do_extended_info(CLS_C);
|
||||
do_return(NULL, 0 CLS_CC);
|
||||
pass_two(CG(active_op_array));
|
||||
CG(active_op_array) = function_token->u.op_array;
|
||||
@@ -832,6 +834,7 @@ int do_begin_function_call(znode *function_name CLS_DC)
|
||||
}
|
||||
break;
|
||||
}
|
||||
do_extended_fcall_begin(CLS_C);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -839,20 +842,30 @@ int do_begin_function_call(znode *function_name CLS_DC)
|
||||
void do_begin_dynamic_function_call(znode *function_name CLS_DC)
|
||||
{
|
||||
unsigned char *ptr = NULL;
|
||||
int last_op_number = get_next_op_number(CG(active_op_array))-1;
|
||||
int last_op_number;
|
||||
zend_op *last_op;
|
||||
|
||||
if (last_op_number>=0 && CG(active_op_array)->opcodes[last_op_number].opcode == ZEND_FETCH_OBJ_R) {
|
||||
CG(active_op_array)->opcodes[last_op_number].opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
CG(active_op_array)->opcodes[last_op_number].extended_value = ZEND_MEMBER_FUNC_CALL;
|
||||
if (function_name->op_type != IS_CONST && is_method_call(CLS_C)) {
|
||||
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
last_op_number = get_next_op_number(CG(active_op_array))-1;
|
||||
last_op = &CG(active_op_array)->opcodes[last_op_number];
|
||||
last_op->opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
last_op->extended_value = ZEND_MEMBER_FUNC_CALL;
|
||||
} else {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
zend_op *opline;
|
||||
|
||||
if (function_name->op_type != IS_CONST) {
|
||||
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
opline->op2 = *function_name;
|
||||
opline->extended_value = 0;
|
||||
SET_UNUSED(opline->op1);
|
||||
}
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
|
||||
do_extended_fcall_begin(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
@@ -863,6 +876,15 @@ void do_begin_class_member_function_call(znode *class_name, znode *function_name
|
||||
|
||||
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
zend_str_tolower(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len);
|
||||
if ((class_name->u.constant.value.str.len == sizeof("parent")-1)
|
||||
&& !memcmp(class_name->u.constant.value.str.val, "parent", sizeof("parent")-1)) {
|
||||
if (!CG(active_class_entry) || !CG(active_class_entry)->parent) {
|
||||
zend_error(E_COMPILE_ERROR, "No parent class available in this context");
|
||||
}
|
||||
efree(class_name->u.constant.value.str.val);
|
||||
class_name->u.constant.value.str.len = CG(active_class_entry)->parent->name_length;
|
||||
class_name->u.constant.value.str.val = estrndup(CG(active_class_entry)->parent->name, class_name->u.constant.value.str.len);
|
||||
}
|
||||
opline->op1 = *class_name;
|
||||
opline->op2 = *function_name;
|
||||
opline->extended_value = ZEND_MEMBER_FUNC_CALL;
|
||||
@@ -1040,7 +1062,7 @@ void do_return(znode *expr, int do_end_vparse CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
static void function_add_ref(zend_function *function)
|
||||
ZEND_API void function_add_ref(zend_function *function)
|
||||
{
|
||||
if (function->type == ZEND_USER_FUNCTION) {
|
||||
zend_op_array *op_array = &function->op_array;
|
||||
@@ -1072,6 +1094,18 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
|
||||
}
|
||||
}
|
||||
|
||||
void do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce)
|
||||
{
|
||||
zend_function tmp_zend_function;
|
||||
zval *tmp;
|
||||
|
||||
/* Perform inheritance */
|
||||
zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0);
|
||||
zend_hash_merge(&ce->function_table, &parent_ce->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function), 0);
|
||||
ce->parent = parent_ce;
|
||||
do_inherit_parent_constructor(ce);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time)
|
||||
{
|
||||
@@ -1095,7 +1129,10 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
case ZEND_DECLARE_CLASS: {
|
||||
zend_class_entry *ce;
|
||||
|
||||
zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce);
|
||||
if (zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce)==FAILURE) {
|
||||
zend_error(E_ERROR, "Internal Zend error - Missing class information for %s", opline->op1.u.constant.value.str.val);
|
||||
return FAILURE;
|
||||
}
|
||||
(*ce->refcount)++;
|
||||
if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, ce, sizeof(zend_class_entry), NULL)==FAILURE) {
|
||||
(*ce->refcount)--;
|
||||
@@ -1110,37 +1147,41 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
break;
|
||||
case ZEND_DECLARE_INHERITED_CLASS: {
|
||||
zend_class_entry *ce, *parent_ce;
|
||||
int parent_name_length;
|
||||
char *class_name, *parent_name;
|
||||
zend_function tmp_zend_function;
|
||||
zval *tmp;
|
||||
int found_ce;
|
||||
|
||||
zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce);
|
||||
(*ce->refcount)++;
|
||||
|
||||
found_ce = zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce);
|
||||
|
||||
/* Restore base class / derived class names */
|
||||
parent_name = opline->op2.u.constant.value.str.val;
|
||||
class_name = strchr(opline->op2.u.constant.value.str.val, ':');
|
||||
if (!class_name) {
|
||||
zend_error(E_CORE_ERROR, "Invalid runtime class entry");
|
||||
}
|
||||
*class_name++ = 0;
|
||||
class_name++;
|
||||
|
||||
if (found_ce==FAILURE) {
|
||||
zend_error(E_ERROR, "Cannot redeclare class %s", class_name);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
(*ce->refcount)++;
|
||||
|
||||
/* Obtain parent class */
|
||||
if (zend_hash_find(class_table, parent_name, strlen(parent_name)+1, (void **) &parent_ce)==FAILURE) {
|
||||
parent_name_length = class_name - opline->op2.u.constant.value.str.val - 1;
|
||||
parent_name = estrndup(opline->op2.u.constant.value.str.val, parent_name_length);
|
||||
if (zend_hash_find(class_table, parent_name, parent_name_length+1, (void **) &parent_ce)==FAILURE) {
|
||||
if (!compile_time) {
|
||||
zend_error(E_ERROR, "Class %s: Cannot inherit from undefined class %s", class_name, parent_name);
|
||||
}
|
||||
(*ce->refcount)--;
|
||||
*(class_name-1) = ':';
|
||||
efree(parent_name);
|
||||
return FAILURE;
|
||||
}
|
||||
efree(parent_name);
|
||||
|
||||
/* Perform inheritance */
|
||||
zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0);
|
||||
zend_hash_merge(&ce->function_table, &parent_ce->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function), 0);
|
||||
ce->parent = parent_ce;
|
||||
do_inherit_parent_constructor(ce);
|
||||
|
||||
do_inheritance(ce, parent_ce);
|
||||
|
||||
/* Register the derived class */
|
||||
if (zend_hash_add(class_table, class_name, strlen(class_name)+1, ce, sizeof(zend_class_entry), NULL)==FAILURE) {
|
||||
@@ -1150,10 +1191,8 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
(*ce->refcount)--;
|
||||
zend_hash_destroy(&ce->function_table);
|
||||
zend_hash_destroy(&ce->default_properties);
|
||||
*(class_name-1) = ':';
|
||||
return FAILURE;
|
||||
}
|
||||
*(class_name-1) = ':';
|
||||
return SUCCESS;
|
||||
}
|
||||
break;
|
||||
@@ -1305,10 +1344,22 @@ void do_brk_cont(int op, znode *expr CLS_DC)
|
||||
void do_switch_cond(znode *cond CLS_DC)
|
||||
{
|
||||
zend_switch_entry switch_entry;
|
||||
zend_op *opline;
|
||||
|
||||
/* Initialize the conditional value */
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_BOOL;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
opline->op1.u.constant.type = IS_BOOL;
|
||||
opline->op1.u.constant.value.lval = 0;
|
||||
INIT_PZVAL(&opline->op1.u.constant);
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
switch_entry.cond = *cond;
|
||||
switch_entry.default_case = -1;
|
||||
switch_entry.control_var = -1;
|
||||
switch_entry.control_var = opline->result.u.var;
|
||||
zend_stack_push(&CG(switch_cond_stack), (void *) &switch_entry, sizeof(switch_entry));
|
||||
|
||||
do_begin_loop(CLS_C);
|
||||
@@ -1373,9 +1424,6 @@ void do_case_before_statement(znode *case_list, znode *case_token, znode *case_e
|
||||
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
|
||||
|
||||
opline->opcode = ZEND_CASE;
|
||||
if (switch_entry_ptr->control_var==-1) {
|
||||
switch_entry_ptr->control_var = get_temporary_variable(CG(active_op_array));
|
||||
}
|
||||
opline->result.u.var = switch_entry_ptr->control_var;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->op1 = switch_entry_ptr->cond;
|
||||
@@ -1438,22 +1486,19 @@ void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_BOOL;
|
||||
if (switch_entry_ptr->control_var==-1) {
|
||||
switch_entry_ptr->control_var = get_temporary_variable(CG(active_op_array));
|
||||
}
|
||||
opline->result.u.var = switch_entry_ptr->control_var;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
opline->op1.u.constant.type = IS_LONG;
|
||||
opline->op1.u.constant.type = IS_BOOL;
|
||||
opline->op1.u.constant.value.lval = 1;
|
||||
INIT_PZVAL(&opline->op1.u.constant);
|
||||
SET_UNUSED(opline->op2);
|
||||
switch_entry_ptr->default_case = next_op_number;
|
||||
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
if (case_list->op_type==IS_UNUSED) {
|
||||
return;
|
||||
}
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
|
||||
}
|
||||
|
||||
@@ -1511,7 +1556,7 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
|
||||
opline->opcode = ZEND_DECLARE_FUNCTION_OR_CLASS;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &class_name->u.constant, opline);
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &class_name->u.constant, opline CLS_CC);
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.refcount = 1;
|
||||
@@ -1602,7 +1647,7 @@ void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
|
||||
unsigned char *ptr = NULL;
|
||||
|
||||
opline->opcode = ZEND_NEW;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *class_name;
|
||||
SET_UNUSED(opline->op2);
|
||||
@@ -1903,32 +1948,22 @@ void do_cast(znode *result, znode *expr, int type CLS_DC)
|
||||
|
||||
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
do_extended_fcall_begin(CLS_C);
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_INCLUDE_OR_EVAL;
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *op1;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.constant.value.lval = type;
|
||||
*result = opline->result;
|
||||
if (type==ZEND_REQUIRE) {
|
||||
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
if (filename->op_type==IS_CONST
|
||||
&& filename->u.constant.type==IS_STRING) {
|
||||
require_filename(filename->u.constant.value.str.val, unique CLS_CC);
|
||||
zval_dtor(&filename->u.constant);
|
||||
} else {
|
||||
znode result;
|
||||
|
||||
do_include_or_eval(ZEND_REQUIRE, &result, filename CLS_CC);
|
||||
opline->opcode = ZEND_INCLUDE_OR_EVAL;
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *op1;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.constant.value.lval = type;
|
||||
*result = opline->result;
|
||||
if (type==ZEND_REQUIRE) {
|
||||
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
}
|
||||
do_extended_fcall_end(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
@@ -1982,7 +2017,7 @@ void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token CLS_DC)
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1992,6 +2027,11 @@ void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_t
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *array;
|
||||
SET_UNUSED(opline->op2);
|
||||
if (variable) {
|
||||
opline->extended_value = 1;
|
||||
} else {
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
*open_brackets_token = opline->result;
|
||||
|
||||
zend_stack_push(&CG(foreach_copy_stack), (void *) &opline->result, sizeof(znode));
|
||||
@@ -2290,7 +2330,6 @@ int zendlex(znode *zendlval CLS_DC)
|
||||
case T_COMMENT:
|
||||
case T_OPEN_TAG:
|
||||
case T_WHITESPACE:
|
||||
case T_PHP_TRACK_VARS:
|
||||
retval = zendlex(zendlval CLS_CC);
|
||||
break;
|
||||
case T_CLOSE_TAG:
|
||||
|
||||
+24
-18
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _COMPILE_H
|
||||
#define _COMPILE_H
|
||||
#ifndef ZEND_COMPILE_H
|
||||
#define ZEND_COMPILE_H
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <istream.h>
|
||||
#endif
|
||||
|
||||
#include "zend_llist.h"
|
||||
|
||||
#define DEBUG_ZEND 0
|
||||
@@ -76,7 +80,6 @@ typedef struct _zend_op {
|
||||
znode op1;
|
||||
znode op2;
|
||||
ulong extended_value;
|
||||
char *filename;
|
||||
uint lineno;
|
||||
} zend_op;
|
||||
|
||||
@@ -117,6 +120,8 @@ struct _zend_op_array {
|
||||
zend_bool return_reference;
|
||||
zend_bool done_pass_two;
|
||||
|
||||
char *filename;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
};
|
||||
|
||||
@@ -191,7 +196,6 @@ typedef struct _zend_file_handle {
|
||||
} zend_file_handle;
|
||||
|
||||
|
||||
#include "zend_globals.h"
|
||||
|
||||
#define IS_CONST (1<<0)
|
||||
#define IS_TMP_VAR (1<<1)
|
||||
@@ -201,12 +205,14 @@ typedef struct _zend_file_handle {
|
||||
|
||||
#define EXT_TYPE_UNUSED (1<<0)
|
||||
|
||||
#include "zend_globals.h"
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
void init_compiler(CLS_D ELS_DC);
|
||||
void shutdown_compiler(CLS_D);
|
||||
|
||||
extern ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
|
||||
extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type CLS_DC);
|
||||
|
||||
void zend_activate(CLS_D ELS_DC);
|
||||
void zend_deactivate(CLS_D ELS_DC);
|
||||
@@ -286,6 +292,7 @@ void do_begin_class_member_function_call(znode *class_name, znode *function_name
|
||||
void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC);
|
||||
void do_return(znode *expr, int do_end_vparse CLS_DC);
|
||||
ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time);
|
||||
void do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
|
||||
void do_early_binding(CLS_D);
|
||||
|
||||
void do_pass_param(znode *param, int op, int offset CLS_DC);
|
||||
@@ -333,12 +340,11 @@ void do_new_list_end(CLS_D);
|
||||
|
||||
void do_cast(znode *result, znode *expr, int type CLS_DC);
|
||||
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC);
|
||||
|
||||
void do_unset(znode *variable CLS_DC);
|
||||
void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
|
||||
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token CLS_DC);
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC);
|
||||
void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
|
||||
void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
|
||||
|
||||
@@ -363,22 +369,21 @@ void do_extended_fcall_end(CLS_D);
|
||||
|
||||
void do_ticks(CLS_D);
|
||||
|
||||
ZEND_API void function_add_ref(zend_function *function);
|
||||
|
||||
#define INITIAL_OP_ARRAY_SIZE 64
|
||||
|
||||
|
||||
/* helper functions in zend-scanner.l */
|
||||
ZEND_API int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC);
|
||||
ZEND_API int require_filename(char *filename, zend_bool unique CLS_DC);
|
||||
ZEND_API int use_filename(char *filename, uint filename_length CLS_DC);
|
||||
ZEND_API zend_op_array *zend_compile_files(int type CLS_DC, int file_count, ...);
|
||||
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files);
|
||||
ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
|
||||
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS_DC);
|
||||
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename CLS_DC);
|
||||
ZEND_API zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC);
|
||||
ZEND_API int zend_execute_scripts(int type CLS_DC ELS_DC, int file_count, ...);
|
||||
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
|
||||
ZEND_API void init_op_array(zend_op_array *op_array, int type, int initial_ops_size);
|
||||
ZEND_API void init_op_array(zend_op_array *op_array, int type, int initial_ops_size CLS_DC);
|
||||
ZEND_API void destroy_op_array(zend_op_array *op_array);
|
||||
ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC);
|
||||
ZEND_API void zend_open_file_dtor(zend_file_handle *fh);
|
||||
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle CLS_DC);
|
||||
ZEND_API void zend_file_handle_dtor(zend_file_handle *fh);
|
||||
|
||||
ZEND_API void destroy_zend_function(zend_function *function);
|
||||
ZEND_API void destroy_zend_class(zend_class_entry *ce);
|
||||
@@ -393,9 +398,9 @@ int get_next_op_number(zend_op_array *op_array);
|
||||
int print_class(zend_class_entry *class_entry);
|
||||
void print_op_array(zend_op_array *op_array, int optimizations);
|
||||
int pass_two(zend_op_array *op_array);
|
||||
ZEND_API void pass_include_eval(zend_op_array *op_array);
|
||||
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
|
||||
ZEND_API zend_bool zend_is_compiling(void);
|
||||
ZEND_API char *zend_make_compiled_string_description(char *name);
|
||||
|
||||
int zendlex(znode *zendlval CLS_DC);
|
||||
|
||||
@@ -564,6 +569,7 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_INCLUDE (1<<1)
|
||||
#define ZEND_INCLUDE_ONCE (1<<2)
|
||||
#define ZEND_REQUIRE (1<<3)
|
||||
#define ZEND_REQUIRE_ONCE (1<<4)
|
||||
|
||||
#define ZEND_ISSET (1<<0)
|
||||
#define ZEND_ISEMPTY (1<<1)
|
||||
@@ -620,4 +626,4 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* _COMPILE_H */
|
||||
#endif /* ZEND_COMPILE_H */
|
||||
+22
-7
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_CONFIG_W32_H
|
||||
#define _ZEND_CONFIG_W32_H
|
||||
#ifndef ZEND_CONFIG_W32_H
|
||||
#define ZEND_CONFIG_W32_H
|
||||
|
||||
|
||||
#include <string.h>
|
||||
@@ -42,23 +42,27 @@ typedef unsigned int uint;
|
||||
#define HAVE_STDIOSTR_H 1
|
||||
#define HAVE_CLASS_ISTDIOSTREAM
|
||||
#define istdiostream stdiostream
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
#ifdef inline
|
||||
#undef inline
|
||||
#endif
|
||||
#define vsnprintf _vsnprintf
|
||||
#define zend_isinf(a) 0
|
||||
|
||||
#define zend_sprintf sprintf
|
||||
|
||||
/* This will cause the compilation process to be MUCH longer, but will generate
|
||||
* a much quicker PHP binary
|
||||
*/
|
||||
#undef inline
|
||||
#ifdef ZEND_WIN32_FORCE_INLINE
|
||||
# define inline __forceinline
|
||||
#else
|
||||
# define inline
|
||||
#endif
|
||||
|
||||
#define finite(A) _finite(A)
|
||||
#define zend_finite(A) _finite(A)
|
||||
#define zend_isnan(A) _isnan(A)
|
||||
|
||||
#ifdef LIBZEND_EXPORTS
|
||||
# define ZEND_API __declspec(dllexport)
|
||||
@@ -68,4 +72,15 @@ typedef unsigned int uint;
|
||||
|
||||
#define ZEND_DLEXPORT __declspec(dllexport)
|
||||
|
||||
#endif /* _ZEND_CONFIG_W32_H */
|
||||
/* 0x00200000L is MB_SERVICE_NOTIFICATION, which is only supported under Windows NT
|
||||
* (and requires _WIN32_WINNT to be defined, which prevents the resulting executable
|
||||
* from running under Windows 9x
|
||||
* Windows 9x should silently ignore it, so it's being used here directly
|
||||
*/
|
||||
#ifndef MB_SERVICE_NOTIFICATION
|
||||
#define MB_SERVICE_NOTIFICATION 0x00200000L
|
||||
#endif
|
||||
|
||||
#define ZEND_SERVICE_MB_STYLE (MB_TOPMOST|MB_SERVICE_NOTIFICATION)
|
||||
|
||||
#endif /* ZEND_CONFIG_W32_H */
|
||||
+11
-1
@@ -134,6 +134,12 @@ void zend_register_standard_constants(ELS_D)
|
||||
c.value.type = IS_BOOL;
|
||||
zend_register_constant(&c ELS_CC);
|
||||
|
||||
c.name = zend_strndup(ZEND_STRL("ZEND_THREAD_SAFE"));
|
||||
c.name_len = sizeof("ZEND_THREAD_SAFE");
|
||||
c.value.value.lval = ZTS_V;
|
||||
c.value.type = IS_BOOL;
|
||||
zend_register_constant(&c ELS_CC);
|
||||
|
||||
c.name = zend_strndup(ZEND_STRL("NULL"));
|
||||
c.name_len = sizeof("NULL");
|
||||
c.value.type = IS_NULL;
|
||||
@@ -233,9 +239,10 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_register_constant(zend_constant *c ELS_DC)
|
||||
ZEND_API int zend_register_constant(zend_constant *c ELS_DC)
|
||||
{
|
||||
char *lowercase_name = zend_strndup(c->name, c->name_len);
|
||||
int ret = SUCCESS;
|
||||
|
||||
#if 0
|
||||
printf("Registering constant for module %d\n",c->module_number);
|
||||
@@ -244,8 +251,11 @@ ZEND_API void zend_register_constant(zend_constant *c ELS_DC)
|
||||
zend_str_tolower(lowercase_name, c->name_len);
|
||||
if (zend_hash_add(EG(zend_constants), lowercase_name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
|
||||
zval_dtor(&c->value);
|
||||
zend_error(E_NOTICE,"Constant %s already defined",lowercase_name);
|
||||
ret = FAILURE;
|
||||
}
|
||||
free(lowercase_name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _CONSTANTS_H
|
||||
#define _CONSTANTS_H
|
||||
#ifndef ZEND_CONSTANTS_H
|
||||
#define ZEND_CONSTANTS_H
|
||||
|
||||
#include "zend_globals.h"
|
||||
|
||||
@@ -55,7 +55,7 @@ ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval,
|
||||
ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number ELS_DC);
|
||||
ZEND_API void zend_register_string_constant(char *name, uint name_len, char *strval, int flags, int module_number ELS_DC);
|
||||
ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *strval, uint strlen, int flags, int module_number ELS_DC);
|
||||
ZEND_API void zend_register_constant(zend_constant *c ELS_DC);
|
||||
ZEND_API int zend_register_constant(zend_constant *c ELS_DC);
|
||||
void zend_copy_constants(HashTable *target, HashTable *sourc);
|
||||
void copy_zend_constant(zend_constant *c);
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _DYNAMIC_ARRAY_H
|
||||
#define _DYNAMIC_ARRAY_H
|
||||
#ifndef ZEND_DYNAMIC_ARRAY_H
|
||||
#define ZEND_DYNAMIC_ARRAY_H
|
||||
|
||||
typedef struct _dynamic_array {
|
||||
char *array;
|
||||
@@ -35,4 +35,4 @@ ZEND_API void *zend_dynamic_array_pop(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index);
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* _ZEND_DYNAMIC_ARRAY_H */
|
||||
#endif /* ZEND_DYNAMIC_ARRAY_H */
|
||||
+3
-3
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_ERRORS_H
|
||||
#define _ZEND_ERRORS_H
|
||||
#ifndef ZEND_ERRORS_H
|
||||
#define ZEND_ERRORS_H
|
||||
|
||||
#define E_ERROR (1<<0L)
|
||||
#define E_WARNING (1<<1L)
|
||||
@@ -36,5 +36,5 @@
|
||||
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE)
|
||||
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
|
||||
|
||||
#endif /* _ZEND_ERRORS_H */
|
||||
#endif /* ZEND_ERRORS_H */
|
||||
|
||||
+111
-150
@@ -65,14 +65,6 @@ static void zend_extension_statement_handler(zend_extension *extension, zend_op_
|
||||
static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array);
|
||||
static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array);
|
||||
|
||||
|
||||
|
||||
#define SEPARATE_ON_READ_OBJECT(obj, _type) \
|
||||
if ((obj) && ((_type) == BP_VAR_R) && ((*(obj))->type == IS_OBJECT)) { \
|
||||
SEPARATE_ZVAL_IF_NOT_REF((obj)); \
|
||||
(*(obj))->is_ref = 1; \
|
||||
}
|
||||
|
||||
#define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED))
|
||||
|
||||
static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_free ELS_DC)
|
||||
@@ -142,10 +134,11 @@ static inline zval *_get_object_zval_ptr(znode *node, temp_variable *Ts, int *sh
|
||||
return &Ts[node->u.var].tmp_var;
|
||||
break;
|
||||
case IS_VAR:
|
||||
if (Ts[node->u.var].var.ptr) {
|
||||
PZVAL_UNLOCK(Ts[node->u.var].var.ptr);
|
||||
if (Ts[node->u.var].var.ptr_ptr) {
|
||||
PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr);
|
||||
*should_free = 0;
|
||||
return Ts[node->u.var].var.ptr;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(Ts[node->u.var].var.ptr_ptr);
|
||||
return *Ts[node->u.var].var.ptr_ptr;
|
||||
} else {
|
||||
if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) {
|
||||
PZVAL_UNLOCK(Ts[node->u.var].EA.data.str_offset.str);
|
||||
@@ -347,16 +340,6 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
if (variable_ptr->refcount==0) {
|
||||
switch (type) {
|
||||
case IS_VAR:
|
||||
/*
|
||||
if (PZVAL_IS_LOCKED(value)) {
|
||||
zval *orig_value = value;
|
||||
|
||||
ALLOC_ZVAL(value);
|
||||
*value = *orig_value;
|
||||
value->refcount=0;
|
||||
zval_copy_ctor(value);
|
||||
}
|
||||
*/
|
||||
/* break missing intentionally */
|
||||
case IS_CONST:
|
||||
if (variable_ptr==value) {
|
||||
@@ -386,16 +369,6 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
} else { /* we need to split */
|
||||
switch (type) {
|
||||
case IS_VAR:
|
||||
/*
|
||||
if (PZVAL_IS_LOCKED(value)) {
|
||||
zval *orig_value = value;
|
||||
|
||||
ALLOC_ZVAL(value);
|
||||
*value = *orig_value;
|
||||
value->refcount=0;
|
||||
zval_copy_ctor(value);
|
||||
}
|
||||
*/
|
||||
/* break missing intentionally */
|
||||
case IS_CONST:
|
||||
if (PZVAL_IS_REF(value) && value->refcount > 0) {
|
||||
@@ -516,14 +489,13 @@ static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_v
|
||||
if (op2->u.fetch_type == ZEND_FETCH_LOCAL) {
|
||||
FREE_OP(op1, free_op1);
|
||||
} else if (op2->u.fetch_type == ZEND_FETCH_STATIC) {
|
||||
zval_update_constant(retval);
|
||||
zval_update_constant(retval, (void *) 1);
|
||||
}
|
||||
|
||||
if (varname == &tmp_varname) {
|
||||
zval_dtor(varname);
|
||||
}
|
||||
Ts[result->u.var].var.ptr_ptr = retval;
|
||||
SEPARATE_ON_READ_OBJECT(retval, type);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, result);
|
||||
}
|
||||
|
||||
@@ -670,13 +642,8 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
case BP_VAR_RW:
|
||||
case BP_VAR_W:
|
||||
if (!PZVAL_IS_REF(container)) {
|
||||
container->refcount--;
|
||||
if (container->refcount>0) {
|
||||
ALLOC_ZVAL(container);
|
||||
*container_ptr = container;
|
||||
container->is_ref=0;
|
||||
}
|
||||
container->refcount=1;
|
||||
SEPARATE_ZVAL(container_ptr);
|
||||
container = *container_ptr;
|
||||
}
|
||||
array_init(container);
|
||||
break;
|
||||
@@ -686,12 +653,8 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
switch (container->type) {
|
||||
case IS_ARRAY:
|
||||
if ((type==BP_VAR_W || type==BP_VAR_RW) && container->refcount>1 && !PZVAL_IS_REF(container)) {
|
||||
container->refcount--;
|
||||
ALLOC_ZVAL(*container_ptr);
|
||||
**container_ptr = *container;
|
||||
SEPARATE_ZVAL(container_ptr);
|
||||
container = *container_ptr;
|
||||
INIT_PZVAL(container);
|
||||
zendi_zval_copy_ctor(*container);
|
||||
}
|
||||
if (op2->op_type == IS_UNUSED) {
|
||||
zval *new_zval = &EG(uninitialized_zval);
|
||||
@@ -701,7 +664,6 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
} else {
|
||||
*retval = zend_fetch_dimension_address_inner(container->value.ht, op2, Ts, type ELS_CC);
|
||||
}
|
||||
SEPARATE_ON_READ_OBJECT(*retval, type);
|
||||
SELECTIVE_PZVAL_LOCK(**retval, result);
|
||||
break;
|
||||
case IS_NULL:
|
||||
@@ -855,13 +817,8 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
|
||||
case BP_VAR_RW:
|
||||
case BP_VAR_W:
|
||||
if (!PZVAL_IS_REF(container)) {
|
||||
container->refcount--;
|
||||
if (container->refcount>0) {
|
||||
ALLOC_ZVAL(container);
|
||||
*container_ptr = container;
|
||||
container->is_ref=0;
|
||||
}
|
||||
container->refcount=1;
|
||||
SEPARATE_ZVAL(container_ptr);
|
||||
container = *container_ptr;
|
||||
}
|
||||
object_init(container);
|
||||
break;
|
||||
@@ -884,15 +841,10 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
|
||||
|
||||
|
||||
if ((type==BP_VAR_W || type==BP_VAR_RW) && container->refcount>1 && !PZVAL_IS_REF(container)) {
|
||||
container->refcount--;
|
||||
ALLOC_ZVAL(*container_ptr);
|
||||
**container_ptr = *container;
|
||||
SEPARATE_ZVAL(container_ptr);
|
||||
container = *container_ptr;
|
||||
INIT_PZVAL(container);
|
||||
zendi_zval_copy_ctor(*container);
|
||||
}
|
||||
*retval = zend_fetch_property_address_inner(container->value.obj.properties, op2, Ts, type ELS_CC);
|
||||
SEPARATE_ON_READ_OBJECT(*retval, type);
|
||||
SELECTIVE_PZVAL_LOCK(**retval, result);
|
||||
}
|
||||
|
||||
@@ -1012,6 +964,11 @@ void execute(zend_op_array *op_array ELS_DC)
|
||||
while (opline<end) {
|
||||
#else
|
||||
while (1) {
|
||||
#endif
|
||||
#ifdef ZEND_WIN32
|
||||
if (EG(timed_out)) {
|
||||
zend_timeout(0);
|
||||
}
|
||||
#endif
|
||||
switch(opline->opcode) {
|
||||
case ZEND_ADD:
|
||||
@@ -1128,17 +1085,9 @@ binary_assign_op_addr: {
|
||||
opline++;
|
||||
continue;
|
||||
}
|
||||
if (!PZVAL_IS_REF(*var_ptr)) {
|
||||
if ((*var_ptr)->refcount>1) {
|
||||
zval *orig_var=*var_ptr;
|
||||
|
||||
(*var_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*var_ptr);
|
||||
**var_ptr = *orig_var;
|
||||
zendi_zval_copy_ctor(**var_ptr);
|
||||
(*var_ptr)->refcount=1;
|
||||
}
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
|
||||
|
||||
EG(binary_op)(*var_ptr, *var_ptr, get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R));
|
||||
Ts[opline->result.u.var].var.ptr_ptr = var_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*var_ptr, &opline->result);
|
||||
@@ -1173,17 +1122,9 @@ binary_assign_op_addr: {
|
||||
zendi_zval_copy_ctor(Ts[opline->result.u.var].tmp_var);
|
||||
break;
|
||||
}
|
||||
if (!PZVAL_IS_REF(*var_ptr)) {
|
||||
if ((*var_ptr)->refcount>1) {
|
||||
zval *orig_var = *var_ptr;
|
||||
|
||||
(*var_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*var_ptr);
|
||||
**var_ptr = *orig_var;
|
||||
zendi_zval_copy_ctor(**var_ptr);
|
||||
(*var_ptr)->refcount=1;
|
||||
}
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
|
||||
|
||||
incdec_op(*var_ptr);
|
||||
switch (opline->opcode) {
|
||||
case ZEND_PRE_INC:
|
||||
@@ -1317,7 +1258,7 @@ binary_assign_op_addr: {
|
||||
zval *value;
|
||||
value = get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R);
|
||||
|
||||
zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (EG(free_op2)?IS_TMP_VAR:opline->op2.op_type), Ts ELS_CC);
|
||||
zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (EG(free_op2)?IS_TMP_VAR:opline->op2.op_type), Ts ELS_CC);
|
||||
/* zend_assign_to_variable() always takes care of op2, never free it! */
|
||||
}
|
||||
NEXT_OPCODE();
|
||||
@@ -1471,7 +1412,7 @@ binary_assign_op_addr: {
|
||||
/* constructor call */
|
||||
|
||||
if (opline->op1.op_type == IS_VAR) {
|
||||
PZVAL_LOCK(*Ts[opline->op1.u.var].var.ptr_ptr);
|
||||
SELECTIVE_PZVAL_LOCK(*Ts[opline->op1.u.var].var.ptr_ptr, &opline->op1);
|
||||
}
|
||||
if (opline->op2.op_type==IS_VAR) {
|
||||
PZVAL_LOCK(*Ts[opline->op2.u.var].var.ptr_ptr);
|
||||
@@ -1529,6 +1470,10 @@ binary_assign_op_addr: {
|
||||
if (!object.ptr || object.ptr->type != IS_OBJECT) {
|
||||
zend_error(E_ERROR, "Call to a member function on a non-object");
|
||||
}
|
||||
if (!object.ptr->is_ref && object.ptr->refcount > 1) {
|
||||
zend_error(E_ERROR, "Bug: Problem in method call\n");
|
||||
}
|
||||
object.ptr->is_ref=1;
|
||||
object.ptr->refcount++; /* For $this pointer */
|
||||
active_function_table = &(object.ptr->value.obj.ce->function_table);
|
||||
}
|
||||
@@ -1658,10 +1603,8 @@ do_fcall_common:
|
||||
|
||||
retval_ptr_ptr = get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_W);
|
||||
|
||||
if (!PZVAL_IS_REF(*retval_ptr_ptr)) {
|
||||
SEPARATE_ZVAL(retval_ptr_ptr);
|
||||
(*retval_ptr_ptr)->is_ref = 1;
|
||||
}
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr);
|
||||
|
||||
(*retval_ptr_ptr)->refcount++;
|
||||
(*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr);
|
||||
} else {
|
||||
@@ -1744,21 +1687,8 @@ send_by_ref:
|
||||
zend_error(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
|
||||
if (!PZVAL_IS_REF(varptr)) {
|
||||
/* code to break away this variable */
|
||||
if (varptr->refcount>1) {
|
||||
varptr->refcount--;
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
**varptr_ptr = *varptr;
|
||||
varptr = *varptr_ptr;
|
||||
varptr->refcount = 1;
|
||||
zval_copy_ctor(varptr);
|
||||
}
|
||||
varptr->is_ref = 1;
|
||||
/* at the end of this code refcount is always 1 */
|
||||
}
|
||||
varptr->refcount++;
|
||||
zend_ptr_stack_push(&EG(argument_stack), varptr);
|
||||
}
|
||||
@@ -1767,7 +1697,7 @@ send_by_ref:
|
||||
zval **param;
|
||||
|
||||
if (zend_ptr_stack_get_arg(opline->op1.u.constant.value.lval, (void **) ¶m ELS_CC)==FAILURE) {
|
||||
zend_error(E_NOTICE, "Missing argument %d for %s()\n", opline->op1.u.constant.value.lval, get_active_function_name());
|
||||
zend_error(E_WARNING, "Missing argument %d for %s()\n", opline->op1.u.constant.value.lval, get_active_function_name());
|
||||
if (opline->result.op_type == IS_VAR) {
|
||||
PZVAL_UNLOCK(*Ts[opline->result.u.var].var.ptr_ptr);
|
||||
}
|
||||
@@ -1782,18 +1712,16 @@ send_by_ref:
|
||||
zval **param, *assignment_value;
|
||||
|
||||
if (zend_ptr_stack_get_arg(opline->op1.u.constant.value.lval, (void **) ¶m ELS_CC)==FAILURE) {
|
||||
if (opline->op2.u.constant.type == IS_CONSTANT) {
|
||||
if (opline->op2.u.constant.type == IS_CONSTANT || opline->op2.u.constant.type==IS_CONSTANT_ARRAY) {
|
||||
zval *default_value;
|
||||
zval tmp;
|
||||
|
||||
ALLOC_ZVAL(default_value);
|
||||
*default_value = opline->op2.u.constant;
|
||||
if (!zend_get_constant(default_value->value.str.val, default_value->value.str.len, &tmp)) {
|
||||
default_value->type = IS_STRING;
|
||||
if (opline->op2.u.constant.type==IS_CONSTANT_ARRAY) {
|
||||
zval_copy_ctor(default_value);
|
||||
} else {
|
||||
*default_value = tmp;
|
||||
}
|
||||
default_value->refcount=1;
|
||||
zval_update_constant(&default_value, 0);
|
||||
default_value->refcount=0;
|
||||
default_value->is_ref=0;
|
||||
param = &default_value;
|
||||
@@ -1806,7 +1734,7 @@ send_by_ref:
|
||||
assignment_value = *param;
|
||||
}
|
||||
|
||||
if (PZVAL_IS_REF(assignment_value)) {
|
||||
if (PZVAL_IS_REF(assignment_value) && param) {
|
||||
zend_assign_to_variable_reference(NULL, get_zval_ptr_ptr(&opline->result, Ts, BP_VAR_W), param, NULL ELS_CC);
|
||||
} else {
|
||||
zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, Ts ELS_CC);
|
||||
@@ -1911,9 +1839,11 @@ send_by_ref:
|
||||
if (zend_hash_find(EG(class_table), class_name.value.str.val, class_name.value.str.len+1, (void **) &ce)==FAILURE) {
|
||||
zend_error(E_ERROR, "Cannot instantiate non-existent class: %s", class_name.value.str.val);
|
||||
}
|
||||
object_init_ex(&Ts[opline->result.u.var].tmp_var, ce);
|
||||
Ts[opline->result.u.var].tmp_var.refcount=1;
|
||||
Ts[opline->result.u.var].tmp_var.is_ref=1;
|
||||
Ts[opline->result.u.var].var.ptr_ptr = &Ts[opline->result.u.var].var.ptr;
|
||||
ALLOC_ZVAL(Ts[opline->result.u.var].var.ptr);
|
||||
object_init_ex(Ts[opline->result.u.var].var.ptr, ce);
|
||||
Ts[opline->result.u.var].var.ptr->refcount=1;
|
||||
Ts[opline->result.u.var].var.ptr->is_ref=1;
|
||||
zval_dtor(&class_name);
|
||||
FREE_OP(&opline->op1, EG(free_op1));
|
||||
}
|
||||
@@ -1946,7 +1876,7 @@ send_by_ref:
|
||||
NEXT_OPCODE();
|
||||
}
|
||||
}
|
||||
if (opline->op1.op_type == IS_TMP_VAR) { /* temporary variable */
|
||||
if (!opline->extended_value && EG(free_op1)) { /* temporary variable */
|
||||
zval *new_expr;
|
||||
|
||||
ALLOC_ZVAL(new_expr);
|
||||
@@ -1955,11 +1885,8 @@ send_by_ref:
|
||||
INIT_PZVAL(expr_ptr);
|
||||
} else {
|
||||
if (opline->extended_value) {
|
||||
if (!PZVAL_IS_REF(expr_ptr)) {
|
||||
SEPARATE_ZVAL(expr_ptr_ptr);
|
||||
expr_ptr = *expr_ptr_ptr;
|
||||
expr_ptr->is_ref = 1;
|
||||
}
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
|
||||
expr_ptr = *expr_ptr_ptr;
|
||||
expr_ptr->refcount++;
|
||||
} else if (PZVAL_IS_REF(expr_ptr)) {
|
||||
zval *new_expr;
|
||||
@@ -1984,7 +1911,11 @@ send_by_ref:
|
||||
case IS_STRING:
|
||||
zend_hash_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
case IS_NULL:
|
||||
zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
|
||||
break;
|
||||
default:
|
||||
zval_ptr_dtor(&expr_ptr);
|
||||
/* do nothing */
|
||||
break;
|
||||
}
|
||||
@@ -2045,7 +1976,8 @@ send_by_ref:
|
||||
return_value_used = RETURN_VALUE_USED(opline);
|
||||
|
||||
switch (opline->op2.u.constant.value.lval) {
|
||||
case ZEND_INCLUDE_ONCE: {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
char *opened_path;
|
||||
int dummy = 1;
|
||||
zend_file_handle file_handle;
|
||||
@@ -2053,37 +1985,40 @@ send_by_ref:
|
||||
file_handle.handle.fp = zend_fopen(inc_filename->value.str.val, &opened_path);
|
||||
file_handle.type = ZEND_HANDLE_FP;
|
||||
file_handle.filename = inc_filename->value.str.val;
|
||||
file_handle.opened_path = opened_path;
|
||||
file_handle.free_filename = 0;
|
||||
|
||||
|
||||
if (file_handle.handle.fp) {
|
||||
if (!opened_path || zend_hash_add(&EG(included_files), opened_path, strlen(opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) {
|
||||
new_op_array = zend_compile_files(ZEND_INCLUDE CLS_CC, 1, &file_handle);
|
||||
if (new_op_array) {
|
||||
pass_include_eval(new_op_array);
|
||||
} else {
|
||||
fclose(file_handle.handle.fp);
|
||||
}
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) CLS_CC);
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
opened_path = NULL; /* zend_destroy_file_handle() already frees it */
|
||||
} else {
|
||||
fclose(file_handle.handle.fp);
|
||||
}
|
||||
if (opened_path) {
|
||||
free(opened_path);
|
||||
} else {
|
||||
if (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle.filename);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle.filename);
|
||||
}
|
||||
}
|
||||
if (opened_path) {
|
||||
efree(opened_path);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
{
|
||||
new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename CLS_CC ELS_CC);
|
||||
if (new_op_array) {
|
||||
pass_include_eval(new_op_array);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ZEND_EVAL:
|
||||
new_op_array = compile_string(inc_filename CLS_CC);
|
||||
case ZEND_EVAL: {
|
||||
char *eval_desc = zend_make_compiled_string_description("eval()'d code");
|
||||
|
||||
new_op_array = compile_string(inc_filename, eval_desc CLS_CC);
|
||||
efree(eval_desc);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
@@ -2162,14 +2097,32 @@ send_by_ref:
|
||||
ht = NULL;
|
||||
break;
|
||||
}
|
||||
if (ht) {
|
||||
if (ht) {
|
||||
switch (offset->type) {
|
||||
case IS_DOUBLE:
|
||||
case IS_RESOURCE:
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
zend_hash_index_del(ht, offset->value.lval);
|
||||
break;
|
||||
{
|
||||
long index;
|
||||
|
||||
if (offset->type == IS_DOUBLE) {
|
||||
index = (long) offset->value.lval;
|
||||
} else {
|
||||
index = offset->value.lval;
|
||||
}
|
||||
zend_hash_index_del(ht, index);
|
||||
break;
|
||||
}
|
||||
case IS_STRING:
|
||||
zend_hash_del(ht, offset->value.str.val, offset->value.str.len+1);
|
||||
break;
|
||||
case IS_NULL:
|
||||
zend_hash_del(ht, "", sizeof(""));
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Illegal offset type in unset");
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -2179,22 +2132,27 @@ send_by_ref:
|
||||
}
|
||||
NEXT_OPCODE();
|
||||
case ZEND_FE_RESET: {
|
||||
zval *array_ptr;
|
||||
zval *array_ptr, **array_ptr_ptr;
|
||||
HashTable *fe_ht;
|
||||
|
||||
array_ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
|
||||
if (EG(free_op1)) { /* IS_TMP_VAR */
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
*tmp = *array_ptr;
|
||||
INIT_PZVAL(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
if (opline->extended_value) {
|
||||
array_ptr_ptr = get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_R);
|
||||
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
|
||||
array_ptr = *array_ptr_ptr;
|
||||
array_ptr->refcount++;
|
||||
}
|
||||
} else {
|
||||
array_ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
if (EG(free_op1)) { /* IS_TMP_VAR */
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
*tmp = *array_ptr;
|
||||
INIT_PZVAL(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
array_ptr->refcount++;
|
||||
}
|
||||
}
|
||||
PZVAL_LOCK(array_ptr);
|
||||
Ts[opline->result.u.var].var.ptr = array_ptr;
|
||||
Ts[opline->result.u.var].var.ptr_ptr = &Ts[opline->result.u.var].var.ptr;
|
||||
@@ -2364,10 +2322,13 @@ send_by_ref:
|
||||
case ZEND_NOP:
|
||||
NEXT_OPCODE();
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
|
||||
}
|
||||
}
|
||||
#if SUPPORT_INTERACTIVE
|
||||
ALLOC_INIT_ZVAL(*(EG(return_value_ptr_ptr)));
|
||||
op_array->last_executed_op_number = opline-op_array->opcodes;
|
||||
EG(in_execution) = original_in_execution;
|
||||
free_alloca(Ts);
|
||||
#else
|
||||
zend_error(E_ERROR,"Arrived at end of main loop which shouldn't happen");
|
||||
|
||||
+138
-10
@@ -18,11 +18,13 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _EXECUTE_H
|
||||
#define _EXECUTE_H
|
||||
#ifndef ZEND_EXECUTE_H
|
||||
#define ZEND_EXECUTE_H
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend_hash.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_execute_locks.h"
|
||||
|
||||
typedef union _temp_variable {
|
||||
zval tmp_var;
|
||||
@@ -52,15 +54,79 @@ void init_executor(CLS_D ELS_DC);
|
||||
void shutdown_executor(ELS_D);
|
||||
void execute(zend_op_array *op_array ELS_DC);
|
||||
ZEND_API int zend_is_true(zval *op);
|
||||
ZEND_API inline void safe_free_zval_ptr(zval *p);
|
||||
ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC);
|
||||
ZEND_API inline int i_zend_is_true(zval *op);
|
||||
ZEND_API int zval_update_constant(zval **pp);
|
||||
ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC);
|
||||
static inline void safe_free_zval_ptr(zval *p)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
if (p!=EG(uninitialized_zval_ptr)) {
|
||||
FREE_ZVAL(p);
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name CLS_DC ELS_DC);
|
||||
static inline int i_zend_is_true(zval *op)
|
||||
{
|
||||
int result;
|
||||
|
||||
switch (op->type) {
|
||||
case IS_NULL:
|
||||
result = 0;
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
case IS_RESOURCE:
|
||||
result = (op->value.lval?1:0);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
result = (op->value.dval ? 1 : 0);
|
||||
break;
|
||||
case IS_STRING:
|
||||
if (op->value.str.len == 0
|
||||
|| (op->value.str.len==1 && op->value.str.val[0]=='0')) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = 1;
|
||||
}
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
result = (zend_hash_num_elements(op->value.ht)?1:0);
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
result = (zend_hash_num_elements(op->value.obj.properties)?1:0);
|
||||
break;
|
||||
default:
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ZEND_API int zval_update_constant(zval **pp, void *arg);
|
||||
|
||||
/* dedicated Zend executor functions - do not use! */
|
||||
ZEND_API inline void zend_ptr_stack_clear_multiple(ELS_D);
|
||||
ZEND_API inline int zend_ptr_stack_get_arg(int requested_arg, void **data ELS_DC);
|
||||
static inline void zend_ptr_stack_clear_multiple(ELS_D)
|
||||
{
|
||||
void **p = EG(argument_stack).top_element-2;
|
||||
int delete_count = (ulong) *p;
|
||||
|
||||
EG(argument_stack).top -= (delete_count+2);
|
||||
while (--delete_count>=0) {
|
||||
zval_ptr_dtor((zval **) --p);
|
||||
}
|
||||
EG(argument_stack).top_element = p;
|
||||
}
|
||||
|
||||
static inline int zend_ptr_stack_get_arg(int requested_arg, void **data ELS_DC)
|
||||
{
|
||||
void **p = EG(argument_stack).top_element-2;
|
||||
int arg_count = (ulong) *p;
|
||||
|
||||
if (requested_arg>arg_count) {
|
||||
return FAILURE;
|
||||
}
|
||||
*data = (p-arg_count+requested_arg-1);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
#if SUPPORT_INTERACTIVE
|
||||
void execute_new_code(CLS_D);
|
||||
@@ -73,13 +139,75 @@ ZEND_API char *zend_get_executed_filename(ELS_D);
|
||||
ZEND_API uint zend_get_executed_lineno(ELS_D);
|
||||
ZEND_API zend_bool zend_is_executing(void);
|
||||
|
||||
void zend_set_timeout(long seconds);
|
||||
void zend_unset_timeout(void);
|
||||
ZEND_API void zend_timeout(int dummy);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
void zend_init_timeout_thread();
|
||||
void zend_shutdown_timeout_thread();
|
||||
#define WM_REGISTER_ZEND_TIMEOUT (WM_USER+1)
|
||||
#define WM_UNREGISTER_ZEND_TIMEOUT (WM_USER+2)
|
||||
#endif
|
||||
|
||||
#define zendi_zval_copy_ctor(p) zval_copy_ctor(&(p))
|
||||
#define zendi_zval_dtor(p) zval_dtor(&(p))
|
||||
|
||||
#define active_opline (*EG(opline_ptr))
|
||||
|
||||
static inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC)
|
||||
{
|
||||
zval *variable_ptr;
|
||||
zval *value_ptr;
|
||||
|
||||
if (!value_ptr_ptr || !variable_ptr_ptr) {
|
||||
zend_error(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
|
||||
return;
|
||||
}
|
||||
|
||||
variable_ptr = *variable_ptr_ptr;
|
||||
value_ptr = *value_ptr_ptr;
|
||||
|
||||
if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) {
|
||||
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
|
||||
/* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */
|
||||
} else if (variable_ptr_ptr != value_ptr_ptr) {
|
||||
variable_ptr->refcount--;
|
||||
if (variable_ptr->refcount==0) {
|
||||
zendi_zval_dtor(*variable_ptr);
|
||||
FREE_ZVAL(variable_ptr);
|
||||
}
|
||||
|
||||
if (!PZVAL_IS_REF(value_ptr)) {
|
||||
/* break it away */
|
||||
value_ptr->refcount--;
|
||||
if (value_ptr->refcount>0) {
|
||||
ALLOC_ZVAL(*value_ptr_ptr);
|
||||
**value_ptr_ptr = *value_ptr;
|
||||
value_ptr = *value_ptr_ptr;
|
||||
zendi_zval_copy_ctor(*value_ptr);
|
||||
}
|
||||
value_ptr->refcount = 1;
|
||||
value_ptr->is_ref = 1;
|
||||
}
|
||||
|
||||
*variable_ptr_ptr = value_ptr;
|
||||
value_ptr->refcount++;
|
||||
} else {
|
||||
if (variable_ptr->refcount>1) { /* we need to break away */
|
||||
SEPARATE_ZVAL(variable_ptr_ptr);
|
||||
}
|
||||
(*variable_ptr_ptr)->is_ref = 1;
|
||||
}
|
||||
|
||||
if (result && !(result->u.EA.type & EXT_TYPE_UNUSED)) {
|
||||
Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result);
|
||||
AI_USE_PTR(Ts[result->u.var].var);
|
||||
}
|
||||
}
|
||||
|
||||
#define IS_OVERLOADED_OBJECT 1
|
||||
#define IS_STRING_OFFSET 2
|
||||
|
||||
#endif /* _EXECUTE_H */
|
||||
#endif /* ZEND_EXECUTE_H */
|
||||
+244
-144
@@ -29,10 +29,23 @@
|
||||
#include "zend_constants.h"
|
||||
#include "zend_extensions.h"
|
||||
#include "zend_execute_locks.h"
|
||||
#if HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
|
||||
ZEND_API void (*zend_execute)(zend_op_array *op_array ELS_DC);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
#include <process.h>
|
||||
/* true global */
|
||||
static WNDCLASS wc;
|
||||
static HWND timeout_window;
|
||||
static HANDLE timeout_thread_event;
|
||||
static DWORD timeout_thread_id;
|
||||
static int timeout_thread_initialized=0;
|
||||
#endif
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
static void (*original_sigsegv_handler)(int);
|
||||
@@ -78,6 +91,18 @@ static void zend_extension_deactivator(zend_extension *extension)
|
||||
}
|
||||
|
||||
|
||||
static int is_not_internal_function(zend_function *function)
|
||||
{
|
||||
return(function->type != ZEND_INTERNAL_FUNCTION);
|
||||
}
|
||||
|
||||
|
||||
static int is_not_internal_class(zend_class_entry *ce)
|
||||
{
|
||||
return(ce->type != ZEND_INTERNAL_CLASS);
|
||||
}
|
||||
|
||||
|
||||
void init_executor(CLS_D ELS_DC)
|
||||
{
|
||||
INIT_ZVAL(EG(uninitialized_zval));
|
||||
@@ -90,8 +115,7 @@ void init_executor(CLS_D ELS_DC)
|
||||
original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv);
|
||||
#endif
|
||||
EG(return_value_ptr_ptr) = &EG(global_return_value_ptr);
|
||||
EG(global_return_value_ptr) = &EG(global_return_value);
|
||||
INIT_ZVAL(EG(global_return_value));
|
||||
EG(global_return_value_ptr) = NULL;
|
||||
|
||||
EG(symtable_cache_ptr) = EG(symtable_cache)-1;
|
||||
EG(symtable_cache_limit)=EG(symtable_cache)+SYMTABLE_CACHE_SIZE-1;
|
||||
@@ -104,7 +128,6 @@ void init_executor(CLS_D ELS_DC)
|
||||
|
||||
zend_ptr_stack_init(&EG(argument_stack));
|
||||
|
||||
EG(main_op_array) = NULL;
|
||||
zend_hash_init(&EG(symbol_table), 50, NULL, ZVAL_PTR_DTOR, 0);
|
||||
EG(active_symbol_table) = &EG(symbol_table);
|
||||
|
||||
@@ -117,16 +140,19 @@ void init_executor(CLS_D ELS_DC)
|
||||
EG(ticks_count) = 0;
|
||||
|
||||
EG(user_error_handler) = NULL;
|
||||
|
||||
zend_ptr_stack_init(&EG(user_error_handlers));
|
||||
|
||||
EG(orig_error_reporting) = EG(error_reporting);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
EG(timed_out) = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void shutdown_executor(ELS_D)
|
||||
{
|
||||
if (EG(global_return_value_ptr) == &EG(global_return_value)) {
|
||||
zval_dtor(&EG(global_return_value));
|
||||
} else {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
zend_ptr_stack_destroy(&EG(arg_types_stack));
|
||||
|
||||
while (EG(symtable_cache_ptr)>=EG(symtable_cache)) {
|
||||
@@ -144,13 +170,16 @@ void shutdown_executor(ELS_D)
|
||||
}
|
||||
}
|
||||
|
||||
zend_destroy_rsrc_list(ELS_C); /* must be destroyed after the main symbol table is destroyed */
|
||||
|
||||
zend_ptr_stack_destroy(&EG(argument_stack));
|
||||
if (EG(main_op_array)) {
|
||||
destroy_op_array(EG(main_op_array));
|
||||
efree(EG(main_op_array));
|
||||
}
|
||||
|
||||
/* Destroy all op arrays */
|
||||
zend_hash_apply(EG(function_table), (int (*)(void *)) is_not_internal_function);
|
||||
zend_hash_apply(EG(class_table), (int (*)(void *)) is_not_internal_class);
|
||||
|
||||
zend_destroy_rsrc_list(ELS_C); /* must be destroyed after the main symbol table and
|
||||
* op arrays are destroyed.
|
||||
*/
|
||||
|
||||
clean_non_persistent_constants();
|
||||
#if ZEND_DEBUG
|
||||
signal(SIGSEGV, original_sigsegv_handler);
|
||||
@@ -162,6 +191,11 @@ void shutdown_executor(ELS_D)
|
||||
zval_dtor(EG(user_error_handler));
|
||||
FREE_ZVAL(EG(user_error_handler));
|
||||
}
|
||||
|
||||
zend_ptr_stack_clean(&EG(user_error_handlers), ZVAL_DESTRUCTOR, 1);
|
||||
zend_ptr_stack_destroy(&EG(user_error_handlers));
|
||||
|
||||
EG(error_reporting) = EG(orig_error_reporting);
|
||||
}
|
||||
|
||||
|
||||
@@ -191,8 +225,8 @@ ZEND_API char *get_active_function_name()
|
||||
|
||||
ZEND_API char *zend_get_executed_filename(ELS_D)
|
||||
{
|
||||
if (EG(opline_ptr)) {
|
||||
return active_opline->filename;
|
||||
if (EG(active_op_array)) {
|
||||
return EG(active_op_array)->filename;
|
||||
} else {
|
||||
return "[no active file]";
|
||||
}
|
||||
@@ -217,16 +251,6 @@ ZEND_API zend_bool zend_is_executing()
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline void safe_free_zval_ptr(zval *p)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
if (p!=EG(uninitialized_zval_ptr)) {
|
||||
FREE_ZVAL(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
|
||||
{
|
||||
#if DEBUG_ZEND>=2
|
||||
@@ -242,53 +266,16 @@ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int i_zend_is_true(zval *op)
|
||||
{
|
||||
int result;
|
||||
|
||||
switch (op->type) {
|
||||
case IS_NULL:
|
||||
result = 0;
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
case IS_RESOURCE:
|
||||
result = (op->value.lval?1:0);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
result = (op->value.dval ? 1 : 0);
|
||||
break;
|
||||
case IS_STRING:
|
||||
if (op->value.str.len == 0
|
||||
|| (op->value.str.len==1 && op->value.str.val[0]=='0')) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = 1;
|
||||
}
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
result = (zend_hash_num_elements(op->value.ht)?1:0);
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
result = (zend_hash_num_elements(op->value.obj.properties)?1:0);
|
||||
break;
|
||||
default:
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_is_true(zval *op)
|
||||
{
|
||||
return i_zend_is_true(op);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zval_update_constant(zval **pp)
|
||||
ZEND_API int zval_update_constant(zval **pp, void *arg)
|
||||
{
|
||||
zval *p = *pp;
|
||||
zend_bool inline_change = (zend_bool) (unsigned long) arg;
|
||||
|
||||
if (p->type == IS_CONSTANT) {
|
||||
zval c;
|
||||
@@ -304,16 +291,22 @@ ZEND_API int zval_update_constant(zval **pp)
|
||||
p->value.str.val,
|
||||
p->value.str.val);
|
||||
p->type = IS_STRING;
|
||||
if (!inline_change) {
|
||||
zval_copy_ctor(p);
|
||||
}
|
||||
} else {
|
||||
STR_FREE(p->value.str.val);
|
||||
if (inline_change) {
|
||||
STR_FREE(p->value.str.val);
|
||||
}
|
||||
*p = c;
|
||||
}
|
||||
INIT_PZVAL(p);
|
||||
p->refcount = refcount;
|
||||
} else if (p->type == IS_ARRAY) {
|
||||
} else if (p->type == IS_CONSTANT_ARRAY) {
|
||||
SEPARATE_ZVAL(pp);
|
||||
p = *pp;
|
||||
zend_hash_apply(p->value.ht, (int (*)(void *)) zval_update_constant);
|
||||
p->type = IS_ARRAY;
|
||||
zend_hash_apply_with_argument(p->value.ht, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -329,7 +322,7 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n
|
||||
for (i=0; i<param_count; i++) {
|
||||
params_array[i] = ¶ms[i];
|
||||
}
|
||||
ex_retval = call_user_function_ex(function_table, object, function_name, &local_retval_ptr, param_count, params_array, 1);
|
||||
ex_retval = call_user_function_ex(function_table, object, function_name, &local_retval_ptr, param_count, params_array, 1, NULL);
|
||||
if (local_retval_ptr) {
|
||||
COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
|
||||
} else {
|
||||
@@ -340,7 +333,7 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n
|
||||
}
|
||||
|
||||
|
||||
int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation)
|
||||
int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table)
|
||||
{
|
||||
int i;
|
||||
zval **original_return_value;
|
||||
@@ -353,12 +346,32 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
|
||||
*retval_ptr_ptr = NULL;
|
||||
|
||||
if (function_name->type==IS_ARRAY) { /* assume array($obj, $name) couple */
|
||||
zval **tmp_object_ptr, **tmp_real_function_name;
|
||||
|
||||
if (zend_hash_index_find(function_name->value.ht, 0, (void **) &tmp_object_ptr)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (zend_hash_index_find(function_name->value.ht, 1, (void **) &tmp_real_function_name)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
function_name = *tmp_real_function_name;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(tmp_object_ptr);
|
||||
object = *tmp_object_ptr;
|
||||
object->is_ref = 1;
|
||||
}
|
||||
|
||||
if (object) {
|
||||
if (object->type != IS_OBJECT) {
|
||||
return FAILURE;
|
||||
}
|
||||
function_table = &object->value.obj.ce->function_table;
|
||||
}
|
||||
|
||||
if (function_name->type!=IS_STRING) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
original_function_state_ptr = EG(function_state_ptr);
|
||||
zend_str_tolower(function_name->value.str.val, function_name->value.str.len);
|
||||
if (zend_hash_find(function_table, function_name->value.str.val, function_name->value.str.len+1, (void **) &function_state.function)==FAILURE) {
|
||||
@@ -403,8 +416,12 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
|
||||
if (function_state.function->type == ZEND_USER_FUNCTION) {
|
||||
calling_symbol_table = EG(active_symbol_table);
|
||||
ALLOC_HASHTABLE(EG(active_symbol_table));
|
||||
zend_hash_init(EG(active_symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
if (symbol_table) {
|
||||
EG(active_symbol_table) = symbol_table;
|
||||
} else {
|
||||
ALLOC_HASHTABLE(EG(active_symbol_table));
|
||||
zend_hash_init(EG(active_symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
}
|
||||
if (object) {
|
||||
zval *dummy, **this_ptr;
|
||||
|
||||
@@ -420,8 +437,10 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
EG(active_op_array) = (zend_op_array *) function_state.function;
|
||||
original_opline_ptr = EG(opline_ptr);
|
||||
zend_execute(EG(active_op_array) ELS_CC);
|
||||
zend_hash_destroy(EG(active_symbol_table));
|
||||
FREE_HASHTABLE(EG(active_symbol_table));
|
||||
if (!symbol_table) {
|
||||
zend_hash_destroy(EG(active_symbol_table));
|
||||
FREE_HASHTABLE(EG(active_symbol_table));
|
||||
}
|
||||
EG(active_symbol_table) = calling_symbol_table;
|
||||
EG(active_op_array) = original_op_array;
|
||||
EG(return_value_ptr_ptr)=original_return_value;
|
||||
@@ -438,7 +457,7 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC)
|
||||
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name CLS_DC ELS_DC)
|
||||
{
|
||||
zval pv;
|
||||
zend_op_array *new_op_array;
|
||||
@@ -463,7 +482,7 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC)
|
||||
|
||||
original_handle_op_arrays = CG(handle_op_arrays);
|
||||
CG(handle_op_arrays) = 0;
|
||||
new_op_array = compile_string(&pv CLS_CC);
|
||||
new_op_array = compile_string(&pv, string_name CLS_CC);
|
||||
CG(handle_op_arrays) = original_handle_op_arrays;
|
||||
|
||||
if (new_op_array) {
|
||||
@@ -505,57 +524,6 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC)
|
||||
{
|
||||
zval *variable_ptr = *variable_ptr_ptr;
|
||||
zval *value_ptr;
|
||||
|
||||
|
||||
if (!value_ptr_ptr) {
|
||||
zend_error(E_ERROR, "Cannot create references to string offsets nor overloaded objects");
|
||||
return;
|
||||
}
|
||||
|
||||
value_ptr = *value_ptr_ptr;
|
||||
if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) {
|
||||
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
|
||||
/* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */
|
||||
} else if (variable_ptr_ptr != value_ptr_ptr) {
|
||||
variable_ptr->refcount--;
|
||||
if (variable_ptr->refcount==0) {
|
||||
zendi_zval_dtor(*variable_ptr);
|
||||
FREE_ZVAL(variable_ptr);
|
||||
}
|
||||
|
||||
if (!PZVAL_IS_REF(value_ptr)) {
|
||||
/* break it away */
|
||||
value_ptr->refcount--;
|
||||
if (value_ptr->refcount>0) {
|
||||
ALLOC_ZVAL(*value_ptr_ptr);
|
||||
**value_ptr_ptr = *value_ptr;
|
||||
value_ptr = *value_ptr_ptr;
|
||||
zendi_zval_copy_ctor(*value_ptr);
|
||||
}
|
||||
value_ptr->refcount = 1;
|
||||
value_ptr->is_ref = 1;
|
||||
}
|
||||
|
||||
*variable_ptr_ptr = value_ptr;
|
||||
value_ptr->refcount++;
|
||||
} else {
|
||||
if (variable_ptr->refcount>1) { /* we need to break away */
|
||||
SEPARATE_ZVAL(variable_ptr_ptr);
|
||||
}
|
||||
(*variable_ptr_ptr)->is_ref = 1;
|
||||
}
|
||||
|
||||
if (result && (result->op_type != IS_UNUSED)) {
|
||||
Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result);
|
||||
AI_USE_PTR(Ts[result->u.var].var);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if SUPPORT_INTERACTIVE
|
||||
void execute_new_code(CLS_D)
|
||||
@@ -572,37 +540,169 @@ void execute_new_code(CLS_D)
|
||||
CG(active_op_array)->end_op_number = CG(active_op_array)->last;
|
||||
EG(active_op_array) = CG(active_op_array);
|
||||
zend_execute(CG(active_op_array) ELS_CC);
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
CG(active_op_array)->start_op_number = CG(active_op_array)->last_executed_op_number;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* these are a dedicated, optimized, function, and shouldn't be used for any purpose
|
||||
* other than by Zend's executor
|
||||
*/
|
||||
ZEND_API inline void zend_ptr_stack_clear_multiple(ELS_D)
|
||||
ZEND_API void zend_timeout(int dummy)
|
||||
{
|
||||
void **p = EG(argument_stack).top_element-2;
|
||||
int delete_count = (ulong) *p;
|
||||
ELS_FETCH();
|
||||
|
||||
EG(argument_stack).top -= (delete_count+2);
|
||||
while (--delete_count>=0) {
|
||||
zval_ptr_dtor((zval **) --p);
|
||||
/* is there any point in this? we're terminating the request anyway...
|
||||
PLS_FETCH();
|
||||
|
||||
PG(connection_status) |= PHP_CONNECTION_TIMEOUT;
|
||||
*/
|
||||
zend_error(E_ERROR, "Maximum execution time of %d second%s exceeded",
|
||||
EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
|
||||
}
|
||||
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
case WM_REGISTER_ZEND_TIMEOUT:
|
||||
/* wParam is the thread id pointer, lParam is the timeout amount in seconds */
|
||||
if (lParam==0) {
|
||||
KillTimer(timeout_window, wParam);
|
||||
} else {
|
||||
SetTimer(timeout_window, wParam, lParam*1000, NULL);
|
||||
}
|
||||
break;
|
||||
case WM_UNREGISTER_ZEND_TIMEOUT:
|
||||
/* wParam is the thread id pointer */
|
||||
KillTimer(timeout_window, wParam);
|
||||
break;
|
||||
case WM_TIMER: {
|
||||
#ifdef ZTS
|
||||
zend_executor_globals *executor_globals;
|
||||
|
||||
executor_globals = ts_resource_ex(executor_globals_id, &wParam);
|
||||
if (!executor_globals) {
|
||||
/* Thread died before receiving its timeout? */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
KillTimer(timeout_window, wParam);
|
||||
EG(timed_out) = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd,message,wParam,lParam);
|
||||
}
|
||||
EG(argument_stack).top_element = p;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API int zend_ptr_stack_get_arg(int requested_arg, void **data ELS_DC)
|
||||
static unsigned __stdcall timeout_thread_proc(void *pArgs)
|
||||
{
|
||||
void **p = EG(argument_stack).top_element-2;
|
||||
int arg_count = (ulong) *p;
|
||||
MSG message;
|
||||
|
||||
if (requested_arg>arg_count) {
|
||||
return FAILURE;
|
||||
wc.style=0;
|
||||
wc.lpfnWndProc = zend_timeout_WndProc;
|
||||
wc.cbClsExtra=0;
|
||||
wc.cbWndExtra=0;
|
||||
wc.hInstance=NULL;
|
||||
wc.hIcon=NULL;
|
||||
wc.hCursor=NULL;
|
||||
wc.hbrBackground=(HBRUSH)(COLOR_BACKGROUND + 5);
|
||||
wc.lpszMenuName=NULL;
|
||||
wc.lpszClassName = "Zend Timeout Window";
|
||||
if(!RegisterClass(&wc)) {
|
||||
return -1;
|
||||
}
|
||||
*data = (p-arg_count+requested_arg-1);
|
||||
return SUCCESS;
|
||||
timeout_window = CreateWindow(wc.lpszClassName, wc.lpszClassName, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);
|
||||
SetEvent(timeout_thread_event);
|
||||
while (GetMessage(&message, NULL, 0, 0)) {
|
||||
SendMessage(timeout_window, message.message, message.wParam, message.lParam);
|
||||
if (message.message == WM_QUIT) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
DestroyWindow(timeout_window);
|
||||
UnregisterClass(wc.lpszClassName, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void zend_init_timeout_thread()
|
||||
{
|
||||
timeout_thread_event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
_beginthreadex(NULL, 0, timeout_thread_proc, NULL, 0, &timeout_thread_id);
|
||||
WaitForSingleObject(timeout_thread_event, INFINITE);
|
||||
}
|
||||
|
||||
|
||||
void zend_shutdown_timeout_thread()
|
||||
{
|
||||
if (!timeout_thread_initialized) {
|
||||
return;
|
||||
}
|
||||
PostThreadMessage(timeout_thread_id, WM_QUIT, 0, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* This one doesn't exists on QNX */
|
||||
#ifndef SIGPROF
|
||||
#define SIGPROF 27
|
||||
#endif
|
||||
|
||||
void zend_set_timeout(long seconds)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
EG(timeout_seconds) = seconds;
|
||||
#ifdef ZEND_WIN32
|
||||
if (timeout_thread_initialized==0 && InterlockedIncrement(&timeout_thread_initialized)==1) {
|
||||
/* We start up this process-wide thread here and not in zend_startup(), because if Zend
|
||||
* is initialized inside a DllMain(), you're not supposed to start threads from it.
|
||||
*/
|
||||
zend_init_timeout_thread();
|
||||
}
|
||||
PostThreadMessage(timeout_thread_id, WM_REGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) seconds);
|
||||
#else
|
||||
# ifdef HAVE_SETITIMER
|
||||
{
|
||||
struct itimerval t_r; /* timeout requested */
|
||||
sigset_t sigset;
|
||||
|
||||
t_r.it_value.tv_sec = seconds;
|
||||
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
|
||||
|
||||
setitimer(ITIMER_PROF, &t_r, NULL);
|
||||
signal(SIGPROF, zend_timeout);
|
||||
sigemptyset(&sigset);
|
||||
sigaddset(&sigset, SIGPROF);
|
||||
sigprocmask(SIG_UNBLOCK,&sigset,NULL);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void zend_unset_timeout(void)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
PostThreadMessage(timeout_thread_id, WM_UNREGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) 0);
|
||||
#else
|
||||
# ifdef HAVE_SETITIMER
|
||||
{
|
||||
struct itimerval no_timeout;
|
||||
|
||||
no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0;
|
||||
|
||||
setitimer(ITIMER_PROF, &no_timeout, NULL);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
#ifndef _ZEND_EXECUTE_LOCKS_H
|
||||
#define _ZEND_EXECUTE_LOCKS_H
|
||||
#ifndef ZEND_EXECUTE_LOCKS_H
|
||||
#define ZEND_EXECUTE_LOCKS_H
|
||||
|
||||
#define PZVAL_LOCK(z) ((z)->refcount++)
|
||||
#define PZVAL_UNLOCK(z) { ((z)->refcount--); \
|
||||
if (!(z)->refcount) { \
|
||||
(z)->refcount = 1; \
|
||||
(z)->is_ref = 0; \
|
||||
EG(garbage)[EG(garbage_ptr)++] = (z); \
|
||||
if (EG(garbage_ptr) == 4) { \
|
||||
zval_ptr_dtor(&EG(garbage)[0]); \
|
||||
zval_ptr_dtor(&EG(garbage)[1]); \
|
||||
@@ -14,9 +13,10 @@
|
||||
EG(garbage)[1] = EG(garbage)[3]; \
|
||||
EG(garbage_ptr) -= 2; \
|
||||
} \
|
||||
EG(garbage)[EG(garbage_ptr)++] = (z); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
|
||||
|
||||
#endif /* _ZEND_EXECUTE_LOCKS_H */
|
||||
#endif /* ZEND_EXECUTE_LOCKS_H */
|
||||
+27
-15
@@ -65,18 +65,19 @@ int zend_load_extension(char *path)
|
||||
}
|
||||
|
||||
if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) {
|
||||
fprintf(stderr, "%s requires Zend version %s or later\n"
|
||||
"Current version %s, API version %d\n",
|
||||
fprintf(stderr, "%s requires Zend Engine API version %d\n"
|
||||
"The installed Zend Engine API version is %d\n\n",
|
||||
new_extension->name,
|
||||
extension_version_info->required_zend_version,
|
||||
ZEND_VERSION,
|
||||
extension_version_info->zend_extension_api_no,
|
||||
ZEND_EXTENSION_API_NO);
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
} else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) {
|
||||
/* we may be able to allow for downwards compatability in some harmless cases. */
|
||||
fprintf(stderr, "%s is outdated (API version %d, current version %d)\n"
|
||||
"Contact %s at %s for a later version of this module.\n",
|
||||
fprintf(stderr, "%s designed to be used with the Zend Engine API %d is outdated\n"
|
||||
"It requires a more recent version of the Zend Engine\n"
|
||||
"The installed Zend Engine API version is %d\n"
|
||||
"Contact %s at %s for a later version of this module.\n\n",
|
||||
new_extension->name,
|
||||
extension_version_info->zend_extension_api_no,
|
||||
ZEND_EXTENSION_API_NO,
|
||||
@@ -113,13 +114,6 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
|
||||
#if ZEND_EXTENSIONS_SUPPORT
|
||||
zend_extension extension;
|
||||
|
||||
if (new_extension->startup) {
|
||||
if (new_extension->startup(new_extension)!=SUCCESS) {
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
extension = *new_extension;
|
||||
extension.handle = handle;
|
||||
|
||||
@@ -145,14 +139,32 @@ static void zend_extension_shutdown(zend_extension *extension)
|
||||
}
|
||||
|
||||
|
||||
int zend_startup_extensions()
|
||||
static void zend_extension_startup(zend_extension *extension)
|
||||
{
|
||||
if (extension->startup) {
|
||||
if (extension->startup(extension)!=SUCCESS) {
|
||||
DL_UNLOAD(extension->handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int zend_startup_extensions_mechanism()
|
||||
{
|
||||
/* Startup extensions mechanism */
|
||||
zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1);
|
||||
last_resource_number = 0;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int zend_startup_extensions()
|
||||
{
|
||||
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_startup);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void zend_shutdown_extensions()
|
||||
{
|
||||
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_shutdown);
|
||||
@@ -162,7 +174,7 @@ void zend_shutdown_extensions()
|
||||
|
||||
void zend_extension_dtor(zend_extension *extension)
|
||||
{
|
||||
#if ZEND_EXTENSIONS_SUPPORT
|
||||
#if ZEND_EXTENSIONS_SUPPORT && !ZEND_DEBUG
|
||||
if (extension->handle) {
|
||||
DL_UNLOAD(extension->handle);
|
||||
}
|
||||
|
||||
+6
-11
@@ -18,12 +18,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_EXTENSIONS_H
|
||||
#define _ZEND_EXTENSIONS_H
|
||||
#ifndef ZEND_EXTENSIONS_H
|
||||
#define ZEND_EXTENSIONS_H
|
||||
|
||||
#include "zend_compile.h"
|
||||
|
||||
#define ZEND_EXTENSION_API_NO 20000521
|
||||
#define ZEND_EXTENSION_API_NO 20001002
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
@@ -77,15 +77,9 @@ ZEND_API void zend_extension_dispatch_message(int message, void *arg);
|
||||
|
||||
#define ZEND_EXTMSG_NEW_EXTENSION 1
|
||||
|
||||
#ifdef ZTS
|
||||
#define ZTS_V 1
|
||||
#else
|
||||
#define ZTS_V 0
|
||||
#endif
|
||||
|
||||
|
||||
#define ZEND_EXTENSION() \
|
||||
ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, "0.90", ZTS_V, ZEND_DEBUG }
|
||||
ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, ZEND_VERSION, ZTS_V, ZEND_DEBUG }
|
||||
|
||||
#define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
|
||||
|
||||
@@ -97,7 +91,8 @@ ZEND_API int zend_load_extension(char *path);
|
||||
ZEND_API int zend_load_extensions(char **extension_paths);
|
||||
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
|
||||
void zend_append_version_info(zend_extension *extension);
|
||||
int zend_startup_extensions_mechanism(void);
|
||||
int zend_startup_extensions(void);
|
||||
void zend_shutdown_extensions(void);
|
||||
|
||||
#endif /* _ZEND_EXTENSIONS_H */
|
||||
#endif /* ZEND_EXTENSIONS_H */
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_FAST_CACHE_H
|
||||
#define _ZEND_FAST_CACHE_H
|
||||
#ifndef ZEND_FAST_CACHE_H
|
||||
#define ZEND_FAST_CACHE_H
|
||||
|
||||
#ifndef ZEND_ENABLE_FAST_CACHE
|
||||
# if ZEND_DEBUG
|
||||
@@ -130,7 +130,7 @@ typedef struct _zend_fast_cache_list_entry {
|
||||
#define FREE_HASHTABLE_REL(ht) \
|
||||
ZEND_FAST_FREE_REL(ht, HASHTABLE_CACHE_LIST)
|
||||
|
||||
#endif /* _ZEND_FAST_CACHE_H */
|
||||
#endif /* ZEND_FAST_CACHE_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
+16
-11
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _T_GLOBALS_H
|
||||
#define _T_GLOBALS_H
|
||||
#ifndef ZEND_GLOBALS_H
|
||||
#define ZEND_GLOBALS_H
|
||||
|
||||
|
||||
#include <setjmp.h>
|
||||
@@ -54,7 +54,6 @@ END_EXTERN_C()
|
||||
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend_execute.h"
|
||||
|
||||
/* excpt.h on Digital Unix 4.0 defines function_table */
|
||||
#undef function_table
|
||||
@@ -92,9 +91,7 @@ struct _zend_compiler_globals {
|
||||
HashTable *function_table; /* function symbol table */
|
||||
HashTable *class_table; /* class table */
|
||||
|
||||
HashTable used_files; /* files already included using 'use' */
|
||||
|
||||
zend_llist filenames_list;
|
||||
HashTable filenames_table;
|
||||
|
||||
zend_bool in_compilation;
|
||||
zend_bool short_tags;
|
||||
@@ -134,7 +131,6 @@ struct _zend_executor_globals {
|
||||
|
||||
/* for global return() support */
|
||||
zval *global_return_value_ptr;
|
||||
zval global_return_value;
|
||||
|
||||
/* symbol table cache */
|
||||
HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
|
||||
@@ -151,9 +147,9 @@ struct _zend_executor_globals {
|
||||
jmp_buf bailout;
|
||||
|
||||
int error_reporting;
|
||||
int orig_error_reporting;
|
||||
|
||||
zend_op_array *active_op_array;
|
||||
zend_op_array *main_op_array;
|
||||
|
||||
HashTable *function_table; /* function symbol table */
|
||||
HashTable *class_table; /* class table */
|
||||
@@ -168,6 +164,10 @@ struct _zend_executor_globals {
|
||||
/* for extended information support */
|
||||
zend_bool no_extensions;
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
zend_bool timed_out;
|
||||
#endif
|
||||
|
||||
HashTable regular_list;
|
||||
HashTable persistent_list;
|
||||
|
||||
@@ -180,6 +180,12 @@ struct _zend_executor_globals {
|
||||
int garbage_ptr;
|
||||
|
||||
zval *user_error_handler;
|
||||
zend_ptr_stack user_error_handlers;
|
||||
|
||||
/* timeout support */
|
||||
int timeout_seconds;
|
||||
|
||||
int lambda_count;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
#if SUPPORT_INTERACTIVE
|
||||
@@ -192,7 +198,7 @@ struct _zend_alloc_globals {
|
||||
zend_mem_header *head; /* standard list */
|
||||
zend_mem_header *phead; /* persistent list */
|
||||
void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
|
||||
unsigned char cache_count[MAX_CACHED_MEMORY];
|
||||
unsigned int cache_count[MAX_CACHED_MEMORY];
|
||||
void *fast_cache_list_head[MAX_FAST_CACHE_TYPES];
|
||||
|
||||
#if ZEND_DEBUG
|
||||
@@ -207,5 +213,4 @@ struct _zend_alloc_globals {
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#endif /* _T_GLOBALS_H */
|
||||
#endif /* ZEND_GLOBALS_H */
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_GLOBALS_MACROS_H
|
||||
#define _ZEND_GLOBALS_MACROS_H
|
||||
#ifndef ZEND_GLOBALS_MACROS_H
|
||||
#define ZEND_GLOBALS_MACROS_H
|
||||
|
||||
typedef struct _zend_compiler_globals zend_compiler_globals;
|
||||
typedef struct _zend_executor_globals zend_executor_globals;
|
||||
@@ -85,5 +85,5 @@ extern ZEND_API zend_executor_globals executor_globals;
|
||||
extern ZEND_API zend_alloc_globals alloc_globals;
|
||||
#endif
|
||||
|
||||
#endif /* _ZEND_GLOBALS_MACROS_H */
|
||||
#endif /* ZEND_GLOBALS_MACROS_H */
|
||||
|
||||
+165
-27
@@ -78,24 +78,28 @@
|
||||
}
|
||||
|
||||
#if ZEND_DEBUG
|
||||
#define HT_OK 0
|
||||
#define HT_IS_DESTROYING 1
|
||||
#define HT_DESTROYED 2
|
||||
#define HT_CLEANING 3
|
||||
#define HT_OK 0
|
||||
#define HT_CLEANING 3
|
||||
|
||||
static void _zend_is_inconsistent(HashTable *ht, char *file, int line)
|
||||
{
|
||||
if (ht->inconsistent==HT_OK) {
|
||||
return;
|
||||
}
|
||||
switch (ht->inconsistent) {
|
||||
case HT_IS_DESTROYING:
|
||||
zend_error(E_CORE_ERROR, "ht=%08x is destroying in %s:%d", ht, file, line);
|
||||
break;
|
||||
case HT_DESTROYED:
|
||||
zend_error(E_CORE_ERROR, "ht=%08x is already destroyed in %s:%d", ht, file, line);
|
||||
break;
|
||||
case HT_CLEANING:
|
||||
zend_error(E_CORE_ERROR, "ht=%08x is cleaning %s:%d", ht, file, line);
|
||||
break;
|
||||
case HT_IS_DESTROYING:
|
||||
zend_output_debug_string(1, "%s(%d) : ht=0x%08x is being destroyed", file, line, ht);
|
||||
break;
|
||||
case HT_DESTROYED:
|
||||
zend_output_debug_string(1, "%s(%d) : ht=0x%08x is already destroyed", file, line, ht);
|
||||
break;
|
||||
case HT_CLEANING:
|
||||
zend_output_debug_string(1, "%s(%d) : ht=0x%08x is being cleaned", file, line, ht);
|
||||
break;
|
||||
}
|
||||
zend_bailout();
|
||||
}
|
||||
#define IS_CONSISTENT(a) _zend_is_inconsistent(a,__FILE__,__LINE__);
|
||||
#define SET_INCONSISTENT(n) ht->inconsistent = n;
|
||||
@@ -104,9 +108,23 @@ static void _zend_is_inconsistent(HashTable *ht, char *file, int line)
|
||||
#define SET_INCONSISTENT(n)
|
||||
#endif
|
||||
|
||||
#define HASH_APPLY_BEGIN(ht) \
|
||||
if ((ht)->bApplyProtection) { \
|
||||
if ((ht)->nApplyCount>=3) { \
|
||||
zend_error(E_WARNING, "Nesting level too deep - recursive dependency?"); \
|
||||
return; \
|
||||
} \
|
||||
(ht)->nApplyCount++; \
|
||||
}
|
||||
|
||||
#define HASH_APPLY_END(ht) \
|
||||
(ht)->nApplyCount--;
|
||||
|
||||
|
||||
/* Generated on an Octa-ALPHA 300MHz CPU & 2.5GB RAM monster */
|
||||
static uint PrimeNumbers[] =
|
||||
{5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793, 2097397, 4194103, 8388857, 16777447, 33554201, 67108961, 134217487, 268435697, 536870683, 1073741621, 2147483399};
|
||||
{5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793, 2097397, 4194103, 8388857, 16777447, 33554201, 67108961, 134217487, 268435697, 536870683, 1073741621, 2147483399};
|
||||
static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(uint);
|
||||
|
||||
#define ZEND_HASH_IF_FULL_DO_RESIZE(ht) \
|
||||
if ((ht)->nNumOfElements > (ht)->nTableSize) { \
|
||||
@@ -115,7 +133,6 @@ static uint PrimeNumbers[] =
|
||||
|
||||
static int zend_hash_do_resize(HashTable *ht);
|
||||
|
||||
static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(ulong);
|
||||
|
||||
ZEND_API ulong hashpjw(char *arKey, uint nKeyLength)
|
||||
{
|
||||
@@ -200,9 +217,28 @@ ZEND_API int zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction
|
||||
ht->nNextFreeElement = 0;
|
||||
ht->pInternalPointer = NULL;
|
||||
ht->persistent = persistent;
|
||||
ht->nApplyCount = 0;
|
||||
ht->bApplyProtection = 1;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent, zend_bool bApplyProtection)
|
||||
{
|
||||
int retval = zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent);
|
||||
|
||||
ht->bApplyProtection = bApplyProtection;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProtection)
|
||||
{
|
||||
ht->bApplyProtection = bApplyProtection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API int zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag)
|
||||
{
|
||||
ulong h;
|
||||
@@ -650,6 +686,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
HASH_APPLY_BEGIN(ht);
|
||||
p = ht->pListHead;
|
||||
while (p != NULL) {
|
||||
if (apply_func(p->pData)) {
|
||||
@@ -658,6 +695,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
|
||||
p = p->pListNext;
|
||||
}
|
||||
}
|
||||
HASH_APPLY_END(ht);
|
||||
}
|
||||
|
||||
|
||||
@@ -667,6 +705,7 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
HASH_APPLY_BEGIN(ht);
|
||||
p = ht->pListHead;
|
||||
while (p != NULL) {
|
||||
if (apply_func(p->pData, argument)) {
|
||||
@@ -675,6 +714,7 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
|
||||
p = p->pListNext;
|
||||
}
|
||||
}
|
||||
HASH_APPLY_END(ht);
|
||||
}
|
||||
|
||||
|
||||
@@ -686,8 +726,9 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, int (*destruct)(void
|
||||
|
||||
IS_CONSISTENT(ht);
|
||||
|
||||
va_start(args, num_args);
|
||||
HASH_APPLY_BEGIN(ht);
|
||||
|
||||
va_start(args, num_args);
|
||||
p = ht->pListHead;
|
||||
while (p != NULL) {
|
||||
hash_key.arKey = p->arKey;
|
||||
@@ -699,8 +740,9 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, int (*destruct)(void
|
||||
p = p->pListNext;
|
||||
}
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
|
||||
HASH_APPLY_END(ht);
|
||||
}
|
||||
|
||||
|
||||
@@ -708,21 +750,21 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, int (*destruct)(void
|
||||
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size)
|
||||
{
|
||||
Bucket *p;
|
||||
void *new_entry;
|
||||
|
||||
IS_CONSISTENT(source);
|
||||
IS_CONSISTENT(target);
|
||||
|
||||
p = source->pListHead;
|
||||
while (p) {
|
||||
memcpy(tmp, p->pData, size);
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(tmp);
|
||||
}
|
||||
if (p->nKeyLength) {
|
||||
zend_hash_update(target, p->arKey, p->nKeyLength, tmp, size, NULL);
|
||||
zend_hash_update(target, p->arKey, p->nKeyLength, p->pData, size, &new_entry);
|
||||
} else {
|
||||
zend_hash_index_update(target, p->h, tmp, size, NULL);
|
||||
zend_hash_index_update(target, p->h, p->pData, size, &new_entry);
|
||||
}
|
||||
if (pCopyConstructor) {
|
||||
pCopyConstructor(new_entry);
|
||||
}
|
||||
p = p->pListNext;
|
||||
}
|
||||
target->pInternalPointer = target->pListHead;
|
||||
@@ -740,13 +782,12 @@ ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_fu
|
||||
|
||||
p = source->pListHead;
|
||||
while (p) {
|
||||
memcpy(tmp, p->pData, size);
|
||||
if (p->nKeyLength>0) {
|
||||
if (zend_hash_add_or_update(target, p->arKey, p->nKeyLength, tmp, size, &t, mode)==SUCCESS && pCopyConstructor) {
|
||||
if (zend_hash_add_or_update(target, p->arKey, p->nKeyLength, p->pData, size, &t, mode)==SUCCESS && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
} else {
|
||||
if ((mode==HASH_UPDATE || !zend_hash_index_exists(target, p->h)) && zend_hash_index_update(target, p->h, tmp, size, &t)==SUCCESS && pCopyConstructor) {
|
||||
if ((mode==HASH_UPDATE || !zend_hash_index_exists(target, p->h)) && zend_hash_index_update(target, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
}
|
||||
@@ -756,6 +797,38 @@ ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_fu
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new))
|
||||
{
|
||||
Bucket *p;
|
||||
void *t;
|
||||
void *pOrig;
|
||||
|
||||
IS_CONSISTENT(source);
|
||||
IS_CONSISTENT(target);
|
||||
|
||||
p = source->pListHead;
|
||||
while (p) {
|
||||
if (p->nKeyLength>0) {
|
||||
if (zend_hash_find(target, p->arKey, p->nKeyLength, &pOrig)==FAILURE
|
||||
|| pReplaceOrig(pOrig, p->pData)) {
|
||||
if (zend_hash_update(target, p->arKey, p->nKeyLength, p->pData, size, &t)==SUCCESS && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (zend_hash_index_find(target, p->h, &pOrig)==FAILURE
|
||||
|| pReplaceOrig(pOrig, p->pData)) {
|
||||
if (zend_hash_index_update(target, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) {
|
||||
pCopyConstructor(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
p = p->pListNext;
|
||||
}
|
||||
target->pInternalPointer = target->pListHead;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API ulong zend_get_hash_value(HashTable *ht, char *arKey, uint nKeyLength)
|
||||
{
|
||||
IS_CONSISTENT(ht);
|
||||
@@ -1064,6 +1137,71 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered)
|
||||
{
|
||||
Bucket *p1, *p2;
|
||||
int result;
|
||||
void *pData2;
|
||||
|
||||
IS_CONSISTENT(ht1);
|
||||
IS_CONSISTENT(ht2);
|
||||
|
||||
result = ht1->nNumOfElements - ht2->nNumOfElements;
|
||||
if (result!=0) {
|
||||
return result;
|
||||
}
|
||||
|
||||
p1 = ht1->pListHead;
|
||||
if (ordered) {
|
||||
p2 = ht2->pListHead;
|
||||
}
|
||||
|
||||
while (p1) {
|
||||
if (ordered && !p2) {
|
||||
return 1; /* That's not supposed to happen */
|
||||
}
|
||||
if (ordered) {
|
||||
if (p1->nKeyLength==0 && p2->nKeyLength==0) { /* numeric indices */
|
||||
result = p1->h - p2->h;
|
||||
if (result!=0) {
|
||||
return result;
|
||||
}
|
||||
} else { /* string indices */
|
||||
result = p1->nKeyLength - p2->nKeyLength;
|
||||
if (result!=0) {
|
||||
return result;
|
||||
}
|
||||
result = memcmp(p1->arKey, p2->arKey, p1->nKeyLength);
|
||||
if (result!=0) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
pData2 = p2->pData;
|
||||
} else {
|
||||
if (p1->nKeyLength==0) { /* numeric index */
|
||||
if (zend_hash_index_find(ht2, p1->h, &pData2)==FAILURE) {
|
||||
return 1;
|
||||
}
|
||||
} else { /* string index */
|
||||
if (zend_hash_find(ht2, p1->arKey, p1->nKeyLength, &pData2)==FAILURE) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
result = compar(p1->pData, pData2);
|
||||
if (result!=0) {
|
||||
return result;
|
||||
}
|
||||
p1 = p1->pListNext;
|
||||
if (ordered) {
|
||||
p2 = p2->pListNext;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_hash_minmax(HashTable *ht, int (*compar) (const void *, const void *), int flag, void **pData)
|
||||
{
|
||||
Bucket *p,*res;
|
||||
@@ -1106,7 +1244,7 @@ void zend_hash_display_pListTail(HashTable *ht)
|
||||
|
||||
p = ht->pListTail;
|
||||
while (p != NULL) {
|
||||
zend_printf("pListTail has key %s\n", p->arKey);
|
||||
zend_output_debug_string(0, "pListTail has key %s\n", p->arKey);
|
||||
p = p->pListLast;
|
||||
}
|
||||
}
|
||||
@@ -1119,14 +1257,14 @@ void zend_hash_display(HashTable *ht)
|
||||
for (i = 0; i < ht->nTableSize; i++) {
|
||||
p = ht->arBuckets[i];
|
||||
while (p != NULL) {
|
||||
zend_printf("%s <==> 0x%X\n", p->arKey, p->h);
|
||||
zend_output_debug_string(0, "%s <==> 0x%X\n", p->arKey, p->h);
|
||||
p = p->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
p = ht->pListTail;
|
||||
while (p != NULL) {
|
||||
zend_printf("%s <==> 0x%X\n", p->arKey, p->h);
|
||||
zend_output_debug_string(0, "%s <==> 0x%X\n", p->arKey, p->h);
|
||||
p = p->pListLast;
|
||||
}
|
||||
}
|
||||
|
||||
+13
-6
@@ -17,8 +17,8 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef _HASH_
|
||||
#define _HASH_
|
||||
#ifndef ZEND_HASH_H
|
||||
#define ZEND_HASH_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -41,7 +41,7 @@ typedef int (*apply_func_arg_t)(void *pDest, void *argument);
|
||||
typedef ulong (*hash_func_t)(char *arKey, uint nKeyLength);
|
||||
typedef void (*copy_ctor_func_t)(void *pElement);
|
||||
|
||||
struct hashtable;
|
||||
struct _hashtable;
|
||||
|
||||
typedef struct bucket {
|
||||
ulong h; /* Used for numeric indexing */
|
||||
@@ -55,7 +55,7 @@ typedef struct bucket {
|
||||
char arKey[1]; /* Must be last element */
|
||||
} Bucket;
|
||||
|
||||
typedef struct hashtable {
|
||||
typedef struct _hashtable {
|
||||
uint nTableSize;
|
||||
uint nHashSizeIndex;
|
||||
uint nNumOfElements;
|
||||
@@ -66,7 +66,9 @@ typedef struct hashtable {
|
||||
Bucket *pListTail;
|
||||
Bucket **arBuckets;
|
||||
dtor_func_t pDestructor;
|
||||
unsigned char persistent;
|
||||
zend_bool persistent;
|
||||
unsigned char nApplyCount;
|
||||
zend_bool bApplyProtection;
|
||||
#if ZEND_DEBUG
|
||||
int inconsistent;
|
||||
#endif
|
||||
@@ -78,6 +80,7 @@ BEGIN_EXTERN_C()
|
||||
|
||||
/* startup/shutdown */
|
||||
ZEND_API int zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent);
|
||||
ZEND_API int zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent, zend_bool bApplyProtection);
|
||||
ZEND_API void zend_hash_destroy(HashTable *ht);
|
||||
|
||||
ZEND_API void zend_hash_clean(HashTable *ht);
|
||||
@@ -108,6 +111,8 @@ typedef struct _zend_hash_key {
|
||||
} zend_hash_key;
|
||||
|
||||
|
||||
typedef int (*apply_func_args_t)(void *pDest, int num_args, va_list args, zend_hash_key *hash_key);
|
||||
|
||||
#define ZEND_STD_HASH_APPLIER \
|
||||
int (*)(void *element, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
|
||||
@@ -165,7 +170,9 @@ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos
|
||||
/* Copying, merging and sorting */
|
||||
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size);
|
||||
ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite);
|
||||
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new));
|
||||
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber);
|
||||
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered);
|
||||
ZEND_API int zend_hash_minmax(HashTable *ht, int (*compar)(const void *, const void *), int flag, void **pData);
|
||||
|
||||
ZEND_API int zend_hash_num_elements(HashTable *ht);
|
||||
@@ -189,4 +196,4 @@ END_EXTERN_C()
|
||||
zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent)
|
||||
|
||||
|
||||
#endif /* _HASH_ */
|
||||
#endif /* ZEND_HASH_H */
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _HIGHLIGHT_H
|
||||
#define _HIGHLIGHT_H
|
||||
#ifndef ZEND_HIGHLIGHT_H
|
||||
#define ZEND_HIGHLIGHT_H
|
||||
|
||||
#define HL_COMMENT_COLOR "#FF8000" /* orange */
|
||||
#define HL_DEFAULT_COLOR "#0000BB" /* blue */
|
||||
@@ -41,7 +41,7 @@ typedef struct _zend_syntax_highlighter_ini {
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
||||
int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
||||
int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
||||
int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name);
|
||||
ZEND_API void zend_html_putc(char c);
|
||||
ZEND_API void zend_html_puts(char *s, uint len);
|
||||
END_EXTERN_C()
|
||||
|
||||
+3
-3
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_INDENT_H
|
||||
#define _ZEND_INDENT_H
|
||||
#ifndef ZEND_INDENT_H
|
||||
#define ZEND_INDENT_H
|
||||
|
||||
ZEND_API void zend_indent(void);
|
||||
|
||||
#endif /* _ZEND_INDENT_H */
|
||||
#endif /* ZEND_INDENT_H */
|
||||
+20
-4
@@ -215,8 +215,9 @@ ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resou
|
||||
|
||||
resource = zend_list_find(id, &actual_resource_type);
|
||||
if (!resource) {
|
||||
if (resource_type_name)
|
||||
if (resource_type_name) {
|
||||
zend_error(E_WARNING, "%d is not a valid %s resource", id, resource_type_name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -232,8 +233,9 @@ ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resou
|
||||
}
|
||||
va_end(resource_types);
|
||||
|
||||
if (resource_type_name)
|
||||
if (resource_type_name) {
|
||||
zend_error(E_WARNING, "Supplied resource is not a valid %s resource", resource_type_name);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -287,7 +289,7 @@ int zend_init_rsrc_list(ELS_D)
|
||||
|
||||
int zend_init_rsrc_plist(ELS_D)
|
||||
{
|
||||
return zend_hash_init(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1);
|
||||
return zend_hash_init_ex(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -347,6 +349,7 @@ ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void
|
||||
lde.module_number = module_number;
|
||||
lde.resource_id = list_destructors.nNextFreeElement;
|
||||
lde.type = ZEND_RESOURCE_LIST_TYPE_STD;
|
||||
lde.type_name = NULL;
|
||||
|
||||
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
|
||||
return FAILURE;
|
||||
@@ -355,7 +358,7 @@ ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, int module_number)
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number)
|
||||
{
|
||||
zend_rsrc_list_dtors_entry lde;
|
||||
|
||||
@@ -370,6 +373,7 @@ ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_fu
|
||||
lde.module_number = module_number;
|
||||
lde.resource_id = list_destructors.nNextFreeElement;
|
||||
lde.type = ZEND_RESOURCE_LIST_TYPE_EX;
|
||||
lde.type_name = type_name;
|
||||
|
||||
if (zend_hash_next_index_insert(&list_destructors,(void *) &lde, sizeof(zend_rsrc_list_dtors_entry),NULL)==FAILURE) {
|
||||
return FAILURE;
|
||||
@@ -390,6 +394,18 @@ void zend_destroy_rsrc_list_dtors()
|
||||
}
|
||||
|
||||
|
||||
char *zend_rsrc_list_get_rsrc_type(int resource)
|
||||
{
|
||||
zend_rsrc_list_dtors_entry *lde;
|
||||
|
||||
if (zend_hash_index_find(&list_destructors, resource, (void **) &lde)==SUCCESS) {
|
||||
return lde->type_name;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+10
-5
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _LIST_H
|
||||
#define _LIST_H
|
||||
#ifndef ZEND_LIST_H
|
||||
#define ZEND_LIST_H
|
||||
|
||||
#include "zend_hash.h"
|
||||
#include "zend_globals.h"
|
||||
@@ -35,7 +35,8 @@ typedef struct _zend_rsrc_list_entry {
|
||||
zend_bool valid;
|
||||
} zend_rsrc_list_entry;
|
||||
|
||||
typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *le);
|
||||
typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *rsrc);
|
||||
#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_rsrc_list_entry *rsrc)
|
||||
|
||||
typedef struct _zend_rsrc_list_dtors_entry {
|
||||
/* old style destructors */
|
||||
@@ -46,6 +47,8 @@ typedef struct _zend_rsrc_list_dtors_entry {
|
||||
rsrc_dtor_func_t list_dtor_ex;
|
||||
rsrc_dtor_func_t plist_dtor_ex;
|
||||
|
||||
char *type_name;
|
||||
|
||||
int module_number;
|
||||
int resource_id;
|
||||
unsigned char type;
|
||||
@@ -54,7 +57,7 @@ typedef struct _zend_rsrc_list_dtors_entry {
|
||||
|
||||
#define register_list_destructors(ld, pld) zend_register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number);
|
||||
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number);
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, int module_number);
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number);
|
||||
|
||||
enum list_entry_type {
|
||||
LE_DB=1000
|
||||
@@ -83,11 +86,13 @@ ZEND_API void *zend_plist_find(int id, int *type);
|
||||
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type);
|
||||
ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
|
||||
|
||||
ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource);
|
||||
|
||||
extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
|
||||
|
||||
#define ZEND_VERIFY_RESOURCE(rsrc) \
|
||||
if (!rsrc) { \
|
||||
RETURN_FALSE; \
|
||||
RETURN_NULL(); \
|
||||
}
|
||||
|
||||
#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \
|
||||
|
||||
+6
-5
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_LLIST_H
|
||||
#define _ZEND_LLIST_H
|
||||
#ifndef ZEND_LLIST_H
|
||||
#define ZEND_LLIST_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -41,6 +41,7 @@ typedef struct _zend_llist {
|
||||
typedef int (*llist_compare_func_t)(const zend_llist_element *, const zend_llist_element *);
|
||||
typedef void(*llist_apply_with_arg_func_t)(void *data, void *arg);
|
||||
typedef void(*llist_apply_with_args_func_t)(void *data, int num_args, va_list args);
|
||||
typedef void (*llist_apply_func_t)(void *);
|
||||
|
||||
typedef zend_llist_element* zend_llist_position;
|
||||
|
||||
@@ -53,8 +54,8 @@ ZEND_API void zend_llist_destroy(zend_llist *l);
|
||||
ZEND_API void zend_llist_clean(zend_llist *l);
|
||||
ZEND_API void zend_llist_remove_tail(zend_llist *l);
|
||||
ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src);
|
||||
ZEND_API void zend_llist_apply(zend_llist *l, void (*func)(void *data));
|
||||
ZEND_API void zend_llist_apply_with_argument(zend_llist *l, void (*func)(void *data, void *arg), void *arg);
|
||||
ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t);
|
||||
ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t, void *arg);
|
||||
ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...);
|
||||
ZEND_API int zend_llist_count(zend_llist *l);
|
||||
ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func);
|
||||
@@ -72,4 +73,4 @@ ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* _ZEND_LLIST_H */
|
||||
#endif /* ZEND_LLIST_H */
|
||||
+3
-4
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MODULES_H
|
||||
#define _MODULES_H
|
||||
#ifndef MODULES_H
|
||||
#define MODULES_H
|
||||
|
||||
#define INIT_FUNC_ARGS int type, int module_number ELS_DC
|
||||
#define INIT_FUNC_ARGS_PASSTHRU type, module_number ELS_CC
|
||||
@@ -37,8 +37,7 @@ extern unsigned char second_arg_allow_ref[];
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#define ZEND_MODULE_API_NO 20000401
|
||||
|
||||
#define ZEND_MODULE_API_NO 20000809
|
||||
#ifdef ZTS
|
||||
#define USING_ZTS 1
|
||||
#else
|
||||
|
||||
+5
-13
@@ -50,7 +50,7 @@ static void op_array_alloc_ops(zend_op_array *op_array)
|
||||
|
||||
|
||||
|
||||
void init_op_array(zend_op_array *op_array, int type, int initial_ops_size)
|
||||
void init_op_array(zend_op_array *op_array, int type, int initial_ops_size CLS_DC)
|
||||
{
|
||||
op_array->type = type;
|
||||
#if SUPPORT_INTERACTIVE
|
||||
@@ -78,6 +78,7 @@ void init_op_array(zend_op_array *op_array, int type, int initial_ops_size)
|
||||
op_array->T = 0;
|
||||
|
||||
op_array->function_name = NULL;
|
||||
op_array->filename = zend_get_compiled_filename(CLS_C);
|
||||
|
||||
op_array->arg_types = NULL;
|
||||
|
||||
@@ -188,7 +189,6 @@ void init_op(zend_op *op CLS_DC)
|
||||
{
|
||||
memset(&op->result, 0, sizeof(znode));
|
||||
op->lineno = CG(zend_lineno);
|
||||
op->filename = zend_get_compiled_filename(CLS_C);
|
||||
op->result.op_type = IS_UNUSED;
|
||||
op->extended_value = 0;
|
||||
memset(&op->op1, 0, sizeof(znode));
|
||||
@@ -252,7 +252,6 @@ static void zend_update_extended_info(zend_op_array *op_array CLS_DC)
|
||||
continue;
|
||||
}
|
||||
opline->lineno = (opline+1)->lineno;
|
||||
opline->filename = (opline+1)->filename;
|
||||
} else {
|
||||
opline->opcode = ZEND_NOP;
|
||||
}
|
||||
@@ -264,7 +263,6 @@ static void zend_update_extended_info(zend_op_array *op_array CLS_DC)
|
||||
opline->op1.op_type = IS_UNUSED;
|
||||
opline->op2.op_type = IS_UNUSED;
|
||||
if (op_array->last>0) {
|
||||
opline->filename = op_array->opcodes[op_array->last-2].filename;
|
||||
opline->lineno= op_array->opcodes[op_array->last-2].lineno;
|
||||
}
|
||||
}
|
||||
@@ -281,6 +279,7 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a
|
||||
|
||||
int pass_two(zend_op_array *op_array)
|
||||
{
|
||||
zend_op *opline=op_array->opcodes, *end=opline+op_array->last;
|
||||
CLS_FETCH();
|
||||
|
||||
if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) {
|
||||
@@ -292,15 +291,6 @@ int pass_two(zend_op_array *op_array)
|
||||
if (CG(handle_op_arrays)) {
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_handler, op_array);
|
||||
}
|
||||
op_array->done_pass_two = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void pass_include_eval(zend_op_array *op_array)
|
||||
{
|
||||
zend_op *opline=op_array->opcodes, *end=opline+op_array->last;
|
||||
|
||||
while (opline<end) {
|
||||
if (opline->op1.op_type==IS_CONST) {
|
||||
opline->op1.u.constant.is_ref = 1;
|
||||
@@ -312,6 +302,8 @@ ZEND_API void pass_include_eval(zend_op_array *op_array)
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
op_array->done_pass_two = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+241
-93
@@ -32,23 +32,55 @@
|
||||
#include "zend_list.h"
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
#ifndef HAVE_FINITE
|
||||
#ifndef finite /* in case it's already a macro */
|
||||
#define finite(a) isfinite(a) /* HPUX 11 only has isfinite() */
|
||||
#endif
|
||||
#else
|
||||
#if HAVE_IEEEFP_H
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define NORMALIZE_BOOL(n) \
|
||||
((n) ? (((n)>0) ? 1 : -1) : 0)
|
||||
|
||||
#if WITH_BCMATH
|
||||
#include "ext/bcmath/number.h"
|
||||
#endif
|
||||
|
||||
ZEND_API double zend_string_to_double(const char *number, zend_uint length)
|
||||
{
|
||||
double divisor = 10.0;
|
||||
double result = 0.0;
|
||||
double exponent;
|
||||
const char *end = number+length;
|
||||
const char *digit = number;
|
||||
|
||||
if (!length) {
|
||||
return result;
|
||||
}
|
||||
|
||||
while (digit < end) {
|
||||
if ((*digit <= '9' && *digit >= '0')) {
|
||||
result *= 10;
|
||||
result += *digit - '0';
|
||||
} else if (*digit == '.') {
|
||||
digit++;
|
||||
break;
|
||||
} else if (toupper(*digit) == 'E') {
|
||||
exponent = (double) atoi(digit+1);
|
||||
result *= pow(10.0, exponent);
|
||||
return result;
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
digit++;
|
||||
}
|
||||
|
||||
while (digit < end) {
|
||||
if ((*digit <= '9' && *digit >= '0')) {
|
||||
result += (*digit - '0') / divisor;
|
||||
divisor *= 10;
|
||||
} else if (toupper(*digit) == 'E') {
|
||||
exponent = (double) atoi(digit+1);
|
||||
result *= pow(10.0, exponent);
|
||||
return result;
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
digit++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void convert_scalar_to_number(zval *op)
|
||||
{
|
||||
@@ -456,7 +488,51 @@ ZEND_API void convert_to_object(zval *op)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void multi_convert_to_long_ex(int argc, ...)
|
||||
{
|
||||
zval **arg;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, argc);
|
||||
|
||||
while (argc--) {
|
||||
arg = va_arg(ap, zval **);
|
||||
convert_to_long_ex(arg);
|
||||
}
|
||||
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
ZEND_API void multi_convert_to_double_ex(int argc, ...)
|
||||
{
|
||||
zval **arg;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, argc);
|
||||
|
||||
while (argc--) {
|
||||
arg = va_arg(ap, zval **);
|
||||
convert_to_double_ex(arg);
|
||||
}
|
||||
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
ZEND_API void multi_convert_to_string_ex(int argc, ...)
|
||||
{
|
||||
zval **arg;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, argc);
|
||||
|
||||
while (argc--) {
|
||||
arg = va_arg(ap, zval **);
|
||||
convert_to_string_ex(arg);
|
||||
}
|
||||
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
ZEND_API int add_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
@@ -994,16 +1070,30 @@ ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2)
|
||||
convert_to_double(&op1_copy);
|
||||
convert_to_double(&op2_copy);
|
||||
|
||||
result->value.lval = NORMALIZE_BOOL(op1_copy.value.dval-op2_copy.value.dval);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(op1_copy.value.dval-op2_copy.value.dval);
|
||||
result->type = IS_LONG;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
if ((op1->type == IS_NULL && op2->type == IS_STRING)
|
||||
|| (op2->type == IS_NULL && op1->type == IS_STRING)) {
|
||||
if (op1->type == IS_NULL) {
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = zend_binary_strcmp("", 0, op2->value.str.val, op2->value.str.len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = zend_binary_strcmp(op1->value.str.val, op1->value.str.len, "", 0);
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
if (op1->type == IS_STRING && op2->type == IS_STRING) {
|
||||
zendi_smart_strcmp(result, op1, op2);
|
||||
return SUCCESS;
|
||||
@@ -1014,7 +1104,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
|
||||
zendi_convert_to_boolean(op1, op1_copy, result);
|
||||
zendi_convert_to_boolean(op2, op2_copy, result);
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1023,25 +1113,68 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
|
||||
|
||||
if (op1->type == IS_LONG && op2->type == IS_LONG) {
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
|
||||
return SUCCESS;
|
||||
}
|
||||
if ((op1->type == IS_DOUBLE || op1->type == IS_LONG)
|
||||
&& (op2->type == IS_DOUBLE || op2->type == IS_LONG)) {
|
||||
result->value.dval = (op1->type == IS_LONG ? (double) op1->value.lval : op1->value.dval) - (op2->type == IS_LONG ? (double) op2->value.lval : op2->value.dval);
|
||||
result->value.lval = NORMALIZE_BOOL(result->value.dval);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval);
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
if ((op1->type==IS_ARRAY || op1->type==IS_OBJECT)
|
||||
&& (op2->type==IS_ARRAY || op2->type==IS_OBJECT)) {
|
||||
zend_error(E_WARNING,"Cannot compare arrays or objects");
|
||||
if (op1->type==IS_ARRAY && op2->type==IS_ARRAY) {
|
||||
zend_compare_arrays(result, op1, op2);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (op1->type==IS_OBJECT && op2->type==IS_OBJECT) {
|
||||
zend_compare_objects(result, op1, op2);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (op1->type==IS_ARRAY) {
|
||||
result->value.lval = 1;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
if (op2->type==IS_ARRAY) {
|
||||
result->value.lval = -1;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
if (op1->type==IS_OBJECT) {
|
||||
result->value.lval = 1;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
if (op2->type==IS_OBJECT) {
|
||||
result->value.lval = -1;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
var_reset(result);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
static int hash_zval_identical_function(const zval **z1, const zval **z2)
|
||||
{
|
||||
zval result;
|
||||
|
||||
/* is_identical_function() returns 1 in case of identity and 0 in case
|
||||
* of a difference;
|
||||
* whereas this comparison function is expected to return 0 on identity,
|
||||
* and non zero otherwise.
|
||||
*/
|
||||
if (is_identical_function(&result, (zval *) *z1, (zval *) *z2)==FAILURE) {
|
||||
return 1;
|
||||
}
|
||||
return !result.value.lval;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
result->type = IS_BOOL;
|
||||
@@ -1052,17 +1185,14 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
|
||||
switch (op1->type) {
|
||||
case IS_NULL:
|
||||
result->value.lval = (op2->type==IS_NULL);
|
||||
return SUCCESS;
|
||||
break;
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
case IS_RESOURCE:
|
||||
result->value.lval = (op1->value.lval == op2->value.lval);
|
||||
return SUCCESS;
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
result->value.lval = (op1->value.dval == op2->value.dval);
|
||||
return SUCCESS;
|
||||
break;
|
||||
case IS_STRING:
|
||||
if ((op1->value.str.len == op2->value.str.len)
|
||||
@@ -1071,22 +1201,37 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
|
||||
} else {
|
||||
result->value.lval = 0;
|
||||
}
|
||||
return SUCCESS;
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
case IS_OBJECT:
|
||||
zend_error(E_WARNING,"Cannot compare arrays or objects");
|
||||
if (zend_hash_compare(op1->value.ht, op2->value.ht, (compare_func_t) hash_zval_identical_function, 1)==0) {
|
||||
result->value.lval = 1;
|
||||
} else {
|
||||
result->value.lval = 0;
|
||||
}
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
if (op1->value.obj.ce != op2->value.obj.ce) {
|
||||
result->value.lval = 0;
|
||||
} else {
|
||||
if (zend_hash_compare(op1->value.obj.properties, op2->value.obj.properties, (compare_func_t) hash_zval_identical_function, 1)==0) {
|
||||
result->value.lval = 1;
|
||||
} else {
|
||||
result->value.lval = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
var_reset(result);
|
||||
return FAILURE;
|
||||
}
|
||||
var_reset(result);
|
||||
return FAILURE;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
result->type = IS_BOOL;
|
||||
if ( is_identical_function( result, op1, op2 ) == FAILURE ) {
|
||||
if (is_identical_function( result, op1, op2 ) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
result->value.lval = !result->value.lval;
|
||||
@@ -1372,6 +1517,25 @@ ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length)
|
||||
{
|
||||
int len;
|
||||
int c1,c2;
|
||||
|
||||
len = MIN(length, MIN(len1, len2));
|
||||
|
||||
while (len--) {
|
||||
c1 = tolower(*s1++);
|
||||
c2 = tolower(*s2++);
|
||||
if (c1 != c2) {
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
|
||||
return len1 - len2;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2)
|
||||
{
|
||||
return zend_binary_strcmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len);
|
||||
@@ -1389,6 +1553,12 @@ ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3)
|
||||
{
|
||||
return zend_binary_strncasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
{
|
||||
int ret1,ret2;
|
||||
@@ -1407,7 +1577,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
str2num(&first,s1->value.str.val,100); /* this scale should do */
|
||||
str2num(&second,s2->value.str.val,100); /* ditto */
|
||||
result->value.lval = bc_compare(first,second);
|
||||
result->value.lval = NORMALIZE_BOOL(result->value.lval);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
@@ -1420,87 +1590,65 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
dval2 = strtod(s2->value.str.val, NULL);
|
||||
}
|
||||
result->value.dval = dval1 - dval2;
|
||||
result->value.lval = NORMALIZE_BOOL(result->value.dval);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval);
|
||||
result->type = IS_LONG;
|
||||
} else { /* they both have to be long's */
|
||||
result->value.lval = lval1 - lval2;
|
||||
result->value.lval = NORMALIZE_BOOL(result->value.lval);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
}
|
||||
} else {
|
||||
result->value.lval = zend_binary_zval_strcmp(s1, s2);
|
||||
result->value.lval = NORMALIZE_BOOL(result->value.lval);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static int hash_zval_compare_function(const zval **z1, const zval **z2)
|
||||
{
|
||||
zval result;
|
||||
|
||||
if (compare_function(&result, (zval *) *z1, (zval *) *z2)==FAILURE) {
|
||||
return 1;
|
||||
}
|
||||
return result.value.lval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2)
|
||||
{
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2)
|
||||
{
|
||||
zend_compare_symbol_tables(result, a1->value.ht, a2->value.ht);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2)
|
||||
{
|
||||
if (o1->value.obj.ce != o2->value.obj.ce) {
|
||||
result->value.lval = 1; /* Comparing objects of different types is pretty much meaningless */
|
||||
result->type = IS_LONG;
|
||||
return;
|
||||
}
|
||||
zend_compare_symbol_tables(result, o1->value.obj.properties, o2->value.obj.properties);
|
||||
}
|
||||
|
||||
|
||||
/* returns 0 for non-numeric string
|
||||
* returns IS_DOUBLE for floating point string, and assigns the value to *dval (if it's not NULL)
|
||||
* returns IS_LONG for integer strings, and assigns the value to *lval (if it's not NULL)
|
||||
* returns FLAG_IS_BC if the number might lose accuracy when converted to a double
|
||||
*/
|
||||
|
||||
#if 1
|
||||
ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double *dval)
|
||||
{
|
||||
long local_lval;
|
||||
double local_dval;
|
||||
char *end_ptr;
|
||||
|
||||
if (!length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno=0;
|
||||
local_lval = strtol(str, &end_ptr, 10);
|
||||
if (errno!=ERANGE && end_ptr == str+length) { /* integer string */
|
||||
if (lval) {
|
||||
*lval = local_lval;
|
||||
}
|
||||
return IS_LONG;
|
||||
}
|
||||
|
||||
errno=0;
|
||||
local_dval = strtod(str, &end_ptr);
|
||||
if (errno!=ERANGE && end_ptr == str+length) { /* floating point string */
|
||||
if (! finite(local_dval)) {
|
||||
/* "inf","nan" and maybe other weird ones */
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dval) {
|
||||
*dval = local_dval;
|
||||
}
|
||||
#if WITH_BCMATH
|
||||
if (length>16) {
|
||||
register char *ptr=str, *end=str+length;
|
||||
|
||||
while(ptr<end) {
|
||||
switch(*ptr++) {
|
||||
case 'e':
|
||||
case 'E':
|
||||
/* scientific notation, not handled by the BC library */
|
||||
return IS_DOUBLE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FLAG_IS_BC;
|
||||
} else {
|
||||
return IS_DOUBLE;
|
||||
}
|
||||
#else
|
||||
return IS_DOUBLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
#if 0
|
||||
|
||||
static inline int is_numeric_string(char *str, int length, long *lval, double *dval)
|
||||
{
|
||||
|
||||
+83
-3
@@ -18,8 +18,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _OPERATORS_H
|
||||
#define _OPERATORS_H
|
||||
#ifndef ZEND_OPERATORS_H
|
||||
#define ZEND_OPERATORS_H
|
||||
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
|
||||
#if WITH_BCMATH
|
||||
#include "ext/bcmath/number.h"
|
||||
#endif
|
||||
|
||||
#define MAX_LENGTH_OF_LONG 18
|
||||
#define MAX_LENGTH_OF_DOUBLE 32
|
||||
@@ -47,7 +58,62 @@ ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double *dval);
|
||||
static inline int is_numeric_string(char *str, int length, long *lval, double *dval)
|
||||
{
|
||||
long local_lval;
|
||||
double local_dval;
|
||||
char *end_ptr;
|
||||
|
||||
if (!length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno=0;
|
||||
local_lval = strtol(str, &end_ptr, 10);
|
||||
if (errno!=ERANGE && end_ptr == str+length) { /* integer string */
|
||||
if (lval) {
|
||||
*lval = local_lval;
|
||||
}
|
||||
return IS_LONG;
|
||||
}
|
||||
|
||||
errno=0;
|
||||
local_dval = strtod(str, &end_ptr);
|
||||
if (errno!=ERANGE && end_ptr == str+length) { /* floating point string */
|
||||
if (! zend_finite(local_dval)) {
|
||||
/* "inf","nan" and maybe other weird ones */
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dval) {
|
||||
*dval = local_dval;
|
||||
}
|
||||
#if WITH_BCMATH
|
||||
if (length>16) {
|
||||
register char *ptr=str, *end=str+length;
|
||||
|
||||
while(ptr<end) {
|
||||
switch(*ptr++) {
|
||||
case 'e':
|
||||
case 'E':
|
||||
/* scientific notation, not handled by the BC library */
|
||||
return IS_DOUBLE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FLAG_IS_BC;
|
||||
} else {
|
||||
return IS_DOUBLE;
|
||||
}
|
||||
#else
|
||||
return IS_DOUBLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ZEND_API int increment_function(zval *op1);
|
||||
ZEND_API int decrement_function(zval *op2);
|
||||
@@ -62,9 +128,14 @@ ZEND_API void convert_to_null(zval *op);
|
||||
ZEND_API void convert_to_boolean(zval *op);
|
||||
ZEND_API void convert_to_array(zval *op);
|
||||
ZEND_API void convert_to_object(zval *op);
|
||||
ZEND_API void multi_convert_to_long_ex(int argc, ...);
|
||||
ZEND_API void multi_convert_to_double_ex(int argc, ...);
|
||||
ZEND_API void multi_convert_to_string_ex(int argc, ...);
|
||||
ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2);
|
||||
#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC)
|
||||
|
||||
ZEND_API double zend_string_to_double(const char *number, zend_uint length);
|
||||
END_EXTERN_C()
|
||||
|
||||
ZEND_API int zval_is_true(zval *op);
|
||||
@@ -76,11 +147,17 @@ ZEND_API void zend_str_tolower(char *str, unsigned int length);
|
||||
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2);
|
||||
ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3);
|
||||
ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2);
|
||||
ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3);
|
||||
ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2);
|
||||
ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length);
|
||||
ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2);
|
||||
ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length);
|
||||
|
||||
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
|
||||
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2);
|
||||
ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2);
|
||||
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
|
||||
|
||||
|
||||
#define convert_to_ex_master(ppzv, lower_type, upper_type) \
|
||||
if ((*ppzv)->type!=IS_##upper_type) { \
|
||||
@@ -125,18 +202,21 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
|
||||
|
||||
|
||||
#define Z_LVAL(zval) (zval).value.lval
|
||||
#define Z_BVAL(zval) ((zend_bool)(zval).value.lval)
|
||||
#define Z_DVAL(zval) (zval).value.dval
|
||||
#define Z_STRVAL(zval) (zval).value.str.val
|
||||
#define Z_STRLEN(zval) (zval).value.str.len
|
||||
#define Z_ARRVAL(zval) (zval).value.ht
|
||||
|
||||
#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p)
|
||||
#define Z_BVAL_P(zval_p) Z_BVAL(*zval_p)
|
||||
#define Z_DVAL_P(zval_p) Z_DVAL(*zval_p)
|
||||
#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p)
|
||||
#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p)
|
||||
#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p)
|
||||
|
||||
#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp)
|
||||
#define Z_BVAL_PP(zval_pp) Z_BVAL(**zval_pp)
|
||||
#define Z_DVAL_PP(zval_pp) Z_DVAL(**zval_pp)
|
||||
#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp)
|
||||
#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp)
|
||||
|
||||
+12
-1
@@ -104,11 +104,22 @@ ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *))
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *))
|
||||
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements)
|
||||
{
|
||||
zend_ptr_stack_apply(stack, func);
|
||||
if (free_elements) {
|
||||
int i = stack->top;
|
||||
|
||||
while (--i >= 0) {
|
||||
efree(stack->elements[i]);
|
||||
}
|
||||
}
|
||||
stack->top = 0;
|
||||
stack->top_element = stack->elements;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack)
|
||||
{
|
||||
return stack->top;
|
||||
}
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_PTR_STACK_H
|
||||
#define _ZEND_PTR_STACK_H
|
||||
#ifndef ZEND_PTR_STACK_H
|
||||
#define ZEND_PTR_STACK_H
|
||||
|
||||
typedef struct _zend_ptr_stack {
|
||||
int top, max;
|
||||
@@ -37,6 +37,7 @@ ZEND_API void *zend_ptr_stack_pop(zend_ptr_stack *stack);
|
||||
ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...);
|
||||
ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack);
|
||||
ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *));
|
||||
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *));
|
||||
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements);
|
||||
ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack);
|
||||
|
||||
#endif /* _ZEND_PTR_STACK_H */
|
||||
#endif /* ZEND_PTR_STACK_H */
|
||||
+3
-3
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_STACK_H
|
||||
#define _ZEND_STACK_H
|
||||
#ifndef ZEND_STACK_H
|
||||
#define ZEND_STACK_H
|
||||
|
||||
typedef struct _zend_stack {
|
||||
int top, max;
|
||||
@@ -44,4 +44,4 @@ ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*
|
||||
#define ZEND_STACK_APPLY_TOPDOWN 1
|
||||
#define ZEND_STACK_APPLY_BOTTOMUP 2
|
||||
|
||||
#endif /* _ZEND_STACK_H */
|
||||
#endif /* ZEND_STACK_H */
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "zend_static_allocator.h"
|
||||
|
||||
/* Not checking emalloc() and erealloc() return values as they are supposed to bailout */
|
||||
|
||||
inline static void block_init(Block *block, zend_uint block_size)
|
||||
{
|
||||
block->pos = block->bp = (char *) emalloc(block_size);
|
||||
block->end = block->bp + block_size;
|
||||
}
|
||||
|
||||
inline static char *block_allocate(Block *block, zend_uint size)
|
||||
{
|
||||
char *retval = block->pos;
|
||||
if ((block->pos += size) >= block->end) {
|
||||
return (char *)NULL;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
inline static void block_destroy(Block *block)
|
||||
{
|
||||
efree(block->bp);
|
||||
}
|
||||
|
||||
void static_allocator_init(StaticAllocator *sa)
|
||||
{
|
||||
sa->Blocks = (Block *) emalloc(sizeof(Block));
|
||||
block_init(sa->Blocks, ALLOCATOR_BLOCK_SIZE);
|
||||
sa->num_blocks = 1;
|
||||
sa->current_block = 0;
|
||||
}
|
||||
|
||||
char *static_allocator_allocate(StaticAllocator *sa, zend_uint size)
|
||||
{
|
||||
char *retval;
|
||||
|
||||
retval = block_allocate(&sa->Blocks[sa->current_block], size);
|
||||
if (retval) {
|
||||
return retval;
|
||||
}
|
||||
sa->Blocks = (Block *) erealloc(sa->Blocks, ++sa->num_blocks);
|
||||
sa->current_block++;
|
||||
block_init(&sa->Blocks[sa->current_block], (size > ALLOCATOR_BLOCK_SIZE) ? size : ALLOCATOR_BLOCK_SIZE);
|
||||
retval = block_allocate(&sa->Blocks[sa->current_block], size);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void static_allocator_destroy(StaticAllocator *sa)
|
||||
{
|
||||
zend_uint i;
|
||||
|
||||
for (i=0; i<sa->num_blocks; i++) {
|
||||
block_free(&sa->Blocks[i]);
|
||||
}
|
||||
efree(sa->Blocks);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef ZEND_STATIC_ALLOCATOR_H
|
||||
#define ZEND_STATIC_ALLOCATOR_H
|
||||
|
||||
#define ALLOCATOR_BLOCK_SIZE 400000
|
||||
|
||||
/* Temporary */
|
||||
typedef unsigned int zend_uint;
|
||||
#define emalloc(s) malloc(s)
|
||||
#define efree(p) free(p)
|
||||
|
||||
typedef struct _Block {
|
||||
char *bp;
|
||||
char *pos;
|
||||
char *end;
|
||||
} Block;
|
||||
|
||||
typedef struct _StaticAllocator {
|
||||
Block *Blocks;
|
||||
zend_uint num_blocks;
|
||||
zend_uint current_block;
|
||||
} StaticAllocator;
|
||||
|
||||
void static_allocator_init(StaticAllocator *sa);
|
||||
char *static_allocator_allocate(StaticAllocator *sa, zend_uint size);
|
||||
void static_allocator_destroy(StaticAllocator *sa);
|
||||
|
||||
#endif /* ZEND_STATIC_ALLOCATOR_H */
|
||||
@@ -61,7 +61,8 @@ ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
case IS_CONSTANT:
|
||||
STR_FREE_REL(zvalue->value.str.val);
|
||||
break;
|
||||
case IS_ARRAY: {
|
||||
case IS_ARRAY:
|
||||
case IS_CONSTANT_ARRAY: {
|
||||
ELS_FETCH();
|
||||
|
||||
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
|
||||
@@ -125,7 +126,8 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
}
|
||||
zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len);
|
||||
break;
|
||||
case IS_ARRAY: {
|
||||
case IS_ARRAY:
|
||||
case IS_CONSTANT_ARRAY: {
|
||||
zval *tmp;
|
||||
HashTable *original_ht = zvalue->value.ht;
|
||||
ELS_FETCH();
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _VARIABLES_H
|
||||
#define _VARIABLES_H
|
||||
#ifndef ZEND_VARIABLES_H
|
||||
#define ZEND_VARIABLES_H
|
||||
|
||||
|
||||
ZEND_API int zend_print_variable(zval *var);
|
||||
|
||||
+1
-125
@@ -1,125 +1 @@
|
||||
/* This is the default configuration file to read -*- C -*- */
|
||||
|
||||
/* these are defined by automake */
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
#undef HAVE_STRUCT_FLOCK
|
||||
#undef HAVE_TM_GMTOFF
|
||||
|
||||
#define CONFIGURATION_FILE_PATH "php.ini"
|
||||
#define USE_CONFIG_FILE 1
|
||||
|
||||
#undef HAVE_DMALLOC
|
||||
|
||||
/* Some global constants defined by conigure */
|
||||
#undef PHP_BUILD_DATE
|
||||
#undef PHP_OS
|
||||
#undef PHP_UNAME
|
||||
|
||||
/* define uint by configure if it is missed (QNX and BSD derived) */
|
||||
#undef uint
|
||||
|
||||
/* define ulong by configure if it is missed (most probably is) */
|
||||
#undef ulong
|
||||
|
||||
/* type check for in_addr_t */
|
||||
#undef in_addr_t
|
||||
|
||||
/* Define if you have dirent.h but opendir() resides in libc rather than in libdir */
|
||||
/* This will cause HAVE_DIRENT_H defined twice sometimes, but it should be problem */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the resolv library (-lresolv). */
|
||||
#undef HAVE_LIBRESOLV
|
||||
|
||||
/* Define if you have the pam library (-lpam). */
|
||||
#define HAVE_LIBPAM 0
|
||||
|
||||
/* Define if you have the bind library (-lbind). */
|
||||
#define HAVE_LIBBIND 0
|
||||
|
||||
/* Define if you have Netscape LDAP instead of umich ldap or openldap*/
|
||||
#define HAVE_NSLDAP 0
|
||||
|
||||
/* Define if you want safe mode enabled by default. */
|
||||
#define PHP_SAFE_MODE 0
|
||||
|
||||
/* Set to the path to the dir containing safe mode executables */
|
||||
#define PHP_SAFE_MODE_EXEC_DIR /usr/local/php/bin
|
||||
|
||||
/* Define if PHP to setup it's own SIGCHLD handler */
|
||||
#define PHP_SIGCHILD 0
|
||||
|
||||
/* Define if you want POST/GET/Cookie track variables by default */
|
||||
#define PHP_TRACK_VARS 0
|
||||
|
||||
/* Undefine if you want stricter XML/SGML compliance by default */
|
||||
/* (this disables "<?expression?>" by default) */
|
||||
#define DEFAULT_SHORT_OPEN_TAG 1
|
||||
|
||||
/* Undefine if you do not want PHP by default to escape "'" */
|
||||
/* in GET/POST/Cookie data */
|
||||
#define MAGIC_QUOTES 1
|
||||
|
||||
/* Define both of these if you want the bundled REGEX library */
|
||||
#define REGEX 0
|
||||
#define HSREGEX 0
|
||||
|
||||
/* Define if you have and want to use libnsl */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define if you have and want to use libsocket */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Define if you have the sendmail program available */
|
||||
#define HAVE_SENDMAIL 0
|
||||
|
||||
/* Define if you are compiling PHP as an Apache module with mod_charset patch applied (aka Russian Apache)*/
|
||||
#define USE_TRANSFER_TABLES 0
|
||||
|
||||
/* Define if you are compiling PHP as an fhttpd module */
|
||||
#define FHTTPD 0
|
||||
|
||||
/* Define if your Apache creates an ap_config.h header file (only 1.3b6 and later) */
|
||||
#define HAVE_AP_CONFIG_H 0
|
||||
|
||||
/* Define if your Apache has src/include/compat.h */
|
||||
#define HAVE_OLD_COMPAT_H 0
|
||||
|
||||
/* Define if your Apache has src/include/ap_compat.h */
|
||||
#define HAVE_AP_COMPAT_H 0
|
||||
|
||||
/* Define if you want to enable PHP RPC (experimental) */
|
||||
#define PHP_RPC 0
|
||||
|
||||
/* Define if you want to prevent the CGI from working unless REDIRECT_STATUS is defined in the environment */
|
||||
#define FORCE_CGI_REDIRECT 0
|
||||
|
||||
/* Define if you want to prevent the CGI from using path_info and path_translated */
|
||||
#define DISCARD_PATH 0
|
||||
|
||||
/* Define if you want include() and other functions to be able to open
|
||||
* http and ftp URLs as files.
|
||||
*/
|
||||
#define PHP_URL_FOPEN 0
|
||||
|
||||
/* Define if you have broken header files like SunOS 4 */
|
||||
#define MISSING_FCLOSE_DECL 0
|
||||
|
||||
/* Define to compile PHP/Zend thread safe */
|
||||
#undef ZTS
|
||||
|
||||
/* Define when compiling with Zeus support */
|
||||
#undef WITH_ZEUS
|
||||
|
||||
/* Define if struct sockaddr contains the field sa_len */
|
||||
#undef HAVE_SOCKADDR_SA_LEN
|
||||
|
||||
#undef BROKEN_SPRINTF
|
||||
|
||||
#if BROKEN_SPRINTF
|
||||
#define sprintf php_sprintf
|
||||
#endif
|
||||
/* Leave this file alone */
|
||||
+158
-47
@@ -4,6 +4,91 @@ dnl This file contains local autoconf functions.
|
||||
|
||||
sinclude(dynlib.m4)
|
||||
|
||||
dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD)
|
||||
dnl
|
||||
dnl Use this macro, if you need to add libraries and or library search
|
||||
dnl paths to the PHP build system which are only given in compiler
|
||||
dnl notation.
|
||||
dnl
|
||||
AC_DEFUN(PHP_EVAL_LIBLINE,[
|
||||
for ac_i in $1; do
|
||||
case "$ac_i" in
|
||||
-l*)
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
AC_ADD_LIBRARY($ac_ii,,$2)
|
||||
;;
|
||||
-L*)
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
AC_ADD_LIBPATH($ac_ii,$2)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
])
|
||||
|
||||
dnl PHP_EVAL_INCLINE(LINE)
|
||||
dnl
|
||||
dnl Use this macro, if you need to add header search paths to the PHP
|
||||
dnl build system which are only given in compiler notation.
|
||||
dnl
|
||||
AC_DEFUN(PHP_EVAL_INCLINE,[
|
||||
for ac_i in $1; do
|
||||
case "$ac_i" in
|
||||
-I*)
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
AC_ADD_INCLUDE($ac_ii)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_READDIR_R_TYPE,[
|
||||
dnl HAVE_READDIR_R is also defined by libmysql
|
||||
AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no)
|
||||
if test "$ac_cv_func_readdir_r" = "yes"; then
|
||||
AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[
|
||||
AC_TRY_RUN([
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
main() {
|
||||
DIR *dir;
|
||||
char entry[sizeof(struct dirent)+257];
|
||||
struct dirent *pentry = (struct dirent *) &entry;
|
||||
|
||||
dir = opendir("/");
|
||||
if (!dir)
|
||||
exit(1);
|
||||
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0)
|
||||
exit(0);
|
||||
exit(1);
|
||||
}
|
||||
],[
|
||||
ac_cv_what_readdir_r=POSIX
|
||||
],[
|
||||
AC_TRY_CPP([
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
int readdir_r(DIR *, struct dirent *);
|
||||
],[
|
||||
ac_cv_what_readdir_r=old-style
|
||||
],[
|
||||
ac_cv_what_readdir_r=none
|
||||
])
|
||||
],[
|
||||
ac_cv_what_readdir_r=none
|
||||
])
|
||||
])
|
||||
case "$ac_cv_what_readdir_r" in
|
||||
POSIX)
|
||||
AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);;
|
||||
old-style)
|
||||
AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_SHLIB_SUFFIX_NAME,[
|
||||
PHP_SUBST(SHLIB_SUFFIX_NAME)
|
||||
SHLIB_SUFFIX_NAME=so
|
||||
@@ -104,7 +189,7 @@ no)
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$php_always_shared"; then
|
||||
if test "$php_always_shared" = "yes"; then
|
||||
ext_output="yes, shared"
|
||||
ext_shared=yes
|
||||
test "[$]$1" = "no" && $1=yes
|
||||
@@ -164,7 +249,7 @@ EOF
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_TIME_R_TYPE,[
|
||||
AC_CACHE_CHECK(for *time_r type, ac_cv_time_r_type,[
|
||||
AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[
|
||||
AC_TRY_RUN([
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
@@ -183,13 +268,13 @@ exit(1);
|
||||
],[
|
||||
ac_cv_time_r_type=hpux
|
||||
],[
|
||||
ac_cv_time_r_type=SUSV2
|
||||
ac_cv_time_r_type=POSIX
|
||||
],[
|
||||
ac_cv_time_r_type=SUSV2
|
||||
ac_cv_time_r_type=POSIX
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_time_r_type" = "hpux"; then
|
||||
AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-SUX 10.x])
|
||||
AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -215,14 +300,17 @@ AC_DEFUN(PHP_MKDIR_P_CHECK,[
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_FAST_GENERATE,[
|
||||
AC_DEFUN(PHP_GEN_CONFIG_VARS,[
|
||||
PHP_MKDIR_P_CHECK
|
||||
echo creating config_vars.mk
|
||||
> config_vars.mk
|
||||
for i in $PHP_VAR_SUBST; do
|
||||
eval echo "$i = \$$i" >> config_vars.mk
|
||||
done
|
||||
$SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $PHP_FAST_OUTPUT_FILES
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_GEN_MAKEFILES,[
|
||||
$SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $BSD_MAKEFILE $1
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_TM_GMTOFF,[
|
||||
@@ -232,7 +320,7 @@ AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
|
||||
ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
|
||||
|
||||
if test "$ac_cv_struct_tm_gmtoff" = yes; then
|
||||
AC_DEFINE(HAVE_TM_GMTOFF)
|
||||
AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -244,9 +332,9 @@ AC_DEFUN(PHP_CONFIGURE_PART,[
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_PROG_SENDMAIL,[
|
||||
AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/lib/sendmail, $PATH /usr/bin /usr/sbin /usr/etc /etc /usr/ucblib)
|
||||
AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/lib/sendmail, $PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib)
|
||||
if test -n "$PROG_SENDMAIL"; then
|
||||
AC_DEFINE(HAVE_SENDMAIL)
|
||||
AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -292,7 +380,7 @@ AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock,
|
||||
])
|
||||
)
|
||||
if test "$ac_cv_struct_flock" = "yes" ; then
|
||||
AC_DEFINE(HAVE_STRUCT_FLOCK, 1)
|
||||
AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -329,7 +417,15 @@ dnl
|
||||
AC_DEFUN(PHP_BUILD_THREAD_SAFE,[
|
||||
enable_experimental_zts=yes
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
AC_MSG_ERROR(ZTS currently requires working POSIX threads. Your system does not support this.)
|
||||
AC_MSG_ERROR(ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.)
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_REQUIRE_CXX,[
|
||||
if test -z "$php_cxx_done"; then
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
php_cxx_done=yes
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -360,7 +456,9 @@ dnl
|
||||
dnl execute code, if variable is not set in namespace
|
||||
dnl
|
||||
AC_DEFUN(AC_PHP_ONCE,[
|
||||
unique=`echo $ac_n "$2$ac_c" | tr -cd a-zA-Z0-9`
|
||||
changequote({,})
|
||||
unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'`
|
||||
changequote([,])
|
||||
cmd="echo $ac_n \"\$$1$unique$ac_c\""
|
||||
if test -n "$unique" && test "`eval $cmd`" = "" ; then
|
||||
eval "$1$unique=set"
|
||||
@@ -386,18 +484,22 @@ AC_DEFUN(AC_EXPAND_PATH,[
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_ADD_LIBPATH(path)
|
||||
dnl AC_ADD_LIBPATH(path[, shared-libadd])
|
||||
dnl
|
||||
dnl add a library to linkpath/runpath
|
||||
dnl
|
||||
AC_DEFUN(AC_ADD_LIBPATH,[
|
||||
if test "$1" != "/usr/lib"; then
|
||||
AC_EXPAND_PATH($1, ai_p)
|
||||
AC_PHP_ONCE(LIBPATH, $ai_p, [
|
||||
test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
|
||||
LDFLAGS="$LDFLAGS -L$ai_p"
|
||||
PHP_RPATHS="$PHP_RPATHS $ai_p"
|
||||
])
|
||||
if test "$ext_shared" = "yes" && test -n "$2"; then
|
||||
$2="-R$1 -L$1 [$]$2"
|
||||
else
|
||||
AC_PHP_ONCE(LIBPATH, $ai_p, [
|
||||
test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
|
||||
LDFLAGS="$LDFLAGS -L$ai_p"
|
||||
PHP_RPATHS="$PHP_RPATHS $ai_p"
|
||||
])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -432,17 +534,30 @@ AC_DEFUN(AC_ADD_INCLUDE,[
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_X_ADD_LIBRARY,[
|
||||
ifelse($2,,$3="-l$1 [$]$3", $3="[$]$3 -l$1")
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_ADD_LIBRARY(library[, append])
|
||||
dnl AC_ADD_LIBRARY(library[, append[, shared-libadd]])
|
||||
dnl
|
||||
dnl add a library to the link line
|
||||
dnl
|
||||
AC_DEFUN(AC_ADD_LIBRARY,[
|
||||
AC_PHP_ONCE(LIBRARY, $1, [
|
||||
if test "$1" != "c"; then
|
||||
ifelse($#, 1, LIBS="-l$1 $LIBS", LIBS="$LIBS -l$1")
|
||||
fi
|
||||
])
|
||||
case "$1" in
|
||||
c|c_r|pthread*) ;;
|
||||
*)
|
||||
ifelse($3,,[
|
||||
PHP_X_ADD_LIBRARY($1,$2,LIBS)
|
||||
],[
|
||||
if test "$ext_shared" = "yes"; then
|
||||
PHP_X_ADD_LIBRARY($1,$2,$3)
|
||||
else
|
||||
AC_ADD_LIBRARY($1,$2)
|
||||
fi
|
||||
])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -450,9 +565,7 @@ dnl AC_ADD_LIBRARY_DEFER(library[, append])
|
||||
dnl
|
||||
dnl add a library to the link line (deferred)
|
||||
AC_DEFUN(AC_ADD_LIBRARY_DEFER,[
|
||||
AC_PHP_ONCE(LIBRARY, $1, [
|
||||
ifelse($#, 1, DLIBS="-l$1 $DLIBS", DLIBS="$DLIBS -l$1")
|
||||
])
|
||||
ifelse($#, 1, DLIBS="-l$1 $DLIBS", DLIBS="$DLIBS -l$1")
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -470,17 +583,13 @@ ifelse($3,,[
|
||||
AC_ADD_LIBRARY($1)
|
||||
],[
|
||||
if test "$ext_shared" = "yes"; then
|
||||
$3="-l$1 [$]$3"
|
||||
if test -n "$2"; then
|
||||
$3="-R$2 -L$2 -l$1 [$]$3"
|
||||
else
|
||||
$3="-l$1 [$]$3"
|
||||
AC_ADD_LIBPATH($2,$3)
|
||||
fi
|
||||
else
|
||||
if test -n "$2"; then
|
||||
AC_ADD_LIBPATH($2)
|
||||
fi
|
||||
AC_ADD_LIBRARY($1)
|
||||
fi
|
||||
AC_ADD_LIBRARY_WITH_PATH($1,$2)
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
@@ -505,7 +614,9 @@ dnl
|
||||
AC_DEFUN(AC_CHECK_CC_OPTION,[
|
||||
echo "main(){return 0;}" > conftest.$ac_ext
|
||||
opt="$1"
|
||||
var=`echo $ac_n "$opt$ac_c"|tr -c a-zA-Z0-9 _`
|
||||
changequote({,})
|
||||
var=`echo $opt|sed 's/[^a-zA-Z0-9]/_/g'`
|
||||
changequote([,])
|
||||
AC_MSG_CHECKING([if compiler supports -$1 really])
|
||||
ac_php_compile="${CC-cc} -$opt -o conftest $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1"
|
||||
if eval $ac_php_compile 2>&1 | egrep "$opt" > /dev/null 2>&1 ; then
|
||||
@@ -527,11 +638,11 @@ AC_DEFUN(PHP_REGEX,[
|
||||
if test "$REGEX_TYPE" = "php"; then
|
||||
REGEX_LIB=regex/libregex.la
|
||||
REGEX_DIR=regex
|
||||
AC_DEFINE(HSREGEX)
|
||||
AC_DEFINE(REGEX,1)
|
||||
AC_DEFINE(HSREGEX,1,[ ])
|
||||
AC_DEFINE(REGEX,1,[ ])
|
||||
PHP_FAST_OUTPUT(regex/Makefile)
|
||||
elif test "$REGEX_TYPE" = "system"; then
|
||||
AC_DEFINE(REGEX,0)
|
||||
AC_DEFINE(REGEX,0,[ ])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(which regex library to use)
|
||||
@@ -548,10 +659,10 @@ dnl
|
||||
AC_DEFUN(AC_MISSING_FCLOSE_DECL,[
|
||||
AC_MSG_CHECKING([for fclose declaration])
|
||||
AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[
|
||||
AC_DEFINE(MISSING_FCLOSE_DECL,0)
|
||||
AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ])
|
||||
AC_MSG_RESULT(ok)
|
||||
],[
|
||||
AC_DEFINE(MISSING_FCLOSE_DECL,1)
|
||||
AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ])
|
||||
AC_MSG_RESULT(missing)
|
||||
])
|
||||
])
|
||||
@@ -570,9 +681,9 @@ AC_DEFUN(AC_BROKEN_SPRINTF,[
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_broken_sprintf" = "yes"; then
|
||||
AC_DEFINE(BROKEN_SPRINTF, 1)
|
||||
AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [ ])
|
||||
else
|
||||
AC_DEFINE(BROKEN_SPRINTF, 0)
|
||||
AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [ ])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -717,13 +828,13 @@ AC_DEFUN(AC_SOCKADDR_SA_LEN,[
|
||||
#include <sys/socket.h>],
|
||||
[struct sockaddr s; s.sa_len;],
|
||||
[ac_cv_sockaddr_sa_len=yes
|
||||
AC_DEFINE(HAVE_SOCKADDR_SA_LEN)],
|
||||
AC_DEFINE(HAVE_SOCKADDR_SA_LEN,1,[ ])],
|
||||
[ac_cv_sockaddr_sa_len=no])
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl ## PHP_AC_OUTPUT(file)
|
||||
dnl ## PHP_OUTPUT(file)
|
||||
dnl ## adds "file" to the list of files generated by AC_OUTPUT
|
||||
dnl ## This macro can be used several times.
|
||||
AC_DEFUN(PHP_OUTPUT,[
|
||||
@@ -764,7 +875,7 @@ int main(void) {
|
||||
ac_cv_ebcdic="no"
|
||||
])])
|
||||
if test "$ac_cv_ebcdic" = "yes"; then
|
||||
AC_DEFINE(CHARSET_EBCDIC,, [Define if system uses EBCDIC])
|
||||
AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC])
|
||||
fi
|
||||
])
|
||||
|
||||
+13
-21
@@ -1,31 +1,22 @@
|
||||
/* -*- C -*-
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP HTML Embedded Scripting Language Version 3.0 |
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This program is free software; you can redistribute it and/or modify |
|
||||
| it under the terms of one of the following licenses: |
|
||||
| |
|
||||
| A) the GNU General Public License as published by the Free Software |
|
||||
| Foundation; either version 2 of the License, or (at your option) |
|
||||
| any later version. |
|
||||
| |
|
||||
| B) the PHP License as published by the PHP Development Team and |
|
||||
| included in the distribution in the file: LICENSE |
|
||||
| |
|
||||
| This program is distributed in the hope that it will be useful, |
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
| GNU General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of both licenses referred to here. |
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@fast.no> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#define CONFIGURE_COMMAND "@CONFIGURE_COMMAND@"
|
||||
#define PHP_ADA_INCLUDE ""
|
||||
@@ -88,3 +79,4 @@
|
||||
#define PHP_VELOCIS_INCLUDE ""
|
||||
#define PHP_VELOCIS_LIBS ""
|
||||
#define PHP_EXTENSION_DIR "@EXTENSION_DIR@"
|
||||
#define PHP_INCLUDE_PATH "@INCLUDE_PATH@"
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#! /bin/sh
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
# cwd must be top_srcdir
|
||||
test -f build/bsd_makefile || exit 2
|
||||
|
||||
test -f bsd_converted && exit 0
|
||||
|
||||
tmpfile=`mktemp /tmp/bsd_makefile.XXXXXX 2>/dev/null` || tmpfile="tmp.$$"
|
||||
for i in build/*.mk; do
|
||||
sed 's/^include \(.*\)/.include "\1"/' $i >$tmpfile \
|
||||
&& cp $tmpfile $i
|
||||
done
|
||||
rm -f $tmpfile
|
||||
|
||||
touch bsd_converted
|
||||
exit 0
|
||||
+16
-22
@@ -1,28 +1,22 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
#
|
||||
# Makefile to generate build tools
|
||||
#
|
||||
|
||||
|
||||
+16
-22
@@ -1,27 +1,21 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# $Id$
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
|
||||
include generated_lists
|
||||
|
||||
|
||||
+20
-1
@@ -1,4 +1,23 @@
|
||||
#! /bin/sh
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Stig Bakken <ssb@fast.no> |
|
||||
# | Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id: buildcheck.sh,v 1.3 2000-08-20 05:39:37 sas Exp $
|
||||
#
|
||||
|
||||
echo "buildconf: checking installation..."
|
||||
|
||||
@@ -48,7 +67,7 @@ exit 1
|
||||
fi
|
||||
lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
|
||||
IFS=.; set $lt_version; IFS=' '
|
||||
if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3"
|
||||
if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" && (test "$3" = "c" || test "$3" -ge "3")
|
||||
then
|
||||
echo "buildconf: libtool version $lt_pversion (ok)"
|
||||
else
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
all: all-recursive
|
||||
|
||||
include $(builddir)/libs.mk
|
||||
|
||||
+48
-33
@@ -1,29 +1,22 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id: fastgen.sh,v 1.6 2000-05-12 07:37:42 sas Exp $
|
||||
# $Id: fastgen.sh,v 1.9 2000-09-26 11:19:38 sas Exp $
|
||||
#
|
||||
|
||||
srcdir=$1
|
||||
@@ -32,6 +25,9 @@ shift
|
||||
mkdir_p=$1
|
||||
shift
|
||||
|
||||
bsd_makefile=$1
|
||||
shift
|
||||
|
||||
top_srcdir=`(cd $srcdir; pwd)`
|
||||
top_builddir=`pwd`
|
||||
|
||||
@@ -41,21 +37,40 @@ else
|
||||
mkdir_p="$top_srcdir/helpers/mkdir.sh"
|
||||
fi
|
||||
|
||||
for makefile in $@; do
|
||||
echo "creating $makefile"
|
||||
# portable dirname
|
||||
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
|
||||
$mkdir_p "$dir/"
|
||||
if test "$bsd_makefile" = "yes"; then
|
||||
(cd $top_srcdir; ./build/bsd_makefile)
|
||||
|
||||
(cat <<EOF
|
||||
for makefile in $@; do
|
||||
echo "creating $makefile"
|
||||
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
|
||||
$mkdir_p "$dir/"
|
||||
|
||||
cat - $top_srcdir/$makefile.in <<EOF |sed 's/^include \(.*\)/.include "\1"/' >$makefile
|
||||
top_srcdir = $top_srcdir
|
||||
top_builddir = $top_builddir
|
||||
srcdir = $top_srcdir/$dir
|
||||
builddir = $top_builddir/$dir
|
||||
VPATH = $top_srcdir/$dir
|
||||
EOF
|
||||
)| cat - $top_srcdir/$makefile.in > $makefile
|
||||
|
||||
test -z "$dir" || touch $dir/.deps
|
||||
|
||||
done
|
||||
test -z "$dir" && dir=.
|
||||
touch $dir/.deps
|
||||
done
|
||||
else
|
||||
for makefile in $@; do
|
||||
echo "creating $makefile"
|
||||
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
|
||||
$mkdir_p "$dir/"
|
||||
|
||||
cat - $top_srcdir/$makefile.in <<EOF >$makefile
|
||||
top_srcdir = $top_srcdir
|
||||
top_builddir = $top_builddir
|
||||
srcdir = $top_srcdir/$dir
|
||||
builddir = $top_builddir/$dir
|
||||
VPATH = $top_srcdir/$dir
|
||||
EOF
|
||||
|
||||
test -z "$dir" && dir=.
|
||||
touch $dir/.deps
|
||||
done
|
||||
fi
|
||||
+16
-23
@@ -1,30 +1,23 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo)
|
||||
LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X)
|
||||
|
||||
$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
|
||||
$(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD)
|
||||
+15
-22
@@ -1,26 +1,19 @@
|
||||
# Copyright (c) 1999 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \
|
||||
# awk -f mkdep.awk > dependencies
|
||||
|
||||
|
||||
{
|
||||
top_srcdir=$1
|
||||
top_builddir=$2
|
||||
srcdir=$3
|
||||
cmd=$4
|
||||
|
||||
for (i = 5; i <= NF; i++) {
|
||||
if (match($i, "^-[A-Z]") == 0)
|
||||
break;
|
||||
cmd=cmd " " $i
|
||||
}
|
||||
|
||||
dif=i-1
|
||||
|
||||
for (; i <= NF; i++)
|
||||
filenames[i-dif]=$i
|
||||
|
||||
no_files=NF-dif
|
||||
|
||||
for(i = 1; i <= no_files; i++) {
|
||||
if (system("test -r " filenames[i]) != 0)
|
||||
continue
|
||||
|
||||
target=filenames[i]
|
||||
sub(srcdir "/", "", target)
|
||||
target2=target
|
||||
sub("\.(c|cpp)$", ".lo", target);
|
||||
sub("\.(c|cpp)$", ".slo", target2);
|
||||
|
||||
for (e in used)
|
||||
delete used[e]
|
||||
|
||||
cmdx=cmd " " filenames[i]
|
||||
done=0
|
||||
while ((cmdx | getline) > 0) {
|
||||
if (match($0, "^# [0-9]* \".*\.h\"") != 0) {
|
||||
if (sub(top_srcdir, "$(top_srcdir)", $3) == 0)
|
||||
sub(top_builddir, "$(top_builddir)", $3)
|
||||
if (substr($3,2,1) != "/" && used[$3] != 1) {
|
||||
if (done == 0)
|
||||
printf(target " " target2 ":")
|
||||
done=1
|
||||
printf(" \\\n\t" substr($3,2,length($3)-2))
|
||||
used[$3] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (done == 1)
|
||||
print "\n"
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Created: Thu Aug 15 11:57:33 1996 too
|
||||
# Last modified: Mon Dec 27 09:23:56 1999 too
|
||||
#
|
||||
# Copyright (c) 1996-1999 Tomi Ollila. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
die "Usage: mkdep CPP-command [CPP options] file1 [file2...]\n"
|
||||
if ($#ARGV < 1);
|
||||
|
||||
$cmdl = shift(@ARGV);
|
||||
|
||||
$cmdl = "$cmdl " . shift (@ARGV) while ($ARGV[0] =~ /^-[A-Z]/);
|
||||
|
||||
while ($file = shift(@ARGV))
|
||||
{
|
||||
$file =~ s/\.o$/.c/;
|
||||
|
||||
open(F, "$cmdl $file|");
|
||||
|
||||
&parseout;
|
||||
|
||||
close(F);
|
||||
}
|
||||
|
||||
|
||||
sub initinit
|
||||
{
|
||||
%used = ();
|
||||
$of = $file;
|
||||
$of =~ s/\.c$/.lo/;
|
||||
$str = "$of:\t$file";
|
||||
$len = length $str;
|
||||
}
|
||||
|
||||
sub initstr
|
||||
{
|
||||
$str = "\t";
|
||||
$len = length $str;
|
||||
}
|
||||
|
||||
sub parseout
|
||||
{
|
||||
&initinit;
|
||||
while (<F>)
|
||||
{
|
||||
next unless (/^# [0-9]* "(.*\.h)"/);
|
||||
|
||||
next if ($1 =~ /^\//);
|
||||
|
||||
next if $used{$1};
|
||||
|
||||
$used{$1} = 1;
|
||||
|
||||
$nlen = length($1) + 1;
|
||||
|
||||
if ($len + $nlen > 72)
|
||||
{
|
||||
print $str, "\\\n";
|
||||
&initstr;
|
||||
$str = $str . $1;
|
||||
}
|
||||
else { $str = $str . " " . $1; }
|
||||
|
||||
$len += $nlen;
|
||||
|
||||
}
|
||||
print $str, "\n";
|
||||
}
|
||||
+15
-22
@@ -1,26 +1,19 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
|
||||
+20
-64
@@ -1,70 +1,23 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir)
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
include $(top_srcdir)/build/rules_common.mk
|
||||
|
||||
all: all-recursive
|
||||
install: install-recursive
|
||||
@@ -88,7 +41,7 @@ install-p: $(targets) $(install_targets)
|
||||
distclean-p depend-p clean-p:
|
||||
|
||||
depend: depend-recursive
|
||||
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
|
||||
@echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true
|
||||
|
||||
clean: clean-recursive clean-x
|
||||
|
||||
@@ -100,6 +53,9 @@ distclean: distclean-recursive clean-x
|
||||
rm -f config.cache config.log config.status config_vars.mk libtool \
|
||||
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
|
||||
|
||||
test: $(top_builddir)/php
|
||||
@$(top_builddir)/php -f $(top_srcdir)/run-tests.php `pwd`
|
||||
|
||||
include $(builddir)/.deps
|
||||
|
||||
.PHONY: all-recursive clean-recursive install-recursive \
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
|
||||
COMPILE = $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
|
||||
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(COMPILE) -c $< && touch $@
|
||||
CXX_SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CXX_COMPILE) -c $< && touch $@
|
||||
|
||||
LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@
|
||||
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
|
||||
DEFS = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
CXX_SUFFIX = .cpp
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c $(CXX_SUFFIX) .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
$(CXX_SUFFIX).o:
|
||||
$(CXX_COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
$(CXX_SUFFIX).lo:
|
||||
$(CXX_PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
$(CXX_SUFFIX).slo:
|
||||
$(CXX_SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
+17
-63
@@ -1,69 +1,23 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -f -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir)
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
include $(top_srcdir)/build/rules_common.mk
|
||||
|
||||
install_targets = install-modules
|
||||
|
||||
@@ -89,7 +43,7 @@ install-p: $(targets) $(install_targets)
|
||||
distclean-p depend-p clean-p:
|
||||
|
||||
depend: depend-recursive
|
||||
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
|
||||
@echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true
|
||||
|
||||
clean: clean-recursive clean-x
|
||||
|
||||
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#! /bin/sh
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
# cwd must be top_srcdir
|
||||
test -f build/sysv_makefile || exit 2
|
||||
|
||||
test -f bsd_converted || exit 1
|
||||
|
||||
tmpfile=`mktemp /tmp/sysv_makefile.XXXXXX` || tmpfile="tmp.$$"
|
||||
for i in build/*.mk; do
|
||||
sed 's/^\.include "\(.*\)"/include \1/' $i >$tmpfile \
|
||||
&& cp $tmpfile $i
|
||||
done
|
||||
rm -f $tmpfile
|
||||
|
||||
rm bsd_converted
|
||||
exit 0
|
||||
Loaded 100 of 833 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user