mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-10 02:30:50 +00:00
Compare commits
1205
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c688aa97f3 | ||
|
|
87d6372a14 | ||
|
|
bb6dacfb69 | ||
|
|
65557ffe88 | ||
|
|
dca71900c1 | ||
|
|
c1e3f5cb17 | ||
|
|
6c51d44141 | ||
|
|
30cfeece94 | ||
|
|
897127d44a | ||
|
|
d019ed533f | ||
|
|
b85f2cba43 | ||
|
|
13582b4fe2 | ||
|
|
25c56d15cd | ||
|
|
2b08dfec28 | ||
|
|
f3bcc012c6 | ||
|
|
6755a85a38 | ||
|
|
4127b34a0a | ||
|
|
f2b0c70512 | ||
|
|
2327b6b954 | ||
|
|
5f8f410e51 | ||
|
|
4ebf7b85ad | ||
|
|
db59169015 | ||
|
|
c898d87aad | ||
|
|
62eeb9278c | ||
|
|
438addf331 | ||
|
|
afc9e1257b | ||
|
|
d35ea24fc0 | ||
|
|
3c1b362235 | ||
|
|
677bf03f07 | ||
|
|
bcb2214e99 | ||
|
|
c166a6fb83 | ||
|
|
117ebf3ca6 | ||
|
|
942c0b3521 | ||
|
|
194d75c3a8 | ||
|
|
c810659379 | ||
|
|
3dc7757a99 | ||
|
|
7dd7f38003 | ||
|
|
e82ad7e9c3 | ||
|
|
64070d9474 | ||
|
|
ceae3847b8 | ||
|
|
6f57224890 | ||
|
|
e20e9786b3 | ||
|
|
d64e09a322 | ||
|
|
e61fea3029 | ||
|
|
d8d8b30972 | ||
|
|
ea3d47b804 | ||
|
|
4a22643375 | ||
|
|
639354357f | ||
|
|
78e6e79a65 | ||
|
|
3581f0d037 | ||
|
|
7a4e1a9b0f | ||
|
|
2de9baf655 | ||
|
|
6e4114daf0 | ||
|
|
044789447c | ||
|
|
392659fabe | ||
|
|
f3fb441979 | ||
|
|
3f1a9fd706 | ||
|
|
ab5c4e2230 | ||
|
|
2cc9f1d377 | ||
|
|
cc5304a9d9 | ||
|
|
45c254d89c | ||
|
|
f6f74737d3 | ||
|
|
5bb017f6d4 | ||
|
|
16ea76a880 | ||
|
|
e07220a006 | ||
|
|
5a7943c9ed | ||
|
|
a5317327c7 | ||
|
|
ef941dd700 | ||
|
|
2204607b10 | ||
|
|
5c28619f51 | ||
|
|
751e5d15f9 | ||
|
|
20c9a79432 | ||
|
|
fd056d0c01 | ||
|
|
a4ff16dd68 | ||
|
|
eb231bb180 | ||
|
|
0c2e3e4e7d | ||
|
|
a14d96ef72 | ||
|
|
9e1cfb4f6e | ||
|
|
d17a12319f | ||
|
|
60766eff5a | ||
|
|
fdc6d630db | ||
|
|
86418fde5b | ||
|
|
e95fe291d4 | ||
|
|
ce8e31be71 | ||
|
|
ecf83739f4 | ||
|
|
9542dbaf54 | ||
|
|
7bc251058a | ||
|
|
b87228e491 | ||
|
|
63d47b7735 | ||
|
|
d1ecda53b7 | ||
|
|
e5983e9ef5 | ||
|
|
880d7666ab | ||
|
|
c2e062c843 | ||
|
|
14a870e940 | ||
|
|
9738fdff44 | ||
|
|
512f4519c6 | ||
|
|
0700ad3417 | ||
|
|
c6b05b2e6b | ||
|
|
b1f13fcc35 | ||
|
|
abac416be7 | ||
|
|
84f8583426 | ||
|
|
d5233c482b | ||
|
|
f8d111d153 | ||
|
|
ce4f149734 | ||
|
|
1890a59cd6 | ||
|
|
602cb959fc | ||
|
|
3964c92f8b | ||
|
|
0d5a9358f0 | ||
|
|
aa3123e87b | ||
|
|
f2099fccfb | ||
|
|
a4c8d7dddc | ||
|
|
170db8b580 | ||
|
|
35e82edf47 | ||
|
|
2fb2c11c09 | ||
|
|
1746a30108 | ||
|
|
d400f52ca4 | ||
|
|
e5ca107a3d | ||
|
|
a79bdcc28f | ||
|
|
6d988ec694 | ||
|
|
b1c4f8978d | ||
|
|
af07e331ac | ||
|
|
1e0bc24992 | ||
|
|
358af8b9eb | ||
|
|
11287bba4d | ||
|
|
f31c9d7d2a | ||
|
|
229a26a497 | ||
|
|
3ab5606732 | ||
|
|
81c24791e1 | ||
|
|
1fe76945f7 | ||
|
|
92f6a8b20e | ||
|
|
fa09e56a43 | ||
|
|
1fd576485f | ||
|
|
fb52cb2d30 | ||
|
|
27b22a7ee3 | ||
|
|
ce63a5b611 | ||
|
|
f7440c020d | ||
|
|
093aaaa23e | ||
|
|
82798e99c8 | ||
|
|
6a30ec5343 | ||
|
|
242631c4bb | ||
|
|
91f068e4c5 | ||
|
|
5a391e843a | ||
|
|
3bfc215091 | ||
|
|
cf0868fec8 | ||
|
|
bbb1a4f8eb | ||
|
|
5175c71cc0 | ||
|
|
f160ee8782 | ||
|
|
a3a7413be8 | ||
|
|
88ca873f3a | ||
|
|
5d291c8ea5 | ||
|
|
990d5d72ea | ||
|
|
9704cd4873 | ||
|
|
e921d0feab | ||
|
|
83c79bb154 | ||
|
|
10fa640f5c | ||
|
|
8fd99b071d | ||
|
|
e8bccbdca9 | ||
|
|
329de3041b | ||
|
|
b8ecfa18c1 | ||
|
|
ea880d2b86 | ||
|
|
c171eecd7a | ||
|
|
1a2f656816 | ||
|
|
c885fc1f53 | ||
|
|
6b69ebf2b8 | ||
|
|
138d5e0f79 | ||
|
|
21ce8b7c64 | ||
|
|
377ed94b2f | ||
|
|
ad922a272d | ||
|
|
7f35cfda71 | ||
|
|
5d70df50ba | ||
|
|
d5b0e6d820 | ||
|
|
31b1a8fc7f | ||
|
|
6581d11cea | ||
|
|
387f15d895 | ||
|
|
a29baa30c8 | ||
|
|
51ea5cc70a | ||
|
|
7305cb156c | ||
|
|
6576719dcb | ||
|
|
a9dcde33e2 | ||
|
|
dfbf2ea001 | ||
|
|
9b83d1ca5d | ||
|
|
23882d31c4 | ||
|
|
3e307aacc4 | ||
|
|
280f379186 | ||
|
|
e9fc8bb300 | ||
|
|
31f38edf35 | ||
|
|
01400c0c15 | ||
|
|
4703eb404d | ||
|
|
230556b646 | ||
|
|
1747a5e505 | ||
|
|
d5bde1d658 | ||
|
|
8a3e0ced12 | ||
|
|
5212b2fe5b | ||
|
|
33ebd52387 | ||
|
|
df6d06def4 | ||
|
|
90087382e4 | ||
|
|
604c14ab00 | ||
|
|
41b87a238e | ||
|
|
af8f84a27c | ||
|
|
1dd908b102 | ||
|
|
c799969a81 | ||
|
|
b31ef32c1d | ||
|
|
c4d21e7632 | ||
|
|
1e2bf3960b | ||
|
|
26c019eaa1 | ||
|
|
65b152948e | ||
|
|
816627b16c | ||
|
|
ee6c1ea743 | ||
|
|
f3127955ba | ||
|
|
98f025430e | ||
|
|
70b41809f2 | ||
|
|
24d2325ecb | ||
|
|
7a205f6087 | ||
|
|
578c6035c8 | ||
|
|
b69656177b | ||
|
|
a3f5afb1c0 | ||
|
|
4fe14a780c | ||
|
|
20a7232d95 | ||
|
|
4f013f8e2d | ||
|
|
cf1134787a | ||
|
|
52a30fd21b | ||
|
|
670654ea87 | ||
|
|
1d66fd7a94 | ||
|
|
51b1d2af6a | ||
|
|
515206ec4e | ||
|
|
6025dd0bda | ||
|
|
d8868ab205 | ||
|
|
9e0017536d | ||
|
|
133c95cf8c | ||
|
|
ad84f02efb | ||
|
|
e74d81f2ed | ||
|
|
0a829ab104 | ||
|
|
db69449d9f | ||
|
|
c279668168 | ||
|
|
e956a266e2 | ||
|
|
ce1f3a7d83 | ||
|
|
e906d4548a | ||
|
|
b625bbd14a | ||
|
|
22fb5f281a | ||
|
|
3ee9dbea0c | ||
|
|
c671332b29 | ||
|
|
738c36932a | ||
|
|
c5149f12b6 | ||
|
|
86e031d9e8 | ||
|
|
ac997bb6c2 | ||
|
|
d3a39771c1 | ||
|
|
b5c3c7bfc9 | ||
|
|
d69d118cbd | ||
|
|
231fe2e1aa | ||
|
|
62c1407a4d | ||
|
|
9295bd2577 | ||
|
|
4a8cac0878 | ||
|
|
4d7c162d16 | ||
|
|
e77485a8f7 | ||
|
|
d58e6f2b00 | ||
|
|
185d90fe22 | ||
|
|
ead9008644 | ||
|
|
1d9584c087 | ||
|
|
a4e9a5ca8f | ||
|
|
e2d66a6d28 | ||
|
|
f5fa29184c | ||
|
|
8bafcd3aa7 | ||
|
|
dea3d7527a | ||
|
|
2170fa6dea | ||
|
|
e6ffafa264 | ||
|
|
6e07d060fc | ||
|
|
489a49d2fe | ||
|
|
8819b58a65 | ||
|
|
8cc4fc6111 | ||
|
|
0cc1641447 | ||
|
|
4fe8a2c1bd | ||
|
|
4a39d66973 | ||
|
|
837596dc21 | ||
|
|
a02ac0c1fc | ||
|
|
7dfbf440ef | ||
|
|
86bb3fa0c0 | ||
|
|
6d7c18c1f5 | ||
|
|
fc48083437 | ||
|
|
d6feb3c1d2 | ||
|
|
faa1891782 | ||
|
|
290db7ace3 | ||
|
|
ff4a3a6a94 | ||
|
|
79977b7fcf | ||
|
|
d070e7e557 | ||
|
|
9e773dfde2 | ||
|
|
531bc520c1 | ||
|
|
8864313c48 | ||
|
|
4d52ee2bc6 | ||
|
|
81aa9a36b6 | ||
|
|
cab346f50c | ||
|
|
e1b77165c9 | ||
|
|
c72b97bf5b | ||
|
|
f2939ffadd | ||
|
|
4f4e2bd506 | ||
|
|
3a88d5a68e | ||
|
|
283dd53bf5 | ||
|
|
c42142bc03 | ||
|
|
f961f0e976 | ||
|
|
93f294b76f | ||
|
|
ee06ab4069 | ||
|
|
8a23f7e215 | ||
|
|
7573b236ea | ||
|
|
40cc9d9d7a | ||
|
|
00bcd72637 | ||
|
|
594f61521b | ||
|
|
274ce69429 | ||
|
|
ea567a73f1 | ||
|
|
f2608c3fdb | ||
|
|
f331865e3b | ||
|
|
c2d127b3ed | ||
|
|
aab49be24a | ||
|
|
ec04c922aa | ||
|
|
37159e7863 | ||
|
|
1df149ec1a | ||
|
|
4c920d1da6 | ||
|
|
92a10866a9 | ||
|
|
8090041fbb | ||
|
|
a19f5933d5 | ||
|
|
afdb73e62f | ||
|
|
200052b51c | ||
|
|
05ed227dde | ||
|
|
2051682665 | ||
|
|
405934a483 | ||
|
|
965c9c2187 | ||
|
|
9c995e93d7 | ||
|
|
3f6108b646 | ||
|
|
442628d935 | ||
|
|
9e870afa39 | ||
|
|
0bbe641a91 | ||
|
|
85575e9a2c | ||
|
|
3909ab4195 | ||
|
|
cfd2a241da | ||
|
|
d6fd672624 | ||
|
|
379889339f | ||
|
|
9109d8dcdd | ||
|
|
5a6fe43d58 | ||
|
|
02795f9961 | ||
|
|
3652bc01ab | ||
|
|
02553b5e7c | ||
|
|
3f1c010615 | ||
|
|
93b12f5fbd | ||
|
|
483a4642f0 | ||
|
|
cfec25f3b2 | ||
|
|
36ff78d232 | ||
|
|
6cd07c5165 | ||
|
|
2a6d170dc0 | ||
|
|
743b3851b1 | ||
|
|
017aff4f6d | ||
|
|
9b654728ef | ||
|
|
60b2d65b2b | ||
|
|
ca6cf936b8 | ||
|
|
91dffe9126 | ||
|
|
3562eb2999 | ||
|
|
ac4a798570 | ||
|
|
718351f882 | ||
|
|
0d89395481 | ||
|
|
2148fe61a0 | ||
|
|
b311342faf | ||
|
|
f352444541 | ||
|
|
d480d23e97 | ||
|
|
b6a90547f6 | ||
|
|
712105cd5d | ||
|
|
601b837c56 | ||
|
|
5fed1466ef | ||
|
|
966b87e814 | ||
|
|
1606365a12 | ||
|
|
b2edf87b39 | ||
|
|
e3d0c91dbb | ||
|
|
8959144837 | ||
|
|
781a53b807 | ||
|
|
c6b91f789d | ||
|
|
bf61827518 | ||
|
|
4fee036f43 | ||
|
|
bd62c63c3b | ||
|
|
657edcd50e | ||
|
|
4b212d1ce6 | ||
|
|
3ec401ec84 | ||
|
|
0817d2a8db | ||
|
|
8c473e1f47 | ||
|
|
6f4cca9cff | ||
|
|
6dea22808e | ||
|
|
dff6e711ce | ||
|
|
d71eb7bbe6 | ||
|
|
7fe8812d3e | ||
|
|
f48a4916ea | ||
|
|
b510a6d11f | ||
|
|
35e7bcbb9d | ||
|
|
693207a845 | ||
|
|
2dd9f01a69 | ||
|
|
2785fbce1e | ||
|
|
60d87e1914 | ||
|
|
7976bcbd28 | ||
|
|
f71789ee71 | ||
|
|
84df96ef37 | ||
|
|
e0fe7b9c03 | ||
|
|
7b8ee930f4 | ||
|
|
5a605ae6f4 | ||
|
|
c36bff57ca | ||
|
|
e0d561a35b | ||
|
|
1a4f22e4ed | ||
|
|
1877b0779c | ||
|
|
c27bbc4086 | ||
|
|
e74b985432 | ||
|
|
2e32234461 | ||
|
|
537aefdb26 | ||
|
|
cb78ebc0de | ||
|
|
cec7e90996 | ||
|
|
95c970030b | ||
|
|
6b2003dd2a | ||
|
|
cbddc54b6f | ||
|
|
337541636b | ||
|
|
f1f8b8a9a2 | ||
|
|
7aed3d51fc | ||
|
|
cfaf694afa | ||
|
|
afc51baaa3 | ||
|
|
590f9c1dee | ||
|
|
f18254e433 | ||
|
|
e67005e748 | ||
|
|
8ae3f4b027 | ||
|
|
232afa4816 | ||
|
|
ec01d01400 | ||
|
|
3e202d75ff | ||
|
|
95d49b10b4 | ||
|
|
ca1d1f832a | ||
|
|
008810dc29 | ||
|
|
8266f8a515 | ||
|
|
6847fefad9 | ||
|
|
b357d0eaf8 | ||
|
|
3f1465a66e | ||
|
|
0dbabb9871 | ||
|
|
0fe632bcee | ||
|
|
1c0f136405 | ||
|
|
f114050fc8 | ||
|
|
8617cc60ad | ||
|
|
a0296da876 | ||
|
|
27fb752fce | ||
|
|
079d9711ac | ||
|
|
9e4b5f7c3a | ||
|
|
9009c4481b | ||
|
|
55218a98f2 | ||
|
|
68d423b3ee | ||
|
|
e721e560e5 | ||
|
|
b7e248dd06 | ||
|
|
56af2d063e | ||
|
|
bbc72d6eb6 | ||
|
|
26b5ef7435 | ||
|
|
debf741e82 | ||
|
|
9387719dac | ||
|
|
62f0dbb0c4 | ||
|
|
34e4269172 | ||
|
|
32604578de | ||
|
|
56834ff66a | ||
|
|
e40667440d | ||
|
|
77ddd3a35b | ||
|
|
be2668c027 | ||
|
|
86357a9c27 | ||
|
|
4dd47ffbc1 | ||
|
|
f67a65543d | ||
|
|
23e8d1762d | ||
|
|
a92fb5fe3d | ||
|
|
7e75bf8f88 | ||
|
|
03d354dcf9 | ||
|
|
6f34f1a68d | ||
|
|
7258842c29 | ||
|
|
7ed678f819 | ||
|
|
97f105e450 | ||
|
|
d926d95066 | ||
|
|
7982d27528 | ||
|
|
33ba4ec2a9 | ||
|
|
5320c897f5 | ||
|
|
16e1cbee07 | ||
|
|
cf4afd61f0 | ||
|
|
4db370ab9c | ||
|
|
dbccd75b06 | ||
|
|
9221981fa3 | ||
|
|
02c0ab8d0c | ||
|
|
174c79dcba | ||
|
|
202d7dd216 | ||
|
|
06d04d15a8 | ||
|
|
446e5d0fff | ||
|
|
16ff84429a | ||
|
|
1cb0d88186 | ||
|
|
db4820447f | ||
|
|
2fa5e6dd6a | ||
|
|
284bc523d6 | ||
|
|
73c8429282 | ||
|
|
59d5462a6a | ||
|
|
cf6c92949c | ||
|
|
b56fd4602f | ||
|
|
f83ff3eb73 | ||
|
|
4c4c8555eb | ||
|
|
7ed68c0f53 | ||
|
|
74bc24d9d5 | ||
|
|
9156c2c8d1 | ||
|
|
4c3f393743 | ||
|
|
a054e6e61e | ||
|
|
20ba4ec0bd | ||
|
|
9442b13939 | ||
|
|
e846baa14b | ||
|
|
288c73580b | ||
|
|
402b2a5d6d | ||
|
|
2a854ca8b9 | ||
|
|
154663e9a2 | ||
|
|
7665e9ef27 | ||
|
|
375c85e27f | ||
|
|
0413f52480 | ||
|
|
10591231ca | ||
|
|
3bc6f8155c | ||
|
|
b7a1130143 | ||
|
|
96b6bdff27 | ||
|
|
0ac169b474 | ||
|
|
a5dbe81a76 | ||
|
|
feccd9f104 | ||
|
|
806abdb87c | ||
|
|
17df2892bd | ||
|
|
1d9f6b8a57 | ||
|
|
09ad17f67e | ||
|
|
182ac10749 | ||
|
|
8b462c1acf | ||
|
|
df42e494d7 | ||
|
|
4fff0386ac | ||
|
|
57668a27cf | ||
|
|
7922481919 | ||
|
|
b5524a0981 | ||
|
|
104209a328 | ||
|
|
091e91c051 | ||
|
|
f8b9b0db69 | ||
|
|
dd7b4680da | ||
|
|
e6006d03ca | ||
|
|
00b2df7b8f | ||
|
|
9d1c26481a | ||
|
|
3ce44b1046 | ||
|
|
7588b1bd81 | ||
|
|
2c9ee99743 | ||
|
|
eb754de807 | ||
|
|
4e8c8fd992 | ||
|
|
bfa7b6b145 | ||
|
|
a412eb08cb | ||
|
|
5453d0be3c | ||
|
|
0c02153bb9 | ||
|
|
ba01cefc0c | ||
|
|
7a1fff1441 | ||
|
|
d8895c02f7 | ||
|
|
e303647058 | ||
|
|
5a35438c21 | ||
|
|
54fed6c652 | ||
|
|
be0eeccdbc | ||
|
|
8ad2f4a2e8 | ||
|
|
c626d9e47b | ||
|
|
79e729d6b2 | ||
|
|
a4bc9478f8 | ||
|
|
63b101f36d | ||
|
|
701bd7cfad | ||
|
|
032b459205 | ||
|
|
33a946d317 | ||
|
|
bd3132bcda | ||
|
|
56654596a3 | ||
|
|
10ec822b59 | ||
|
|
360675cee3 | ||
|
|
83a5bfdd04 | ||
|
|
e99e7c04ba | ||
|
|
86133ef45e | ||
|
|
85844ace95 | ||
|
|
c8ac4bb069 | ||
|
|
f0ee629b04 | ||
|
|
8bf4fe02db | ||
|
|
1e573a9acd | ||
|
|
63c15d292a | ||
|
|
4efa22c84e | ||
|
|
9f07657b48 | ||
|
|
de8120f5d0 | ||
|
|
7d759e6781 | ||
|
|
1e13eb646e | ||
|
|
ba8b703ba1 | ||
|
|
edb2032c4e | ||
|
|
820adaddf1 | ||
|
|
ed731497fe | ||
|
|
fd3f26c100 | ||
|
|
21d8c984da | ||
|
|
1220513252 | ||
|
|
4a35689b48 | ||
|
|
4b0707cf32 | ||
|
|
33de7a2ea4 | ||
|
|
24c5143122 | ||
|
|
49c891f2cf | ||
|
|
8c6da509f2 | ||
|
|
5f3515652a | ||
|
|
8b4000f4cb | ||
|
|
0b1226219c | ||
|
|
cc31ea96a5 | ||
|
|
7e5ef04b13 | ||
|
|
709286c0d2 | ||
|
|
773a26bb22 | ||
|
|
9ea5e71a75 | ||
|
|
33eb7d83ca | ||
|
|
1e57766b11 | ||
|
|
228a537bbe | ||
|
|
cd0957112b | ||
|
|
53fb0ea075 | ||
|
|
8771472210 | ||
|
|
5d70fbf6c1 | ||
|
|
8638a61df9 | ||
|
|
3f684e77a7 | ||
|
|
240d17f12f | ||
|
|
d47b44e3c2 | ||
|
|
cf00d75980 | ||
|
|
8b1195ffcc | ||
|
|
a30f028a12 | ||
|
|
9f1d0dec47 | ||
|
|
1324095627 | ||
|
|
08389808ee | ||
|
|
6735ebb271 | ||
|
|
68217ef564 | ||
|
|
7e686b1b95 | ||
|
|
565c322797 | ||
|
|
5e3bbea0ff | ||
|
|
678c204e32 | ||
|
|
7831d30265 | ||
|
|
06a18f169b | ||
|
|
96a19593b2 | ||
|
|
c0dcedcafc | ||
|
|
babad2694e | ||
|
|
4247839610 | ||
|
|
82c8a9e745 | ||
|
|
eb66458ed9 | ||
|
|
f84ba1b039 | ||
|
|
85ca1dfb08 | ||
|
|
fffbcf5297 | ||
|
|
7a4a5944f9 | ||
|
|
6c0c410acf | ||
|
|
13d840bc3f | ||
|
|
8c75ad3dd3 | ||
|
|
ee382ca76a | ||
|
|
4bb329eafb | ||
|
|
22d6f64f54 | ||
|
|
4dcb388c0c | ||
|
|
3bfef7eef1 | ||
|
|
1ac04fe9f4 | ||
|
|
a5783da8a9 | ||
|
|
de13056307 | ||
|
|
6ddd686141 | ||
|
|
39dbe1d41b | ||
|
|
a4838358f3 | ||
|
|
dbc6964fbb | ||
|
|
8dbbeaf55a | ||
|
|
aa5102490a | ||
|
|
ab185b11b5 | ||
|
|
20ee106672 | ||
|
|
83bbb90d10 | ||
|
|
32c7eaa9e3 | ||
|
|
6780b649c6 | ||
|
|
7d519f2f84 | ||
|
|
c051b3868b | ||
|
|
128b733eca | ||
|
|
5a5646dce1 | ||
|
|
55272d3df8 | ||
|
|
567b3cef6b | ||
|
|
d01370cdc2 | ||
|
|
09af5f967f | ||
|
|
5a468e740c | ||
|
|
61f288ced3 | ||
|
|
79fd46c3a1 | ||
|
|
51ad9501d1 | ||
|
|
98d95dd88e | ||
|
|
52e769d883 | ||
|
|
ec50085da3 | ||
|
|
71a4740847 | ||
|
|
13e67642fa | ||
|
|
f52ffb8943 | ||
|
|
359a3af2a1 | ||
|
|
13a74e6979 | ||
|
|
93313c576c | ||
|
|
f0688ad7e2 | ||
|
|
e20af627c2 | ||
|
|
cf0ea12384 | ||
|
|
119b85b736 | ||
|
|
39df209ddd | ||
|
|
823a48558c | ||
|
|
0320532962 | ||
|
|
8ea07b1fd2 | ||
|
|
fa0f9ed367 | ||
|
|
a597f24b5e | ||
|
|
92896a9945 | ||
|
|
efea424869 | ||
|
|
e23d66fb5c | ||
|
|
6ecd417b34 | ||
|
|
de73bd0123 | ||
|
|
b287aa2cf4 | ||
|
|
22ce3af972 | ||
|
|
e7ad3bbec2 | ||
|
|
21a0c57cb1 | ||
|
|
3491633aa0 | ||
|
|
093e9f5e97 | ||
|
|
328d08bd63 | ||
|
|
1740e6ee4e | ||
|
|
36101a55ad | ||
|
|
100148168a | ||
|
|
0a7fc83253 | ||
|
|
0b601a7bea | ||
|
|
37d7b91d48 | ||
|
|
6a836bee6f | ||
|
|
870a6679ff | ||
|
|
61a3c147c3 | ||
|
|
4b6328e052 | ||
|
|
cdd360043e | ||
|
|
da599af7cb | ||
|
|
0fd0323956 | ||
|
|
41da939988 | ||
|
|
ac1a484c84 | ||
|
|
598aaba8ca | ||
|
|
331221eec6 | ||
|
|
809198b916 | ||
|
|
95303a4bb2 | ||
|
|
c2042b1561 | ||
|
|
93c35c3352 | ||
|
|
c21663b3e7 | ||
|
|
af1e5ad881 | ||
|
|
f858b6891c | ||
|
|
d5bafdaa20 | ||
|
|
b88ef58a9f | ||
|
|
3f0696dada | ||
|
|
b2c0acb9ec | ||
|
|
ce5a09ea40 | ||
|
|
9e3315799c | ||
|
|
5f1793e21c | ||
|
|
c656292b96 | ||
|
|
96559e91fe | ||
|
|
ac524d4b94 | ||
|
|
2e844a0799 | ||
|
|
691881a505 | ||
|
|
f2ff18e71e | ||
|
|
d5968b8f21 | ||
|
|
da973fe6bf | ||
|
|
a1784083e9 | ||
|
|
5a6b8653b9 | ||
|
|
036cc83ed6 | ||
|
|
3a9f68eb11 | ||
|
|
b203fb3481 | ||
|
|
276c815f04 | ||
|
|
0ac98aa95a | ||
|
|
0c3ada7dd4 | ||
|
|
d8fc73b5c4 | ||
|
|
9531846163 | ||
|
|
b0f01a4778 | ||
|
|
f040ce584d | ||
|
|
9706aa1daa | ||
|
|
99caa5d43b | ||
|
|
2f39b484f5 | ||
|
|
dda0b783df | ||
|
|
533ef3988b | ||
|
|
7afbcb4fef | ||
|
|
27afe4e49b | ||
|
|
7f42813ad8 | ||
|
|
15fee4d3a6 | ||
|
|
1b6ccfe86c | ||
|
|
fb910c64cd | ||
|
|
177341f899 | ||
|
|
b5c6dfdd0c | ||
|
|
494defe52b | ||
|
|
9ae2115123 | ||
|
|
7cb18f7109 | ||
|
|
b87e105411 | ||
|
|
b147536a10 | ||
|
|
75b03f5f72 | ||
|
|
c8f88a0c0b | ||
|
|
d7357c0649 | ||
|
|
ca1b3ffbc8 | ||
|
|
055472d3b4 | ||
|
|
2f9260fe4c | ||
|
|
7dc2579bfe | ||
|
|
f2b3c3c2f6 | ||
|
|
63243be5ac | ||
|
|
22f066e708 | ||
|
|
7567b96c22 | ||
|
|
f0a988a26a | ||
|
|
ca4005f623 | ||
|
|
6bcb8eb1be | ||
|
|
67daaa7aac | ||
|
|
42e39d474b | ||
|
|
afecff3aa4 | ||
|
|
d4b10839b3 | ||
|
|
558d287af9 | ||
|
|
66a636a6ae | ||
|
|
b43cf1a583 | ||
|
|
bb4bc40cf9 | ||
|
|
e4e39b8263 | ||
|
|
48ab0fb57d | ||
|
|
6101d108e0 | ||
|
|
06362129fa | ||
|
|
5c40e7c41e | ||
|
|
7aacff63c9 | ||
|
|
cff218cf54 | ||
|
|
d6c9c23ff5 | ||
|
|
209fe717b1 | ||
|
|
51b01ca9b7 | ||
|
|
928863f85b | ||
|
|
959ad0e9ea | ||
|
|
4bc3097e6f | ||
|
|
f1afd5796c | ||
|
|
a0bad70bd1 | ||
|
|
f0f7b9de53 | ||
|
|
c7cdb687da | ||
|
|
e4b7bf4ae8 | ||
|
|
8ee14c990b | ||
|
|
2829eaeee8 | ||
|
|
623406cf2b | ||
|
|
009025e00d | ||
|
|
4d5491e285 | ||
|
|
dad0716e37 | ||
|
|
af2dca818c | ||
|
|
a38995a832 | ||
|
|
93252bd556 | ||
|
|
f3e63d9e71 | ||
|
|
cb25b1222e | ||
|
|
5cc16d86b0 | ||
|
|
8aa0c92bc6 | ||
|
|
7ebbe20fb0 | ||
|
|
2807ba18e1 | ||
|
|
52cb8bb275 | ||
|
|
14d9a59f1c | ||
|
|
99947a251e | ||
|
|
5bcc067687 | ||
|
|
dd509608a1 | ||
|
|
361a09e5fa | ||
|
|
8a7d806054 | ||
|
|
5a2189f3d3 | ||
|
|
04b0bc4c70 | ||
|
|
8c2f752c3d | ||
|
|
06545c3364 | ||
|
|
bcb0020705 | ||
|
|
f42659a8f1 | ||
|
|
ce4e09daff | ||
|
|
54ec3a8e2f | ||
|
|
7d33215124 | ||
|
|
fcd55e03cb | ||
|
|
045aaef644 | ||
|
|
56b75920b4 | ||
|
|
d3439023d3 | ||
|
|
82d975d671 | ||
|
|
0bede914ab | ||
|
|
8e9cd1e4ae | ||
|
|
3af5f84c9d | ||
|
|
ef943e75a5 | ||
|
|
c12d4bc7d4 | ||
|
|
6d4ab7372d | ||
|
|
62fc17983a | ||
|
|
81301ad2a9 | ||
|
|
7e70c1ad91 | ||
|
|
c49cdc9a64 | ||
|
|
7796f4d995 | ||
|
|
7e50dda96b | ||
|
|
43523e9854 | ||
|
|
63b272998c | ||
|
|
0d66693cc3 | ||
|
|
5e4a85f2e3 | ||
|
|
3160cab22b | ||
|
|
a9fd483aff | ||
|
|
90f67c6245 | ||
|
|
d7d966f7c6 | ||
|
|
3feb4b3bdd | ||
|
|
c1a4861eb1 | ||
|
|
f72897c29d | ||
|
|
3e591dabbd | ||
|
|
8e8d923fea | ||
|
|
5b293ecd4d | ||
|
|
690575e51f | ||
|
|
331823337c | ||
|
|
bc53807a17 | ||
|
|
9a17e7b6f5 | ||
|
|
d447d17602 | ||
|
|
18d11eea40 | ||
|
|
94bc5f6c55 | ||
|
|
f8d9ef14b5 | ||
|
|
303558e6cf | ||
|
|
ee56524324 | ||
|
|
276c876171 | ||
|
|
69fa5199bc | ||
|
|
2521b5550a | ||
|
|
7b083fe5d1 | ||
|
|
a3f77686ef | ||
|
|
1bce4ebfd8 | ||
|
|
9e959a0b8a | ||
|
|
5b52d07ea6 | ||
|
|
ed74428ca1 | ||
|
|
b6789ae332 | ||
|
|
7894c0cc1a | ||
|
|
26415d0465 | ||
|
|
4092f4b8c0 | ||
|
|
b5375a323d | ||
|
|
fb981b9650 | ||
|
|
788b25ccf8 | ||
|
|
b55d490ef0 | ||
|
|
0e5f26c6bb | ||
|
|
e8e88afd11 | ||
|
|
125da02aa7 | ||
|
|
5600f889b2 | ||
|
|
869eeb62f4 | ||
|
|
621fe70048 | ||
|
|
db44261039 | ||
|
|
2c0b8b5ac8 | ||
|
|
7c08c88a87 | ||
|
|
a27ed294df | ||
|
|
3a52ee44f5 | ||
|
|
81e0131bc9 | ||
|
|
ce6db81dce | ||
|
|
1dcee0c840 | ||
|
|
053712c95d | ||
|
|
52cd153723 | ||
|
|
4628f3021b | ||
|
|
563cb21539 | ||
|
|
cda27ae9ac | ||
|
|
023cb6474b | ||
|
|
49824ee8cb | ||
|
|
aa8b27ba1d | ||
|
|
9eea00c086 | ||
|
|
f681b37c7b | ||
|
|
afb0c684dc | ||
|
|
1dadb97552 | ||
|
|
6821da54f8 | ||
|
|
a92788ddd9 | ||
|
|
8ccce347a3 | ||
|
|
e0166ebc06 | ||
|
|
aa147184ba | ||
|
|
1a218328da | ||
|
|
02822cbc33 | ||
|
|
2c88f2950c | ||
|
|
f297719cdb | ||
|
|
1bfb1f7958 | ||
|
|
8b44285b90 | ||
|
|
746ce67b66 | ||
|
|
3b408ce516 | ||
|
|
33ed504ef4 | ||
|
|
7a9ad9d0c8 | ||
|
|
c5d640d8af | ||
|
|
f065529b6d | ||
|
|
c7f7b1c3d6 | ||
|
|
7e250d06f5 | ||
|
|
d8a322e7be | ||
|
|
9aea8d5bdc | ||
|
|
d9bf422f12 | ||
|
|
a05e8e7a75 | ||
|
|
48a8b14a47 | ||
|
|
196b2350f4 | ||
|
|
0e43d751ea | ||
|
|
d82728c4d0 | ||
|
|
d13f6d754f | ||
|
|
306c8a7fc8 | ||
|
|
85151a61ce | ||
|
|
433880bc6e | ||
|
|
1dd31c38a6 | ||
|
|
02d6ec2a6b | ||
|
|
070dfe0833 | ||
|
|
f9b8901791 | ||
|
|
c9bb8db0ad | ||
|
|
6313238c63 | ||
|
|
e5aa4c844f | ||
|
|
01ed90ccef | ||
|
|
17f132f9ee | ||
|
|
67e81da36b | ||
|
|
c3fe95d971 | ||
|
|
aeec4e198a | ||
|
|
e5fbf4414a | ||
|
|
4747a40964 | ||
|
|
2bcf787a29 | ||
|
|
7d52d5b786 | ||
|
|
314f107498 | ||
|
|
7f97086631 | ||
|
|
fd28fec38b | ||
|
|
c10c675f5b | ||
|
|
869c196fa0 | ||
|
|
c1218de0d2 | ||
|
|
3f48a5524d | ||
|
|
f63da06238 | ||
|
|
bed72caf06 | ||
|
|
9e9050a428 | ||
|
|
e3aeb15678 | ||
|
|
50bfff5502 | ||
|
|
cd2006f8b7 | ||
|
|
39f6b22dae | ||
|
|
65e6d82771 | ||
|
|
96fd258d07 | ||
|
|
acd6114fa7 | ||
|
|
71e3f6fde3 | ||
|
|
52d6ab608f | ||
|
|
1f4d09c09f | ||
|
|
4ceffd7131 | ||
|
|
01b178292e | ||
|
|
b9d17aaab4 | ||
|
|
f08430ec65 | ||
|
|
1d9a7c2623 | ||
|
|
4136916e2f | ||
|
|
8339e8c81d | ||
|
|
4d738adb38 | ||
|
|
90e2bc1580 | ||
|
|
3d05a0d9cc | ||
|
|
0e1db64f8d | ||
|
|
ba78cb9c53 | ||
|
|
f93ce67426 | ||
|
|
e30a2740cf | ||
|
|
a5a5902fbc | ||
|
|
a0bf6b0923 | ||
|
|
236d54114c | ||
|
|
a08dc937c7 | ||
|
|
b5f5e9a6d1 | ||
|
|
94ce166244 | ||
|
|
4e33a1d677 | ||
|
|
796c4a021a | ||
|
|
c85209985a | ||
|
|
f12728f13e | ||
|
|
96d4220a5d | ||
|
|
ef5b7e212d | ||
|
|
2560bfd5f9 | ||
|
|
55a6c270dd | ||
|
|
7145d1a21a | ||
|
|
25829488c4 | ||
|
|
58e24ac18a | ||
|
|
5ae3f32b24 | ||
|
|
e8f465f3d4 | ||
|
|
5fbe27828b | ||
|
|
d13824b0bc | ||
|
|
2d3ef1b8ae | ||
|
|
646db4f072 | ||
|
|
443b99805e | ||
|
|
d4346da6cb | ||
|
|
e6241dc703 | ||
|
|
205309f1c1 | ||
|
|
28f9dc6e56 | ||
|
|
50f0a1b5d8 | ||
|
|
269785f95e | ||
|
|
63931ff4e8 | ||
|
|
0076374125 | ||
|
|
f0552d929f | ||
|
|
c356371437 | ||
|
|
fdc253e99d | ||
|
|
8588b58a5e | ||
|
|
17bd995568 | ||
|
|
d8ad991022 | ||
|
|
4bfcb29c46 | ||
|
|
c791d60ad9 | ||
|
|
3516ee485a | ||
|
|
11781bdaa8 | ||
|
|
da536e8a32 | ||
|
|
5d2206d3af | ||
|
|
3d8bd038d2 | ||
|
|
26b123b7f9 | ||
|
|
daa7982110 | ||
|
|
78f8d04e63 | ||
|
|
720d32f581 | ||
|
|
7ceaa82d30 | ||
|
|
1e6c159422 | ||
|
|
9b09f412bf | ||
|
|
a7d6450ea1 | ||
|
|
fd87bb3321 | ||
|
|
1701a9e22f | ||
|
|
9f2e9c5140 | ||
|
|
6c40fa15b6 | ||
|
|
4f3f4699ea | ||
|
|
125300b563 | ||
|
|
0487650536 | ||
|
|
6393ab1486 | ||
|
|
53aea140df | ||
|
|
edabed5604 | ||
|
|
37d7d08482 | ||
|
|
f95edc016b | ||
|
|
65ee58da41 | ||
|
|
4f2dd59e24 | ||
|
|
7ef3076a56 | ||
|
|
4b8a100ec9 | ||
|
|
104de20298 | ||
|
|
96ab2781ab | ||
|
|
6b5f0dde77 | ||
|
|
f81c6b18f4 | ||
|
|
d172a6b581 | ||
|
|
48c3643753 | ||
|
|
2c73cc3b29 | ||
|
|
b56086ae33 | ||
|
|
1a6f498b8c | ||
|
|
7c7fe83615 | ||
|
|
9a1edceb46 | ||
|
|
f09d8b68ab | ||
|
|
2aa4138668 | ||
|
|
1570c5b30e | ||
|
|
f2fe56ff69 | ||
|
|
bbe27ffae9 | ||
|
|
ecc1aa80e7 | ||
|
|
a36fa329a2 | ||
|
|
1207465e59 | ||
|
|
5d10addd01 | ||
|
|
dcf9114329 | ||
|
|
30569aac45 | ||
|
|
3cb1eb0471 | ||
|
|
07e0885519 | ||
|
|
42c586b97c | ||
|
|
33d27f5bfe | ||
|
|
05585132ca | ||
|
|
98037c425d | ||
|
|
b55a6c9185 | ||
|
|
91ec4763fd | ||
|
|
e2f17b298c | ||
|
|
7297f5196e | ||
|
|
2dda8d7f97 | ||
|
|
2639ab7d03 | ||
|
|
41cf3b96db | ||
|
|
698459ea93 | ||
|
|
afeb7704c9 | ||
|
|
01c2701a0f | ||
|
|
eb3d12c6dd | ||
|
|
338405d343 | ||
|
|
ba290e05a8 | ||
|
|
6aefb8bae3 | ||
|
|
3ee8c8f0da | ||
|
|
620d013499 | ||
|
|
e1a84e442e | ||
|
|
447eb3b031 | ||
|
|
2c32cc81dd | ||
|
|
e9e7bc6db3 | ||
|
|
48ffdd79f7 | ||
|
|
739132e58d | ||
|
|
e3246872e3 | ||
|
|
7d0715d53d | ||
|
|
741ca16711 | ||
|
|
a7af382874 | ||
|
|
5aa3eff94f | ||
|
|
d69ec49dc6 | ||
|
|
e1b5df4b55 | ||
|
|
fc478e5935 | ||
|
|
879bfc7a34 | ||
|
|
d49b53b5e1 | ||
|
|
c4bc4871ee | ||
|
|
07d691174b | ||
|
|
bb8046c4a9 | ||
|
|
348b2f0730 | ||
|
|
71ffa09f41 | ||
|
|
88322d2ea0 | ||
|
|
a99ccfc6ef | ||
|
|
c6840056a9 | ||
|
|
15d87d2452 | ||
|
|
6b79bbe842 | ||
|
|
cd0dd562f0 | ||
|
|
ad671669ce | ||
|
|
55b31d5103 | ||
|
|
9bee15a080 | ||
|
|
3bea592273 | ||
|
|
9d0d2e5a69 | ||
|
|
09628fd51e | ||
|
|
4215a17639 | ||
|
|
075146773f | ||
|
|
41308d4b43 | ||
|
|
980c803cd7 | ||
|
|
1b2c932cc2 | ||
|
|
7af5579e3f | ||
|
|
7d77a63342 | ||
|
|
fe0fbdc5b6 | ||
|
|
221c80d26d | ||
|
|
8f51f72dc6 | ||
|
|
bc781c94ed | ||
|
|
c901d4c528 | ||
|
|
ac7768adbf | ||
|
|
736f4831a5 | ||
|
|
f6f0f285cc | ||
|
|
97c496fc9d | ||
|
|
fff675c448 | ||
|
|
46783929a3 | ||
|
|
7c2f1384d4 | ||
|
|
b81789eb1e | ||
|
|
68e32f6ac3 | ||
|
|
24eb90c524 | ||
|
|
ae64b9096e | ||
|
|
0cdb7d6a29 | ||
|
|
2b2bda778e | ||
|
|
4199c6d6a0 | ||
|
|
9c754da0fc | ||
|
|
1b6fae101a | ||
|
|
b0c60bd249 | ||
|
|
d9f6ea2fc3 | ||
|
|
8de073782c | ||
|
|
cd8d7c7c8a | ||
|
|
cb2ab20a11 | ||
|
|
974f278257 | ||
|
|
244cc30c14 | ||
|
|
a30af3e355 | ||
|
|
ecc51ad6de | ||
|
|
1d3b055eba | ||
|
|
a100c51f51 | ||
|
|
e4252b8092 | ||
|
|
830be36b56 | ||
|
|
58cb2362c6 | ||
|
|
9dd45ec800 | ||
|
|
270be258d3 | ||
|
|
63a48afcd5 | ||
|
|
028cf1a368 | ||
|
|
76bef75836 | ||
|
|
84aa8cce64 | ||
|
|
33f30aee64 | ||
|
|
2c2e4c463f | ||
|
|
8bf949b5d6 | ||
|
|
beceb905cd | ||
|
|
083b2df569 | ||
|
|
6d0fa9bdae | ||
|
|
00238ad1ba | ||
|
|
b291b0902d | ||
|
|
6c856de82d | ||
|
|
6cdea551cc | ||
|
|
64ed8f7141 | ||
|
|
78d420e9fe |
No files matched your search
-860
@@ -1,860 +0,0 @@
|
||||
PHP 3.0 CHANGE LOG ChangeLog
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
December 24 1998, Version 3.0.6
|
||||
- Fix GetImageSize() to work with non-standard jpg images
|
||||
- Add Mersenne Twister functions (mt_rand, mt_srand, etc)
|
||||
- Add str_replace() function
|
||||
- Add chunk_split() function
|
||||
- Fixed a bug in the memory limit code, in cases where $php_errormsg was
|
||||
also used.
|
||||
- Add iptcparse() function
|
||||
- Adobe FDF supported
|
||||
- getallheaders() NULL string fix <michale@utko.fee.vutbr.cz>
|
||||
- Add all configuration directives to phpinfo() page
|
||||
- Functions pack() and unpack() rewritten to be binary and buffer overrun
|
||||
safe and behave like the Perl functions for all implemented format codes.
|
||||
- Ensured that msql_error() will not return error messages generated by
|
||||
previously-run scripts.
|
||||
- Add base_convert() function
|
||||
- Make sprintf() and printf() output binary safe
|
||||
- Made gzgetc binary safe
|
||||
- Add convert_cyr_string() and quoted_printable_decode() functions
|
||||
- Fix ldap_free_result() core dump bug
|
||||
- Add support for current OpenLDAP-2.0-devel library
|
||||
- Add php3_asp_tags directive so it can be set from Apache config files
|
||||
- Added UTF-8 support in the XML extension
|
||||
- Make rand(min,max) safer on older platforms where the low-order bits have
|
||||
short cycles.
|
||||
- Added new pdf (Portable Document Format) module
|
||||
- Added an XML parsing extension using James Clark's "expat" library
|
||||
- Optimized parts of the token cache code.
|
||||
- Terminate on out-of-memory errors. Until now, PHP could crash in out of
|
||||
memory situations (clean-up, no real effect).
|
||||
- Unterminated comments in include files were being reported with the wrong line
|
||||
number. Fixed.
|
||||
- Added ImageCopy() and ImageColorDeallocate(). ImageCopy() is about
|
||||
20% faster than ImageCopyResized(). ImageColorDeallocate() marks
|
||||
palette entries free for reuse (by <mka@satama.com>).
|
||||
- In the CGI version, it was impossible to access resources (e.g. SQL links,
|
||||
images) from user-defined shutdown functions. Fixed.
|
||||
- Added optional third parameter to strpos() to specify the offset to
|
||||
start searching from.
|
||||
- Fixed a crash bug in unset() when unsetting illegal variables (rare).
|
||||
- Made ImageInterlace and ImageTransparentColor parameters optional, and made
|
||||
them return the current/new settings.
|
||||
- Optimized GetImageSize() <thies@digicol.de>.
|
||||
- Made odbc_autocommit() without args return status
|
||||
- Added connect workaround for OpenLink ODBC
|
||||
- Added minimal InterBase support. Tested only on 4.0 & Linux.
|
||||
- Fixed some memory leaks and bogus error messages in the URL handler of
|
||||
the various file open functions. Should only affect error handling
|
||||
in bad URLs.
|
||||
|
||||
October 5 1998 Version 3.0.5
|
||||
- mysql_field_flags now reports all MySQL flags and the result is suitable
|
||||
for automatic parsing. Compatibility warning: The result format has
|
||||
changed. If you have scripts parsing the result of this function, you
|
||||
may need to adapt them.
|
||||
- Made nl2br() binary safe (not that it's of much use).
|
||||
- Fixed a bug in the API function getThis(). It affected mostly the dir
|
||||
functions, if nested within objects.
|
||||
- Fixed a problem in require() in conjunction with switch(), and in some other
|
||||
cases. Also fixed an identical problem with the call_user_function() API
|
||||
function.
|
||||
- Removed -lpthread when compiling with MySQL support. It caused various
|
||||
serious problems when compiled into Apache.
|
||||
- Add serialize() and unserialize() functions from jkl@njet.net
|
||||
- Fix in_addr_t check for systems with in_addr_t in netinet/in.h
|
||||
- Add atan2() function
|
||||
|
||||
September 22 1998 Version 3.0.4
|
||||
- Added uksort() - array key sort using a user defined comparison function.
|
||||
- Added 'j' support to date() - generates the day of the month, without
|
||||
possible leading zeros.
|
||||
- Added support for multiple crypt() encryptions if the system supports it
|
||||
- Added optional support for ASP-style <% %> and <%= tags
|
||||
- Fixed data loss problems with very large numeric array indices on 64-bit
|
||||
platforms (e.g. DEC UNIX).
|
||||
- 2 cursor_type parameters for ifx_query() and ifx_prepare changed
|
||||
to 1 (bitmask). Added a few constants for use in Informix module.
|
||||
- Added php3.ini option ifx.charasvarchar. If set, trailing blanks
|
||||
are stripped from fixed-length char columns. (Makes life easier
|
||||
for people using Informix SE.)
|
||||
- Static SNMP module which compiles with ucd-snmp 3.5.2
|
||||
- fixed imap_header & header_info from crashing when a header line
|
||||
is > 1024 characters.
|
||||
- Added patch for rfc822_parse_adr to return an array of objects instead
|
||||
of a single object.
|
||||
- Informix Online 7.x & SE 7.x support now fairly complete and stable
|
||||
- Add dbase_get_record_with_names() function
|
||||
- Added a special case for open_basedir. When open_basedir is set to "."
|
||||
the directory in which the script is stored will be used as basedir.
|
||||
- Include alloca.c in the distribution for platforms without alloca().
|
||||
- Improved stripping of URL passwords from error messages - the length of the
|
||||
username/password isn't obvious now, and all protocols are handled properly
|
||||
(most importantly, http).
|
||||
- Copying objects that had member functions with static variables produced
|
||||
undetermined results. Fixed.
|
||||
- Added function lstat() and cleaned up the status functions,
|
||||
added tests for file status functions (this may break on some plattforms)
|
||||
- Fixed is_link() - it was returning always false.
|
||||
- Fixed apache_note() - it was corrupting memory.
|
||||
- New Function. void get_meta_tags(string filename); Parses filename until
|
||||
closing head tag and turns all meta tags into variables prefixed with 'meta_'.
|
||||
The below meta tag would produce $meta_test="some string here"
|
||||
<meta name="test" content="some string here">
|
||||
- Generalized some internal functions in order to better support calling
|
||||
user-level functions from C code. Fixes a few sporadic problems related
|
||||
to constructors inside eval() and more.
|
||||
- Fixed an endless loop in explode(), strstr() and strpos() in case of an
|
||||
invalid empty delimiter.
|
||||
- rand() now accepts two optional arguments, which denote the requested range
|
||||
of the generated number. E.g., rand(3,7) would generate a random number
|
||||
between 3 and 7.
|
||||
- Added M_PI constant.
|
||||
- Added deg2rad() and rad2deg() for converting radians<->degrees.
|
||||
- ImageArc() misbehaved when given negative angles, fixed.
|
||||
- Fixed a bug in ereg() that may have caused buglets under some circumstances.
|
||||
- Added imap_status
|
||||
- Shutdown functions, registered via register_shutdown_function(), could never
|
||||
generate output in the Apache module version. Fixed.
|
||||
- Brought IMAP docs into sync with acutal imap code
|
||||
- imap_fetchstructure now takes in optional flags
|
||||
- Fix potential core dumps in imap_append and imap_fetchtext_full
|
||||
- Fix problem in SetCookie() function related to long cookies
|
||||
- Add uasort() function to go along with usort (like sort() and asort())
|
||||
- Add port number to Host header as per section 14.23 of the HTTP 1.1 RFC
|
||||
- Fix imap_reopen to only take 2 arguments with an optional 3rd flags arg
|
||||
- Add optional 2nd argument to imap_close
|
||||
- Add CL_EXPUNGE flag to imap_open() flags
|
||||
- Fix 4th arg on imap_append(). It was getting converted to a long by mistake.
|
||||
- Fix shutdown warning in the LDAP module
|
||||
- *COMPATIBILITY WARNING* imap_fetchstructure() "parametres" object and property
|
||||
name changed to "parameters" to match the documentation and to be consistent
|
||||
with the rest of the API.
|
||||
- Delete uploaded temporary files automatically at the end of a request
|
||||
- Add upload_max_filesize and correponsing php3_upload_max_filesize directive
|
||||
to control the maximum size of an uploaded file. Setting this to 0 would
|
||||
completely eliminate file uploads.
|
||||
- Force $PHP_SELF to PATH_INFO value when running in CGI FORCE_CGI_REDIRECT mode
|
||||
- Add apache_lookup_uri() function which does an internal sub-request lookup
|
||||
and returns an object containing the request_rec fields for the URI. (Yes,
|
||||
you have to be a bit of a gearhead to figure this one out)
|
||||
- Fix a few signed char problems causing functions like ucfirst() not to work
|
||||
correctly with non-English charsets
|
||||
- md5() function not binary safe - fixed
|
||||
|
||||
August 15 1998 Version 3.0.3
|
||||
- Changed the name of fopen_basedir to open_basedir, to be a little more
|
||||
accurate about what it does.
|
||||
- Added Hyperwave module
|
||||
- Added config-option (php3_)enable_dl <on/off>. This enables/disables the
|
||||
dl() function. In safe-mode dl() is always disabled.
|
||||
- Auto-prepended files were crashing under some circumstances - fixed.
|
||||
- Win32 mail fixes provided by walton@nordicdms.com
|
||||
- Comparing between arrays and/or objects now generates a warning (it always
|
||||
returns false, as it used to; no comparison is made)
|
||||
- Fixed a bug in the syntax highlighting code, that made ending-double-quotes
|
||||
appear twice under certain circumstances.
|
||||
- Fix bug in filetype() function related to symlinks
|
||||
- Started integrating Informix SE support to PHP configure/makefile setup.
|
||||
- gdttf roundoff fixes from ellson@lucent.com
|
||||
- Added initial Informix SE support files from Danny Heijl - This code still
|
||||
needs to be integrated into the PHP configure/makefile setup and the code
|
||||
itself needs more work.
|
||||
- return in the global scope now terminates the execution of the current file.
|
||||
- Added the ability to register shutdown function(s), via
|
||||
register_shutdown_function($function_name).
|
||||
- Clean up const warnings
|
||||
- Add write support to ftp fopen wrappers
|
||||
- Add strspn() and strcspn() functions
|
||||
- On systems without strerror use Apache version if compiling as Apache module
|
||||
- The PHP start tag was being ignored under some circumstances - fixed.
|
||||
- The db, dbase and filepro functions are now Safe-Mode aware.
|
||||
- Added config-option (php3_)fopen_basedir <path>. This limits the directory-
|
||||
tree scripts can open files in to <path>.
|
||||
- Fixed pg_loreadall that didn't always return all the contents in a PostgreSQL
|
||||
large object. Also, doesn't pass through anything if method is HEAD.
|
||||
- configure fix to create target Apache module dir
|
||||
- Fix core dump in imageTTFtext() function
|
||||
- Added static IMAP support
|
||||
- Syntax highlighting was generating additional whitespace - fixed.
|
||||
- Added ucwords. Works like ucfirst, but works on all words within a string.
|
||||
- Added array_walk() - apply user function to every element of an array
|
||||
- Added usort() - array sort that accepts a user defined comparison function!
|
||||
- Added the ability to call user-level functions and object methods on demand
|
||||
from the C source using a completely generalized, slick API function.
|
||||
Miracles do happen every once in a while.
|
||||
- Added constructors. Don't even squeek about destructors! :) (we mean that)
|
||||
- Make pg_lowrite() binary safe
|
||||
- Fixed mod_charset option in ./setup
|
||||
- Fixed rewinddir() and dir()::rewind() under Win32 (they didn't work before).
|
||||
- Add Win32 COM support! By-name referencing is supported using the IDispatch
|
||||
interface (automation). Available functions - COM_Load(), COM_Invoke(),
|
||||
COM_PropGet() and COM_PropSet().
|
||||
|
||||
July 20 1998 Version 3.0.2a
|
||||
- Fix a quirk in the configuration file parser, the endless fountain of joy
|
||||
and fun.
|
||||
- Fix a bug in the API function add_method() that made dir() crash.
|
||||
|
||||
July 18 1998 Version 3.0.2
|
||||
- Compile cleanups for *BSD
|
||||
- Add support for the OpenLink ODBC Drivers
|
||||
- Add PHP_SELF, PHP_AUTH_* and HTTP_*_VARS PHP variables to phpinfo() output
|
||||
- Add workaround for broken makes
|
||||
- Add Apache 1.3.1 support (some Apache header files were moved around)
|
||||
- Added apache_note() function.
|
||||
- Fix order of system libraries and detect libresolv correctly
|
||||
- Fixed a bug in the Sybase-DB module. Several numeric field types were
|
||||
getting truncated when having large values.
|
||||
- Added testpages for unified odbc
|
||||
- Fix php -s seg fault when filename was missing
|
||||
- Made getdate() without args default to current time
|
||||
- Added ImageColorResolve() and some fixes to the freetype support.
|
||||
- Added strcasecmp()
|
||||
- Added error_prepend_string and error_append_string .ini and .conf directives
|
||||
to make it possible to configure the look of error messages displayed by PHP
|
||||
to some extent
|
||||
- Added E_ERROR, E_WARNING, E_NOTICE, E_PARSE and E_ALL constants, that can be
|
||||
used in conjunction with error_reporting()
|
||||
(e.g. error_reporting(E_ERROR|E_WARNING|E_NOTICE);
|
||||
- Fixed a crash problem with classes that contained function(s) with default
|
||||
values.
|
||||
- Fixed a problem in the browscap module. Browscap files weren't being read
|
||||
properly.
|
||||
- Fix -L path in libphp4.module to make ApacheSSL compile without errors
|
||||
- Fix StripSlashes so it correctly decodes a \0 to a NUL
|
||||
|
||||
July 04 1998 Version 3.0.1
|
||||
- echo/print of empty strings don't trigger sending the header anymore.
|
||||
- Implemented shift left and shift right operators (<< and >>)
|
||||
- Compile fix for cc on HP-UX.
|
||||
- Look for beta-version Solid libraries as well.
|
||||
- Make GD module show more info in phpinfo().
|
||||
- Compile fix for NextStep 3.0.
|
||||
- Fix for Oracle extension on OSF/1.
|
||||
- Fix gd 1.3 bug in ImageColorAt().
|
||||
- pg_loread() hopefully handles binary data now.
|
||||
- Turned off some warnings in dns.c
|
||||
- Added ImageTTFBBox() and made ImageTTFText() return bounding box.
|
||||
- Added constants for Ora_Bind()'s modes.
|
||||
- Renamed all hash_*() routines to _php3_hash_*() to avoid clashes with other
|
||||
libraries.
|
||||
- Changed uodbc default LONG behaviour: longreadlen 4096 bytes, binmode 1.
|
||||
The module now actually uses the php.ini settings.
|
||||
- New PostgreSQL functions: pg_fetch_row(), pg_fetch_array()
|
||||
and pg_fetch_object()
|
||||
- Fix a segmentation fault when calling invalid functions in certain
|
||||
circumstances
|
||||
- Fix bug that caused link-related functions to not pay attention to
|
||||
run-time safe mode setting (it was using whatever was set at compile time).
|
||||
- Fix bug in exec() function when used in safe mode
|
||||
|
||||
June 6 1998 Version 3.0
|
||||
- Add checkdnsrr function (check availability DNS records)
|
||||
- Add getmxrr function (get MX hostnames and weights)
|
||||
- Fixed bug in nl2br() function
|
||||
- Fix for an RC5 related problem in the Sybase module, when dealing
|
||||
with very long data types.
|
||||
- Speed up string concatenation by roughly a factor of 2
|
||||
- Add escape-handling to date function
|
||||
- Make base64 functions binary safe
|
||||
- Add strrpos function to complement strpos function added in RC5
|
||||
- Add ltrim function (strips only at the start of string)
|
||||
- Add rtrim as an alias to chop() for completeness sake
|
||||
- Add trim function (similar to chop, except it strips at the start as well)
|
||||
- Added 2 optional args to fsockopen function - errno and errstr
|
||||
- Fixed bug in split() function related to leading matches
|
||||
- Fixed problem in error_log() function (thanks to Jan Legenhausen)
|
||||
- empty("0") was returning true - fixed
|
||||
- Removed the old sybsql module. Use the new sybase_*() functions instead.
|
||||
- Several fixes to the configuration file parser
|
||||
- LDAP fixes - fixed return values on several functions
|
||||
|
||||
May 23 1998 Version 3.0RC5
|
||||
- The BC math library functions now compile in by default.
|
||||
- Fixed a bug in virtual() and other types of SSI's (e.g. <!--#exec). Under
|
||||
certain circumstances, this used to result in random problems.
|
||||
- Fixed a bug in virtual(). It was misbehaving if it was called before any
|
||||
other output.
|
||||
- Added mysql.default_port, mysql.default_host, mysql.default_user and
|
||||
mysql.default_password ini-file directives.
|
||||
- Improved handling of the MySQL default port. It now honors /etc/services
|
||||
and $MYSQL_TCP_PORT.
|
||||
- Fixed a crash in opening of broken ftp:// URLs, and improved error reporting
|
||||
in opening of URLs.
|
||||
- Fixed several non-critical scanner issues with syntax highlighting mode and
|
||||
the <script language=php> tag.
|
||||
- Fixed fseek on windows. (windows only): fseek will not return proper results
|
||||
on files opened as text mode. PHP uses binary mode as the default for file
|
||||
operations, but this can be overiden by fopen. Do not open files in text
|
||||
mode and use fseek on them!
|
||||
- Add strpos() function
|
||||
- Added zlib module, requires zlib >= 1.0.9
|
||||
- Improved the module API implementation. Dynamic modules may now register
|
||||
persistent resources (not that it makes much sense, but at least PHP
|
||||
won't crash). The API itself remains unchanged.
|
||||
- bcmod() wasn't always behaving like modulus should behave (it was behaving
|
||||
exactly like GNU bc's % operator). Fixed.
|
||||
- Changed the Sybase-DB module to always return strings, instead of auto-typing
|
||||
result sets. This was done for consistency with the other database modules,
|
||||
and in order to avoid overflows due to the platform-dependant limitations
|
||||
of the numeric data types of PHP. You can turn compatability mode on using
|
||||
the sybase.compatability_mode directive in the php3.ini file.
|
||||
- Fixed problems with the TINYINT field in the Sybase-CT module.
|
||||
- Applied some small speed optimizations to the Sybase-DB module querying code.
|
||||
- Added 'numeric' and 'type' properties to the object returned by
|
||||
sybase_fetch_field().
|
||||
- The 'new' operator doesn't accept all expressions anymore. Instead, it
|
||||
accepts a class name, or a variable reference (scalar, array element, etc).
|
||||
- Add ora_numcols() function
|
||||
- Add ora_do() and ora_fetch_into() functions to Oracle driver
|
||||
- Add persistent connection support to Oracle driver
|
||||
- Make Oracle driver clean up open connections and open cursors automatically
|
||||
- Added fread() and fwrite() that properly handle binary data.
|
||||
- Add Ora_ColumnSize() to Oracle code
|
||||
- The string "0" means FALSE again. This was done in order to maintain type
|
||||
conversion consistency.
|
||||
- Added solid_fetch_prev() for fetching the previous result row from Solid.
|
||||
- Huge integers are now automatically converted to floating point numbers
|
||||
(that have a wider range).
|
||||
- Floating point numbers are now displayed using scientific notation when
|
||||
they're extremely big or extremely small. The 'precision' php3.ini directive
|
||||
no longer designates the number of decimal digits, but rather, the maximum
|
||||
number of significant digits required.
|
||||
- Added support for scientific notation for floating point numbers (e.g. 1E7)
|
||||
throughout the entire language.
|
||||
- Fixed a potential/probable memory corruption problem with HEAD request
|
||||
handling.
|
||||
- Using un-encapsulated strings now generates a NOTICE-level warning
|
||||
(e.g. $a = foo; instead of $a = "foo";)
|
||||
- Added defined("name") function to check if a certain constant is defined
|
||||
or not.
|
||||
- Support new Apache mechanism for setting SERVER_SUBVERSION
|
||||
- Added PHP_OS and PHP_VERSION constants
|
||||
- Added the ability to define constants in runtime! Constants are script-wide,
|
||||
(there's no scope, once the constant is defined, it's valid everywhere).
|
||||
Syntax is define("name", $value [, $case_insensitive]). 'name' can be any name
|
||||
that is a valid variable name, *without* the $ prefix. 'value' can be
|
||||
any *scalar* value. If the optional 'case_insensitive' parameter is 1,
|
||||
then the constant is created case-insensitive (the default is case
|
||||
sensitive). Note: define() is currently *NOT* supported in preprocessed
|
||||
scripts.
|
||||
- Added general support for constants. The Syslog constants (e.g.
|
||||
LOG_ERR, LOG_CRIT, etc.) should be accessed as constants from now on (that
|
||||
is, without a $ prefix). You can still set define_syslog_variables to On
|
||||
in the php3.ini file if you want to define the various $ variables. The
|
||||
default for this directive in the php3.ini-dist file has been changed to
|
||||
Off.
|
||||
- The configuration file path variable now expands . and .. into their
|
||||
respective directories. You can obtain the path of the php3.ini file
|
||||
that was used by printing get_cfg_var("cfg_file_path").
|
||||
- Fixed a crash-recovery parser crash ($a=7; $a[3]+=5;)
|
||||
- Add gmmktime() function
|
||||
- Fixed a crash with implode() and empty arrays.
|
||||
- Fixed a bug that, under fairly rare circumstances, caused PHP not to
|
||||
recognize if(), require() and other statements as statements, and
|
||||
to complain about them as being unsupported functions.
|
||||
- Beautified php3.ini-dist and added more comments to it. Also changed
|
||||
the behavior of the configuration file parser to be brighter about
|
||||
the various constants (TRUE/FALSE/ON/OFF etc).
|
||||
- Fixed a bug in openlog() - the specified device name was being mangled.
|
||||
- Memory leaks were sometimes reported erroneously - fixed.
|
||||
- Improved the convertor to handle some quirks of the PHP/FI 2 parser with
|
||||
comments.
|
||||
- Fixed number_format() to properly handle negative numbers, and optimized it
|
||||
a bit.
|
||||
- Fixed static variables inside class member functions. Note that using such
|
||||
static variables inside member functions usually defeats the purpose of
|
||||
objects, so it is not recommended.
|
||||
- Fixed a bug in fpassthru() (the file was being closed twice).
|
||||
- Added strftime().
|
||||
- Add set_socket_blocking() function to control blocking on socket fd's
|
||||
- The sendmail_path in php3.ini was being ignored - fixed.
|
||||
- Fixed a bug with file upload, with files that contained the MIME boundary
|
||||
inside them.
|
||||
- Fixed a bug with form variables of type array, with spaces in their
|
||||
index (e.g. name="foo[bar bar]").
|
||||
- gd-1.3 autodetect and support
|
||||
- Year 2000 compliance is now togglable from the php3.ini file. Setting PHP
|
||||
to be y2k compliant effects the way it creates cookies, and means it'll
|
||||
NOT work with many browsers out there that are not y2k compliant! For
|
||||
that reason, the default for this option is off.
|
||||
- safe mode / fix from monti@vesatec.com
|
||||
- Integrated the FreeType support in the GD extension.
|
||||
- Added --with-gd=DIR and --without-gd options to configure
|
||||
|
||||
April 18 1998 Version 3.0 Release Candidate 4
|
||||
- Auto-prepended and auto-appended files were reporting the wrong filename
|
||||
in errors and in __FILE__ - fixed.
|
||||
- Fix GPC problem related to mixed scalar and array vars with the same name
|
||||
- Made putenv() Apache-safe. Environment variables may no longer leak in
|
||||
between requests.
|
||||
- The trailing semicolon is no longer required in class declarations.
|
||||
- Fixed a memory leak in the (array) and (object) operators under certain
|
||||
conditions.
|
||||
- <script> tags weren't working unless short tags were enabled - Fixed.
|
||||
- Fixed a bug in certain array indices that weren't treated as numbers
|
||||
even though they looked like numbers (e.g. "10", "20").
|
||||
- Changes to support renamed API functions in Apache-1.3
|
||||
- Fixed the -p and -e command line switches
|
||||
- Fix a segfault when calling command line version without parameters
|
||||
- Fix for feof() when used on a socket
|
||||
- Fix off-by-one error in fgets() when used on a socket
|
||||
- Fix bug in ImageSetPixel() (Thanks to ecain@Phosphor.net)
|
||||
|
||||
March 31 1998 Version 3.0 Release Candidate 3
|
||||
- Tiny bugfix for magic_quotes_sybase
|
||||
- Fix Apache build problems introduced in RC2
|
||||
- $a["0"]==$a[0] fix
|
||||
- Apache-1.3 build changes to support 100% automatic builds and shared library
|
||||
module builds. See INSTALL file.
|
||||
|
||||
March 30 1998 Version 3.0 Release Candidate 2
|
||||
- Changed the socket implementation under UNIX to not use FILE pointers, in
|
||||
order to work around the buggy Solaris libc (and possibly buggy libc's
|
||||
in other platforms).
|
||||
- Fixed a bug in min() and max() with certain arrays.
|
||||
- *WARNING* Move Apache 1.3 php3 file install to src/modules/php4 instead of
|
||||
src/modules/extra. Make sure you change your AddModule line correctly
|
||||
in your Apache Configuration file. This change is to take advantage of
|
||||
new Apache-1.3 configuration mechanism which makes it easier to build an
|
||||
Apache server with PHP automatically enabled. It will also help building
|
||||
a shared library module version of PHP soon.
|
||||
- Fixed a crash bug with auto-appended files.
|
||||
- Made --enable-discard-path work on all Unix servers #!/path/php CGI scripts
|
||||
should now work everywhere. I have tested on Apache, WN and Netscape 2.0
|
||||
- Made $a["123"] and $a[123] be identical. $a["0123"] is still different,
|
||||
though.
|
||||
- Added 'precision' ini directive, to set the number of decimal digits
|
||||
displayed for floating point numbers (default - 6).
|
||||
- Made integer/integer divisions evaluate to floating point numbers when
|
||||
applicable (e.g., 5/2==2.5(float), but 4/2==2(int))
|
||||
- Get rid of reliance on tied streams and move all socket reads and writes
|
||||
to recv/send calls
|
||||
- Cleaned up head.c a bit and fixed CGI SetCookie order problem
|
||||
- Changed default variable parsing order to Get-Cookie-Post (GPC)
|
||||
- Fixed setup so it has all configure options and defaults.
|
||||
- Added optional decimal point and thousands seperator to number_format()
|
||||
e.g., number_format(1500,2,',','.') == 1.500,00
|
||||
- Fixed cgi bug in windows that prevented files from being parsed on many
|
||||
systems and servers.
|
||||
|
||||
March 23 1998 Version 3.0 Release Candidate
|
||||
- Added support for the Raima database (ALPHA)
|
||||
- Fixed a bug in persistent PostgreSQL links and the connection-string method.
|
||||
- Added EXTENSION_STATUS file, that specifies the stability and status of
|
||||
every module in the distribution.
|
||||
- Added optional parameters to user functions with default values, variables
|
||||
that are forced to be passed by reference and variables that can be
|
||||
optionally passed by reference. The ini file directive
|
||||
'ignore_missing_userfunc_args' is no longer supported.
|
||||
- Added fhttpd support (by Alex Belits)
|
||||
- Improved performance by approximately 20-30%.
|
||||
- Added mysql_error(), mysql_errno() (if available) and msql_error().
|
||||
Errors coming back from the database backend no longer issue warnings.
|
||||
Instead, use these functions to retreive the error.
|
||||
- Patched count(), each(), prev(), next(), reset() and end() to work around
|
||||
the implementation side effects of unset(). As far as the users are
|
||||
concerned, this should be transparent now (even though it's slower now,
|
||||
until it's thoroughly fixed in 3.1).
|
||||
- Added number_format(). number_format(2499,2)=='2,499.00'.
|
||||
- error_reporting() now sets the error reporting level to the supplied
|
||||
argument, without any interpretations.
|
||||
- Fixed a lookahead parser bug that occured under rare circumstances.
|
||||
- Change the comparison operators to compare numeric strings as numbers. If
|
||||
you want to compare them as strings, you can use the new C-like strcmp()
|
||||
- Fixed Ora_GetColumn() bug when fetching strings
|
||||
- Added Ora_ColumnName() and Ora_ColumnType()
|
||||
- Preliminary LONG and LONG RAW support in Oracle extension
|
||||
- Add \123 and \xAB style octal and hex escapes to "" and `` strings
|
||||
- Add "-c" command line flag for specifying path to php3.ini file
|
||||
- Improved list() so that elements can be skipped, for example:
|
||||
list($name,,,$realname) = explode(":",fgets($passwd_file));
|
||||
- Fixed a tiny bug in the hash initialization which caused excessive use of
|
||||
memory. Report and fix by short@k332.feld.cvut.cz
|
||||
- Fixed strtolower() and strtoupper() to work with 8-bit chars
|
||||
- Fixed to compile and run on SunOS 4.1
|
||||
- Fixed a crash in soundex() of an empty string
|
||||
- Fixed parse_str() - it wasn't always defining the right variables,
|
||||
and didn't work with arrays.
|
||||
- Made [m,My]SQL create/drop database functions return success status
|
||||
- Fixed some memory leak/crash problems in the Adabas module
|
||||
- Added each() in order to allow for easy and correct array traversing.
|
||||
- Make Apache module version respect LOCALE setting
|
||||
- Add support for Apache 1.3b6+ ap_config.h file
|
||||
- Fixed a nasty corruption bug in eval() and show_source() that resulted in
|
||||
script termination (e.g. eval("exit();").
|
||||
- Fixed a syntax highlighting problem with keywords used as variable
|
||||
names.
|
||||
- Fixed a possible crash and/or file descriptor leak
|
||||
- Fixed line number being off by one in #! shell style execution
|
||||
- Made it possible to disable auto_prepend/append with "none" filename
|
||||
- Allow safe CGI calling through #!php style scripts
|
||||
|
||||
March 2 1998 Version 3.0b6
|
||||
- Made [s]printf handle %ld
|
||||
- Changed CGI version to only open regular files as input script
|
||||
- Added ignore_missing_userfunc_args directive to suppress warnings messages
|
||||
about missing arguments to user-defined functions
|
||||
- Added Postgres function - pg_cmdtuples(), by Vladimir Litovka
|
||||
- Disabled command line options if used as CGI
|
||||
- Changed CGI version to use PATH_TRANSLATED as the script file name
|
||||
- Link with solid shared library instead of static one
|
||||
- Fixed a crash with functions that aren't being called correctly
|
||||
- Fixed file descriptor leak in auto-prepend/append
|
||||
- Imap module is usable. See README in dl/imap.
|
||||
|
||||
February 24 1998 Version 3.0b5
|
||||
- Made the URL aware file functions be enabled by default
|
||||
- Fixed an unlikely crash bug in the parser, with uninitialized array elements
|
||||
which are refered to as objects.
|
||||
- Fixed several fields that were being incorrectly read in Sybase CT.
|
||||
- Fix Apache-1.3 related SIGHUP problem which was preventing php3.ini from
|
||||
getting re-read on a SIGHUP
|
||||
- *** WARNING *** Downwards incompatible change: The plus operator (+) is not
|
||||
longer overloaded as concatenation for strings. Instead, it converts its
|
||||
arguments to numbers and performs numeric addition.
|
||||
- Add Stig and Tin's bdf2gdfont script to extra/gd directory
|
||||
- Added join() as an alias to implode()
|
||||
- Made implode() accept arguments in the order used by explode() as well
|
||||
- Made $php_errormsg local in function calls
|
||||
- Fixed Apache configuration directive bugs
|
||||
- Added a number of .ini directives to Apache .conf directive list
|
||||
- Fixed a 'memory leak' with strtok()
|
||||
- echo/print now handle binary data correctly.
|
||||
- NEW now accepts any expression for the class name argument.
|
||||
- Add ImageDashedLine() GD function
|
||||
- Add arg_separator .ini directive so the '&' GET method separator can be
|
||||
changed to ';' for example. Corresponding php3_arg_separator Apache .conf
|
||||
directive works as well.
|
||||
- Walked around an implementation side effect of switch(). <? switch(expr) { ?>
|
||||
now works.
|
||||
- Added memory caching, resulting in a significant performance boost
|
||||
- Added support for for(): .. endfor; loops
|
||||
- Added a new predicate - empty($var). Returns true if $var is not set,
|
||||
or is FALSE. Returns false otherwise.
|
||||
- Added is_integer() (same as is_long()) and is_real() (same as is_double()).
|
||||
- Added sizeof() as an alias to the count() function
|
||||
- Added --enable-force-cgi-redirect, to prevent the CGI from working if
|
||||
someone directly accesses PHP not through Apache's CGI redirect
|
||||
(off by default).
|
||||
- Fixed marking of deleted dBase records. Noticed by Simon Gornall
|
||||
<simon@oyster.co.uk>.
|
||||
- Fixed fixed "%%" bug in [s]printf
|
||||
- Fixed a UMR (initialized memory read) in the Oracle code
|
||||
- Potential fix for mysql-related SIGPIPE problem which caused httpd to spin
|
||||
- Made PHP responsive to the Apache link status (stop executing if the link
|
||||
dies).
|
||||
- Fixed a crash bug with StrongHold and secure pages
|
||||
- Fixed StrongHold installation
|
||||
- Optimized the function call sequence a bit.
|
||||
- Fixed Sybase/CT date/datetime/money fields work to correctly.
|
||||
- Fixed Apache module startup problems - php3_module_startup should only be
|
||||
called once.
|
||||
- Fixed ord() with characters >127
|
||||
- Fixed bug in file_exists() function
|
||||
- Fixed stripslashes() to remove the escaping quote (instead of backslash)
|
||||
in case magic_quotes_sybase is true.
|
||||
- Also make echo and print automatically remove trailing decimal zeros.
|
||||
- Added htmlentities(), currently handling only ISO-8859-1 entities
|
||||
- "0" is no longer considered false, the only string which is false is the
|
||||
empty string "".
|
||||
- Added 'true' and 'false' keywords
|
||||
- Added 'xor' (logical exclusive or)
|
||||
- Automatic conversion from double to string removes decimal trailing zeros.
|
||||
- Added arsort() and rsort() to sort in descending order.
|
||||
- Turned on "XLATOPT_NOCNV" by default for uODBC/Solid.
|
||||
- Added support for a port number in the mysql_(p)connect() functions
|
||||
- Fixed a file descriptor leak in the configuration parser.
|
||||
- Fixed a few buglets with syntax highlighting with certain language keywords
|
||||
- Added functions to control minimum severity level of Sybase messages to
|
||||
display.
|
||||
- Added highlight_string() - behaves like highlight_file(), only instead
|
||||
of highlighting a file, it syntax highlights the contents of its
|
||||
argument.
|
||||
- Renamed show_source() to highlight_file(). show_source() is still
|
||||
supported for downwards compatability.
|
||||
- Fixed a bug in class inheritence - member functions with upper case
|
||||
letters in their names couldn't be redefined.
|
||||
- Made chown(), chgrp() and chmod() return TRUE/FALSE instead of 0/-1.
|
||||
|
||||
February 02 1998 Version 3.0b4
|
||||
- Fixed a segfault bug in one of the unified ODBC error messages.
|
||||
- Set default file modes to binary on Win32 (solved a lot of bs)
|
||||
- Fixed file copy on Win32
|
||||
- MIME file uploads fixed on Win32
|
||||
- Added contributed icons by Colin Viebrock (undex extra/icons)
|
||||
- Fixed the debugger enough to call it "beta code".
|
||||
- Fixed some leaks in the Oracle module, tidied up the code a bit.
|
||||
- Added __FILE__ and __LINE__ which evaluate to the currently parsed file
|
||||
and currently parsed line respectively.
|
||||
- Added ImageColorAt(), ImageColorSet(), ImageColorsForIndex(), and
|
||||
ImageColorsTotal() to allow manipulating the palette of GIF images.
|
||||
- Rename '--enable-url-includes' option to '--enable-url-fopen-wrapper' to
|
||||
better describe what it does, and pay attention to the setting.
|
||||
- Added optional parameter to the file(), readfile() and fopen() functions
|
||||
to look for files located in the include path.
|
||||
- Fixed bug that allowed the file() and readfile() to open files in the
|
||||
include path inadvertantly.
|
||||
- Fixed a (documented) bug in printf()/sprintf() with hard limited strings
|
||||
and alignment (e.g. %-.20s).
|
||||
- Optimized several quoted string routines.
|
||||
- Added error_log ini directive to select where errors get logged when
|
||||
log_errors is turned on or the error_log() function is used.
|
||||
- Added the ability to direct errors to log files instead of or in addition
|
||||
to the script output. Use the new display_errors and log_errors
|
||||
php3.ini directives.
|
||||
- Made environment variables uneraseable by POST/GET/Cookie variables.
|
||||
- Fixed a bug in the elseif() construct. The expression was being evaluated
|
||||
even if a previous if/elseif already evaluated to true and got executed.
|
||||
- Fixed a bug in the exit code parameter of system()
|
||||
- Tighten up all exec() related functions in safe mode
|
||||
- Added error_log() function to log messages to the server error log, or
|
||||
stderr for the CGI version.
|
||||
- Added support for a general memory limit of scripts.
|
||||
- Fixed a segfault bug that occured under certain circumstances with shell
|
||||
escapes ($foo = `...`)
|
||||
- Made keywords be valid property names of objects.
|
||||
- Fixed a segfault bug when creating new objects of an unknown class.
|
||||
- Fixed a problem with the maximum execution time limit, that may have
|
||||
prevented this feature from working on certain platforms.
|
||||
- PHP would now warn you with E_NOTICE about unknown escape characters,
|
||||
e.g. "\f". It would still be considered as a backslash followed by f,
|
||||
but the proper way of writing this is "\\f" or '\f'.
|
||||
- Added support for ${...} inside encapsulated strings. Supported: ${foo},
|
||||
${foo[bar]}, ${foo[0]}, ${$foo[$bar]}, ${$foo->bar} and ${$foo}
|
||||
- Fixed a bug in automatic persistent link reconnect of the Sybase/DB module.
|
||||
Thanks to Steve Willer for finding that 'stealth' bug!
|
||||
- Fixed a crash bug in the GET/POST/Cookie parser in case of regular
|
||||
and array variables with the same name.
|
||||
- Added round() function.
|
||||
- Can't use encapsed strings as variable names anymore, ie. $"blah blah".
|
||||
- Fixed bug in gethostby*() functions that resulted in a core dump.
|
||||
(Noticed by torben@coastnet.com.)
|
||||
- Fixed bug in dbase_get_record that prevented number and date fields
|
||||
from being properly decoded. (Thanks again to colins@infofind.com.)
|
||||
- Make dbase_get_record include a 'deleted' field that indicates whether
|
||||
that record had been marked for deletion.
|
||||
- Fixed bug in dbase library that stomped on the deleted flag of the first
|
||||
record in the file if it was set. (Thanks to colins@infofind.com.)
|
||||
- Fixed putenv() to not report a memory leak and possibly prevent a bug
|
||||
from that memory being freed.
|
||||
- Added setlocale()
|
||||
- Added pg_fieldisnull() (by Stephan Duehr)
|
||||
- Changed pg_exec() to always return a result identifier on succees
|
||||
- Solid linking fixes (tries to find the right library)
|
||||
- Fixed a but with date() and the 'w' element.
|
||||
- Tried to eliminate unimportant memory leak notifications.
|
||||
- Made min() and max() backwards compatible and able to handle doubles.
|
||||
- Add fgetc() function
|
||||
- Fixed bug in getmyuid(), getmyinode() and getlastmod(). Thanks to
|
||||
khim@sch57.msk.ru for pointing this out.
|
||||
- Fixed http:// URL includes with no path specified send request for /.
|
||||
- Added GetAllHeaders() (Apache-only)
|
||||
- Added workaround that made the Image text functions 8-bit clean
|
||||
- Made snmp internally compilable for Win32 (not the unix one though),
|
||||
only adds 2k to binary size, so no reason not to have it there.
|
||||
- Fixed ldap loading on Win32
|
||||
- Fixed MySQL Info function on Win32 platform
|
||||
- Fixed compilation of syntax highlighting mode
|
||||
|
||||
January 17 1998 Version 3.0b3
|
||||
- Added mysql support under windows ;) happy happy joy joy
|
||||
- Fixed dbase.dll for Win32 to actualy load now.
|
||||
- Enhanced the convertor to recognize ?> as a php-close-block as well.
|
||||
- Fixed potential SetCookie() core dumps
|
||||
- Changed print to be an expression instead of a statement. That means you can
|
||||
now do stuff like foobar() or print("Unable to foobar!"). echo has NOT been
|
||||
changed.
|
||||
- Removed the flex optimization flags to reduce the size of the scanner
|
||||
- Added memory leak logging into apache log files (apache module only)
|
||||
- Fixed a nasty bug in one of the internal stacks. This may have caused
|
||||
random crashes in several occassions.
|
||||
- Fixed bug in ImageGif() making it hang sometimes
|
||||
- Added ImageLoadFont(), ImageFontWidth() and ImageFontHeight()
|
||||
- error_reporting() now returns the old error reporting level
|
||||
- Fixed url includes/opens not working under Win32
|
||||
- Fixed errorneous handling of multipart/form-data input
|
||||
- Added rawurlencode(), rawurldecode() and changed urlencode() and urldecode()
|
||||
a bit too.
|
||||
- Fixed a bug in [s]printf, sign was forgotten for doubles.
|
||||
- Fixed a segfault bug in pg_fieldprtlen(), and made it accept field names
|
||||
in addition to field offsets.
|
||||
- Made the setup script a little more user-friendly.
|
||||
- Added is_long(), is_double(), is_string(), is_array() and is_object()
|
||||
- Fixed a bug in freeing of mSQL results.
|
||||
- Improved pg_exec() to properly return true or false with queries that don't
|
||||
return rows (i.e. insert, update, create, etc)
|
||||
- Added get_cfg_var() to enable checking cfg file directives from within
|
||||
a script.
|
||||
- Fixed a bug with urlencode() and characters 0x80-0xff
|
||||
- Changed the behaviour of ereg_replace to more intuitive. The
|
||||
backslashes other than valid existing back references in the second
|
||||
argument are no more evaluated as escape sequences.
|
||||
- Fixed a bug in the configuration file loader and safe mode.
|
||||
- Fixed a bug with configuration variables taken from the environment.
|
||||
- Added <script language=php> </script> as PHP open/close tags, to allow
|
||||
the use of editors such as Microsoft Frontpage.
|
||||
- Fixed a bug in the default php3.ini directory - it wasn't defaulting to
|
||||
/usr/local/lib properly.
|
||||
- Added support for \r\n line endings
|
||||
- Fixed a bug that may have prevented POST method variables from working
|
||||
with certain scripts when using the CGI version.
|
||||
- Convertor: Added support for single-quoted strings
|
||||
- Fixed segfault bug in the Adabas module, with queries that don't return
|
||||
rows (update, insert, etc).
|
||||
|
||||
December 22 1997 Version 3.0b2
|
||||
- Changed variable type conversions that do not specify base to always use
|
||||
base 10. "010" is no more 8, it is 10. Use intval ($x, 0) to get C-style
|
||||
octal and hex numbers recognized.
|
||||
- Fixed a possible segfault bug in several functions, when using the concat
|
||||
operator and possibly other operators/functions.
|
||||
- # is no longer accepted as a comment in php3.ini. Use ; instead.
|
||||
- Added browscap support
|
||||
- Configuration file directives are now case-sensitive
|
||||
- Fixed msql_tablename() and msql_dbname()
|
||||
- Added a PHP/FI 2.0 -> PHP 3.0 convertor
|
||||
- Added support for shell/perl-style single quotes
|
||||
- Added support for execution of external programs using backquotes ($a=`ls -l`)
|
||||
- fixed mail() on windows, also fixed memory leaks in mail on windows
|
||||
- added sendmail_from to handle return route on windows
|
||||
- Changed the way the config file is searched. The file name is now
|
||||
php3.ini (hardcoded), and it'll be looked for in: local directory, $PHPRC
|
||||
and builtin path designated by ./configure under UNIX or Windows directory
|
||||
under Windows.
|
||||
- Fixed ereg_replace replacing empty matches and a one off buffer overflow
|
||||
- Fixed File upload on windows platform
|
||||
- Fixed a bug that caused 'HTTP/1.1 100 Continue' messages with
|
||||
Internet Explorer 4.0 and certain scripts that receive POST variables
|
||||
- Get/POST/Cookie data variables are from now *ALWAYS* strings. If you want
|
||||
to use them in integer/real context, you must explicitly change their types.
|
||||
This was done in order to avoid possible loss of data when doing these
|
||||
conversions automatically.
|
||||
- Variables named as keywords are now allowed (e.g. $function, $class, etc)
|
||||
- Fixed a problem with msql() and mysql() with NULL fields
|
||||
- Fixed a segfault bug with class declarations
|
||||
- Fixed bugs with FOR loops and include() from within eval()
|
||||
- Changed include() to be executed conditionally. PHP-3.0 efficient
|
||||
unconditional include is now require()
|
||||
|
||||
December 08 1997 Version 3.0b1
|
||||
- Switched to public beta test phase
|
||||
- Generalized unset() and isset() to work on any type of variables, including
|
||||
specific array indices or object properties (e.g., unset($a[4]) now works).
|
||||
- Added support for object references inside encapsulated strings
|
||||
(for example, 'echo "Username: $user->name"' now works)
|
||||
- Added arbitary precision math support (basic operations with
|
||||
unlimited range numbers, and support for unlimited decimal digits)
|
||||
- Apache module can now handle preprocessed scripts (by using:
|
||||
AddType application/x-httpd-php3-preprocessed .php3p
|
||||
in the Apache configuration)
|
||||
- Made settype() pass its first parameter by value. Improved it to be able
|
||||
to convert to arrays and objects (originally by Steve Willer)
|
||||
- Implemented CPU time limit on scripts when setitimer() is available
|
||||
- Computed field names in the Sybase/CT and Sybase/DB modules are now named
|
||||
computed, computed1, computed2, ...
|
||||
- Added Sybase/CT client/server message handlers and updated the Sybase/DB ones
|
||||
- Made the regexp function automatically take arguments by reference
|
||||
when necessary
|
||||
- Added builtin support for auto append and prepend in the parser level
|
||||
- Improved the Sybase/CT sybase_query(). Should be more stable now, and
|
||||
hopefully work with a wider range of queries. It's difficult to work
|
||||
without docs, though, so it may still not be 100% right...
|
||||
- Changed error messages to show error type, file and line with bold
|
||||
- Added support for autoprepend and autoprepend
|
||||
- Added some more warning flags if gcc is used
|
||||
|
||||
December 03 1997 Version 3.0a4
|
||||
- Improved the internal functions API - no need to explicitly pass
|
||||
parameters by reference to internal functions that specifically
|
||||
require them, e.g. sort(), ksort(), reset(), count(), etc.
|
||||
This is *STILL* downwards compatible with the previous alphas,
|
||||
in the sense that you can explicitly pass the arguments by reference
|
||||
if you want to.
|
||||
- use srandom/random instead of srand/rand if available
|
||||
- Added [m,My]sql_listfields() for downwards compatability
|
||||
- -p now replaces .php3 extension with .php3p (otherwise it adds .php3p)
|
||||
- Added C++ style comments (// comment)
|
||||
- Fixed # commenting to terminate at a close PHP tag
|
||||
- Added \0 back reference for full string match to *reg*_replace and
|
||||
added backslash escaping to replace string
|
||||
- Fixed a few bugs in the Sybase DB-library module.
|
||||
- Added Sybase CT-library support. It should be considered experimental.
|
||||
Syntax is identical to the one of the DB-library. Allows people to
|
||||
connect to MS-SQL servers from Linux without having to pay for a
|
||||
library!
|
||||
- Beautified phpinfo()
|
||||
- Add ImageColorClosest() and ImageColorExact() GD functions
|
||||
- Make all .ini directives work as Apache .conf directives as well
|
||||
- Added PHP2-like File() function with PHP3 URL support
|
||||
- Upgraded the Sybase interface. It's practically MySQL compatible now!
|
||||
Among other things, added sybase_fetch_array() and sybase_fetch_object().
|
||||
- Fixed problem in multi dimensional array handling and self modifying
|
||||
operators (+=, -=, etc).
|
||||
- Safe Mode file open implementation
|
||||
- SVR3 portability problem fix
|
||||
|
||||
November 23 1997 Version 3.0a3
|
||||
- Made the global statement behave like PHP 2 with undefined variables
|
||||
- Added msql_fetch_object() and msql_fetch_array()
|
||||
- Switched between the 1st and 2nd parameters to explode(), so that it acts
|
||||
like split()
|
||||
- Fixed passthru(), exec() and system() functions
|
||||
- Implemented second optional parameter to intval() to specify conversion base
|
||||
(The default is to assume you want to do a base 10 conversion.)
|
||||
- Implemented SQL safe mode for MySQL
|
||||
- Read UploadTmpDir from php3.ini instead of apache conf files
|
||||
- Added mysql_fetch_object() and mysql_fetch_array()
|
||||
- Changed function->old_function. function is now an alias to cfunction.
|
||||
- Split the magic_quotes directive to get/post/data and other
|
||||
- Added generic copy() function
|
||||
- Added a $GLOBALS[] array, which contains all global variables
|
||||
- Fix broken getimagesize() function
|
||||
- Made mysql_fetch_field() and msql_fetch_field() optionally accept a 2nd argument
|
||||
- Fixed mysql_data_seek() and msql_data_seek()
|
||||
- Changed list assignment to list(...) and array init to array(...)
|
||||
- Made <?php_track_vars?> work
|
||||
- cgi when not in debug mode uses regular malloc(), free() functions now
|
||||
- Added preliminary support for perl-style list assignments
|
||||
- Fixed a bug in mysql_result() and msql_result() when specifying table
|
||||
- renamed internal error-handling function and levels
|
||||
- Added basename and dirname functions similar to sh counterparts
|
||||
- Added base64_encode() and base64_decode()
|
||||
- Support Basic authorization for http url includes
|
||||
- Added parse_url() function to extract url components
|
||||
- Made it possible to use anonymous ftp on URL includes
|
||||
- Fixed url includes to handle different URLs better
|
||||
- Fixed mysql_field*() functions
|
||||
- Made mysql_connect() smarter, after a mysql_close() (applies to msql and pgsql too)
|
||||
|
||||
November 6 1997 Version 3.0a2
|
||||
- Fixed a segfault bug caused by non-persistent connect in [m,My,Postgres]SQL modules
|
||||
- Fix command line argument handling
|
||||
- Made empty array list assignments work ($a=({});)
|
||||
- Made '$' escaping optional when a variable name parsing isn't possible
|
||||
- Added support for mysql_[p]connect(host) and mysql_[p]connect(host,user)
|
||||
- New layout in phpinfo()
|
||||
- Update Oracle extension to use php3_list functions
|
||||
- Add includepath support
|
||||
- Add #!php shell script escape support
|
||||
- Change name of CGI/command line version from php3.cgi to php
|
||||
- Add SNMP extension
|
||||
- show_source() support
|
||||
- Parsing of command-line args for CGI version
|
||||
- Support for backreferences in ereg_replace
|
||||
- Support for hexadecimal numbers directly at the scanner level
|
||||
- Support octal numbers directly at the scanner level
|
||||
- Fixed problem with huge html files (with little or no php code)
|
||||
- Fix eval() empty string argument core dump
|
||||
- renamed 'install' to 'setup' to be more accurate and avoid name conflict
|
||||
- Fixed Oracle compilation
|
||||
- Fixed mSQL 1.0 compilation
|
||||
- Fixed a problem in the mSQL, MySQL and PostgresSQL drivers and NULL fields.
|
||||
- Fixed the GLOBAL statement to be able to declare an array.
|
||||
|
||||
October 29 1997 Version 3.0a1
|
||||
- Start with excellent new parser from Andi and Zeev
|
||||
@@ -1,25 +1,28 @@
|
||||
Installation Instructions for PHP 4.0
|
||||
-------------------------------------
|
||||
|
||||
For the impatient here is a quick set of steps that will build PHP
|
||||
as an Apache module for Apache 1.3.0 with MySQL support. A more verbose
|
||||
Note! As of 4.0b3, PHP will require GNU make.
|
||||
|
||||
For the impatient here is a quick set of steps that will build PHP as
|
||||
an Apache module for Apache 1.3.x with MySQL support. A more verbose
|
||||
explanation follows.
|
||||
|
||||
|
||||
QUICK INSTALL
|
||||
|
||||
gunzip apache_1.3.x.tar.gz
|
||||
tar xvf apache_1.3.x.tar
|
||||
gunzip php-4.0.x.tar.gz
|
||||
tar xvf php-4.0.x.tar
|
||||
cd apache_1.3.x
|
||||
./configure --prefix=/www
|
||||
cd ../php-4.0.x
|
||||
./configure --with-mysql --with-apache=../apache_1.3.x --enable-track-vars
|
||||
make
|
||||
make install
|
||||
cd ../apache_1.3.x
|
||||
./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
|
||||
$ gunzip -c apache_1.3.x.tar.gz | tar xf -
|
||||
$ cd apache_1.3.x
|
||||
$ ./configure
|
||||
$ cd ..
|
||||
|
||||
$ gunzip -c php-4.0.x.tar.gz | tar xf -
|
||||
$ cd php-4.0.x
|
||||
$ ./configure --with-mysql --with-apache=../apache_1.3.x --enable-track-vars
|
||||
$ make
|
||||
$ make install
|
||||
|
||||
$ 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
|
||||
@@ -157,3 +160,29 @@ Installing PHP can be done in four simple steps:
|
||||
|
||||
When you are finished making changes to your srm.conf file, you can
|
||||
start up your server.
|
||||
|
||||
USING PHP3 AND PHP4 AS CONCURRENT APACHE MODULES
|
||||
|
||||
Recent operating systems provide the ability to perform versioning and
|
||||
scoping. This features make it possible to let PHP3 and PHP4 run as
|
||||
concurrent modules in one Apache server.
|
||||
|
||||
This feature is known to work on the following platforms:
|
||||
|
||||
- Linux with recent binutils (binutils 2.9.1.0.25 tested)
|
||||
- Solaris 2.5 or better
|
||||
- FreeBSD (3.2, 4.0 tested)
|
||||
|
||||
To enable it, configure PHP3 and PHP4 to use APXS (--with-apxs) and the
|
||||
necessary link extensions (--enable-versioning). Otherwise, all standard
|
||||
installations instructions apply. For example:
|
||||
|
||||
$ ./configure \
|
||||
--with-apxs=/apache/bin/apxs \
|
||||
--enable-versioning \
|
||||
--with-mysql \
|
||||
--enable-track-vars
|
||||
|
||||
If this also works on your platform or if you know a way to do it, please
|
||||
report it to our bug database at http://bugs.php.net
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 2.0
|
||||
The PHP License, version 2.01
|
||||
Copyright (c) 1999 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
@@ -17,25 +17,32 @@ are met:
|
||||
|
||||
3. The name "PHP" must not be used to endorse or promote products
|
||||
derived from this software without prior permission from the
|
||||
PHP Group. This does not apply to add-on libraries or tools
|
||||
that work in conjunction with PHP. In such a case the PHP
|
||||
name may be used to indicate that the product supports PHP.
|
||||
PHP Group. This does not apply to add-on libraries or tools
|
||||
that work in conjunction with PHP. In such a case the PHP
|
||||
name may be used to indicate that the product supports PHP.
|
||||
|
||||
4. The PHP Group reserves the right to modify the PHP license at
|
||||
any time and without prior notice, as long as the changes keep
|
||||
the free and open source nature of PHP.
|
||||
4. The PHP Group may publish revised and/or new versions of the
|
||||
license from time to time. Each version will be given a
|
||||
distinguishing version number.
|
||||
Once covered code has been published under a particular version
|
||||
of the license, you may always continue to use it under the
|
||||
terms of that version. You may also choose to use such covered
|
||||
code under the terms of any subsequent version of the license
|
||||
published by the PHP Group. No one other than the PHP Group has
|
||||
the right to modify the terms applicable to covered code created
|
||||
under this License.
|
||||
|
||||
5. Redistributions of any form whatsoever must retain the following
|
||||
acknowledgment:
|
||||
"This product includes PHP, freely available from
|
||||
http://www.php.net/".
|
||||
http://www.php.net/".
|
||||
|
||||
6. Permission to freely distribute and use Zend as an integrated
|
||||
part of PHP is granted, under the conditions of version 0.91
|
||||
of the Zend License.
|
||||
The license is bundled with the Zend engine, and is available
|
||||
at http://www.zend.com/license/0_91.txt, or by contacting
|
||||
license@zend.com.
|
||||
of the Zend License.
|
||||
The license is bundled with the Zend engine, and is available
|
||||
at http://www.zend.com/license/0_91.txt, or by contacting
|
||||
license@zend.com.
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +64,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals on behalf of the PHP Group.
|
||||
|
||||
The PHP Group can be contacted via Email at php-group@php.net.
|
||||
The PHP Group can be contacted via Email at group@php.net.
|
||||
|
||||
For more information on the PHP Group and the PHP project,
|
||||
please see <http://www.php.net>.
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
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: 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: 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
|
||||
--------------------------------------------------------------------------------
|
||||
@@ -15,3 +15,6 @@ oci8 Working (but no blob-support yet)
|
||||
oracle Working
|
||||
iptc Working
|
||||
informix Working
|
||||
zlib Working
|
||||
sysvshm Working
|
||||
odbc Working (except for persistent connections)
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
ZEND_DIR = $(srcdir)/libzend
|
||||
SUBDIRS = libzend ext sapi $(TSRM_DIR) $(REGEX_DIR)
|
||||
|
||||
BUILDLDFLAGS = $(EXTRA_LDFLAGS) $(LDFLAGS)
|
||||
|
||||
phptemp_LTLIBRARIES = libphp4.la
|
||||
libphp4_la_SOURCES = \
|
||||
main.c internal_functions.c snprintf.c php3_sprintf.c \
|
||||
configuration-parser.y configuration-scanner.l request_info.c \
|
||||
safe_mode.c fopen-wrappers.c php3_realpath.c alloca.c \
|
||||
php_ini.c SAPI.c rfc1867.c dlist.c php_content_types.c strlcpy.c \
|
||||
strlcat.c mergesort.c
|
||||
|
||||
libphp4_la_DEPENDENCIES = \
|
||||
libzend/libzend.la \
|
||||
sapi/$(PHP_SAPI)/libphpsapi_$(PHP_SAPI).la \
|
||||
$(REGEX_LIB) \
|
||||
$(EXT_LTLIBS) \
|
||||
$(TSRM_LIB)
|
||||
|
||||
libphp4_la_LIBADD = $(libphp4_la_DEPENDENCIES) $(EXTRA_LIBS)
|
||||
|
||||
libphp4_la_LDFLAGS = $(BUILDLDFLAGS) $(PHP_RPATHS)
|
||||
|
||||
configuration-parser.h configuration-parser.c: configuration-parser.y
|
||||
$(YACC) -p cfg -v -d $< -o configuration-parser.c
|
||||
|
||||
configuration-scanner.c: configuration-scanner.l
|
||||
$(LEX) -Pcfg -o$@ -i $<
|
||||
|
||||
EXTRA_PROGRAMS = php
|
||||
|
||||
noinst_PROGRAMS = $(PHP_PROGRAM)
|
||||
php_SOURCES = stub.c
|
||||
php_LDADD = libphp4.la
|
||||
php_LDFLAGS = -export-dynamic
|
||||
|
||||
install-data-local:
|
||||
$(INSTALL_IT)
|
||||
-238
@@ -1,238 +0,0 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP HTML Embedded Scripting Language Version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | 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. |
|
||||
# +----------------------------------------------------------------------+
|
||||
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
bindir = @bindir@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
ZEND_DIR = $(srcdir)/libzend
|
||||
SUBDIRS=libzend ext @TSRM_DIR@
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
LN_S = @LN_S@
|
||||
CC = @CC@
|
||||
AR = ar rc
|
||||
BINNAME = @BINNAME@
|
||||
INSTALL_IT = @INSTALL_IT@
|
||||
EXTRA_LIBS = @EXTRA_LIBS@
|
||||
EXT_LIBS = @EXT_LIBS@
|
||||
INCLUDES = @INCLUDES@
|
||||
INCLUDE = -I$(srcdir) -I. -I$(ZEND_DIR) -I$(srcdir)/TSRM $(INCLUDES)
|
||||
PROF_CFLAGS =
|
||||
CFLAGS_SHLIB = @CFLAGS_SHLIB@
|
||||
LDFLAGS_SHLIB = @LDFLAGS_SHLIB@
|
||||
LDFLAGS_SHLIB_EXPORT = @LDFLAGS_SHLIB_EXPORT@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CFLAGS = @CFLAGS@ $(CFLAGS_SHLIB) $(CPPFLAGS) $(INCLUDE) @DEBUG_CFLAGS@ @STRONGHOLD@ $(PROF_CFLAGS)
|
||||
LDFLAGS = @RPATHS@ @LDFLAGS@ $(LDFLAGS_SHLIB) $(LDFLAGS_SHLIB_EXPORT) -L$(ZEND_DIR)
|
||||
REGCFLAGS = $(CFLAGS)
|
||||
RANLIB = @RANLIB@
|
||||
YACC = @YACC@
|
||||
MAINT = @MAINT@
|
||||
APXS = @APXS@
|
||||
APXS_LDFLAGS = $(EXTRA_LIBS) $(LIBS)
|
||||
APXS_EXP = @APXS_EXP@
|
||||
WARNING_LEVEL = @WARNING_LEVEL@
|
||||
LEX_CFLAGS = -w$(WARNING_LEVEL) @LEX_CFLAGS@
|
||||
EXT_SHARED = @EXT_SHARED@
|
||||
|
||||
SOURCE = main.c internal_functions.c snprintf.c php3_sprintf.c \
|
||||
configuration-parser.c configuration-scanner.c request_info.c \
|
||||
safe_mode.c fopen-wrappers.c php3_realpath.c alloca.c output.c \
|
||||
php_ini.c SAPI.c cgi_main.c rfc1867.c dlist.c
|
||||
OBJS = main.o internal_functions.o snprintf.o php3_sprintf.o \
|
||||
configuration-parser.o configuration-scanner.o request_info.o \
|
||||
safe_mode.o fopen-wrappers.o php3_realpath.o alloca.o output.o \
|
||||
php_ini.o SAPI.o cgi_main.o rfc1867.o dlist.o
|
||||
|
||||
PHPLIBS = -Llibzend -lzend -Lext -lphpext
|
||||
LIBS = $(PHPLIBS) $(EXTRA_LIBS) @LIBS@
|
||||
|
||||
all: $(BINNAME)
|
||||
|
||||
all-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-depend-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
for subdir in $(SUBDIRS); do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) || fail=yes; \
|
||||
done && test -z "$$fail"
|
||||
|
||||
# CGI binary or fhttpd module
|
||||
php: all-recursive $(OBJS) @REGEX_LIB@ @FHTTPD_LIB@ @TSRM_LIB@
|
||||
$(CC) $(CFLAGS) -o $(BINNAME) $(LDFLAGS) $(OBJS) $(LIBS)
|
||||
|
||||
# Apache modules
|
||||
libphp4.a libmodphp4.a: all-recursive $(OBJS) @REGEX_LIB@
|
||||
$(AR) $@.tmp $(OBJS)
|
||||
$(srcdir)/scripts/armerge $@ $@.tmp ext/libphpext.a libzend/libzend.a @TSRM_LIB@
|
||||
@rm -f $@.tmp
|
||||
$(RANLIB) $(BINNAME)
|
||||
|
||||
# Apache modules
|
||||
libmodphp4-so.a: all-recursive $(OBJS) @REGEX_LIB@
|
||||
$(AR) $@.tmp $(OBJS)
|
||||
$(srcdir)/scripts/armerge $@ $@.tmp ext/libphpext.a libzend/libzend.a @TSRM_LIB@
|
||||
@rm -f $@.tmp
|
||||
$(RANLIB) libmodphp4-so.a
|
||||
|
||||
# Apache 1.3 shared module
|
||||
libphp4.so: $(srcdir)/mod_php4.c libmodphp4-so.a @REGEX_LIB@
|
||||
-@test -f ./mod_php4.c || test -L ./mod_php4.c || $(LN_S) $(srcdir)/mod_php4.c ./mod_php4.c
|
||||
-@test -f ./mod_php4.c || test -h ./mod_php4.c || $(LN_S) $(srcdir)/mod_php4.c ./mod_php4.c
|
||||
$(APXS) $(INCLUDE) -c -o libphp4.so @RPATHS@ ./mod_php4.c libmodphp4-so.a $(APXS_LDFLAGS) $(APXS_EXP)
|
||||
|
||||
regex/libregex.a:
|
||||
(cd regex; $(MAKE) lib)
|
||||
|
||||
configuration-parser.h configuration-parser.c: $(srcdir)/configuration-parser.y
|
||||
bison -p cfg -v -d $(srcdir)/configuration-parser.y -o configuration-parser.c
|
||||
|
||||
configuration-scanner.o: configuration-scanner.c
|
||||
$(CC) $(CFLAGS) $(LEX_CFLAGS) -c configuration-scanner.c
|
||||
|
||||
configuration-scanner.c: $(srcdir)/configuration-scanner.l
|
||||
flex -Pcfg -oconfiguration-scanner.c -i $(srcdir)/configuration-scanner.l
|
||||
|
||||
clean: clean-recursive
|
||||
-rm -f libphp4.a libmodphp4.a libphp4.so php *.o
|
||||
-rm -f test/php.desc test/php.in test/php.out test/php.test
|
||||
-rm -f test/a.tmp test/b.tmp test/test.dbm*
|
||||
|
||||
distclean: clean distclean-recursive
|
||||
-rm -f *-parser.[ch] *-scanner.c *.output
|
||||
-rm -f config.status config.cache config.log
|
||||
-rm -f Makefile Makefile.depend php_config.h build-defs.h
|
||||
-rm -f libphp4.module stamp-h
|
||||
-rm -f regex/*.o regex/*.a regex/*.ih
|
||||
-rm -f doc/checkdoc doc/funcparse doc/version.ent
|
||||
-rm -f do-conf test/test.log
|
||||
-rm -f doc/Makefile regex/Makefile
|
||||
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
tar chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
|
||||
distdir:
|
||||
-rm -rf $(distdir)
|
||||
files=`echo *` ;\
|
||||
mkdir $(distdir) ;\
|
||||
for file in $$files ; do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file ; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
(cd $(distdir) ; $(MAKE) distclean)
|
||||
cd $(distdir)/libzend ;\
|
||||
flex -Pzend -ozend-scanner.c -i zend-scanner.l ;\
|
||||
bison -p zend -v -d zend-parser.y -o zend-parser.c
|
||||
cd $(distdir) ;\
|
||||
flex -Pcfg -oconfiguration-scanner.c -i configuration-scanner.l ;\
|
||||
bison -p cfg -v -d configuration-parser.y -o configuration-parser.c
|
||||
find $(distdir) -name CVS -o -name .cvsignore | xargs rm -rf
|
||||
|
||||
maintainer-clean-depend: maintainer-clean-depend-recursive
|
||||
|
||||
bench: $(BINNAME)
|
||||
./$(BINNAME) -c. tests/bench.phtml
|
||||
|
||||
# can't use a single rule for this because 'test' is a directory
|
||||
test: regression
|
||||
regression check: $(BINNAME)
|
||||
cd test && ./testall
|
||||
|
||||
config.status: configure
|
||||
./config.status --recheck
|
||||
|
||||
build-defs.h php_config.h: stamp-h
|
||||
stamp-h: php_config.h.in config.status
|
||||
CONFIG_FILES='build-defs.h stamp-h' ./config.status
|
||||
|
||||
Makefile: Makefile.in config.status
|
||||
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
|
||||
|
||||
#
|
||||
# You must use '--enable-maintainer-mode' with configure to enable
|
||||
# these rules, which requires autoconf be installed.
|
||||
#
|
||||
configure: @MAINT@ configure.in aclocal.m4
|
||||
cd $(srcdir) && autoconf
|
||||
|
||||
php_config.h.in: @MAINT@ stamp-h.in
|
||||
stamp-h.in: configure.in aclocal.m4 acconfig.h
|
||||
cd ${srcdir} && autoheader && touch ${srcdir}/stamp-h.in
|
||||
|
||||
install: install-recursive $(BINNAME)
|
||||
$(INSTALL_IT)
|
||||
|
||||
install-recursive:
|
||||
if test "$(EXT_SHARED)" != ""; then \
|
||||
for dir in X $(EXT_SHARED); do \
|
||||
test -d ext/$$dir && (cd ext/$$dir; $(MAKE) install); \
|
||||
done; \
|
||||
fi
|
||||
|
||||
indent: clean
|
||||
indent -v -kr -cli4 -ts4 \
|
||||
-T pval -T HashTable -T Bucket -T Token -T TokenCache -T TokenCacheManager \
|
||||
-T switch_expr -T internal_function -T control_structure_data \
|
||||
-T MemoryHashTable -T MemoryBucket \
|
||||
-T pvalue_value -T Stack *.c *.h
|
||||
rm -f *~
|
||||
|
||||
.c.o:
|
||||
@rm -f $@
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
# @bn=`echo $@ | sed -e 's#functions/##'`; test -f $@ || \
|
||||
# (test "$@" != "$$bn" && test -f "$$bn" && mv $$bn $@)
|
||||
|
||||
parser-scanner: configuration-parser.c configuration-scanner.c
|
||||
|
||||
depend: parser-scanner
|
||||
$(CC) $(CFLAGS) -MM $(SOURCE) | perl -pe 's|regex/regex.h||;' > Makefile.depend
|
||||
$(CC) $(CFLAGS) -MM $(FUNCTIONS_SOURCE) | perl -pe 's|^(.+\.o)|functions/$$1|; s|regex/regex.h||;' >> Makefile.depend
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 4
|
||||
# End:
|
||||
@@ -0,0 +1,302 @@
|
||||
PHP 4.0 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
November 16 1999, Version 4.0 Beta 3
|
||||
- ucfirst()/ucwords() no longer modify arg1. (Thies)
|
||||
- Fixed strtr() not to modify arg1. (Thies)
|
||||
- Added Win32 build files for Informix driver and make it
|
||||
compile with ZTS (danny)
|
||||
- Added tmpfile() function (Stig)
|
||||
- Upgraded regex library to alpha3.8 (Sascha)
|
||||
- Fixed selecting nested-tables in OCI8. (Thies)
|
||||
- RFC-854 fix for internal FTP-Code. Commands have to end in "\r\n" (Thies)
|
||||
- Fix OpenLink ODBC support (Stig)
|
||||
- min(),max(),a[r]sort(),[r]sort(),k[r]sort() now work consistent with the
|
||||
language-core. (Thies)
|
||||
- tempnam() now uses mkstemp() if available (Stig)
|
||||
- serialize() and var_dump() now honor the precision as set in php.ini
|
||||
for doubles. (Thies)
|
||||
- Improved the Win32 COM module to support [out] parameters (Boris Wedl)
|
||||
- Fixed garbage returned at the end of certain Sybase-Columns (Thies)
|
||||
Patch submitted by: neal@wanlink.com
|
||||
- Added Microsoft SQL Server module for Win32 (Frank)
|
||||
- Added support for forcing a variable number of internal function arguments
|
||||
by reference. (Andi & Zeev, Zend library)
|
||||
- Implemented getprotoby{name,number} (Evan)
|
||||
- Added array_pad() function. (Andrei)
|
||||
- Added new getservby{name,port} functions. (Evan)
|
||||
- Added session.cookie_path and session.cookie_domain (Sascha)
|
||||
- Continue processing PHP_INI_SYSTEM knownDirectives after extension=
|
||||
(Sam Ruby)
|
||||
- Enable IBM DB2 support - Tested against DB2 6.1 UDB on Linux (Rasmus)
|
||||
- Added new str_repeat() function. (Andrei)
|
||||
- Output-Buffering system is now Thread-Safe. (Thies)
|
||||
- implemented OCI8 $lob->WriteToFile() function - very useful for streaming
|
||||
large amounts of LOB-Data without to need of a huge buffer. (Thies)
|
||||
- Added session.use_cookies option (Sascha)
|
||||
- Added getcwd() function. (Thies)
|
||||
- XML_Parse_Into_Struct no longer eats data. (Thies)
|
||||
- Fixed parse_url('-') crash. (Thies)
|
||||
- added === operator support. (Andi & Thies, Zend library)
|
||||
- unserialize() now gives a notice when passed invalid data. (Thies)
|
||||
- Fixed shuffle() so that it no longer breaks on Solaris. (Andrei)
|
||||
- Added is_resource(), is_bool() functions. (Thies)
|
||||
- Cleaned up File-Module (Thies)
|
||||
- Upgraded math-funtions to use new Zend function API (Thies)
|
||||
- Fixed zombie problem in shell_exec() and $a = `some_command`
|
||||
constructs. (Thies)
|
||||
- Thies introduced ZEND_FETCH_RESOURCE2 (Danny).
|
||||
- Added Informix driver to list of maintained extensions. (Danny).
|
||||
- Informix driver : Changed ifx.ec to use the new high-performance
|
||||
ZEND API. (Danny)
|
||||
- IXF_LIBDIR environment variable specifies alternate Informix library
|
||||
path for configure (Danny).
|
||||
- Fixed gmmktime() so that the following should always be true:
|
||||
gmmktime([args]) == mktime([args]) + date('Z', mktime([args])) (Jouni)
|
||||
- setlocale doesn't anymore screw up things if you forgot to change it back
|
||||
to the original settings. (Jouni)
|
||||
- Switched to new system where ChangeLog is automagically updated from commit
|
||||
messages. NEWS file is now the place for public announcements. (Andrei)
|
||||
- Fixed refcount problem in XML module. (Thies)
|
||||
- Fixed crash in HTTP_RAW_POST_DATA handling (Thies)
|
||||
- You can use resources as array-indices again (Thies, Zend library)
|
||||
- Fixed pg_fetch_array() with three arguments (Sascha)
|
||||
Patch submitted by: brian@soda.berkeley.edu
|
||||
- Upgraded a lot internal functions to use new Zend function API (Thies)
|
||||
- fdf support ported; not completely tested with latest version 4.0 for
|
||||
glibc (Uwe)
|
||||
- OCI8 connections are now kept open as long as they are referenced (Thies)
|
||||
- Cleaned up Directory-Module (Thies)
|
||||
- Small fix in Ora_Close (Thies)
|
||||
- Ported range() and shuffle() from PHP3 to PHP4 (Andrei)
|
||||
- Fixed header("HTTP/..."); behaviour (Sascha)
|
||||
- Improved UNIX build system. Now utilizes libtool (Sascha)
|
||||
- Upgrade some more internal functions to use new Zend function API. (Thies,
|
||||
Zend library)
|
||||
- Fixed backwards incompatibility with ereg() (Thies)
|
||||
- Updated Zend garbage collection with a much more thorough method.
|
||||
(Andi, Zend library)
|
||||
- Added the ability to use variable references in the array() construct.
|
||||
For example, array("foo" => &$foo). (Andi, Zend library)
|
||||
- Added array_reverse() function (Andrei)
|
||||
- Some more XML fixes/cleanups (Thies)
|
||||
- Updated preg_replace() so that if any argument passed in is an array
|
||||
it will make a copy of each entry before converting it to string so that
|
||||
the original is intact. If the subject is an array then it will preserve
|
||||
the keys in the output as well (Andrei)
|
||||
- Updated OCI8 to use the new high-performance Zend function API. (Thies)
|
||||
- Configure speedup (Stig)
|
||||
- Fixed LOB/Persistent-Connection related OCI8-Crash (Thies)
|
||||
- Generalized server-API build procedure on UNIX (Stig)
|
||||
- Added '--disable-rpath' option (Sascha)
|
||||
- Added AOLserver SAPI module (Sascha)
|
||||
- Fixed XML Callbacks. (Thies)
|
||||
- Updated ODBC to use the new high-performance Zend function API (kara)
|
||||
- Updated zlib to use the new high-performance Zend function API. (Stefan)
|
||||
- Updated preg_split() to allow returning only non-empty pieces (Andrei)
|
||||
- Updated PCRE to use the new high-performance Zend function API (Andrei)
|
||||
- Updated session, dba, mhash, mcrypt, sysvshm, sysvsem, gettext modules to use
|
||||
the new high-performance Zend function API (Sascha)
|
||||
- Extended var_dump to handle resource type somewhat (Andrei)
|
||||
- Updated WDDX to use the new high-performance Zend function API (Andrei)
|
||||
- Updated XML to use the new high-performance Zend function API. (Thies)
|
||||
- Updated Oracle to use the new high-performance Zend function API. (Thies)
|
||||
- Improved the performance of the MySQL module significantly by using the new
|
||||
high-performance Zend function API. (Zeev)
|
||||
- Add support for the Easysoft ODBC-ODCB Bridge (martin@easysoft.com)
|
||||
- Fix bug in odbc_setoption, getParameter call incorrect (martin@easysoft.com)
|
||||
- Ora_Fetch_Into now resets the returned array in all cases (Thies)
|
||||
- Fixed NULL-Column problem in Oracle-Driver (Thies)
|
||||
- Added extra metadata functions to ODBC, SQLTables etc (nick@easysoft.com)
|
||||
- Fixed SEGV in mcal make_event_object() and
|
||||
typo in mcal_list_alarms() (Andrew Skalski)
|
||||
- Fixed Ora_PLogon (Thies)
|
||||
- Resourcified Oracle (Thies)
|
||||
- Implemented object serialization/deserialization in WDDX (Andrei)
|
||||
- Added krsort() function (Thies)
|
||||
- Added func_num_args(), func_get_arg() and func_get_args() for standard
|
||||
access to variable number of arguments functions (Zeev)
|
||||
- Added FTP support (Andrew Skalski)
|
||||
- Added optional allowable_tags arguments to strip_tags(), gzgetss() and
|
||||
fgetss() to allow you to specify a string of tags that are not to be
|
||||
stripped (Rasmus)
|
||||
- Upgraded var_dump() to take multiple arguments (Andrei)
|
||||
- Resourcified XML (Thies)
|
||||
- Fixed a memory leak in the Apache per-directory directives handler (Zeev)
|
||||
- Added array_count_values() function. (Thies)
|
||||
- snmp, pgsql, mysql and gd modules can be built as dynamically loaded
|
||||
modules (Greg)
|
||||
- OCI8 fix for fetching empty LOBs (Thies)
|
||||
- Added user-level callbacks for session module (Sascha)
|
||||
- Added support for unknown POST content types (Zeev)
|
||||
- Added "wddx" serialization handler for session module (Sascha)
|
||||
(automatically enabled, if you compile with --with-wddx)
|
||||
- Fixed unserializing objects (Thies)
|
||||
- PHP 4.0 now serializes Objects as 'O' (not understood by PHP 3.0), but
|
||||
unserializes PHP 3.0 serialized objects as expected. (Thies)
|
||||
- Made serialize/unserialize work on classes. If the class is known at
|
||||
unserialize() time, you'll get back a fully working object! (Thies)
|
||||
- Reworked preg_* functions according to the new PCRE API, which also made
|
||||
them behave much more like Perl ones (Andrei)
|
||||
- Made it possible to specify external location of PCRE library (Andrei)
|
||||
- Updated bundled PCRE library to version 2.08 (Andrei)
|
||||
- count()/is_array/is_object... speedups. (Thies)
|
||||
- OCI8 supports appending and positioning when saving LOBs (Thies)
|
||||
- Added metaphone support (Thies)
|
||||
- OCI8 doesn't use define callbacks any longer. (Thies)
|
||||
- OCI8 Driver now supports LOBs like PHP 3.0. (Thies)
|
||||
- var_dump now dumps the properties of an object (Thies)
|
||||
- Rewrote the GET/POST/Cookie data reader to support multi-dimensional
|
||||
arrays! (Zeev)
|
||||
- Renamed allow_builtin_links to expose_php (defaults to On). This directive
|
||||
tells PHP whether it may expose its existence to the outside world, e.g.
|
||||
by adding itself to the Web server header (Zeev)
|
||||
- Added support for transparent session id propagation (Sascha)
|
||||
- Made WDDX serialize object properties properly (Andrei)
|
||||
- Fixed WDDX mem leak when undefined variable is passed in
|
||||
for serialization (Andrei)
|
||||
- Added session_unset() function (Andrei)
|
||||
- Fixed double session globals shutdown crash (Andrei)
|
||||
- Fixed crash related to ignore_user_abort ini entry (Andrei)
|
||||
- Added support for external entropy sources for session id creation
|
||||
(on Unices /dev/random and /dev/urandom) (Sascha)
|
||||
- Added gpc_globals variable directive to php.ini. By default it is On, but
|
||||
if it is set to Off, GET, POST and Cookie variables will not be inserted
|
||||
to the global scope. Mostly makes sense when coupled with track_vars (Zeev)
|
||||
- Added versioning support for shared library (Sascha)
|
||||
This allows concurrent use of PHP 3.0 and PHP 4.0 as Apache modules. See
|
||||
the end of the INSTALL file for more information.
|
||||
- Added second parameter to array_keys which specifies search value
|
||||
for which the key should be returned (Andrei)
|
||||
- Resourcified Informix driver (Danny)
|
||||
- New resource handling for odbc, renamed to php_odbc.[ch]
|
||||
- Make set_time_limit() work on Unix (Rasmus)
|
||||
- Added connection handling support (Rasmus)
|
||||
- Improved the Sybase-CT module to make use of resources (Zeev)
|
||||
- Improved the mSQL module to make use of resources (Zeev)
|
||||
- Changed mysql_query() and mysql_db_query() to return false in case of saving
|
||||
the result set data fails (Zeev)
|
||||
- Improved the resource mechanism - resources were not getting freed as soon
|
||||
as they could (Zeev)
|
||||
- Added shared memory module for session data storage (Sascha)
|
||||
- Fixed session.auto_start (Sascha)
|
||||
- Fixed several problems with output buffering and HEAD requests (Zeev)
|
||||
- Fixed HTTP Status code issue with ISAPI module (Zeev)
|
||||
- Fixed a problem that prevented $GLOBALS from working properly (Zeev, Zend
|
||||
library)
|
||||
- Ported newest GetImageSize (Thies)
|
||||
- Added session compile support in Win32 (Andi)
|
||||
- Added -d switch to the CGI binary that allows overriding php.ini values
|
||||
from the command line (Zeev)
|
||||
- Fixed a crash that would occur if wddx_deserialize did not receive
|
||||
a valid packet (Andrei)
|
||||
- Fixed a bugglet when redefining a class at run-time (Andi, Zend library)
|
||||
- Fixed sem_get() on AIX (Sascha)
|
||||
- Fixed fopen() to work with URL's in Win32 (Andi & Zeev)
|
||||
- Fixed include_path for Win32 (Andi, Zend library)
|
||||
- Fixed bug in ISAPI header sending function (Charles)
|
||||
- Fixed memory leak when using undefined values (Andi & Zeev, Zend library)
|
||||
- Added output_buffering directive to php.ini, to enable output buffering
|
||||
for all PHP scripts - default is off (Zeev).
|
||||
- Fixed some more class inheritance issues (Zeev, Zend library)
|
||||
- Fixed Apache build wrt to shared modules on FreeBSD/Linux (Sascha)
|
||||
- Added session.extern_referer_chk which checks whether session ids were
|
||||
referred to by an external site and eliminates them (Sascha)
|
||||
- Improved session id generation (Sascha)
|
||||
- Improved speed of uniqid() by using the combined LCG and removing
|
||||
the extra usleep() (Sascha)
|
||||
- Introduced general combined linear congruential generator (Sascha)
|
||||
- Made ldap_close back into an alias for ldap_unbind (Andrei)
|
||||
- OciFetchInto now resets the returned array in all cases (Thies)
|
||||
- Fixed mysql_errno() to work with recent versions of MySQL (Zeev)
|
||||
- Fixed a problem with define() and boolean values (Zeev)
|
||||
- Fixed inclusion of gd/freetype functions (Sascha)
|
||||
- Fixed persistency of MHASH_* constants (Sascha)
|
||||
- Oracle is now ZTS-Safe (Thies)
|
||||
- Fixed flushing of cached information to disk in DBA's DB2 module (Sascha)
|
||||
- OCI8 is now ZTS-Safe (Thies)
|
||||
- Fixed is_writeable/is_writable problem; they are both defined now (Andrei)
|
||||
- Imported PHP 3.0 diskfreespace() function (Thies)
|
||||
- Fixed thread-safety issues in the MySQL module (Zeev)
|
||||
- Fixed thread-safe support for dynamic modules (Zeev)
|
||||
- Fixed Sybase CT build process (Zeev)
|
||||
|
||||
August 9 1999, Version 4.0 Beta 2
|
||||
- Fixed a problem when sending HTTP/1.x header lines using header() (Zeev)
|
||||
- Win32 builds now include the ODBC module built-in (Zeev)
|
||||
- Fixed SYSV-SHM interface (Thies).
|
||||
- Updated hyperwave module, made it thread safe
|
||||
- Updated pdflib module, version 0.6 of pdflib no longer supported
|
||||
- Updated fdf module
|
||||
- Built-in phpinfo() links are now turned off by default. They can be turned
|
||||
on using the allow_builtin_links INI directive (Zeev)
|
||||
- Changed phpinfo() to list modules that have no info function (Zeev)
|
||||
- Modified array_walk() function so that the userland callback is passed
|
||||
a key and possible user data in addition to the value (Andrei)
|
||||
- Fixed ldap_search(), ldap_read() and ldap_list() (Zeev)
|
||||
- Fixed Apache information in phpinfo() (sam@breakfree.com)
|
||||
- Improved register_shutdown_function() - you may now supply arguments that
|
||||
will be passed to the shutdown function (Zeev)
|
||||
- Improved call_user_func() and call_user_method() - they now support passing
|
||||
arguments by reference (Zeev)
|
||||
- Fixed usort() and uksort() (Zeev)
|
||||
- Fixed md5() in the Apache module (Thies)
|
||||
- Introduced build process for dynamic modules (Stig)
|
||||
- Improved ISAPI module to supprt large server variables (Zeev)
|
||||
- Imported PHP 3.0 fixes for problem with PHP as a dynamic module and Redhat
|
||||
libc2.1 in zlib module (Stefan)
|
||||
- Fixed sybase_fetch_object() (Zeev)
|
||||
- Made the IMAP module work with PHP 4.0 (Zeev)
|
||||
- Fixed a problem with include()/require() of URLs (Sascha, Zeev)
|
||||
- Fixed a bug in implode() that caused it to corrupt its arguments (Zeev)
|
||||
- Added get_class($obj), get_parent_class($obj) and method_exists($obj,"name")
|
||||
(Andi & Zeev)
|
||||
- Fixed various inheritance problems (Andi & Zeev, Zend library)
|
||||
- Children now inherit their parent's constructor, if they do not supply a
|
||||
constructor of their own.
|
||||
- Fixed runtime inheritance of classes (parent methods/properties were
|
||||
overriding their children) (Zeev, Zend library)
|
||||
- Fixed backwards incompatibility with the "new" operator (Andi, Zend library)
|
||||
- Fixed bugs in uksort() and ksort() sort ordering (Andrei)
|
||||
- Fixed a memory leak when using assignment-op operators with lvalue of type
|
||||
string (Zeev, Zend library)
|
||||
- Fixed a problem in inheritance from classes that are defined in include()d
|
||||
files (Zeev, Zend library)
|
||||
- Fixed a problem with the PHP error handler that could result in a crash
|
||||
on certain operating systems (Zeev)
|
||||
- Apache php_flag values only recognized 'On' (case sensitive) - changed
|
||||
to case insensitive (Zeev)
|
||||
- Fixed a memory leak with switch statement containing return statements
|
||||
(Andi & Zeev, Zend library)
|
||||
- Fixed a crash problem in switch statements that had a string offset
|
||||
as a conditional (Andi & Zeev, Zend library)
|
||||
- Imported PHP 3.0 fixes for rand() and mt_rand() (Rasmus)
|
||||
- Added function entries for strip_tags() and similar_text() (Andrei)
|
||||
- Fixed a bug in WDDX that would cause a crash if a number was passed in
|
||||
instead of a variable name (Andrei)
|
||||
- Ported strtotime() function from PHP 3.0 (Andrei)
|
||||
- Merged in gdttf stuff from PHP 3.0 (Sascha)
|
||||
- buildconf now checks your installation (Stig)
|
||||
- XML module now built dynamically with --with-xml=shared (Stig)
|
||||
- Added a check for freetype.h - fixed build on RedHat 6.0 (Zeev)
|
||||
- Fixed array_walk() to work in PHP 4.0 (Andrei)
|
||||
- Ported all remaining date() format options from PHP 3.0 (Andrei)
|
||||
- $php_errormsg now works (Andrei)
|
||||
- Added locale support for Perl Compatible Regexp functions (Andrei)
|
||||
- Informix module ported (Danny)
|
||||
- Removed --with-shared-apache (Sascha)
|
||||
- Added patch for reverse lookup table in base64_decode (Sascha)
|
||||
Submitted by bfranklin@dct.com
|
||||
- Merged in PHP 3.0 version of str_replace (Sascha)
|
||||
- Added DBA module (Sascha)
|
||||
- Added session id detection within REQUEST_URI (Sascha)
|
||||
- Merged in HP-UX/ANSI compatibility switch from PHP 3.0 (Sascha)
|
||||
- Fixed rpath handling for utilitites built during Apache build (Sascha)
|
||||
- Added missing E_ error level constants (Zeev, Zend library)
|
||||
- Fixed a bug in sending multiple HTTP Cookies under Apache (Zeev)
|
||||
- Fixed implicit connect on the MySQL, mSQL, PostgreSQL and Sybase
|
||||
modules (Zeev)
|
||||
- Gave PHP 4.0's SNMP extension all the functionality of PHP 3.0.12 (SteveL)
|
||||
|
||||
July 19 1999, Version 4.0 Beta 1
|
||||
- First public beta of PHP 4.0
|
||||
@@ -0,0 +1,102 @@
|
||||
This is the first file you should be reading after you get your CVS account.
|
||||
We'll assume you're basically familiar with CVS, but feel free to post
|
||||
your questions on the mailing list.
|
||||
|
||||
PHP is developed through the efforts of a large number of people.
|
||||
Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following
|
||||
some basic rules with regards to CVS usage will:
|
||||
|
||||
a. Make everybody happier, especially those responsible for maintaining
|
||||
the CVS itself.
|
||||
b. Keep the changes consistently well documented and easily trackable.
|
||||
c. Prevent some of those 'Oops' moments.
|
||||
d. Increase the general level of good will on planet Earth.
|
||||
|
||||
|
||||
Having said that, here are the organizational rules:
|
||||
|
||||
1. Respect other people working on the project.
|
||||
|
||||
2. Discuss any significant changes on the list before committing.
|
||||
|
||||
3. Look at MAINTANERS 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
|
||||
start fighting publicly - take it up in private email.
|
||||
|
||||
5. If you don't know how to do something, ask first!
|
||||
|
||||
6. Test your changes before committing them. We mean it. Really.
|
||||
|
||||
|
||||
The next few rules are more of a technical nature.
|
||||
|
||||
1. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
|
||||
messages every day. Woe be to those who attempt to mess with it.
|
||||
|
||||
2. All news updates intended for public viewing, such as new features,
|
||||
bug fixes, improvements, etc., should go into the NEWS file. Also see
|
||||
the note below about automatically updating NEWS in your commit message.
|
||||
|
||||
3. Do not commit multiple file and dump all messages in one commit. If you
|
||||
modified several unrelated files, commit each group separately and
|
||||
provide a nice commit message for each one. See example below.
|
||||
|
||||
4. Do write your commit message in such a way that it makes sense even
|
||||
without the corresponding diff. One should be able to look at it, and
|
||||
immediately know what was modified. Definitely include the function name
|
||||
in the message as shown below.
|
||||
|
||||
5. In your commit messages, keep each line shorter than 80 characters. And
|
||||
try to align your lines vertically, if they wrap. It looks bad otherwise.
|
||||
|
||||
6. If you modified a function that is callable from PHP, prepend PHP to
|
||||
the function name as shown below.
|
||||
|
||||
|
||||
The format of the commit messages is pretty simple.
|
||||
|
||||
If a line begins with #, it is taken to be a comment and will not appear
|
||||
in the ChangeLog. If the line begins with @, it will be redirected to the
|
||||
NEWS file. Everything else goes into the ChangeLog.
|
||||
|
||||
It is important to note that if your comment or news logline spans multiple
|
||||
lines, you have to put # or @ at the beginning of _every_ such line.
|
||||
|
||||
Example. Say you modified two files, datetime.c and string.c. In datetime.c
|
||||
you added a new format option for date() function, and in string.c you fixed
|
||||
a memory leak in php_trim(). Don't commit both of these at once. Commit them
|
||||
separately and try to make sure your commit messages look something like the
|
||||
following.
|
||||
|
||||
For datetime.c:
|
||||
|
||||
(PHP date) Added new 'K' format modifier for printing out number of
|
||||
days until New Year's Eve.
|
||||
@- Added new 'K' format modifier that will output the number of days
|
||||
@ until New Year's Eve. (Bob)
|
||||
|
||||
For string.c:
|
||||
(php_trim) Fixed a memory leak resulting from improper use of zval_dtor().
|
||||
# Man, that thing was leaking all over the place!
|
||||
@- Memory leak in trim() function has finally been fixed. (Bob)
|
||||
|
||||
The lines above marked with @ will go into NEWS file automagically, and the
|
||||
# lines will be omitted from the ChangeLog. Alternatively, you might want
|
||||
to modify NEWS file directly and not use the @ lines.
|
||||
|
||||
If you don't see your messages in ChangeLog and NEWS right away, don't worry!
|
||||
These files are updated once a day, so your stuff will not show up until
|
||||
somewhat later. Don't go adding stuff to NEWS by hand if you already put @
|
||||
lines in the commit message.
|
||||
|
||||
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
|
||||
to look at PHP CVS repository in various ways.
|
||||
|
||||
To receive daily updates to ChangeLog and NEWS, send an empty message to
|
||||
php-cvs-daily-subscribe@lists.php.net.
|
||||
|
||||
Happy hacking,
|
||||
|
||||
PHP Team
|
||||
@@ -0,0 +1,7 @@
|
||||
Things to do or at least think about doing in the future. Name in
|
||||
parenthesis means that person has taken on this project.
|
||||
|
||||
ext/standard
|
||||
------------
|
||||
* strpad() (Andrei)
|
||||
* advanced sort (Andrei)
|
||||
@@ -35,12 +35,6 @@ March 1 1999, Version 3.0.7
|
||||
variables.
|
||||
- Clean up apxs build
|
||||
- Add INSTALL.REDHAT file to walk RedHat users through the install
|
||||
- Added optional second argument to mysql_fetch_array(); MYSQL_ASSOC will
|
||||
cause the resulting array to contain the associative indices only,
|
||||
MYSQL_NUM will cause the array to contain the numeric indices only (like
|
||||
mysql_fetch_row()) and MYSQL_BOTH would cause them both to be defined
|
||||
(default).
|
||||
- Backport the Zend debugging memory manager into the PHP 3.0.x tree.
|
||||
- Add function_exists() function.
|
||||
- Add another version of WDDX module
|
||||
(we need to pick a single implementation here)
|
||||
@@ -76,8 +70,6 @@ March 1 1999, Version 3.0.7
|
||||
- Fix bug in pdf_close() function
|
||||
- Add WDDX support (see http://www.wddx.org for more info)
|
||||
- Add similar_text() function
|
||||
- Constructors of parent classes weren't accessible to derived classes (as
|
||||
of 3.0.6). Fixed.
|
||||
- Introduce simple regex compilation cache
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
## process this file with automake to produce Makefile.am
|
||||
AUTOMAKE_OPTIONS=foreign
|
||||
noinst_LTLIBRARIES=libtsrm.la
|
||||
libtsrm_la_SOURCES = TSRM.c
|
||||
+434
@@ -0,0 +1,434 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Zeev Suraski |
|
||||
+----------------------------------------------------------------------+
|
||||
| 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> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#include "TSRM.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
typedef struct _tsrm_tls_entry tsrm_tls_entry;
|
||||
|
||||
struct _tsrm_tls_entry {
|
||||
void **storage;
|
||||
int count;
|
||||
THREAD_T thread_id;
|
||||
tsrm_tls_entry *next;
|
||||
};
|
||||
|
||||
|
||||
typedef struct {
|
||||
size_t size;
|
||||
void (*ctor)(void *resource);
|
||||
void (*dtor)(void *resource);
|
||||
} tsrm_resource_type;
|
||||
|
||||
|
||||
/* The memory manager table */
|
||||
static tsrm_tls_entry **tsrm_tls_table;
|
||||
static int tsrm_tls_table_size;
|
||||
static ts_rsrc_id id_count;
|
||||
|
||||
/* The resource sizes table */
|
||||
static tsrm_resource_type *resource_types_table;
|
||||
static int resource_types_table_size;
|
||||
|
||||
|
||||
static MUTEX_T tsmm_mutex; /* thread-safe memory manager mutex */
|
||||
|
||||
/* New thread handlers */
|
||||
static void (*tsrm_new_thread_begin_handler)();
|
||||
static void (*tsrm_new_thread_end_handler)();
|
||||
|
||||
/* Debug support */
|
||||
static int tsrm_debug(const char *format, ...);
|
||||
static int tsrm_debug_status;
|
||||
|
||||
|
||||
/* Startup TSRM (call once for the entire process) */
|
||||
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_status)
|
||||
{
|
||||
tsrm_tls_table_size = expected_threads;
|
||||
tsrm_tls_table = (tsrm_tls_entry **) calloc(tsrm_tls_table_size, sizeof(tsrm_tls_entry *));
|
||||
if (!tsrm_tls_table) {
|
||||
return 0;
|
||||
}
|
||||
id_count=0;
|
||||
|
||||
resource_types_table_size = expected_resources;
|
||||
resource_types_table = (tsrm_resource_type *) calloc(resource_types_table_size, sizeof(tsrm_resource_type));
|
||||
if (!resource_types_table) {
|
||||
free(tsrm_tls_table);
|
||||
return 0;
|
||||
}
|
||||
|
||||
tsmm_mutex = tsrm_mutex_alloc();
|
||||
|
||||
tsrm_new_thread_begin_handler = tsrm_new_thread_end_handler = NULL;
|
||||
|
||||
tsrm_debug_status = debug_status;
|
||||
|
||||
tsrm_debug("Started up TSRM, %d expected threads, %d expected resources\n", expected_threads, expected_resources);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* Shutdown TSRM (call once for the entire process) */
|
||||
TSRM_API void tsrm_shutdown()
|
||||
{
|
||||
int i;
|
||||
|
||||
if (tsrm_tls_table) {
|
||||
for (i=0; i<tsrm_tls_table_size; i++) {
|
||||
tsrm_tls_entry *p = tsrm_tls_table[i], *next_p;
|
||||
|
||||
while (p) {
|
||||
int j;
|
||||
|
||||
next_p = p->next;
|
||||
for (j=0; j<id_count; j++) {
|
||||
free(p->storage[j]);
|
||||
}
|
||||
free(p->storage);
|
||||
free(p);
|
||||
p = next_p;
|
||||
}
|
||||
}
|
||||
free(tsrm_tls_table);
|
||||
}
|
||||
if (resource_types_table) {
|
||||
free(resource_types_table);
|
||||
}
|
||||
tsrm_mutex_free(tsmm_mutex);
|
||||
tsrm_debug("Shutdown TSRM\n");
|
||||
}
|
||||
|
||||
|
||||
/* allocates a new thread-safe-resource id */
|
||||
TSRM_API ts_rsrc_id ts_allocate_id(size_t size, void (*ctor)(void *resource), void (*dtor)(void *resource))
|
||||
{
|
||||
ts_rsrc_id new_id;
|
||||
int i;
|
||||
|
||||
tsrm_debug("Obtaining a new resource id, %d bytes\n", size);
|
||||
|
||||
tsrm_mutex_lock(tsmm_mutex);
|
||||
|
||||
/* obtain a resource id */
|
||||
new_id = id_count++;
|
||||
tsrm_debug("Obtained resource id %d\n", new_id);
|
||||
|
||||
/* store the new resource type in the resource sizes table */
|
||||
if (resource_types_table_size < id_count) {
|
||||
resource_types_table = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count);
|
||||
if (!resource_types_table) {
|
||||
return -1;
|
||||
}
|
||||
resource_types_table_size = id_count;
|
||||
}
|
||||
resource_types_table[new_id].size = size;
|
||||
resource_types_table[new_id].ctor = ctor;
|
||||
resource_types_table[new_id].dtor = dtor;
|
||||
|
||||
/* enlarge the arrays for the already active threads */
|
||||
for (i=0; i<tsrm_tls_table_size; i++) {
|
||||
tsrm_tls_entry *p = tsrm_tls_table[i];
|
||||
|
||||
while (p) {
|
||||
if (p->count < id_count) {
|
||||
int j;
|
||||
|
||||
p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count);
|
||||
for (j=p->count; j<id_count; j++) {
|
||||
p->storage[j] = (void *) malloc(resource_types_table[j].size);
|
||||
if (resource_types_table[j].ctor) {
|
||||
resource_types_table[j].ctor(p->storage[j]);
|
||||
}
|
||||
}
|
||||
p->count = id_count;
|
||||
}
|
||||
p = p->next;
|
||||
}
|
||||
}
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
|
||||
tsrm_debug("Successfully allocated new resource id %d\n", new_id);
|
||||
return new_id;
|
||||
}
|
||||
|
||||
|
||||
static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_T thread_id)
|
||||
{
|
||||
int i;
|
||||
|
||||
(*thread_resources_ptr) = (tsrm_tls_entry *) malloc(sizeof(tsrm_tls_entry));
|
||||
(*thread_resources_ptr)->storage = (void **) malloc(sizeof(void *)*id_count);
|
||||
(*thread_resources_ptr)->count = id_count;
|
||||
(*thread_resources_ptr)->thread_id = thread_id;
|
||||
(*thread_resources_ptr)->next = NULL;
|
||||
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
|
||||
if (tsrm_new_thread_begin_handler) {
|
||||
tsrm_new_thread_begin_handler(thread_id);
|
||||
}
|
||||
for (i=0; i<id_count; i++) {
|
||||
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
|
||||
if (resource_types_table[i].ctor) {
|
||||
resource_types_table[i].ctor((*thread_resources_ptr)->storage[i]);
|
||||
}
|
||||
}
|
||||
if (tsrm_new_thread_end_handler) {
|
||||
tsrm_new_thread_end_handler(thread_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* fetches the requested resource for the current thread */
|
||||
void *ts_resource(ts_rsrc_id id)
|
||||
{
|
||||
THREAD_T thread_id = tsrm_thread_id();
|
||||
int hash_value;
|
||||
tsrm_tls_entry *thread_resources;
|
||||
void *resource;
|
||||
|
||||
tsrm_debug("Fetching resource id %d for thread %ld\n", id, (long) thread_id);
|
||||
tsrm_mutex_lock(tsmm_mutex);
|
||||
|
||||
hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
|
||||
thread_resources = tsrm_tls_table[hash_value];
|
||||
|
||||
if (!thread_resources) {
|
||||
allocate_new_resource(&tsrm_tls_table[hash_value], thread_id);
|
||||
return ts_resource(id);
|
||||
/* thread_resources = tsrm_tls_table[hash_value]; */
|
||||
} else {
|
||||
do {
|
||||
if (thread_resources->thread_id == thread_id) {
|
||||
break;
|
||||
}
|
||||
if (thread_resources->next) {
|
||||
thread_resources = thread_resources->next;
|
||||
} else {
|
||||
allocate_new_resource(&thread_resources->next, thread_id);
|
||||
return ts_resource(id);
|
||||
/*
|
||||
* thread_resources = thread_resources->next;
|
||||
* break;
|
||||
*/
|
||||
}
|
||||
} while (thread_resources);
|
||||
}
|
||||
|
||||
resource = thread_resources->storage[id];
|
||||
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
|
||||
tsrm_debug("Successfully fetched resource id %d for thread id %ld - %x\n", id, (long) thread_id, (long) resource);
|
||||
return resource;
|
||||
}
|
||||
|
||||
|
||||
/* frees all resources allocated for the current thread */
|
||||
void ts_free_thread()
|
||||
{
|
||||
THREAD_T thread_id = tsrm_thread_id();
|
||||
int hash_value;
|
||||
tsrm_tls_entry *thread_resources;
|
||||
tsrm_tls_entry *last=NULL;
|
||||
|
||||
tsrm_mutex_lock(tsmm_mutex);
|
||||
hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
|
||||
thread_resources = tsrm_tls_table[hash_value];
|
||||
|
||||
while (thread_resources) {
|
||||
if (thread_resources->thread_id == thread_id) {
|
||||
int i;
|
||||
|
||||
for (i=0; i<thread_resources->count; i++) {
|
||||
if (resource_types_table[i].dtor) {
|
||||
resource_types_table[i].dtor(thread_resources->storage[i]);
|
||||
}
|
||||
free(thread_resources->storage[i]);
|
||||
}
|
||||
free(thread_resources->storage);
|
||||
if (last) {
|
||||
last->next = thread_resources->next;
|
||||
} else {
|
||||
tsrm_tls_table[hash_value]=NULL;
|
||||
}
|
||||
free(thread_resources);
|
||||
break;
|
||||
}
|
||||
if (thread_resources->next) {
|
||||
last = thread_resources;
|
||||
}
|
||||
thread_resources = thread_resources->next;
|
||||
}
|
||||
tsrm_mutex_unlock(tsmm_mutex);
|
||||
}
|
||||
|
||||
|
||||
/* deallocates all occurrences of a given id */
|
||||
void ts_free_id(ts_rsrc_id id)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Utility Functions
|
||||
*/
|
||||
|
||||
/* Obtain the current thread id */
|
||||
TSRM_API THREAD_T tsrm_thread_id(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return GetCurrentThreadId();
|
||||
#elif defined(PTHREADS)
|
||||
return pthread_self();
|
||||
#elif defined(NSAPI)
|
||||
return systhread_current();
|
||||
#elif defined(PI3WEB)
|
||||
return PIThread_getCurrent();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Allocate a mutex */
|
||||
TSRM_API MUTEX_T tsrm_mutex_alloc( void )
|
||||
{
|
||||
MUTEX_T mutexp;
|
||||
|
||||
#ifdef WIN32
|
||||
mutexp = CreateMutex(NULL,FALSE,NULL);
|
||||
#elif defined(PTHREADS)
|
||||
mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
|
||||
pthread_mutex_init(mutexp,NULL);
|
||||
#elif defined(NSAPI)
|
||||
mutexp = crit_init();
|
||||
#elif defined(PI3WEB)
|
||||
mutexp = PIPlatform_allocLocalMutex();
|
||||
#endif
|
||||
#ifdef THR_DEBUG
|
||||
printf("Mutex created thread: %d\n",mythreadid());
|
||||
#endif
|
||||
return( mutexp );
|
||||
}
|
||||
|
||||
|
||||
/* Free a mutex */
|
||||
TSRM_API void tsrm_mutex_free( MUTEX_T mutexp )
|
||||
{
|
||||
if (mutexp) {
|
||||
#ifdef WIN32
|
||||
CloseHandle(mutexp);
|
||||
#elif defined(PTHREADS)
|
||||
free(mutexp);
|
||||
#elif defined(NSAPI)
|
||||
crit_terminate(mutexp);
|
||||
#elif defined(PI3WEB)
|
||||
PISync_delete(mutexp)
|
||||
#endif
|
||||
}
|
||||
#ifdef THR_DEBUG
|
||||
printf("Mutex freed thread: %d\n",mythreadid());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Lock a mutex */
|
||||
TSRM_API int tsrm_mutex_lock( MUTEX_T mutexp )
|
||||
{
|
||||
#if 0
|
||||
tsrm_debug("Mutex locked thread: %ld\n",tsrm_thread_id());
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
return WaitForSingleObject(mutexp,1000);
|
||||
#elif defined(PTHREADS)
|
||||
return pthread_mutex_lock(mutexp);
|
||||
#elif defined(NSAPI)
|
||||
return crit_enter(mutexp);
|
||||
#elif defined(PI3WEB)
|
||||
return PISync_lock(mutexp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Unlock a mutex */
|
||||
TSRM_API int tsrm_mutex_unlock( MUTEX_T mutexp )
|
||||
{
|
||||
#if 0
|
||||
tsrm_debug("Mutex unlocked thread: %ld\n",tsrm_thread_id());
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
return ReleaseMutex(mutexp);
|
||||
#elif defined(PTHREADS)
|
||||
return pthread_mutex_unlock(mutexp);
|
||||
#elif defined(NSAPI)
|
||||
return crit_exit(mutexp);
|
||||
#elif defined(PI3WEB)
|
||||
return PISync_unlock(mutexp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
TSRM_API void *tsrm_set_new_thread_begin_handler(void (*new_thread_begin_handler)(THREAD_T thread_id))
|
||||
{
|
||||
void *retval = (void *) tsrm_new_thread_begin_handler;
|
||||
|
||||
tsrm_new_thread_begin_handler = new_thread_begin_handler;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
TSRM_API void *tsrm_set_new_thread_end_handler(void (*new_thread_end_handler)(THREAD_T thread_id))
|
||||
{
|
||||
void *retval = (void *) tsrm_new_thread_end_handler;
|
||||
|
||||
tsrm_new_thread_end_handler = new_thread_end_handler;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Debug support
|
||||
*/
|
||||
|
||||
static int tsrm_debug(const char *format, ...)
|
||||
{
|
||||
if (tsrm_debug_status) {
|
||||
va_list args;
|
||||
int size;
|
||||
|
||||
va_start(args, format);
|
||||
size = vprintf(format, args);
|
||||
va_end(args);
|
||||
return size;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void tsrm_debug_set(int status)
|
||||
{
|
||||
tsrm_debug_status = status;
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
# Microsoft Developer Studio Project File - Name="TSRM" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=TSRM - Win32 Debug_TS
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "TSRM.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "TSRM.mak" CFG="TSRM - Win32 Debug_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "TSRM - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TSRM - Win32 Release_TS" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "TSRM - Win32 Debug_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "TSRM___Win32_Debug_TS"
|
||||
# PROP BASE Intermediate_Dir "TSRM___Win32_Debug_TS"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug_TS"
|
||||
# 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 BASE RSC /l 0x40d /d "_DEBUG"
|
||||
# ADD RSC /l 0x40d /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "TSRM___Win32_Release_TS"
|
||||
# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release_TS"
|
||||
# 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 BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "TSRM - Win32 Debug_TS"
|
||||
# Name "TSRM - Win32 Release_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TSRM.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\TSRM.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Thread Safe Resource Manager |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Zeev Suraski |
|
||||
+----------------------------------------------------------------------+
|
||||
| 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> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TSRM_H
|
||||
#define _TSRM_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# undef PACKAGE
|
||||
# undef VERSION
|
||||
# include "tsrm_config.h"
|
||||
# undef PACKAGE
|
||||
# undef VERSION
|
||||
#endif
|
||||
|
||||
#if WIN32||WINNT
|
||||
# include <windows.h>
|
||||
#elif defined(PTHREADS)
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
|
||||
typedef int ts_rsrc_id;
|
||||
|
||||
#if WIN32||WINNT
|
||||
# ifdef TSRM_EXPORTS
|
||||
# define TSRM_API __declspec(dllexport)
|
||||
# else
|
||||
# define TSRM_API __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# define TSRM_API
|
||||
#endif
|
||||
|
||||
|
||||
/* Define THREAD_T and MUTEX_T */
|
||||
#if defined(WIN32)
|
||||
# define THREAD_T DWORD
|
||||
# define MUTEX_T void *
|
||||
#elif defined(PTHREADS)
|
||||
# define THREAD_T pthread_t
|
||||
# define MUTEX_T pthread_mutex_t *
|
||||
#elif defined(NSAPI)
|
||||
# define THREAD_T SYS_THREAD
|
||||
# define MUTEX_T CRITICAL
|
||||
#elif defined(PI3WEB)
|
||||
# define THREAD_T PIThread *
|
||||
# define MUTEX_T PISync *
|
||||
#endif
|
||||
|
||||
typedef void (*ts_allocate_ctor)(void *);
|
||||
|
||||
#define THREAD_HASH_OF(thr,ts) (unsigned long)thr%(unsigned long)ts
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* startup/shutdown */
|
||||
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_status);
|
||||
TSRM_API void tsrm_shutdown();
|
||||
|
||||
/* allocates a new thread-safe-resource id */
|
||||
TSRM_API ts_rsrc_id ts_allocate_id(size_t size, ts_allocate_ctor ctor, void (*dtor)(void *resource));
|
||||
|
||||
/* fetches the requested resource for the current thread */
|
||||
TSRM_API void *ts_resource(ts_rsrc_id id);
|
||||
|
||||
/* frees all resources allocated for the current thread */
|
||||
TSRM_API void ts_free_thread();
|
||||
|
||||
/* deallocates all occurrences of a given id */
|
||||
TSRM_API void ts_free_id(ts_rsrc_id id);
|
||||
|
||||
|
||||
/* Debug support */
|
||||
TSRM_API void tsrm_debug_set(int status);
|
||||
|
||||
/* utility functions */
|
||||
TSRM_API THREAD_T tsrm_thread_id(void);
|
||||
TSRM_API MUTEX_T tsrm_mutex_alloc(void);
|
||||
TSRM_API void tsrm_mutex_free(MUTEX_T mutexp);
|
||||
TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp);
|
||||
TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp);
|
||||
|
||||
TSRM_API void *tsrm_set_new_thread_begin_handler(void (*new_thread_begin_handler)(THREAD_T thread_id));
|
||||
TSRM_API void *tsrm_set_new_thread_end_handler(void (*new_thread_end_handler)(THREAD_T thread_id));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TSRM_H */
|
||||
@@ -0,0 +1 @@
|
||||
#undef PTHREADS
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
|
||||
])
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# Makefile to generate build tools
|
||||
#
|
||||
# Standard usage:
|
||||
# make -f build.mk
|
||||
#
|
||||
# Written by Sascha Schumann
|
||||
#
|
||||
# $Id$
|
||||
|
||||
|
||||
LT_TARGETS = ltmain.sh ltconfig
|
||||
|
||||
config_h_in = tsrm_config.h.in
|
||||
|
||||
makefile_am_files = Makefile.am
|
||||
makefile_in_files = $(makefile_am_files:.am=.in)
|
||||
makefile_files = $(makefile_am_files:e.am=e)
|
||||
|
||||
targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in)
|
||||
|
||||
all: $(targets)
|
||||
|
||||
clean:
|
||||
rm -f $(targets)
|
||||
|
||||
$(LT_TARGETS):
|
||||
rm -f $(LT_TARGETS)
|
||||
libtoolize --automake $(AMFLAGS) -f
|
||||
|
||||
$(makefile_in_files): $(makefile_am_files)
|
||||
automake -a -i $(AMFLAGS) $(makefile_files)
|
||||
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
aclocal
|
||||
|
||||
$(config_h_in): configure.in acconfig.h
|
||||
# explicitly remove target since autoheader does not seem to work
|
||||
# correctly otherwise (timestamps are not updated)
|
||||
@rm -f $@
|
||||
autoheader
|
||||
|
||||
configure: aclocal.m4 configure.in
|
||||
autoconf
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
--copy)
|
||||
automake_flags=--copy
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
|
||||
libtoolize --force --automake $automake_flags
|
||||
|
||||
mv aclocal.m4 aclocal.m4.old 2>/dev/null
|
||||
aclocal
|
||||
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
|
||||
echo "buildconf: keeping ${1}aclocal.m4"
|
||||
mv aclocal.m4.old aclocal.m4
|
||||
else
|
||||
echo "buildconf: created or modified ${1}aclocal.m4"
|
||||
fi
|
||||
|
||||
autoheader
|
||||
|
||||
automake --add-missing --include-deps $automake_flags
|
||||
|
||||
mv configure configure.old 2>/dev/null
|
||||
autoconf
|
||||
if cmp configure.old configure > /dev/null 2>&1; then
|
||||
echo "buildconf: keeping ${1}configure"
|
||||
mv configure.old configure
|
||||
else
|
||||
echo "buildconf: created or modified ${1}configure"
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
dnl $Id$
|
||||
dnl
|
||||
dnl Minimalistic configure.in for TSRM.
|
||||
dnl
|
||||
|
||||
AC_INIT(TSRM.c)
|
||||
AM_INIT_AUTOMAKE(TSRM, 1.0)
|
||||
AM_CONFIG_HEADER(tsrm_config.h)
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_STDC
|
||||
AC_PROG_CC_C_O
|
||||
AC_PROG_RANLIB
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
if test "$enable_debug" != "yes"; then
|
||||
AM_SET_LIBTOOL_VARIABLE([--silent])
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(c_r, pthread_kill)
|
||||
AC_CHECK_LIB(pthread, pthread_kill)
|
||||
|
||||
AC_CHECK_FUNCS(pthread_kill)
|
||||
|
||||
if test "$ac_cv_func_pthread_kill" != "yes"; then
|
||||
AC_MSG_ERROR(You need pthreads to build TSRM.)
|
||||
fi
|
||||
|
||||
AC_DEFINE(PTHREADS)
|
||||
|
||||
AC_CHECK_HEADERS(stdarg.h)
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
+20
-8
@@ -2,23 +2,35 @@
|
||||
|
||||
#CLEANFILES = zend-parser.c zend-parser.h zend-scanner.c zend-parser.output
|
||||
|
||||
ZEND_SCANNER = @ZEND_SCANNER@
|
||||
|
||||
AUTOMAKE_OPTIONS=foreign
|
||||
noinst_LIBRARIES=libzend.a
|
||||
libzend_a_SOURCES=\
|
||||
zend-parser.y zend-scanner.l \
|
||||
EXTRA_LTLIBRARIES=libzend_cc.la libzend_c.la
|
||||
noinst_LTLIBRARIES=$(ZEND_SCANNER) libzend.la
|
||||
|
||||
libzend_cc_la_SOURCES=zend-scanner-cc.cc
|
||||
libzend_c_la_SOURCES=zend-scanner.c
|
||||
|
||||
libzend_la_SOURCES=\
|
||||
zend-parser.y \
|
||||
zend_alloc.c zend_compile.c zend_constants.c \
|
||||
zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \
|
||||
zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
|
||||
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
|
||||
zend_list.c zend_indent.c
|
||||
zend_list.c zend_indent.c zend_builtin_functions.c
|
||||
|
||||
libzend_la_LIBADD = $(ZEND_SCANNER)
|
||||
libzend_la_LDFLAGS = @EXTRA_LIBS@
|
||||
|
||||
# automake isn't too clever about "non-standard" use of lex and yacc
|
||||
|
||||
zend-scanner.c: zend-scanner.l
|
||||
$(LEX) -Pzend -ozend-scanner.c -i $(srcdir)/zend-scanner.l
|
||||
zend-scanner.l: zend-parser.h
|
||||
|
||||
zend-scanner.cc: zend-scanner.l
|
||||
$(LEX) -+ -S$(srcdir)/flex.skl -Pzend -ozend-scanner.cc -i $(srcdir)/zend-scanner.l
|
||||
zend-scanner.c: zend-scanner.l
|
||||
$(LEX) -Pzend -o$@ -i $(srcdir)/zend-scanner.l
|
||||
|
||||
zend-scanner-cc.cc: zend-scanner.l
|
||||
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -o$@ $(srcdir)/zend-scanner.l
|
||||
|
||||
zend-parser.h: zend-parser.c
|
||||
zend-parser.c: zend-parser.y
|
||||
|
||||
+16
-16
@@ -4,7 +4,7 @@
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
.\alloca.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
@@ -27,7 +27,7 @@
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\modules.h"\
|
||||
@@ -46,7 +46,7 @@
|
||||
.\zend_constants.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_constants.h"\
|
||||
".\zend_operators.h"\
|
||||
".\zend_variables.h"\
|
||||
@@ -59,7 +59,7 @@
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_constants.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
@@ -80,7 +80,7 @@
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_highlight.h"\
|
||||
".\zend_llist.h"\
|
||||
@@ -96,7 +96,7 @@
|
||||
.\zend_llist.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
@@ -107,7 +107,7 @@
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\modules.h"\
|
||||
@@ -127,7 +127,7 @@
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
".\zend_operators.h"\
|
||||
@@ -143,7 +143,7 @@
|
||||
.\zend_ptr_stack.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_ptr_stack.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
@@ -153,7 +153,7 @@
|
||||
.\zend_stack.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_stack.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
@@ -164,7 +164,7 @@
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_constants.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
@@ -184,7 +184,7 @@
|
||||
.\zend.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_operators.h"\
|
||||
".\zend_variables.h"\
|
||||
".\zend.h"\
|
||||
@@ -196,7 +196,7 @@
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\zend_compile.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend_constants.h"\
|
||||
".\zend_execute.h"\
|
||||
".\zend_llist.h"\
|
||||
@@ -216,7 +216,7 @@
|
||||
|
||||
.\zend_hash.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
@@ -225,7 +225,7 @@
|
||||
.\zend_ini.c : \
|
||||
"..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\zend_alloc.h"\
|
||||
".\config.w32.h"\
|
||||
".\zend_config.w32.h"\
|
||||
".\zend.h"\
|
||||
".\zend_errors.h"\
|
||||
".\zend_hash.h"\
|
||||
|
||||
+55
-16
@@ -1,3 +1,9 @@
|
||||
#undef HAVE_CLASS_ISTDIOSTREAM
|
||||
|
||||
#define ZEND_API
|
||||
|
||||
@TOP@
|
||||
|
||||
/* This is the default configuration file to read */
|
||||
#define USE_CONFIG_FILE 1
|
||||
|
||||
@@ -11,19 +17,6 @@
|
||||
/* 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 */
|
||||
#define HAVE_DIRENT_H 0
|
||||
|
||||
/* Define if you have struct flock */
|
||||
#define HAVE_STRUCT_FLOCK 0
|
||||
|
||||
/* Define if you have the resolv library (-lresolv). */
|
||||
#define HAVE_LIBRESOLV 0
|
||||
|
||||
/* Undefine if you want stricter XML/SGML compliance by default */
|
||||
/* (this disables "<?expression?>" by default) */
|
||||
#define T_DEFAULT_SHORT_OPEN_TAG 1
|
||||
@@ -32,9 +25,6 @@
|
||||
#define REGEX 0
|
||||
#define HSREGEX 0
|
||||
|
||||
/* Define if you have libdl (used for dynamic linking) */
|
||||
#define HAVE_LIBDL 0
|
||||
|
||||
#undef ZEND_DEBUG
|
||||
|
||||
/* Define if you want to enable bc style precision math support */
|
||||
@@ -48,3 +38,52 @@
|
||||
|
||||
/* Define to compile Zend thread safe */
|
||||
#undef ZTS
|
||||
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
@BOTTOM@
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
/* Define if you have stdiostream.h */
|
||||
#undef HAVE_STDIOSTREAM_H
|
||||
|
||||
#ifdef HAVE_DLFCN_H
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBDL) && defined(RTLD_NOW)
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_NOW)
|
||||
# define DL_UNLOAD dlclose
|
||||
# define DL_FETCH_SYMBOL dlsym
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#else
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 0
|
||||
#endif
|
||||
|
||||
#if ZEND_BROKEN_SPRINTF
|
||||
int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#else
|
||||
# define zend_sprintf sprintf
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
+9
-4
@@ -5,16 +5,21 @@ dnl This file contains local autoconf functions.
|
||||
dnl
|
||||
dnl Check for broken sprintf()
|
||||
dnl
|
||||
AC_DEFUN(AC_BROKEN_SPRINTF,[
|
||||
AC_DEFUN(AC_ZEND_BROKEN_SPRINTF,[
|
||||
AC_MSG_CHECKING([for broken sprintf])
|
||||
AC_TRY_RUN([main() { char buf[20]; exit (sprintf(buf,"testing 123")!=11); }],[
|
||||
AC_DEFINE(BROKEN_SPRINTF,0)
|
||||
AC_DEFINE(ZEND_BROKEN_SPRINTF,0)
|
||||
AC_MSG_RESULT(ok)
|
||||
],[
|
||||
AC_DEFINE(BROKEN_SPRINTF,1)
|
||||
AC_DEFINE(ZEND_BROKEN_SPRINTF,1)
|
||||
AC_MSG_RESULT(broken)
|
||||
],[
|
||||
AC_DEFINE(BROKEN_SPRINTF,0)
|
||||
AC_DEFINE(ZEND_BROKEN_SPRINTF,0)
|
||||
AC_MSG_RESULT(cannot check, guessing ok)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
|
||||
])
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
# Makefile to generate build tools
|
||||
#
|
||||
# Standard usage:
|
||||
# make -f build.mk
|
||||
#
|
||||
# Written by Sascha Schumann
|
||||
#
|
||||
# $Id$
|
||||
|
||||
|
||||
LT_TARGETS = ltmain.sh ltconfig
|
||||
|
||||
config_h_in = zend_config.h.in
|
||||
|
||||
makefile_am_files = Makefile.am
|
||||
makefile_in_files = $(makefile_am_files:.am=.in)
|
||||
makefile_files = $(makefile_am_files:e.am=e)
|
||||
|
||||
targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in)
|
||||
|
||||
all: $(targets)
|
||||
|
||||
clean:
|
||||
rm -f $(targets)
|
||||
|
||||
$(LT_TARGETS):
|
||||
rm -f $(LT_TARGETS)
|
||||
libtoolize --automake $(AMFLAGS) -f
|
||||
|
||||
$(makefile_in_files): $(makefile_am_files)
|
||||
automake -a -i $(AMFLAGS) $(makefile_files)
|
||||
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
aclocal
|
||||
|
||||
$(config_h_in): configure.in acconfig.h
|
||||
# explicitly remove target since autoheader does not seem to work
|
||||
# correctly otherwise (timestamps are not updated)
|
||||
@rm -f $@
|
||||
autoheader
|
||||
|
||||
configure: aclocal.m4 configure.in
|
||||
autoconf
|
||||
+10
-1
@@ -1,5 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
--copy)
|
||||
automake_flags=--copy
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
|
||||
libtoolize --force --automake $automake_flags
|
||||
|
||||
mv aclocal.m4 aclocal.m4.old 2>/dev/null
|
||||
aclocal
|
||||
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
|
||||
@@ -11,7 +20,7 @@ fi
|
||||
|
||||
autoheader
|
||||
|
||||
automake --add-missing --include-deps
|
||||
automake --add-missing --include-deps $automake_flags
|
||||
|
||||
mv configure configure.old 2>/dev/null
|
||||
autoconf
|
||||
|
||||
+81
-25
@@ -24,10 +24,19 @@ else
|
||||
AC_MSG_RESULT($1.$2 (ok))
|
||||
fi
|
||||
AC_PROG_CC
|
||||
AC_PROG_RANLIB
|
||||
if test "$enable_thread_safety" = "yes" ; then
|
||||
AC_PROG_CXX
|
||||
fi
|
||||
AC_PROG_CC_C_O
|
||||
AM_PROG_LEX
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
if test "$enable_debug" != "yes"; then
|
||||
AM_SET_LIBTOOL_VARIABLE([--silent])
|
||||
fi
|
||||
AM_PROG_CC_STDC
|
||||
AC_C_INLINE
|
||||
|
||||
dnl Hack to work around a Mac OS X cpp problem
|
||||
dnl Known versions needing this workaround are 5.3 and 5.4
|
||||
if test "$ac_cv_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then
|
||||
@@ -56,39 +65,33 @@ AC_CHECK_LIB(c, dlopen, [
|
||||
LIBS="-ldl $LIBS"
|
||||
AC_DEFINE(HAVE_LIBDL) ], []) ])
|
||||
|
||||
dnl The sin may be in a library which need not be specifed
|
||||
dnl as well as res_search resides in libsocket
|
||||
AC_CHECK_LIB(c, sin, [:], [
|
||||
AC_CHECK_LIB(m, sin) ])
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
dnl In QNX opendir resides in libc but dirent.h is still required
|
||||
if test "`uname -s 2>/dev/null`" != "QNX"; then
|
||||
AC_HEADER_DIRENT
|
||||
else
|
||||
AC_CHECK_HEADERS(dirent.h)
|
||||
fi
|
||||
dnl QNX requires unix.h to allow functions in libunix to work properly
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h crypt.h sys/file.h memory.h pwd.h grp.h sys/socket.h sys/wait.h syslog.h string.h sys/varargs.h stdarg.h sys/resource.h sys/time.h signal.h netinet/in.h dlfcn.h limits.h sys/types.h sys/statvfs.h sys/statfs.h unix.h db.h ndbm.h)
|
||||
AC_CHECK_HEADERS(limits.h malloc.h string.h unistd.h stdarg.h sys/types.h signal.h unix.h dlfcn.h)
|
||||
|
||||
if test "$enable_thread_safety" = "yes" ; then
|
||||
dnl C++ specific header files
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_CHECK_HEADER(stdiostream.h, [ AC_DEFINE(HAVE_STDIOSTREAM_H) ])
|
||||
AC_LANG_C
|
||||
fi
|
||||
|
||||
dnl Checks for types
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
dnl This is required for QNX and may be some BSD derived systems
|
||||
AC_CHECK_TYPE( uint, unsigned int )
|
||||
AC_CHECK_TYPE( ulong, unsigned long )
|
||||
|
||||
AC_CHECK_SIZEOF(void *, 4)
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr flock lockf putenv tempnam usleep setlocale gettimeofday setvbuf srand48 lrand48 srandom random link symlink regcomp getlogin cuserid vsnprintf snprintf gcvt utime crypt setitimer rint unsetenv strftime setsockopt tzset statvfs statfs inet_aton getpid kill)
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_ALLOCA
|
||||
AC_BROKEN_SPRINTF
|
||||
AC_REPLACE_FUNCS(getopt)
|
||||
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol)
|
||||
AC_ZEND_BROKEN_SPRINTF
|
||||
|
||||
AC_MSG_CHECKING(whether to include debugging symbols)
|
||||
AC_ARG_ENABLE(debug,
|
||||
@@ -114,6 +117,23 @@ AC_ARG_ENABLE(debug,
|
||||
AC_SUBST(DEBUG_CFLAGS)
|
||||
CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
|
||||
RESULT=yes
|
||||
AC_MSG_CHECKING(whether to enable inline)
|
||||
AC_ARG_ENABLE(inline,
|
||||
[ --disable-inline Disable the inline specifier],
|
||||
[
|
||||
if test "$enableval" = "no"; then
|
||||
RESULT=no
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT($RESULT)
|
||||
|
||||
if test "$RESULT" = "yes"; then
|
||||
AC_C_INLINE
|
||||
else
|
||||
AC_DEFINE(inline, [])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether to enable a memory limit)
|
||||
AC_ARG_ENABLE(memory-limit,
|
||||
[ --enable-memory-limit Compile with memory limit support. ],
|
||||
@@ -131,23 +151,59 @@ AC_ARG_ENABLE(memory-limit,
|
||||
])
|
||||
|
||||
|
||||
ZEND_SCANNER_TYPE=c
|
||||
dnl Sigh. This will probably break automake's automatic dependencies..
|
||||
AC_MSG_CHECKING(whether to build Zend thread-safe)
|
||||
AC_ARG_ENABLE(thread-safety,
|
||||
[ --enable-thread-safety Whether to build Zend thread-safe.],[
|
||||
AC_DEFINE(ZTS)
|
||||
AC_MSG_RESULT(yes)
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(ZTS)
|
||||
ZEND_SCANNER_TYPE=cc
|
||||
CPPFLAGS="$CPPFLAGS -I../TSRM"
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
AC_SUBST(TSRM_DIR)
|
||||
AC_SUBST(TSRM_LIB)
|
||||
ZEND_SCANNER="libzend_${ZEND_SCANNER_TYPE}.la"
|
||||
AC_SUBST(ZEND_SCANNER)
|
||||
|
||||
AC_SUBST(CFLAGS_SHLIB)
|
||||
AC_SUBST(LDFLAGS_SHLIB)
|
||||
AC_SUBST(LDFLAGS_SHLIB_EXPORT)
|
||||
if test "$enable_thread_safety" = "yes" ; then
|
||||
AC_CHECK_LIB(C, cin)
|
||||
AC_CHECK_LIB(g++, cin)
|
||||
AC_CHECK_LIB(stdc++, cin)
|
||||
dnl Digital Unix 4.0
|
||||
AC_CHECK_LIB(cxx, cin)
|
||||
AC_CHECK_LIB(cxxstd, __array_delete)
|
||||
|
||||
AC_OUTPUT(Makefile, [], [])
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_MSG_CHECKING(for class istdiostream)
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fstream.h>
|
||||
#include <stdiostream.h>
|
||||
],[
|
||||
istdiostream *foo = new istdiostream((FILE *) 0);
|
||||
],[
|
||||
AC_DEFINE(HAVE_CLASS_ISTDIOSTREAM, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
AC_LANG_RESTORE
|
||||
|
||||
fi
|
||||
|
||||
EXTRA_LIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_SUBST(EXTRA_LIBS)
|
||||
AC_OUTPUT(Makefile)
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 4
|
||||
|
||||
+16
-6
@@ -102,6 +102,10 @@ SOURCE=.\zend_API.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_builtin_functions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_compile.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -170,10 +174,6 @@ SOURCE=.\zend_variables.c
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\config.w32.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FlexLexer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -202,10 +202,18 @@ SOURCE=.\zend_API.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_builtin_functions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_compile.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_config.w32.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_constants.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -275,7 +283,8 @@ InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
@@ -291,7 +300,8 @@ InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
|
||||
+21
-7
@@ -102,6 +102,10 @@ SOURCE=.\zend_API.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_builtin_functions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_compile.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -170,10 +174,6 @@ SOURCE=.\zend_variables.c
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\config.w32.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FlexLexer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -202,10 +202,18 @@ SOURCE=.\zend_API.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_builtin_functions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_compile.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_config.w32.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_constants.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -226,6 +234,10 @@ SOURCE=.\zend_globals.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_globals_macros.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -275,7 +287,8 @@ InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
@@ -291,7 +304,8 @@ InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y
|
||||
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
|
||||
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y
|
||||
|
||||
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
@@ -327,7 +341,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
|
||||
|
||||
|
||||
+39
-32
@@ -56,7 +56,7 @@
|
||||
%left '|'
|
||||
%left '^'
|
||||
%left '&'
|
||||
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL
|
||||
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL
|
||||
%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
|
||||
%left T_SL T_SR
|
||||
%left '+' '-' '.'
|
||||
@@ -348,9 +348,8 @@ class_variable_decleration:
|
||||
| T_VARIABLE '=' static_scalar { do_declare_property(&$1, &$3 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
echo_expr_list:
|
||||
/* empty */
|
||||
| echo_expr_list ',' expr { do_echo(&$3 CLS_CC); }
|
||||
| expr { do_echo(&$1 CLS_CC); }
|
||||
;
|
||||
@@ -358,27 +357,31 @@ echo_expr_list:
|
||||
|
||||
for_expr:
|
||||
/* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; }
|
||||
| for_expr ',' { do_free(&$1 CLS_CC); } expr { $$ = $4; }
|
||||
| non_empty_for_expr { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_for_expr:
|
||||
non_empty_for_expr ',' { do_free(&$1 CLS_CC); } expr { $$ = $4; }
|
||||
| expr { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
expr_without_variable:
|
||||
T_LIST '(' { do_list_init(CLS_C); } assignment_list ')' '=' expr { do_list_end(&$$, &$7 CLS_CC); }
|
||||
| w_cvar '=' expr { do_assign(&$$, &$1, &$3 CLS_CC); }
|
||||
| w_cvar '=' '&' w_cvar { do_assign_ref(&$$, &$1, &$4 CLS_CC); }
|
||||
| cvar '=' expr { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); do_assign(&$$, &$1, &$3 CLS_CC); }
|
||||
| cvar '=' '&' w_cvar { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); do_assign_ref(&$$, &$1, &$4 CLS_CC); }
|
||||
| T_NEW class_name { do_extended_fcall_begin(CLS_C); do_begin_new_object(&$1, &$2 CLS_CC); } ctor_arguments { do_end_new_object(&$$, &$2, &$1, &$4 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
| rw_cvar T_PLUS_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_MINUS_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_MUL_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_DIV_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_CONCAT_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_MOD_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_AND_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_OR_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar XT_OR_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_SL_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_SR_EQUAL expr { do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_PLUS_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_MINUS_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_MUL_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_DIV_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_CONCAT_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 CLS_CC); }
|
||||
| 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_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); }
|
||||
| T_INC rw_cvar { do_pre_incdec(&$$, &$2, ZEND_PRE_INC CLS_CC); }
|
||||
| rw_cvar T_DEC { do_post_incdec(&$$, &$1, ZEND_POST_DEC CLS_CC); }
|
||||
@@ -403,6 +406,7 @@ expr_without_variable:
|
||||
| '-' 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_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); }
|
||||
@@ -413,15 +417,15 @@ expr_without_variable:
|
||||
| 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); }
|
||||
| T_STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_function_call(&$1 CLS_CC); }
|
||||
| T_STRING '(' { do_extended_fcall_begin(CLS_C); $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0 CLS_CC); do_extended_fcall_end(CLS_C); }
|
||||
')' { 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); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
')' { 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); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$3, &$$, &$6, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
')' { do_end_function_call(&$3, &$$, &$6, 1, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
| internal_functions_in_yacc { $$ = $1; }
|
||||
| T_INT_CAST expr { do_cast(&$$, &$2, IS_LONG CLS_CC); }
|
||||
| T_DOUBLE_CAST expr { do_cast(&$$, &$2, IS_DOUBLE CLS_CC); }
|
||||
@@ -507,17 +511,17 @@ expr:
|
||||
|
||||
|
||||
r_cvar:
|
||||
cvar { do_end_variable_parse(BP_VAR_R CLS_CC); $$ = $1; }
|
||||
cvar { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
w_cvar:
|
||||
cvar { do_end_variable_parse(BP_VAR_W CLS_CC); $$ = $1; }
|
||||
cvar { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
rw_cvar:
|
||||
cvar { do_end_variable_parse(BP_VAR_RW CLS_CC); $$ = $1; }
|
||||
cvar { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
@@ -570,7 +574,7 @@ object_property:
|
||||
scalar_object_property:
|
||||
T_STRING { $$ = $1; }
|
||||
| '{' expr '}' { $$ = $2; }
|
||||
| cvar_without_objects { do_end_variable_parse(BP_VAR_R CLS_CC); $$ = $1; }
|
||||
| cvar_without_objects { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
@@ -599,20 +603,23 @@ assignment_list_element:
|
||||
|
||||
|
||||
array_pair_list:
|
||||
/* empty */ { do_init_array(&$$, NULL, NULL CLS_CC); }
|
||||
/* empty */ { do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_array_pair_list:
|
||||
non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { do_add_array_element(&$$, &$5, &$3 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr { do_add_array_element(&$$, &$3, NULL CLS_CC); }
|
||||
| expr T_DOUBLE_ARROW expr { do_init_array(&$$, &$3, &$1 CLS_CC); }
|
||||
| expr { do_init_array(&$$, &$1, NULL CLS_CC); }
|
||||
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); }
|
||||
| expr T_DOUBLE_ARROW expr { do_init_array(&$$, &$3, &$1, 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); }
|
||||
;
|
||||
|
||||
|
||||
encaps_list:
|
||||
encaps_list encaps_var { do_end_variable_parse(BP_VAR_R CLS_CC); do_add_variable(&$$, &$1, &$2 CLS_CC); }
|
||||
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); }
|
||||
|
||||
+47
-19
@@ -40,15 +40,6 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef ZTS
|
||||
#include <fstream.h>
|
||||
# if WIN32||WINNT
|
||||
# include <strstrea.h>
|
||||
# else
|
||||
# include <strstream.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_alloc.h"
|
||||
#include "zend_compile.h"
|
||||
@@ -58,12 +49,27 @@
|
||||
#include "zend_variables.h"
|
||||
#include "zend_operators.h"
|
||||
|
||||
#if HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#ifdef ZTS
|
||||
# include <fstream.h>
|
||||
# ifdef HAVE_STDIOSTR_H
|
||||
# include <stdiostr.h>
|
||||
# endif
|
||||
# ifdef HAVE_STDIOSTREAM_H
|
||||
# include <stdiostream.h>
|
||||
# endif
|
||||
# if WIN32||WINNT
|
||||
# include <strstrea.h>
|
||||
# else
|
||||
# include <strstream.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef ZTS
|
||||
@@ -79,6 +85,16 @@
|
||||
# define MY_INPUT input
|
||||
#endif
|
||||
|
||||
#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM)
|
||||
class istdiostream : public istream
|
||||
{
|
||||
private:
|
||||
stdiobuf _file;
|
||||
public:
|
||||
istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
|
||||
};
|
||||
#endif
|
||||
|
||||
#define YY_FATAL_ERROR zend_fatal_scanner_error
|
||||
|
||||
#define HANDLE_NEWLINES(s,l) \
|
||||
@@ -170,7 +186,7 @@ BEGIN_EXTERN_C()
|
||||
ZEND_API void zend_open_file_dtor(void *f)
|
||||
{
|
||||
#ifdef ZTS
|
||||
delete *((ifstream **) f);
|
||||
delete *((istream **) f);
|
||||
#else
|
||||
fclose(*((FILE **) f));
|
||||
#endif
|
||||
@@ -187,7 +203,7 @@ ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
{
|
||||
#ifndef ZTS
|
||||
switch (file_handle->type) {
|
||||
@@ -218,14 +234,22 @@ ZEND_API inline int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
file_handle->handle.is = new ifstream(file_handle->handle.fd);
|
||||
break;
|
||||
case ZEND_HANDLE_FILENAME:
|
||||
file_handle->handle.is = new ifstream(file_handle->filename, ios::nocreate|ios::in|ios::binary);
|
||||
break;
|
||||
{
|
||||
file_handle->handle.fp = zend_fopen(file_handle->filename);
|
||||
if (!file_handle->handle.fp) {
|
||||
return FAILURE;
|
||||
}
|
||||
file_handle->handle.is = new istdiostream(file_handle->handle.fp);
|
||||
break;
|
||||
}
|
||||
case ZEND_HANDLE_FP:
|
||||
if (file_handle->handle.fp==stdin) {
|
||||
file_handle->handle.is = (ifstream *) &cin;
|
||||
} else {
|
||||
fclose(file_handle->handle.fp);
|
||||
file_handle->handle.is = new ifstream(file_handle->filename, ios::nocreate|ios::in|ios::binary);
|
||||
if (!file_handle->handle.fp) {
|
||||
return FAILURE;
|
||||
}
|
||||
file_handle->handle.is = new istdiostream(file_handle->handle.fp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -799,6 +823,10 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
return T_DEC;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"===" {
|
||||
return T_IS_IDENTICAL;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"==" {
|
||||
return T_IS_EQUAL;
|
||||
}
|
||||
|
||||
+14
-11
@@ -26,6 +26,7 @@
|
||||
#include "zend_constants.h"
|
||||
#include "zend_list.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_builtin_functions.h"
|
||||
|
||||
#ifdef ZTS
|
||||
# define GLOBAL_FUNCTION_TABLE global_function_table
|
||||
@@ -42,10 +43,10 @@ ZEND_API zend_class_entry zend_standard_class_def;
|
||||
ZEND_API int (*zend_printf)(const char *format, ...);
|
||||
ZEND_API int (*zend_write)(const char *str, uint str_length);
|
||||
ZEND_API void (*zend_error)(int type, const char *format, ...);
|
||||
void (*zend_message_dispatcher)(long message, void *data);
|
||||
FILE *(*zend_fopen)(const char *filename);
|
||||
void (*zend_block_interruptions)();
|
||||
void (*zend_unblock_interruptions)();
|
||||
ZEND_API void (*zend_message_dispatcher)(long message, void *data);
|
||||
ZEND_API FILE *(*zend_fopen)(const char *filename);
|
||||
ZEND_API void (*zend_block_interruptions)();
|
||||
ZEND_API void (*zend_unblock_interruptions)();
|
||||
ZEND_API int (*zend_get_ini_entry)(char *name, uint name_length, zval *contents);
|
||||
|
||||
#ifdef ZTS
|
||||
@@ -226,7 +227,7 @@ static void register_standard_class()
|
||||
zend_standard_class_def.handle_property_set = NULL;
|
||||
zend_standard_class_def.refcount = (int *) malloc(sizeof(int));
|
||||
*zend_standard_class_def.refcount = 1;
|
||||
zend_hash_add(GLOBAL_CLASS_TABLE, "stdClass", sizeof("stdClass"), &zend_standard_class_def, sizeof(zend_class_entry), NULL);
|
||||
zend_hash_add(GLOBAL_CLASS_TABLE, "stdclass", sizeof("stdclass"), &zend_standard_class_def, sizeof(zend_class_entry), NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -262,7 +263,7 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals)
|
||||
static void executor_globals_ctor(zend_executor_globals *executor_globals)
|
||||
{
|
||||
if (global_constants_table) {
|
||||
zend_startup_constants(executor_globals->zend_constants ELS_CC);
|
||||
zend_startup_constants(ELS_C);
|
||||
zend_copy_constants(executor_globals->zend_constants, global_constants_table);
|
||||
}
|
||||
init_resource_plist(ELS_C);
|
||||
@@ -278,7 +279,7 @@ static void executor_globals_dtor(zend_executor_globals *executor_globals)
|
||||
|
||||
static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
{
|
||||
start_memory_manager();
|
||||
start_memory_manager(ALS_C);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -291,10 +292,10 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions)
|
||||
zend_executor_globals *executor_globals;
|
||||
|
||||
alloc_globals_id = ts_allocate_id(sizeof(zend_alloc_globals), alloc_globals_ctor, NULL);
|
||||
#else
|
||||
start_memory_manager(ALS_C);
|
||||
#endif
|
||||
|
||||
start_memory_manager();
|
||||
|
||||
/* Set up utility functions and values */
|
||||
zend_error = utility_functions->error_function;
|
||||
zend_printf = utility_functions->printf_function;
|
||||
@@ -334,10 +335,10 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions)
|
||||
compiler_globals_dtor(compiler_globals);
|
||||
compiler_globals->function_table = GLOBAL_FUNCTION_TABLE;
|
||||
compiler_globals->class_table = GLOBAL_CLASS_TABLE;
|
||||
zend_startup_constants(EG(zend_constants), executor_globals);
|
||||
zend_startup_constants(executor_globals);
|
||||
GLOBAL_CONSTANTS_TABLE = EG(zend_constants);
|
||||
#else
|
||||
zend_startup_constants(EG(zend_constants));
|
||||
zend_startup_constants();
|
||||
#endif
|
||||
zend_register_standard_constants(ELS_C);
|
||||
|
||||
@@ -345,6 +346,8 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions)
|
||||
init_resource_plist(ELS_C);
|
||||
#endif
|
||||
|
||||
zend_startup_builtin_functions();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
+76
-25
@@ -23,7 +23,6 @@
|
||||
|
||||
#define ZEND_VERSION "0.90"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_EXTERN_C() extern "C" {
|
||||
#define END_EXTERN_C() }
|
||||
@@ -32,40 +31,71 @@
|
||||
#define END_EXTERN_C()
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* general definitions
|
||||
*/
|
||||
|
||||
#if WINNT||WIN32
|
||||
#include "config.w32.h"
|
||||
#if (defined(WINNT) && WINNT) || (defined(WIN32) && WIN32)
|
||||
# include "zend_config.w32.h"
|
||||
#else
|
||||
#include "zend_config.h"
|
||||
#include "config.unix.h"
|
||||
# include "zend_config.h"
|
||||
#endif
|
||||
|
||||
/* all HAVE_XXX test have to be after the include of zend_config above */
|
||||
|
||||
#ifdef HAVE_UNIX_H
|
||||
# include <unix.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#if ZEND_DEBUG
|
||||
#define ZEND_FILE_LINE_D char *__zend_filename, uint __zend_lineno
|
||||
#define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D
|
||||
#define ZEND_FILE_LINE_ORIG_D char *__zend_orig_filename, uint __zend_orig_lineno
|
||||
#define ZEND_FILE_LINE_ORIG_DC , ZEND_FILE_LINE_ORIG_D
|
||||
#define ZEND_FILE_LINE_RELAY_C __zend_filename, __zend_lineno
|
||||
#define ZEND_FILE_LINE_RELAY_CC , ZEND_FILE_LINE_RELAY_C
|
||||
#define ZEND_FILE_LINE_C __FILE__, __LINE__
|
||||
#define ZEND_FILE_LINE_CC , ZEND_FILE_LINE_C
|
||||
#define ZEND_FILE_LINE_EMPTY_C NULL, 0
|
||||
#define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C
|
||||
#define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno
|
||||
#define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C
|
||||
#else
|
||||
#define ZEND_FILE_LINE_D
|
||||
#define ZEND_FILE_LINE_DC
|
||||
#define ZEND_FILE_LINE_ORIG_D
|
||||
#define ZEND_FILE_LINE_ORIG_DC
|
||||
#define ZEND_FILE_LINE_RELAY_C
|
||||
#define ZEND_FILE_LINE_RELAY_CC
|
||||
#define ZEND_FILE_LINE_C
|
||||
#define ZEND_FILE_LINE_CC
|
||||
#define ZEND_FILE_LINE_EMPTY_C
|
||||
#define ZEND_FILE_LINE_EMPTY_CC
|
||||
#define ZEND_FILE_LINE_ORIG_RELAY_C
|
||||
#define ZEND_FILE_LINE_ORIG_RELAY_CC
|
||||
#endif /* ZEND_DEBUG */
|
||||
|
||||
|
||||
#include "zend_errors.h"
|
||||
#include "zend_alloc.h"
|
||||
|
||||
/* this is a workaround for a bug in gcc */
|
||||
#if SIZEOF_VOID_P == 8 || (1)
|
||||
typedef unsigned int zend_bool;
|
||||
#else
|
||||
typedef unsigned char zend_bool;
|
||||
#endif
|
||||
|
||||
#undef SUCCESS
|
||||
#undef FAILURE
|
||||
#define SUCCESS 0
|
||||
#define FAILURE -1 /* this MUST stay a negative number, or it may effect functions! */
|
||||
#define FAILURE -1 /* this MUST stay a negative number, or it may affect functions! */
|
||||
|
||||
|
||||
#include "zend_hash.h"
|
||||
#include "zend_llist.h"
|
||||
|
||||
|
||||
#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, HashTable *list, HashTable *plist, zval *this_ptr
|
||||
#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, list, plist, this_ptr
|
||||
|
||||
@@ -95,10 +125,7 @@ struct _zval_struct {
|
||||
/* Variable information */
|
||||
zvalue_value value; /* value */
|
||||
unsigned char type; /* active type */
|
||||
struct {
|
||||
unsigned int locks:7;
|
||||
unsigned int is_ref:1;
|
||||
} EA;
|
||||
unsigned char is_ref;
|
||||
short refcount;
|
||||
};
|
||||
|
||||
@@ -124,6 +151,8 @@ typedef struct _zend_overloaded_element {
|
||||
zval element;
|
||||
} zend_overloaded_element;
|
||||
|
||||
/* excpt.h on Digital Unix 4.0 defines function_table */
|
||||
#undef function_table
|
||||
|
||||
struct _zend_class_entry {
|
||||
char type;
|
||||
@@ -196,7 +225,7 @@ ZEND_API extern char *empty_string;
|
||||
ZEND_API extern char *undefined_variable_string;
|
||||
|
||||
#define STR_FREE(ptr) if (ptr && ptr!=empty_string && ptr!=undefined_variable_string) { efree(ptr); }
|
||||
|
||||
#define STR_FREE_REL(ptr) if (ptr && ptr!=empty_string && ptr!=undefined_variable_string) { efree_rel(ptr); }
|
||||
|
||||
/* output support */
|
||||
#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
|
||||
@@ -207,10 +236,10 @@ BEGIN_EXTERN_C()
|
||||
extern ZEND_API int (*zend_printf)(const char *format, ...);
|
||||
extern ZEND_API int (*zend_write)(const char *str, uint str_length);
|
||||
extern ZEND_API void (*zend_error)(int type, const char *format, ...);
|
||||
extern FILE *(*zend_fopen)(const char *filename);
|
||||
extern void (*zend_block_interruptions)();
|
||||
extern void (*zend_unblock_interruptions)();
|
||||
extern void (*zend_message_dispatcher)(long message, void *data);
|
||||
extern ZEND_API FILE *(*zend_fopen)(const char *filename);
|
||||
extern ZEND_API void (*zend_block_interruptions)();
|
||||
extern ZEND_API void (*zend_unblock_interruptions)();
|
||||
extern ZEND_API void (*zend_message_dispatcher)(long message, void *data);
|
||||
extern ZEND_API int (*zend_get_ini_entry)(char *name, uint name_length, zval *contents);
|
||||
END_EXTERN_C()
|
||||
|
||||
@@ -238,11 +267,33 @@ extern zend_utility_values zend_uv;
|
||||
|
||||
#define INIT_PZVAL(z) \
|
||||
(z)->refcount = 1; \
|
||||
(z)->EA.is_ref = 0; \
|
||||
(z)->EA.locks = 0;
|
||||
(z)->is_ref = 0;
|
||||
|
||||
#define MAKE_STD_ZVAL(zv) \
|
||||
#define MAKE_STD_ZVAL(zv) \
|
||||
zv = (zval *) emalloc(sizeof(zval)); \
|
||||
INIT_PZVAL(zv);
|
||||
|
||||
#define SEPARATE_ZVAL(ppzv) \
|
||||
{ \
|
||||
zval *orig_ptr = *(ppzv); \
|
||||
\
|
||||
if (orig_ptr->refcount>1) { \
|
||||
orig_ptr->refcount--; \
|
||||
*(ppzv) = (zval *) emalloc(sizeof(zval)); \
|
||||
**(ppzv) = *orig_ptr; \
|
||||
zval_copy_ctor(*(ppzv)); \
|
||||
(*(ppzv))->refcount=1; \
|
||||
(*(ppzv))->is_ref = 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define ZEND_MAX_RESERVED_RESOURCES 1
|
||||
|
||||
#endif /* _ZEND_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
+85
-9
@@ -26,8 +26,8 @@
|
||||
#include "zend_constants.h"
|
||||
#include "zend_operators.h"
|
||||
|
||||
#if HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
/* these variables are true statics/globals, and have to be mutex'ed on every access */
|
||||
@@ -226,6 +226,13 @@ ZEND_API inline int object_init(zval *arg)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS))
|
||||
{
|
||||
zend_error(E_WARNING, "add_assoc_function() is no longer supported");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
@@ -237,6 +244,28 @@ ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_assoc_bool(zval *arg, char *key, int b)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
|
||||
tmp->type = IS_BOOL;
|
||||
tmp->value.lval = b;
|
||||
INIT_PZVAL(tmp);
|
||||
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_assoc_resource(zval *arg, char *key, int r)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
|
||||
tmp->type = IS_RESOURCE;
|
||||
tmp->value.lval = r;
|
||||
INIT_PZVAL(tmp);
|
||||
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
@@ -280,13 +309,6 @@ ZEND_API inline int add_assoc_stringl(zval *arg, char *key, char *str, uint leng
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS))
|
||||
{
|
||||
zend_error(E_WARNING, "add_assoc_function() is no longer supported");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_index_long(zval *arg, uint index, long n)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
@@ -298,6 +320,28 @@ ZEND_API inline int add_index_long(zval *arg, uint index, long n)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_index_bool(zval *arg, uint index, int b)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
|
||||
tmp->type = IS_BOOL;
|
||||
tmp->value.lval = b;
|
||||
INIT_PZVAL(tmp);
|
||||
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_index_resource(zval *arg, uint index, int r)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
|
||||
tmp->type = IS_RESOURCE;
|
||||
tmp->value.lval = r;
|
||||
INIT_PZVAL(tmp);
|
||||
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_index_double(zval *arg, uint index, double d)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
@@ -352,6 +396,28 @@ ZEND_API inline int add_next_index_long(zval *arg, long n)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_next_index_bool(zval *arg, int b)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
|
||||
tmp->type = IS_BOOL;
|
||||
tmp->value.lval = b;
|
||||
INIT_PZVAL(tmp);
|
||||
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_next_index_resource(zval *arg, int r)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
|
||||
tmp->type = IS_RESOURCE;
|
||||
tmp->value.lval = r;
|
||||
INIT_PZVAL(tmp);
|
||||
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_next_index_double(zval *arg, double d)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
@@ -491,6 +557,16 @@ ZEND_API inline int add_property_long(zval *arg, char *key, long n)
|
||||
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
ZEND_API inline int add_property_resource(zval *arg, char *key, long n)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
|
||||
tmp->type = IS_RESOURCE;
|
||||
tmp->value.lval = n;
|
||||
INIT_PZVAL(tmp);
|
||||
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_property_double(zval *arg, char *key, double d)
|
||||
{
|
||||
|
||||
+93
-47
@@ -80,6 +80,7 @@ ZEND_API void wrong_param_count(void);
|
||||
#define BYREF_NONE 0
|
||||
#define BYREF_FORCE 1
|
||||
#define BYREF_ALLOW 2
|
||||
#define BYREF_FORCE_REST 3
|
||||
|
||||
#if !(WIN32||WINNT)
|
||||
#define DLEXPORT
|
||||
@@ -90,31 +91,43 @@ int zend_startup_module(zend_module_entry *module);
|
||||
ZEND_API int array_init(zval *arg);
|
||||
ZEND_API int object_init(zval *arg);
|
||||
ZEND_API int object_init_ex(zval *arg, zend_class_entry *ce);
|
||||
|
||||
/* no longer supported */
|
||||
ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
|
||||
|
||||
ZEND_API int add_assoc_long(zval *arg, char *key, long n);
|
||||
ZEND_API int add_assoc_bool(zval *arg, char *key, int b);
|
||||
ZEND_API int add_assoc_resource(zval *arg, char *key, int r);
|
||||
ZEND_API int add_assoc_double(zval *arg, char *key, double d);
|
||||
ZEND_API int add_assoc_string(zval *arg, char *key, char *str, int duplicate);
|
||||
ZEND_API int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
|
||||
ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
|
||||
|
||||
ZEND_API int add_index_long(zval *arg, uint idx, long n);
|
||||
ZEND_API int add_index_bool(zval *arg, uint idx, int b);
|
||||
ZEND_API int add_index_resource(zval *arg, uint idx, int r);
|
||||
ZEND_API int add_index_double(zval *arg, uint idx, double d);
|
||||
ZEND_API int add_index_string(zval *arg, uint idx, char *str, int duplicate);
|
||||
ZEND_API int add_index_stringl(zval *arg, uint idx, char *str, uint length, int duplicate);
|
||||
|
||||
ZEND_API int add_next_index_long(zval *arg, long n);
|
||||
ZEND_API int add_next_index_bool(zval *arg, int b);
|
||||
ZEND_API int add_next_index_resource(zval *arg, int r);
|
||||
ZEND_API int add_next_index_double(zval *arg, double d);
|
||||
ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate);
|
||||
ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate);
|
||||
|
||||
ZEND_API int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate);
|
||||
ZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate);
|
||||
ZEND_API int add_get_index_long(zval *arg, uint idx, long l, void **dest);
|
||||
ZEND_API int add_get_index_double(zval *arg, uint idx, double d, void **dest);
|
||||
ZEND_API int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate);
|
||||
ZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate);
|
||||
ZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, int duplicate);
|
||||
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, int param_count, zval *params[]);
|
||||
|
||||
ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval, int param_count, zval **params[], int no_separation);
|
||||
|
||||
ZEND_API int add_property_long(zval *arg, char *key, long l);
|
||||
ZEND_API int add_property_resource(zval *arg, char *key, long r);
|
||||
ZEND_API int add_property_double(zval *arg, char *key, double d);
|
||||
ZEND_API int add_property_string(zval *arg, char *key, char *str, int duplicate);
|
||||
ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
|
||||
@@ -182,51 +195,84 @@ ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length,
|
||||
#define RETURN_FALSE { RETVAL_FALSE; return; }
|
||||
#define RETURN_TRUE { RETVAL_TRUE; return; }
|
||||
|
||||
#define SET_VAR_STRING(n,v) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
\
|
||||
char *str=v; /* prevent 'v' from being evaluated more than once */ \
|
||||
var->value.str.val = (str); \
|
||||
var->value.str.len = strlen((str)); \
|
||||
var->type = IS_STRING; \
|
||||
INIT_PZVAL(var); \
|
||||
zend_hash_update(&EG(symbol_table), (n), strlen((n))+1, &var, sizeof(zval *), NULL); \
|
||||
} \
|
||||
}
|
||||
#define SET_VAR_STRINGL(n,v,l) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
\
|
||||
char *name=(n); \
|
||||
var->value.str.val = (v); \
|
||||
var->value.str.len = (l); \
|
||||
var->type = IS_STRING; \
|
||||
INIT_PZVAL(var); \
|
||||
zend_hash_update(&EG(symbol_table), name, strlen(name)+1, &var, sizeof(zval *), NULL); \
|
||||
} \
|
||||
}
|
||||
#define SET_VAR_LONG(n,v) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
\
|
||||
var->value.lval = (v); \
|
||||
var->type = IS_LONG; \
|
||||
INIT_PZVAL(var); \
|
||||
zend_hash_update(&EG(symbol_table), (n), strlen((n))+1, &var, sizeof(zval *), NULL); \
|
||||
} \
|
||||
}
|
||||
#define SET_VAR_DOUBLE(n,v) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
\
|
||||
var->value.dval = (v); \
|
||||
var->type = IS_DOUBLE; \
|
||||
INIT_PZVAL(var); \
|
||||
zend_hash_update(&EG(symbol_table)), (n), strlen((n))+1, &var, sizeof(zval *), NULL); \
|
||||
} \
|
||||
#define SET_VAR_STRING(n,v) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
char *str=(v); /* prevent 'v' from being evaluated more than once */ \
|
||||
\
|
||||
var->value.str.val = (str); \
|
||||
var->value.str.len = strlen((str)); \
|
||||
var->type = IS_STRING; \
|
||||
ZEND_SET_GLOBAL_VAR(n, var); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SET_VAR_STRINGL(n,v,l) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
\
|
||||
var->value.str.val = (v); \
|
||||
var->value.str.len = (l); \
|
||||
var->type = IS_STRING; \
|
||||
ZEND_SET_GLOBAL_VAR(n, var); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SET_VAR_LONG(n,v) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
\
|
||||
var->value.lval = (v); \
|
||||
var->type = IS_LONG; \
|
||||
ZEND_SET_GLOBAL_VAR(n, var); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SET_VAR_DOUBLE(n,v) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
\
|
||||
var->value.dval = (v); \
|
||||
var->type = IS_DOUBLE; \
|
||||
ZEND_SET_GLOBAL_VAR(n, var); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define ZEND_SET_SYMBOL(symtable, name, var) \
|
||||
{ \
|
||||
char *_name = (name); \
|
||||
\
|
||||
ZEND_SET_SYMBOL_WITH_LENGTH(symtable, _name, strlen(_name)+1, var); \
|
||||
}
|
||||
|
||||
|
||||
#define ZEND_SET_SYMBOL_WITH_LENGTH(symtable, name, name_length, var) \
|
||||
{ \
|
||||
zval **orig_var; \
|
||||
\
|
||||
if (zend_hash_find(symtable, (name), (name_length), (void **) &orig_var)==SUCCESS \
|
||||
&& PZVAL_IS_REF(*orig_var)) { \
|
||||
(var)->refcount = (*orig_var)->refcount; \
|
||||
(var)->is_ref = 1; \
|
||||
\
|
||||
zval_dtor(*orig_var); \
|
||||
**orig_var = *(var); \
|
||||
efree(var); \
|
||||
} else { \
|
||||
INIT_PZVAL((var)); \
|
||||
zend_hash_update(symtable, (name), (name_length), &(var), sizeof(zval *), NULL); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define ZEND_SET_GLOBAL_VAR(name, var) \
|
||||
ZEND_SET_SYMBOL(&EG(symbol_table), name, var)
|
||||
|
||||
#define ZEND_SET_GLOBAL_VAR_WITH_LENGTH(name, name_length, var) \
|
||||
ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), name, name_length, var)
|
||||
|
||||
#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? (p)->value.obj.properties : NULL)))
|
||||
|
||||
#endif /* _ZEND_API_H */
|
||||
|
||||
|
||||
+44
-83
@@ -23,11 +23,11 @@
|
||||
#include "zend.h"
|
||||
#include "zend_alloc.h"
|
||||
#include "zend_globals.h"
|
||||
#if HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
# include <signal.h>
|
||||
#endif
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef ZTS
|
||||
@@ -46,7 +46,7 @@ static zend_alloc_globals alloc_globals;
|
||||
|
||||
# if MEMORY_LIMIT
|
||||
# if ZEND_DEBUG
|
||||
#define CHECK_MEMORY_LIMIT(s) _CHECK_MEMORY_LIMIT(s,filename,lineno)
|
||||
#define CHECK_MEMORY_LIMIT(s) _CHECK_MEMORY_LIMIT(s ZEND_FILE_LINE_RELAY_CC)
|
||||
# else
|
||||
#define CHECK_MEMORY_LIMIT(s) _CHECK_MEMORY_LIMIT(s,NULL,0)
|
||||
# endif
|
||||
@@ -97,11 +97,7 @@ static zend_alloc_globals alloc_globals;
|
||||
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API void *_emalloc(size_t size, char *filename, uint lineno)
|
||||
#else
|
||||
ZEND_API void *_emalloc(size_t size)
|
||||
#endif
|
||||
ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
mem_header *p;
|
||||
ALS_FETCH();
|
||||
@@ -111,8 +107,10 @@ ZEND_API void *_emalloc(size_t size)
|
||||
if ((size < MAX_CACHED_MEMORY) && (AG(cache_count)[size] > 0)) {
|
||||
p = AG(cache)[size][--AG(cache_count)[size]];
|
||||
#if ZEND_DEBUG
|
||||
p->filename = filename;
|
||||
p->lineno = lineno;
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
p->orig_filename = __zend_orig_filename;
|
||||
p->orig_lineno = __zend_orig_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
p->reported = 0;
|
||||
#endif
|
||||
@@ -126,7 +124,7 @@ ZEND_API void *_emalloc(size_t size)
|
||||
|
||||
if (!p) {
|
||||
fprintf(stderr,"FATAL: emalloc(): Unable to allocate %ld bytes\n", (long) size);
|
||||
#if ZEND_DEBUG && HAVE_KILL && HAVE_GETPID
|
||||
#if ZEND_DEBUG && defined(HAVE_KILL) && defined(HAVE_GETPID)
|
||||
kill(getpid(), SIGSEGV);
|
||||
#else
|
||||
exit(1);
|
||||
@@ -138,8 +136,10 @@ ZEND_API void *_emalloc(size_t size)
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
p->size = size;
|
||||
#if ZEND_DEBUG
|
||||
p->filename = filename;
|
||||
p->lineno = lineno;
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
p->orig_filename = __zend_orig_filename;
|
||||
p->orig_lineno = __zend_orig_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
p->reported = 0;
|
||||
*((long *)(((char *) p) + sizeof(mem_header)+size+PLATFORM_PADDING+END_ALIGNMENT(size))) = MEM_BLOCK_END_MAGIC;
|
||||
@@ -152,17 +152,13 @@ ZEND_API void *_emalloc(size_t size)
|
||||
}
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API void _efree(void *ptr, char *filename, uint lineno)
|
||||
#else
|
||||
ZEND_API void _efree(void *ptr)
|
||||
#endif
|
||||
ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
mem_header *p = (mem_header *) ((char *)ptr - sizeof(mem_header) - PLATFORM_PADDING);
|
||||
ALS_FETCH();
|
||||
|
||||
#if ZEND_DEBUG
|
||||
if (!_mem_block_check(ptr, 1, filename, lineno)) {
|
||||
if (!_mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
|
||||
return;
|
||||
}
|
||||
memset(ptr, 0x5a, p->size);
|
||||
@@ -188,21 +184,13 @@ ZEND_API void _efree(void *ptr)
|
||||
}
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API void *_ecalloc(size_t nmemb, size_t size, char *filename, uint lineno)
|
||||
#else
|
||||
ZEND_API void *_ecalloc(size_t nmemb, size_t size)
|
||||
#endif
|
||||
ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
void *p;
|
||||
int final_size=size*nmemb;
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
#if ZEND_DEBUG
|
||||
p = _emalloc(final_size,filename,lineno);
|
||||
#else
|
||||
p = emalloc(final_size);
|
||||
#endif
|
||||
p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
if (!p) {
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *) p;
|
||||
@@ -213,22 +201,14 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size)
|
||||
}
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure, char *filename, uint lineno)
|
||||
#else
|
||||
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure)
|
||||
#endif
|
||||
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
mem_header *p = (mem_header *) ((char *)ptr-sizeof(mem_header)-PLATFORM_PADDING);
|
||||
mem_header *orig = p;
|
||||
ALS_FETCH();
|
||||
|
||||
if (!ptr) {
|
||||
#if ZEND_DEBUG
|
||||
return _emalloc(size, filename, lineno);
|
||||
#else
|
||||
return emalloc(size);
|
||||
#endif
|
||||
return _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
@@ -248,8 +228,8 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure)
|
||||
}
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
#if ZEND_DEBUG
|
||||
p->filename = filename;
|
||||
p->lineno = lineno;
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
*((long *)(((char *) p) + sizeof(mem_header)+size+PLATFORM_PADDING+END_ALIGNMENT(size))) = MEM_BLOCK_END_MAGIC;
|
||||
#endif
|
||||
@@ -263,22 +243,14 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure)
|
||||
}
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API char *_estrdup(const char *s, char *filename, uint lineno)
|
||||
#else
|
||||
ZEND_API char *_estrdup(const char *s)
|
||||
#endif
|
||||
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
int length;
|
||||
char *p;
|
||||
|
||||
length = strlen(s)+1;
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
#if ZEND_DEBUG
|
||||
p = (char *) _emalloc(length,filename,lineno);
|
||||
#else
|
||||
p = (char *) emalloc(length);
|
||||
#endif
|
||||
p = (char *) _emalloc(length ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
if (!p) {
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (char *)NULL;
|
||||
@@ -289,20 +261,12 @@ ZEND_API char *_estrdup(const char *s)
|
||||
}
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API char *_estrndup(const char *s, uint length, char *filename, uint lineno)
|
||||
#else
|
||||
ZEND_API char *_estrndup(const char *s, uint length)
|
||||
#endif
|
||||
ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
char *p;
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
#if ZEND_DEBUG
|
||||
p = (char *) _emalloc(length+1,filename,lineno);
|
||||
#else
|
||||
p = (char *) emalloc(length+1);
|
||||
#endif
|
||||
p = (char *) _emalloc(length+1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
if (!p) {
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (char *)NULL;
|
||||
@@ -343,10 +307,8 @@ ZEND_API int zend_set_memory_limit(unsigned int memory_limit)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void start_memory_manager(void)
|
||||
ZEND_API void start_memory_manager(ALS_D)
|
||||
{
|
||||
ALS_FETCH();
|
||||
|
||||
AG(phead) = AG(head) = NULL;
|
||||
|
||||
#if MEMORY_LIMIT
|
||||
@@ -362,7 +324,7 @@ ZEND_API void start_memory_manager(void)
|
||||
ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
{
|
||||
mem_header *p, *t;
|
||||
#ifdef ZEND_DEBUG
|
||||
#if ZEND_DEBUG
|
||||
int had_leaks=0;
|
||||
#endif
|
||||
ALS_FETCH();
|
||||
@@ -424,7 +386,7 @@ void zend_debug_alloc_output(char *format, ...)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int _mem_block_check(void *ptr, int silent, char *filename, int lineno)
|
||||
ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
mem_header *p = (mem_header *) ((char *)ptr - sizeof(mem_header) - PLATFORM_PADDING);
|
||||
int no_cache_notice=0;
|
||||
@@ -442,7 +404,10 @@ ZEND_API int _mem_block_check(void *ptr, int silent, char *filename, int lineno)
|
||||
if (!silent) {
|
||||
zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
|
||||
zend_debug_alloc_output("---------------------------------------\n");
|
||||
zend_debug_alloc_output("%s(%d) : Block 0x%0.8lX status:\n", filename, lineno, (long) p);
|
||||
zend_debug_alloc_output("%s(%d) : Block 0x%0.8lX status:\n" ZEND_FILE_LINE_RELAY_CC, (long) p);
|
||||
if (__zend_orig_filename) {
|
||||
zend_debug_alloc_output("%s(%d) : Actual location (location was relayed)\n" ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
zend_debug_alloc_output("%10s\t","Beginning: ");
|
||||
}
|
||||
|
||||
@@ -457,7 +422,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent, char *filename, int lineno)
|
||||
zend_debug_alloc_output("Freed\n");
|
||||
had_problems=1;
|
||||
} else {
|
||||
return _mem_block_check(ptr, 0, filename, lineno);
|
||||
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
break;
|
||||
case MEM_BLOCK_CACHED_MAGIC:
|
||||
@@ -468,7 +433,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent, char *filename, int lineno)
|
||||
}
|
||||
} else {
|
||||
if (!no_cache_notice) {
|
||||
return _mem_block_check(ptr, 0, filename, lineno);
|
||||
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -476,7 +441,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent, char *filename, int lineno)
|
||||
if (!silent) {
|
||||
zend_debug_alloc_output("Overrun (magic=0x%0.8lX, expected=0x%0.8lX)\n", p->magic, MEM_BLOCK_START_MAGIC);
|
||||
} else {
|
||||
return _mem_block_check(ptr, 0, filename, lineno);
|
||||
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
had_problems=1;
|
||||
valid_beginning=0;
|
||||
@@ -492,7 +457,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent, char *filename, int lineno)
|
||||
int i;
|
||||
|
||||
if (silent) {
|
||||
return _mem_block_check(ptr, 0, filename, lineno);
|
||||
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(mem_header)+p->size+PLATFORM_PADDING;
|
||||
@@ -534,7 +499,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent, char *filename, int lineno)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void _full_mem_check(int silent, char *filename, uint lineno)
|
||||
ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
mem_header *p;
|
||||
int errors=0;
|
||||
@@ -544,31 +509,27 @@ ZEND_API void _full_mem_check(int silent, char *filename, uint lineno)
|
||||
|
||||
|
||||
zend_debug_alloc_output("------------------------------------------------\n");
|
||||
zend_debug_alloc_output("Full Memory Check at %s:%d\n", filename, lineno);
|
||||
zend_debug_alloc_output("Full Memory Check at %s:%d\n" ZEND_FILE_LINE_RELAY_CC);
|
||||
|
||||
while (p) {
|
||||
if (!_mem_block_check((void *)((char *)p + sizeof(mem_header) + PLATFORM_PADDING), (silent?2:3), filename, lineno)) {
|
||||
if (!_mem_block_check((void *)((char *)p + sizeof(mem_header) + PLATFORM_PADDING), (silent?2:3) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
|
||||
errors++;
|
||||
}
|
||||
p = p->pNext;
|
||||
}
|
||||
zend_debug_alloc_output("End of full memory check %s:%d (%d errors)\n", filename, lineno, errors);
|
||||
zend_debug_alloc_output("End of full memory check %s:%d (%d errors)\n" ZEND_FILE_LINE_RELAY_CC, errors);
|
||||
zend_debug_alloc_output("------------------------------------------------\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API void _persist_alloc(void *ptr, char *filename, uint lineno)
|
||||
#else
|
||||
ZEND_API void _persist_alloc(void *ptr)
|
||||
#endif
|
||||
ZEND_API void _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
mem_header *p = (mem_header *) ((char *)ptr-sizeof(mem_header)-PLATFORM_PADDING);
|
||||
ALS_FETCH();
|
||||
|
||||
#if ZEND_DEBUG
|
||||
_mem_block_check(ptr, 1, filename, lineno);
|
||||
_mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
#endif
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
|
||||
+37
-39
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "zend_globals_macros.h"
|
||||
|
||||
#define MEM_BLOCK_START_MAGIC 0x7312F8DCL
|
||||
#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
|
||||
#define MEM_BLOCK_FREED_MAGIC 0x99954317L
|
||||
@@ -34,6 +36,8 @@ typedef struct _mem_header {
|
||||
char *filename;
|
||||
uint lineno;
|
||||
int reported;
|
||||
char *orig_filename;
|
||||
uint orig_lineno;
|
||||
#endif
|
||||
struct _mem_header *pNext;
|
||||
struct _mem_header *pLast;
|
||||
@@ -58,40 +62,35 @@ ZEND_API char *zend_strndup(const char *s, unsigned int length);
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API void *_emalloc(size_t size, char *filename, uint lineno);
|
||||
ZEND_API void _efree(void *ptr, char *filename, uint lineno);
|
||||
ZEND_API void *_ecalloc(size_t nmemb, size_t size, char *filename, uint lineno);
|
||||
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure, char *filename, uint lineno);
|
||||
ZEND_API char *_estrdup(const char *s, char *filename, uint lineno);
|
||||
ZEND_API char *_estrndup(const char *s, unsigned int length, char *filename, uint lineno);
|
||||
ZEND_API void _persist_alloc(void *ptr, char *filename, uint lineno);
|
||||
#define emalloc(size) _emalloc((size),__FILE__,__LINE__)
|
||||
#define efree(ptr) _efree((ptr),__FILE__,__LINE__)
|
||||
#define ecalloc(nmemb,size) _ecalloc((nmemb),(size),__FILE__,__LINE__)
|
||||
#define erealloc(ptr,size) _erealloc((ptr),(size),0,__FILE__,__LINE__)
|
||||
#define erealloc_recoverable(ptr,size) _erealloc((ptr),(size),1,__FILE__,__LINE__)
|
||||
#define estrdup(s) _estrdup((s),__FILE__,__LINE__)
|
||||
#define estrndup(s,length) _estrndup((s),(length),__FILE__,__LINE__)
|
||||
#define persist_alloc(p) _persist_alloc((p),__FILE__,__LINE__)
|
||||
#else
|
||||
ZEND_API void *_emalloc(size_t size);
|
||||
ZEND_API void _efree(void *ptr);
|
||||
ZEND_API void *_ecalloc(size_t nmemb, size_t size);
|
||||
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure);
|
||||
ZEND_API char *_estrdup(const char *s);
|
||||
ZEND_API char *_estrndup(const char *s, unsigned int length);
|
||||
ZEND_API void _persist_alloc(void *ptr);
|
||||
#define emalloc(size) _emalloc((size))
|
||||
#define efree(ptr) _efree((ptr))
|
||||
#define ecalloc(nmemb,size) _ecalloc((nmemb),(size))
|
||||
#define erealloc(ptr,size) _erealloc((ptr),(size),0)
|
||||
#define erealloc_recoverable(ptr,size) _erealloc((ptr),(size),1)
|
||||
#define estrdup(s) _estrdup((s))
|
||||
#define estrndup(s,length) _estrndup((s),(length))
|
||||
#define persist_alloc(p) _persist_alloc((p))
|
||||
#endif
|
||||
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_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API void _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
|
||||
/* Standard wrapper macros */
|
||||
#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define efree(ptr) _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define ecalloc(nmemb,size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define erealloc(ptr,size) _erealloc((ptr), (size),0 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define erealloc_recoverable(ptr,size) _erealloc((ptr), (size),1 ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define estrndup(s,length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define persist_alloc(p) _persist_alloc((p) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
|
||||
/* Relay wrapper macros */
|
||||
#define emalloc_rel(size) _emalloc((size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define efree_rel(ptr) _efree((ptr) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define ecalloc_rel(nmemb, size) _ecalloc((nmemb), (size) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define erealloc_rel(ptr, size) _erealloc((ptr), (size), 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define erealloc_recoverable_rel(ptr, size) _erealloc((ptr), (size), 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define estrdup_rel(s) _estrdup((s) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define estrndup_rel(s, length) _estrndup((s), (length) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
#define persist_alloc_rel(p) _persist_alloc((p) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC)
|
||||
|
||||
/* Selective persistent/non persistent allocation macros */
|
||||
#define pemalloc(size,persistent) ((persistent)?malloc(size):emalloc(size))
|
||||
#define pefree(ptr,persistent) ((persistent)?free(ptr):efree(ptr))
|
||||
#define pecalloc(nmemb,size,persistent) ((persistent)?calloc((nmemb),(size)):ecalloc((nmemb),(size)))
|
||||
@@ -104,15 +103,14 @@ ZEND_API void _persist_alloc(void *ptr);
|
||||
|
||||
ZEND_API int zend_set_memory_limit(unsigned int memory_limit);
|
||||
|
||||
ZEND_API void start_memory_manager(void);
|
||||
ZEND_API void start_memory_manager(ALS_D);
|
||||
ZEND_API void shutdown_memory_manager(int silent, int clean_cache);
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API int _mem_block_check(void *ptr, int silent, char *filename, int lineno);
|
||||
ZEND_API void _full_mem_check(int silent, char *filename, uint lineno);
|
||||
#define mem_block_check(ptr, silent) _mem_block_check(ptr, silent, __FILE__, __LINE__)
|
||||
#define mem_block_check(ptr, silent) _mem_block_check(ptr, silent, __FILE__, __LINE__)
|
||||
#define full_mem_check(silent) _full_mem_check(silent, __FILE__, __LINE__)
|
||||
ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
|
||||
#define mem_block_check(ptr, silent) _mem_block_check(ptr, silent ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#define full_mem_check(silent) _full_mem_check(silent ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
|
||||
#else
|
||||
#define mem_block_check(type, ptr, silent)
|
||||
#define full_mem_check(silent)
|
||||
|
||||
@@ -0,0 +1,423 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 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_91.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> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_builtin_functions.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_constants.h"
|
||||
|
||||
static ZEND_FUNCTION(zend_version);
|
||||
static ZEND_FUNCTION(func_num_args);
|
||||
static ZEND_FUNCTION(func_get_arg);
|
||||
static ZEND_FUNCTION(func_get_args);
|
||||
static ZEND_FUNCTION(strlen);
|
||||
static ZEND_FUNCTION(strcmp);
|
||||
static ZEND_FUNCTION(strcasecmp);
|
||||
static ZEND_FUNCTION(each);
|
||||
static ZEND_FUNCTION(error_reporting);
|
||||
static ZEND_FUNCTION(define);
|
||||
static ZEND_FUNCTION(defined);
|
||||
static ZEND_FUNCTION(get_class);
|
||||
static ZEND_FUNCTION(get_parent_class);
|
||||
static ZEND_FUNCTION(method_exists);
|
||||
static ZEND_FUNCTION(leak);
|
||||
|
||||
extern unsigned char first_arg_force_ref[];
|
||||
|
||||
static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(zend_version, NULL)
|
||||
ZEND_FE(func_num_args, NULL)
|
||||
ZEND_FE(func_get_arg, NULL)
|
||||
ZEND_FE(func_get_args, NULL)
|
||||
ZEND_FE(strlen, NULL)
|
||||
ZEND_FE(strcmp, NULL)
|
||||
ZEND_FE(strcasecmp, NULL)
|
||||
ZEND_FE(each, first_arg_force_ref)
|
||||
ZEND_FE(error_reporting, NULL)
|
||||
ZEND_FE(define, NULL)
|
||||
ZEND_FE(defined, NULL)
|
||||
ZEND_FE(get_class, NULL)
|
||||
ZEND_FE(get_parent_class, NULL)
|
||||
ZEND_FE(method_exists, NULL)
|
||||
ZEND_FE(leak, NULL)
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
int zend_startup_builtin_functions()
|
||||
{
|
||||
return zend_register_functions(builtin_functions, NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_FUNCTION(zend_version)
|
||||
{
|
||||
RETURN_STRINGL(ZEND_VERSION, sizeof(ZEND_VERSION)-1, 1);
|
||||
}
|
||||
|
||||
|
||||
ZEND_FUNCTION(func_num_args)
|
||||
{
|
||||
void **p;
|
||||
int arg_count;
|
||||
ELS_FETCH();
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
|
||||
|
||||
p = EG(argument_stack).top_element-1-arg_count-1;
|
||||
if (p>=EG(argument_stack).elements) {
|
||||
RETURN_LONG((ulong) *p);
|
||||
} else {
|
||||
zend_error(E_WARNING, "func_num_args(): Called from the global scope - no function context");
|
||||
RETURN_LONG(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_FUNCTION(func_get_arg)
|
||||
{
|
||||
void **p;
|
||||
int arg_count;
|
||||
zval **z_requested_offset;
|
||||
zval *arg;
|
||||
long requested_offset;
|
||||
ELS_FETCH();
|
||||
|
||||
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &z_requested_offset)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_long_ex(z_requested_offset);
|
||||
requested_offset = (*z_requested_offset)->value.lval;
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
|
||||
|
||||
p = EG(argument_stack).top_element-1-arg_count-1;
|
||||
if (p<EG(argument_stack).elements) {
|
||||
zend_error(E_WARNING, "func_get_arg(): Called from the global scope - no function context");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
arg_count = (ulong) *p;
|
||||
|
||||
if (requested_offset>arg_count) {
|
||||
zend_error(E_WARNING, "func_get_arg(): Only %d arguments passed to function (argument %d requested)", arg_count, requested_offset);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
arg = *(p-(arg_count-requested_offset));
|
||||
*return_value = *arg;
|
||||
zval_copy_ctor(return_value);
|
||||
}
|
||||
|
||||
|
||||
ZEND_FUNCTION(func_get_args)
|
||||
{
|
||||
void **p;
|
||||
int arg_count;
|
||||
int i;
|
||||
ELS_FETCH();
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
|
||||
|
||||
p = EG(argument_stack).top_element-1-arg_count-1;
|
||||
if (p<EG(argument_stack).elements) {
|
||||
zend_error(E_WARNING, "func_get_args(): Called from the global scope - no function context");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
arg_count = (ulong) *p;
|
||||
|
||||
|
||||
array_init(return_value);
|
||||
for (i=0; i<arg_count; i++) {
|
||||
zval *element;
|
||||
|
||||
element = (zval *) emalloc(sizeof(zval));
|
||||
*element = **((zval **) (p-(arg_count-i)));
|
||||
zval_copy_ctor(element);
|
||||
INIT_PZVAL(element);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &element, sizeof(zval *), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto int strlen(string str)
|
||||
Get string length */
|
||||
ZEND_FUNCTION(strlen)
|
||||
{
|
||||
zval **str;
|
||||
|
||||
if (ARG_COUNT(ht) != 1 || getParametersEx(1, &str) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(str);
|
||||
RETVAL_LONG((*str)->value.str.len);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int strcmp(string str1, string str2)
|
||||
Binary safe string comparison */
|
||||
ZEND_FUNCTION(strcmp)
|
||||
{
|
||||
zval **s1, **s2;
|
||||
|
||||
if (ARG_COUNT(ht) != 2 || getParametersEx(2, &s1, &s2) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
RETURN_LONG(zend_binary_strcmp(*s1,*s2));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int strcasecmp(string str1, string str2)
|
||||
Binary safe case-insensitive string comparison */
|
||||
ZEND_FUNCTION(strcasecmp)
|
||||
{
|
||||
zval **s1, **s2;
|
||||
|
||||
if (ARG_COUNT(ht)!=2 || getParametersEx(2, &s1, &s2) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
RETURN_LONG(zend_binary_strcasecmp(*s1, *s2));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_FUNCTION(each)
|
||||
{
|
||||
zval **array,*entry,**entry_ptr, *tmp;
|
||||
char *string_key;
|
||||
ulong num_key;
|
||||
zval **inserted_pointer;
|
||||
HashTable *target_hash;
|
||||
|
||||
if (ARG_COUNT(ht) != 1 || getParametersEx(1, &array) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
target_hash = HASH_OF(*array);
|
||||
if (!target_hash) {
|
||||
zend_error(E_WARNING,"Variable passed to each() is not an array or object");
|
||||
return;
|
||||
}
|
||||
if (zend_hash_get_current_data(target_hash, (void **) &entry_ptr)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
array_init(return_value);
|
||||
entry = *entry_ptr;
|
||||
|
||||
/* add value elements */
|
||||
if (entry->is_ref) {
|
||||
tmp = (zval *)emalloc(sizeof(zval));
|
||||
*tmp = *entry;
|
||||
zval_copy_ctor(tmp);
|
||||
tmp->is_ref=0;
|
||||
tmp->refcount=0;
|
||||
entry=tmp;
|
||||
}
|
||||
zend_hash_index_update(return_value->value.ht, 1, &entry, sizeof(zval *), NULL);
|
||||
entry->refcount++;
|
||||
zend_hash_update_ptr(return_value->value.ht, "value", sizeof("value"), entry, sizeof(zval *), NULL);
|
||||
entry->refcount++;
|
||||
|
||||
/* add the key elements */
|
||||
switch (zend_hash_get_current_key(target_hash, &string_key, &num_key)) {
|
||||
case HASH_KEY_IS_STRING:
|
||||
add_get_index_string(return_value,0,string_key,(void **) &inserted_pointer,0);
|
||||
break;
|
||||
case HASH_KEY_IS_LONG:
|
||||
add_get_index_long(return_value,0,num_key, (void **) &inserted_pointer);
|
||||
break;
|
||||
}
|
||||
zend_hash_update(return_value->value.ht, "key", sizeof("key"), inserted_pointer, sizeof(zval *), NULL);
|
||||
(*inserted_pointer)->refcount++;
|
||||
zend_hash_move_forward(target_hash);
|
||||
}
|
||||
|
||||
ZEND_FUNCTION(error_reporting)
|
||||
{
|
||||
zval **arg;
|
||||
int old_error_reporting;
|
||||
ELS_FETCH();
|
||||
|
||||
old_error_reporting = EG(error_reporting);
|
||||
switch (ARG_COUNT(ht)) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
if (getParametersEx(1,&arg) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_long_ex(arg);
|
||||
EG(error_reporting)=(*arg)->value.lval;
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
break;
|
||||
}
|
||||
|
||||
RETVAL_LONG(old_error_reporting);
|
||||
}
|
||||
|
||||
ZEND_FUNCTION(define)
|
||||
{
|
||||
zval **var, **val, **non_cs;
|
||||
int case_sensitive;
|
||||
zend_constant c;
|
||||
ELS_FETCH();
|
||||
|
||||
switch(ARG_COUNT(ht)) {
|
||||
case 2:
|
||||
if (getParametersEx(2, &var, &val)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
case_sensitive = CONST_CS;
|
||||
break;
|
||||
case 3:
|
||||
if (getParametersEx(3, &var, &val, &non_cs)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_long_ex(non_cs);
|
||||
if ((*non_cs)->value.lval) {
|
||||
case_sensitive = 0;
|
||||
} else {
|
||||
case_sensitive = CONST_CS;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
break;
|
||||
}
|
||||
switch((*val)->type) {
|
||||
case IS_LONG:
|
||||
case IS_DOUBLE:
|
||||
case IS_STRING:
|
||||
case IS_BOOL:
|
||||
case IS_RESOURCE:
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING,"Constants may only evaluate to scalar values");
|
||||
RETURN_FALSE;
|
||||
break;
|
||||
}
|
||||
convert_to_string_ex(var);
|
||||
|
||||
c.value = **val;
|
||||
zval_copy_ctor(&c.value);
|
||||
c.flags = case_sensitive | ~CONST_PERSISTENT; /* 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;
|
||||
}
|
||||
|
||||
|
||||
ZEND_FUNCTION(defined)
|
||||
{
|
||||
zval **var;
|
||||
zval c;
|
||||
|
||||
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &var)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(var);
|
||||
if (zend_get_constant((*var)->value.str.val, (*var)->value.str.len, &c)) {
|
||||
zval_dtor(&c);
|
||||
RETURN_LONG(1);
|
||||
} else {
|
||||
RETURN_LONG(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* {{{ proto string get_class(object object)
|
||||
Retrieves the class name ...
|
||||
*/
|
||||
ZEND_FUNCTION(get_class)
|
||||
{
|
||||
zval **arg;
|
||||
|
||||
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &arg)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if ((*arg)->type != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_STRINGL((*arg)->value.obj.ce->name, (*arg)->value.obj.ce->name_length, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string get_parent_class(object object)
|
||||
Retrieves the parent class name ...
|
||||
*/
|
||||
ZEND_FUNCTION(get_parent_class)
|
||||
{
|
||||
zval **arg;
|
||||
|
||||
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &arg)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (((*arg)->type != IS_OBJECT) || !(*arg)->value.obj.ce->parent) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_STRINGL((*arg)->value.obj.ce->parent->name, (*arg)->value.obj.ce->parent->name_length, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool method_exists(object object, string method)
|
||||
Checks if the class method exists ...
|
||||
*/
|
||||
ZEND_FUNCTION(method_exists)
|
||||
{
|
||||
zval **arg1, **arg2;
|
||||
|
||||
if (ARG_COUNT(ht)!=2 || getParametersEx(2, &arg1, &arg2)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if ((*arg1)->type != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_string_ex(arg2);
|
||||
if(zend_hash_exists(&(*arg1)->value.obj.ce->function_table, (*arg2)->value.str.val, (*arg2)->value.str.len+1)) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_FUNCTION(leak)
|
||||
{
|
||||
int leakbytes=3;
|
||||
zval **leak;
|
||||
|
||||
if (ARG_COUNT(ht)>=1) {
|
||||
if (getParametersEx(1, &leak)==SUCCESS) {
|
||||
convert_to_long_ex(leak);
|
||||
leakbytes = (*leak)->value.lval;
|
||||
}
|
||||
}
|
||||
|
||||
emalloc(leakbytes);
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| 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_91.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
@@ -17,43 +17,10 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_UNIX_H
|
||||
#define _CONFIG_UNIX_H
|
||||
|
||||
#define ZEND_API
|
||||
#ifndef _ZEND_BUILTIN_FUNCTIONS_H
|
||||
#define _ZEND_BUILTIN_FUNCTIONS_H
|
||||
|
||||
#include <stdlib.h>
|
||||
int zend_startup_builtin_functions();
|
||||
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LIBDL
|
||||
# include <dlfcn.h>
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_NOW)
|
||||
# define DL_UNLOAD dlclose
|
||||
# define DL_FETCH_SYMBOL dlsym
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#else
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 0
|
||||
#endif
|
||||
|
||||
#if BROKEN_SPRINTF
|
||||
int zend_sprintf(char *buffer, const char *format, ...);
|
||||
#else
|
||||
# define zend_sprintf sprintf
|
||||
#endif
|
||||
|
||||
#if ZEND_DEBUG
|
||||
# define inline
|
||||
#endif
|
||||
|
||||
#endif /* _CONFIG_UNIX_H */
|
||||
#endif /* _ZEND_BUILTIN_FUNCTIONS_H */
|
||||
+260
-83
@@ -55,11 +55,34 @@ static void free_filename(void *p)
|
||||
}
|
||||
|
||||
|
||||
static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline)
|
||||
{
|
||||
char lineno_buf[32];
|
||||
uint lineno_len;
|
||||
char *filename;
|
||||
|
||||
lineno_len = zend_sprintf(lineno_buf, "%d", opline->lineno);
|
||||
if (opline->filename) {
|
||||
filename = opline->filename;
|
||||
} else {
|
||||
filename = "-";
|
||||
}
|
||||
|
||||
/* NULL, name length, filename length, line number length */
|
||||
result->value.str.len = 1+name->value.str.len+strlen(filename)+lineno_len+1;
|
||||
result->value.str.val = (char *) emalloc(result->value.str.len+1);
|
||||
sprintf(result->value.str.val, "%c%s%s%s", '\0', name->value.str.val, filename, lineno_buf);
|
||||
result->type = IS_STRING;
|
||||
result->refcount = 1;
|
||||
}
|
||||
|
||||
|
||||
void init_compiler(CLS_D ELS_DC)
|
||||
{
|
||||
zend_stack_init(&CG(bp_stack));
|
||||
zend_stack_init(&CG(function_call_stack));
|
||||
zend_stack_init(&CG(switch_cond_stack));
|
||||
zend_stack_init(&CG(foreach_copy_stack));
|
||||
zend_stack_init(&CG(object_stack));
|
||||
CG(active_class_entry) = NULL;
|
||||
zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0);
|
||||
@@ -80,6 +103,7 @@ void shutdown_compiler(CLS_D)
|
||||
zend_stack_destroy(&CG(bp_stack));
|
||||
zend_stack_destroy(&CG(function_call_stack));
|
||||
zend_stack_destroy(&CG(switch_cond_stack));
|
||||
zend_stack_destroy(&CG(foreach_copy_stack));
|
||||
zend_stack_destroy(&CG(object_stack));
|
||||
zend_llist_destroy(&CG(filenames_list));
|
||||
zend_hash_apply(CG(function_table), (int (*)(void *)) is_not_internal_function);
|
||||
@@ -88,13 +112,14 @@ void shutdown_compiler(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_set_compiled_filename(char *new_compiled_filename)
|
||||
ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename)
|
||||
{
|
||||
char *p = estrdup(new_compiled_filename);
|
||||
CLS_FETCH();
|
||||
|
||||
zend_llist_add_element(&CG(filenames_list), &p);
|
||||
CG(compiled_filename) = p;
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,28 +196,40 @@ void do_fetch_globals(znode *varname CLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC)
|
||||
void fetch_simple_variable_ex(znode *result, znode *varname, int bp, int op CLS_DC)
|
||||
{
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
zend_op opline;
|
||||
zend_op *opline_ptr;
|
||||
zend_llist *fetch_list_ptr;
|
||||
|
||||
opline->opcode = ZEND_FETCH_W; /* the default mode must be Write, since fetch_simple_variable() is used to define function arguments */
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.EA.type = 0;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *varname;
|
||||
*result = opline->result;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.constant.value.lval = ZEND_FETCH_LOCAL;
|
||||
if (bp) {
|
||||
opline_ptr = &opline;
|
||||
init_op(opline_ptr CLS_CC);
|
||||
} else {
|
||||
opline_ptr = get_next_op(CG(active_op_array) CLS_CC);
|
||||
}
|
||||
|
||||
opline_ptr->opcode = op;
|
||||
opline_ptr->result.op_type = IS_VAR;
|
||||
opline_ptr->result.u.EA.type = 0;
|
||||
opline_ptr->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline_ptr->op1 = *varname;
|
||||
*result = opline_ptr->result;
|
||||
SET_UNUSED(opline_ptr->op2);
|
||||
opline_ptr->op2.u.fetch_type = ZEND_FETCH_LOCAL;
|
||||
|
||||
if (bp) {
|
||||
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
|
||||
zend_llist_add_element(fetch_list_ptr, &next_op_number);
|
||||
zend_llist_add_element(fetch_list_ptr, opline_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC)
|
||||
{
|
||||
/* the default mode must be Write, since fetch_simple_variable() is used to define function arguments */
|
||||
fetch_simple_variable_ex(result, varname, bp, ZEND_FETCH_W CLS_CC);
|
||||
}
|
||||
|
||||
|
||||
void fetch_array_begin(znode *result, znode *varname, znode *first_dim CLS_DC)
|
||||
{
|
||||
@@ -204,21 +241,21 @@ void fetch_array_begin(znode *result, znode *varname, znode *first_dim CLS_DC)
|
||||
|
||||
void fetch_array_dim(znode *result, znode *parent, znode *dim CLS_DC)
|
||||
{
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
zend_op opline;
|
||||
zend_llist *fetch_list_ptr;
|
||||
|
||||
opline->opcode = ZEND_FETCH_DIM_W; /* the backpatching routine assumes W */
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.EA.type = 0;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *parent;
|
||||
opline->op2 = *dim;
|
||||
opline->extended_value = ZEND_FETCH_STANDARD;
|
||||
*result = opline->result;
|
||||
init_op(&opline CLS_CC);
|
||||
opline.opcode = ZEND_FETCH_DIM_W; /* the backpatching routine assumes W */
|
||||
opline.result.op_type = IS_VAR;
|
||||
opline.result.u.EA.type = 0;
|
||||
opline.result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline.op1 = *parent;
|
||||
opline.op2 = *dim;
|
||||
opline.extended_value = ZEND_FETCH_STANDARD;
|
||||
*result = opline.result;
|
||||
|
||||
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
|
||||
zend_llist_add_element(fetch_list_ptr, &next_op_number);
|
||||
zend_llist_add_element(fetch_list_ptr, &opline);
|
||||
}
|
||||
|
||||
|
||||
@@ -459,23 +496,27 @@ void do_begin_variable_parse(CLS_D)
|
||||
{
|
||||
zend_llist fetch_list;
|
||||
|
||||
zend_llist_init(&fetch_list, sizeof(int), NULL, 0);
|
||||
/* 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));
|
||||
}
|
||||
|
||||
|
||||
void do_end_variable_parse(int type CLS_DC)
|
||||
void do_end_variable_parse(int type, int arg_offset CLS_DC)
|
||||
{
|
||||
zend_llist *fetch_list_ptr;
|
||||
zend_llist_element *le;
|
||||
zend_op *opline;
|
||||
zend_op *opline, *opline_ptr;
|
||||
|
||||
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
|
||||
|
||||
le = fetch_list_ptr->head;
|
||||
|
||||
while (le) {
|
||||
opline = &CG(active_op_array)->opcodes[*((int *) le->data)];
|
||||
opline_ptr = (zend_op *)le->data;
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
memcpy(opline, opline_ptr, sizeof(zend_op));
|
||||
switch (type) {
|
||||
case BP_VAR_R:
|
||||
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
|
||||
@@ -490,6 +531,11 @@ void do_end_variable_parse(int type CLS_DC)
|
||||
break;
|
||||
case BP_VAR_IS:
|
||||
opline->opcode += 6; /* 3+3 */
|
||||
break;
|
||||
case BP_VAR_FUNC_ARG:
|
||||
opline->opcode += 9; /* 3+3+3 */
|
||||
opline->extended_value = arg_offset;
|
||||
break;
|
||||
}
|
||||
le = le->next;
|
||||
}
|
||||
@@ -588,7 +634,6 @@ void do_free(znode *op1 CLS_DC)
|
||||
&& opline->result.u.var == op1->u.var) {
|
||||
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
} else {
|
||||
|
||||
/* This should be an object instanciation
|
||||
* Find JMP_NO_CTOR, mark the preceding ASSIGN and the
|
||||
* proceeding INIT_FCALL_BY_NAME as unused
|
||||
@@ -627,14 +672,14 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
|
||||
opline->opcode = ZEND_DECLARE_FUNCTION_OR_CLASS;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
opline->op1.u.constant.type = IS_LONG;
|
||||
opline->op1.u.constant.value.lval = zend_hash_next_free_element(CG(function_table));
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &function_name->u.constant, opline);
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.value.str.val = estrndup(name, name_len);
|
||||
opline->op2.u.constant.value.str.len = name_len;
|
||||
opline->op2.u.constant.refcount = 1;
|
||||
opline->extended_value = ZEND_DECLARE_FUNCTION;
|
||||
zend_hash_next_index_insert(CG(function_table), &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
|
||||
zend_hash_update(CG(function_table), opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
|
||||
}
|
||||
|
||||
if (CG(extended_info)) {
|
||||
@@ -645,6 +690,19 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
|
||||
{
|
||||
/* Push a seperator to the switch and foreach stacks */
|
||||
zend_switch_entry switch_entry;
|
||||
|
||||
switch_entry.cond.op_type = IS_UNUSED;
|
||||
switch_entry.default_case = 0;
|
||||
switch_entry.control_var = 0;
|
||||
|
||||
zend_stack_push(&CG(switch_cond_stack), (void *) &switch_entry, sizeof(switch_entry));
|
||||
|
||||
zend_stack_push(&CG(foreach_copy_stack), (void *) &switch_entry.cond, sizeof(znode));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -652,6 +710,10 @@ void do_end_function_declaration(znode *function_token CLS_DC)
|
||||
{
|
||||
pass_two(CG(active_op_array));
|
||||
CG(active_op_array) = function_token->u.op_array;
|
||||
|
||||
/* Pop the switch and foreach seperators */
|
||||
zend_stack_del_top(&CG(switch_cond_stack));
|
||||
zend_stack_del_top(&CG(foreach_copy_stack));
|
||||
}
|
||||
|
||||
|
||||
@@ -684,7 +746,7 @@ void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, un
|
||||
}
|
||||
|
||||
|
||||
void do_begin_function_call(znode *function_name CLS_DC)
|
||||
int do_begin_function_call(znode *function_name CLS_DC)
|
||||
{
|
||||
zend_function *function;
|
||||
|
||||
@@ -694,7 +756,7 @@ void do_begin_function_call(znode *function_name CLS_DC)
|
||||
|
||||
zval_copy_ctor(&tmp.u.constant);
|
||||
do_begin_dynamic_function_call(&tmp CLS_CC);
|
||||
return;
|
||||
return 1; /* Dynamic */
|
||||
}
|
||||
|
||||
switch (function->type) {
|
||||
@@ -711,6 +773,7 @@ void do_begin_function_call(znode *function_name CLS_DC)
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -749,12 +812,12 @@ 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 CLS_DC)
|
||||
void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
ELS_FETCH();
|
||||
|
||||
if (function_name->op_type==IS_CONST && !is_method) {
|
||||
if (function_name->op_type==IS_CONST && !is_method && !is_dynamic_fcall) {
|
||||
opline->opcode = ZEND_DO_FCALL;
|
||||
} else {
|
||||
opline->opcode = ZEND_DO_FCALL_BY_NAME;
|
||||
@@ -772,7 +835,7 @@ void do_end_function_call(znode *function_name, znode *result, znode *argument_l
|
||||
|
||||
void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
zend_op *opline;
|
||||
unsigned char *arg_types;
|
||||
int original_op=op;
|
||||
zend_function **function_ptr_ptr, *function_ptr;
|
||||
@@ -781,10 +844,8 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
function_ptr = *function_ptr_ptr;
|
||||
if (function_ptr) {
|
||||
arg_types = function_ptr->common.arg_types;
|
||||
opline->extended_value = ZEND_DO_FCALL;
|
||||
} else {
|
||||
arg_types = NULL;
|
||||
opline->extended_value = ZEND_DO_FCALL_BY_NAME;
|
||||
}
|
||||
|
||||
if (op == ZEND_SEND_VAL) {
|
||||
@@ -798,8 +859,9 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (arg_types && offset<=arg_types[0]
|
||||
&& arg_types[offset]==BYREF_FORCE) {
|
||||
|
||||
|
||||
if (ARG_SHOULD_BE_SENT_BY_REF(offset, 1, arg_types)) {
|
||||
/* change to passing by reference */
|
||||
switch (param->op_type) {
|
||||
case IS_VAR:
|
||||
@@ -815,17 +877,23 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
switch(op) {
|
||||
case ZEND_SEND_VAR:
|
||||
if (function_ptr) {
|
||||
do_end_variable_parse(BP_VAR_R CLS_CC);
|
||||
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
} else {
|
||||
do_end_variable_parse(BP_VAR_W CLS_CC);
|
||||
do_end_variable_parse(BP_VAR_FUNC_ARG, offset CLS_CC);
|
||||
}
|
||||
break;
|
||||
case ZEND_SEND_REF:
|
||||
do_end_variable_parse(BP_VAR_W CLS_CC);
|
||||
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
if (function_ptr) {
|
||||
opline->extended_value = ZEND_DO_FCALL;
|
||||
} else {
|
||||
opline->extended_value = ZEND_DO_FCALL_BY_NAME;
|
||||
}
|
||||
opline->opcode = op;
|
||||
opline->op1 = *param;
|
||||
opline->op2.u.opline_num = offset;
|
||||
@@ -833,9 +901,51 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
static int generate_free_switch_expr(zend_switch_entry *switch_entry CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
if (switch_entry->cond.op_type == IS_UNUSED) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_SWITCH_FREE;
|
||||
opline->op1 = switch_entry->cond;
|
||||
SET_UNUSED(opline->op2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int generate_free_foreach_copy(znode *foreach_copy CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
if (foreach_copy->op_type == IS_UNUSED) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_FREE;
|
||||
opline->op1 = *foreach_copy;
|
||||
SET_UNUSED(opline->op2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void do_return(znode *expr CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
zend_op *opline;
|
||||
|
||||
#ifdef ZTS
|
||||
zend_stack_apply_with_argument(&CG(switch_cond_stack), (int (*)(void *element, void *)) generate_free_switch_expr, ZEND_STACK_APPLY_TOPDOWN CLS_CC);
|
||||
zend_stack_apply_with_argument(&CG(foreach_copy_stack), (int (*)(void *element, void *)) generate_free_foreach_copy, ZEND_STACK_APPLY_TOPDOWN CLS_CC);
|
||||
#else
|
||||
zend_stack_apply(&CG(switch_cond_stack), (int (*)(void *element)) generate_free_switch_expr, ZEND_STACK_APPLY_TOPDOWN);
|
||||
zend_stack_apply(&CG(foreach_copy_stack), (int (*)(void *element)) generate_free_foreach_copy, ZEND_STACK_APPLY_TOPDOWN);
|
||||
#endif
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_RETURN;
|
||||
if (expr) {
|
||||
@@ -857,26 +967,52 @@ static void function_add_ref(zend_function *function)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table)
|
||||
static void do_inherit_parent_constructor(zend_class_entry *ce)
|
||||
{
|
||||
if (ce->parent
|
||||
&& !zend_hash_exists(&ce->function_table, ce->name, ce->name_length+1)) {
|
||||
zend_function *function;
|
||||
|
||||
if (zend_hash_find(&ce->parent->function_table, ce->parent->name, ce->parent->name_length+1, (void **) &function)==SUCCESS) {
|
||||
/* inherit parent's constructor */
|
||||
zend_hash_update(&ce->function_table, ce->name, ce->name_length+1, function, sizeof(zend_function), NULL);
|
||||
function_add_ref(function);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time)
|
||||
{
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_DECLARE_FUNCTION: {
|
||||
zend_function *function;
|
||||
|
||||
zend_hash_index_find(function_table, opline->op1.u.constant.value.lval, (void **) &function);
|
||||
zend_hash_find(function_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &function);
|
||||
(*function->op_array.refcount)++;
|
||||
if (zend_hash_add(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, function, sizeof(zend_function), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redeclare %s()", opline->op2.u.constant.value.str.val);
|
||||
if (!compile_time) {
|
||||
zend_error(E_ERROR, "Cannot redeclare %s()", opline->op2.u.constant.value.str.val);
|
||||
}
|
||||
return FAILURE;
|
||||
} else {
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_DECLARE_CLASS: {
|
||||
zend_class_entry *ce;
|
||||
|
||||
zend_hash_index_find(class_table, opline->op1.u.constant.value.lval, (void **) &ce);
|
||||
zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce);
|
||||
(*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) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
|
||||
(*ce->refcount)--;
|
||||
if (!compile_time) {
|
||||
zend_error(E_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
|
||||
}
|
||||
return FAILURE;
|
||||
} else {
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -886,49 +1022,72 @@ ZEND_API void do_bind_function_or_class(zend_op *opline, HashTable *function_tab
|
||||
zend_function tmp_zend_function;
|
||||
zval *tmp;
|
||||
|
||||
zend_hash_index_find(class_table, opline->op1.u.constant.value.lval, (void **) &ce);
|
||||
zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce);
|
||||
(*ce->refcount)++;
|
||||
|
||||
/* 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_COMPILE_ERROR, "Invalid runtime class entry");
|
||||
zend_error(E_CORE_ERROR, "Invalid runtime class entry");
|
||||
}
|
||||
*class_name++ = 0;
|
||||
|
||||
/* Obtain parent class */
|
||||
if (zend_hash_find(class_table, parent_name, strlen(parent_name)+1, (void **) &parent_ce)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Class %s: Cannot inherit from undefined class %s", class_name, parent_name);
|
||||
if (!compile_time) {
|
||||
zend_error(E_ERROR, "Class %s: Cannot inherit from undefined class %s", class_name, parent_name);
|
||||
}
|
||||
(*ce->refcount)--;
|
||||
*(class_name-1) = ':';
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
/* Perform inheritence */
|
||||
zend_hash_copy(&ce->function_table, &parent_ce->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function));
|
||||
zend_hash_copy(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
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);
|
||||
|
||||
/* Register the derived class */
|
||||
if (zend_hash_add(class_table, class_name, strlen(class_name)+1, ce, sizeof(zend_class_entry), NULL)==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
|
||||
if (!compile_time) {
|
||||
zend_error(E_ERROR, "Cannot redeclare class %s", opline->op2.u.constant.value.str.val);
|
||||
}
|
||||
(*ce->refcount)--;
|
||||
zend_hash_destroy(&ce->function_table);
|
||||
zend_hash_destroy(&ce->default_properties);
|
||||
return FAILURE;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
void do_early_binding(CLS_D)
|
||||
{
|
||||
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
|
||||
HashTable *table;
|
||||
|
||||
do_bind_function_or_class(opline, CG(function_table), CG(class_table));
|
||||
if (do_bind_function_or_class(opline, CG(function_table), CG(class_table), 1)==FAILURE) {
|
||||
return;
|
||||
}
|
||||
switch (opline->extended_value) {
|
||||
case ZEND_DECLARE_FUNCTION:
|
||||
zend_hash_index_del(CG(function_table), opline->op1.u.constant.value.lval);
|
||||
table = CG(function_table);
|
||||
break;
|
||||
case ZEND_DECLARE_CLASS:
|
||||
zend_hash_index_del(CG(class_table), opline->op1.u.constant.value.lval);
|
||||
table = CG(class_table);
|
||||
break;
|
||||
default:
|
||||
zend_error(E_COMPILE_ERROR, "Invalid binding type");
|
||||
return;
|
||||
}
|
||||
zend_hash_del(table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len);
|
||||
zval_dtor(&opline->op1.u.constant);
|
||||
zval_dtor(&opline->op2.u.constant);
|
||||
opline->opcode = ZEND_NOP;
|
||||
SET_UNUSED(opline->op1);
|
||||
@@ -1096,7 +1255,10 @@ void do_switch_end(znode *case_list CLS_DC)
|
||||
CG(active_op_array)->current_brk_cont = CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].parent;
|
||||
|
||||
/* emit free for the switch condition*/
|
||||
do_free(&switch_entry_ptr->cond CLS_CC);
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_SWITCH_FREE;
|
||||
opline->op1 = switch_entry_ptr->cond;
|
||||
SET_UNUSED(opline->op2);
|
||||
if (switch_entry_ptr->cond.op_type == IS_CONST) {
|
||||
zval_dtor(&switch_entry_ptr->cond.u.constant);
|
||||
}
|
||||
@@ -1237,9 +1399,12 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
/* copy default properties */
|
||||
zend_hash_copy(&CG(class_entry).default_properties, &parent_class->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
CG(class_entry).parent = parent_class;
|
||||
|
||||
zval_dtor(&parent_class_name->u.constant);
|
||||
} else {
|
||||
runtime_inheritence = 1;
|
||||
CG(class_entry).parent = NULL;
|
||||
}
|
||||
} else {
|
||||
CG(class_entry).parent = NULL;
|
||||
@@ -1251,10 +1416,10 @@ 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;
|
||||
opline->op1.u.constant.type = IS_LONG;
|
||||
opline->op1.u.constant.value.lval = zend_hash_next_free_element(CG(class_table));
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &class_name->u.constant, opline);
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.refcount = 1;
|
||||
if (runtime_inheritence) {
|
||||
char *full_class_name;
|
||||
|
||||
@@ -1266,6 +1431,7 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
full_class_name[0] = ':';
|
||||
full_class_name++;
|
||||
memcpy(full_class_name, CG(class_entry).name, CG(class_entry).name_length);
|
||||
zval_dtor(&parent_class_name->u.constant);
|
||||
full_class_name += CG(class_entry).name_length;
|
||||
full_class_name[0] = 0;
|
||||
opline->extended_value = ZEND_DECLARE_INHERITED_CLASS;
|
||||
@@ -1275,12 +1441,13 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
opline->extended_value = ZEND_DECLARE_CLASS;
|
||||
}
|
||||
|
||||
zend_hash_next_index_insert(CG(class_table), &CG(class_entry), sizeof(zend_class_entry), (void **) &CG(active_class_entry));
|
||||
zend_hash_update(CG(class_table), opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &CG(class_entry), sizeof(zend_class_entry), (void **) &CG(active_class_entry));
|
||||
}
|
||||
|
||||
|
||||
void do_end_class_declaration(CLS_D)
|
||||
{
|
||||
do_inherit_parent_constructor(CG(active_class_entry));
|
||||
CG(active_class_entry) = NULL;
|
||||
}
|
||||
|
||||
@@ -1299,20 +1466,20 @@ void do_declare_property(znode *var_name, znode *value CLS_DC)
|
||||
|
||||
void do_fetch_property(znode *result, znode *object, znode *property CLS_DC)
|
||||
{
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
zend_op opline;
|
||||
zend_llist *fetch_list_ptr;
|
||||
|
||||
opline->opcode = ZEND_FETCH_OBJ_W; /* the backpatching routine assumes W */
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.EA.type = 0;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *object;
|
||||
opline->op2 = *property;
|
||||
*result = opline->result;
|
||||
init_op(&opline CLS_CC);
|
||||
opline.opcode = ZEND_FETCH_OBJ_W; /* the backpatching routine assumes W */
|
||||
opline.result.op_type = IS_VAR;
|
||||
opline.result.u.EA.type = 0;
|
||||
opline.result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline.op1 = *object;
|
||||
opline.op2 = *property;
|
||||
*result = opline.result;
|
||||
|
||||
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
|
||||
zend_llist_add_element(fetch_list_ptr, &next_op_number);
|
||||
zend_llist_add_element(fetch_list_ptr, &opline);
|
||||
}
|
||||
|
||||
|
||||
@@ -1343,8 +1510,8 @@ void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
|
||||
opline->op1 = *class_name;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
//*result = opline->result;
|
||||
//do_assign(result, variable, &opline->result CLS_CC);
|
||||
/* *result = opline->result;
|
||||
do_assign(result, variable, &opline->result CLS_CC); */
|
||||
|
||||
|
||||
new_token->u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
@@ -1372,7 +1539,7 @@ void do_end_new_object(znode *result, znode *class_name, znode *new_token, znode
|
||||
if (class_name->op_type == IS_CONST) {
|
||||
zval_copy_ctor(&class_name->u.constant);
|
||||
}
|
||||
do_end_function_call(class_name, &ctor_result, argument_list, 1 CLS_CC);
|
||||
do_end_function_call(class_name, &ctor_result, argument_list, 1, 0 CLS_CC);
|
||||
do_free(&ctor_result CLS_CC);
|
||||
|
||||
CG(active_op_array)->opcodes[new_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
@@ -1435,7 +1602,7 @@ void do_shell_exec(znode *result, znode *cmd CLS_DC)
|
||||
|
||||
|
||||
|
||||
void do_init_array(znode *result, znode *expr, znode *offset CLS_DC)
|
||||
void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1454,10 +1621,11 @@ void do_init_array(znode *result, znode *expr, znode *offset CLS_DC)
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
opline->extended_value = is_ref;
|
||||
}
|
||||
|
||||
|
||||
void do_add_array_element(znode *result, znode *expr, znode *offset CLS_DC)
|
||||
void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1469,6 +1637,7 @@ void do_add_array_element(znode *result, znode *expr, znode *offset CLS_DC)
|
||||
} else {
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
opline->extended_value = is_ref;
|
||||
}
|
||||
|
||||
|
||||
@@ -1613,7 +1782,7 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *varname;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.constant.value.lval = fetch_type;
|
||||
opline->op2.u.fetch_type = fetch_type;
|
||||
|
||||
if (varname->op_type == IS_CONST) {
|
||||
zval_copy_ctor(&varname->u.constant);
|
||||
@@ -1658,10 +1827,13 @@ void do_indirect_references(znode *result, znode *num_references, znode *variabl
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=1; i<=num_references->u.constant.value.lval; i++) {
|
||||
fetch_simple_variable(result, variable, 1 CLS_CC);
|
||||
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
for (i=1; i<num_references->u.constant.value.lval; i++) {
|
||||
fetch_simple_variable_ex(result, variable, 0, ZEND_FETCH_R CLS_CC);
|
||||
*variable = *result;
|
||||
}
|
||||
do_begin_variable_parse(CLS_C);
|
||||
fetch_simple_variable(result, variable, 1 CLS_CC);
|
||||
}
|
||||
|
||||
|
||||
@@ -1688,7 +1860,7 @@ void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
do_end_variable_parse(BP_VAR_IS CLS_CC);
|
||||
do_end_variable_parse(BP_VAR_IS, 0 CLS_CC);
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_ISSET_ISEMPTY;
|
||||
@@ -1713,6 +1885,8 @@ void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_t
|
||||
SET_UNUSED(opline->op2);
|
||||
*open_brackets_token = opline->result;
|
||||
|
||||
zend_stack_push(&CG(foreach_copy_stack), (void *) &opline->result, sizeof(znode));
|
||||
|
||||
/* save the location of the beginning of the loop (array fetching) */
|
||||
foreach_token->u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
|
||||
@@ -1784,6 +1958,7 @@ void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
|
||||
|
||||
opline->opcode = ZEND_JMP;
|
||||
opline->op1.u.opline_num = foreach_token->u.opline_num;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
CG(active_op_array)->opcodes[foreach_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
@@ -1792,6 +1967,8 @@ void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
|
||||
|
||||
do_free(open_brackets_token CLS_CC);
|
||||
|
||||
zend_stack_del_top(&CG(foreach_copy_stack));
|
||||
|
||||
DEC_BPC(CG(active_op_array));
|
||||
}
|
||||
|
||||
|
||||
+157
-107
@@ -23,8 +23,8 @@
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#if HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#include "zend_llist.h"
|
||||
@@ -34,9 +34,9 @@
|
||||
#define DEBUG_ZEND 0
|
||||
|
||||
#ifndef ZTS
|
||||
#define SUPPORT_INTERACTIVE 1
|
||||
# define SUPPORT_INTERACTIVE 1
|
||||
#else
|
||||
#define SUPPORT_INTERACTIVE 0
|
||||
# define SUPPORT_INTERACTIVE 0
|
||||
#endif
|
||||
|
||||
#define FREE_PNODE(znode) zval_dtor(&znode->u.constant);
|
||||
@@ -62,6 +62,7 @@ typedef struct _znode {
|
||||
|
||||
int var;
|
||||
int opline_num;
|
||||
int fetch_type;
|
||||
zend_op_array *op_array;
|
||||
struct {
|
||||
int var; /* dummy */
|
||||
@@ -93,6 +94,7 @@ struct _zend_op_array {
|
||||
int type; /* MUST be the first element of this struct! */
|
||||
|
||||
unsigned char *arg_types; /* MUST be the second element of this struct! */
|
||||
char *function_name; /* MUST be the third element of this struct! */
|
||||
|
||||
int *refcount;
|
||||
|
||||
@@ -101,7 +103,6 @@ struct _zend_op_array {
|
||||
|
||||
int T;
|
||||
|
||||
char *function_name;
|
||||
|
||||
zend_brk_cont_element *brk_cont_array;
|
||||
int last_brk_cont;
|
||||
@@ -117,7 +118,7 @@ struct _zend_op_array {
|
||||
int backpatch_count;
|
||||
#endif
|
||||
|
||||
void *reserved[4];
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
};
|
||||
|
||||
|
||||
@@ -125,9 +126,9 @@ typedef struct _zend_internal_function {
|
||||
int type; /* MUST be the first element of this struct! */
|
||||
|
||||
unsigned char *arg_types; /* MUST be the second element of this struct */
|
||||
char *function_name; /* MUST be the third element of this struct */
|
||||
|
||||
void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
|
||||
char *function_name;
|
||||
} zend_internal_function;
|
||||
|
||||
|
||||
@@ -136,6 +137,7 @@ typedef union _zend_function {
|
||||
struct {
|
||||
int type; /* never used */
|
||||
unsigned char *arg_types;
|
||||
char *function_name;
|
||||
} common;
|
||||
|
||||
zend_op_array op_array;
|
||||
@@ -146,7 +148,7 @@ typedef union _zend_function {
|
||||
typedef struct _zend_function_state {
|
||||
HashTable *function_symbol_table;
|
||||
zend_function *function;
|
||||
void *reserved[4];
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
} zend_function_state;
|
||||
|
||||
|
||||
@@ -200,7 +202,7 @@ int lex_scan(zval *zendlval CLS_DC);
|
||||
void startup_scanner(CLS_D);
|
||||
void shutdown_scanner(CLS_D);
|
||||
|
||||
ZEND_API void zend_set_compiled_filename(char *new_compiled_filename);
|
||||
ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename);
|
||||
ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename);
|
||||
ZEND_API char *zend_get_compiled_filename();
|
||||
|
||||
@@ -218,6 +220,7 @@ void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void do_assign(znode *result, znode *variable, znode *value CLS_DC);
|
||||
void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC);
|
||||
void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC);
|
||||
void fetch_simple_variable_ex(znode *result, znode *varname, int bp, int op CLS_DC);
|
||||
void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC);
|
||||
void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC);
|
||||
void do_fetch_globals(znode *varname CLS_DC);
|
||||
@@ -248,7 +251,7 @@ void do_pre_incdec(znode *result, znode *op1, int op CLS_DC);
|
||||
void do_post_incdec(znode *result, znode *op1, int op CLS_DC);
|
||||
|
||||
void do_begin_variable_parse(CLS_D);
|
||||
void do_end_variable_parse(int type CLS_DC);
|
||||
void do_end_variable_parse(int type, int arg_offset CLS_DC);
|
||||
|
||||
void do_free(znode *op1 CLS_DC);
|
||||
|
||||
@@ -260,12 +263,12 @@ void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method CLS_DC);
|
||||
void do_end_function_declaration(znode *function_token CLS_DC);
|
||||
void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC);
|
||||
void do_begin_function_call(znode *function_name CLS_DC);
|
||||
int do_begin_function_call(znode *function_name CLS_DC);
|
||||
void do_begin_dynamic_function_call(znode *function_name CLS_DC);
|
||||
void do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC);
|
||||
void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method CLS_DC);
|
||||
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 CLS_DC);
|
||||
ZEND_API void do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table);
|
||||
ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time);
|
||||
void do_early_binding(CLS_D);
|
||||
|
||||
void do_pass_param(znode *param, int op, int offset CLS_DC);
|
||||
@@ -302,8 +305,8 @@ void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC);
|
||||
|
||||
void do_shell_exec(znode *result, znode *cmd CLS_DC);
|
||||
|
||||
void do_init_array(znode *result, znode *expr, znode *offset CLS_DC);
|
||||
void do_add_array_element(znode *result, znode *expr, znode *offset CLS_DC);
|
||||
void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
|
||||
void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
|
||||
void do_add_static_array_element(znode *result, znode *offset, znode *expr);
|
||||
void do_list_init();
|
||||
void do_list_end(znode *result, znode *expr CLS_DC);
|
||||
@@ -347,7 +350,7 @@ ZEND_API zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ..
|
||||
ZEND_API zend_op_array *v_compile_files(int mark_as_ref 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_filename(zval *filename CLS_DC);
|
||||
ZEND_API inline int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
|
||||
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 initial_ops_size);
|
||||
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);
|
||||
@@ -362,6 +365,7 @@ void zend_class_add_ref(zend_class_entry *ce);
|
||||
#define ZEND_CLASS_DTOR (int (*)(void *)) destroy_zend_class
|
||||
|
||||
zend_op *get_next_op(zend_op_array *op_array CLS_DC);
|
||||
void init_op(zend_op *op CLS_DC);
|
||||
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);
|
||||
@@ -391,111 +395,116 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_BW_NOT 12
|
||||
#define ZEND_BOOL_NOT 13
|
||||
#define ZEND_BOOL_XOR 14
|
||||
#define ZEND_IS_EQUAL 15
|
||||
#define ZEND_IS_NOT_EQUAL 16
|
||||
#define ZEND_IS_SMALLER 17
|
||||
#define ZEND_IS_SMALLER_OR_EQUAL 18
|
||||
#define ZEND_CAST 19
|
||||
#define ZEND_QM_ASSIGN 20
|
||||
#define ZEND_IS_IDENTICAL 15
|
||||
#define ZEND_IS_EQUAL 16
|
||||
#define ZEND_IS_NOT_EQUAL 17
|
||||
#define ZEND_IS_SMALLER 18
|
||||
#define ZEND_IS_SMALLER_OR_EQUAL 19
|
||||
#define ZEND_CAST 20
|
||||
#define ZEND_QM_ASSIGN 21
|
||||
|
||||
#define ZEND_ASSIGN_ADD 21
|
||||
#define ZEND_ASSIGN_SUB 22
|
||||
#define ZEND_ASSIGN_MUL 23
|
||||
#define ZEND_ASSIGN_DIV 24
|
||||
#define ZEND_ASSIGN_MOD 25
|
||||
#define ZEND_ASSIGN_SL 26
|
||||
#define ZEND_ASSIGN_SR 27
|
||||
#define ZEND_ASSIGN_CONCAT 28
|
||||
#define ZEND_ASSIGN_BW_OR 29
|
||||
#define ZEND_ASSIGN_BW_AND 30
|
||||
#define ZEND_ASSIGN_BW_XOR 31
|
||||
#define ZEND_ASSIGN_ADD 22
|
||||
#define ZEND_ASSIGN_SUB 23
|
||||
#define ZEND_ASSIGN_MUL 24
|
||||
#define ZEND_ASSIGN_DIV 25
|
||||
#define ZEND_ASSIGN_MOD 26
|
||||
#define ZEND_ASSIGN_SL 27
|
||||
#define ZEND_ASSIGN_SR 28
|
||||
#define ZEND_ASSIGN_CONCAT 29
|
||||
#define ZEND_ASSIGN_BW_OR 30
|
||||
#define ZEND_ASSIGN_BW_AND 31
|
||||
#define ZEND_ASSIGN_BW_XOR 32
|
||||
|
||||
#define ZEND_PRE_INC 32
|
||||
#define ZEND_PRE_DEC 33
|
||||
#define ZEND_POST_INC 34
|
||||
#define ZEND_POST_DEC 35
|
||||
#define ZEND_PRE_INC 33
|
||||
#define ZEND_PRE_DEC 34
|
||||
#define ZEND_POST_INC 35
|
||||
#define ZEND_POST_DEC 36
|
||||
|
||||
#define ZEND_ASSIGN 36
|
||||
#define ZEND_ASSIGN_REF 37
|
||||
#define ZEND_ASSIGN 37
|
||||
#define ZEND_ASSIGN_REF 38
|
||||
|
||||
#define ZEND_ECHO 38
|
||||
#define ZEND_PRINT 39
|
||||
#define ZEND_ECHO 39
|
||||
#define ZEND_PRINT 40
|
||||
|
||||
#define ZEND_JMP 40
|
||||
#define ZEND_JMPZ 41
|
||||
#define ZEND_JMPNZ 42
|
||||
#define ZEND_JMPZNZ 43
|
||||
#define ZEND_JMPZ_EX 44
|
||||
#define ZEND_JMPNZ_EX 45
|
||||
#define ZEND_CASE 46
|
||||
#define ZEND_BRK 47
|
||||
#define ZEND_CONT 48
|
||||
#define ZEND_BOOL 49
|
||||
#define ZEND_JMP 41
|
||||
#define ZEND_JMPZ 42
|
||||
#define ZEND_JMPNZ 43
|
||||
#define ZEND_JMPZNZ 44
|
||||
#define ZEND_JMPZ_EX 45
|
||||
#define ZEND_JMPNZ_EX 46
|
||||
#define ZEND_CASE 47
|
||||
#define ZEND_SWITCH_FREE 48
|
||||
#define ZEND_BRK 49
|
||||
#define ZEND_CONT 50
|
||||
#define ZEND_BOOL 51
|
||||
|
||||
#define ZEND_INIT_STRING 50
|
||||
#define ZEND_ADD_CHAR 51
|
||||
#define ZEND_ADD_STRING 52
|
||||
#define ZEND_ADD_VAR 53
|
||||
#define ZEND_INIT_STRING 52
|
||||
#define ZEND_ADD_CHAR 53
|
||||
#define ZEND_ADD_STRING 54
|
||||
#define ZEND_ADD_VAR 55
|
||||
|
||||
#define ZEND_BEGIN_SILENCE 54
|
||||
#define ZEND_END_SILENCE 55
|
||||
#define ZEND_BEGIN_SILENCE 56
|
||||
#define ZEND_END_SILENCE 57
|
||||
|
||||
#define ZEND_INIT_FCALL_BY_NAME 56
|
||||
#define ZEND_DO_FCALL 57
|
||||
#define ZEND_DO_FCALL_BY_NAME 58
|
||||
#define ZEND_RETURN 59
|
||||
#define ZEND_INIT_FCALL_BY_NAME 58
|
||||
#define ZEND_DO_FCALL 59
|
||||
#define ZEND_DO_FCALL_BY_NAME 60
|
||||
#define ZEND_RETURN 61
|
||||
|
||||
#define ZEND_RECV 60
|
||||
#define ZEND_RECV_INIT 61
|
||||
#define ZEND_RECV 62
|
||||
#define ZEND_RECV_INIT 63
|
||||
|
||||
#define ZEND_SEND_VAL 62
|
||||
#define ZEND_SEND_VAR 63
|
||||
#define ZEND_SEND_REF 64
|
||||
#define ZEND_SEND_VAL 64
|
||||
#define ZEND_SEND_VAR 65
|
||||
#define ZEND_SEND_REF 66
|
||||
|
||||
#define ZEND_NEW 65
|
||||
#define ZEND_JMP_NO_CTOR 66
|
||||
#define ZEND_FREE 67
|
||||
#define ZEND_NEW 67
|
||||
#define ZEND_JMP_NO_CTOR 68
|
||||
#define ZEND_FREE 69
|
||||
|
||||
#define ZEND_INIT_ARRAY 68
|
||||
#define ZEND_ADD_ARRAY_ELEMENT 69
|
||||
#define ZEND_INIT_ARRAY 70
|
||||
#define ZEND_ADD_ARRAY_ELEMENT 71
|
||||
|
||||
#define ZEND_INCLUDE_OR_EVAL 70
|
||||
#define ZEND_INCLUDE_OR_EVAL 72
|
||||
|
||||
#define ZEND_UNSET_VAR 71
|
||||
#define ZEND_UNSET_DIM_OBJ 72
|
||||
#define ZEND_ISSET_ISEMPTY 73
|
||||
#define ZEND_UNSET_VAR 73
|
||||
#define ZEND_UNSET_DIM_OBJ 74
|
||||
#define ZEND_ISSET_ISEMPTY 75
|
||||
|
||||
#define ZEND_FE_RESET 74
|
||||
#define ZEND_FE_FETCH 75
|
||||
#define ZEND_FE_RESET 76
|
||||
#define ZEND_FE_FETCH 77
|
||||
|
||||
#define ZEND_EXIT 76
|
||||
#define ZEND_EXIT 78
|
||||
|
||||
|
||||
/* the following 12 opcodes are 4 groups of 3 opcodes each, and must
|
||||
/* the following 15 opcodes are 5 groups of 3 opcodes each, and must
|
||||
* remain in that order!
|
||||
*/
|
||||
#define ZEND_FETCH_R 77
|
||||
#define ZEND_FETCH_DIM_R 78
|
||||
#define ZEND_FETCH_OBJ_R 79
|
||||
#define ZEND_FETCH_W 80
|
||||
#define ZEND_FETCH_DIM_W 81
|
||||
#define ZEND_FETCH_OBJ_W 82
|
||||
#define ZEND_FETCH_RW 83
|
||||
#define ZEND_FETCH_DIM_RW 84
|
||||
#define ZEND_FETCH_OBJ_RW 85
|
||||
#define ZEND_FETCH_IS 86
|
||||
#define ZEND_FETCH_DIM_IS 87
|
||||
#define ZEND_FETCH_OBJ_IS 88
|
||||
#define ZEND_FETCH_R 79
|
||||
#define ZEND_FETCH_DIM_R 80
|
||||
#define ZEND_FETCH_OBJ_R 81
|
||||
#define ZEND_FETCH_W 82
|
||||
#define ZEND_FETCH_DIM_W 83
|
||||
#define ZEND_FETCH_OBJ_W 84
|
||||
#define ZEND_FETCH_RW 85
|
||||
#define ZEND_FETCH_DIM_RW 86
|
||||
#define ZEND_FETCH_OBJ_RW 87
|
||||
#define ZEND_FETCH_IS 88
|
||||
#define ZEND_FETCH_DIM_IS 89
|
||||
#define ZEND_FETCH_OBJ_IS 90
|
||||
#define ZEND_FETCH_FUNC_ARG 91
|
||||
#define ZEND_FETCH_DIM_FUNC_ARG 92
|
||||
#define ZEND_FETCH_OBJ_FUNC_ARG 93
|
||||
|
||||
#define ZEND_FETCH_DIM_TMP_VAR 89
|
||||
#define ZEND_FETCH_CONSTANT 90
|
||||
#define ZEND_FETCH_DIM_TMP_VAR 94
|
||||
#define ZEND_FETCH_CONSTANT 95
|
||||
|
||||
#define ZEND_DECLARE_FUNCTION_OR_CLASS 91
|
||||
#define ZEND_DECLARE_FUNCTION_OR_CLASS 96
|
||||
|
||||
#define ZEND_EXT_STMT 92
|
||||
#define ZEND_EXT_FCALL_BEGIN 93
|
||||
#define ZEND_EXT_FCALL_END 94
|
||||
#define ZEND_EXT_NOP 95
|
||||
#define ZEND_EXT_STMT 97
|
||||
#define ZEND_EXT_FCALL_BEGIN 98
|
||||
#define ZEND_EXT_FCALL_END 99
|
||||
#define ZEND_EXT_NOP 100
|
||||
|
||||
/* end of block */
|
||||
|
||||
@@ -508,11 +517,12 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_FETCH_STATIC 2
|
||||
|
||||
/* var status for backpatching */
|
||||
#define BP_VAR_R 0
|
||||
#define BP_VAR_W 1
|
||||
#define BP_VAR_RW 2
|
||||
#define BP_VAR_IS 3
|
||||
#define BP_VAR_NA 4 /* if not applicable */
|
||||
#define BP_VAR_R 0
|
||||
#define BP_VAR_W 1
|
||||
#define BP_VAR_RW 2
|
||||
#define BP_VAR_IS 3
|
||||
#define BP_VAR_NA 4 /* if not applicable */
|
||||
#define BP_VAR_FUNC_ARG 5
|
||||
|
||||
|
||||
#define ZEND_INTERNAL_FUNCTION 1
|
||||
@@ -549,11 +559,51 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_CTOR_CALL 1<<1
|
||||
|
||||
|
||||
#define PZVAL_IS_REF(z) ((z)->EA.is_ref)
|
||||
#define PZVAL_IS_LOCKED(z) ((z)->EA.locks>0)
|
||||
#define AI_USE_PTR(ai) \
|
||||
if ((ai).ptr_ptr) { \
|
||||
(ai).ptr = *((ai).ptr_ptr); \
|
||||
(ai).ptr_ptr = &((ai).ptr); \
|
||||
} else { \
|
||||
(ai).ptr = NULL; \
|
||||
}
|
||||
|
||||
#define PZVAL_LOCK(z) (z)->EA.locks++
|
||||
#define PZVAL_UNLOCK(z) (z)->EA.locks--
|
||||
#define PZVAL_IS_REF(z) ((z)->is_ref)
|
||||
|
||||
#define PZVAL_LOCK(z) ((z)->refcount++)
|
||||
#define PZVAL_UNLOCK(z) { ((z)->refcount--); \
|
||||
if (!(z)->refcount) { \
|
||||
EG(garbage)[EG(garbage_ptr)++] = (z); \
|
||||
if (EG(garbage_ptr) == 4) { \
|
||||
zval_dtor(EG(garbage)[0]); \
|
||||
efree(EG(garbage)[0]); \
|
||||
zval_dtor(EG(garbage)[1]); \
|
||||
efree(EG(garbage)[1]); \
|
||||
EG(garbage)[0] = EG(garbage)[2]; \
|
||||
EG(garbage)[1] = EG(garbage)[3]; \
|
||||
EG(garbage_ptr) -= 2; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
|
||||
|
||||
|
||||
/* Lost In Stupid Parentheses */
|
||||
#define ARG_SHOULD_BE_SENT_BY_REF(offset, conduct_check, arg_types) \
|
||||
( \
|
||||
conduct_check \
|
||||
&& arg_types \
|
||||
&& \
|
||||
( \
|
||||
( \
|
||||
offset<=arg_types[0] \
|
||||
&& arg_types[offset]==BYREF_FORCE \
|
||||
) \
|
||||
|| ( \
|
||||
offset>=arg_types[0] \
|
||||
&& arg_types[arg_types[0]]==BYREF_FORCE_REST \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
|
||||
#endif /* _COMPILE_H */
|
||||
@@ -29,12 +29,18 @@ typedef unsigned long ulong;
|
||||
typedef unsigned int uint;
|
||||
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#include <malloc.h>
|
||||
|
||||
#define HAVE_DIRENT_H 0
|
||||
|
||||
#define HAVE_KILL 0
|
||||
#define HAVE_GETPID 1
|
||||
#undef HAVE_KILL
|
||||
#define HAVE_GETPID 1
|
||||
/* #define HAVE_ALLOCA_H 1 */
|
||||
#define HAVE_MEMCPY 1
|
||||
#define HAVE_STRDUP 1
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
#define HAVE_STDIOSTR_H 1
|
||||
#define HAVE_CLASS_ISTDIOSTREAM
|
||||
#define istdiostream stdiostream
|
||||
|
||||
#ifdef inline
|
||||
#undef inline
|
||||
@@ -78,7 +78,7 @@ void clean_module_constants(int module_number)
|
||||
}
|
||||
|
||||
|
||||
int zend_startup_constants(HashTable *constants ELS_DC)
|
||||
int zend_startup_constants(ELS_D)
|
||||
{
|
||||
#if WIN32|WINNT
|
||||
DWORD dwBuild=0;
|
||||
@@ -102,7 +102,7 @@ void zend_register_standard_constants(ELS_D)
|
||||
/* ZEND_FIX: Move to PHP */
|
||||
#if 0
|
||||
#if WIN32|WINNT
|
||||
// Get build numbers for Windows NT or Win95
|
||||
/* Get build numbers for Windows NT or Win95 */
|
||||
if (dwVersion < 0x80000000){
|
||||
php3_os="WINNT";
|
||||
} else {
|
||||
|
||||
@@ -46,7 +46,7 @@ typedef struct _zend_constant {
|
||||
|
||||
void clean_module_constants(int module_number);
|
||||
int free_zend_constant(zend_constant *c);
|
||||
int zend_startup_constants(HashTable *constants ELS_DC);
|
||||
int zend_startup_constants(ELS_D);
|
||||
int zend_shutdown_constants(ELS_D);
|
||||
void zend_register_standard_constants(ELS_D);
|
||||
void clean_non_persistent_constants(void);
|
||||
|
||||
+394
-280
File diff suppressed because it is too large.
Load diff
+5
-2
@@ -26,9 +26,12 @@
|
||||
|
||||
typedef union _temp_variable {
|
||||
zval tmp_var;
|
||||
zval **var;
|
||||
struct {
|
||||
zval **var_dummy; /* a dummy */
|
||||
zval **ptr_ptr;
|
||||
zval *ptr;
|
||||
} var;
|
||||
struct {
|
||||
zval tmp_var; /* a dummy */
|
||||
|
||||
zval *str;
|
||||
int offset;
|
||||
|
||||
+62
-23
@@ -84,12 +84,10 @@ void init_executor(CLS_D ELS_DC)
|
||||
var_uninit(&EG(uninitialized_zval));
|
||||
var_uninit(&EG(error_zval));
|
||||
EG(uninitialized_zval).refcount = 1;
|
||||
EG(uninitialized_zval).EA.is_ref=0;
|
||||
EG(uninitialized_zval).EA.locks = 0;
|
||||
EG(uninitialized_zval).is_ref=0;
|
||||
EG(uninitialized_zval_ptr)=&EG(uninitialized_zval);
|
||||
EG(error_zval).refcount = 1;
|
||||
EG(error_zval).EA.is_ref=0;
|
||||
EG(error_zval).EA.locks = 0;
|
||||
EG(error_zval).is_ref=0;
|
||||
EG(error_zval_ptr)=&EG(error_zval);
|
||||
zend_ptr_stack_init(&EG(arg_types_stack));
|
||||
zend_stack_init(&EG(overloaded_objects_stack));
|
||||
@@ -116,12 +114,13 @@ void init_executor(CLS_D ELS_DC)
|
||||
|
||||
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_activator);
|
||||
EG(opline_ptr) = NULL;
|
||||
EG(garbage_ptr) = 0;
|
||||
}
|
||||
|
||||
|
||||
void shutdown_executor(ELS_D)
|
||||
{
|
||||
zval_dtor(EG(return_value));
|
||||
zval_dtor(&EG(global_return_value));
|
||||
zend_ptr_stack_destroy(&EG(arg_types_stack));
|
||||
zend_stack_destroy(&EG(overloaded_objects_stack));
|
||||
|
||||
@@ -145,6 +144,10 @@ void shutdown_executor(ELS_D)
|
||||
#if ZEND_DEBUG
|
||||
signal(SIGSEGV, original_sigsegv_handler);
|
||||
#endif
|
||||
while (EG(garbage_ptr)--) {
|
||||
zval_dtor(EG(garbage)[EG(garbage_ptr)]);
|
||||
efree(EG(garbage)[EG(garbage_ptr)]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -202,10 +205,8 @@ ZEND_API inline void safe_free_zval_ptr(zval *p)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zval_ptr_dtor(zval **zval_ptr)
|
||||
ZEND_API int _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
|
||||
{
|
||||
int locked = PZVAL_IS_LOCKED(*zval_ptr);
|
||||
|
||||
#if DEBUG_ZEND>=2
|
||||
printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)->refcount-1);
|
||||
#endif
|
||||
@@ -214,11 +215,7 @@ ZEND_API int zval_ptr_dtor(zval **zval_ptr)
|
||||
zval_dtor(*zval_ptr);
|
||||
safe_free_zval_ptr(*zval_ptr);
|
||||
}
|
||||
if (locked) {
|
||||
return 0; /* don't kill the container bucket */
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -267,6 +264,7 @@ ZEND_API void zval_update_constant(zval *p)
|
||||
{
|
||||
if (p->type == IS_CONSTANT) {
|
||||
zval c;
|
||||
int refcount = p->refcount;
|
||||
|
||||
if (!zend_get_constant(p->value.str.val, p->value.str.len, &c)) {
|
||||
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
|
||||
@@ -278,10 +276,27 @@ ZEND_API void zval_update_constant(zval *p)
|
||||
*p = c;
|
||||
}
|
||||
INIT_PZVAL(p);
|
||||
p->refcount = refcount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval, int param_count, zval *params[])
|
||||
{
|
||||
zval ***params_array = (zval ***) emalloc(sizeof(zval **)*param_count);
|
||||
int i;
|
||||
int ex_retval;
|
||||
|
||||
for (i=0; i<param_count; i++) {
|
||||
params_array[i] = ¶ms[i];
|
||||
}
|
||||
ex_retval = call_user_function_ex(function_table, object, function_name, retval, param_count, params_array, 1);
|
||||
efree(params_array);
|
||||
return ex_retval;
|
||||
}
|
||||
|
||||
|
||||
int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval, int param_count, zval **params[], int no_separation)
|
||||
{
|
||||
int i;
|
||||
zval *original_return_value;
|
||||
@@ -305,14 +320,37 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
for (i=0; i<param_count; i++) {
|
||||
zval *param;
|
||||
|
||||
param = (zval *) emalloc(sizeof(zval));
|
||||
*param = *(params[i]);
|
||||
INIT_PZVAL(param);
|
||||
zval_copy_ctor(param);
|
||||
if (function_state.function->common.arg_types
|
||||
&& i<function_state.function->common.arg_types[0]
|
||||
&& function_state.function->common.arg_types[i+1]==BYREF_FORCE
|
||||
&& !PZVAL_IS_REF(*params[i])) {
|
||||
if ((*params[i])->refcount>1) {
|
||||
zval *new_zval;
|
||||
|
||||
if (no_separation) {
|
||||
return FAILURE;
|
||||
}
|
||||
new_zval = (zval *) emalloc(sizeof(zval));
|
||||
*new_zval = **params[i];
|
||||
zval_copy_ctor(new_zval);
|
||||
new_zval->refcount = 1;
|
||||
(*params[i])->refcount--;
|
||||
*params[i] = new_zval;
|
||||
}
|
||||
(*params[i])->refcount++;
|
||||
(*params[i])->is_ref = 1;
|
||||
param = *params[i];
|
||||
} else if (*params[i] != &EG(uninitialized_zval)) {
|
||||
(*params[i])->refcount++;
|
||||
param = *params[i];
|
||||
} else {
|
||||
param = (zval *) emalloc(sizeof(zval));
|
||||
*param = **(params[i]);
|
||||
INIT_PZVAL(param);
|
||||
}
|
||||
zend_ptr_stack_push(&EG(argument_stack), param);
|
||||
}
|
||||
|
||||
@@ -421,7 +459,8 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var
|
||||
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==&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);
|
||||
@@ -438,8 +477,7 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var
|
||||
zendi_zval_copy_ctor(*value_ptr);
|
||||
}
|
||||
value_ptr->refcount = 1;
|
||||
value_ptr->EA.is_ref = 1;
|
||||
value_ptr->EA.locks = 0;
|
||||
value_ptr->is_ref = 1;
|
||||
}
|
||||
|
||||
*variable_ptr_ptr = value_ptr;
|
||||
@@ -449,8 +487,9 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var
|
||||
}
|
||||
|
||||
if (result && (result->op_type != IS_UNUSED)) {
|
||||
Ts[result->u.var].var = variable_ptr_ptr;
|
||||
PZVAL_LOCK(*variable_ptr_ptr);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,11 +91,11 @@ int zend_load_extension(char *path)
|
||||
(ZTS_V?"is":"isn't"));
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
} else if (ZEND_DEBUG_V!=extension_version_info->debug) {
|
||||
} else if (ZEND_DEBUG!=extension_version_info->debug) {
|
||||
fprintf(stderr, "Cannot load %s - it %s debug information, whereas Zend %s\n",
|
||||
new_extension->name,
|
||||
(extension_version_info->debug?"contains":"does not contain"),
|
||||
(ZEND_DEBUG_V?"does":"does not"));
|
||||
(ZEND_DEBUG?"does":"does not"));
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
@@ -78,15 +78,9 @@ ZEND_API int zend_get_resource_handle();
|
||||
#define ZTS_V 0
|
||||
#endif
|
||||
|
||||
#ifdef ZEND_DEBUG
|
||||
#define ZEND_DEBUG_V 1
|
||||
#else
|
||||
#define ZEND_DEBUG_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_V }
|
||||
ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, "0.90", ZTS_V, ZEND_DEBUG }
|
||||
|
||||
#define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
|
||||
|
||||
|
||||
+15
-67
@@ -21,8 +21,11 @@
|
||||
#ifndef _T_GLOBALS_H
|
||||
#define _T_GLOBALS_H
|
||||
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
#include "zend_globals_macros.h"
|
||||
|
||||
#include "zend_stack.h"
|
||||
#include "zend_ptr_stack.h"
|
||||
#include "zend_hash.h"
|
||||
@@ -46,80 +49,19 @@ END_EXTERN_C()
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct _zend_compiler_globals zend_compiler_globals;
|
||||
typedef struct _zend_executor_globals zend_executor_globals;
|
||||
typedef struct _zend_alloc_globals zend_alloc_globals;
|
||||
|
||||
#define SYMTABLE_CACHE_SIZE 32
|
||||
|
||||
|
||||
/* Compiler */
|
||||
#ifdef ZTS
|
||||
# define CLS_D zend_compiler_globals *compiler_globals
|
||||
# define CLS_DC , CLS_D
|
||||
# define CLS_C compiler_globals
|
||||
# define CLS_CC , CLS_C
|
||||
# define CG(v) (((zend_compiler_globals *) compiler_globals)->v)
|
||||
# define CLS_FETCH() zend_compiler_globals *compiler_globals = (zend_compiler_globals *) ts_resource(compiler_globals_id)
|
||||
# define YYPARSE_PARAM compiler_globals
|
||||
# define YYLEX_PARAM compiler_globals
|
||||
BEGIN_EXTERN_C()
|
||||
int zendparse(void *compiler_globals);
|
||||
END_EXTERN_C()
|
||||
#else
|
||||
# define CLS_D
|
||||
# define CLS_DC
|
||||
# define CLS_C
|
||||
# define CLS_CC
|
||||
# define CG(v) (compiler_globals.v)
|
||||
# define CLS_FETCH()
|
||||
extern ZEND_API zend_compiler_globals compiler_globals;
|
||||
int zendparse();
|
||||
#endif
|
||||
|
||||
|
||||
/* Executor */
|
||||
#ifdef ZTS
|
||||
# define ELS_D zend_executor_globals *executor_globals
|
||||
# define ELS_DC , ELS_D
|
||||
# define ELS_C executor_globals
|
||||
# define ELS_CC , ELS_C
|
||||
# define EG(v) (executor_globals->v)
|
||||
# define ELS_FETCH() zend_executor_globals *executor_globals = (zend_executor_globals *) ts_resource(executor_globals_id)
|
||||
#else
|
||||
# define ELS_D
|
||||
# define ELS_DC
|
||||
# define ELS_C
|
||||
# define ELS_CC
|
||||
# define EG(v) (executor_globals.v)
|
||||
# define ELS_FETCH()
|
||||
extern ZEND_API zend_executor_globals executor_globals;
|
||||
#endif
|
||||
|
||||
|
||||
/* Memory Manager */
|
||||
#ifdef ZTS
|
||||
# define ALS_D zend_alloc_globals *alloc_globals
|
||||
# define ALS_DC , ALS_D
|
||||
# define ALS_C alloc_globals
|
||||
# define ALS_CC , ALS_C
|
||||
# define AG(v) (((zend_alloc_globals *) alloc_globals)->v)
|
||||
# define ALS_FETCH() zend_alloc_globals *alloc_globals = (zend_alloc_globals *) ts_resource(alloc_globals_id)
|
||||
#else
|
||||
# define ALS_D
|
||||
# define ALS_DC
|
||||
# define ALS_C
|
||||
# define ALS_CC
|
||||
# define AG(v) (alloc_globals.v)
|
||||
# define ALS_FETCH()
|
||||
#endif
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend_execute.h"
|
||||
|
||||
/* excpt.h on Digital Unix 4.0 defines function_table */
|
||||
#undef function_table
|
||||
|
||||
struct _zend_compiler_globals {
|
||||
zend_stack bp_stack;
|
||||
zend_stack switch_cond_stack;
|
||||
zend_stack foreach_copy_stack;
|
||||
zend_stack object_stack;
|
||||
|
||||
zend_class_entry class_entry, *active_class_entry;
|
||||
@@ -201,14 +143,20 @@ struct _zend_executor_globals {
|
||||
long precision;
|
||||
|
||||
/* for extended information support */
|
||||
unsigned char no_extensions;
|
||||
zend_bool no_extensions;
|
||||
|
||||
HashTable regular_list;
|
||||
HashTable persistent_list;
|
||||
|
||||
zend_ptr_stack argument_stack;
|
||||
int free_op1, free_op2;
|
||||
int (*unary_op)(zval *result, zval *op1);
|
||||
int (*binary_op)(zval *result, zval *op1, zval *op2);
|
||||
|
||||
void *reserved[4];
|
||||
zval *garbage[4];
|
||||
int garbage_ptr;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
#if SUPPORT_INTERACTIVE
|
||||
int interactive;
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 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_91.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> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#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;
|
||||
typedef struct _zend_alloc_globals zend_alloc_globals;
|
||||
|
||||
/* Compiler */
|
||||
#ifdef ZTS
|
||||
# define CLS_D zend_compiler_globals *compiler_globals
|
||||
# define CLS_DC , CLS_D
|
||||
# define CLS_C compiler_globals
|
||||
# define CLS_CC , CLS_C
|
||||
# define CG(v) (((zend_compiler_globals *) compiler_globals)->v)
|
||||
# define CLS_FETCH() zend_compiler_globals *compiler_globals = (zend_compiler_globals *) ts_resource(compiler_globals_id)
|
||||
# define YYPARSE_PARAM compiler_globals
|
||||
# define YYLEX_PARAM compiler_globals
|
||||
BEGIN_EXTERN_C()
|
||||
int zendparse(void *compiler_globals);
|
||||
END_EXTERN_C()
|
||||
#else
|
||||
# define CLS_D
|
||||
# define CLS_DC
|
||||
# define CLS_C
|
||||
# define CLS_CC
|
||||
# define CG(v) (compiler_globals.v)
|
||||
# define CLS_FETCH()
|
||||
extern ZEND_API struct _zend_compiler_globals compiler_globals;
|
||||
int zendparse();
|
||||
#endif
|
||||
|
||||
|
||||
/* Executor */
|
||||
#ifdef ZTS
|
||||
# define ELS_D zend_executor_globals *executor_globals
|
||||
# define ELS_DC , ELS_D
|
||||
# define ELS_C executor_globals
|
||||
# define ELS_CC , ELS_C
|
||||
# define EG(v) (executor_globals->v)
|
||||
# define ELS_FETCH() zend_executor_globals *executor_globals = (zend_executor_globals *) ts_resource(executor_globals_id)
|
||||
#else
|
||||
# define ELS_D
|
||||
# define ELS_DC
|
||||
# define ELS_C
|
||||
# define ELS_CC
|
||||
# define EG(v) (executor_globals.v)
|
||||
# define ELS_FETCH()
|
||||
extern ZEND_API zend_executor_globals executor_globals;
|
||||
#endif
|
||||
|
||||
|
||||
/* Memory Manager */
|
||||
#ifdef ZTS
|
||||
# define ALS_D zend_alloc_globals *alloc_globals
|
||||
# define ALS_DC , ALS_D
|
||||
# define ALS_C alloc_globals
|
||||
# define ALS_CC , ALS_C
|
||||
# define AG(v) (((zend_alloc_globals *) alloc_globals)->v)
|
||||
# define ALS_FETCH() zend_alloc_globals *alloc_globals = (zend_alloc_globals *) ts_resource(alloc_globals_id)
|
||||
#else
|
||||
# define ALS_D
|
||||
# define ALS_DC
|
||||
# define ALS_C
|
||||
# define ALS_CC
|
||||
# define AG(v) (alloc_globals.v)
|
||||
# define ALS_FETCH()
|
||||
#endif
|
||||
|
||||
#endif /* _ZEND_GLOBALS_MACROS_H */
|
||||
|
||||
+42
-11
@@ -18,12 +18,17 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#define HANDLE_NUMERIC(key,length,func) { \
|
||||
register char *tmp=key; \
|
||||
@@ -55,7 +60,6 @@ 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};
|
||||
|
||||
static int if_full_do_resize(HashTable *ht);
|
||||
static int zend_hash_rehash(HashTable *ht);
|
||||
|
||||
static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(ulong);
|
||||
|
||||
@@ -650,7 +654,7 @@ static int if_full_do_resize(HashTable *ht)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static int zend_hash_rehash(HashTable *ht)
|
||||
ZEND_API int zend_hash_rehash(HashTable *ht)
|
||||
{
|
||||
Bucket *p;
|
||||
uint nIndex;
|
||||
@@ -744,9 +748,6 @@ ZEND_API void zend_hash_destroy(HashTable *ht)
|
||||
}
|
||||
if (delete_bucket) {
|
||||
pefree(q,ht->persistent);
|
||||
} else {
|
||||
int i;
|
||||
i=2;
|
||||
}
|
||||
}
|
||||
pefree(ht->arBuckets,ht->persistent);
|
||||
@@ -822,6 +823,35 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht,int (*destruct) (void
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_hash_apply_with_arguments(HashTable *ht,int (*destruct)(void *, int, va_list, zend_hash_key *), int num_args, ...)
|
||||
{
|
||||
Bucket *p, *q;
|
||||
va_list args;
|
||||
zend_hash_key hash_key;
|
||||
|
||||
va_start(args, num_args);
|
||||
|
||||
p = ht->pListHead;
|
||||
while (p != NULL) {
|
||||
q = p;
|
||||
p = p->pListNext;
|
||||
hash_key.arKey = q->arKey;
|
||||
hash_key.nKeyLength = q->nKeyLength;
|
||||
hash_key.h = q->h;
|
||||
if (destruct(q->pData, num_args, args, &hash_key)) {
|
||||
if (q->nKeyLength == 0) {
|
||||
zend_hash_index_del(ht, q->h);
|
||||
} else {
|
||||
zend_hash_del(ht,q->arKey,q->nKeyLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, void (*pCopyConstructor) (void *pData), void *tmp, uint size)
|
||||
{
|
||||
Bucket *p;
|
||||
@@ -1067,7 +1097,8 @@ ZEND_API int zend_hash_get_current_data(HashTable *ht, void **pData)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_hash_sort(HashTable *ht, int (*compar) (const void *, const void *), int renumber)
|
||||
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
|
||||
compare_func_t compar, int renumber)
|
||||
{
|
||||
Bucket **arTmp;
|
||||
Bucket *p;
|
||||
@@ -1088,7 +1119,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, int (*compar) (const void *, const vo
|
||||
i++;
|
||||
}
|
||||
|
||||
qsort((void *) arTmp, i, sizeof(Bucket *), compar);
|
||||
(*sort_func)((void *) arTmp, i, sizeof(Bucket *), compar);
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
ht->pListHead = arTmp[0];
|
||||
|
||||
+19
-3
@@ -62,6 +62,8 @@ typedef struct hashtable {
|
||||
unsigned char persistent;
|
||||
} HashTable;
|
||||
|
||||
typedef int (*compare_func_t) (const void *, const void *);
|
||||
typedef void (*sort_func_t) (void *, size_t, register size_t, compare_func_t);
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
@@ -98,13 +100,26 @@ ZEND_API int zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void
|
||||
|
||||
ZEND_API int zend_hash_pointer_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData);
|
||||
|
||||
|
||||
typedef struct _zend_hash_key {
|
||||
char *arKey;
|
||||
uint nKeyLength;
|
||||
ulong h;
|
||||
} zend_hash_key;
|
||||
|
||||
|
||||
#define ZEND_STD_HASH_APPLIER \
|
||||
int (*)(void *element, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
|
||||
ZEND_API int zend_hash_pointer_index_update_or_next_insert(HashTable *ht, ulong h, void *pData, int flag);
|
||||
#define zend_hash_pointer_index_update(ht,h,pData) \
|
||||
zend_hash_pointer_index_update_or_next_insert(ht,h,pData,HASH_UPDATE)
|
||||
#define zend_hash_next_index_pointer_insert(ht,pData) \
|
||||
zend_hash_pointer_index_update_or_next_insert(ht,0,pData,HASH_NEXT_INSERT)
|
||||
ZEND_API void zend_hash_apply(HashTable *ht,int (*destruct) (void *));
|
||||
ZEND_API void zend_hash_apply_with_argument(HashTable *ht,int (*destruct) (void *, void *), void *);
|
||||
ZEND_API void zend_hash_apply(HashTable *ht,int (*destruct)(void *));
|
||||
ZEND_API void zend_hash_apply_with_argument(HashTable *ht,int (*destruct)(void *, void *), void *);
|
||||
ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, ZEND_STD_HASH_APPLIER, int, ...);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -141,11 +156,12 @@ ZEND_API void zend_hash_internal_pointer_end(HashTable *ht);
|
||||
/* Copying, merging and sorting */
|
||||
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, void (*pCopyConstructor) (void *pData), void *tmp, uint size);
|
||||
ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, void (*pCopyConstructor) (void *pData), void *tmp, uint size, int overwrite);
|
||||
ZEND_API int zend_hash_sort(HashTable *ht, int (*compar) (const void *, const void *), int renumber);
|
||||
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_minmax(HashTable *ht, int (*compar) (const void *, const void *), int flag, void **pData);
|
||||
|
||||
ZEND_API int zend_hash_num_elements(HashTable *ht);
|
||||
|
||||
ZEND_API int zend_hash_rehash(HashTable *ht);
|
||||
|
||||
ZEND_API ulong hashpjw(char *arKey, uint nKeyLength);
|
||||
|
||||
|
||||
+68
-1
@@ -18,12 +18,13 @@
|
||||
*/
|
||||
|
||||
|
||||
/* resource lists */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_list.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_globals.h"
|
||||
|
||||
|
||||
ZEND_API int le_index_ptr;
|
||||
|
||||
static inline int zend_list_do_insert(HashTable *list,void *ptr, int type)
|
||||
@@ -137,6 +138,72 @@ 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)
|
||||
{
|
||||
int rsrc_id;
|
||||
|
||||
rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type);
|
||||
|
||||
if (rsrc_result) {
|
||||
rsrc_result->value.lval = rsrc_id;
|
||||
rsrc_result->type = IS_RESOURCE;
|
||||
}
|
||||
|
||||
return rsrc_id;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
|
||||
{
|
||||
int id;
|
||||
int actual_resource_type;
|
||||
void *resource;
|
||||
va_list resource_types;
|
||||
int i;
|
||||
|
||||
if (default_id==-1) { /* use id */
|
||||
if (!passed_id) {
|
||||
if (resource_type_name) {
|
||||
zend_error(E_WARNING, "No %s resource supplied", resource_type_name);
|
||||
}
|
||||
return NULL;
|
||||
} else if ((*passed_id)->type != IS_RESOURCE) {
|
||||
if (resource_type_name) {
|
||||
zend_error(E_WARNING, "Supplied argument is not a valid %s resource", resource_type_name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
id = (*passed_id)->value.lval;
|
||||
} else {
|
||||
id = default_id;
|
||||
}
|
||||
|
||||
resource = zend_list_find(id, &actual_resource_type);
|
||||
if (!resource) {
|
||||
if (resource_type_name)
|
||||
zend_error(E_WARNING, "%d is not a valid %s resource", id, resource_type_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
va_start(resource_types, num_resource_types);
|
||||
for (i=0; i<num_resource_types; i++) {
|
||||
if (actual_resource_type == va_arg(resource_types, int)) {
|
||||
va_end(resource_types);
|
||||
if (found_resource_type) {
|
||||
*found_resource_type = actual_resource_type;
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
}
|
||||
va_end(resource_types);
|
||||
|
||||
if (resource_type_name)
|
||||
zend_error(E_WARNING, "Supplied resource is not a valid %s resource", resource_type_name);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int list_entry_destructor(void *ptr)
|
||||
{
|
||||
list_entry *le = (list_entry *) ptr;
|
||||
|
||||
@@ -63,6 +63,25 @@ ZEND_API int zend_plist_delete(int id);
|
||||
ZEND_API void *zend_list_find(int id, int *type);
|
||||
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, ...);
|
||||
|
||||
extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
|
||||
|
||||
#define ZEND_VERIFY_RESOURCE(rsrc) \
|
||||
if (!rsrc) { \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \
|
||||
rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 1, resource_type); \
|
||||
ZEND_VERIFY_RESOURCE(rsrc);
|
||||
|
||||
#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1,resource_type2) \
|
||||
rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \
|
||||
ZEND_VERIFY_RESOURCE(rsrc);
|
||||
|
||||
#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \
|
||||
zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type);
|
||||
|
||||
#endif
|
||||
+8
-4
@@ -27,8 +27,10 @@
|
||||
#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
|
||||
|
||||
#define STANDARD_MODULE_PROPERTIES 0, 0, 0, NULL, 0
|
||||
#define STANDARD_MODULE_PROPERTIES_EX 0, 0, 0, NULL, 0
|
||||
|
||||
#define STANDARD_MODULE_PROPERTIES \
|
||||
NULL, NULL, STANDARD_MODULE_PROPERTIES_EX
|
||||
|
||||
#define MODULE_PERSISTENT 1
|
||||
#define MODULE_TEMPORARY 2
|
||||
@@ -43,6 +45,8 @@ struct _zend_module_entry {
|
||||
int (*request_startup_func)(INIT_FUNC_ARGS);
|
||||
int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS);
|
||||
void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
|
||||
int (*global_startup_func)(void);
|
||||
int (*global_shutdown_func)(void);
|
||||
int request_started, module_started;
|
||||
unsigned char type;
|
||||
void *handle;
|
||||
@@ -52,9 +56,9 @@ struct _zend_module_entry {
|
||||
|
||||
extern HashTable module_registry;
|
||||
|
||||
extern void module_destructor(zend_module_entry *module);
|
||||
extern int module_registry_cleanup(zend_module_entry *module);
|
||||
extern int module_registry_request_startup(zend_module_entry *module);
|
||||
void module_destructor(zend_module_entry *module);
|
||||
int module_registry_cleanup(zend_module_entry *module);
|
||||
int module_registry_request_startup(zend_module_entry *module);
|
||||
|
||||
#define ZEND_MODULE_DTOR (int (*)(void *)) module_destructor
|
||||
#endif
|
||||
+21
-5
@@ -190,6 +190,20 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
|
||||
}
|
||||
|
||||
|
||||
void init_op(zend_op *op CLS_DC)
|
||||
{
|
||||
op->lineno = CG(zend_lineno);
|
||||
op->filename = zend_get_compiled_filename();
|
||||
op->result.op_type = IS_UNUSED;
|
||||
op->extended_value = 0;
|
||||
op->op1.u.EA.var = 0;
|
||||
op->op1.u.EA.type = 0;
|
||||
op->op2.u.EA.var = 0;
|
||||
op->op2.u.EA.type = 0;
|
||||
op->result.u.EA.var = 0;
|
||||
op->result.u.EA.type = 0;
|
||||
}
|
||||
|
||||
zend_op *get_next_op(zend_op_array *op_array CLS_DC)
|
||||
{
|
||||
int next_op_num = op_array->last++;
|
||||
@@ -211,9 +225,8 @@ zend_op *get_next_op(zend_op_array *op_array CLS_DC)
|
||||
}
|
||||
|
||||
next_op = &(op_array->opcodes[next_op_num]);
|
||||
next_op->lineno = CG(zend_lineno);
|
||||
next_op->filename = zend_get_compiled_filename();
|
||||
next_op->result.op_type = IS_UNUSED;
|
||||
|
||||
init_op(next_op CLS_CC);
|
||||
|
||||
return next_op;
|
||||
}
|
||||
@@ -298,10 +311,10 @@ void pass_include_eval(zend_op_array *op_array)
|
||||
|
||||
while (opline<end) {
|
||||
if (opline->op1.op_type==IS_CONST) {
|
||||
opline->op1.u.constant.EA.is_ref = 1;
|
||||
opline->op1.u.constant.is_ref = 1;
|
||||
}
|
||||
if (opline->op2.op_type==IS_CONST) {
|
||||
opline->op2.u.constant.EA.is_ref = 1;
|
||||
opline->op2.u.constant.is_ref = 1;
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
@@ -367,6 +380,9 @@ ZEND_API void *get_binary_op(int opcode)
|
||||
case ZEND_ASSIGN_CONCAT:
|
||||
return (void *) concat_function;
|
||||
break;
|
||||
case ZEND_IS_IDENTICAL:
|
||||
return (void *) is_identical_function;
|
||||
break;
|
||||
case ZEND_IS_EQUAL:
|
||||
return (void *) is_equal_function;
|
||||
break;
|
||||
|
||||
+170
-123
@@ -28,13 +28,12 @@
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_list.h"
|
||||
|
||||
#if WITH_BCMATH
|
||||
#include "functions/number.h"
|
||||
#endif
|
||||
|
||||
static inline int is_numeric_string(char *str, int length, long *lval, double *dval);
|
||||
|
||||
ZEND_API void convert_scalar_to_number(zval *op)
|
||||
{
|
||||
char *strval;
|
||||
@@ -59,92 +58,100 @@ ZEND_API void convert_scalar_to_number(zval *op)
|
||||
break;
|
||||
}
|
||||
STR_FREE(strval);
|
||||
} else if (op->type == IS_BOOL || op->type==IS_RESOURCE) {
|
||||
} else if (op->type==IS_BOOL || op->type==IS_RESOURCE) {
|
||||
op->type = IS_LONG;
|
||||
}
|
||||
}
|
||||
|
||||
#define zendi_convert_scalar_to_number(op, holder) \
|
||||
if ((op)->type == IS_STRING) { \
|
||||
switch (((holder).type=is_numeric_string((op)->value.str.val, (op)->value.str.len, &(holder).value.lval, &(holder).value.dval))) { \
|
||||
case IS_DOUBLE: \
|
||||
case IS_LONG: \
|
||||
break; \
|
||||
case IS_BC: \
|
||||
(holder).type = IS_DOUBLE; /* may have lost significant digits */ \
|
||||
break; \
|
||||
default: \
|
||||
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
|
||||
(holder).type = IS_LONG; \
|
||||
break; \
|
||||
} \
|
||||
(op) = &(holder); \
|
||||
} else if ((op)->type==IS_BOOL || (op)->type==IS_RESOURCE) { \
|
||||
(holder) = *(op); \
|
||||
(holder).type = IS_LONG; \
|
||||
(op) = &(holder); \
|
||||
#define zendi_convert_scalar_to_number(op, holder, result) \
|
||||
if (op==result) { \
|
||||
convert_scalar_to_number(op); \
|
||||
} else if ((op)->type == IS_STRING) { \
|
||||
switch (((holder).type=is_numeric_string((op)->value.str.val, (op)->value.str.len, &(holder).value.lval, &(holder).value.dval))) { \
|
||||
case IS_DOUBLE: \
|
||||
case IS_LONG: \
|
||||
break; \
|
||||
case IS_BC: \
|
||||
(holder).type = IS_DOUBLE; /* may have lost significant digits */ \
|
||||
break; \
|
||||
default: \
|
||||
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
|
||||
(holder).type = IS_LONG; \
|
||||
break; \
|
||||
} \
|
||||
(op) = &(holder); \
|
||||
} else if ((op)->type==IS_BOOL || (op)->type==IS_RESOURCE) { \
|
||||
(holder).value.lval = (op)->value.lval; \
|
||||
(holder).type = IS_LONG; \
|
||||
(op) = &(holder); \
|
||||
}
|
||||
|
||||
|
||||
#define zendi_convert_to_long(op, holder) \
|
||||
if ((op)->type != IS_LONG) { \
|
||||
switch ((op)->type) { \
|
||||
case IS_BOOL: \
|
||||
case IS_RESOURCE: \
|
||||
break; \
|
||||
case IS_DOUBLE: \
|
||||
(holder).value.lval = (long) (op)->value.dval; \
|
||||
break; \
|
||||
case IS_STRING: \
|
||||
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
|
||||
break; \
|
||||
case IS_ARRAY: \
|
||||
(holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \
|
||||
break; \
|
||||
case IS_OBJECT: \
|
||||
(holder).value.lval = (zend_hash_num_elements((op)->value.obj.properties)?1:0); \
|
||||
break; \
|
||||
default: \
|
||||
zend_error(E_WARNING, "Cannot convert to ordinal value"); \
|
||||
(holder).value.lval = 0; \
|
||||
break; \
|
||||
} \
|
||||
(holder).type = IS_LONG; \
|
||||
(op) = &(holder); \
|
||||
|
||||
#define zendi_convert_to_long(op, holder, result) \
|
||||
if (op==result) { \
|
||||
convert_to_long(op); \
|
||||
} else if ((op)->type==IS_BOOL || (op)->type==IS_RESOURCE) { \
|
||||
(holder).value.lval = (op)->value.lval; \
|
||||
(holder).type = IS_LONG; \
|
||||
(op) = &(holder); \
|
||||
} else if ((op)->type != IS_LONG) { \
|
||||
switch ((op)->type) { \
|
||||
case IS_DOUBLE: \
|
||||
(holder).value.lval = (long) (op)->value.dval; \
|
||||
break; \
|
||||
case IS_STRING: \
|
||||
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
|
||||
break; \
|
||||
case IS_ARRAY: \
|
||||
(holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \
|
||||
break; \
|
||||
case IS_OBJECT: \
|
||||
(holder).value.lval = (zend_hash_num_elements((op)->value.obj.properties)?1:0); \
|
||||
break; \
|
||||
default: \
|
||||
zend_error(E_WARNING, "Cannot convert to ordinal value"); \
|
||||
(holder).value.lval = 0; \
|
||||
break; \
|
||||
} \
|
||||
(holder).type = IS_LONG; \
|
||||
(op) = &(holder); \
|
||||
}
|
||||
|
||||
|
||||
#define zendi_convert_to_boolean(op, holder) \
|
||||
if ((op)->type != IS_BOOL) { \
|
||||
switch ((op)->type) { \
|
||||
case IS_LONG: \
|
||||
case IS_RESOURCE: \
|
||||
(holder).value.lval = ((op)->value.lval ? 1 : 0); \
|
||||
break; \
|
||||
case IS_DOUBLE: \
|
||||
(holder).value.lval = ((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')) { \
|
||||
(holder).value.lval = 0; \
|
||||
} else { \
|
||||
(holder).value.lval = 1; \
|
||||
} \
|
||||
break; \
|
||||
case IS_ARRAY: \
|
||||
(holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \
|
||||
break; \
|
||||
case IS_OBJECT: \
|
||||
(holder).value.lval = (zend_hash_num_elements((op)->value.obj.properties)?1:0); \
|
||||
break; \
|
||||
default: \
|
||||
(holder).value.lval = 0; \
|
||||
break; \
|
||||
} \
|
||||
(holder).type = IS_BOOL; \
|
||||
(op) = &(holder); \
|
||||
} \
|
||||
#define zendi_convert_to_boolean(op, holder, result) \
|
||||
if (op==result) { \
|
||||
convert_to_boolean(op); \
|
||||
} else if ((op)->type != IS_BOOL) { \
|
||||
switch ((op)->type) { \
|
||||
case IS_RESOURCE: \
|
||||
case IS_LONG: \
|
||||
(holder).value.lval = ((op)->value.lval ? 1 : 0); \
|
||||
break; \
|
||||
case IS_DOUBLE: \
|
||||
(holder).value.lval = ((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')) { \
|
||||
(holder).value.lval = 0; \
|
||||
} else { \
|
||||
(holder).value.lval = 1; \
|
||||
} \
|
||||
break; \
|
||||
case IS_ARRAY: \
|
||||
(holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \
|
||||
break; \
|
||||
case IS_OBJECT: \
|
||||
(holder).value.lval = (zend_hash_num_elements((op)->value.obj.properties)?1:0); \
|
||||
break; \
|
||||
default: \
|
||||
(holder).value.lval = 0; \
|
||||
break; \
|
||||
} \
|
||||
(holder).type = IS_BOOL; \
|
||||
(op) = &(holder); \
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void convert_to_long(zval *op)
|
||||
@@ -159,37 +166,32 @@ ZEND_API void convert_to_long_base(zval *op, int base)
|
||||
long tmp;
|
||||
|
||||
switch (op->type) {
|
||||
case IS_BOOL:
|
||||
case IS_RESOURCE:
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
return;
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
op->value.lval = (long) op->value.dval;
|
||||
op->type = IS_LONG;
|
||||
break;
|
||||
case IS_STRING:
|
||||
strval = op->value.str.val;
|
||||
op->value.lval = strtol(strval, NULL, base);
|
||||
op->type = IS_LONG;
|
||||
STR_FREE(strval);
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
tmp = (zend_hash_num_elements(op->value.ht)?1:0);
|
||||
zval_dtor(op);
|
||||
op->value.lval = tmp;
|
||||
op->type = IS_LONG;
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
tmp = (zend_hash_num_elements(op->value.obj.properties)?1:0);
|
||||
zval_dtor(op);
|
||||
op->value.lval = tmp;
|
||||
op->type = IS_LONG;
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Cannot convert to ordinal value");
|
||||
zval_dtor(op);
|
||||
op->value.lval = 0;
|
||||
op->type = IS_LONG;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -203,8 +205,8 @@ ZEND_API void convert_to_double(zval *op)
|
||||
double tmp;
|
||||
|
||||
switch (op->type) {
|
||||
case IS_BOOL:
|
||||
case IS_RESOURCE:
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
op->value.dval = (double) op->value.lval;
|
||||
op->type = IS_DOUBLE;
|
||||
@@ -248,8 +250,8 @@ ZEND_API void convert_to_boolean(zval *op)
|
||||
switch (op->type) {
|
||||
case IS_BOOL:
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_RESOURCE:
|
||||
case IS_LONG:
|
||||
op->value.lval = (op->value.lval ? 1 : 0);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
@@ -403,14 +405,22 @@ ZEND_API int add_function(zval *result, zval *op1, zval *op2)
|
||||
|
||||
if (op1->type == IS_ARRAY && op2->type == IS_ARRAY) {
|
||||
zval *tmp;
|
||||
|
||||
*result = *op1;
|
||||
zval_copy_ctor(result);
|
||||
|
||||
if ((result == op1) && (result == op2)) {
|
||||
/* $a += $a */
|
||||
return SUCCESS;
|
||||
}
|
||||
if (result != op1) {
|
||||
/* $a += $b */
|
||||
*result = *op1;
|
||||
zval_copy_ctor(result);
|
||||
}
|
||||
zend_hash_merge(result->value.ht, op2->value.ht, (void (*)(void *pData)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0);
|
||||
return SUCCESS;
|
||||
}
|
||||
zendi_convert_scalar_to_number(op1, op1_copy);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy);
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
|
||||
|
||||
if (op1->type == IS_LONG && op2->type == IS_LONG) {
|
||||
double dval = (double) op1->value.lval + (double) op2->value.lval;
|
||||
@@ -446,8 +456,8 @@ ZEND_API int sub_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
zendi_convert_scalar_to_number(op1, op1_copy);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy);
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
|
||||
if (op1->type == IS_LONG && op2->type == IS_LONG) {
|
||||
double dval = (double) op1->value.lval - (double) op2->value.lval;
|
||||
@@ -483,8 +493,8 @@ ZEND_API int mul_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
zendi_convert_scalar_to_number(op1, op1_copy);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy);
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
|
||||
if (op1->type == IS_LONG && op2->type == IS_LONG) {
|
||||
double dval = (double) op1->value.lval * (double) op2->value.lval;
|
||||
@@ -519,8 +529,8 @@ ZEND_API int div_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
zendi_convert_scalar_to_number(op1, op1_copy);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy);
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
|
||||
if ((op2->type == IS_LONG && op2->value.lval == 0) || (op2->type == IS_DOUBLE && op2->value.dval == 0.0)) {
|
||||
zend_error(E_WARNING, "Division by zero");
|
||||
@@ -559,8 +569,8 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
zendi_convert_to_long(op1, op1_copy);
|
||||
zendi_convert_to_long(op2, op2_copy);
|
||||
zendi_convert_to_long(op1, op1_copy, result);
|
||||
zendi_convert_to_long(op2, op2_copy, result);
|
||||
|
||||
if (op2->value.lval == 0) {
|
||||
var_reset(result);
|
||||
@@ -579,12 +589,12 @@ ZEND_API int boolean_or_function(zval *result, zval *op1, zval *op2)
|
||||
|
||||
result->type = IS_BOOL;
|
||||
|
||||
zendi_convert_to_boolean(op1, op1_copy);
|
||||
zendi_convert_to_boolean(op1, op1_copy, result);
|
||||
if (op1->value.lval) {
|
||||
result->value.lval = 1;
|
||||
return SUCCESS;
|
||||
}
|
||||
zendi_convert_to_boolean(op2, op2_copy);
|
||||
zendi_convert_to_boolean(op2, op2_copy, result);
|
||||
if (op2->value.lval) {
|
||||
result->value.lval = 1;
|
||||
return SUCCESS;
|
||||
@@ -600,12 +610,12 @@ ZEND_API int boolean_and_function(zval *result, zval *op1, zval *op2)
|
||||
|
||||
result->type = IS_BOOL;
|
||||
|
||||
zendi_convert_to_boolean(op1, op1_copy);
|
||||
zendi_convert_to_boolean(op1, op1_copy, result);
|
||||
if (!op1->value.lval) {
|
||||
result->value.lval = 0;
|
||||
return SUCCESS;
|
||||
}
|
||||
zendi_convert_to_boolean(op2, op2_copy);
|
||||
zendi_convert_to_boolean(op2, op2_copy, result);
|
||||
if (!op2->value.lval) {
|
||||
result->value.lval = 0;
|
||||
return SUCCESS;
|
||||
@@ -621,8 +631,8 @@ ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2)
|
||||
|
||||
result->type = IS_BOOL;
|
||||
|
||||
zendi_convert_to_boolean(op1, op1_copy);
|
||||
zendi_convert_to_boolean(op2, op2_copy);
|
||||
zendi_convert_to_boolean(op1, op1_copy, result);
|
||||
zendi_convert_to_boolean(op2, op2_copy, result);
|
||||
result->value.lval = op1->value.lval ^ op2->value.lval;
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -632,7 +642,7 @@ ZEND_API int boolean_not_function(zval *result, zval *op1)
|
||||
{
|
||||
zval op1_copy;
|
||||
|
||||
zendi_convert_to_boolean(op1, op1_copy);
|
||||
zendi_convert_to_boolean(op1, op1_copy, result);
|
||||
|
||||
result->type = IS_BOOL;
|
||||
result->value.lval = !op1->value.lval;
|
||||
@@ -694,8 +704,8 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2)
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
zendi_convert_to_long(op1, op1_copy);
|
||||
zendi_convert_to_long(op2, op2_copy);
|
||||
zendi_convert_to_long(op1, op1_copy, result);
|
||||
zendi_convert_to_long(op2, op2_copy, result);
|
||||
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = op1->value.lval | op2->value.lval;
|
||||
@@ -728,8 +738,8 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2)
|
||||
}
|
||||
|
||||
|
||||
zendi_convert_to_long(op1, op1_copy);
|
||||
zendi_convert_to_long(op2, op2_copy);
|
||||
zendi_convert_to_long(op1, op1_copy, result);
|
||||
zendi_convert_to_long(op2, op2_copy, result);
|
||||
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = op1->value.lval & op2->value.lval;
|
||||
@@ -761,8 +771,8 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
zendi_convert_to_long(op1, op1_copy);
|
||||
zendi_convert_to_long(op2, op2_copy);
|
||||
zendi_convert_to_long(op1, op1_copy, result);
|
||||
zendi_convert_to_long(op2, op2_copy, result);
|
||||
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = op1->value.lval ^ op2->value.lval;
|
||||
@@ -774,8 +784,8 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
zendi_convert_to_long(op1, op1_copy);
|
||||
zendi_convert_to_long(op2, op2_copy);
|
||||
zendi_convert_to_long(op1, op1_copy, result);
|
||||
zendi_convert_to_long(op2, op2_copy, result);
|
||||
result->value.lval = op1->value.lval << op2->value.lval;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
@@ -786,8 +796,8 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
zendi_convert_to_long(op1, op1_copy);
|
||||
zendi_convert_to_long(op2, op2_copy);
|
||||
zendi_convert_to_long(op1, op1_copy, result);
|
||||
zendi_convert_to_long(op2, op2_copy, result);
|
||||
result->value.lval = op1->value.lval >> op2->value.lval;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
@@ -870,19 +880,19 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
if (op1->type == IS_STRING && op2->type == IS_STRING) {
|
||||
zendi_smart_strcmp(result,op1,op2);
|
||||
zendi_smart_strcmp(result, op1, op2);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (op1->type == IS_BOOL || op2->type == IS_BOOL) {
|
||||
zendi_convert_to_boolean(op1, op1_copy);
|
||||
zendi_convert_to_boolean(op2, op2_copy);
|
||||
zendi_convert_to_boolean(op1, op1_copy, result);
|
||||
zendi_convert_to_boolean(op2, op2_copy, result);
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = op1->value.lval - op2->value.lval;
|
||||
return SUCCESS;
|
||||
}
|
||||
zendi_convert_scalar_to_number(op1, op1_copy);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy);
|
||||
zendi_convert_scalar_to_number(op1, op1_copy, result);
|
||||
zendi_convert_scalar_to_number(op2, op2_copy, result);
|
||||
|
||||
if (op1->type == IS_LONG && op2->type == IS_LONG) {
|
||||
result->type = IS_LONG;
|
||||
@@ -904,6 +914,42 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
result->type = IS_BOOL;
|
||||
if (op1->type != op2->type) {
|
||||
result->value.lval = 0;
|
||||
return SUCCESS;
|
||||
}
|
||||
switch (op1->type) {
|
||||
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)
|
||||
&& (!memcmp(op1->value.str.val, op2->value.str.val, op1->value.str.len))) {
|
||||
result->value.lval = 1;
|
||||
} else {
|
||||
result->value.lval = 0;
|
||||
}
|
||||
return SUCCESS;
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
case IS_OBJECT:
|
||||
zend_error(E_WARNING,"Cannot compare arrays or objects");
|
||||
break;
|
||||
}
|
||||
var_reset(result);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
if (compare_function(result, op1, op2) == FAILURE) {
|
||||
@@ -1106,6 +1152,7 @@ ZEND_API int decrement_function(zval *op1)
|
||||
op1->type = IS_LONG;
|
||||
break;
|
||||
} else if (is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, NULL)==IS_LONG) { /* long */
|
||||
STR_FREE(op1->value.str.val);
|
||||
op1->value.lval = lval-1;
|
||||
op1->type = IS_LONG;
|
||||
break;
|
||||
@@ -1224,7 +1271,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
*/
|
||||
|
||||
#if 1
|
||||
static inline int is_numeric_string(char *str, int length, long *lval, double *dval)
|
||||
ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double *dval)
|
||||
{
|
||||
long local_lval;
|
||||
double local_dval;
|
||||
|
||||
@@ -42,9 +42,11 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int concat_function(zval *result, zval *op1, zval *op2);
|
||||
|
||||
ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int is_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);
|
||||
|
||||
ZEND_API int increment_function(zval *op1);
|
||||
ZEND_API int decrement_function(zval *op2);
|
||||
@@ -70,4 +72,60 @@ ZEND_API int zend_binary_strcmp(zval *s1, zval *s2);
|
||||
ZEND_API int zend_binary_strcasecmp(zval *s1, zval *s2);
|
||||
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
|
||||
|
||||
#define convert_to_long_ex(ppzv) \
|
||||
if ((*ppzv)->type!=IS_LONG) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
} \
|
||||
convert_to_long(*ppzv); \
|
||||
}
|
||||
|
||||
#define convert_to_double_ex(ppzv) \
|
||||
if ((*ppzv)->type!=IS_DOUBLE) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
} \
|
||||
convert_to_double(*ppzv); \
|
||||
}
|
||||
|
||||
#define convert_to_string_ex(ppzv) \
|
||||
if ((*ppzv)->type!=IS_STRING) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
} \
|
||||
convert_to_string(*ppzv); \
|
||||
}
|
||||
|
||||
#define convert_to_array_ex(ppzv) \
|
||||
if ((*ppzv)->type!=IS_ARRAY) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
} \
|
||||
convert_to_array(*ppzv); \
|
||||
}
|
||||
|
||||
#define convert_to_object_ex(ppzv) \
|
||||
if ((*ppzv)->type!=IS_OBJECT) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
} \
|
||||
convert_to_object(*ppzv); \
|
||||
}
|
||||
|
||||
#define convert_to_boolean_ex(ppzv) \
|
||||
if ((*ppzv)->type!=IS_BOOL) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
} \
|
||||
convert_to_boolean(*ppzv); \
|
||||
}
|
||||
|
||||
#define convert_scalar_to_number_ex(ppzv) \
|
||||
if ((*ppzv)->type!=IS_LONG && (*ppzv)->type!=IS_DOUBLE) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
} \
|
||||
convert_scalar_to_number(*ppzv); \
|
||||
}
|
||||
|
||||
#endif
|
||||
+42
-6
@@ -20,12 +20,14 @@
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_ptr_stack.h"
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack)
|
||||
{
|
||||
stack->top_element = stack->elements = (void **) emalloc(sizeof(void *)*STACK_BLOCK_SIZE);
|
||||
stack->max = STACK_BLOCK_SIZE;
|
||||
stack->top_element = stack->elements = (void **) emalloc(sizeof(void *)*PTR_STACK_BLOCK_SIZE);
|
||||
stack->max = PTR_STACK_BLOCK_SIZE;
|
||||
stack->top = 0;
|
||||
}
|
||||
|
||||
@@ -33,15 +35,49 @@ ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack)
|
||||
ZEND_API inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr)
|
||||
{
|
||||
if (stack->top >= stack->max) { /* we need to allocate more memory */
|
||||
short diff = stack->top_element-stack->elements;
|
||||
|
||||
stack->elements = (void **) erealloc(stack->elements, (sizeof(void *) * (stack->max *= 2 )));
|
||||
stack->top_element = stack->elements+diff;
|
||||
stack->top_element = stack->elements+stack->top;
|
||||
}
|
||||
stack->top++;
|
||||
*(stack->top_element++) = ptr;
|
||||
}
|
||||
|
||||
ZEND_API inline void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count,...)
|
||||
{
|
||||
va_list ptr;
|
||||
void *elem;
|
||||
|
||||
if (stack->top+count > stack->max) { /* we need to allocate more memory */
|
||||
stack->max *= 2;
|
||||
stack->max += count;
|
||||
stack->elements = (void **) erealloc(stack->elements, (sizeof(void *) * (stack->max)));
|
||||
stack->top_element = stack->elements+stack->top;
|
||||
}
|
||||
va_start(ptr, count);
|
||||
while (count>0) {
|
||||
elem = va_arg(ptr, void *);
|
||||
stack->top++;
|
||||
*(stack->top_element++) = elem;
|
||||
count--;
|
||||
}
|
||||
va_end(ptr);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count,...)
|
||||
{
|
||||
va_list ptr;
|
||||
void **elem;
|
||||
|
||||
va_start(ptr, count);
|
||||
while (count>0) {
|
||||
elem = va_arg(ptr, void **);
|
||||
*elem = *(--stack->top_element);
|
||||
stack->top--;
|
||||
count--;
|
||||
}
|
||||
va_end(ptr);
|
||||
}
|
||||
|
||||
ZEND_API inline void *zend_ptr_stack_pop(zend_ptr_stack *stack)
|
||||
{
|
||||
|
||||
@@ -28,11 +28,13 @@ typedef struct _zend_ptr_stack {
|
||||
} zend_ptr_stack;
|
||||
|
||||
|
||||
#define STACK_BLOCK_SIZE 64
|
||||
#define PTR_STACK_BLOCK_SIZE 64
|
||||
|
||||
ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack);
|
||||
ZEND_API void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr);
|
||||
ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count,...);
|
||||
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 *));
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#if HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#if BROKEN_SPRINTF
|
||||
|
||||
@@ -116,3 +116,49 @@ ZEND_API int zend_stack_count(zend_stack *stack)
|
||||
{
|
||||
return stack->top;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_stack_apply(zend_stack *stack, int (*apply_function)(void *element), int type)
|
||||
{
|
||||
int i;
|
||||
|
||||
switch (type) {
|
||||
case ZEND_STACK_APPLY_TOPDOWN:
|
||||
for (i=stack->top-1; i>=0; i--) {
|
||||
if (apply_function(stack->elements[i])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_STACK_APPLY_BOTTOMUP:
|
||||
for (i=0; i<stack->top; i++) {
|
||||
if (apply_function(stack->elements[i])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int (*apply_function)(void *element, void *arg), int type, void *arg)
|
||||
{
|
||||
int i;
|
||||
|
||||
switch (type) {
|
||||
case ZEND_STACK_APPLY_TOPDOWN:
|
||||
for (i=stack->top-1; i>=0; i--) {
|
||||
if (apply_function(stack->elements[i], arg)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZEND_STACK_APPLY_BOTTOMUP:
|
||||
for (i=0; i<stack->top; i++) {
|
||||
if (apply_function(stack->elements[i], arg)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,10 @@ ZEND_API int zend_stack_is_empty(zend_stack *stack);
|
||||
ZEND_API int zend_stack_destroy(zend_stack *stack);
|
||||
ZEND_API void **zend_stack_base(zend_stack *stack);
|
||||
ZEND_API int zend_stack_count(zend_stack *stack);
|
||||
ZEND_API void zend_stack_apply(zend_stack *stack, int (*apply_function)(void *element), int type);
|
||||
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int (*apply_function)(void *element, void *arg), int type, void *arg);
|
||||
|
||||
#define ZEND_STACK_APPLY_TOPDOWN 1
|
||||
#define ZEND_STACK_APPLY_BOTTOMUP 2
|
||||
|
||||
#endif /* _ZEND_STACK_H */
|
||||
+42
-11
@@ -51,7 +51,7 @@ ZEND_API inline void var_uninit(zval *var)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zval_dtor(zval *zvalue)
|
||||
ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
{
|
||||
if (zvalue->type==IS_LONG) {
|
||||
return 1;
|
||||
@@ -59,20 +59,20 @@ ZEND_API int zval_dtor(zval *zvalue)
|
||||
switch(zvalue->type) {
|
||||
case IS_STRING:
|
||||
case IS_CONSTANT:
|
||||
STR_FREE(zvalue->value.str.val);
|
||||
STR_FREE_REL(zvalue->value.str.val);
|
||||
break;
|
||||
case IS_ARRAY: {
|
||||
ELS_FETCH();
|
||||
|
||||
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
|
||||
zend_hash_destroy(zvalue->value.ht);
|
||||
efree(zvalue->value.ht);
|
||||
efree_rel(zvalue->value.ht);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
zend_hash_destroy(zvalue->value.obj.properties);
|
||||
efree(zvalue->value.obj.properties);
|
||||
efree_rel(zvalue->value.obj.properties);
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
/* destroy resource */
|
||||
@@ -89,15 +89,23 @@ ZEND_API int zval_dtor(zval *zvalue)
|
||||
}
|
||||
|
||||
|
||||
void zval_del_ref(zval **p)
|
||||
{
|
||||
(*p)->refcount--;
|
||||
if ((*p)->refcount==0) {
|
||||
zval_dtor(*p);
|
||||
efree(*p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void zval_add_ref(zval **p)
|
||||
{
|
||||
(*p)->refcount++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ZEND_API int zval_copy_ctor(zval *zvalue)
|
||||
ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
{
|
||||
switch (zvalue->type) {
|
||||
case IS_RESOURCE:
|
||||
@@ -117,18 +125,20 @@ ZEND_API int zval_copy_ctor(zval *zvalue)
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
zvalue->value.str.val = (char *) estrndup(zvalue->value.str.val, zvalue->value.str.len);
|
||||
zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len);
|
||||
break;
|
||||
case IS_ARRAY: {
|
||||
zval *tmp;
|
||||
HashTable *original_ht = zvalue->value.ht;
|
||||
ELS_FETCH();
|
||||
|
||||
if (!zvalue->value.ht || zvalue->value.ht==&EG(symbol_table)) {
|
||||
if (!zvalue->value.ht) {
|
||||
var_reset(zvalue);
|
||||
return FAILURE;
|
||||
} else if (zvalue->value.ht==&EG(symbol_table)) {
|
||||
return SUCCESS; /* do nothing */
|
||||
}
|
||||
zvalue->value.ht = (HashTable *) emalloc(sizeof(HashTable));
|
||||
zvalue->value.ht = (HashTable *) emalloc_rel(sizeof(HashTable));
|
||||
zend_hash_init(zvalue->value.ht, 0, NULL, PVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(zvalue->value.ht, original_ht, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
@@ -137,7 +147,7 @@ ZEND_API int zval_copy_ctor(zval *zvalue)
|
||||
zval *tmp;
|
||||
HashTable *original_ht = zvalue->value.obj.properties;
|
||||
|
||||
zvalue->value.obj.properties = (HashTable *) emalloc(sizeof(HashTable));
|
||||
zvalue->value.obj.properties = (HashTable *) emalloc_rel(sizeof(HashTable));
|
||||
zend_hash_init(zvalue->value.obj.properties, 0, NULL, PVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(zvalue->value.obj.properties, original_ht, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
@@ -153,6 +163,27 @@ ZEND_API int zend_print_variable(zval *var)
|
||||
}
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API int _zval_copy_ctor_wrapper(zval *zvalue)
|
||||
{
|
||||
return zval_copy_ctor(zvalue);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int _zval_dtor_wrapper(zval *zvalue)
|
||||
{
|
||||
return zval_dtor(zvalue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API int _zval_ptr_dtor_wrapper(zval **zval_ptr)
|
||||
{
|
||||
return zval_ptr_dtor(zval_ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+26
-7
@@ -25,16 +25,35 @@
|
||||
ZEND_API int zend_print_variable(zval *var);
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API int zval_copy_ctor(zval *zvalue);
|
||||
ZEND_API int zval_dtor(zval *zvalue);
|
||||
ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC);
|
||||
ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC);
|
||||
ZEND_API int _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC);
|
||||
#define zval_copy_ctor(zvalue) _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC)
|
||||
#define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC)
|
||||
#define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC)
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_API int _zval_copy_ctor_wrapper(zval *zvalue);
|
||||
ZEND_API int _zval_dtor_wrapper(zval *zvalue);
|
||||
ZEND_API int _zval_ptr_dtor_wrapper(zval **zval_ptr);
|
||||
#define zval_copy_ctor_wrapper _zval_copy_ctor_wrapper
|
||||
#define zval_dtor_wrapper _zval_dtor_wrapper
|
||||
#define zval_ptr_dtor_wrapper _zval_ptr_dtor_wrapper
|
||||
#else
|
||||
#define zval_copy_ctor_wrapper _zval_copy_ctor
|
||||
#define zval_dtor_wrapper _zval_dtor
|
||||
#define zval_ptr_dtor_wrapper _zval_ptr_dtor
|
||||
#endif
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
ZEND_API int zval_ptr_dtor(zval **zval_ptr);
|
||||
void zval_add_ref(zval **p);
|
||||
|
||||
#define PVAL_DESTRUCTOR (int (*)(void *)) zval_dtor
|
||||
#define PVAL_PTR_DTOR (int (*)(void *)) zval_ptr_dtor
|
||||
#define PVAL_COPY_CTOR (void (*)(void *)) zval_copy_ctor
|
||||
void zval_add_ref(zval **p);
|
||||
void zval_del_ref(zval **p);
|
||||
|
||||
#define PVAL_DESTRUCTOR (int (*)(void *)) zval_dtor_wrapper
|
||||
#define PVAL_PTR_DTOR (int (*)(void *)) zval_ptr_dtor_wrapper
|
||||
#define PVAL_COPY_CTOR (void (*)(void *)) zval_copy_ctor_wrapper
|
||||
|
||||
ZEND_API void var_reset(zval *var);
|
||||
ZEND_API void var_uninit(zval *var);
|
||||
|
||||
+9
-1
@@ -4,10 +4,12 @@
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
#undef HAVE_AOLSERVER
|
||||
|
||||
#undef HAVE_STRUCT_FLOCK
|
||||
#undef HAVE_TM_GMTOFF
|
||||
|
||||
#define CONFIGURATION_FILE_PATH "php3.ini"
|
||||
#define CONFIGURATION_FILE_PATH "php.ini"
|
||||
#define USE_CONFIG_FILE 1
|
||||
|
||||
#undef HAVE_DMALLOC
|
||||
@@ -116,3 +118,9 @@
|
||||
|
||||
/* 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
|
||||
+213
-36
@@ -2,6 +2,27 @@ dnl $Id$
|
||||
dnl
|
||||
dnl This file contains local autoconf functions.
|
||||
|
||||
dnl
|
||||
dnl PHP_BUILD_SHARED
|
||||
dnl
|
||||
AC_DEFUN(PHP_BUILD_SHARED,[
|
||||
php_build_target=shared
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_BUILD_STATIC
|
||||
dnl
|
||||
AC_DEFUN(PHP_BUILD_STATIC,[
|
||||
php_build_target=static
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_BUILD_PROGRAM
|
||||
dnl
|
||||
AC_DEFUN(PHP_BUILD_PROGRAM,[
|
||||
php_build_target=program
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_PHP_ONCE(namespace, variable, code)
|
||||
dnl
|
||||
@@ -25,7 +46,9 @@ AC_DEFUN(AC_EXPAND_PATH,[
|
||||
if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then
|
||||
$2="$1"
|
||||
else
|
||||
$2="`pwd`/$1"
|
||||
ep_dir="`dirname \"$1\"`"
|
||||
ep_realdir="`(cd \"$ep_dir\" && pwd)`"
|
||||
$2="$ep_realdir/`basename \"$1\"`"
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -35,16 +58,29 @@ dnl
|
||||
dnl add a library to linkpath/runpath
|
||||
dnl
|
||||
AC_DEFUN(AC_ADD_LIBPATH,[
|
||||
AC_EXPAND_PATH($1, ai_p)
|
||||
AC_PHP_ONCE(LIBPATH, $ai_p, [
|
||||
EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
|
||||
RAW_RPATHS="$RAW_RPATHS ${raw_runpath_switch}$ai_p"
|
||||
if test -n "$APXS" ; then
|
||||
RPATHS="$RPATHS ${apxs_runpath_switch}$ai_p'"
|
||||
else
|
||||
RPATHS="$RPATHS ${ld_runpath_switch}$ai_p"
|
||||
fi
|
||||
])
|
||||
if test "$1" != "/usr/lib"; then
|
||||
AC_EXPAND_PATH($1, ai_p)
|
||||
AC_PHP_ONCE(LIBPATH, $ai_p, [
|
||||
EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
|
||||
PHP_RPATHS="$PHP_RPATHS $ai_p"
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_BUILD_RPATH()
|
||||
dnl
|
||||
dnl builds RPATH from PHP_RPATHS
|
||||
dnl
|
||||
AC_DEFUN(AC_BUILD_RPATH,[
|
||||
if test "$enable_rpath" = "yes" && test -n "$PHP_RPATHS"; then
|
||||
OLD_RPATHS="$PHP_RPATHS"
|
||||
PHP_RPATHS=""
|
||||
for i in $OLD_RPATHS; do
|
||||
PHP_RPATHS="$PHP_RPATHS -R $i"
|
||||
NATIVE_RPATHS="$NATIVE_RPATHS ${ld_runpath_switch}$i"
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -53,10 +89,12 @@ dnl
|
||||
dnl add a include path
|
||||
dnl
|
||||
AC_DEFUN(AC_ADD_INCLUDE,[
|
||||
AC_EXPAND_PATH($1, ai_p)
|
||||
AC_PHP_ONCE(INCLUDEPATH, $ai_p, [
|
||||
INCLUDES="$INCLUDES -I$ai_p"
|
||||
])
|
||||
if test "$1" != "/usr/include"; then
|
||||
AC_EXPAND_PATH($1, ai_p)
|
||||
AC_PHP_ONCE(INCLUDEPATH, $ai_p, [
|
||||
INCLUDES="$INCLUDES -I$ai_p"
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -81,6 +119,10 @@ AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH,[
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Check for cc option
|
||||
dnl
|
||||
@@ -89,16 +131,41 @@ AC_DEFUN(AC_CHECK_CC_OPTION,[
|
||||
opt="$1"
|
||||
var=`echo $ac_n "$opt$ac_c"|tr -c a-zA-Z0-9 _`
|
||||
AC_MSG_CHECKING([if compiler supports -$1 really])
|
||||
ac_php_compile="${CC-cc} -$opt -c $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1"
|
||||
if eval $ac_php_compile | egrep "$opt" > /dev/null 2>&1 ; then
|
||||
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
|
||||
eval php_cc_$var=no
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
eval php_cc_$var=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
if eval ./conftest 2>/dev/null ; then
|
||||
eval php_cc_$var=yes
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
eval php_cc_$var=no
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
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)
|
||||
elif test "$REGEX_TYPE" = "system"; then
|
||||
AC_DEFINE(REGEX,0)
|
||||
elif test "$REGEX_TYPE" = "apache"; then
|
||||
AC_DEFINE(REGEX,2)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(which regex library to use)
|
||||
AC_MSG_RESULT($REGEX_TYPE)
|
||||
|
||||
AC_SUBST(REGEX_DIR)
|
||||
AC_SUBST(REGEX_LIB)
|
||||
AC_SUBST(HSREGEX)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl See if we have broken header files like SunOS has.
|
||||
@@ -132,29 +199,139 @@ AC_DEFUN(AC_BROKEN_SPRINTF,[
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Stuff to do when setting up a new extension.
|
||||
dnl XXX have to change the hardcoding of ".a" when we want to be able
|
||||
dnl to make dynamic libraries as well.
|
||||
dnl PHP_EXTENSION(extname [, shared])
|
||||
dnl
|
||||
dnl Includes an extension in the build.
|
||||
dnl
|
||||
dnl "extname" is the name of the ext/ subdir where the extension resides
|
||||
dnl "shared" can be set to "shared" or "yes" to build the extension as
|
||||
dnl a dynamically loadable library.
|
||||
dnl
|
||||
AC_DEFUN(PHP_EXTENSION,[
|
||||
EXT_SUBDIRS="$EXT_SUBDIRS $1"
|
||||
if test "$2" != "shared" -a "$2" != "yes"; then
|
||||
_extlib="libphpext_$1.a"
|
||||
EXT_LIBS="$EXT_LIBS $1/$_extlib"
|
||||
EXTINFO_DEPS="$EXTINFO_DEPS ../ext/$1/extinfo.c.stub"
|
||||
EXT_STATIC="$EXT_STATIC $1"
|
||||
else
|
||||
EXT_SHARED="$EXT_SHARED $1"
|
||||
if test -d "$cwd/$srcdir/ext/$1" ; then
|
||||
EXT_SUBDIRS="$EXT_SUBDIRS $1"
|
||||
if test "$2" != "shared" -a "$2" != "yes"; then
|
||||
_extlib="libphpext_$1.a"
|
||||
EXT_LTLIBS="$EXT_LTLIBS ext/$1/libphpext_$1.la"
|
||||
EXT_LIBS="$EXT_LIBS $1/$_extlib"
|
||||
EXT_STATIC="$EXT_STATIC $1"
|
||||
else
|
||||
EXT_SHARED="$EXT_SHARED $1"
|
||||
fi
|
||||
PHP_OUTPUT(ext/$1/Makefile)
|
||||
fi
|
||||
dnl EXT_INCLUDE_CODE="\#include \"ext/$1/php3_$1.h\"\\n$EXT_INCLUDE_CODE"
|
||||
dnl EXT_MODULE_PTRS="phpext_$1_ptr, $EXT_MODULE_PTRS"
|
||||
dnl "
|
||||
])
|
||||
|
||||
AC_SUBST(EXT_SUBDIRS)
|
||||
AC_SUBST(EXT_STATIC)
|
||||
AC_SUBST(EXT_SHARED)
|
||||
AC_SUBST(EXT_LIBS)
|
||||
AC_SUBST(EXTINFO_DEPS)
|
||||
dnl AC_SUBST(EXT_INCLUDE_CODE)
|
||||
dnl AC_SUBST(EXT_MODULES_PTRS)
|
||||
AC_SUBST(EXT_LTLIBS)
|
||||
|
||||
dnl
|
||||
dnl Solaris requires main code to be position independent in order
|
||||
dnl to let shared objects find symbols. Weird. Ugly.
|
||||
dnl
|
||||
dnl Must be run after all --with-NN options that let the user
|
||||
dnl choose dynamic extensions, and after the gcc test.
|
||||
dnl
|
||||
AC_DEFUN(PHP_SOLARIS_PIC_WEIRDNESS,[
|
||||
AC_MSG_CHECKING(whether -fPIC is required)
|
||||
if test "$EXT_SHARED" != ""; then
|
||||
os=`uname -sr 2>/dev/null`
|
||||
case "$os" in
|
||||
"SunOS 5.6"|"SunOS 5.7")
|
||||
case "$CC" in
|
||||
gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";;
|
||||
*) CFLAGS="$CFLAGS -fpic";;
|
||||
esac
|
||||
AC_MSG_RESULT(yes);;
|
||||
*)
|
||||
AC_MSG_RESULT(no);;
|
||||
esac
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Checks whether $withval is "shared" or starts with "shared,XXX"
|
||||
dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff
|
||||
dnl from $withval.
|
||||
dnl
|
||||
AC_DEFUN(PHP_WITH_SHARED,[
|
||||
case $withval in
|
||||
shared)
|
||||
shared=yes
|
||||
withval=yes
|
||||
;;
|
||||
shared,*)
|
||||
shared=yes
|
||||
withval=`echo $withval | sed -e 's/^shared,//'`
|
||||
;;
|
||||
*)
|
||||
shared=no
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
dnl The problem is that the default compilation flags in Solaris 2.6 won't
|
||||
dnl let programs access large files; you need to tell the compiler that
|
||||
dnl you actually want your programs to work on large files. For more
|
||||
dnl details about this brain damage please see:
|
||||
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
||||
|
||||
dnl Written by Paul Eggert <eggert@twinsun.com>.
|
||||
|
||||
AC_DEFUN(AC_SYS_LFS,
|
||||
[dnl
|
||||
# If available, prefer support for large files unless the user specified
|
||||
# one of the CPPFLAGS, LDFLAGS, or LIBS variables.
|
||||
AC_MSG_CHECKING(whether large file support needs explicit enabling)
|
||||
ac_getconfs=''
|
||||
ac_result=yes
|
||||
ac_set=''
|
||||
ac_shellvars='CPPFLAGS LDFLAGS LIBS'
|
||||
for ac_shellvar in $ac_shellvars; do
|
||||
case $ac_shellvar in
|
||||
CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
|
||||
*) ac_lfsvar=LFS_$ac_shellvar ;;
|
||||
esac
|
||||
eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
|
||||
(getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
|
||||
ac_getconf=`getconf $ac_lfsvar`
|
||||
ac_getconfs=$ac_getconfs$ac_getconf
|
||||
eval ac_test_$ac_shellvar=\$ac_getconf
|
||||
done
|
||||
case "$ac_result$ac_getconfs" in
|
||||
yes) ac_result=no ;;
|
||||
esac
|
||||
case "$ac_result$ac_set" in
|
||||
yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
|
||||
esac
|
||||
AC_MSG_RESULT($ac_result)
|
||||
case $ac_result in
|
||||
yes)
|
||||
for ac_shellvar in $ac_shellvars; do
|
||||
eval $ac_shellvar=\$ac_test_$ac_shellvar
|
||||
done ;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN(AC_SOCKADDR_SA_LEN,[
|
||||
AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/socket.h>],
|
||||
[struct sockaddr s; s.sa_len;],
|
||||
[ac_cv_sockaddr_sa_len=yes
|
||||
AC_DEFINE(HAVE_SOCKADDR_SA_LEN)],
|
||||
[ac_cv_sockaddr_sa_len=no])
|
||||
])
|
||||
])
|
||||
|
||||
dnl ## PHP_AC_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,[
|
||||
PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1"
|
||||
])
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
##
|
||||
## Apache 1.3 Makefile template for PHP3 Module
|
||||
## Apache 1.3 Makefile template for PHP 4.0 Module
|
||||
## [src/modules/php4/Makefile.tmpl]
|
||||
##
|
||||
|
||||
|
||||
+4
-6
@@ -57,6 +57,10 @@
|
||||
#define PHP_MYSQL_INCLUDE ""
|
||||
#define PHP_MYSQL_LFLAGS ""
|
||||
#define PHP_MYSQL_LIBS ""
|
||||
#define PHP_ODBC_TYPE "@ODBC_TYPE@"
|
||||
#define PHP_ODBC_INCLUDE "@ODBC_INCLUDE@"
|
||||
#define PHP_ODBC_LFLAGS "@ODBC_LFLAGS@"
|
||||
#define PHP_ODBC_LIBS "@ODBC_LIBS@"
|
||||
#define PHP_ORACLE_HOME ""
|
||||
#define PHP_ORACLE_INCLUDE ""
|
||||
#define PHP_ORACLE_LFLAGS ""
|
||||
@@ -84,9 +88,3 @@
|
||||
#define PHP_VELOCIS_INCLUDE ""
|
||||
#define PHP_VELOCIS_LIBS ""
|
||||
|
||||
#define ODBC_TYPE ""
|
||||
#define ODBC_INCDIR ""
|
||||
#define ODBC_INCLUDE ""
|
||||
#define ODBC_LIBDIR ""
|
||||
#define ODBC_LFLAGS ""
|
||||
#define ODBC_LIBS ""
|
||||
@@ -0,0 +1,91 @@
|
||||
# Makefile to generate build tools
|
||||
#
|
||||
# Standard usage:
|
||||
# make -f build.mk
|
||||
#
|
||||
# To prepare a self-contained distribution:
|
||||
# make -f build.mk dist
|
||||
#
|
||||
#
|
||||
# Written by Sascha Schumann
|
||||
#
|
||||
# $Id$
|
||||
|
||||
|
||||
LT_TARGETS = ltmain.sh ltconfig
|
||||
LT_PATCHES = patch-aa patch-ab
|
||||
|
||||
SUBDIRS = libzend TSRM
|
||||
|
||||
makefile_am_files = Makefile.am $(shell find ext sapi regex -name Makefile.am)
|
||||
makefile_in_files = $(makefile_am_files:.am=.in)
|
||||
makefile_files = $(makefile_am_files:e.am=e)
|
||||
|
||||
config_h_in = php_config.h.in
|
||||
|
||||
config_h_files = \
|
||||
$(shell echo ext/*/config.h.stub sapi/*/config.h.stub)
|
||||
|
||||
config_m4_files = \
|
||||
$(shell echo ext/*/config.m4 sapi/*/config.m4)
|
||||
|
||||
acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
|
||||
|
||||
targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in)
|
||||
|
||||
all: $(targets)
|
||||
@for i in $(SUBDIRS); do \
|
||||
test -d $$i || (test -d ../$$i && ln -s ../$$i $$i); \
|
||||
(cd $$i && $(MAKE) -f build.mk AMFLAGS=$(AMFLAGS)); \
|
||||
done
|
||||
|
||||
dist:
|
||||
@rm -f $(SUBDIRS) 2>/dev/null || true
|
||||
@for i in $(SUBDIRS); do \
|
||||
test -d $$i || (test -d ../$$i && cp -rp ../$$i $$i); \
|
||||
done
|
||||
@find . -type l -exec rm {} \;
|
||||
$(MAKE) AMFLAGS=--copy -f build.mk
|
||||
|
||||
clean:
|
||||
rm -f $(targets)
|
||||
@for i in $(SUBDIRS); do \
|
||||
(cd $$i && $(MAKE) -f build.mk clean); \
|
||||
done
|
||||
|
||||
cvsclean:
|
||||
@for i in $(shell find . -follow -name .cvsignore); do \
|
||||
(cd `dirname $$i` && rm -rf `cat .cvsignore`); \
|
||||
done
|
||||
@rm -f $(SUBDIRS) 2>/dev/null || true
|
||||
|
||||
acconfig.h: $(acconfig_h_SOURCES)
|
||||
@echo rebuilding $@
|
||||
@cat $(acconfig_h_SOURCES) > $@
|
||||
|
||||
$(LT_TARGETS): $(LT_PATCHES)
|
||||
rm -f $(LT_TARGETS)
|
||||
libtoolize --automake -c -f
|
||||
patch ltconfig < patch-aa
|
||||
patch ltmain.sh < patch-ab
|
||||
@grep compile_rpath ltconfig >/dev/null 2>&1 || (\
|
||||
echo "patching libtool components failed."; \
|
||||
exit 1)
|
||||
|
||||
|
||||
$(makefile_in_files): $(makefile_am_files) aclocal.m4
|
||||
@echo rebuilding Makefile.in\'s
|
||||
@automake -a -i $(AMFLAGS) $(makefile_files) 2>&1 \
|
||||
| grep -v PHP_OUTPUT_FILES || true >&2
|
||||
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
aclocal
|
||||
|
||||
$(config_h_in): configure.in acconfig.h
|
||||
# explicitly remove target since autoheader does not seem to work
|
||||
# correctly otherwise (timestamps are not updated)
|
||||
@rm -f $@
|
||||
autoheader
|
||||
|
||||
configure: aclocal.m4 configure.in $(config_m4_files)
|
||||
autoconf
|
||||
@@ -1,8 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
supplied_flag=$1
|
||||
|
||||
# do some version checking for the tools we use
|
||||
if test "$1" = "--force"; then
|
||||
shift
|
||||
# this is a posix correct "test -nt"
|
||||
elif test "`ls -t buildconf buildconf.stamp 2>/dev/null |head -1`" != "buildconf"; then
|
||||
:
|
||||
else
|
||||
echo "buildconf: checking installation..."
|
||||
|
||||
@@ -42,31 +47,67 @@ else
|
||||
echo "buildconf: automake version $am_version (ok)"
|
||||
fi
|
||||
|
||||
# The stuff from libtool we need is in CVS right now, so it is
|
||||
# not required to run buildconf.
|
||||
# libtool 1.3.3 or newer
|
||||
lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
|
||||
if test "$lt_pversion" = ""; then
|
||||
echo "buildconf: libtool not found."
|
||||
echo " You need libtool version 1.3 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
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"
|
||||
then
|
||||
echo "buildconf: libtool version $lt_pversion (ok)"
|
||||
else
|
||||
echo "buildconf: libtool version $lt_pversion found."
|
||||
echo " You need libtool version 1.3.3 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
fi
|
||||
touch buildconf.stamp
|
||||
fi
|
||||
|
||||
if test "$1" = "--copy"; then
|
||||
am_prefix=`which automake | sed -e 's#/[^/]*/[^/]*$##'`
|
||||
lt_prefix=`which libtool | sed -e 's#/[^/]*/[^/]*$##'`
|
||||
if test "$am_prefix" != "$lt_prefix"; then
|
||||
echo "buildconf: WARNING: automake and libtool are installed in different"
|
||||
echo " directories. This may cause aclocal to fail."
|
||||
echo "buildconf: continuing anyway"
|
||||
fi
|
||||
|
||||
if test "$supplied_flag" = "--copy"; then
|
||||
automake_flags=--copy
|
||||
fi
|
||||
|
||||
if ! test -d libzend; then
|
||||
if test ! -d libzend; then
|
||||
if test -d ../libzend; then
|
||||
echo "buildconf: linking ../libzend to ./libzend"
|
||||
ln -s ../libzend .
|
||||
else
|
||||
echo "buildconf: can not find libzend"
|
||||
echo " libzend should be installed in . or .."
|
||||
echo " libzend should be installed in . or .., how to fetch:"
|
||||
echo ""
|
||||
echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository login"
|
||||
echo " (password \"zend\")"
|
||||
echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository co libzend"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if ! test -d TSRM; then
|
||||
if test ! -d TSRM; then
|
||||
if test -d ../TSRM; then
|
||||
echo "buildconf: linking ../TSRM to ./TSRM"
|
||||
ln -s ../TSRM .
|
||||
else
|
||||
echo "buildconf: can not find TSRM"
|
||||
echo " TSRM should be installed in . or .."
|
||||
echo " TSRM should be installed in . or .., how to fetch:"
|
||||
echo ""
|
||||
echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository login"
|
||||
echo " (password \"zend\")"
|
||||
echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository co TSRM"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -75,6 +116,15 @@ fi
|
||||
|
||||
mv aclocal.m4 aclocal.m4.old 2>/dev/null
|
||||
aclocal
|
||||
if test "$?" != "0" -a "$am_prefix" != "$lt_prefix"; then
|
||||
echo "buildconf: ERROR: aclocal failed, probably because automake and"
|
||||
echo " libtool are installed with different prefixes;"
|
||||
echo " automake is installed in $am_prefix, but libtool in $lt_prefix."
|
||||
echo " Please re-install automake and/or libtool with a common prefix"
|
||||
echo " and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
|
||||
echo "buildconf: keeping aclocal.m4"
|
||||
mv aclocal.m4.old aclocal.m4
|
||||
@@ -84,7 +134,12 @@ fi
|
||||
|
||||
autoheader
|
||||
|
||||
automake --add-missing --include-deps $automake_flags
|
||||
# find all Makefile.ams
|
||||
files="Makefile `find ext sapi regex -name Makefile.am | sed 's#\.am##' | tr '\n' ' '`"
|
||||
|
||||
# suppress stupid automake warning
|
||||
automake --add-missing --include-deps $automake_flags $files 2>&1 | grep -v \$PHP_OUTPUT_FILES >&2
|
||||
|
||||
|
||||
mv configure configure.old 2>/dev/null
|
||||
autoconf
|
||||
@@ -95,5 +150,7 @@ else
|
||||
echo "buildconf: created or modified configure"
|
||||
fi
|
||||
|
||||
(cd libzend; ./buildconf libzend/)
|
||||
(cd TSRM; ./buildconf TSRM/)
|
||||
if test "$supplied_flag" != "--local"; then
|
||||
(cd libzend; ./buildconf $automake_flags libzend/)
|
||||
(cd TSRM; ./buildconf $automake_flags TSRM/)
|
||||
fi
|
||||
Vendored
+130
-40
@@ -1,6 +1,7 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -36,6 +37,20 @@
|
||||
# (but try to keep the structure clean).
|
||||
#
|
||||
|
||||
# Use $HOST_CC if defined. $CC may point to a cross-compiler
|
||||
if test x"$CC_FOR_BUILD" = x; then
|
||||
if test x"$HOST_CC" != x; then
|
||||
CC_FOR_BUILD="$HOST_CC"
|
||||
else
|
||||
if test x"$CC" != x; then
|
||||
CC_FOR_BUILD="$CC"
|
||||
else
|
||||
CC_FOR_BUILD=cc
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 8/24/94.)
|
||||
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
|
||||
@@ -78,7 +93,7 @@ main:
|
||||
ret \$31,(\$26),1
|
||||
.end main
|
||||
EOF
|
||||
${CC-cc} $dummy.s -o $dummy 2>/dev/null
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./$dummy
|
||||
case "$?" in
|
||||
@@ -100,7 +115,13 @@ EOF
|
||||
esac
|
||||
fi
|
||||
rm -f $dummy.s $dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit 0 ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# Should we change UNAME_MACHINE based on the output of uname instead
|
||||
# of the specific Alpha model?
|
||||
echo alpha-pc-interix
|
||||
exit 0 ;;
|
||||
21064:Windows_NT:50:3)
|
||||
echo alpha-dec-winnt3.5
|
||||
@@ -144,7 +165,7 @@ EOF
|
||||
SR2?01:HI-UX/MPP:*:*)
|
||||
echo hppa1.1-hitachi-hiuxmpp
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
|
||||
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
|
||||
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
|
||||
if test "`(/bin/universe) 2>/dev/null`" = att ; then
|
||||
echo pyramid-pyramid-sysv3
|
||||
@@ -203,6 +224,32 @@ EOF
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
# The situation for MiNT is a little confusing. The machine name
|
||||
# can be virtually everything (everything which is not
|
||||
# "atarist" or "atariste" at least should have a processor
|
||||
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
|
||||
# to the lowercase version "mint" (or "freemint"). Finally
|
||||
# the system name "TOS" denotes a system which is actually not
|
||||
# MiNT. But MiNT is downward compatible to TOS, so this should
|
||||
# be no problem.
|
||||
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
|
||||
echo m68k-milan-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
|
||||
echo m68k-hades-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -236,7 +283,7 @@ EOF
|
||||
VAX*:ULTRIX*:*:*)
|
||||
echo vax-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
2020:CLIX:*:*)
|
||||
2020:CLIX:*:* | 2430:CLIX:*:*)
|
||||
echo clipper-intergraph-clix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mips:*:*:UMIPS | mips:*:*:RISCos)
|
||||
@@ -260,7 +307,7 @@ EOF
|
||||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy \
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy \
|
||||
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
@@ -326,7 +373,7 @@ EOF
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
@@ -374,7 +421,7 @@ EOF
|
||||
case "${UNAME_MACHINE}" in
|
||||
9000/31? ) HP_ARCH=m68000 ;;
|
||||
9000/[34]?? ) HP_ARCH=m68k ;;
|
||||
9000/6?? | 9000/7?? | 9000/80[024] | 9000/8?[136790] | 9000/892 )
|
||||
9000/[678][0-9][0-9])
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@@ -406,7 +453,7 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
(${CC-cc} $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
|
||||
($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
|
||||
rm -f $dummy.c $dummy
|
||||
esac
|
||||
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
@@ -438,7 +485,7 @@ EOF
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
@@ -448,10 +495,7 @@ EOF
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
*9??*:MPE*:*:*)
|
||||
echo hppa1.0-hp-mpeix
|
||||
exit 0 ;;
|
||||
*9??*:MPE*:*:*)
|
||||
*9??*:MPE/iX:*:*)
|
||||
echo hppa1.0-hp-mpeix
|
||||
exit 0 ;;
|
||||
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
||||
@@ -470,6 +514,9 @@ EOF
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
hppa*:OpenBSD:*:*)
|
||||
echo hppa-unknown-openbsd
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
@@ -509,7 +556,7 @@ EOF
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
F300:UNIX_System_V:*:*)
|
||||
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
@@ -522,12 +569,12 @@ EOF
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sparc*:BSD/OS:*:*)
|
||||
echo sparc-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sparc*:BSD/OS:*:*)
|
||||
echo sparc-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
@@ -552,6 +599,15 @@ EOF
|
||||
i*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit 0 ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
# UNAME_MACHINE based on the output of uname instead of i386?
|
||||
echo i386-pc-interix
|
||||
exit 0 ;;
|
||||
i*:UWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-uwin
|
||||
exit 0 ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin
|
||||
exit 0 ;;
|
||||
@@ -562,16 +618,17 @@ EOF
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:Linux:*:*)
|
||||
# # uname on the ARM produces all sorts of strangeness, and we need to
|
||||
# # filter it out.
|
||||
# case "$UNAME_MACHINE" in
|
||||
# armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
|
||||
# arm* | sa110*) UNAME_MACHINE="arm" ;;
|
||||
# esac
|
||||
# uname on the ARM produces all sorts of strangeness, and we need to
|
||||
# filter it out.
|
||||
case "$UNAME_MACHINE" in
|
||||
armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
|
||||
arm* | sa110*) UNAME_MACHINE="arm" ;;
|
||||
esac
|
||||
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us.
|
||||
ld_help_string=`ld --help 2>&1`
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
ld_help_string=`cd /; ld --help 2>&1`
|
||||
ld_supported_emulations=`echo $ld_help_string \
|
||||
| sed -ne '/supported emulations:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
@@ -584,8 +641,36 @@ EOF
|
||||
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
|
||||
elf32arm) echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 ;;
|
||||
elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
|
||||
elf32ppc)
|
||||
# Determine Lib Version
|
||||
cat >$dummy.c <<EOF
|
||||
#include <features.h>
|
||||
#if defined(__GLIBC__)
|
||||
extern char __libc_version[];
|
||||
extern char __libc_release[];
|
||||
#endif
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#if defined(__GLIBC__)
|
||||
printf("%s %s\n", __libc_version, __libc_release);
|
||||
#else
|
||||
printf("unkown\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
LIBC=""
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./$dummy | grep 1\.99 > /dev/null
|
||||
if test "$?" = 0 ; then
|
||||
LIBC="libc1"
|
||||
fi
|
||||
fi
|
||||
rm -f $dummy.c $dummy
|
||||
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
|
||||
esac
|
||||
|
||||
if test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
@@ -607,7 +692,7 @@ EOF
|
||||
.end main
|
||||
EOF
|
||||
LIBC=""
|
||||
${CC-cc} $dummy.s -o $dummy 2>/dev/null
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
./$dummy
|
||||
case "$?" in
|
||||
@@ -652,7 +737,7 @@ EOF
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld)
|
||||
@@ -695,7 +780,7 @@ EOF
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
fi ;;
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
|
||||
@@ -718,6 +803,14 @@ EOF
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:5:7*)
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
|
||||
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
|
||||
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
@@ -727,18 +820,15 @@ EOF
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:UnixWare:*:*)
|
||||
if /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
pc:*:*:*)
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i386.
|
||||
@@ -825,7 +915,7 @@ EOF
|
||||
news*:NEWS-OS:*:6*)
|
||||
echo mips-sony-newsos6
|
||||
exit 0 ;;
|
||||
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
|
||||
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
@@ -959,7 +1049,7 @@ main ()
|
||||
}
|
||||
EOF
|
||||
|
||||
${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
Vendored
+271
-35
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script, version 1.1.
|
||||
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
@@ -98,11 +98,21 @@ case $os in
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-scout)
|
||||
;;
|
||||
-wrs)
|
||||
os=vxworks
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco5)
|
||||
os=sco3.2v5
|
||||
os=-sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco4)
|
||||
@@ -121,6 +131,9 @@ case $os in
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-udk*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-isc)
|
||||
os=-isc2.2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
@@ -151,15 +164,21 @@ case $basic_machine in
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
||||
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
|
||||
| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
|
||||
| hppa2.0w \
|
||||
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
|
||||
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
|
||||
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
|
||||
| mipstx39 | mipstx39el | armv[34][lb] \
|
||||
| sparc | sparclet | sparclite | sparc64 | v850)
|
||||
| 580 | i960 | h8300 \
|
||||
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
||||
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
|
||||
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
|
||||
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
|
||||
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
||||
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr5000 | miprs64vr5000el \
|
||||
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
|
||||
| thumb | d10v)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
@@ -175,25 +194,41 @@ case $basic_machine in
|
||||
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
|
||||
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
|
||||
| hppa2.0w-* \
|
||||
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
|
||||
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
||||
| xmp-* | ymp-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
|
||||
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
|
||||
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
||||
| clipper-* | orion-* \
|
||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
| sparc64-* | mips64-* | mipsel-* | armv[34][lb]-*\
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| f301-* | armv*-*)
|
||||
| f301-* | armv*-* | t3e-* \
|
||||
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
||||
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
386bsd)
|
||||
basic_machine=i386-unknown
|
||||
os=-bsd
|
||||
;;
|
||||
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
|
||||
basic_machine=m68000-att
|
||||
;;
|
||||
3b*)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
a29khif)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
adobe68k)
|
||||
basic_machine=m68010-adobe
|
||||
os=-scout
|
||||
;;
|
||||
alliant | fx80)
|
||||
basic_machine=fx80-alliant
|
||||
;;
|
||||
@@ -223,6 +258,10 @@ case $basic_machine in
|
||||
basic_machine=m68k-apollo
|
||||
os=-sysv
|
||||
;;
|
||||
apollo68bsd)
|
||||
basic_machine=m68k-apollo
|
||||
os=-bsd
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
@@ -299,6 +338,10 @@ case $basic_machine in
|
||||
encore | umax | mmax)
|
||||
basic_machine=ns32k-encore
|
||||
;;
|
||||
es1800 | OSE68k | ose68k | ose | OSE)
|
||||
basic_machine=m68k-ericsson
|
||||
os=-ose
|
||||
;;
|
||||
fx2800)
|
||||
basic_machine=i860-alliant
|
||||
;;
|
||||
@@ -317,6 +360,14 @@ case $basic_machine in
|
||||
basic_machine=h8300-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
h8300xray)
|
||||
basic_machine=h8300-hitachi
|
||||
os=-xray
|
||||
;;
|
||||
h8500hms)
|
||||
basic_machine=h8500-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
harris)
|
||||
basic_machine=m88k-harris
|
||||
os=-sysv3
|
||||
@@ -332,13 +383,30 @@ case $basic_machine in
|
||||
basic_machine=m68k-hp
|
||||
os=-hpux
|
||||
;;
|
||||
hp3k9[0-9][0-9] | hp9[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hp9k2[0-9][0-9] | hp9k31[0-9])
|
||||
basic_machine=m68000-hp
|
||||
;;
|
||||
hp9k3[2-9][0-9])
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
|
||||
hp9k6[0-9][0-9] | hp6[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hp9k7[0-79][0-9] | hp7[0-79][0-9])
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k78[0-9] | hp78[0-9])
|
||||
# FIXME: really hppa2.0-hp
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
|
||||
# FIXME: really hppa2.0-hp
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][13679] | hp8[0-9][13679])
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||
@@ -347,13 +415,13 @@ case $basic_machine in
|
||||
hppa-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
hp3k9[0-9][0-9] | hp9[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
os=-mpeix
|
||||
hppaosf)
|
||||
basic_machine=hppa1.1-hp
|
||||
os=-osf
|
||||
;;
|
||||
hp3k9[0-9][0-9] | hp9[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
os=-mpeix
|
||||
hppro)
|
||||
basic_machine=hppa1.1-hp
|
||||
os=-proelf
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
@@ -376,6 +444,22 @@ case $basic_machine in
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
i386mach)
|
||||
basic_machine=i386-mach
|
||||
os=-mach
|
||||
;;
|
||||
i386-vsta | vsta)
|
||||
basic_machine=i386-unknown
|
||||
os=-vsta
|
||||
;;
|
||||
i386-go32 | go32)
|
||||
basic_machine=i386-unknown
|
||||
os=-go32
|
||||
;;
|
||||
i386-mingw32 | mingw32)
|
||||
basic_machine=i386-unknown
|
||||
os=-mingw32
|
||||
;;
|
||||
iris | iris4d)
|
||||
basic_machine=mips-sgi
|
||||
case $os in
|
||||
@@ -404,6 +488,10 @@ case $basic_machine in
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
*mint | *MiNT)
|
||||
basic_machine=m68k-atari
|
||||
os=-mint
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux-gnu
|
||||
@@ -418,10 +506,22 @@ case $basic_machine in
|
||||
mips3*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
|
||||
;;
|
||||
monitor)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
;;
|
||||
msdos)
|
||||
basic_machine=i386-unknown
|
||||
os=-msdos
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
;;
|
||||
netbsd386)
|
||||
basic_machine=i386-unknown
|
||||
os=-netbsd
|
||||
;;
|
||||
netwinder)
|
||||
basic_machine=armv4l-corel
|
||||
os=-linux
|
||||
@@ -438,6 +538,10 @@ case $basic_machine in
|
||||
basic_machine=mips-sony
|
||||
os=-newsos
|
||||
;;
|
||||
necv70)
|
||||
basic_machine=v70-nec
|
||||
os=-sysv
|
||||
;;
|
||||
next | m*-next )
|
||||
basic_machine=m68k-next
|
||||
case $os in
|
||||
@@ -463,9 +567,25 @@ case $basic_machine in
|
||||
basic_machine=i960-intel
|
||||
os=-nindy
|
||||
;;
|
||||
mon960)
|
||||
basic_machine=i960-intel
|
||||
os=-mon960
|
||||
;;
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
op50n-* | op60c-*)
|
||||
basic_machine=hppa1.1-oki
|
||||
os=-proelf
|
||||
;;
|
||||
OSE68000 | ose68000)
|
||||
basic_machine=m68000-ericsson
|
||||
os=-ose
|
||||
;;
|
||||
os68k)
|
||||
basic_machine=m68k-none
|
||||
os=-os68k
|
||||
;;
|
||||
pa-hitachi)
|
||||
basic_machine=hppa1.1-hitachi
|
||||
os=-hiuxwe2
|
||||
@@ -483,19 +603,19 @@ case $basic_machine in
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | k5 | nexen)
|
||||
pentium | p5 | k5 | k6 | nexen)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentiumpro | p6 | k6 | 6x86)
|
||||
pentiumpro | p6 | 6x86)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | nexen-*)
|
||||
pentium-* | p5-* | k5-* | k6-* | nexen-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | k6-* | 6x86-*)
|
||||
pentiumpro-* | p6-* | 6x86-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumii-* | pentium2-*)
|
||||
@@ -519,12 +639,20 @@ case $basic_machine in
|
||||
ps2)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
rom68k)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
;;
|
||||
rm[46]00)
|
||||
basic_machine=mips-siemens
|
||||
;;
|
||||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
sa29200)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
@@ -532,6 +660,10 @@ case $basic_machine in
|
||||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sparclite-wrs)
|
||||
basic_machine=sparclite-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
sps7)
|
||||
basic_machine=m68k-bull
|
||||
os=-sysv2
|
||||
@@ -539,6 +671,13 @@ case $basic_machine in
|
||||
spur)
|
||||
basic_machine=spur-unknown
|
||||
;;
|
||||
st2000)
|
||||
basic_machine=m68k-tandem
|
||||
;;
|
||||
stratus)
|
||||
basic_machine=i860-stratus
|
||||
os=-sysv4
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
@@ -583,6 +722,10 @@ case $basic_machine in
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
t3e)
|
||||
basic_machine=t3e-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
@@ -600,6 +743,10 @@ case $basic_machine in
|
||||
basic_machine=a29k-nyu
|
||||
os=-sym1
|
||||
;;
|
||||
v810 | necv810)
|
||||
basic_machine=v810-nec
|
||||
os=-none
|
||||
;;
|
||||
vaxv)
|
||||
basic_machine=vax-dec
|
||||
os=-sysv
|
||||
@@ -623,6 +770,14 @@ case $basic_machine in
|
||||
basic_machine=a29k-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
w65*)
|
||||
basic_machine=w65-wdc
|
||||
os=-none
|
||||
;;
|
||||
w89k-*)
|
||||
basic_machine=hppa1.1-winbond
|
||||
os=-proelf
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
@@ -630,6 +785,10 @@ case $basic_machine in
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
z8k-*-coff)
|
||||
basic_machine=z8k-unknown
|
||||
os=-sim
|
||||
;;
|
||||
none)
|
||||
basic_machine=none-none
|
||||
os=-none
|
||||
@@ -637,6 +796,15 @@ case $basic_machine in
|
||||
|
||||
# Here we handle the default manufacturer of certain CPU types. It is in
|
||||
# some cases the only manufacturer, in others, it is the most popular.
|
||||
w89k)
|
||||
basic_machine=hppa1.1-winbond
|
||||
;;
|
||||
op50n)
|
||||
basic_machine=hppa1.1-oki
|
||||
;;
|
||||
op60c)
|
||||
basic_machine=hppa1.1-oki
|
||||
;;
|
||||
mips)
|
||||
if [ x$os = x-linux-gnu ]; then
|
||||
basic_machine=mips-unknown
|
||||
@@ -659,7 +827,7 @@ case $basic_machine in
|
||||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sparc)
|
||||
sparc | sparcv9)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
@@ -671,6 +839,16 @@ case $basic_machine in
|
||||
orion105)
|
||||
basic_machine=clipper-highlevel
|
||||
;;
|
||||
mac | mpw | mac-mpw)
|
||||
basic_machine=m68k-apple
|
||||
;;
|
||||
pmac | pmac-mpw)
|
||||
basic_machine=powerpc-apple
|
||||
;;
|
||||
c4x*)
|
||||
basic_machine=c4x-none
|
||||
os=-coff
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
@@ -724,14 +902,21 @@ case $os in
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \
|
||||
| -openstep* | -mpeix* | -oskit*)
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
|
||||
;;
|
||||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
@@ -756,6 +941,9 @@ case $os in
|
||||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-386bsd)
|
||||
os=-bsd
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
@@ -787,9 +975,18 @@ case $os in
|
||||
# This must come after -sysvr4.
|
||||
-sysv*)
|
||||
;;
|
||||
-ose*)
|
||||
os=-ose
|
||||
;;
|
||||
-es1800*)
|
||||
os=-ose
|
||||
;;
|
||||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-*mint | -*MiNT)
|
||||
os=-mint
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
@@ -839,6 +1036,15 @@ case $basic_machine in
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mips*-cisco)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
@@ -851,6 +1057,15 @@ case $basic_machine in
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-wec)
|
||||
os=-proelf
|
||||
;;
|
||||
*-winbond)
|
||||
os=-proelf
|
||||
;;
|
||||
*-oki)
|
||||
os=-proelf
|
||||
;;
|
||||
*-hp)
|
||||
os=-hpux
|
||||
;;
|
||||
@@ -914,6 +1129,18 @@ case $basic_machine in
|
||||
f301-fujitsu)
|
||||
os=-uxpv
|
||||
;;
|
||||
*-rom68k)
|
||||
os=-coff
|
||||
;;
|
||||
*-*bug)
|
||||
os=-coff
|
||||
;;
|
||||
*-apple)
|
||||
os=-macos
|
||||
;;
|
||||
*-atari*)
|
||||
os=-mint
|
||||
;;
|
||||
*)
|
||||
os=-none
|
||||
;;
|
||||
@@ -935,10 +1162,10 @@ case $basic_machine in
|
||||
-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-hpux*)
|
||||
vendor=hp
|
||||
-beos*)
|
||||
vendor=be
|
||||
;;
|
||||
-mpeix*)
|
||||
-hpux*)
|
||||
vendor=hp
|
||||
;;
|
||||
-mpeix*)
|
||||
@@ -971,6 +1198,15 @@ case $basic_machine in
|
||||
-aux*)
|
||||
vendor=apple
|
||||
;;
|
||||
-hms*)
|
||||
vendor=hitachi
|
||||
;;
|
||||
-mpw* | -macos*)
|
||||
vendor=apple
|
||||
;;
|
||||
-*mint | -*MiNT)
|
||||
vendor=atari
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
|
||||
+239
-428
@@ -1,37 +1,20 @@
|
||||
dnl $Id$ -*- sh -*-
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl ## $Id$ -*- sh -*-
|
||||
dnl ## Process this file with autoconf to produce a configure script.
|
||||
|
||||
divert(0)
|
||||
|
||||
AC_INIT(main.c)
|
||||
recurse=yes
|
||||
for arg in $@; do
|
||||
case $arg in
|
||||
## This is to prevent "./config.status --recheck" from
|
||||
## running configure in libzend again.
|
||||
--no-recursion) recurse=no;;
|
||||
--enable-thread-safety) threadsafe=yes;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
|
||||
echo ""
|
||||
echo "ERROR: --with-shared-apache is not supported."
|
||||
echo " Please read INSTALL.DSO for instructions on using APXS."
|
||||
exit 1
|
||||
AC_MSG_ERROR(--with-shared-apache is not supported. Please refer to the documentation for using APXS)
|
||||
fi
|
||||
|
||||
if test -n "$with_apache" && test -n "$with_apxs"; then
|
||||
AC_MSG_ERROR(--with-apache and --with-apxs cannot be used together)
|
||||
fi
|
||||
|
||||
cwd=`pwd`
|
||||
cachefile=$cwd/config.cache
|
||||
|
||||
if test "$recurse" = "yes"; then
|
||||
(set -x; test -d libzend || mkdir libzend ; cd libzend; $cwd/$srcdir/libzend/configure --cache-file=$cachefile $@)
|
||||
if test "$threadsafe" = "yes"; then
|
||||
(set -x; test -d TSRM || mkdir TSRM; cd TSRM; $cwd/$srcdir/TSRM/configure --cache-file=$cachefile $@)
|
||||
fi
|
||||
fi
|
||||
|
||||
(set -x; cd $srcdir; ./ltconfig --disable-static --enable-dlopen --cache-file=$cachefile ltmain.sh)
|
||||
passthru="$@"
|
||||
|
||||
dnl ## Diversion 1 is the initial checking of OS features, programs,
|
||||
dnl ## libraries and so on.
|
||||
@@ -39,7 +22,7 @@ dnl ## libraries and so on.
|
||||
dnl ## In diversion 2 we check for compile-time options to the PHP
|
||||
dnl ## core and how to deal with different system dependencies. This
|
||||
dnl ## includes what regex library is used and whether debugging or short
|
||||
dnl ## tags are enabled, and the default behaviour of php3.ini options.
|
||||
dnl ## tags are enabled, and the default behaviour of php.ini options.
|
||||
dnl ## This is also where an SAPI interface is selected (choosing between
|
||||
dnl ## Apache module, CGI etc.)
|
||||
|
||||
@@ -51,9 +34,7 @@ dnl ## Diversion 4 is the last one. Here we generate files and clean up.
|
||||
divert(1)
|
||||
|
||||
dnl ## This is where the version number is changed from now on!
|
||||
AM_INIT_AUTOMAKE(php, 4.0b2-dev)
|
||||
|
||||
|
||||
AM_INIT_AUTOMAKE(php, 4.0b3)
|
||||
|
||||
PHP_VERSION=$VERSION
|
||||
echo "/* automatically generated by configure */" > php_version.h.new
|
||||
@@ -71,24 +52,28 @@ AC_SUBST(PHP_VERSION)
|
||||
AM_CONFIG_HEADER(php_config.h)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
phplibdir=$libdir/php
|
||||
AC_SUBST(phplibdir)
|
||||
|
||||
dnl We want this one before the checks, so the checks can modify CFLAGS.
|
||||
test -z "$CFLAGS" && auto_cflags=1
|
||||
|
||||
dnl If we're using cc on HP-UX, add the -Ae to CFLAGS
|
||||
if test -n "$auto_cflags" && test "`uname -s 2>/dev/null`" = "HP-UX"; then
|
||||
test -n "$GCC" || CFLAGS="-Ae $CFLAGS -D_HPUX_SOURCE"
|
||||
fi
|
||||
dnl If we're using cc on HP-UX, add -Ae -D_HPUX_SOURCE [obsolete]
|
||||
dnl if test -n "$auto_cflags" && test "`uname -s 2>/dev/null`" = "HP-UX"; then
|
||||
dnl test -n "$GCC" || CFLAGS="-Ae $CFLAGS -D_HPUX_SOURCE"
|
||||
dnl fi
|
||||
|
||||
dnl Checks for programs.
|
||||
AM_PROG_LIBTOOL
|
||||
AC_PROG_YACC
|
||||
if test "$YACC" != "bison -y"; then
|
||||
AC_MSG_WARN(You will need bison if you want to regenerate the PHP parsers.)
|
||||
else
|
||||
AC_MSG_CHECKING(bison version)
|
||||
set `$YACC --version| sed -e 's/^GNU Bison version //' -e 's/\./ /'`
|
||||
oldIFS=$IFS; IFS=.
|
||||
set `bison -V | sed -e 's/^GNU Bison version //'`
|
||||
IFS=$oldIFS
|
||||
if test "$1" = "1" -a "$2" -lt "25"; then
|
||||
AC_MSG_WARN(You will need bison 1.25 if you want to regenerate the PHP parsers (found $1.$2).)
|
||||
AC_MSG_WARN(Bison 1.25 or newer needed to regenerate parsers (found $1.$2).)
|
||||
fi
|
||||
AC_MSG_RESULT($1.$2 (ok))
|
||||
fi
|
||||
@@ -98,11 +83,14 @@ dnl## OLDLIBS=$LIBS; LIBS=""
|
||||
AC_PROG_CC
|
||||
dnl## LIBS=$OLDLIBS
|
||||
|
||||
AM_PROG_CC_STDC
|
||||
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_CC_C_O
|
||||
AC_PROG_LN_S
|
||||
AC_PATH_PROG(PERL_PATH, perl)
|
||||
|
||||
AM_PROG_LEX
|
||||
|
||||
dnl Make flex scanners use const if they can, even if __STDC__ is not
|
||||
dnl true, for compilers like Sun's that only set __STDC__ true in
|
||||
@@ -119,11 +107,6 @@ if test "$ac_cv_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then
|
||||
CPPFLAGS="$CPPFLAGS -traditional-cpp"
|
||||
fi
|
||||
|
||||
if test "`uname -sv`" = "AIX 4" -a "$GCC" != "yes"; then
|
||||
APXS_EXP="-bE:mod_php4.exp"
|
||||
fi
|
||||
AC_SUBST(APXS_EXP)
|
||||
|
||||
dnl Ugly hack to get around a problem with gcc on AIX.
|
||||
if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \
|
||||
"`uname -sv`" = "AIX 4"; then
|
||||
@@ -140,8 +123,6 @@ AC_CACHE_VAL(php_cv_cc_dashr,[
|
||||
AC_MSG_RESULT($php_cv_cc_dashr)
|
||||
if test $php_cv_cc_dashr = "yes"; then
|
||||
ld_runpath_switch="-R"
|
||||
raw_runpath_switch="-R"
|
||||
apxs_runpath_switch="-Wl,-R'"
|
||||
else
|
||||
AC_MSG_CHECKING([if compiler supports -Wl,-rpath,])
|
||||
AC_CACHE_VAL(php_cv_cc_rpath,[
|
||||
@@ -152,36 +133,12 @@ else
|
||||
AC_MSG_RESULT($php_cv_cc_rpath)
|
||||
if test $php_cv_cc_rpath = "yes"; then
|
||||
ld_runpath_switch="-Wl,-rpath,"
|
||||
raw_runpath_switch="-rpath "
|
||||
apxs_runpath_switch="-Wl,'-rpath "
|
||||
else
|
||||
dnl something innocuous
|
||||
ld_runpath_switch="-L"
|
||||
raw_runpath_switch="-L"
|
||||
apxs_runpath_switch="-L'"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
dnl Check compiler support for -rdynamic
|
||||
AC_MSG_CHECKING(if compiler supports -rdynamic)
|
||||
AC_CACHE_VAL(php_cc_rdynamic,[
|
||||
SAVE_LIBS="${LIBS}"
|
||||
LIBS="-rdynamic ${LIBS}"
|
||||
AC_TRY_LINK([], [], php_cc_rdynamic=yes, php_cc_rdynamic=no)
|
||||
LIBS="${SAVE_LIBS}"])
|
||||
AC_MSG_RESULT($php_cc_rdynamic)
|
||||
if test $php_cc_rdynamic = "yes"; then
|
||||
AC_CHECK_CC_OPTION(rdynamic)
|
||||
fi
|
||||
if test $php_cc_rdynamic = "yes"; then
|
||||
LDFLAGS="${LDFLAGS} -rdynamic"
|
||||
RDYNAMIC_LFLAGS="-rdynamic"
|
||||
else
|
||||
RDYNAMIC_LFLAGS=""
|
||||
fi
|
||||
AC_SUBST(RDYNAMIC_LFLAGS)
|
||||
|
||||
dnl AC_PROG_INSTALL
|
||||
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
|
||||
@@ -197,32 +154,28 @@ if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
|
||||
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
|
||||
fi
|
||||
|
||||
INCLUDES="-I\$(top_builddir)/libzend -I\$(top_builddir)/TSRM"
|
||||
INCLUDES="-I\$(top_builddir)/libzend -I\$(top_srcdir) -I\$(top_srcdir)/libzend"
|
||||
AC_SUBST(INCLUDES)
|
||||
|
||||
AC_CHECK_LIB(nsl, gethostname, [
|
||||
LIBS="-lnsl $LIBS"
|
||||
AC_DEFINE(HAVE_LIBNSL) ], [])
|
||||
AC_ADD_LIBRARY(nsl)
|
||||
AC_DEFINE(HAVE_LIBNSL) ], [])
|
||||
|
||||
AC_CHECK_LIB(c, socket, [:], [
|
||||
AC_CHECK_LIB(socket, socket, [
|
||||
LIBS="-lsocket $LIBS"
|
||||
AC_DEFINE(HAVE_LIBSOCKET) ], []) ])
|
||||
AC_CHECK_LIB(socket, socket, [
|
||||
AC_ADD_LIBRARY(socket)
|
||||
AC_DEFINE(HAVE_LIBSOCKET) ], [])
|
||||
|
||||
AC_CHECK_LIB(c, gethostbyaddr, [:], [
|
||||
AC_CHECK_LIB(nsl, gethostbyaddr, [
|
||||
LIBS="-lnsl $LIBS"
|
||||
AC_DEFINE(HAVE_LIBNSL) ], []) ])
|
||||
AC_CHECK_LIB(nsl, gethostbyaddr, [
|
||||
AC_ADD_LIBRARY(nsl)
|
||||
AC_DEFINE(HAVE_LIBNSL) ], [])
|
||||
|
||||
AC_CHECK_LIB(c, crypt, [:], [
|
||||
AC_CHECK_LIB(crypt, crypt, [
|
||||
LIBS="-lcrypt $LIBS"
|
||||
AC_DEFINE(HAVE_LIBCRYPT) ], []) ])
|
||||
AC_CHECK_LIB(crypt, crypt, [
|
||||
AC_ADD_LIBRARY(crypt)
|
||||
AC_DEFINE(HAVE_LIBCRYPT) ], [])
|
||||
|
||||
dnl The sin may be in a library which need not be specifed
|
||||
dnl as well as res_search resides in libsocket
|
||||
AC_CHECK_LIB(c, sin, [:], [
|
||||
AC_CHECK_LIB(m, sin) ])
|
||||
AC_CHECK_LIB(m, sin)
|
||||
|
||||
dnl The res_search may be in libsocket as well, and if it is
|
||||
dnl make sure to check for dn_skipname in libresolv, or if res_search
|
||||
@@ -252,7 +205,35 @@ else
|
||||
fi
|
||||
AC_MISSING_FCLOSE_DECL
|
||||
dnl QNX requires unix.h to allow functions in libunix to work properly
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h crypt.h sys/file.h memory.h pwd.h grp.h sys/socket.h sys/wait.h syslog.h string.h sys/varargs.h stdarg.h sys/time.h signal.h netinet/in.h dlfcn.h limits.h sys/types.h unix.h arpa/inet.h locale.h)
|
||||
AC_CHECK_HEADERS(
|
||||
arpa/inet.h \
|
||||
crypt.h \
|
||||
dlfcn.h \
|
||||
fcntl.h \
|
||||
grp.h \
|
||||
limits.h \
|
||||
locale.h \
|
||||
memory.h \
|
||||
netinet/in.h \
|
||||
pwd.h \
|
||||
signal.h \
|
||||
stdarg.h \
|
||||
stdlib.h \
|
||||
string.h \
|
||||
sys/file.h \
|
||||
sys/mman.h \
|
||||
sys/select.h \
|
||||
sys/socket.h \
|
||||
sys/statfs.h \
|
||||
sys/statvfs.h \
|
||||
sys/time.h \
|
||||
sys/types.h \
|
||||
sys/varargs.h \
|
||||
sys/wait.h \
|
||||
syslog.h \
|
||||
unistd.h \
|
||||
unix.h \
|
||||
)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_STRUCT_TM
|
||||
@@ -310,7 +291,51 @@ AC_CHECK_TYPE( ulong, unsigned long )
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr flock lockf putenv tempnam usleep setlocale gettimeofday setvbuf srand48 lrand48 srandom random link symlink regcomp getlogin cuserid vsnprintf snprintf gcvt utime crypt rint unsetenv strftime setsockopt tzset shutdown inet_aton)
|
||||
AC_CHECK_FUNCS(
|
||||
crypt \
|
||||
cuserid \
|
||||
flock \
|
||||
gcvt \
|
||||
getlogin \
|
||||
gethostbyaddr \
|
||||
gettimeofday \
|
||||
inet_aton \
|
||||
link \
|
||||
lockf \
|
||||
lrand48 \
|
||||
memcpy \
|
||||
memmove \
|
||||
mmap \
|
||||
putenv \
|
||||
random \
|
||||
regcomp \
|
||||
rint \
|
||||
setitimer \
|
||||
setlocale \
|
||||
setsockopt \
|
||||
setvbuf \
|
||||
shutdown \
|
||||
sin \
|
||||
snprintf \
|
||||
srand48 \
|
||||
srandom \
|
||||
statfs \
|
||||
statvfs \
|
||||
strcasecmp \
|
||||
strdup \
|
||||
strerror \
|
||||
strftime \
|
||||
strstr \
|
||||
symlink \
|
||||
tempnam \
|
||||
tzset \
|
||||
unsetenv \
|
||||
usleep \
|
||||
utime \
|
||||
vsnprintf \
|
||||
)
|
||||
|
||||
AC_REPLACE_FUNCS(strlcat strlcpy)
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_FUNC_ALLOCA
|
||||
dnl## OLDLIBS=$LIBS; LIBS=""
|
||||
@@ -347,259 +372,23 @@ abs_builddir=`pwd`
|
||||
AC_SUBST(abs_srcdir)
|
||||
AC_SUBST(abs_builddir)
|
||||
|
||||
AC_MSG_CHECKING(for Apache module support via DSO through APXS)
|
||||
AC_ARG_WITH(apxs,
|
||||
[ --with-apxs[=FILE] Build shared Apache module. FILE is the optional
|
||||
pathname to the Apache apxs tool; defaults to "apxs".
|
||||
(This option needs Perl installed)],
|
||||
RESULT=no
|
||||
AC_MSG_CHECKING(whether to enable versioning)
|
||||
AC_ARG_ENABLE(versioning,
|
||||
[ --enable-versioning Take advantage of versioning and scoping.
|
||||
See INSTALL for more information],
|
||||
[
|
||||
if test "$withval" = "yes"; then
|
||||
withval=apxs
|
||||
fi
|
||||
AC_EXPAND_PATH($withval, APXS)
|
||||
APXS_LDFLAGS="@SYBASE_LFLAGS@ @SYBASE_LIBS@ @SYBASE_CT_LFLAGS@ @SYBASE_CT_LIBS@"
|
||||
APACHE_INCLUDE="-I`$APXS -q INCLUDEDIR`"
|
||||
BINNAME=libphp4.so
|
||||
INSTALL_IT="\$(APXS) -i -a -n php4 $BINNAME"
|
||||
CFLAGS_SHLIB=`perl -V:cccdlflags | cut -d\' -f2`
|
||||
LDFLAGS_SHLIB=`perl -V:lddlflags | cut -d\' -f2`
|
||||
LDFLAGS_SHLIB_EXPORT=`perl -V:ccdlflags | cut -d\' -f2`
|
||||
PHP_LIBS=
|
||||
STRONGHOLD=
|
||||
INCLUDES="$INCLUDES $APACHE_INCLUDE"
|
||||
AC_DEFINE(APACHE)
|
||||
AC_SUBST(APXS)
|
||||
AC_SUBST(APXS_LDFLAGS)
|
||||
AC_SUBST(BINNAME)
|
||||
AC_SUBST(INSTALL_IT)
|
||||
AC_SUBST(PHP_LIBS)
|
||||
AC_SUBST(APACHE_INCLUDE)
|
||||
AC_DEFINE(HAVE_AP_CONFIG_H)
|
||||
AC_DEFINE(HAVE_AP_COMPAT_H)
|
||||
AC_MSG_RESULT(yes)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$enableval" = "yes" ; then
|
||||
EXTRA_LDFLAGS="-export-symbols \$(srcdir)/php.sym"
|
||||
RESULT="yes"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
APACHE_INSTALL_FILES="$srcdir/mod_php4.* libphp4.module"
|
||||
|
||||
if test "$BINNAME" != "libmodphp4-so.a"; then
|
||||
if test "$BINNAME" != "libphp4.so"; then
|
||||
AC_MSG_CHECKING(for Apache module support)
|
||||
AC_ARG_WITH(apache,
|
||||
[ --with-apache[=DIR] Build Apache module. DIR is the top-level Apache
|
||||
build directory, defaults to /usr/local/etc/httpd.],
|
||||
[
|
||||
if test "$withval" = "yes"; then
|
||||
# Apache's default directory
|
||||
withval=/usr/local/etc/httpd
|
||||
fi
|
||||
if test "$withval" != "no"; then
|
||||
rpath_raw=yes
|
||||
# For Apache 1.2.x
|
||||
AC_EXPAND_PATH($withval, withval)
|
||||
if test -f $withval/src/httpd.h; then
|
||||
APACHE_INCLUDE=-I$withval/src
|
||||
APACHE_TARGET=$withval/src
|
||||
BINNAME=libphp4.a
|
||||
INSTALL_IT="mkdir -p $APACHE_TARGET; cp $BINNAME $APACHE_INSTALL_FILES $APACHE_TARGET"
|
||||
PHP_LIBS="-L. -lphp3"
|
||||
AC_DEFINE(APACHE)
|
||||
AC_MSG_RESULT(yes - Apache 1.2.x)
|
||||
STRONGHOLD=
|
||||
if test -f $withval/src/ap_config.h; then
|
||||
AC_DEFINE(HAVE_AP_CONFIG_H)
|
||||
fi
|
||||
# For Apache 1.3.x
|
||||
elif test -f $withval/src/main/httpd.h; then
|
||||
APACHE_INCLUDE="-I$withval/src/main -I$withval/src/os/unix -I$withval/src/ap"
|
||||
APACHE_TARGET=$withval/src/modules/php4
|
||||
if test ! -d $APACHE_TARGET; then
|
||||
mkdir $APACHE_TARGET
|
||||
fi
|
||||
BINNAME=libmodphp4.a
|
||||
INSTALL_IT="mkdir -p $APACHE_TARGET; cp $BINNAME $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
|
||||
PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
|
||||
AC_DEFINE(APACHE)
|
||||
AC_MSG_RESULT(yes - Apache 1.3.x)
|
||||
STRONGHOLD=
|
||||
if test -f $withval/src/include/ap_config.h; then
|
||||
AC_DEFINE(HAVE_AP_CONFIG_H)
|
||||
fi
|
||||
if test -f $withval/src/include/ap_compat.h; then
|
||||
AC_DEFINE(HAVE_AP_COMPAT_H)
|
||||
if test ! -f $withval/src/include/ap_config_auto.h; then
|
||||
AC_MSG_ERROR(Please run Apache's configure or src/Configure program once and try again)
|
||||
fi
|
||||
else
|
||||
if test -f $withval/src/include/compat.h; then
|
||||
AC_DEFINE(HAVE_OLD_COMPAT_H)
|
||||
fi
|
||||
fi
|
||||
# Also for Apache 1.3.x
|
||||
elif test -f $withval/src/include/httpd.h; then
|
||||
APACHE_INCLUDE="-I$withval/src/include -I$withval/src/os/unix"
|
||||
APACHE_TARGET=$withval/src/modules/php4
|
||||
if test ! -d $APACHE_TARGET; then
|
||||
mkdir $APACHE_TARGET
|
||||
fi
|
||||
BINNAME=libmodphp4.a
|
||||
PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
|
||||
INSTALL_IT="mkdir -p $APACHE_TARGET; cp $BINNAME $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
|
||||
AC_DEFINE(APACHE)
|
||||
AC_MSG_RESULT(yes - Apache 1.3.x)
|
||||
STRONGHOLD=
|
||||
if test -f $withval/src/include/ap_config.h; then
|
||||
AC_DEFINE(HAVE_AP_CONFIG_H)
|
||||
fi
|
||||
if test -f $withval/src/include/ap_compat.h; then
|
||||
AC_DEFINE(HAVE_AP_COMPAT_H)
|
||||
if test ! -f $withval/src/include/ap_config_auto.h; then
|
||||
AC_MSG_ERROR(Please run Apache's configure or src/Configure program once and try again)
|
||||
fi
|
||||
else
|
||||
if test -f $withval/src/include/compat.h; then
|
||||
AC_DEFINE(HAVE_OLD_COMPAT_H)
|
||||
fi
|
||||
fi
|
||||
# For StrongHold 2.2
|
||||
elif test -f $withval/apache/httpd.h; then
|
||||
APACHE_INCLUDE=-"I$withval/apache -I$withval/ssl/include"
|
||||
APACHE_TARGET=$withval/apache
|
||||
BINNAME=libmodphp4.a
|
||||
PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
|
||||
INSTALL_IT="mkdir -p $APACHE_TARGET; cp $BINNAME $APACHE_INSTALL_FILES $APACHE_TARGET"
|
||||
STRONGHOLD=-DSTRONGHOLD=1
|
||||
AC_DEFINE(APACHE)
|
||||
AC_MSG_RESULT(yes - StrongHold)
|
||||
if test -f $withval/apache/ap_config.h; then
|
||||
AC_DEFINE(HAVE_AP_CONFIG_H)
|
||||
fi
|
||||
if test -f $withval/src/ap_compat.h; then
|
||||
AC_DEFINE(HAVE_AP_COMPAT_H)
|
||||
if test ! -f $withval/src/include/ap_config_auto.h; then
|
||||
AC_MSG_ERROR(Please run Apache's configure or src/Configure program once and try again)
|
||||
fi
|
||||
else
|
||||
if test -f $withval/src/compat.h; then
|
||||
AC_DEFINE(HAVE_OLD_COMPAT_H)
|
||||
fi
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Invalid Apache directory - unable to find httpd.h under $withval)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
BINNAME=php
|
||||
INSTALL_IT="cp $BINNAME \$(bindir)"
|
||||
fi
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
BINNAME=php
|
||||
INSTALL_IT="cp $BINNAME \$(bindir)"
|
||||
])
|
||||
INCLUDES="$INCLUDES $APACHE_INCLUDE"
|
||||
dnl## AC_SUBST(APACHE_INCLUDE)
|
||||
AC_SUBST(APACHE_TARGET)
|
||||
AC_SUBST(INSTALL_IT)
|
||||
AC_SUBST(BINNAME)
|
||||
AC_SUBST(STRONGHOLD)
|
||||
AC_SUBST(PHP_LIBS)
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether to use bundled regex library)
|
||||
AC_ARG_WITH(system-regex,
|
||||
[ --with-system-regex Do not use the bundled regex library],
|
||||
[
|
||||
if test -n "$APXS"; then
|
||||
if test -n "`$APXS -q CFLAGS | grep USE_HSREGEX`"; then
|
||||
HSREGEX=yes
|
||||
else
|
||||
HSREGEX=no
|
||||
fi
|
||||
else
|
||||
if test "$withval" = "no"; then
|
||||
HSREGEX=yes
|
||||
else
|
||||
HSREGEX=no
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
if test -n "$APXS"; then
|
||||
if test -n "`$APXS -q CFLAGS | grep USE_HSREGEX`"; then
|
||||
HSREGEX=yes
|
||||
else
|
||||
HSREGEX=no
|
||||
fi
|
||||
else
|
||||
HSREGEX=yes
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT($HSREGEX)
|
||||
|
||||
if test "$HSREGEX" = "yes"; then
|
||||
REGEX_LIB=regex/libregex.a
|
||||
EXTRA_LIBS="-L$abs_builddir/regex -lregex $EXTRA_LIBS"
|
||||
AC_DEFINE(HSREGEX)
|
||||
AC_DEFINE(REGEX,1)
|
||||
else
|
||||
REGEX_LIB=
|
||||
AC_DEFINE(REGEX,0)
|
||||
fi
|
||||
|
||||
AC_SUBST(REGEX_LIB)
|
||||
AC_SUBST(HSREGEX)
|
||||
|
||||
AC_MSG_CHECKING(for mod_charset compatibility option)
|
||||
AC_ARG_WITH(mod_charset,
|
||||
[ --with-mod_charset Enable transfer tables for mod_charset (Rus Apache).],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_TRANSFER_TABLES)
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(for fhttpd module support)
|
||||
AC_ARG_WITH(fhttpd,
|
||||
[ --with-fhttpd[=DIR] Build fhttpd module. DIR is the fhttpd sources
|
||||
directory, defaults to /usr/local/src/fhttpd.],
|
||||
[
|
||||
if test "$withval" = "yes"; then
|
||||
# fhttpd source directory
|
||||
withval=/usr/local/src/fhttpd
|
||||
fi
|
||||
if test "$withval" != "no"; then
|
||||
# For fhttpd 0.3.x
|
||||
if test -f $withval/servproc.h; then
|
||||
FHTTPD_INCLUDE=-I$withval/
|
||||
FHTTPD_LIB=$withval/servproc.o
|
||||
FHTTPD_TARGET=$withval/
|
||||
BINNAME=php
|
||||
AC_DEFINE(FHTTPD)
|
||||
AC_MSG_RESULT(yes - fhttpd 0.3.x)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Invalid fhttpd directory - unable to find servproc.h under $withval)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
INCLUDES="$INCLUDES $FHTTPD_INCLUDE"
|
||||
dnl## AC_SUBST(FHTTPD_INCLUDE)
|
||||
AC_SUBST(FHTTPD_LIB)
|
||||
AC_SUBST(FHTTPD_TARGET)
|
||||
|
||||
AC_MSG_RESULT($RESULT)
|
||||
|
||||
AC_MSG_CHECKING(whether to use a configuration file)
|
||||
AC_ARG_WITH(config-file-path,
|
||||
[ --with-config-file-path=PATH Sets the path in which to look for php3.ini
|
||||
[ --with-config-file-path=PATH
|
||||
Sets the path in which to look for php.ini.
|
||||
defaults to /usr/local/lib],
|
||||
[
|
||||
if test "$withval" = "yes"; then
|
||||
@@ -727,78 +516,20 @@ AC_ARG_ENABLE(magic-quotes,
|
||||
])
|
||||
|
||||
|
||||
AC_MSG_CHECKING(whether to build PHP thread-safe)
|
||||
AC_ARG_ENABLE(thread-safety,
|
||||
[ --enable-thread-safety Whether to build PHP thread-safe.],[
|
||||
TSRM_LIB='TSRM/libtsrm.a'
|
||||
TSRM_DIR=TSRM
|
||||
AC_DEFINE(ZTS)
|
||||
AC_MSG_CHECKING(whether to enable runpaths)
|
||||
AC_ARG_ENABLE(rpath,
|
||||
[ --disable-rpath Disable passing additional runtime library
|
||||
search paths],
|
||||
[
|
||||
if test "$enableval" = "no"; then
|
||||
enable_rpath=no
|
||||
else
|
||||
enable_rpath=yes
|
||||
fi
|
||||
],[
|
||||
TSRM_DIR=""
|
||||
enable_rpath=yes
|
||||
])
|
||||
AC_SUBST(TSRM_DIR)
|
||||
AC_SUBST(TSRM_LIB)
|
||||
|
||||
dnl AC_MSG_CHECKING(whether to enable PHP RPC support)
|
||||
dnl AC_ARG_ENABLE(php-rpc,
|
||||
dnl [ --enable-php-rpc Compile with PHP RPC support.],
|
||||
dnl [
|
||||
dnl if test "$enableval" = "yes"; then
|
||||
dnl AC_DEFINE(PHP_RPC, 1)
|
||||
dnl AC_MSG_RESULT(yes)
|
||||
dnl else
|
||||
dnl AC_DEFINE(PHP_RPC, 0)
|
||||
dnl AC_MSG_RESULT(no)
|
||||
dnl fi
|
||||
dnl ],[
|
||||
dnl AC_DEFINE(PHP_RPC, 0)
|
||||
dnl AC_MSG_RESULT(no)
|
||||
dnl ])
|
||||
|
||||
if test "$BINNAME" = "php"; then
|
||||
AC_MSG_CHECKING(whether to force Apache CGI redirect)
|
||||
AC_ARG_ENABLE(force-cgi-redirect,
|
||||
[ --enable-force-cgi-redirect Enable the security check for internal server
|
||||
redirects. You should use this if you are
|
||||
running the CGI version with Apache. ],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(FORCE_CGI_REDIRECT, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
REDIRECT=1
|
||||
else
|
||||
AC_DEFINE(FORCE_CGI_REDIRECT, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
REDIRECT=0
|
||||
fi
|
||||
],[
|
||||
AC_DEFINE(FORCE_CGI_REDIRECT, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
REDIRECT=0
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether to discard path_info + path_translated)
|
||||
AC_ARG_ENABLE(discard_path,
|
||||
[ --enable-discard-path If this is enabled, the PHP CGI binary
|
||||
can safely be placed outside of the
|
||||
web tree and people will not be able
|
||||
to circumvent .htaccess security. ],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(DISCARD_PATH, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
DISCARD_PATH=1
|
||||
else
|
||||
AC_DEFINE(DISCARD_PATH, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
DISCARD_PATH=0
|
||||
fi
|
||||
],[
|
||||
AC_DEFINE(DISCARD_PATH, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
DISCARD_PATH=0
|
||||
])
|
||||
fi
|
||||
AC_MSG_RESULT($enable_rpath)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable short tags by default)
|
||||
AC_ARG_ENABLE(short-tags,
|
||||
@@ -818,8 +549,9 @@ AC_ARG_ENABLE(short-tags,
|
||||
|
||||
AC_MSG_CHECKING(whether to enable the URL-aware fopen wrapper)
|
||||
AC_ARG_ENABLE(url-fopen-wrapper,
|
||||
[ --disable-url-fopen-wrapper Disable the URL-aware fopen wrapper that allows
|
||||
accessing files via http or ftp.],
|
||||
[ --disable-url-fopen-wrapper
|
||||
Disable the URL-aware fopen wrapper that allows
|
||||
accessing files via http or ftp.],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(PHP3_URL_FOPEN, 1)
|
||||
@@ -836,7 +568,7 @@ AC_ARG_ENABLE(url-fopen-wrapper,
|
||||
DMALLOC_RESULT=no
|
||||
AC_MSG_CHECKING(whether to enable dmalloc)
|
||||
AC_ARG_ENABLE(dmalloc,
|
||||
[ --enable-dmalloc Enable dmalloc],
|
||||
[ --enable-dmalloc Enable dmalloc],
|
||||
[
|
||||
if test "$enableval" = "yes" ; then
|
||||
AC_DEFINE(HAVE_DMALLOC, 1)
|
||||
@@ -847,23 +579,81 @@ AC_ARG_ENABLE(dmalloc,
|
||||
])
|
||||
AC_MSG_RESULT($DMALLOC_RESULT)
|
||||
|
||||
dnl ## This is the default server API.
|
||||
PHP_SAPI=cgi
|
||||
PHP_BUILD_PROGRAM
|
||||
dnl paths to the targets relative to the build directory
|
||||
SAPI_PROGRAM=php
|
||||
SAPI_SHARED=libs/libphp4.so
|
||||
SAPI_STATIC=libs/libphp4.a
|
||||
|
||||
esyscmd(./scripts/config-stubs sapi)
|
||||
|
||||
divert(3)
|
||||
|
||||
AC_SUBST(EXTRA_LIBS)
|
||||
AC_SUBST(EXTRA_LDFLAGS)
|
||||
|
||||
# reading config stubs
|
||||
esyscmd(./scripts/config-stubs)
|
||||
esyscmd(./scripts/config-stubs ext)
|
||||
|
||||
PHP_OUTPUT(sapi/$PHP_SAPI/Makefile)
|
||||
|
||||
divert(4)
|
||||
|
||||
dnl If we're using gcc and the user hasn't specified CFLAGS, add -O2.
|
||||
enable_shared=yes
|
||||
enable_static=yes
|
||||
|
||||
case "$php_build_target" in
|
||||
program)
|
||||
enable_shared=no
|
||||
PHP_PROGRAM=php
|
||||
passthru="$passthru --disable-shared"
|
||||
;;
|
||||
shared)
|
||||
enable_static=no
|
||||
passthru="$passthru --disable-static"
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version"
|
||||
;;
|
||||
static)
|
||||
enable_shared=no
|
||||
passthru="$passthru --disable-shared"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
if test "$enable_debug" != "yes"; then
|
||||
AM_SET_LIBTOOL_VARIABLE([--silent])
|
||||
fi
|
||||
|
||||
PHP_REGEX
|
||||
|
||||
dnl If we are using gcc and the user has not specified CFLAGS, add -O2.
|
||||
test -n "$auto_cflags" && test -n "$GCC" && CFLAGS="$CFLAGS -O2"
|
||||
|
||||
dnl If we're using cc on HP-UX, add the -Ae to CFLAGS
|
||||
if test -n "$auto_cflags" && test "`uname -s 2>/dev/null`" = "HP-UX"; then
|
||||
test -n "$GCC" || CFLAGS="-Ae $CFLAGS"
|
||||
fi
|
||||
AC_MSG_CHECKING(whether to build PHP thread-safe)
|
||||
AC_ARG_ENABLE(thread-safety,
|
||||
[ --enable-thread-safety Whether to build PHP thread-safe.],[
|
||||
if test "$enableval" = "yes"; then
|
||||
TSRM_LIB='TSRM/libtsrm.la'
|
||||
TSRM_DIR=TSRM
|
||||
AC_DEFINE(ZTS)
|
||||
INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM -I\$(top_srcdir)/TSRM"
|
||||
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
|
||||
export CPPFLAGS
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
],[
|
||||
TSRM_DIR=""
|
||||
TSRM_LIB=""
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
AC_SUBST(TSRM_DIR)
|
||||
AC_SUBST(TSRM_LIB)
|
||||
|
||||
dnl *** Commented out - generates slow code and consumes a lot of
|
||||
dnl *** resources during compilation - we need to figure out how
|
||||
@@ -871,13 +661,23 @@ dnl *** to supply it only when absolutely necessary
|
||||
dnl If we are using gcc add -fpic to make dl() work on some platforms
|
||||
dnl test -n "$GCC" && CFLAGS="$CFLAGS -fpic"
|
||||
|
||||
dnl add -fPIC option on Solaris if we are building dynamic extensions
|
||||
dnl PHP_SOLARIS_PIC_WEIRDNESS
|
||||
|
||||
AC_BUILD_RPATH
|
||||
|
||||
phplibdir="`pwd`/modules"
|
||||
phptempdir="`pwd`/libs"
|
||||
AC_SUBST(phplibdir)
|
||||
AC_SUBST(phptempdir)
|
||||
EXTRA_LIBS="$LIBS $EXTRA_LIBS"
|
||||
LIBS=""
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(PROG_SENDMAIL)
|
||||
AC_SUBST(CFLAGS_SHLIB)
|
||||
AC_SUBST(LDFLAGS_SHLIB)
|
||||
AC_SUBST(LDFLAGS_SHLIB_EXPORT)
|
||||
AC_SUBST(RPATHS)
|
||||
AC_SUBST(RAW_RPATHS)
|
||||
AC_SUBST(PHP_RPATHS)
|
||||
AC_SUBST(NATIVE_RPATHS)
|
||||
AC_SUBST(PHP_PROGRAM)
|
||||
|
||||
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
|
||||
AC_SUBST(PHP_BUILD_DATE)
|
||||
@@ -887,10 +687,13 @@ AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME")
|
||||
PHP_OS=`uname`
|
||||
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS")
|
||||
|
||||
AC_OUTPUT(Makefile libphp4.module
|
||||
scripts/mkextlib regex/Makefile
|
||||
@@EXT_MAKEFILES@@ build-defs.h, [
|
||||
], [
|
||||
AC_SUBST(PHP_LIBS)
|
||||
AC_SUBST(PHP_SAPI)
|
||||
AC_SUBST(INSTALL_IT)
|
||||
|
||||
#libphp4.module
|
||||
AC_OUTPUT([Makefile php4.spec ext/Makefile sapi/Makefile $PHP_OUTPUT_FILES
|
||||
scripts/mkextlib regex/Makefile build-defs.h], [], [
|
||||
|
||||
if test ! -f $srcdir/ext/bcmath/number.c; then
|
||||
echo "creating number.c"
|
||||
@@ -899,8 +702,16 @@ if test ! -f $srcdir/ext/bcmath/number.c; then
|
||||
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h
|
||||
fi
|
||||
|
||||
if test "" = ""; then
|
||||
if test "$no_recursion" != "yes"; then
|
||||
(set -x; test -d libzend || mkdir libzend; cd libzend; $cwd/$srcdir/libzend/configure --cache-file=../$cache_file $passthru) || exit 1
|
||||
if test "$enable_thread_safety" = "yes"; then
|
||||
(set -x; test -d TSRM || mkdir TSRM; cd TSRM && $cwd/$srcdir/TSRM/configure --cache-file=../$cache_file $passthru) || exit 1
|
||||
fi
|
||||
dnl (set -x; cd $srcdir; sh ltconfig --disable-static --enable-dlopen --cache-file=$cache_file ltmain.sh)
|
||||
fi
|
||||
|
||||
# run this only when generating all the files?
|
||||
if true; then
|
||||
chmod +x scripts/mkextlib
|
||||
# Hacking while airborne considered harmful.
|
||||
#
|
||||
@@ -916,7 +727,7 @@ if test "" = ""; then
|
||||
fi
|
||||
|
||||
# Warn about CGI version with no extra security options.
|
||||
if test "$BINNAME" = "php"; then
|
||||
if test "$PHP_SAPI" = "cgi"; then
|
||||
if test "$REDIRECT" = "0"; then
|
||||
if test "$DISCARD_PATH" = "0"; then
|
||||
echo "+--------------------------------------------------------------------+"
|
||||
@@ -945,6 +756,6 @@ fi
|
||||
|
||||
divert
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 4
|
||||
# End:
|
||||
dnl ## Local Variables:
|
||||
dnl ## tab-width: 4
|
||||
dnl ## End:
|
||||
@@ -18,6 +18,9 @@
|
||||
* -----------------
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1 1999/07/19 18:58:44 andrey
|
||||
* Moving dlist stuff into core.
|
||||
*
|
||||
* Revision 1.2 1999/05/11 00:01:42 zeev
|
||||
* * Get Apache to work. POST doesn't work yet.
|
||||
* * There are now -I directives for the absolute path of php4, php4/libzend and the builddir for
|
||||
@@ -61,7 +64,7 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include "dlist.h"
|
||||
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = @EXT_SUBDIRS@
|
||||
EXT_STATIC = @EXT_STATIC@
|
||||
|
||||
noinst_LIBRARIES=libphpext.a
|
||||
|
||||
libphpext.a: @EXT_LIBS@
|
||||
top_srcdir=$(top_srcdir) $(top_builddir)/scripts/mkextlib $@ $(EXT_STATIC)
|
||||
-@test "`uname -s`" = "Rhapsody" && $(RANLIB) $@
|
||||
@@ -1,6 +1,5 @@
|
||||
# $Id$
|
||||
|
||||
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
|
||||
noinst_LIBRARIES=libphpext_apache.a
|
||||
libphpext_apache_a_SOURCES=apache.c
|
||||
noinst_LTLIBRARIES=libphpext_apache.la
|
||||
libphpext_apache_la_SOURCES=apache.c
|
||||
|
||||
+63
-59
@@ -24,7 +24,7 @@
|
||||
#include "php_globals.h"
|
||||
#include "php_ini.h"
|
||||
#include "SAPI.h"
|
||||
#include "mod_php4.h"
|
||||
#include "sapi/apache/mod_php4.h"
|
||||
#include "ext/standard/info.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -46,15 +46,16 @@ extern module *top_module;
|
||||
PHP_FUNCTION(virtual);
|
||||
PHP_FUNCTION(getallheaders);
|
||||
PHP_FUNCTION(apachelog);
|
||||
void php3_info_apache(ZEND_MODULE_INFO_FUNC_ARGS);
|
||||
PHP_FUNCTION(apache_note);
|
||||
PHP_FUNCTION(apache_lookup_uri);
|
||||
|
||||
PHP_MINFO_FUNCTION(apache);
|
||||
|
||||
function_entry apache_functions[] = {
|
||||
{"virtual", php3_virtual, NULL},
|
||||
{"getallheaders", php3_getallheaders, NULL},
|
||||
{"apache_note", php3_apache_note,NULL},
|
||||
{"apache_lookup_uri", php3_apache_lookup_uri,NULL},
|
||||
PHP_FE(virtual, NULL)
|
||||
PHP_FE(getallheaders, NULL)
|
||||
PHP_FE(apache_note, NULL)
|
||||
PHP_FE(apache_lookup_uri, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -98,14 +99,14 @@ PHP_INI_BEGIN()
|
||||
PHP_INI_END()
|
||||
|
||||
|
||||
static int php_apache_minit(INIT_FUNC_ARGS)
|
||||
static PHP_MINIT_FUNCTION(apache)
|
||||
{
|
||||
REGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static int php_apache_mshutdown(SHUTDOWN_FUNC_ARGS)
|
||||
static PHP_MSHUTDOWN_FUNCTION(apache)
|
||||
{
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
@@ -113,7 +114,7 @@ static int php_apache_mshutdown(SHUTDOWN_FUNC_ARGS)
|
||||
|
||||
|
||||
php3_module_entry apache_module_entry = {
|
||||
"Apache", apache_functions, php_apache_minit, php_apache_mshutdown, NULL, NULL, php3_info_apache, STANDARD_MODULE_PROPERTIES
|
||||
"Apache", apache_functions, PHP_MINIT(apache), PHP_MSHUTDOWN(apache), NULL, NULL, PHP_MINFO(apache), STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
/* {{{ proto string apache_note(string note_name [, string note_value])
|
||||
@@ -146,7 +147,7 @@ PHP_FUNCTION(apache_note)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void php3_info_apache(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
PHP_MINFO_FUNCTION(apache)
|
||||
{
|
||||
module *modp = NULL;
|
||||
char output_buf[128];
|
||||
@@ -164,6 +165,51 @@ void php3_info_apache(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
|
||||
serv = ((request_rec *) SG(server_context))->server;
|
||||
|
||||
PUTS("<table border=5 width=\"600\">\n");
|
||||
php_info_print_table_header(2, "Entry", "Value");
|
||||
#if WIN32|WINNT
|
||||
PUTS("Apache for Windows 95/NT<br>");
|
||||
#else
|
||||
php_info_print_table_row(2, "APACHE_INCLUDE", PHP_APACHE_INCLUDE);
|
||||
php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET);
|
||||
#endif
|
||||
php_info_print_table_row(2, "Apache Version", SERVER_VERSION);
|
||||
#ifdef APACHE_RELEASE
|
||||
sprintf(output_buf, "%d", APACHE_RELEASE);
|
||||
php_info_print_table_row(2, "Apache Release", output_buf);
|
||||
#endif
|
||||
sprintf(output_buf, "%d", MODULE_MAGIC_NUMBER);
|
||||
php_info_print_table_row(2, "Apache API Version", output_buf);
|
||||
sprintf(output_buf, "%s:%u", serv->server_hostname,serv->port);
|
||||
php_info_print_table_row(2, "Hostname/Port", output_buf);
|
||||
#if !defined(WIN32) && !defined(WINNT)
|
||||
sprintf(output_buf, "%s(%d)/%d", user_name,(int)user_id,(int)group_id);
|
||||
php_info_print_table_row(2, "User/Group", output_buf);
|
||||
sprintf(output_buf, "per child: %d<br>keep alive: %s<br>max per connection: %d",max_requests_per_child,serv->keep_alive ? "on":"off", serv->keep_alive_max);
|
||||
php_info_print_table_row(2, "Max Requests", output_buf);
|
||||
#endif
|
||||
sprintf(output_buf, "connection: %d<br>keep-alive: %d",serv->timeout,serv->keep_alive_timeout);
|
||||
php_info_print_table_row(2, "Timeouts", output_buf);
|
||||
#if !defined(WIN32) && !defined(WINNT)
|
||||
php_info_print_table_row(2, "Server Root", server_root);
|
||||
|
||||
|
||||
PUTS("<tr><td valign=\"top\" bgcolor=\"" PHP_ENTRY_NAME_COLOR "\">Loaded modules</td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">");
|
||||
for(modp = top_module; modp; modp = modp->next) {
|
||||
strlcpy(name, modp->name, sizeof(name));
|
||||
if ((p = strrchr(name, '.'))) {
|
||||
*p='\0'; /* Cut off ugly .c extensions on module names */
|
||||
}
|
||||
PUTS(name);
|
||||
if (modp->next) {
|
||||
PUTS(", ");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
PUTS("</td></tr>\n");
|
||||
PUTS("</table>\n");
|
||||
|
||||
|
||||
{
|
||||
register int i;
|
||||
array_header *arr;
|
||||
@@ -214,49 +260,6 @@ void php3_info_apache(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
PUTS("</table>\n\n");
|
||||
}
|
||||
|
||||
PUTS("<table border=5 width=\"600\">\n");
|
||||
php_info_print_table_header(2, "Entry", "Value");
|
||||
#if WIN32|WINNT
|
||||
PUTS("Apache for Windows 95/NT<br>");
|
||||
#else
|
||||
php_info_print_table_row(2, "APACHE_INCLUDE", PHP_APACHE_INCLUDE);
|
||||
php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET);
|
||||
#endif
|
||||
php_info_print_table_row(2, "Apache Version", SERVER_VERSION);
|
||||
#ifdef APACHE_RELEASE
|
||||
sprintf(output_buf, "%d", APACHE_RELEASE);
|
||||
php_info_print_table_row(2, "Apache Release", output_buf);
|
||||
#endif
|
||||
sprintf(output_buf, "%d", MODULE_MAGIC_NUMBER);
|
||||
php_info_print_table_row(2, "Apache API Version", output_buf);
|
||||
sprintf(output_buf, "%s:%u", serv->server_hostname,serv->port);
|
||||
php_info_print_table_row(2, "Hostname/Port", output_buf);
|
||||
#if !defined(WIN32) && !defined(WINNT)
|
||||
sprintf(output_buf, "%s(%d)/%d", user_name,(int)user_id,(int)group_id);
|
||||
php_info_print_table_row(2, "User/Group", output_buf);
|
||||
sprintf(output_buf, "per child: %d<br>keep alive: %s<br>max per connection: %d",max_requests_per_child,serv->keep_alive ? "on":"off", serv->keep_alive_max);
|
||||
php_info_print_table_row(2, "Max Requests", output_buf);
|
||||
#endif
|
||||
sprintf(output_buf, "connection: %d<br>keep-alive: %d",serv->timeout,serv->keep_alive_timeout);
|
||||
php_info_print_table_row(2, "Timeouts", output_buf);
|
||||
#if !defined(WIN32) && !defined(WINNT)
|
||||
php_info_print_table_row(2, "Server Root", server_root);
|
||||
|
||||
|
||||
PUTS("<tr><td valign=\"top\" bgcolor=\"" PHP_ENTRY_NAME_COLOR "\">Loaded modules</td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">");
|
||||
for(modp = top_module; modp; modp = modp->next) {
|
||||
strncpy(name, modp->name, sizeof(name) - 1);
|
||||
if ((p = strrchr(name, '.'))) {
|
||||
*p='\0'; /* Cut off ugly .c extensions on module names */
|
||||
}
|
||||
PUTS(name);
|
||||
if (modp->next) {
|
||||
PUTS(", ");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
PUTS("</td></tr>\n");
|
||||
PUTS("</table>\n");
|
||||
}
|
||||
|
||||
/* This function is equivalent to <!--#include virtual...-->
|
||||
@@ -281,13 +284,13 @@ PHP_FUNCTION(virtual)
|
||||
convert_to_string(filename);
|
||||
|
||||
if (!(rr = sub_req_lookup_uri (filename->value.str.val, ((request_rec *) SG(server_context))))) {
|
||||
php3_error(E_WARNING, "Unable to include '%s' - URI lookup failed", filename->value.str.val);
|
||||
php_error(E_WARNING, "Unable to include '%s' - URI lookup failed", filename->value.str.val);
|
||||
if (rr) destroy_sub_req (rr);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (rr->status != 200) {
|
||||
php3_error(E_WARNING, "Unable to include '%s' - error finding URI", filename->value.str.val);
|
||||
php_error(E_WARNING, "Unable to include '%s' - error finding URI", filename->value.str.val);
|
||||
if (rr) destroy_sub_req (rr);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -295,14 +298,14 @@ PHP_FUNCTION(virtual)
|
||||
/* Cannot include another PHP file because of global conflicts */
|
||||
if (rr->content_type &&
|
||||
!strcmp(rr->content_type, PHP3_MIME_TYPE)) {
|
||||
php3_error(E_WARNING, "Cannot include a PHP file "
|
||||
php_error(E_WARNING, "Cannot include a PHP file "
|
||||
"(use <code><?include \"%s\"></code> instead)", filename->value.str.val);
|
||||
if (rr) destroy_sub_req (rr);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (run_sub_req(rr)) {
|
||||
php3_error(E_WARNING, "Unable to include '%s' - request execution failed", filename->value.str.val);
|
||||
php_error(E_WARNING, "Unable to include '%s' - request execution failed", filename->value.str.val);
|
||||
if (rr) destroy_sub_req (rr);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
@@ -320,6 +323,7 @@ PHP_FUNCTION(getallheaders)
|
||||
table_entry *tenv;
|
||||
int i;
|
||||
SLS_FETCH();
|
||||
PLS_FETCH();
|
||||
|
||||
if (array_init(return_value) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
@@ -353,7 +357,7 @@ PHP_FUNCTION(apache_lookup_uri)
|
||||
convert_to_string(filename);
|
||||
|
||||
if(!(rr = sub_req_lookup_uri(filename->value.str.val, ((request_rec *) SG(server_context))))) {
|
||||
php3_error(E_WARNING, "URI lookup failed", filename->value.str.val);
|
||||
php_error(E_WARNING, "URI lookup failed", filename->value.str.val);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
object_init(return_value);
|
||||
@@ -427,7 +431,7 @@ PHP_FUNCTION(apache_exec_uri)
|
||||
convert_to_string(filename);
|
||||
|
||||
if(!(rr = ap_sub_req_lookup_uri(filename->value.str.val, ((request_rec *) SG(server_context))))) {
|
||||
php3_error(E_WARNING, "URI lookup failed", filename->value.str.val);
|
||||
php_error(E_WARNING, "URI lookup failed", filename->value.str.val);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETVAL_LONG(ap_run_sub_req(rr));
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
dnl $Id$
|
||||
|
||||
if test -n "$APACHE_INCLUDE"; then
|
||||
PHP_EXTENSION(apache)
|
||||
fi
|
||||
@@ -1,6 +1,5 @@
|
||||
# $Id$
|
||||
|
||||
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
|
||||
noinst_LIBRARIES=libphpext_aspell.a
|
||||
libphpext_aspell_a_SOURCES=aspell.c
|
||||
noinst_LTLIBRARIES=libphpext_aspell.la
|
||||
libphpext_aspell_la_SOURCES=aspell.c
|
||||
|
||||
+16
-15
@@ -37,17 +37,17 @@
|
||||
#include <aspell-c.h>
|
||||
|
||||
function_entry aspell_functions[] = {
|
||||
{"aspell_new", php3_aspell_new, NULL},
|
||||
{"aspell_check", php3_aspell_check, NULL},
|
||||
{"aspell_check_raw", php3_aspell_check_raw, NULL},
|
||||
{"aspell_suggest", php3_aspell_suggest, NULL},
|
||||
PHP_FE(aspell_new, NULL)
|
||||
PHP_FE(aspell_check, NULL)
|
||||
PHP_FE(aspell_check_raw, NULL)
|
||||
PHP_FE(aspell_suggest, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
static int le_aspell;
|
||||
|
||||
php3_module_entry aspell_module_entry = {
|
||||
"Aspell", aspell_functions, php3_minit_aspell, NULL, NULL, NULL, php3_info_aspell, STANDARD_MODULE_PROPERTIES
|
||||
"Aspell", aspell_functions, PHP_MINIT(aspell), NULL, NULL, NULL, PHP_MINFO(aspell), STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ php3_module_entry aspell_module_entry = {
|
||||
DLEXPORT php3_module_entry *get_module(void) { return &aspell_module_entry; }
|
||||
#endif
|
||||
|
||||
int php3_minit_aspell(INIT_FUNC_ARGS)
|
||||
PHP_MINIT_FUNCTION(aspell)
|
||||
{
|
||||
le_aspell = register_list_destructors(php3_aspell_close,NULL);
|
||||
return SUCCESS;
|
||||
@@ -68,7 +68,7 @@ void php3_aspell_close(aspell *sc)
|
||||
|
||||
/* {{{ proto int aspell_new(string master[, string personal])
|
||||
Load a dictionary */
|
||||
void php3_aspell_new(INTERNAL_FUNCTION_PARAMETERS)
|
||||
PHP_FUNCTION(aspell_new)
|
||||
{
|
||||
pval *master, *personal;
|
||||
int argc;
|
||||
@@ -93,9 +93,10 @@ void php3_aspell_new(INTERNAL_FUNCTION_PARAMETERS)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto array aspell_suggest(aspell int,string word)
|
||||
Return array of Suggestions */
|
||||
void php3_aspell_suggest(INTERNAL_FUNCTION_PARAMETERS)
|
||||
PHP_FUNCTION(aspell_suggest)
|
||||
{
|
||||
pval *scin, *word;
|
||||
int argc;
|
||||
@@ -114,7 +115,7 @@ void php3_aspell_suggest(INTERNAL_FUNCTION_PARAMETERS)
|
||||
sc= (aspell *) php3_list_find(scin->value.lval, &type);
|
||||
if(!sc)
|
||||
{
|
||||
php3_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);
|
||||
php_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -132,7 +133,7 @@ void php3_aspell_suggest(INTERNAL_FUNCTION_PARAMETERS)
|
||||
|
||||
/* {{{ proto int aspell_check(aspell int,string word)
|
||||
Return if word is valid */
|
||||
void php3_aspell_check(INTERNAL_FUNCTION_PARAMETERS)
|
||||
PHP_FUNCTION(aspell_check)
|
||||
{
|
||||
int type;
|
||||
pval *scin,*word;
|
||||
@@ -148,7 +149,7 @@ void php3_aspell_check(INTERNAL_FUNCTION_PARAMETERS)
|
||||
sc= (aspell *) php3_list_find(scin->value.lval, &type);
|
||||
if(!sc)
|
||||
{
|
||||
php3_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);
|
||||
php_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (aspell_check(sc, word->value.str.val))
|
||||
@@ -164,7 +165,7 @@ void php3_aspell_check(INTERNAL_FUNCTION_PARAMETERS)
|
||||
|
||||
/* {{{ proto int aspell_check_raw(aspell int,string word)
|
||||
Return if word is valid, ignoring case or trying to trim it in any way*/
|
||||
void php3_aspell_check_raw(INTERNAL_FUNCTION_PARAMETERS)
|
||||
PHP_FUNCTION(aspell_check_raw)
|
||||
{
|
||||
pval *scin,*word;
|
||||
int type;
|
||||
@@ -180,7 +181,7 @@ void php3_aspell_check_raw(INTERNAL_FUNCTION_PARAMETERS)
|
||||
sc= (aspell *) php3_list_find(scin->value.lval, &type);
|
||||
if(!sc)
|
||||
{
|
||||
php3_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);
|
||||
php_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (aspell_check_raw(sc, word->value.str.val))
|
||||
@@ -194,9 +195,9 @@ void php3_aspell_check_raw(INTERNAL_FUNCTION_PARAMETERS)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
void php3_info_aspell(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
PHP_MINFO_FUNCTION(aspell)
|
||||
{
|
||||
php3_printf("ASpell support enabled");
|
||||
php_printf("ASpell support enabled");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -36,13 +36,14 @@
|
||||
extern php3_module_entry aspell_module_entry;
|
||||
#define aspell_module_ptr &aspell_module_entry
|
||||
|
||||
extern int php3_minit_aspell(INIT_FUNC_ARGS);
|
||||
extern void php3_info_aspell(ZEND_MODULE_INFO_FUNC_ARGS);
|
||||
extern PHP_MINIT_FUNCTION(aspell);
|
||||
extern PHP_MINFO_FUNCTION(aspell);
|
||||
extern void php3_aspell_close();
|
||||
void php3_aspell_new(INTERNAL_FUNCTION_PARAMETERS);
|
||||
void php3_aspell_check(INTERNAL_FUNCTION_PARAMETERS);
|
||||
void php3_aspell_check_raw(INTERNAL_FUNCTION_PARAMETERS);
|
||||
void php3_aspell_suggest(INTERNAL_FUNCTION_PARAMETERS);
|
||||
|
||||
PHP_FUNCTION(aspell_new);
|
||||
PHP_FUNCTION(aspell_check);
|
||||
PHP_FUNCTION(aspell_check_raw);
|
||||
PHP_FUNCTION(aspell_suggest);
|
||||
|
||||
#else
|
||||
#define aspell_module_ptr NULL
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# $Id$
|
||||
|
||||
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
|
||||
noinst_LIBRARIES=libphpext_bcmath.a
|
||||
libphpext_bcmath_a_SOURCES=bcmath.c number.c
|
||||
noinst_LTLIBRARIES=libphpext_bcmath.la
|
||||
libphpext_bcmath_la_SOURCES=bcmath.c number.c
|
||||
+24
-24
@@ -24,20 +24,20 @@
|
||||
#include "php3_bcmath.h"
|
||||
|
||||
function_entry bcmath_functions[] = {
|
||||
{"bcadd", php3_bcmath_add, NULL},
|
||||
{"bcsub", php3_bcmath_sub, NULL},
|
||||
{"bcmul", php3_bcmath_mul, NULL},
|
||||
{"bcdiv", php3_bcmath_div, NULL},
|
||||
{"bcmod", php3_bcmath_mod, NULL},
|
||||
{"bcpow", php3_bcmath_pow, NULL},
|
||||
{"bcsqrt", php3_bcmath_sqrt, NULL},
|
||||
{"bcscale", php3_bcmath_set_scale, NULL},
|
||||
{"bccomp", php3_bcmath_comp, NULL},
|
||||
PHP_FE(bcadd, NULL)
|
||||
PHP_FE(bcsub, NULL)
|
||||
PHP_FE(bcmul, NULL)
|
||||
PHP_FE(bcdiv, NULL)
|
||||
PHP_FE(bcmod, NULL)
|
||||
PHP_FE(bcpow, NULL)
|
||||
PHP_FE(bcsqrt, NULL)
|
||||
PHP_FE(bcscale, NULL)
|
||||
PHP_FE(bccomp, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
php3_module_entry bcmath_module_entry = {
|
||||
"bcmath", bcmath_functions, NULL, NULL, php3_rinit_bcmath, php3_rend_bcmath, NULL, STANDARD_MODULE_PROPERTIES
|
||||
"bcmath", bcmath_functions, NULL, NULL, PHP_RINIT(bcmath), PHP_RSHUTDOWN(bcmath), NULL, STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#if COMPILE_DL
|
||||
@@ -48,7 +48,7 @@ php3_module_entry *get_module() { return &bcmath_module_entry; };
|
||||
static long bc_precision;
|
||||
#endif
|
||||
|
||||
int php3_rinit_bcmath(INIT_FUNC_ARGS)
|
||||
PHP_RINIT_FUNCTION(bcmath)
|
||||
{
|
||||
init_numbers();
|
||||
if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) {
|
||||
@@ -57,7 +57,7 @@ int php3_rinit_bcmath(INIT_FUNC_ARGS)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
int php3_rend_bcmath(SHUTDOWN_FUNC_ARGS)
|
||||
PHP_RSHUTDOWN_FUNCTION(bcmath)
|
||||
{
|
||||
destruct_numbers();
|
||||
return SUCCESS;
|
||||
@@ -65,7 +65,7 @@ int php3_rend_bcmath(SHUTDOWN_FUNC_ARGS)
|
||||
|
||||
/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
|
||||
Returns the sum of two arbitrary precision numbers */
|
||||
PHP_FUNCTION(bcmath_add)
|
||||
PHP_FUNCTION(bcadd)
|
||||
{
|
||||
pval *left, *right,*scale_param;
|
||||
bc_num first, second, result;
|
||||
@@ -108,7 +108,7 @@ PHP_FUNCTION(bcmath_add)
|
||||
|
||||
/* {{{ proto string bcsub(string left_operand, string right_operand [, int scale])
|
||||
Returns the difference between two arbitrary precision numbers (subtration) */
|
||||
PHP_FUNCTION(bcmath_sub)
|
||||
PHP_FUNCTION(bcsub)
|
||||
{
|
||||
pval *left, *right,*scale_param;
|
||||
bc_num first, second, result;
|
||||
@@ -151,7 +151,7 @@ PHP_FUNCTION(bcmath_sub)
|
||||
|
||||
/* {{{ proto string bcmul(string left_operand, string right_operand [, int scale])
|
||||
Returns the multiplication of two arbitrary precision numbers */
|
||||
PHP_FUNCTION(bcmath_mul)
|
||||
PHP_FUNCTION(bcmul)
|
||||
{
|
||||
pval *left, *right,*scale_param;
|
||||
bc_num first, second, result;
|
||||
@@ -194,7 +194,7 @@ PHP_FUNCTION(bcmath_mul)
|
||||
|
||||
/* {{{ proto string bcdiv(string left_operand, string right_operand [, int scale])
|
||||
Returns the quotient of two arbitrary precision numbers (division) */
|
||||
PHP_FUNCTION(bcmath_div)
|
||||
PHP_FUNCTION(bcdiv)
|
||||
{
|
||||
pval *left, *right,*scale_param;
|
||||
bc_num first, second, result;
|
||||
@@ -231,7 +231,7 @@ PHP_FUNCTION(bcmath_div)
|
||||
return_value->type = IS_STRING;
|
||||
break;
|
||||
case -1: /* division by zero */
|
||||
php3_error(E_WARNING,"Division by zero");
|
||||
php_error(E_WARNING,"Division by zero");
|
||||
break;
|
||||
}
|
||||
free_num(&first);
|
||||
@@ -243,7 +243,7 @@ PHP_FUNCTION(bcmath_div)
|
||||
|
||||
/* {{{ proto string bcmod(string left_operand, string right_operand)
|
||||
Returns the modulus of the two arbitrary precision operands */
|
||||
PHP_FUNCTION(bcmath_mod)
|
||||
PHP_FUNCTION(bcmod)
|
||||
{
|
||||
pval *left, *right;
|
||||
bc_num first, second, result;
|
||||
@@ -272,7 +272,7 @@ PHP_FUNCTION(bcmath_mod)
|
||||
return_value->type = IS_STRING;
|
||||
break;
|
||||
case -1:
|
||||
php3_error(E_WARNING,"Division by zero");
|
||||
php_error(E_WARNING,"Division by zero");
|
||||
break;
|
||||
}
|
||||
free_num(&first);
|
||||
@@ -284,7 +284,7 @@ PHP_FUNCTION(bcmath_mod)
|
||||
|
||||
/* {{{ proto string bcpow(string x, string y [, int scale])
|
||||
Returns the value of an arbitrary precision number raised to the power of another */
|
||||
PHP_FUNCTION(bcmath_pow)
|
||||
PHP_FUNCTION(bcpow)
|
||||
{
|
||||
pval *left, *right,*scale_param;
|
||||
bc_num first, second, result;
|
||||
@@ -327,7 +327,7 @@ PHP_FUNCTION(bcmath_pow)
|
||||
|
||||
/* {{{ proto string bcsqrt(string operand [, int scale])
|
||||
Returns the square root of an arbitray precision number */
|
||||
PHP_FUNCTION(bcmath_sqrt)
|
||||
PHP_FUNCTION(bcsqrt)
|
||||
{
|
||||
pval *left,*scale_param;
|
||||
bc_num result;
|
||||
@@ -358,7 +358,7 @@ PHP_FUNCTION(bcmath_sqrt)
|
||||
return_value->value.str.len = strlen(return_value->value.str.val);
|
||||
return_value->type = IS_STRING;
|
||||
} else {
|
||||
php3_error(E_WARNING,"Square root of negative number");
|
||||
php_error(E_WARNING,"Square root of negative number");
|
||||
}
|
||||
free_num(&result);
|
||||
return;
|
||||
@@ -367,7 +367,7 @@ PHP_FUNCTION(bcmath_sqrt)
|
||||
|
||||
/* {{{ proto string bccomp(string left_operand, string right_operand [, int scale])
|
||||
Compares two arbitrary precision numbers */
|
||||
PHP_FUNCTION(bcmath_comp)
|
||||
PHP_FUNCTION(bccomp)
|
||||
{
|
||||
pval *left, *right, *scale_param;
|
||||
bc_num first, second;
|
||||
@@ -409,7 +409,7 @@ PHP_FUNCTION(bcmath_comp)
|
||||
|
||||
/* {{{ proto string bcscale(int scale)
|
||||
Sets default scale parameter for all bc math functions */
|
||||
PHP_FUNCTION(bcmath_set_scale)
|
||||
PHP_FUNCTION(bcscale)
|
||||
{
|
||||
pval *new_scale;
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ dnl $Id$
|
||||
|
||||
AC_MSG_CHECKING(whether to enable bc style precision math functions)
|
||||
AC_ARG_ENABLE(bcmath,
|
||||
[ --enable-bcmath Compile with bc style precision math functions.
|
||||
Read README-BCMATH for instructions on how to
|
||||
get this module installed. ],
|
||||
[ --enable-bcmath Compile with bc style precision math functions.
|
||||
Read README-BCMATH for instructions on how to
|
||||
get this module installed. ],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(WITH_BCMATH, 1)
|
||||
|
||||
+11
-11
@@ -43,17 +43,17 @@
|
||||
extern php3_module_entry bcmath_module_entry;
|
||||
#define phpext_bcmath_ptr &bcmath_module_entry
|
||||
|
||||
extern int php3_rinit_bcmath(INIT_FUNC_ARGS);
|
||||
extern int php3_rend_bcmath(SHUTDOWN_FUNC_ARGS);
|
||||
PHP_FUNCTION(bcmath_add);
|
||||
PHP_FUNCTION(bcmath_sub);
|
||||
PHP_FUNCTION(bcmath_mul);
|
||||
PHP_FUNCTION(bcmath_div);
|
||||
PHP_FUNCTION(bcmath_mod);
|
||||
PHP_FUNCTION(bcmath_pow);
|
||||
PHP_FUNCTION(bcmath_sqrt);
|
||||
PHP_FUNCTION(bcmath_comp);
|
||||
PHP_FUNCTION(bcmath_set_scale);
|
||||
extern PHP_RINIT_FUNCTION(bcmath);
|
||||
extern PHP_RSHUTDOWN_FUNCTION(bcmath);
|
||||
PHP_FUNCTION(bcadd);
|
||||
PHP_FUNCTION(bcsub);
|
||||
PHP_FUNCTION(bcmul);
|
||||
PHP_FUNCTION(bcdiv);
|
||||
PHP_FUNCTION(bcmod);
|
||||
PHP_FUNCTION(bcpow);
|
||||
PHP_FUNCTION(bcsqrt);
|
||||
PHP_FUNCTION(bccomp);
|
||||
PHP_FUNCTION(bcscale);
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#ifndef _PHP3_COM_H
|
||||
#define _PHP3_COM_H
|
||||
#ifndef _PHP_COM_H
|
||||
#define _PHP_COM_H
|
||||
|
||||
#if WIN32|WINNT
|
||||
|
||||
extern int php3_minit_COM(INIT_FUNC_ARGS);
|
||||
extern int php3_mshutdown_COM(SHUTDOWN_FUNC_ARGS);
|
||||
extern PHP_MINIT_FUNCTION(COM);
|
||||
extern PHP_MSHUTDOWN_FUNCTION(COM);
|
||||
PHP_FUNCTION(COM_load);
|
||||
PHP_FUNCTION(COM_invoke);
|
||||
|
||||
PHP_FUNCTION(com_propget);
|
||||
PHP_FUNCTION(com_propput);
|
||||
extern php3_module_entry COM_module_entry;
|
||||
extern zend_module_entry COM_module_entry;
|
||||
#define COM_module_ptr &COM_module_entry
|
||||
|
||||
#else
|
||||
@@ -21,4 +21,4 @@ extern php3_module_entry COM_module_entry;
|
||||
|
||||
#define phpext_COM_ptr COM_module_ptr
|
||||
|
||||
#endif /* _PHP3_COM_H */
|
||||
#endif /* _PHP_COM_H */
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
# $Id$
|
||||
|
||||
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
|
||||
noinst_LIBRARIES=libphpext_dav.a
|
||||
libphpext_dav_a_SOURCES=dav.c
|
||||
noinst_LTLIBRARIES=libphpext_dav.la
|
||||
libphpext_dav_la_SOURCES=dav.c
|
||||
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
# $Id$
|
||||
|
||||
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
|
||||
noinst_LIBRARIES=libphpext_db.a
|
||||
libphpext_db_a_SOURCES=db.c
|
||||
noinst_LTLIBRARIES=libphpext_db.la
|
||||
libphpext_db_la_SOURCES=db.c
|
||||
|
||||
@@ -4,6 +4,8 @@ dnl don't forget to call PHP_EXTENSION(db)
|
||||
|
||||
divert(1)
|
||||
|
||||
AC_CHECK_HEADERS(db1/ndbm.h)
|
||||
|
||||
# Checks for libraries.
|
||||
# Prefer gdbm, Berkeley DB and ndbm/dbm, in that order
|
||||
AC_DEFUN(AC_PREFERRED_DB_LIB,[
|
||||
|
||||
+54
-53
@@ -20,22 +20,16 @@
|
||||
/* $Id$ */
|
||||
#define IS_EXT_MODULE
|
||||
#if COMPILE_DL
|
||||
#ifdef PHP_31
|
||||
# include "../phpdl.h"
|
||||
#else
|
||||
# ifdef THREAD_SAFE
|
||||
# undef THREAD_SAFE
|
||||
# endif
|
||||
# include "dl/phpdl.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
|
||||
#include "php.h"
|
||||
#include "php_globals.h"
|
||||
#include "safe_mode.h"
|
||||
#include "fopen-wrappers.h"
|
||||
#include "ext/standard/flock_compat.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -85,8 +79,12 @@
|
||||
#define DB_DBM_HSEARCH 1
|
||||
#include <db.h>
|
||||
#else
|
||||
#ifdef HAVE_DB1_NDBM_H
|
||||
#include <db1/ndbm.h>
|
||||
#else
|
||||
#include <ndbm.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define DBM_TYPE DBM *
|
||||
#define DBM_MODE_TYPE int
|
||||
@@ -182,9 +180,9 @@ dbm_info *_php3_finddbm(pval *id,HashTable *list)
|
||||
DBM_TLS_VARS;
|
||||
|
||||
if (id->type == IS_STRING) {
|
||||
numitems = _php3_hash_num_elements(list);
|
||||
numitems = zend_hash_num_elements(list);
|
||||
for (i=1; i<=numitems; i++) {
|
||||
if (_php3_hash_index_find(list, i, (void **) &le)==FAILURE) {
|
||||
if (zend_hash_index_find(list, i, (void **) &le)==FAILURE) {
|
||||
continue;
|
||||
}
|
||||
if (le->type == DBM_GLOBAL(le_db)) {
|
||||
@@ -240,9 +238,9 @@ static char *php3_get_info_db(void)
|
||||
}
|
||||
|
||||
|
||||
void php3_info_db(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
PHP_MINFO_FUNCTION(db)
|
||||
{
|
||||
php3_printf(php3_get_info_db());
|
||||
php_printf(php3_get_info_db());
|
||||
}
|
||||
|
||||
PHP_FUNCTION(dblist)
|
||||
@@ -288,9 +286,10 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {
|
||||
|
||||
DBM_TYPE dbf=NULL;
|
||||
DBM_MODE_TYPE imode;
|
||||
PLS_FETCH();
|
||||
|
||||
if (filename == NULL) {
|
||||
php3_error(E_WARNING, "NULL filename passed to _php3_dbmopen()");
|
||||
php_error(E_WARNING, "NULL filename passed to _php3_dbmopen()");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -336,7 +335,7 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {
|
||||
lockfd = open(lockfn,O_RDWR|O_CREAT,0644);
|
||||
close(lockfd);
|
||||
} else {
|
||||
php3_error(E_WARNING, "File appears to be locked [%s]\n",lockfn);
|
||||
php_error(E_WARNING, "File appears to be locked [%s]\n",lockfn);
|
||||
return -1;
|
||||
}
|
||||
#else /* NFS_HACK */
|
||||
@@ -347,7 +346,7 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {
|
||||
flock(lockfd,LOCK_EX);
|
||||
close(lockfd);
|
||||
} else {
|
||||
php3_error(E_WARNING, "Unable to establish lock: %s",filename);
|
||||
php_error(E_WARNING, "Unable to establish lock: %s",filename);
|
||||
}
|
||||
#endif /* else NFS_HACK */
|
||||
|
||||
@@ -364,7 +363,7 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {
|
||||
if (dbf) {
|
||||
info = (dbm_info *)emalloc(sizeof(dbm_info));
|
||||
if (!info) {
|
||||
php3_error(E_ERROR, "problem allocating memory!");
|
||||
php_error(E_ERROR, "problem allocating memory!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -376,7 +375,7 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {
|
||||
return info;
|
||||
} else {
|
||||
#if GDBM
|
||||
php3_error(E_WARNING, "dbmopen_gdbm(%s): %d [%s], %d [%s]",filename,gdbm_errno,gdbm_strerror(gdbm_errno),errno,strerror(errno));
|
||||
php_error(E_WARNING, "dbmopen_gdbm(%s): %d [%s], %d [%s]",filename,gdbm_errno,gdbm_strerror(gdbm_errno),errno,strerror(errno));
|
||||
if (gdbm_errno)
|
||||
ret = gdbm_errno;
|
||||
else if (errno)
|
||||
@@ -386,13 +385,13 @@ dbm_info *_php3_dbmopen(char *filename, char *mode) {
|
||||
#else
|
||||
#if NDBM
|
||||
#if DEBUG
|
||||
php3_error(E_WARNING, "dbmopen_ndbm(%s): errno = %d [%s]\n",filename,errno,strerror(errno));
|
||||
php_error(E_WARNING, "dbmopen_ndbm(%s): errno = %d [%s]\n",filename,errno,strerror(errno));
|
||||
#endif
|
||||
if (errno) ret=errno;
|
||||
else ret = -1;
|
||||
#else
|
||||
#if DEBUG
|
||||
php3_error(E_WARNING, "dbmopen_flatfile(%s): errno = %d [%s]\n",filename,errno,strerror(errno));
|
||||
php_error(E_WARNING, "dbmopen_flatfile(%s): errno = %d [%s]\n",filename,errno,strerror(errno));
|
||||
#endif
|
||||
if (errno) ret=errno;
|
||||
else ret = -1;
|
||||
@@ -472,7 +471,7 @@ PHP_FUNCTION(dbminsert)
|
||||
|
||||
info = _php3_finddbm(id,list);
|
||||
if (!info) {
|
||||
php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -485,8 +484,8 @@ int _php3_dbminsert(dbm_info *info, char *key, char *value) {
|
||||
int ret;
|
||||
DBM_TYPE dbf;
|
||||
|
||||
_php3_stripslashes(key,NULL);
|
||||
_php3_stripslashes(value,NULL);
|
||||
php_stripslashes(key,NULL);
|
||||
php_stripslashes(value,NULL);
|
||||
|
||||
value_datum.dptr = estrdup(value);
|
||||
value_datum.dsize = strlen(value);
|
||||
@@ -499,7 +498,7 @@ int _php3_dbminsert(dbm_info *info, char *key, char *value) {
|
||||
|
||||
dbf = info->dbf;
|
||||
if (!dbf) {
|
||||
php3_error(E_WARNING, "Unable to locate dbm file");
|
||||
php_error(E_WARNING, "Unable to locate dbm file");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -525,7 +524,7 @@ PHP_FUNCTION(dbmreplace)
|
||||
|
||||
info = _php3_finddbm(id,list);
|
||||
if (!info) {
|
||||
php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -540,8 +539,8 @@ int _php3_dbmreplace(dbm_info *info, char *key, char *value) {
|
||||
PLS_FETCH();
|
||||
|
||||
if (PG(magic_quotes_runtime)) {
|
||||
_php3_stripslashes(key,NULL);
|
||||
_php3_stripslashes(value,NULL);
|
||||
php_stripslashes(key,NULL);
|
||||
php_stripslashes(value,NULL);
|
||||
}
|
||||
|
||||
value_datum.dptr = estrdup(value);
|
||||
@@ -555,7 +554,7 @@ int _php3_dbmreplace(dbm_info *info, char *key, char *value) {
|
||||
|
||||
dbf = info->dbf;
|
||||
if (!dbf) {
|
||||
php3_error(E_WARNING, "Unable to locate dbm file");
|
||||
php_error(E_WARNING, "Unable to locate dbm file");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -579,7 +578,7 @@ PHP_FUNCTION(dbmfetch)
|
||||
|
||||
info = _php3_finddbm(id,list);
|
||||
if (!info) {
|
||||
php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -608,7 +607,7 @@ char *_php3_dbmfetch(dbm_info *info, char *key) {
|
||||
|
||||
dbf = info->dbf;
|
||||
if (!dbf) {
|
||||
php3_error(E_WARNING, "Unable to locate dbm file");
|
||||
php_error(E_WARNING, "Unable to locate dbm file");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -632,7 +631,7 @@ char *_php3_dbmfetch(dbm_info *info, char *key) {
|
||||
ret = NULL;
|
||||
|
||||
if (ret && PG(magic_quotes_runtime)) {
|
||||
ret = _php3_addslashes(ret, value_datum.dsize, NULL, 1);
|
||||
ret = php_addslashes(ret, value_datum.dsize, NULL, 1);
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
@@ -651,7 +650,7 @@ PHP_FUNCTION(dbmexists)
|
||||
|
||||
info = _php3_finddbm(id,list);
|
||||
if (!info) {
|
||||
php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -672,7 +671,7 @@ int _php3_dbmexists(dbm_info *info, char *key) {
|
||||
|
||||
dbf = info->dbf;
|
||||
if (!dbf) {
|
||||
php3_error(E_WARNING, "Unable to locate dbm file");
|
||||
php_error(E_WARNING, "Unable to locate dbm file");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -694,7 +693,7 @@ PHP_FUNCTION(dbmdelete)
|
||||
|
||||
info = _php3_finddbm(id,list);
|
||||
if (!info) {
|
||||
php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -715,7 +714,7 @@ int _php3_dbmdelete(dbm_info *info, char *key) {
|
||||
|
||||
dbf = info->dbf;
|
||||
if (!dbf) {
|
||||
php3_error(E_WARNING, "Unable to locate dbm file");
|
||||
php_error(E_WARNING, "Unable to locate dbm file");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -735,7 +734,7 @@ PHP_FUNCTION(dbmfirstkey)
|
||||
|
||||
info = _php3_finddbm(id,list);
|
||||
if (!info) {
|
||||
php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -756,7 +755,7 @@ char *_php3_dbmfirstkey(dbm_info *info) {
|
||||
|
||||
dbf = info->dbf;
|
||||
if (!dbf) {
|
||||
php3_error(E_WARNING, "Unable to locate dbm file");
|
||||
php_error(E_WARNING, "Unable to locate dbm file");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -793,7 +792,7 @@ PHP_FUNCTION(dbmnextkey)
|
||||
|
||||
info = _php3_finddbm(id,list);
|
||||
if (!info) {
|
||||
php3_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
php_error(E_WARNING, "not a valid database identifier %d", id->value.lval);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -821,7 +820,7 @@ char *_php3_dbmnextkey(dbm_info *info, char *key) {
|
||||
|
||||
dbf = info->dbf;
|
||||
if (!dbf) {
|
||||
php3_error(E_WARNING, "Unable to locate dbm file");
|
||||
php_error(E_WARNING, "Unable to locate dbm file");
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -847,7 +846,7 @@ char *_php3_dbmnextkey(dbm_info *info, char *key) {
|
||||
else ret=NULL;
|
||||
|
||||
if (ret && PG(magic_quotes_runtime)) {
|
||||
ret = _php3_addslashes(ret, ret_datum.dsize, NULL, 1);
|
||||
ret = php_addslashes(ret, ret_datum.dsize, NULL, 1);
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
@@ -1079,7 +1078,7 @@ datum flatfile_nextkey(FILE *dbf) {
|
||||
#endif
|
||||
|
||||
|
||||
int php3_minit_db(INIT_FUNC_ARGS)
|
||||
PHP_MINIT_FUNCTION(db)
|
||||
{
|
||||
#if defined(THREAD_SAFE)
|
||||
dbm_global_struct *dbm_globals;
|
||||
@@ -1104,7 +1103,8 @@ int php3_minit_db(INIT_FUNC_ARGS)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
static int php3_mend_db(void){
|
||||
static PHP_MSHUTDOWN_FUNCTION(db)
|
||||
{
|
||||
DBM_TLS_VARS;
|
||||
#ifdef THREAD_SAFE
|
||||
PHP3_TLS_THREAD_FREE(dbm_globals);
|
||||
@@ -1121,7 +1121,8 @@ static int php3_mend_db(void){
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
int php3_rinit_db(INIT_FUNC_ARGS) {
|
||||
PHP_RINIT_FUNCTION(db)
|
||||
{
|
||||
#if !GDBM && !NDBM
|
||||
CurrentFlatFilePos = 0L;
|
||||
#endif
|
||||
@@ -1130,21 +1131,21 @@ int php3_rinit_db(INIT_FUNC_ARGS) {
|
||||
|
||||
|
||||
function_entry dbm_functions[] = {
|
||||
{"dblist", php3_dblist, NULL},
|
||||
{"dbmopen", php3_dbmopen, NULL},
|
||||
{"dbmclose", php3_dbmclose, NULL},
|
||||
{"dbminsert", php3_dbminsert, NULL},
|
||||
{"dbmfetch", php3_dbmfetch, NULL},
|
||||
{"dbmreplace", php3_dbmreplace, NULL},
|
||||
{"dbmexists", php3_dbmexists, NULL},
|
||||
{"dbmdelete", php3_dbmdelete, NULL},
|
||||
{"dbmfirstkey", php3_dbmfirstkey, NULL},
|
||||
{"dbmnextkey", php3_dbmnextkey, NULL},
|
||||
PHP_FE(dblist, NULL)
|
||||
PHP_FE(dbmopen, NULL)
|
||||
PHP_FE(dbmclose, NULL)
|
||||
PHP_FE(dbminsert, NULL)
|
||||
PHP_FE(dbmfetch, NULL)
|
||||
PHP_FE(dbmreplace, NULL)
|
||||
PHP_FE(dbmexists, NULL)
|
||||
PHP_FE(dbmdelete, NULL)
|
||||
PHP_FE(dbmfirstkey, NULL)
|
||||
PHP_FE(dbmnextkey, NULL)
|
||||
{NULL,NULL,NULL}
|
||||
};
|
||||
|
||||
php3_module_entry dbm_module_entry = {
|
||||
"DBM", dbm_functions, php3_minit_db, php3_mend_db, php3_rinit_db, NULL, php3_info_db, STANDARD_MODULE_PROPERTIES
|
||||
"DBM", dbm_functions, PHP_MINIT(db), PHP_MSHUTDOWN(db), PHP_RINIT(db), NULL, PHP_MINFO(db), STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#if COMPILE_DL
|
||||
|
||||
+4
-3
@@ -74,9 +74,10 @@ char *_php3_dbmfirstkey(dbm_info *info);
|
||||
char *_php3_dbmnextkey(dbm_info *info, char *key);
|
||||
|
||||
/* db file functions */
|
||||
int php3_minit_db(INIT_FUNC_ARGS);
|
||||
int php3_rinit_db(INIT_FUNC_ARGS);
|
||||
void php3_info_db(ZEND_MODULE_INFO_FUNC_ARGS);
|
||||
PHP_MINIT_FUNCTION(db);
|
||||
PHP_RINIT_FUNCTION(db);
|
||||
PHP_MINFO_FUNCTION(db);
|
||||
|
||||
PHP_FUNCTION(dblist);
|
||||
PHP_FUNCTION(dbmopen);
|
||||
PHP_FUNCTION(dbmclose);
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
# $Id$
|
||||
|
||||
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
|
||||
noinst_LIBRARIES=libphpext_dba.a
|
||||
libphpext_dba_a_SOURCES=dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c \
|
||||
noinst_LTLIBRARIES=libphpext_dba.la
|
||||
libphpext_dba_la_SOURCES=dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c \
|
||||
dba_ndbm.c
|
||||
|
||||
+2
-2
@@ -108,7 +108,7 @@ AC_MSG_CHECKING(for NDBM support)
|
||||
AC_DBA_STD_RESULT
|
||||
|
||||
AC_ARG_WITH(db2,
|
||||
[ --with-db2[=DIR] Include DB2 support],[
|
||||
[ --with-db2[=DIR] Include Berkeley DB2 support],[
|
||||
if test "$withval" != "no"; then
|
||||
for i in /usr/local /usr /usr/BerkeleyDB $withval; do
|
||||
if test -f "$i/db2/db.h"; then
|
||||
@@ -149,7 +149,7 @@ AC_ARG_WITH(db2,
|
||||
AC_DBA_STD_ATTACH
|
||||
fi
|
||||
])
|
||||
AC_MSG_CHECKING(for DB2 support)
|
||||
AC_MSG_CHECKING(for Berkeley DB2 support)
|
||||
AC_DBA_STD_RESULT
|
||||
|
||||
AC_ARG_WITH(dbm,
|
||||
|
||||
+52
-49
@@ -57,16 +57,16 @@ function_entry dba_functions[] = {
|
||||
{NULL,NULL,NULL}
|
||||
};
|
||||
|
||||
static int php3_minit_dba(INIT_FUNC_ARGS);
|
||||
static int php3_mshutdown_dba(SHUTDOWN_FUNC_ARGS);
|
||||
static void php3_info_dba(ZEND_MODULES_INFO_FUNC_ARGS);
|
||||
static PHP_MINIT_FUNCTION(dba);
|
||||
static PHP_MSHUTDOWN_FUNCTION(dba);
|
||||
static PHP_MINFO_FUNCTION(dba);
|
||||
|
||||
php3_module_entry dba_module_entry = {
|
||||
"DataBase API", dba_functions,
|
||||
php3_minit_dba,
|
||||
php3_mshutdown_dba,
|
||||
PHP_MINIT(dba),
|
||||
PHP_MSHUTDOWN(dba),
|
||||
NULL, NULL,
|
||||
php3_info_dba,
|
||||
PHP_MINFO(dba),
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
@@ -86,31 +86,35 @@ typedef struct dba_handler {
|
||||
|
||||
/* {{{ macromania */
|
||||
|
||||
#define DBA_ID_PARS pval *id; dba_info *info = NULL; int type, ac = ARG_COUNT(ht)
|
||||
#define DBA_ID_PARS \
|
||||
pval **id; \
|
||||
dba_info *info = NULL; \
|
||||
int type, ac = ARG_COUNT(ht)
|
||||
|
||||
/* these are used to get the standard arguments */
|
||||
|
||||
#define DBA_GET1 \
|
||||
if(ac != 1 || getParameters(ht, ac, &id) != SUCCESS) { \
|
||||
WRONG_PARAM_COUNT; \
|
||||
#define DBA_GET1 \
|
||||
if(ac != 1 || getParametersEx(ac, &id) != SUCCESS) { \
|
||||
WRONG_PARAM_COUNT; \
|
||||
}
|
||||
|
||||
#define DBA_GET2 \
|
||||
pval *key; \
|
||||
if(ac != 2 || getParameters(ht, ac, &key, &id) != SUCCESS) { \
|
||||
WRONG_PARAM_COUNT; \
|
||||
} \
|
||||
convert_to_string(key)
|
||||
#define DBA_GET2 \
|
||||
pval **key; \
|
||||
if(ac != 2 || getParametersEx(ac, &key, &id) != SUCCESS) { \
|
||||
WRONG_PARAM_COUNT; \
|
||||
} \
|
||||
convert_to_string_ex(key)
|
||||
|
||||
#define DBA_IF_NOT_CORRECT_TYPE(link_id) \
|
||||
info = php3_list_find(link_id, &type); \
|
||||
#define DBA_IF_NOT_CORRECT_TYPE(link_id) \
|
||||
info = php3_list_find(link_id, &type); \
|
||||
if(!info || (type != GLOBAL(le_db) && type != GLOBAL(le_pdb)))
|
||||
|
||||
#define DBA_ID_GET \
|
||||
convert_to_long(id); \
|
||||
DBA_IF_NOT_CORRECT_TYPE(id->value.lval) { \
|
||||
php3_error(E_WARNING, "Unable to find DBA identifier %d", id->value.lval); \
|
||||
RETURN_FALSE; \
|
||||
#define DBA_ID_GET \
|
||||
convert_to_long_ex(id); \
|
||||
DBA_IF_NOT_CORRECT_TYPE((*id)->value.lval) { \
|
||||
php_error(E_WARNING, "Unable to find DBA identifier %d", \
|
||||
(*id)->value.lval); \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
#define DBA_ID_GET1 DBA_ID_PARS; DBA_GET1; DBA_ID_GET
|
||||
@@ -128,7 +132,7 @@ typedef struct dba_handler {
|
||||
/* check whether the user has write access */
|
||||
#define DBA_WRITE_CHECK \
|
||||
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
|
||||
php3_error(E_WARNING, "you cannot perform a modification to a database without proper access"); \
|
||||
php_error(E_WARNING, "you cannot perform a modification to a database without proper access"); \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
@@ -174,9 +178,9 @@ static void dba_close(dba_info *info)
|
||||
/* }}} */
|
||||
/* {{{ php3_minit_dba */
|
||||
|
||||
static int php3_minit_dba(INIT_FUNC_ARGS)
|
||||
static PHP_MINIT_FUNCTION(dba)
|
||||
{
|
||||
_php3_hash_init(&ht_keys, 0, NULL, NULL, 1);
|
||||
zend_hash_init(&ht_keys, 0, NULL, NULL, 1);
|
||||
GLOBAL(le_db) = register_list_destructors(dba_close, NULL);
|
||||
GLOBAL(le_pdb) = register_list_destructors(NULL, dba_close);
|
||||
return SUCCESS;
|
||||
@@ -184,15 +188,15 @@ static int php3_minit_dba(INIT_FUNC_ARGS)
|
||||
/* }}} */
|
||||
/* {{{ php3_mshutdown_dba */
|
||||
|
||||
static int php3_mshutdown_dba(SHUTDOWN_FUNC_ARGS)
|
||||
static PHP_MSHUTDOWN_FUNCTION(dba)
|
||||
{
|
||||
_php3_hash_destroy(&ht_keys);
|
||||
zend_hash_destroy(&ht_keys);
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
/* {{{ php3_info_dba */
|
||||
|
||||
static void php3_info_dba(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
static PHP_MINFO_FUNCTION(dba)
|
||||
{
|
||||
dba_handler *hptr;
|
||||
|
||||
@@ -208,13 +212,13 @@ static void php3_info_dba(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
static void _php3_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
{
|
||||
DBA_ID_PARS;
|
||||
pval *val, *key;
|
||||
pval **val, **key;
|
||||
|
||||
if(ac != 3 || getParameters(ht, ac, &key, &val, &id) != SUCCESS) {
|
||||
if(ac != 3 || getParametersEx(ac, &key, &val, &id) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string(key);
|
||||
convert_to_string(val);
|
||||
convert_to_string_ex(key);
|
||||
convert_to_string_ex(val);
|
||||
DBA_ID_GET;
|
||||
|
||||
DBA_WRITE_CHECK;
|
||||
@@ -230,7 +234,7 @@ static void _php3_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
|
||||
static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
{
|
||||
pval **args = (pval **) NULL;
|
||||
pval ***args = (pval ***) NULL;
|
||||
int ac = ARG_COUNT(ht);
|
||||
dba_mode_t modenr;
|
||||
dba_info *info;
|
||||
@@ -246,15 +250,15 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
|
||||
/* we pass additional args to the respective handler */
|
||||
args = emalloc(ac * sizeof(pval *));
|
||||
if(getParametersArray(ht, ac, args) != SUCCESS) {
|
||||
if(getParametersArrayEx(ac, args) != SUCCESS) {
|
||||
FREENOW;
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
/* we only take string arguments */
|
||||
for(i = 0; i < ac; i++) {
|
||||
convert_to_string(args[i]);
|
||||
keylen += args[i]->value.str.len;
|
||||
convert_to_string_ex(args[i]);
|
||||
keylen += (*args[i])->value.str.len;
|
||||
}
|
||||
|
||||
if(persistent) {
|
||||
@@ -263,27 +267,26 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
keylen = 0;
|
||||
|
||||
for(i = 0; i < ac; i++) {
|
||||
memcpy(key+keylen,args[i]->value.str.val,args[i]->value.str.len);
|
||||
keylen += args[i]->value.str.len;
|
||||
memcpy(key+keylen,(*args[i])->value.str.val,(*args[i])->value.str.len);
|
||||
keylen += (*args[i])->value.str.len;
|
||||
}
|
||||
|
||||
if(_php3_hash_find(&ht_keys, key, keylen, (void **) &info) == SUCCESS) {
|
||||
if(zend_hash_find(&ht_keys, key, keylen, (void **) &info) == SUCCESS) {
|
||||
FREENOW;
|
||||
RETURN_LONG(php3_list_insert(info, GLOBAL(le_pdb)));
|
||||
}
|
||||
}
|
||||
|
||||
/* this is O(n) and could be improved */
|
||||
for(hptr = handler; hptr->name &&
|
||||
strcasecmp(hptr->name, args[2]->value.str.val); hptr++);
|
||||
strcasecmp(hptr->name, (*args[2])->value.str.val); hptr++);
|
||||
|
||||
if(!hptr->name) {
|
||||
php3_error(E_WARNING, "no such handler: %s", args[2]->value.str.val);
|
||||
php_error(E_WARNING, "no such handler: %s", (*args[2])->value.str.val);
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
switch(args[1]->value.str.val[0]) {
|
||||
switch((*args[1])->value.str.val[0]) {
|
||||
case 'c':
|
||||
modenr = DBA_CREAT;
|
||||
break;
|
||||
@@ -297,14 +300,14 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
modenr = DBA_TRUNC;
|
||||
break;
|
||||
default:
|
||||
php3_error(E_WARNING,"illegal DBA mode: %s",args[1]->value.str.val);
|
||||
php_error(E_WARNING,"illegal DBA mode: %s",(*args[1])->value.str.val);
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
info = malloc(sizeof(*info));
|
||||
memset(info, 0, sizeof(info));
|
||||
info->path = strdup(args[0]->value.str.val);
|
||||
info->path = strdup((*args[0])->value.str.val);
|
||||
info->mode = modenr;
|
||||
info->argc = ac - 3;
|
||||
info->argv = args + 3;
|
||||
@@ -312,7 +315,7 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
|
||||
if(hptr->open(info) != SUCCESS) {
|
||||
dba_close(info);
|
||||
php3_error(E_WARNING, "driver initialization failed");
|
||||
php_error(E_WARNING, "driver initialization failed");
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -322,7 +325,7 @@ static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
|
||||
listid = php3_list_insert(info, persistent?GLOBAL(le_pdb):GLOBAL(le_db));
|
||||
if(persistent) {
|
||||
_php3_hash_update(&ht_keys, key, keylen, info, sizeof(*info), NULL);
|
||||
zend_hash_update(&ht_keys, key, keylen, info, sizeof(*info), NULL);
|
||||
}
|
||||
|
||||
FREENOW;
|
||||
@@ -354,7 +357,7 @@ PHP_FUNCTION(dba_close)
|
||||
{
|
||||
DBA_ID_GET1;
|
||||
|
||||
php3_list_delete(id->value.lval);
|
||||
php3_list_delete((*id)->value.lval);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+3
-3
@@ -78,8 +78,8 @@ DBA_OPEN_FUNC(db2)
|
||||
return FAILURE;
|
||||
|
||||
if(info->argc > 0) {
|
||||
convert_to_long(info->argv[0]);
|
||||
filemode = info->argv[0]->value.lval;
|
||||
convert_to_long_ex(info->argv[0]);
|
||||
filemode = (*info->argv[0])->value.lval;
|
||||
}
|
||||
|
||||
if(!db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) {
|
||||
@@ -96,7 +96,7 @@ DBA_CLOSE_FUNC(db2)
|
||||
DB2_DATA;
|
||||
|
||||
if(dba->cursor) dba->cursor->c_close(dba->cursor);
|
||||
dba->dbp->close(dba->dbp, DB_NOSYNC);
|
||||
dba->dbp->close(dba->dbp, 0);
|
||||
free(dba);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -66,8 +66,8 @@ DBA_OPEN_FUNC(dbm)
|
||||
int filemode = 0644;
|
||||
|
||||
if(info->argc > 0) {
|
||||
convert_to_long(info->argv[0]);
|
||||
filemode = info->argv[0]->value.lval;
|
||||
convert_to_long_ex(info->argv[0]);
|
||||
filemode = (*info->argv[0])->value.lval;
|
||||
}
|
||||
|
||||
if(info->mode == DBA_TRUNC) {
|
||||
|
||||
+2
-2
@@ -59,8 +59,8 @@ DBA_OPEN_FUNC(gdbm)
|
||||
return FAILURE;
|
||||
|
||||
if(info->argc > 0) {
|
||||
convert_to_long(info->argv[0]);
|
||||
filemode = info->argv[0]->value.lval;
|
||||
convert_to_long_ex(info->argv[0]);
|
||||
filemode = (*info->argv[0])->value.lval;
|
||||
}
|
||||
|
||||
dbf = gdbm_open(info->path, 0, gmode, filemode, NULL);
|
||||
|
||||
Loaded 100 of 513 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user