mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-17 22:16:37 +00:00
Compare commits
2730
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e90254086a | ||
|
|
9f0eba9f10 | ||
|
|
f311ab1608 | ||
|
|
6614e8edb4 | ||
|
|
ba69d9958d | ||
|
|
763e1f3a09 | ||
|
|
5f98304f55 | ||
|
|
b0d0aff6a8 | ||
|
|
5a241ca1af | ||
|
|
3d5fd994e7 | ||
|
|
3d75fcae68 | ||
|
|
ff1b4be80c | ||
|
|
4dfdac7fba | ||
|
|
1d4f22bf63 | ||
|
|
b896825e8f | ||
|
|
ac523aa37e | ||
|
|
2a5a064a03 | ||
|
|
66e4f71040 | ||
|
|
515d7e7dae | ||
|
|
cb5891d277 | ||
|
|
8f1ff9e85e | ||
|
|
303dc9e96a | ||
|
|
4b5e7d6618 | ||
|
|
dfaaa8ff95 | ||
|
|
5b315e1304 | ||
|
|
0c03253635 | ||
|
|
d1a6a64675 | ||
|
|
ee5e330bcf | ||
|
|
d47e4b8617 | ||
|
|
b0c7ac2dc1 | ||
|
|
a67157c2c2 | ||
|
|
1c16ed47bc | ||
|
|
50aec09e04 | ||
|
|
89efa59e98 | ||
|
|
e9484d5c37 | ||
|
|
d049d4a6bd | ||
|
|
10249f2dfb | ||
|
|
eadbbec532 | ||
|
|
1702067ac0 | ||
|
|
091dc3840d | ||
|
|
940f58c2de | ||
|
|
e708c0ba70 | ||
|
|
2297f670b1 | ||
|
|
d8a75cf7e5 | ||
|
|
cfa7028d66 | ||
|
|
7d3341bee3 | ||
|
|
234f029727 | ||
|
|
388f7cdccc | ||
|
|
2456af596f | ||
|
|
9b9ab1793f | ||
|
|
684dca9aca | ||
|
|
fd7dc3024c | ||
|
|
947e17b1da | ||
|
|
56adbffdbf | ||
|
|
63526e633e | ||
|
|
cb62c5d5f8 | ||
|
|
e16710f1b5 | ||
|
|
a536df5327 | ||
|
|
3998034acb | ||
|
|
93e9520314 | ||
|
|
22bb1fbe5f | ||
|
|
bb57053f76 | ||
|
|
7f87a319aa | ||
|
|
f9f8691feb | ||
|
|
268a981c3a | ||
|
|
777f8dccca | ||
|
|
de5e2a58df | ||
|
|
322be14458 | ||
|
|
9d640cc990 | ||
|
|
bc8d0782dd | ||
|
|
c80c71f48b | ||
|
|
7c43b6829f | ||
|
|
35e3efbd41 | ||
|
|
d57210fb0b | ||
|
|
cd5b7dd64a | ||
|
|
6a449f2b02 | ||
|
|
a18d4d2085 | ||
|
|
772e4fa41a | ||
|
|
8741aa825d | ||
|
|
ffbb3c8bd8 | ||
|
|
c454a4156e | ||
|
|
ff3b0c84a3 | ||
|
|
f8c0f76881 | ||
|
|
8c9e222689 | ||
|
|
388195de8b | ||
|
|
520602ae4e | ||
|
|
b831ca7d64 | ||
|
|
7d6784d98d | ||
|
|
fe8f752946 | ||
|
|
baadf90fb5 | ||
|
|
c3cc31c745 | ||
|
|
dd43255b27 | ||
|
|
e15172f0e2 | ||
|
|
fce46168d1 | ||
|
|
98087ab562 | ||
|
|
15925864b2 | ||
|
|
0404a02430 | ||
|
|
6e815b76ea | ||
|
|
153ef54498 | ||
|
|
536221be39 | ||
|
|
4a6869c98e | ||
|
|
80a05cd78c | ||
|
|
5b1f7bc8ac | ||
|
|
405d07de96 | ||
|
|
8975f1dceb | ||
|
|
53a5eccf66 | ||
|
|
10b5f74855 | ||
|
|
789aa48043 | ||
|
|
6b8afa5d42 | ||
|
|
fd50caf95a | ||
|
|
0ffda3cc49 | ||
|
|
34c2b0a07c | ||
|
|
66f1be08c8 | ||
|
|
4b57e0e9f7 | ||
|
|
3cda6a750e | ||
|
|
da66298659 | ||
|
|
eb6f625d83 | ||
|
|
6e1dee8c1e | ||
|
|
a4edfc06c5 | ||
|
|
1e5a405c5c | ||
|
|
7957b20b48 | ||
|
|
38cdb8e7b7 | ||
|
|
49b4ac0a1c | ||
|
|
da132274a4 | ||
|
|
d3d350e7ce | ||
|
|
9b509a3bad | ||
|
|
9a63d8af7f | ||
|
|
3fb9b8f42d | ||
|
|
1d92510032 | ||
|
|
34cc1de229 | ||
|
|
5d6516be86 | ||
|
|
80b4f8fa5b | ||
|
|
c141fcbf53 | ||
|
|
21785afbe8 | ||
|
|
39aa0c4d3a | ||
|
|
f14961b005 | ||
|
|
fa9b168161 | ||
|
|
d19a44a6aa | ||
|
|
95ca9db755 | ||
|
|
71d4206074 | ||
|
|
87a491d7b6 | ||
|
|
c6ddfd4440 | ||
|
|
33f9499975 | ||
|
|
84eb48f0a1 | ||
|
|
43d91224f6 | ||
|
|
8f8889d02d | ||
|
|
6c68ac0def | ||
|
|
f5888acfba | ||
|
|
bd900fb66b | ||
|
|
ae11748038 | ||
|
|
a6d9b5ed18 | ||
|
|
b791918443 | ||
|
|
c885f468aa | ||
|
|
090d39b7b1 | ||
|
|
baad58df05 | ||
|
|
ef0bd3d102 | ||
|
|
f29eae1302 | ||
|
|
e3ae196da8 | ||
|
|
f8ecf34bf1 | ||
|
|
b73a6f883d | ||
|
|
70b8e3e8f6 | ||
|
|
cbfa4c88d9 | ||
|
|
2987d5216e | ||
|
|
17ce56825d | ||
|
|
fcefeee914 | ||
|
|
e48192fbb5 | ||
|
|
4c99114a25 | ||
|
|
8b794bb1dd | ||
|
|
e1705c0810 | ||
|
|
e38d7accb7 | ||
|
|
fa02b85082 | ||
|
|
447bf163ef | ||
|
|
7d5cfd3766 | ||
|
|
3ad9d62949 | ||
|
|
565400780b | ||
|
|
a99ca5a64a | ||
|
|
fbbbcdbaa7 | ||
|
|
59b455cf2f | ||
|
|
bd06de9ae9 | ||
|
|
cd40d5df9f | ||
|
|
a35d575ba6 | ||
|
|
785fd93311 | ||
|
|
2db5dc37c8 | ||
|
|
d532ba06c6 | ||
|
|
a5f1a555f3 | ||
|
|
495a957c99 | ||
|
|
9ded807a20 | ||
|
|
f38e760c39 | ||
|
|
7565347ba0 | ||
|
|
988435cf04 | ||
|
|
c532a70746 | ||
|
|
424b2e83b8 | ||
|
|
0b5ca3f7d5 | ||
|
|
79f857b323 | ||
|
|
34a7f94d57 | ||
|
|
4292f89345 | ||
|
|
190e2e73e9 | ||
|
|
988302171a | ||
|
|
e53b791b3e | ||
|
|
177e77fdab | ||
|
|
17fe680117 | ||
|
|
35f43ad274 | ||
|
|
e4e7047e4a | ||
|
|
3ca7eb7485 | ||
|
|
239d30bbee | ||
|
|
7272d029a5 | ||
|
|
f775d18b2c | ||
|
|
aa49d4af62 | ||
|
|
b595b1f01a | ||
|
|
a2bdc522f5 | ||
|
|
aa5c0ffcbf | ||
|
|
727398b2d4 | ||
|
|
e5360259a4 | ||
|
|
111d36a3c8 | ||
|
|
df74f1dfab | ||
|
|
307a234879 | ||
|
|
3ce3e9ba27 | ||
|
|
66175ef9fe | ||
|
|
d1c1e99d98 | ||
|
|
7dca298b21 | ||
|
|
16b6a3f5e4 | ||
|
|
598f9f52b7 | ||
|
|
981e1ae7b8 | ||
|
|
13692ff313 | ||
|
|
6caf633cf7 | ||
|
|
5bbc4114f1 | ||
|
|
165361a515 | ||
|
|
6ebdd64d3c | ||
|
|
c85390a691 | ||
|
|
6303aec7ff | ||
|
|
ce826716d5 | ||
|
|
d6a55b532c | ||
|
|
cefc1f2336 | ||
|
|
6b8059afe9 | ||
|
|
53e19d5102 | ||
|
|
1f0049158a | ||
|
|
6bbf0105af | ||
|
|
8cae0bf725 | ||
|
|
16380b0155 | ||
|
|
3afe0e2ed1 | ||
|
|
0d3085944f | ||
|
|
d973e2c25b | ||
|
|
a52af6cd7c | ||
|
|
66a172c9b4 | ||
|
|
618c98179b | ||
|
|
28b8d17c28 | ||
|
|
e962769fee | ||
|
|
61c0f610dc | ||
|
|
fce92e3ca2 | ||
|
|
2c5c26f205 | ||
|
|
7ef638aa30 | ||
|
|
318a59d302 | ||
|
|
719d995a9d | ||
|
|
5d51452545 | ||
|
|
02c42362ff | ||
|
|
5be482030e | ||
|
|
968d2c5b33 | ||
|
|
ab99eb59fb | ||
|
|
c250702c40 | ||
|
|
e465e94a12 | ||
|
|
1769d69ca3 | ||
|
|
eb4b5ffd22 | ||
|
|
a526b42211 | ||
|
|
62be931c9f | ||
|
|
e008af1364 | ||
|
|
619537208b | ||
|
|
fee1263ca3 | ||
|
|
02d2a5db3a | ||
|
|
fd7153b0f3 | ||
|
|
6df3a21309 | ||
|
|
1f5ee72e2d | ||
|
|
5928970d22 | ||
|
|
cbc8b0f4b4 | ||
|
|
e7c50e4866 | ||
|
|
6caaf70451 | ||
|
|
bcec04f1d9 | ||
|
|
07a8327a0e | ||
|
|
2e738b519f | ||
|
|
b8063c342c | ||
|
|
438e9bdc93 | ||
|
|
bd593d3da6 | ||
|
|
a2ad91df33 | ||
|
|
164cbab7c6 | ||
|
|
cac15508d5 | ||
|
|
d64c9d2823 | ||
|
|
f20194149f | ||
|
|
43793b94f7 | ||
|
|
2ef880c048 | ||
|
|
f18b903d5f | ||
|
|
99f151f1bd | ||
|
|
a1c036b8cf | ||
|
|
390dccacac | ||
|
|
131dfb4a02 | ||
|
|
8df948c5c2 | ||
|
|
97de5b2106 | ||
|
|
8e3fdccb8d | ||
|
|
88426390a8 | ||
|
|
77f4e1c8c7 | ||
|
|
2b0a8049db | ||
|
|
d09ec3261f | ||
|
|
f79e3fa02f | ||
|
|
a9d4cf9023 | ||
|
|
0eeee6b7c8 | ||
|
|
f6c8918a0d | ||
|
|
ce9a9fb1dc | ||
|
|
9097a78187 | ||
|
|
7b89a0037d | ||
|
|
f3c1222da3 | ||
|
|
b54f915280 | ||
|
|
01740bfb0d | ||
|
|
cdb98a04a5 | ||
|
|
0d714115ab | ||
|
|
53bdf0b5cc | ||
|
|
a29791411b | ||
|
|
796ff183b0 | ||
|
|
3c766f379b | ||
|
|
dee9053cb6 | ||
|
|
3570258050 | ||
|
|
b51aa1f36f | ||
|
|
420d668f33 | ||
|
|
ae19180641 | ||
|
|
717acfe9c5 | ||
|
|
8f58728e2b | ||
|
|
b98d2a8261 | ||
|
|
605b1aa394 | ||
|
|
9fb095b50e | ||
|
|
d1a9eca805 | ||
|
|
03e842ccb8 | ||
|
|
fddf89aff7 | ||
|
|
d975678006 | ||
|
|
62adbfc521 | ||
|
|
6bcc8ff0c7 | ||
|
|
eb0e694665 | ||
|
|
ef1d6987fd | ||
|
|
e52889acd9 | ||
|
|
99b4051eca | ||
|
|
cbd3f41ba8 | ||
|
|
edd7025645 | ||
|
|
a712da5cee | ||
|
|
e346a6b538 | ||
|
|
6cac26c21f | ||
|
|
6ce07a85e4 | ||
|
|
a7d1bc96be | ||
|
|
216067b63f | ||
|
|
1868bfdcdf | ||
|
|
a4a4de55f7 | ||
|
|
c9dfab5024 | ||
|
|
897bb1b572 | ||
|
|
1aa01da212 | ||
|
|
cf8545794b | ||
|
|
9c88d20070 | ||
|
|
df2935808e | ||
|
|
4e63aa4566 | ||
|
|
2ffa48b447 | ||
|
|
fb330f795d | ||
|
|
764747ec7f | ||
|
|
0f06ad29a6 | ||
|
|
1326e17536 | ||
|
|
d530b82b26 | ||
|
|
1251445abc | ||
|
|
c5b2c8ba93 | ||
|
|
deff917851 | ||
|
|
c8ffb0ba59 | ||
|
|
eb8cd900a6 | ||
|
|
d180634e07 | ||
|
|
e49ad341bd | ||
|
|
b4e48b952e | ||
|
|
039551788b | ||
|
|
dce9fd0e44 | ||
|
|
5dff860557 | ||
|
|
eea5d09eb9 | ||
|
|
471a07f223 | ||
|
|
66eedaa03d | ||
|
|
467b5e4892 | ||
|
|
169606602b | ||
|
|
01ecd47a05 | ||
|
|
022159a6cd | ||
|
|
4a81e8c111 | ||
|
|
c183168481 | ||
|
|
02b0cef4d8 | ||
|
|
61fcaf564a | ||
|
|
c904bb2b87 | ||
|
|
962d39e86e | ||
|
|
ff843bacf4 | ||
|
|
0ebcdb28af | ||
|
|
b928bdceb8 | ||
|
|
6a8fdc6c5c | ||
|
|
3b649d637d | ||
|
|
34c40031ca | ||
|
|
24b26065e0 | ||
|
|
98bf43f229 | ||
|
|
8e58cc501f | ||
|
|
4f0f3c3ba0 | ||
|
|
0b7fd17c2b | ||
|
|
d7ac0f2c9d | ||
|
|
a14261bc42 | ||
|
|
7864fdfdee | ||
|
|
6dd322874e | ||
|
|
a5418dc0ac | ||
|
|
11fabacc3c | ||
|
|
0e0f3eb097 | ||
|
|
10eb67a3aa | ||
|
|
8ed100e5c5 | ||
|
|
eedf4e973f | ||
|
|
663d46ea23 | ||
|
|
edfd7f9a80 | ||
|
|
458352954d | ||
|
|
88a0832a09 | ||
|
|
32af54f62b | ||
|
|
48ef2d62ba | ||
|
|
e2168491a1 | ||
|
|
d3a7f5be38 | ||
|
|
dd6cccf50e | ||
|
|
45ba649c8e | ||
|
|
45a5555b09 | ||
|
|
102c6ce4b8 | ||
|
|
78d77c1476 | ||
|
|
ad730a374b | ||
|
|
ebe02095df | ||
|
|
ff8a716efe | ||
|
|
7fdfcc28ec | ||
|
|
3701bc4207 | ||
|
|
1cefd77f1c | ||
|
|
9d2bcf2bd0 | ||
|
|
194e8828a1 | ||
|
|
de9f39beda | ||
|
|
2bfe0001da | ||
|
|
e93df14b67 | ||
|
|
a8401a33c6 | ||
|
|
d8d6ff3c4c | ||
|
|
7e0baa7a1d | ||
|
|
50b014b957 | ||
|
|
f8983e467f | ||
|
|
cd9e047d65 | ||
|
|
fe0f40254f | ||
|
|
d5d6c79584 | ||
|
|
1c36e3472f | ||
|
|
4a1da8b6f9 | ||
|
|
bfac4633a5 | ||
|
|
675ce84475 | ||
|
|
b7a8baf1bb | ||
|
|
b9d1b21598 | ||
|
|
7eec1997ef | ||
|
|
8aa6d9cb35 | ||
|
|
a23c64ee8b | ||
|
|
950e7224ad | ||
|
|
5af7dff758 | ||
|
|
375474ce86 | ||
|
|
7f158268aa | ||
|
|
76061b701e | ||
|
|
09d281ff62 | ||
|
|
c012528fe1 | ||
|
|
e46a517ed6 | ||
|
|
1a8da63ca0 | ||
|
|
dae76aa1b5 | ||
|
|
01d478ba56 | ||
|
|
5673378ea6 | ||
|
|
2ffe85ddac | ||
|
|
5a35a6bafc | ||
|
|
d1f1d40527 | ||
|
|
d4b160c0d6 | ||
|
|
b6d29b2347 | ||
|
|
93d51636f7 | ||
|
|
e374f6fd31 | ||
|
|
70345bd222 | ||
|
|
0b7a9cea88 | ||
|
|
1f6c248909 | ||
|
|
1b993610c1 | ||
|
|
746f01802d | ||
|
|
06388f5181 | ||
|
|
ab36e22aeb | ||
|
|
8a8c3eafc8 | ||
|
|
22e9ff476a | ||
|
|
45cfada9a1 | ||
|
|
efc005c078 | ||
|
|
110735c3bb | ||
|
|
a4146cc890 | ||
|
|
4ef2af7c72 | ||
|
|
1db5c7d1e2 | ||
|
|
467c4314b8 | ||
|
|
c106ab8ba0 | ||
|
|
48db9618b8 | ||
|
|
4c818aec33 | ||
|
|
30c5b53ad1 | ||
|
|
a35237795f | ||
|
|
3c51a88d0c | ||
|
|
f27956eb19 | ||
|
|
3bd5d5dc13 | ||
|
|
cf10288201 | ||
|
|
dc5af6decc | ||
|
|
8fe69306dc | ||
|
|
1e7c5b8562 | ||
|
|
1e56dd781a | ||
|
|
a00a1d12ea | ||
|
|
7bb2af41e3 | ||
|
|
898c8ead87 | ||
|
|
13b67621cf | ||
|
|
1e672d4528 | ||
|
|
678508b426 | ||
|
|
ccacfd880b | ||
|
|
b470fe138b | ||
|
|
ecd354ada1 | ||
|
|
6341c60f67 | ||
|
|
c521aeda57 | ||
|
|
640c8226aa | ||
|
|
1c641cfdee | ||
|
|
01a4220954 | ||
|
|
0aed5fd91c | ||
|
|
7fcaa66bcd | ||
|
|
c6449f307a | ||
|
|
8c65f81676 | ||
|
|
5ec49e9c79 | ||
|
|
666a53a247 | ||
|
|
950fb739f8 | ||
|
|
8fb954ae4f | ||
|
|
7213c743f0 | ||
|
|
bc7abb3300 | ||
|
|
ae1043ba0d | ||
|
|
a0e46521e3 | ||
|
|
3637589db1 | ||
|
|
ebd9e89fcf | ||
|
|
949574d027 | ||
|
|
c07a056dac | ||
|
|
56dcb7ed07 | ||
|
|
844938ec4e | ||
|
|
635d7fbfae | ||
|
|
8715b55ce0 | ||
|
|
a982eb2267 | ||
|
|
124fe30f03 | ||
|
|
1ae552c7d1 | ||
|
|
178ae887ab | ||
|
|
181da8f232 | ||
|
|
86920d4c68 | ||
|
|
7744e04b42 | ||
|
|
015884dda5 | ||
|
|
0ebb7335c9 | ||
|
|
2980f7f92d | ||
|
|
9786b16e9f | ||
|
|
833339c692 | ||
|
|
0d9c0616f9 | ||
|
|
9cd4929417 | ||
|
|
1e949e6caa | ||
|
|
e50b33c240 | ||
|
|
44cf237a72 | ||
|
|
90331b27ac | ||
|
|
a603902561 | ||
|
|
f1b988d2af | ||
|
|
3bbc7466fc | ||
|
|
636b8927c6 | ||
|
|
2bd6846adc | ||
|
|
fb39eda0d8 | ||
|
|
afccb58612 | ||
|
|
8c82566b48 | ||
|
|
030c0fd415 | ||
|
|
73bd59943c | ||
|
|
abb31591ff | ||
|
|
81c4fd5efc | ||
|
|
7a2e01c592 | ||
|
|
62227a03b1 | ||
|
|
69d1e788c0 | ||
|
|
9bfd5e5e55 | ||
|
|
fb69f854af | ||
|
|
8e12a0126e | ||
|
|
b5447a4d7a | ||
|
|
ac309e9696 | ||
|
|
d3007a8ca9 | ||
|
|
ce3c002a16 | ||
|
|
0399d94e35 | ||
|
|
51491d06f1 | ||
|
|
5dadceb115 | ||
|
|
8a5bc5b674 | ||
|
|
0a142bb94e | ||
|
|
80db548369 | ||
|
|
bf913cc61d | ||
|
|
a9abc3ab6b | ||
|
|
385d1aa664 | ||
|
|
fcd7794c2b | ||
|
|
36c87e18d6 | ||
|
|
f78e1408c5 | ||
|
|
1895a09749 | ||
|
|
cecfdbe71e | ||
|
|
e5835b63c9 | ||
|
|
cf9ea9d9cd | ||
|
|
ff53dde157 | ||
|
|
e319b5f6a5 | ||
|
|
57735564ec | ||
|
|
148a3396ec | ||
|
|
7bd0936291 | ||
|
|
4197a68602 | ||
|
|
c3bff72209 | ||
|
|
f9d1b16d8b | ||
|
|
8a86e37d69 | ||
|
|
faf4f764b7 | ||
|
|
3d939af4a3 | ||
|
|
69a44fdae8 | ||
|
|
f9fc8f78ab | ||
|
|
a33c135b0a | ||
|
|
25df65b0b8 | ||
|
|
ff4031585a | ||
|
|
3c61d015c2 | ||
|
|
9b916e6a48 | ||
|
|
78a1fdfcaa | ||
|
|
93feb306f8 | ||
|
|
e3e75eb2da | ||
|
|
ec93ec1fb1 | ||
|
|
e191baa1a3 | ||
|
|
fd4e7282fe | ||
|
|
09d2f7e280 | ||
|
|
0f54988877 | ||
|
|
d348a83a72 | ||
|
|
27ca66b410 | ||
|
|
21f77edba0 | ||
|
|
5df3ca812b | ||
|
|
3563e0adba | ||
|
|
f1eefa64ec | ||
|
|
df4547a3df | ||
|
|
0fa7618f7c | ||
|
|
94cca68983 | ||
|
|
cab5f6afb8 | ||
|
|
9a8a9d774e | ||
|
|
3d3d385d37 | ||
|
|
887c672a6c | ||
|
|
7a0855aeb5 | ||
|
|
83d987b48d | ||
|
|
e09b2d0df4 | ||
|
|
58acf7dbe1 | ||
|
|
72c4912f58 | ||
|
|
773e306df2 | ||
|
|
7182e722ca | ||
|
|
ee82f87cbf | ||
|
|
251cda4941 | ||
|
|
5d10b23a78 | ||
|
|
1ea8d6afac | ||
|
|
dec92a445f | ||
|
|
617266e33e | ||
|
|
417f74451f | ||
|
|
112525ea9f | ||
|
|
2aaa538aef | ||
|
|
be6afb3fcc | ||
|
|
22dba603f5 | ||
|
|
4571d8ddea | ||
|
|
521f03c184 | ||
|
|
0eb51100b7 | ||
|
|
6d51f4a788 | ||
|
|
32dffec0f8 | ||
|
|
cd8c4268ec | ||
|
|
03851ced5f | ||
|
|
ae0d73e87d | ||
|
|
c9158aec30 | ||
|
|
34e74f8afe | ||
|
|
cf1d0f1844 | ||
|
|
49b2166e1a | ||
|
|
99133bf4bb | ||
|
|
f51150584c | ||
|
|
30b43665e8 | ||
|
|
3fdc316faf | ||
|
|
4686a3b50e | ||
|
|
0236982d6d | ||
|
|
2472700dd1 | ||
|
|
08bd9586fb | ||
|
|
61ceb9e5ab | ||
|
|
c32de173c3 | ||
|
|
78cec9f33e | ||
|
|
39af86f017 | ||
|
|
d91068a88a | ||
|
|
f9bc6ac04e | ||
|
|
1ec84f9c21 | ||
|
|
22bfb799a7 | ||
|
|
8a3edf2cab | ||
|
|
bd29009c31 | ||
|
|
7741269930 | ||
|
|
3ac4c96641 | ||
|
|
072755ca8d | ||
|
|
6ba87f8cf6 | ||
|
|
398923de53 | ||
|
|
cde504ad27 | ||
|
|
8090fbb686 | ||
|
|
0302ee5992 | ||
|
|
88de714c41 | ||
|
|
ccc12f8801 | ||
|
|
d0fd31018b | ||
|
|
5e0dec4a40 | ||
|
|
c2588fd0bd | ||
|
|
6ceddbb1d5 | ||
|
|
e80b2b13fa | ||
|
|
c5cf13eb29 | ||
|
|
7f689fc044 | ||
|
|
a8b0d9609c | ||
|
|
dc5cd319e5 | ||
|
|
cc590f49f2 | ||
|
|
767ea7a7e4 | ||
|
|
f365665213 | ||
|
|
11f4909068 | ||
|
|
2936860d24 | ||
|
|
eb7979ab5b | ||
|
|
650008eea1 | ||
|
|
8580374aa1 | ||
|
|
af77bc0583 | ||
|
|
d1f9ac5bb9 | ||
|
|
fdb5ce845f | ||
|
|
92437e9db1 | ||
|
|
bad35f5484 | ||
|
|
c80906e4cc | ||
|
|
400ca09018 | ||
|
|
0f82e6de23 | ||
|
|
7114e3f9a9 | ||
|
|
674f4bac47 | ||
|
|
9ebc920044 | ||
|
|
7e0a18d014 | ||
|
|
e043439ff6 | ||
|
|
957327e8bc | ||
|
|
33789f8cdf | ||
|
|
c97760776b | ||
|
|
aa09d60d7d | ||
|
|
86c03cceb0 | ||
|
|
1596e646fc | ||
|
|
f04936f8a1 | ||
|
|
a786fc4ab7 | ||
|
|
b458902704 | ||
|
|
715ff77344 | ||
|
|
4099600941 | ||
|
|
3df1e68fe9 | ||
|
|
a5b03338f8 | ||
|
|
aeb3476923 | ||
|
|
87fbbfa692 | ||
|
|
a859e83392 | ||
|
|
a8bb2a86b1 | ||
|
|
09915a1597 | ||
|
|
a704be730c | ||
|
|
1e438060af | ||
|
|
11acad981c | ||
|
|
31c3dfdf52 | ||
|
|
d7779d8bdf | ||
|
|
e5a2f0f95c | ||
|
|
1e632ffdee | ||
|
|
5354940f93 | ||
|
|
3564810150 | ||
|
|
f428c40ac2 | ||
|
|
073bb3fdf8 | ||
|
|
db3d16dca1 | ||
|
|
6173835699 | ||
|
|
0aefa3e037 | ||
|
|
7dd8b901e6 | ||
|
|
29571bf2b1 | ||
|
|
44845ea24b | ||
|
|
760a17729e | ||
|
|
4a4d185637 | ||
|
|
f4e20147b5 | ||
|
|
f0ed744125 | ||
|
|
5fcb963f09 | ||
|
|
d20eec24ce | ||
|
|
7bde3adbd4 | ||
|
|
efb51322c1 | ||
|
|
03c844305f | ||
|
|
e2e6363488 | ||
|
|
08ff225a46 | ||
|
|
6d77362190 | ||
|
|
8bff24d65b | ||
|
|
8669a15755 | ||
|
|
69223ccebd | ||
|
|
c2279a0217 | ||
|
|
46e672243a | ||
|
|
ac0e07ecda | ||
|
|
0aa5f2ea3c | ||
|
|
4e6e741af8 | ||
|
|
ccc2b1b8ce | ||
|
|
31be486539 | ||
|
|
f615ec59cb | ||
|
|
7f008ae327 | ||
|
|
c20fb0c22d | ||
|
|
f1941064de | ||
|
|
13e9da59ff | ||
|
|
8ab33a4d13 | ||
|
|
521e1d218c | ||
|
|
6baa5bc2dc | ||
|
|
fe24b820be | ||
|
|
10503a3b92 | ||
|
|
2a6fbb620c | ||
|
|
4a658e8b51 | ||
|
|
c693ca137f | ||
|
|
e2e7283a30 | ||
|
|
ae827bae28 | ||
|
|
ce42de535a | ||
|
|
08838fe79a | ||
|
|
ed2933342c | ||
|
|
7fc980e1fa | ||
|
|
fb20aee667 | ||
|
|
69ddfd0acb | ||
|
|
1dd49bd4d6 | ||
|
|
c82eca90f4 | ||
|
|
654b75694a | ||
|
|
dc6d46c180 | ||
|
|
602914d824 | ||
|
|
7342fc7a28 | ||
|
|
7894d58ae5 | ||
|
|
74011b6767 | ||
|
|
dee6170da3 | ||
|
|
ffef0d8d44 | ||
|
|
b0f87cdb5f | ||
|
|
3f65342eb2 | ||
|
|
33ceae2809 | ||
|
|
afedd22f19 | ||
|
|
4132ec828d | ||
|
|
23dfe91b60 | ||
|
|
f3ac213120 | ||
|
|
fc5daee434 | ||
|
|
f626eb4986 | ||
|
|
59ddaefd72 | ||
|
|
0d6a794d85 | ||
|
|
9a751419cf | ||
|
|
cb35b7e4ed | ||
|
|
07f7b8c1e3 | ||
|
|
010f7850e0 | ||
|
|
c88ccc49a1 | ||
|
|
3f43d41ba6 | ||
|
|
7a3e2ee70a | ||
|
|
f4357f3254 | ||
|
|
c32bba9644 | ||
|
|
3ba2d1bf88 | ||
|
|
7d5e93ac57 | ||
|
|
fa89a5f940 | ||
|
|
fe22dc5ff8 | ||
|
|
33f8ab3800 | ||
|
|
354272315a | ||
|
|
ee3c06a533 | ||
|
|
ab6d34d8ba | ||
|
|
72fcf1310a | ||
|
|
3dd91d548e | ||
|
|
b826d6a43d | ||
|
|
fdbea075fa | ||
|
|
30da5fd8fc | ||
|
|
63b7056f9a | ||
|
|
a9ec11476c | ||
|
|
19de3be052 | ||
|
|
cd72153455 | ||
|
|
36c1a9a39d | ||
|
|
9930bab2a6 | ||
|
|
7436c0791b | ||
|
|
aaaaf46846 | ||
|
|
831459885e | ||
|
|
62d5504706 | ||
|
|
3ee9304cd9 | ||
|
|
b8f9b48098 | ||
|
|
9377ed98dd | ||
|
|
7713553d85 | ||
|
|
b345acb577 | ||
|
|
873df0ae89 | ||
|
|
fa254b6267 | ||
|
|
6953135774 | ||
|
|
b81cc1daf4 | ||
|
|
679bcde68b | ||
|
|
2df8e7341e | ||
|
|
ec9612aa44 | ||
|
|
54fa1a77d7 | ||
|
|
df81aba99f | ||
|
|
c4e2c84fa2 | ||
|
|
fdb62f9ce7 | ||
|
|
dc704e26fe | ||
|
|
686bd5724b | ||
|
|
166c703eb7 | ||
|
|
0e67838ecf | ||
|
|
f78f340288 | ||
|
|
8154734529 | ||
|
|
5797876236 | ||
|
|
498ce88d67 | ||
|
|
0060f95699 | ||
|
|
4b87dccefc | ||
|
|
17b84ad7e7 | ||
|
|
fbfd92c775 | ||
|
|
661758348c | ||
|
|
06358248a4 | ||
|
|
788feca4ae | ||
|
|
86d6389db4 | ||
|
|
30f6031bfa | ||
|
|
f51b56cfed | ||
|
|
8570e0e3ba | ||
|
|
0d194ec80b | ||
|
|
198537b70f | ||
|
|
5db0f958c4 | ||
|
|
e2dc9f3bc9 | ||
|
|
89d4eedaf9 | ||
|
|
d8f2900589 | ||
|
|
0a09f95dd7 | ||
|
|
494ed67194 | ||
|
|
2b26bb5086 | ||
|
|
cc7a71592c | ||
|
|
ec6c171fdd | ||
|
|
24abc76a93 | ||
|
|
61b88ae8ed | ||
|
|
dc91d47014 | ||
|
|
72805c7d9b | ||
|
|
aef06da015 | ||
|
|
0b33ac7627 | ||
|
|
4802fbb8b8 | ||
|
|
a88946c70d | ||
|
|
e905fabe0d | ||
|
|
f2a236ff83 | ||
|
|
6c4d6ba5e3 | ||
|
|
d0f3764ee2 | ||
|
|
b6e4841ec7 | ||
|
|
cad04f5579 | ||
|
|
a85e57ebc3 | ||
|
|
948edc9caf | ||
|
|
dedc130786 | ||
|
|
da7a5fc29d | ||
|
|
69eb908f06 | ||
|
|
f2471fd50a | ||
|
|
599813d73a | ||
|
|
884a614e67 | ||
|
|
5df40a8a1d | ||
|
|
8d0c626fe6 | ||
|
|
6fb3301416 | ||
|
|
80d6eccf6e | ||
|
|
0022a2f81a | ||
|
|
69a894a2f0 | ||
|
|
5ad95a203c | ||
|
|
eefc66419c | ||
|
|
9f6976d6d5 | ||
|
|
515b7e74df | ||
|
|
bf58db4bc2 | ||
|
|
79a89ef8fe | ||
|
|
281a8aebda | ||
|
|
3b9bcd7443 | ||
|
|
6bc1bf4c93 | ||
|
|
df3d78cbac | ||
|
|
dd497bdc1a | ||
|
|
cae3b7dff5 | ||
|
|
5989ae5dc1 | ||
|
|
733d94909f | ||
|
|
52288d4f05 | ||
|
|
8ca13c97c2 | ||
|
|
f5520fd465 | ||
|
|
fca9539d63 | ||
|
|
8eb698a847 | ||
|
|
19ea1a0bc9 | ||
|
|
ce86302f8a | ||
|
|
99e2820bed | ||
|
|
a931caf2b2 | ||
|
|
f6a7542f73 | ||
|
|
6767b4df68 | ||
|
|
b2e90b4e8b | ||
|
|
645b2736a3 | ||
|
|
92c87b1ba9 | ||
|
|
dca0d3f454 | ||
|
|
82c5c690c9 | ||
|
|
f1dfd1f5f7 | ||
|
|
0b516602fd | ||
|
|
c3d4066b48 | ||
|
|
cf4863788e | ||
|
|
3e80436fb8 | ||
|
|
dbf959d04d | ||
|
|
4f5717d0a0 | ||
|
|
095e13632c | ||
|
|
a4d401a67d | ||
|
|
8d2d181e69 | ||
|
|
0b6d923bae | ||
|
|
f8f7dcf0cf | ||
|
|
d4def2d2a3 | ||
|
|
b45ee4b1ed | ||
|
|
ec70bc274f | ||
|
|
fe50664d4d | ||
|
|
0d383d9373 | ||
|
|
95310ad5e0 | ||
|
|
7613e064f8 | ||
|
|
7a2d83acdc | ||
|
|
0628b33278 | ||
|
|
0d36199cf9 | ||
|
|
de2cea47c0 | ||
|
|
a493cdc92c | ||
|
|
fc4b7bac9c | ||
|
|
358bdc8832 | ||
|
|
1e3d94b70b | ||
|
|
15c8fa99fb | ||
|
|
83f567abf3 | ||
|
|
113b87736b | ||
|
|
5da6bf51a4 | ||
|
|
0825ae458d | ||
|
|
164e4e50b9 | ||
|
|
e20cdc315e | ||
|
|
660fcd93e0 | ||
|
|
1743bb0346 | ||
|
|
b19376c6f5 | ||
|
|
dd537aaaa6 | ||
|
|
564f9795f8 | ||
|
|
632b054aba | ||
|
|
b2266104b1 | ||
|
|
c07dcd1b8d | ||
|
|
b64e872e84 | ||
|
|
c801cfb879 | ||
|
|
ea90eab146 | ||
|
|
9595fb76f3 | ||
|
|
52b1e3482d | ||
|
|
1d4e698aca | ||
|
|
e2905f1b5c | ||
|
|
a481fddfb3 | ||
|
|
ce38236221 | ||
|
|
b05bd34af5 | ||
|
|
5c8abc75af | ||
|
|
1191f6bf7c | ||
|
|
b93e5ecbe0 | ||
|
|
ca4147055a | ||
|
|
5d5b09e1a7 | ||
|
|
1f64d98753 | ||
|
|
a3c17cf766 | ||
|
|
e13285ded7 | ||
|
|
8e7a5098dd | ||
|
|
06e6094a53 | ||
|
|
430bfdd878 | ||
|
|
0fc8ff61b2 | ||
|
|
b87df8f210 | ||
|
|
c7e2d8ef35 | ||
|
|
8d3ce80f48 | ||
|
|
953fe189da | ||
|
|
952f58b66d | ||
|
|
8d19edc495 | ||
|
|
be00d130e6 | ||
|
|
ace102eb00 | ||
|
|
9fa7428cf5 | ||
|
|
f1d5167ae3 | ||
|
|
9e9ba7d974 | ||
|
|
1a8683f976 | ||
|
|
aecae7c3af | ||
|
|
e404a471e7 | ||
|
|
e3dd0a28ce | ||
|
|
5ef03c4ff8 | ||
|
|
96c648c9f7 | ||
|
|
8aac6e7d3d | ||
|
|
0118f62195 | ||
|
|
42d15298d7 | ||
|
|
e0a48fe623 | ||
|
|
32ffe0ba6f | ||
|
|
1152b4c29e | ||
|
|
58eaa24a90 | ||
|
|
5c5ccc9844 | ||
|
|
ddbcbb666d | ||
|
|
b7f2d80a28 | ||
|
|
105be1513d | ||
|
|
ddc36fb776 | ||
|
|
3220bb570e | ||
|
|
5369a7b7b4 | ||
|
|
b9387791a8 | ||
|
|
563c97cf82 | ||
|
|
ea9be8b88b | ||
|
|
83ce0793a7 | ||
|
|
cdb7471c36 | ||
|
|
974671eced | ||
|
|
4b6594c5e9 | ||
|
|
dc8980bab2 | ||
|
|
b80b8381d4 | ||
|
|
39aa59bdec | ||
|
|
095f1d91b1 | ||
|
|
3b77fd37a9 | ||
|
|
0c46488147 | ||
|
|
6f08c178b9 | ||
|
|
6ccea93d6b | ||
|
|
d8b6163f96 | ||
|
|
59ec1bdefb | ||
|
|
fa7c418b79 | ||
|
|
68e54e9922 | ||
|
|
5c5ec88292 | ||
|
|
94a724f686 | ||
|
|
a20e90abb3 | ||
|
|
0a14a32c78 | ||
|
|
382653aebc | ||
|
|
bc220aa000 | ||
|
|
fc0813f11a | ||
|
|
e16c38b3f5 | ||
|
|
b992f02935 | ||
|
|
232bcff77e | ||
|
|
9d2738cf1d | ||
|
|
dc93a62cbb | ||
|
|
9786e4450a | ||
|
|
2a17453e42 | ||
|
|
ec997d5c5b | ||
|
|
071c01a019 | ||
|
|
f4c9d96f2e | ||
|
|
b73919eb50 | ||
|
|
57c20bf836 | ||
|
|
a6face98c8 | ||
|
|
8cf5a64885 | ||
|
|
e5df341868 | ||
|
|
21416083b1 | ||
|
|
e297737cb1 | ||
|
|
7c9435e741 | ||
|
|
662280560f | ||
|
|
ed699b4263 | ||
|
|
645156918c | ||
|
|
5a7c8f46c9 | ||
|
|
4b78e0aca6 | ||
|
|
5da62dd57e | ||
|
|
44908999a8 | ||
|
|
f9cdcc583c | ||
|
|
df96f5f8d5 | ||
|
|
1651fbff64 | ||
|
|
75a00321c3 | ||
|
|
4f5f93efa1 | ||
|
|
5132321c3e | ||
|
|
0e2ac7d992 | ||
|
|
972ef3f31b | ||
|
|
dd05651046 | ||
|
|
eb786dc055 | ||
|
|
80486c95be | ||
|
|
36faff14b1 | ||
|
|
12e319b091 | ||
|
|
91f1f7d3c3 | ||
|
|
b27718ff00 | ||
|
|
4789127d27 | ||
|
|
5c366e4e52 | ||
|
|
ca10d9b2de | ||
|
|
389eca0c1b | ||
|
|
18c44ad873 | ||
|
|
a2984a5d50 | ||
|
|
0b8369196b | ||
|
|
4928f63821 | ||
|
|
94d46c4fbc | ||
|
|
a1c480154a | ||
|
|
c0919bbd41 | ||
|
|
46a7a05d57 | ||
|
|
50a93b5678 | ||
|
|
64c974e8b6 | ||
|
|
5f8e4c0474 | ||
|
|
503bb3bedb | ||
|
|
883bd2b1de | ||
|
|
7412bd5c84 | ||
|
|
e40268d07c | ||
|
|
ba37ae2c0b | ||
|
|
dec71471df | ||
|
|
e223693d0c | ||
|
|
9e10ac5b1d | ||
|
|
149c7f2a8a | ||
|
|
9022a4bdbd | ||
|
|
a918842f30 | ||
|
|
bbe0df125e | ||
|
|
70b2013f9e | ||
|
|
9aba6a94d3 | ||
|
|
f9e9cab7ac | ||
|
|
0540bbe5af | ||
|
|
c1c8422dbf | ||
|
|
2b3a575ab3 | ||
|
|
a9755246c3 | ||
|
|
46d61dd857 | ||
|
|
ac8e7b96f4 | ||
|
|
7ecf70047b | ||
|
|
900aae165e | ||
|
|
eea8ae4fd1 | ||
|
|
a15b08a709 | ||
|
|
429cf808e6 | ||
|
|
fe1147b01a | ||
|
|
284b0ae24e | ||
|
|
19a9577901 | ||
|
|
a81e6bc04e | ||
|
|
708811184d | ||
|
|
9cbcade6c9 | ||
|
|
67f6974373 | ||
|
|
fae56aee27 | ||
|
|
6f88327a12 | ||
|
|
c31f6fbd90 | ||
|
|
963d31198a | ||
|
|
a51d3058f7 | ||
|
|
03b562c93e | ||
|
|
a81a1c7a1a | ||
|
|
207167c54b | ||
|
|
61792f9cc5 | ||
|
|
2ad8fc6281 | ||
|
|
d6c66f3b7c | ||
|
|
d191777b3f | ||
|
|
02f7ee57f7 | ||
|
|
f1c268d79a | ||
|
|
43e04d5a77 | ||
|
|
c007a7232d | ||
|
|
39b4163bfb | ||
|
|
1dc32c2d52 | ||
|
|
ae6b0ea03f | ||
|
|
d5bfb21f2f | ||
|
|
0a3482f213 | ||
|
|
830715a6d7 | ||
|
|
4f15966d1b | ||
|
|
44e0d27685 | ||
|
|
297ca5c08a | ||
|
|
df77365d29 | ||
|
|
8367275477 | ||
|
|
0b91e2fcd3 | ||
|
|
2b36f579f1 | ||
|
|
544b65493e | ||
|
|
93135c8b32 | ||
|
|
1b7bfe5bbf | ||
|
|
d39724c536 | ||
|
|
8b1b39b5b5 | ||
|
|
e519d9ca6c | ||
|
|
0866fef791 | ||
|
|
4e1f9412cf | ||
|
|
58e1d9ddd6 | ||
|
|
3bc8debefe | ||
|
|
3ee4f3ea7e | ||
|
|
9e601aaea7 | ||
|
|
2e2642cfb3 | ||
|
|
d748c0827d | ||
|
|
5d72b491c3 | ||
|
|
b128f39837 | ||
|
|
38c2b8ec63 | ||
|
|
5097f64256 | ||
|
|
a1608562ae | ||
|
|
b8fd674453 | ||
|
|
f0c7e0275f | ||
|
|
c9911a151e | ||
|
|
1665cba750 | ||
|
|
603d5ff5d8 | ||
|
|
938598b8d2 | ||
|
|
f2ff9eeef5 | ||
|
|
81138a641a | ||
|
|
4cb9a483d2 | ||
|
|
53263049d2 | ||
|
|
689094634e | ||
|
|
a92fde9736 | ||
|
|
7b77b063a6 | ||
|
|
3dae749f6f | ||
|
|
a5bb1466a3 | ||
|
|
b6b79a8d90 | ||
|
|
6727342b7a | ||
|
|
32a3c3987e | ||
|
|
2acd0ad1fe | ||
|
|
2206a9f7dd | ||
|
|
a4016620bf | ||
|
|
5424369f3a | ||
|
|
9ffd5b5595 | ||
|
|
aa6769dde2 | ||
|
|
c6c261e922 | ||
|
|
9f598b187c | ||
|
|
06e504d32a | ||
|
|
efabab1a34 | ||
|
|
5f883ac86d | ||
|
|
bba955fd4f | ||
|
|
25b95d2a97 | ||
|
|
c7100c4a1a | ||
|
|
5684953d59 | ||
|
|
d337cbaae8 | ||
|
|
67f867311b | ||
|
|
021631d5eb | ||
|
|
da1cca03ae | ||
|
|
804861c5ac | ||
|
|
c8e1057d1f | ||
|
|
d17e3d6b18 | ||
|
|
e39d70fff6 | ||
|
|
beb6916cfc | ||
|
|
97c9603b02 | ||
|
|
7f54318897 | ||
|
|
a66283c7b9 | ||
|
|
93f9fc77ad | ||
|
|
8ec20a16ed | ||
|
|
09ac924559 | ||
|
|
578726ca2f | ||
|
|
38e458b86d | ||
|
|
73c6fbff7e | ||
|
|
e663d856b3 | ||
|
|
64f91d80fa | ||
|
|
c5d5c69bfe | ||
|
|
cc0d6ac19c | ||
|
|
232b90454f | ||
|
|
897b413c2d | ||
|
|
c981be0bca | ||
|
|
4cdcf638ce | ||
|
|
5b8c5bedac | ||
|
|
744fe82e0a | ||
|
|
95f45d6c50 | ||
|
|
85e9d69f23 | ||
|
|
cd3305a2d1 | ||
|
|
a0ba444959 | ||
|
|
1cf5c33627 | ||
|
|
ed6e734047 | ||
|
|
12aae5ab66 | ||
|
|
83252f57b6 | ||
|
|
34ba0394cb | ||
|
|
adc5bbc925 | ||
|
|
d02a351061 | ||
|
|
02c3eb2bd5 | ||
|
|
9130f05d08 | ||
|
|
86cff779c3 | ||
|
|
5628b3f0ab | ||
|
|
436ffa8a18 | ||
|
|
b251a4778d | ||
|
|
982f4b525c | ||
|
|
f118d94783 | ||
|
|
89f99967b8 | ||
|
|
0fc483fed6 | ||
|
|
5c6bf64509 | ||
|
|
e4409a8556 | ||
|
|
a7c8bfb9fb | ||
|
|
56fc855afd | ||
|
|
4bd1af056e | ||
|
|
2cb6745cf0 | ||
|
|
5115342c6e | ||
|
|
a9159c2eec | ||
|
|
4766abb0e5 | ||
|
|
ad0f9dbccb | ||
|
|
f133141bfb | ||
|
|
731404c0ba | ||
|
|
0c2b366ce1 | ||
|
|
3ba4105fde | ||
|
|
4ee5cad9f9 | ||
|
|
f57d8a2c25 | ||
|
|
1e344cf010 | ||
|
|
da3db3d864 | ||
|
|
49a34c6811 | ||
|
|
d7dc66bdbd | ||
|
|
875ac538fb | ||
|
|
e3bbb4bc6c | ||
|
|
fddd1201b4 | ||
|
|
5e296bfe97 | ||
|
|
6882044a46 | ||
|
|
1ddc9ff852 | ||
|
|
794f312176 | ||
|
|
7c70003d22 | ||
|
|
8372b2baf1 | ||
|
|
c56888da7c | ||
|
|
eb70d8361b | ||
|
|
5c40dfa374 | ||
|
|
f55b70e764 | ||
|
|
7a6dddcc0b | ||
|
|
2a15b85ca1 | ||
|
|
44e178e089 | ||
|
|
ebce1ad787 | ||
|
|
db160e8164 | ||
|
|
b491796a4c | ||
|
|
1fc8733dbf | ||
|
|
6e2bf336f6 | ||
|
|
14e457d374 | ||
|
|
32aa845957 | ||
|
|
38cb3de2bc | ||
|
|
3e2a1034cb | ||
|
|
d437ba9071 | ||
|
|
8153dc5772 | ||
|
|
da1bfb4211 | ||
|
|
d3dd529c23 | ||
|
|
c43fe80d6f | ||
|
|
d0395d6f5b | ||
|
|
991f9ef9f4 | ||
|
|
2f41e1b979 | ||
|
|
617e1b054c | ||
|
|
074af16d34 | ||
|
|
538464f34d | ||
|
|
f44afc6e99 | ||
|
|
69ff396312 | ||
|
|
18e0850ba1 | ||
|
|
de0d354736 | ||
|
|
d8e64d623e | ||
|
|
ce283e2326 | ||
|
|
6a2da70f94 | ||
|
|
eefbe904b2 | ||
|
|
997e63993b | ||
|
|
301f8feab4 | ||
|
|
57b398af1f | ||
|
|
a73ba4b238 | ||
|
|
34933225f6 | ||
|
|
effa5bb024 | ||
|
|
daf81344af | ||
|
|
8a4805c831 | ||
|
|
fc8c923bb2 | ||
|
|
06dab5e7e5 | ||
|
|
491a315c11 | ||
|
|
131d9cb2dc | ||
|
|
47442c4c85 | ||
|
|
179672a980 | ||
|
|
007c325cc1 | ||
|
|
983cc700a9 | ||
|
|
77688ff3b5 | ||
|
|
9e2fb7bb41 | ||
|
|
0d21940d54 | ||
|
|
ef426d467c | ||
|
|
53586378b0 | ||
|
|
eb224c7850 | ||
|
|
1bab18a00c | ||
|
|
cc6ca27dcb | ||
|
|
0769927e01 | ||
|
|
5ed7a47a79 | ||
|
|
cf534695d2 | ||
|
|
a82b3034b1 | ||
|
|
708109e950 | ||
|
|
523f3cce5f | ||
|
|
37282c9043 | ||
|
|
fdc53674c8 | ||
|
|
38a4ccddb6 | ||
|
|
8a64f51101 | ||
|
|
24302e89e5 | ||
|
|
7dfcbd13c2 | ||
|
|
57b4e1a3ee | ||
|
|
2b1daf73eb | ||
|
|
8a94c8d598 | ||
|
|
9c3d6304dd | ||
|
|
9df7df3293 | ||
|
|
72b57c66f0 | ||
|
|
f9547241d5 | ||
|
|
69a16e9693 | ||
|
|
ec9aae474a | ||
|
|
27b736a192 | ||
|
|
0a52ef6439 | ||
|
|
149e6181e5 | ||
|
|
5f6ad55543 | ||
|
|
f72bcaa648 | ||
|
|
1e31b7755c | ||
|
|
c97314257c | ||
|
|
5cd7bf59b3 | ||
|
|
e282cefe20 | ||
|
|
fe92fef608 | ||
|
|
0ccbd9d9ec | ||
|
|
41eef61c69 | ||
|
|
4179e85693 | ||
|
|
1469f420d6 | ||
|
|
3642282b07 | ||
|
|
c7040b71bc | ||
|
|
5e18db46c3 | ||
|
|
76a32c0ce8 | ||
|
|
b7cd2bfa8e | ||
|
|
b543f9959c | ||
|
|
521c8af6a4 | ||
|
|
f50de70308 | ||
|
|
af9a852bf1 | ||
|
|
88041c4fc7 | ||
|
|
ee16ee2a38 | ||
|
|
fcf0afce17 | ||
|
|
6c8f9bf3b4 | ||
|
|
e9d126a7d3 | ||
|
|
68d4298e71 | ||
|
|
2c975a2b06 | ||
|
|
cc2c9d8f0f | ||
|
|
a692f15568 | ||
|
|
6db2262102 | ||
|
|
1a8dfac59d | ||
|
|
74d30dff7b | ||
|
|
f76e0a4077 | ||
|
|
a65971221f | ||
|
|
27e5c89b21 | ||
|
|
cdb7254384 | ||
|
|
a4de43fe87 | ||
|
|
a97eccaba3 | ||
|
|
1f822b98ce | ||
|
|
0cc5c94b37 | ||
|
|
31803785fd | ||
|
|
2cb0e69b51 | ||
|
|
a3ac1e5e59 | ||
|
|
0340340673 | ||
|
|
3f029b61e8 | ||
|
|
6fb861d7a8 | ||
|
|
df03379b4e | ||
|
|
4ce6480745 | ||
|
|
fea19e97db | ||
|
|
a582ce8735 | ||
|
|
69d7ea4f30 | ||
|
|
e4b86c2cd5 | ||
|
|
b280bec492 | ||
|
|
5d568a2e22 | ||
|
|
b4db46606e | ||
|
|
6da32c3314 | ||
|
|
491792e0d0 | ||
|
|
8419dc332b | ||
|
|
8c79054ad2 | ||
|
|
7fd92b524d | ||
|
|
b43f85d641 | ||
|
|
9df63e183e | ||
|
|
b763b25c96 | ||
|
|
3b2bcf3c41 | ||
|
|
7ec4e5e21b | ||
|
|
6a048bfd64 | ||
|
|
7b31a19305 | ||
|
|
70003624fa | ||
|
|
db546462b6 | ||
|
|
fcd82d34c5 | ||
|
|
a2d42419a5 | ||
|
|
a0f70aa618 | ||
|
|
04daa555aa | ||
|
|
b880fb5bcc | ||
|
|
96f01b1414 | ||
|
|
a9f0e0176b | ||
|
|
2572b088d0 | ||
|
|
863e6fd242 | ||
|
|
5dba477467 | ||
|
|
18e1e63e78 | ||
|
|
6a7bc777ca | ||
|
|
1e4e9b34e2 | ||
|
|
7e576d36e8 | ||
|
|
c8d0be50c5 | ||
|
|
c0cede82f1 | ||
|
|
1239651126 | ||
|
|
5bdd53972f | ||
|
|
7b02e9fc35 | ||
|
|
5b2bad3825 | ||
|
|
6db18997bb | ||
|
|
334bde365c | ||
|
|
0eaa79e4eb | ||
|
|
7bd5794a07 | ||
|
|
92ca446e47 | ||
|
|
40e99c5e9f | ||
|
|
326f69f54e | ||
|
|
2e68fc59e3 | ||
|
|
4d68c944d9 | ||
|
|
3e99a228df | ||
|
|
7c003f8c0c | ||
|
|
7acbcc9601 | ||
|
|
13e7413182 | ||
|
|
bf18f87644 | ||
|
|
65ccee97a6 | ||
|
|
6bd7d3db64 | ||
|
|
4ab3d2d22c | ||
|
|
c32e09f791 | ||
|
|
49c32728af | ||
|
|
48fc7c447f | ||
|
|
7ef5212400 | ||
|
|
36912e5ff9 | ||
|
|
82aa0d1404 | ||
|
|
d5ad9de048 | ||
|
|
1c8c9ad231 | ||
|
|
073b7acc90 | ||
|
|
42c874ba5f | ||
|
|
0bf6633452 | ||
|
|
90ad09dc1d | ||
|
|
e5ceb99a1e | ||
|
|
5366478e18 | ||
|
|
7db7884e8c | ||
|
|
245428b241 | ||
|
|
3b88c31bfc | ||
|
|
d015d47527 | ||
|
|
6e6eb6002b | ||
|
|
ec52ce44a9 | ||
|
|
827ad656cb | ||
|
|
608b96a8aa | ||
|
|
e88bde0a73 | ||
|
|
8b8077709e | ||
|
|
512ff32f87 | ||
|
|
f5a77d04ff | ||
|
|
e4df84a8da | ||
|
|
3092c10e93 | ||
|
|
c059cd6181 | ||
|
|
caf9049ae1 | ||
|
|
0b8ea28832 | ||
|
|
cf6a2b1621 | ||
|
|
1e0b71df1f | ||
|
|
959a550780 | ||
|
|
0979233f5a | ||
|
|
9d3ca44e4d | ||
|
|
b3ecf2feaf | ||
|
|
cd83fb18c0 | ||
|
|
b46c44b485 | ||
|
|
1bcdb436c1 | ||
|
|
2a3fdcb73d | ||
|
|
8c9388c984 | ||
|
|
14f76028aa | ||
|
|
c46d1e3402 | ||
|
|
5c281c6116 | ||
|
|
f0d631ad8f | ||
|
|
1ed113d925 | ||
|
|
3cb7cf43de | ||
|
|
74169f5fc4 | ||
|
|
0583ae2648 | ||
|
|
ddf3740cf9 | ||
|
|
033209b061 | ||
|
|
f856855efd | ||
|
|
0fe5aef05e | ||
|
|
a4bf381557 | ||
|
|
b28d6b50c2 | ||
|
|
73b732a31c | ||
|
|
7658768705 | ||
|
|
c56df5cac0 | ||
|
|
15dd8e61a2 | ||
|
|
ee286febe7 | ||
|
|
f30765e1a0 | ||
|
|
83304f3d2c | ||
|
|
cc64b583fb | ||
|
|
2702340dd9 | ||
|
|
3e5398ffba | ||
|
|
6ac297fbc1 | ||
|
|
77b158159f | ||
|
|
2cb6e338a1 | ||
|
|
ca7fcf038f | ||
|
|
95fa99702c | ||
|
|
ae67ddc318 | ||
|
|
26eaf668e7 | ||
|
|
29c41fe46d | ||
|
|
db065413d1 | ||
|
|
553eb2391d | ||
|
|
b19d1bdb0f | ||
|
|
bc8e138250 | ||
|
|
49cc8a7805 | ||
|
|
50a2574e97 | ||
|
|
adc620708b | ||
|
|
4e21e2ee2e | ||
|
|
69c2faf510 | ||
|
|
84569c08fc | ||
|
|
fe37f4bca9 | ||
|
|
e7eccd2438 | ||
|
|
61379fe0c3 | ||
|
|
7fc5c94478 | ||
|
|
ac7d60ecec | ||
|
|
e92f6f15cb | ||
|
|
a32c54bdbb | ||
|
|
773d0560f2 | ||
|
|
712ffd4c14 | ||
|
|
ea033715a9 | ||
|
|
9c146016d3 | ||
|
|
9c192f526e | ||
|
|
70eb0c78f8 | ||
|
|
da4f3edac4 | ||
|
|
2f23538ba0 | ||
|
|
6e2c7e5137 | ||
|
|
65b6639481 | ||
|
|
20cc50db4c | ||
|
|
bd1140e71d | ||
|
|
85940d676f | ||
|
|
fa5ab18f2e | ||
|
|
63fb0326e9 | ||
|
|
d0b9a3989b | ||
|
|
05cf4423b9 | ||
|
|
05aa5cb831 | ||
|
|
bb09ee9505 | ||
|
|
00c14f7413 | ||
|
|
caeaaf4d98 | ||
|
|
e20b13751b | ||
|
|
61b1fe45d2 | ||
|
|
355eda0cf3 | ||
|
|
7cd40d3a53 | ||
|
|
1aba4ea9d0 | ||
|
|
649d8721db | ||
|
|
9dca788ca0 | ||
|
|
fe558092e4 | ||
|
|
781b6e9435 | ||
|
|
d63341ea5f | ||
|
|
4a50fde509 | ||
|
|
cc14640f17 | ||
|
|
7b346d0a12 | ||
|
|
f42a770f65 | ||
|
|
b460dcfa0a | ||
|
|
c405b64e57 | ||
|
|
51c10e49dd | ||
|
|
715aa0388c | ||
|
|
8ad55cbd94 | ||
|
|
88c98d3e3f | ||
|
|
eedd3ac4d0 | ||
|
|
f3cd07fe7d | ||
|
|
5951b166c8 | ||
|
|
b5de395367 | ||
|
|
9cc704421a | ||
|
|
d609112c0e | ||
|
|
cf89b8db5a | ||
|
|
fc1bc7102f | ||
|
|
29ed30f77c | ||
|
|
ab5ca792e4 | ||
|
|
909f3af8dc | ||
|
|
3bd9e02380 | ||
|
|
9d0c2484c0 | ||
|
|
ce562b6280 | ||
|
|
db33bb8ff6 | ||
|
|
f6460bfe6f | ||
|
|
81ff62c271 | ||
|
|
e8cf4a40d4 | ||
|
|
5b570ecc01 | ||
|
|
bf87ec7aeb | ||
|
|
69ee40691f | ||
|
|
045653dfed | ||
|
|
e24e95bdec | ||
|
|
ff2443eb67 | ||
|
|
ba50898123 | ||
|
|
9abeb4819f | ||
|
|
1a3864b15c | ||
|
|
d037fdc8be | ||
|
|
b5e13a0f97 | ||
|
|
96351ba5ee | ||
|
|
5f883e802a | ||
|
|
3852f8076f | ||
|
|
70a6f84862 | ||
|
|
71a4bdc882 | ||
|
|
77fb7d2b64 | ||
|
|
bd418f0741 | ||
|
|
9b98d3ca0b | ||
|
|
a2121549aa | ||
|
|
6e1ad8c00d | ||
|
|
213491a146 | ||
|
|
2d2c494970 | ||
|
|
fa56e42b08 | ||
|
|
a9f7101365 | ||
|
|
acdeb47444 | ||
|
|
57f3e61220 | ||
|
|
1ceb19f196 | ||
|
|
05024cb094 | ||
|
|
4cb71a069b | ||
|
|
ec8add1a4c | ||
|
|
ae11f08d69 | ||
|
|
9f870d1e6c | ||
|
|
3b6d718f18 | ||
|
|
f5c0eb98c4 | ||
|
|
d5005ff5d7 | ||
|
|
fa7f4d1e6a | ||
|
|
d69b38ea65 | ||
|
|
12b2f2af8f | ||
|
|
99e0b36321 | ||
|
|
031808cd1b | ||
|
|
b6bc7dcd10 | ||
|
|
5864290d20 | ||
|
|
0c3b839af9 | ||
|
|
4bc0565d14 | ||
|
|
42ca607e71 | ||
|
|
09ab7fc6ca | ||
|
|
ca737cc01f | ||
|
|
4562f7b6d7 | ||
|
|
d02fe90b00 | ||
|
|
31c9ad1831 | ||
|
|
d7f21375d4 | ||
|
|
0beaaa9356 | ||
|
|
6ef9f9fe9c | ||
|
|
36abfe1121 | ||
|
|
898ff287f2 | ||
|
|
29c133f11d | ||
|
|
edb2b71387 | ||
|
|
92943a0c3f | ||
|
|
fc173b6ace | ||
|
|
ad5b022ed1 | ||
|
|
5e55e47f7f | ||
|
|
331d0fd83c | ||
|
|
dc70a25a1d | ||
|
|
fbea48211e | ||
|
|
64df92e053 | ||
|
|
313de641eb | ||
|
|
56251a7239 | ||
|
|
dedd0eb898 | ||
|
|
2897c6fe25 | ||
|
|
79e36bd365 | ||
|
|
e7d03185c4 | ||
|
|
b4b82e05d8 | ||
|
|
6cbb9fa288 | ||
|
|
ceb247762f | ||
|
|
76d027d3e7 | ||
|
|
0a092b6226 | ||
|
|
b1de472ba3 | ||
|
|
0e18779e8b | ||
|
|
5610800a7b | ||
|
|
315999da94 | ||
|
|
365f379435 | ||
|
|
84bafc1002 | ||
|
|
99d782cf60 | ||
|
|
d34b144061 | ||
|
|
0d19142fc2 | ||
|
|
9ade072706 | ||
|
|
9dd0086785 | ||
|
|
3bfe29fddb | ||
|
|
b053e6422f | ||
|
|
dd4f37a4cf | ||
|
|
9318964f25 | ||
|
|
6401dc10b2 | ||
|
|
51e6ab21d7 | ||
|
|
2139099781 | ||
|
|
8afd1b1d97 | ||
|
|
bd09614526 | ||
|
|
eeb9e688f2 | ||
|
|
f14a3042be | ||
|
|
70bd8c71b5 | ||
|
|
68c10efe1b | ||
|
|
ffd70dca19 | ||
|
|
9e0ae58772 | ||
|
|
fc636abfa7 | ||
|
|
aa52ee54c1 | ||
|
|
4682085405 | ||
|
|
11c654bbcd | ||
|
|
2552876786 | ||
|
|
ad311c35c7 | ||
|
|
74fba75ca0 | ||
|
|
14c223b2c7 | ||
|
|
906b922051 | ||
|
|
f8aec3164c | ||
|
|
8b55704887 | ||
|
|
bf8f42835f | ||
|
|
d693d6b2cb | ||
|
|
52eebff6f8 | ||
|
|
70893ff7af | ||
|
|
33cb181af2 | ||
|
|
4dd71d4cfe | ||
|
|
110b670d44 | ||
|
|
e38c4ae3ad | ||
|
|
4e5acab610 | ||
|
|
490569ca28 | ||
|
|
ae552c39fd | ||
|
|
44a52bcd9b | ||
|
|
9f3c8ffeb0 | ||
|
|
f19fe37dec | ||
|
|
c87f13951f | ||
|
|
e37ddc1368 | ||
|
|
aeb6f86fe6 | ||
|
|
cc91e5ea64 | ||
|
|
a05db57374 | ||
|
|
c5977f6503 | ||
|
|
4c7af667a7 | ||
|
|
b7c1735cb8 | ||
|
|
4711a6113d | ||
|
|
08427debe8 | ||
|
|
3e616b5a31 | ||
|
|
97cea1b933 | ||
|
|
d3d45277a1 | ||
|
|
0e7e4d30f6 | ||
|
|
6189e219ff | ||
|
|
bafbbea051 | ||
|
|
fd629e6ee0 | ||
|
|
250118b1b1 | ||
|
|
78c9eaccd9 | ||
|
|
583556a3c2 | ||
|
|
45315698d8 | ||
|
|
556e2b9c6e | ||
|
|
d91d3bbee2 | ||
|
|
e45c1af8b4 | ||
|
|
a4ea1d6826 | ||
|
|
68ab1d3d07 | ||
|
|
42d553c8ae | ||
|
|
ff84e15146 | ||
|
|
68df5c5019 | ||
|
|
08055feffa | ||
|
|
865b7ac545 | ||
|
|
863651dff1 | ||
|
|
67cc918c3c | ||
|
|
48bc90a8aa | ||
|
|
312071bd08 | ||
|
|
908cdfafe1 | ||
|
|
c33fa392de | ||
|
|
4beb8a0d7d | ||
|
|
7a955aa1c1 | ||
|
|
5222c8872d | ||
|
|
ece1369191 | ||
|
|
137e1a1379 | ||
|
|
f1d0753f71 | ||
|
|
e5c8aeb3f1 | ||
|
|
f7f7094bcf | ||
|
|
685fd42965 | ||
|
|
0e90b9dc83 | ||
|
|
e6146d6bf3 | ||
|
|
051a30bc65 | ||
|
|
1bcdcebe67 | ||
|
|
3b783ef57b | ||
|
|
1261271839 | ||
|
|
fd344d3602 | ||
|
|
88b31ecb28 | ||
|
|
ae08e0500e | ||
|
|
a86e27db95 | ||
|
|
6131b78748 | ||
|
|
3a59390e9d | ||
|
|
a508bec819 | ||
|
|
c7843d3b4e | ||
|
|
80782eff1f | ||
|
|
4d7150657c | ||
|
|
bf5cb890b0 | ||
|
|
1841e77906 | ||
|
|
d4fd66687d | ||
|
|
1b42c94968 | ||
|
|
bc3a6ebae0 | ||
|
|
28a6ba5fc0 | ||
|
|
937db8cc80 | ||
|
|
3f6e1be9da | ||
|
|
d23e5d837a | ||
|
|
1170876974 | ||
|
|
33a564c971 | ||
|
|
99d572ad14 | ||
|
|
10f52b4805 | ||
|
|
83d20ab305 | ||
|
|
c0b3d86d91 | ||
|
|
ab7bbbb160 | ||
|
|
f0cfb4aee8 | ||
|
|
8fa4f7d83f | ||
|
|
ba03c9f2aa | ||
|
|
b51805caeb | ||
|
|
e387105e35 | ||
|
|
35a5c6f192 | ||
|
|
c846de3fb4 | ||
|
|
0178fb1ab5 | ||
|
|
76ec07c402 | ||
|
|
5520a43b77 | ||
|
|
478abf57d4 | ||
|
|
7a22bb09d7 | ||
|
|
f5cc1929eb | ||
|
|
8481cdf62f | ||
|
|
971a6f1702 | ||
|
|
284491887f | ||
|
|
c07b5282af | ||
|
|
2b9b11d3af | ||
|
|
c401bbe22e | ||
|
|
3bd34bf386 | ||
|
|
59d1066525 | ||
|
|
4a37c618e6 | ||
|
|
d64c1652e2 | ||
|
|
fca41d2752 | ||
|
|
189847996d | ||
|
|
0275e4f665 | ||
|
|
88b903da66 | ||
|
|
fe615efb5c | ||
|
|
7da7a50c69 | ||
|
|
3b5efa05f7 | ||
|
|
dcf5f1a8d5 | ||
|
|
5bccee70ae | ||
|
|
9c94a2b971 | ||
|
|
ac22cb771b | ||
|
|
1200b075dc | ||
|
|
b82f261918 | ||
|
|
9d1847cdd4 | ||
|
|
6981775d23 | ||
|
|
b275477b76 | ||
|
|
4eae85673a | ||
|
|
de6c9f35a1 | ||
|
|
ccc386c8e3 | ||
|
|
a965c2d73b | ||
|
|
fcd0c2a03f | ||
|
|
c475b6112a | ||
|
|
1e1e162e31 | ||
|
|
a8c7a9deb8 | ||
|
|
027512320f | ||
|
|
7bc9ea2b9f | ||
|
|
11e2405489 | ||
|
|
324391bc30 | ||
|
|
1970a527ff | ||
|
|
ecb74a01a1 | ||
|
|
6aff02506e | ||
|
|
53e1ea7728 | ||
|
|
86c96359f3 | ||
|
|
eb1cc78be8 | ||
|
|
21ca719293 | ||
|
|
9dc605afe5 | ||
|
|
b828e6971c | ||
|
|
da8c6bea46 | ||
|
|
835fb93f63 | ||
|
|
4c0058f44a | ||
|
|
f788b6743b | ||
|
|
e3d76db455 | ||
|
|
67f6945e8a | ||
|
|
ceebb2db61 | ||
|
|
5283b0b821 | ||
|
|
98674b73bd | ||
|
|
9133a9b8b0 | ||
|
|
5f34cfddbc | ||
|
|
18fee17d38 | ||
|
|
e06c2021c9 | ||
|
|
3b74bbe999 | ||
|
|
b117adeded | ||
|
|
1e5749f47f | ||
|
|
838bab821c | ||
|
|
e9abf023b4 | ||
|
|
d5f6f5cb50 | ||
|
|
74c94b2b1a | ||
|
|
485d10cb13 | ||
|
|
e0b0919375 | ||
|
|
da98cacafc | ||
|
|
a75a9fb8ef | ||
|
|
2fb4209083 | ||
|
|
a763da63ad | ||
|
|
aa7efd11b7 | ||
|
|
5dd0055c77 | ||
|
|
9ff0159bf4 | ||
|
|
13f27d8063 | ||
|
|
b99722ddf5 | ||
|
|
b7e53b12f6 | ||
|
|
361ae6886e | ||
|
|
ef1ea9c895 | ||
|
|
22099d934e | ||
|
|
8a61125a54 | ||
|
|
bac6df0475 | ||
|
|
349e81e468 | ||
|
|
c3db2fe705 | ||
|
|
021836efcb | ||
|
|
c764f2e3ab | ||
|
|
9a7909c983 | ||
|
|
6e7b5172ea | ||
|
|
e3f95d1c5f | ||
|
|
7763337255 | ||
|
|
1ce2132b97 | ||
|
|
7eb1f5b28c | ||
|
|
ccaff4461b | ||
|
|
86fa2aade2 | ||
|
|
17129a0deb | ||
|
|
9b621d1c8f | ||
|
|
80ca00005f | ||
|
|
0ac9536d99 | ||
|
|
43819ff6b2 | ||
|
|
bf25d1cec9 | ||
|
|
d7c9624c5b | ||
|
|
71613cbd57 | ||
|
|
739bdec582 | ||
|
|
4f8ae75f4f | ||
|
|
ceba50b6ed | ||
|
|
eb9d799876 | ||
|
|
e4cc1ad900 | ||
|
|
6c330bd6bf | ||
|
|
f77e6a4499 | ||
|
|
1c4532dcbf | ||
|
|
0cda28f77b | ||
|
|
fe9abd3219 | ||
|
|
c54864e3af | ||
|
|
d7e34cf6ea | ||
|
|
f1dac01f11 | ||
|
|
e6b768105d | ||
|
|
02d647b5f9 | ||
|
|
9935ddee99 | ||
|
|
ee26ec5e9c | ||
|
|
51ef369d45 | ||
|
|
466e30c83e | ||
|
|
f27920214c | ||
|
|
ae22fe4c52 | ||
|
|
a0f2e9bf34 | ||
|
|
18b8440c95 | ||
|
|
8f6a42f11b | ||
|
|
087e39a7ef | ||
|
|
588ea96deb | ||
|
|
4549b969f9 | ||
|
|
2f633d91ca | ||
|
|
d526de3fa8 | ||
|
|
9eef999b38 | ||
|
|
a6393de6f7 | ||
|
|
8805f09d87 | ||
|
|
64057e992b | ||
|
|
995c565fba | ||
|
|
f1a2ee55e0 | ||
|
|
08dc9ba24f | ||
|
|
18f57df605 | ||
|
|
3a6dfeaa76 | ||
|
|
6062f199d9 | ||
|
|
b770a07e9c | ||
|
|
75b1316e70 | ||
|
|
9bb9221642 | ||
|
|
a5c143f415 | ||
|
|
2ba009c0f1 | ||
|
|
1ed56d5d08 | ||
|
|
9b840c5f59 | ||
|
|
fc74c302be | ||
|
|
2a4d65f3b8 | ||
|
|
6b51b3f92f | ||
|
|
d66d7c6e3a | ||
|
|
af220872b9 | ||
|
|
9819391442 | ||
|
|
1fae341a98 | ||
|
|
6dba297a79 | ||
|
|
c854703ad6 | ||
|
|
f79688e848 | ||
|
|
acddf10f80 | ||
|
|
74daa1d74a | ||
|
|
e9dcdb8f97 | ||
|
|
1f19c43d9d | ||
|
|
4a211a80fb | ||
|
|
ea459657d1 | ||
|
|
530bb8ec9e | ||
|
|
4661030b38 | ||
|
|
24150ded0d | ||
|
|
42bcac7a18 | ||
|
|
385b6a22a4 | ||
|
|
f331c22623 | ||
|
|
69e950ecfc | ||
|
|
167f772966 | ||
|
|
7fa17e8e08 | ||
|
|
95c7788747 | ||
|
|
e24bb8c492 | ||
|
|
475b31f1e0 | ||
|
|
f71098906b | ||
|
|
b881578f67 | ||
|
|
0811dfe257 | ||
|
|
f4c778ff04 | ||
|
|
12315f78a2 | ||
|
|
1cca60e704 | ||
|
|
603aca0bb3 | ||
|
|
7fa7c8a8e3 | ||
|
|
bac7a5085e | ||
|
|
7441ee5175 | ||
|
|
6ae0902498 | ||
|
|
017a6353d1 | ||
|
|
e578fad099 | ||
|
|
3811b58a7d | ||
|
|
bb302a755c | ||
|
|
920b7b2841 | ||
|
|
9d4e4545fe | ||
|
|
23b633e071 | ||
|
|
81662eb8f4 | ||
|
|
b08f85aeef | ||
|
|
0b1c8b455a | ||
|
|
003ef1aa74 | ||
|
|
bbb25255b0 | ||
|
|
d997d485ff | ||
|
|
d1db3691a1 | ||
|
|
829f4f334b | ||
|
|
e781caf962 | ||
|
|
883c62b5e9 | ||
|
|
e7a4d5f18d | ||
|
|
bfe09e8305 | ||
|
|
0036b8bba0 | ||
|
|
f6eb750183 | ||
|
|
b1a00f722e | ||
|
|
34723d02f8 | ||
|
|
a60e91b313 | ||
|
|
94be61fde5 | ||
|
|
0f4b9aa812 | ||
|
|
6a79c379cc | ||
|
|
055645b079 | ||
|
|
fe93919b48 | ||
|
|
2e7093d5ef | ||
|
|
80bdd19e03 | ||
|
|
80f4886c5a | ||
|
|
12d3e3d775 | ||
|
|
fe416bd353 | ||
|
|
89553f5df6 | ||
|
|
f9e0d94a65 | ||
|
|
a4c68caedd | ||
|
|
1c7f36465b | ||
|
|
8d012c45e2 | ||
|
|
29280bb9ec | ||
|
|
732eeeabd9 | ||
|
|
8709369720 | ||
|
|
49e98c3ddd | ||
|
|
6723bdd920 | ||
|
|
6d0ab6166c | ||
|
|
9709f7ec73 | ||
|
|
25b5cb9599 | ||
|
|
79726c8864 | ||
|
|
42765d50e0 | ||
|
|
5bdd18caf1 | ||
|
|
41f6bca92f | ||
|
|
aa50e6368a | ||
|
|
c59993005c | ||
|
|
0fd89aa20d | ||
|
|
7d926a0e0c | ||
|
|
ec0e2d7312 | ||
|
|
b48eebb114 | ||
|
|
091acff312 | ||
|
|
f452c7762f | ||
|
|
bc5c9d8d7b | ||
|
|
945e9c3f20 | ||
|
|
681f352a9d | ||
|
|
073b148167 | ||
|
|
59b53ea2c8 | ||
|
|
404bbe1f26 | ||
|
|
4a824eb8cb | ||
|
|
992e808451 | ||
|
|
e79c87aca0 | ||
|
|
c59c663619 | ||
|
|
c8b321c678 | ||
|
|
39c4687816 | ||
|
|
ba256fb835 | ||
|
|
de8471ab4e | ||
|
|
e548a31510 | ||
|
|
ab465c5857 | ||
|
|
338608ab31 | ||
|
|
12f9173c6d | ||
|
|
2e7f24a487 | ||
|
|
9603c7cc83 | ||
|
|
06c586932a | ||
|
|
7ddde45863 | ||
|
|
01c532dc22 | ||
|
|
236db28a93 | ||
|
|
2460569ccb | ||
|
|
ebddd16c75 | ||
|
|
489b705d4b | ||
|
|
ca5622c711 | ||
|
|
a7063b1aee | ||
|
|
0f1c2504b1 | ||
|
|
c2fd6752cf | ||
|
|
3b5659ae92 | ||
|
|
ed04cedecc | ||
|
|
018072529a | ||
|
|
d5abab7322 | ||
|
|
0c470af314 | ||
|
|
de0774041c | ||
|
|
ce62bbb674 | ||
|
|
aee1dd9ec0 | ||
|
|
5194ebe6a8 | ||
|
|
264bf67584 | ||
|
|
2da5f17e52 | ||
|
|
6a75df6cd7 | ||
|
|
4b0da428e7 | ||
|
|
aa539466f7 | ||
|
|
44c0f591f7 | ||
|
|
90ac20ebb5 | ||
|
|
59e466d54c | ||
|
|
bc8c90f0d2 | ||
|
|
5aae762143 | ||
|
|
c630fe664f | ||
|
|
7f48989be6 | ||
|
|
1616b5193c | ||
|
|
82dbc9c74f | ||
|
|
8c813dbb96 | ||
|
|
39cb8fe0ac | ||
|
|
bf609338ae | ||
|
|
b1a837ad17 | ||
|
|
b29ad75564 | ||
|
|
3d297cfe81 | ||
|
|
9d34140191 | ||
|
|
212e25e4be | ||
|
|
c12aa454ff | ||
|
|
f207b3623e | ||
|
|
3a816341f9 | ||
|
|
9f51f154aa | ||
|
|
5ac1ee403b | ||
|
|
1755f655db | ||
|
|
ef5d72cc37 | ||
|
|
c77aa759ea | ||
|
|
8055da9830 | ||
|
|
b6197bcf90 | ||
|
|
2e90a7a368 | ||
|
|
600e4a11c7 | ||
|
|
68413a7452 | ||
|
|
38fb57f9d6 | ||
|
|
fb46032cbb | ||
|
|
e0628436f3 | ||
|
|
a6869f2333 | ||
|
|
0b414c4e4e | ||
|
|
a04a28fbb5 | ||
|
|
ddc0f79f50 | ||
|
|
cf20c54292 | ||
|
|
8b9e07dace | ||
|
|
1a4e39838f | ||
|
|
ef4cd692e0 | ||
|
|
e1a753c3d0 | ||
|
|
0c535aa355 | ||
|
|
a6748c555e | ||
|
|
254fdd754c | ||
|
|
b3ec6d5d05 | ||
|
|
b4864206aa | ||
|
|
625828657a | ||
|
|
1258fbb077 | ||
|
|
0ce0db5158 | ||
|
|
3ccff40306 | ||
|
|
22c5c021f0 | ||
|
|
f0f00daa92 | ||
|
|
135eb22124 | ||
|
|
bee49753c8 | ||
|
|
b995d2cc2f | ||
|
|
83a0278171 | ||
|
|
c47452f729 | ||
|
|
485412ecb1 | ||
|
|
a753430fb9 | ||
|
|
5cabf74445 | ||
|
|
39adeaf4f4 | ||
|
|
01e6ca33ab | ||
|
|
e30b061a06 | ||
|
|
131e3a06fb | ||
|
|
c145f85638 | ||
|
|
11f53347c7 | ||
|
|
8c4ab98e17 | ||
|
|
d6afe4bac7 | ||
|
|
91bb21c522 | ||
|
|
79daecb7d5 | ||
|
|
ca48239da1 | ||
|
|
86a19f4714 | ||
|
|
1d1b59da76 | ||
|
|
45686e3a55 | ||
|
|
f2d3ce4170 | ||
|
|
0517436bf9 | ||
|
|
f8e1457be0 | ||
|
|
409f06b330 | ||
|
|
11fdbdf427 | ||
|
|
2f50aaa349 | ||
|
|
53a0d6fb9d | ||
|
|
5540028340 | ||
|
|
fdbca7526f | ||
|
|
01362974d6 | ||
|
|
54259250e5 | ||
|
|
430571d62c | ||
|
|
0296bba808 | ||
|
|
b32b8d0d44 | ||
|
|
8a2f6c5e60 | ||
|
|
8a75e48bd4 | ||
|
|
400f464307 | ||
|
|
ad115d2088 | ||
|
|
c60c1b8172 | ||
|
|
680d2dae32 | ||
|
|
796ce90c1e | ||
|
|
b2449f929c | ||
|
|
6864e05ae3 | ||
|
|
7663e4f65e | ||
|
|
b862a8b728 | ||
|
|
5da185594c | ||
|
|
336bf35a2c | ||
|
|
059b64efbe | ||
|
|
c23056719e | ||
|
|
99f079a349 | ||
|
|
ab16816eb8 | ||
|
|
7723bdbaa7 | ||
|
|
e02d610df8 | ||
|
|
9ab35ae393 | ||
|
|
270eff1dfe | ||
|
|
d231293832 | ||
|
|
a8bb0a452d | ||
|
|
fc678100cd | ||
|
|
6f63373bb2 | ||
|
|
3a35a6955d | ||
|
|
137765c95a | ||
|
|
302ccb0d97 | ||
|
|
b87e48802e | ||
|
|
5924c920ec | ||
|
|
31e3466556 | ||
|
|
d0cb4d09aa | ||
|
|
8b9765a917 | ||
|
|
87f72a4b06 | ||
|
|
49be46409c | ||
|
|
4585f7bf1f | ||
|
|
5c3917478a | ||
|
|
99ff6e3b76 | ||
|
|
58a0844b1c | ||
|
|
97f64988e2 | ||
|
|
fafbf6d8da | ||
|
|
adec56938e | ||
|
|
e6ba28b680 | ||
|
|
c3677ca907 | ||
|
|
92633067af | ||
|
|
af2ef0830a | ||
|
|
aa73f6b68f | ||
|
|
2b6d84ff37 | ||
|
|
7271c050a3 | ||
|
|
99783fe795 | ||
|
|
d3690efffe | ||
|
|
b7b97df93f | ||
|
|
58fb1a3922 | ||
|
|
e6c203832e | ||
|
|
fb6a1b8b83 | ||
|
|
4b006cb8b0 | ||
|
|
549cf0381a | ||
|
|
f6ac18841d | ||
|
|
cd377b646d | ||
|
|
c6df8ab565 | ||
|
|
df138c2e2f | ||
|
|
bbe2172c38 | ||
|
|
19d978d1c7 | ||
|
|
a965dc5b40 | ||
|
|
62114c1806 | ||
|
|
ec386cc9fd | ||
|
|
ee08b81aab | ||
|
|
97e1ad136a | ||
|
|
2dea694ab4 | ||
|
|
dc0e663241 | ||
|
|
4352cb55f1 | ||
|
|
8950aa75c4 | ||
|
|
83097f136a | ||
|
|
437e396455 | ||
|
|
840697c69b | ||
|
|
bd375505f7 | ||
|
|
3e5dc58f35 | ||
|
|
caaeb9ff12 | ||
|
|
878906fbb8 | ||
|
|
2fc0dac01e | ||
|
|
44a712d810 | ||
|
|
bfc85c288a | ||
|
|
4423bf9d10 | ||
|
|
a0591b32c7 | ||
|
|
470fe972f5 | ||
|
|
b83739945e | ||
|
|
259c05829b | ||
|
|
c93a189028 | ||
|
|
bf4d20aaa8 | ||
|
|
b42603eee6 | ||
|
|
c7667cec62 | ||
|
|
a0b08b5e0b | ||
|
|
64c6e1e90e | ||
|
|
3ff75e5b8b | ||
|
|
e078a04fd0 | ||
|
|
7d425f38ee | ||
|
|
24156db252 | ||
|
|
f24931222c | ||
|
|
3f74baed02 | ||
|
|
972631be71 | ||
|
|
c658fc5cbd | ||
|
|
bf7b292db9 | ||
|
|
da67577ed3 | ||
|
|
4d83b0a315 | ||
|
|
d67a4cec24 | ||
|
|
03505c7226 | ||
|
|
3164ac7217 | ||
|
|
0dab12ec9f | ||
|
|
736570923d | ||
|
|
0aeeb7b169 | ||
|
|
78e84f9da3 | ||
|
|
a4dc650d11 | ||
|
|
d3cad4f289 | ||
|
|
8acd3e3818 | ||
|
|
e8b74e56c9 | ||
|
|
e1334ec9bb | ||
|
|
7d5ba9d058 | ||
|
|
c32a44111f | ||
|
|
18a476686d | ||
|
|
b29063a1ea | ||
|
|
48e10ec9c4 | ||
|
|
3559dc0037 | ||
|
|
4bd0b72b98 | ||
|
|
b645013ee5 | ||
|
|
304d60c8f3 | ||
|
|
9a07df6c4a | ||
|
|
abd545682e | ||
|
|
3076a86685 | ||
|
|
16a35c234e | ||
|
|
44e9e95933 | ||
|
|
af22085c51 | ||
|
|
60841f1231 | ||
|
|
b8cebe32e3 | ||
|
|
bdefd5da15 | ||
|
|
402a9db2fe | ||
|
|
95cd75dce7 | ||
|
|
2602a59e87 | ||
|
|
a2f46f8e68 | ||
|
|
ed3c962b39 | ||
|
|
a241a80d68 | ||
|
|
576df38f59 | ||
|
|
f29ee8f7ee | ||
|
|
c5589a9dd5 | ||
|
|
4595bf1e20 | ||
|
|
8e99c415ab | ||
|
|
f04aeeb649 | ||
|
|
a667251458 | ||
|
|
cd2b3616bb | ||
|
|
35286e2922 | ||
|
|
c91ecdb1a0 | ||
|
|
da8ad4f20f | ||
|
|
a51deb5371 | ||
|
|
7b0b368fc3 | ||
|
|
c4b6a034f1 | ||
|
|
990ac99c97 | ||
|
|
0ab3cda84a | ||
|
|
953bf8bbf6 | ||
|
|
bc6811ec90 | ||
|
|
6570dc0e31 | ||
|
|
e2961b5e11 | ||
|
|
890c1de998 | ||
|
|
800ffda01c | ||
|
|
6bdbd306b1 | ||
|
|
4a4fe0974f | ||
|
|
8edf2b88dc | ||
|
|
e81d9aaca3 | ||
|
|
a6d4b30d19 | ||
|
|
2fd8cbff2a | ||
|
|
3dce6028f7 | ||
|
|
43ae2bffbb | ||
|
|
3762f2d25c | ||
|
|
4765396846 | ||
|
|
61b9e78e1b | ||
|
|
fce126bcb1 | ||
|
|
ccb4b18348 | ||
|
|
f2d703e916 | ||
|
|
400ee6caa0 | ||
|
|
a95547478a | ||
|
|
f5bf967660 | ||
|
|
797b8885c5 | ||
|
|
a4e1579afa | ||
|
|
6bbe440f6d | ||
|
|
7c88c6fce1 | ||
|
|
5b2ecc5b82 | ||
|
|
701a00d391 | ||
|
|
5a5ef06c57 | ||
|
|
0c46c25633 | ||
|
|
afe0e5601b | ||
|
|
2a7fb51466 | ||
|
|
7948fe36c4 | ||
|
|
c76f23420e | ||
|
|
48c35eaeaa | ||
|
|
b92aadb6ee | ||
|
|
163f5f4993 | ||
|
|
3a82ae9244 | ||
|
|
6e1884a352 | ||
|
|
531b5ecbfc | ||
|
|
5864b57eec | ||
|
|
cf5a5fb1dd | ||
|
|
2c99bef442 | ||
|
|
e3af8ed321 | ||
|
|
7070605a17 | ||
|
|
f2f8d38efa | ||
|
|
6bf3529919 | ||
|
|
9aef66711e | ||
|
|
06dda03a98 | ||
|
|
d93da3c1c3 | ||
|
|
85a5a2873e | ||
|
|
f62473e8c1 | ||
|
|
289dc0b6ed | ||
|
|
80e20b5fea | ||
|
|
8f88443aba | ||
|
|
381349a8cd | ||
|
|
eb0971609b | ||
|
|
aec0bb339b | ||
|
|
32ef59b290 | ||
|
|
09d2e3d159 | ||
|
|
a20c76fcbc | ||
|
|
3238c7ec2c | ||
|
|
155fd22de0 | ||
|
|
fbff71727b | ||
|
|
f3240be016 | ||
|
|
eb1927d94e | ||
|
|
546af70783 | ||
|
|
5d65261362 | ||
|
|
8395516b7d | ||
|
|
53da0c2fba | ||
|
|
5a0e5b7fc6 | ||
|
|
28ef78e4cb | ||
|
|
39d9a93acc | ||
|
|
b640c27a08 | ||
|
|
c34a062f5c | ||
|
|
b7a5b3c309 | ||
|
|
27daca31f3 | ||
|
|
1ad06e428d | ||
|
|
ebd4445ba2 | ||
|
|
8eb145a3be | ||
|
|
9cf1a98d0e | ||
|
|
7e156e73b5 | ||
|
|
4e1baf3a4e | ||
|
|
a770520bff | ||
|
|
3c50b7ee45 | ||
|
|
b90bc0b15c | ||
|
|
90e1b0734e | ||
|
|
068596552d | ||
|
|
10dd60795c | ||
|
|
aec33aa753 | ||
|
|
14f915ece6 | ||
|
|
235386b245 | ||
|
|
c517633b49 | ||
|
|
809a2c6254 | ||
|
|
90f1218fbb | ||
|
|
7d2d48e116 | ||
|
|
7f27821c5f | ||
|
|
88b7ed053f | ||
|
|
d6f788f56a | ||
|
|
50e49b4a5f | ||
|
|
e0690e4e12 | ||
|
|
e3ff6b561d | ||
|
|
9120a4231c | ||
|
|
e25e3f092a | ||
|
|
735efc17f3 | ||
|
|
21b403d4d9 | ||
|
|
57fbbf2036 | ||
|
|
3bf1b04cb4 | ||
|
|
e28aff2f7a | ||
|
|
fc6c531ec2 | ||
|
|
0ef049d707 | ||
|
|
69f8907a29 | ||
|
|
3f6e00e48d | ||
|
|
62b2087a84 | ||
|
|
946df29029 | ||
|
|
af925f0a14 | ||
|
|
9903bb93a2 | ||
|
|
eab451e6e8 | ||
|
|
7a2471ede0 | ||
|
|
b996436b4c | ||
|
|
3b86ea7dc0 | ||
|
|
44ffdc182f | ||
|
|
3c8990eb36 | ||
|
|
67b4b3a634 | ||
|
|
63d0849403 | ||
|
|
a94721fc4c | ||
|
|
9156d86009 | ||
|
|
a04805ce88 | ||
|
|
337bcc7014 | ||
|
|
458f3e427f | ||
|
|
4e095276af | ||
|
|
34075d480e | ||
|
|
dd2a2a8072 | ||
|
|
5eeb9db457 | ||
|
|
473632bf0d | ||
|
|
81913fc35c | ||
|
|
a1160a3eb9 | ||
|
|
aa3737e6e1 | ||
|
|
b0e1f9ca2f | ||
|
|
304f1ebcb2 | ||
|
|
23f92bfa20 | ||
|
|
1601a2dac9 | ||
|
|
5ba5f00f65 | ||
|
|
3ae459b83e | ||
|
|
41392f5497 | ||
|
|
11967c94fc | ||
|
|
1fe57c9505 | ||
|
|
5939b3d702 | ||
|
|
5c56fd4793 | ||
|
|
3d7d75cef8 | ||
|
|
ec33704c39 | ||
|
|
ff737b6090 | ||
|
|
f4d14ad69c | ||
|
|
19f0603885 | ||
|
|
6f5f74da55 | ||
|
|
c07a14a01f | ||
|
|
4674b6d652 | ||
|
|
095909be79 | ||
|
|
f889148335 | ||
|
|
a2276107ab | ||
|
|
e538fcbf10 | ||
|
|
f0888ccaef | ||
|
|
42847f7d5c | ||
|
|
0f1acb60a1 | ||
|
|
cc205c60ae | ||
|
|
99b83a38de | ||
|
|
23e5aedd37 | ||
|
|
fa1f318d74 | ||
|
|
80bab9d939 | ||
|
|
ff7a79c6cf | ||
|
|
e96c5401f1 | ||
|
|
4fb1e2788f | ||
|
|
8a4170e6bd | ||
|
|
3a47431122 | ||
|
|
5ae205fb41 | ||
|
|
5c3666eb00 | ||
|
|
1a48d4d155 | ||
|
|
07bb5d89b3 | ||
|
|
51bea21b3b | ||
|
|
8306501e48 | ||
|
|
06ab44337f | ||
|
|
a31237a21f | ||
|
|
12f9894f54 | ||
|
|
8a34d1a7e0 | ||
|
|
931bbca113 | ||
|
|
2e07f02451 | ||
|
|
efeadf086b | ||
|
|
ed0a307ccd | ||
|
|
742c58c240 | ||
|
|
6e1dbe497c | ||
|
|
469966917b | ||
|
|
a2cc070fc2 | ||
|
|
1ad5180f28 | ||
|
|
be1bb28355 | ||
|
|
f455a484bd | ||
|
|
2603f1c419 | ||
|
|
5eba3fbd34 | ||
|
|
a4c22c8b3a | ||
|
|
724e4e2259 | ||
|
|
839390c19c | ||
|
|
0d70a91b6d | ||
|
|
56a5e84f9d | ||
|
|
f5d5637f72 | ||
|
|
665078d0c4 | ||
|
|
eb54c032c8 | ||
|
|
9ea9ca32ba | ||
|
|
dc0a5f9c24 | ||
|
|
8224207b26 | ||
|
|
4148381dff | ||
|
|
2d87ae9ab6 | ||
|
|
4d2b0715d1 | ||
|
|
b4b39c6886 | ||
|
|
4dbf758f4c | ||
|
|
489de5dce2 | ||
|
|
223c674c2a | ||
|
|
9947223800 | ||
|
|
cb45c2ea55 | ||
|
|
143b02d8a4 | ||
|
|
48fb8ba3cd | ||
|
|
213d0e2fb2 | ||
|
|
e760c2b3b9 | ||
|
|
63d4411560 | ||
|
|
497b3fe2c5 | ||
|
|
b3c440c06a | ||
|
|
2185831922 | ||
|
|
bf1effa4bc | ||
|
|
d15e7a5ec2 | ||
|
|
ce10927efb | ||
|
|
a1ad2872ee | ||
|
|
f1fcb022be | ||
|
|
11c9545416 | ||
|
|
cd7d5546ae | ||
|
|
21e53485dd | ||
|
|
47b49c8a68 | ||
|
|
28bfab716b | ||
|
|
6bdcfc745d | ||
|
|
74dcad5107 | ||
|
|
69c046e53b | ||
|
|
e1e08ae506 | ||
|
|
ea20775565 | ||
|
|
e18a883796 | ||
|
|
3db6716761 | ||
|
|
6c3477c003 | ||
|
|
83fef4866d | ||
|
|
3ee4e65c95 | ||
|
|
8a581c3536 | ||
|
|
cce755591b | ||
|
|
2ad04e47c5 | ||
|
|
396bccfb1d | ||
|
|
878ed4934c | ||
|
|
bb3ca12629 | ||
|
|
502bb9c746 | ||
|
|
59a3b83bf5 | ||
|
|
66f5e50050 | ||
|
|
2d0b84ee30 | ||
|
|
fb1c77bd4f | ||
|
|
71dddd7db7 | ||
|
|
a3c6514332 | ||
|
|
02d3b39420 | ||
|
|
9ebd037226 | ||
|
|
fb61a2c944 | ||
|
|
13b2c79f6a | ||
|
|
a4c484a4d8 | ||
|
|
1687075373 | ||
|
|
91549cfa4f | ||
|
|
7fe808ea02 | ||
|
|
6aa9078d16 | ||
|
|
5c95a044dd | ||
|
|
6dcfd23eeb | ||
|
|
8f17fbb900 | ||
|
|
17b74af457 | ||
|
|
5da8a25c5c | ||
|
|
d787ea5346 | ||
|
|
5b4306d183 | ||
|
|
db67fc0cfd | ||
|
|
679bfd11aa | ||
|
|
43e0ef5e72 | ||
|
|
8a879b8fc5 | ||
|
|
9201cfdd81 | ||
|
|
c9c6446aa1 | ||
|
|
d8000684bf | ||
|
|
ced9cee10c | ||
|
|
3c700f9260 | ||
|
|
158979f838 | ||
|
|
b68f3af503 | ||
|
|
22344ea595 | ||
|
|
005c9d0341 | ||
|
|
46b14f85c3 | ||
|
|
1ccad1ab7d | ||
|
|
4e86f5d754 | ||
|
|
5ca6da5ae8 | ||
|
|
bc7b3fc745 | ||
|
|
795295206b | ||
|
|
7bb95460d5 | ||
|
|
704151ca19 | ||
|
|
1be7a8d461 | ||
|
|
88892c6792 | ||
|
|
3fdf0dbedc | ||
|
|
7dfeb4fd21 | ||
|
|
7af301be55 | ||
|
|
32486ef0b3 | ||
|
|
1cad06afda | ||
|
|
ad764253ca | ||
|
|
6553540153 | ||
|
|
8267934235 | ||
|
|
d90daba134 | ||
|
|
8ebba516a3 | ||
|
|
dfe01a37a4 | ||
|
|
660e392458 | ||
|
|
63e8df2320 | ||
|
|
a15916a47a | ||
|
|
457a13dac5 | ||
|
|
e911ee38bd | ||
|
|
9ac3e94dcc | ||
|
|
08d762cb0c | ||
|
|
75db7e91c6 | ||
|
|
00e3bb678d | ||
|
|
050835e955 | ||
|
|
61a6a92618 | ||
|
|
d9258da42e |
No files matched your search
@@ -1,14 +1,53 @@
|
||||
Installation Instructions for PHP 4.0
|
||||
-------------------------------------
|
||||
|
||||
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.
|
||||
first a dynamic Apache module (DSO) for Apache 1.3.x with MySQL support
|
||||
and then a static module. A more verbose explanation follows.
|
||||
|
||||
Note! Only install either the static module or the dynamic one. Do not
|
||||
install both.
|
||||
|
||||
If you want both PHP 3 and 4 modules in the same Apache server, check the
|
||||
bottom of this file for instructions.
|
||||
|
||||
INSTALLATION WITH THE ZEUS WEB SERVER:
|
||||
--Please see the 'README.Zeus' file included in this distribution
|
||||
|
||||
QUICK INSTALL (DSO)
|
||||
|
||||
For this to work your Apache httpd must have mod_so enabled.
|
||||
Check using httpd -l. You should see something like:
|
||||
|
||||
Compiled-in modules:
|
||||
http_core.c
|
||||
mod_so.c
|
||||
|
||||
Chances are you will see a lot more modules than these two. That's ok,
|
||||
as long as mod_so.c shows up you can proceed with the following steps:
|
||||
|
||||
$ gunzip -c php-4.0.x.tar.gz | tar xf -
|
||||
$ cd php-4.0.x
|
||||
$ ./configure --with-mysql --with-apxs
|
||||
$ make
|
||||
$ make install
|
||||
|
||||
If you get an error telling you that the apxs script could not be found,
|
||||
look for it on your system and if you find it, provide the full path to it
|
||||
as: --with-apxs=/path/to/apxs
|
||||
|
||||
The only thing left to do is to edit your httpd.conf file and make sure the
|
||||
PHP 4 mime type is there and uncommented. You need a line that looks like
|
||||
this:
|
||||
|
||||
AddType application/x-httpd-php .php
|
||||
|
||||
Then restart your server (apachectl restart) and you should be able to
|
||||
serve up PHP files now. Make a test file called test.php and put some
|
||||
PHP tags in it. Like <?phpinfo()?>, for example.
|
||||
|
||||
|
||||
QUICK INSTALL
|
||||
QUICK INSTALL (Static)
|
||||
|
||||
$ gunzip -c apache_1.3.x.tar.gz | tar xf -
|
||||
$ cd apache_1.3.x
|
||||
@@ -36,18 +75,66 @@ Edit your httpd.conf or srm.conf file and add:
|
||||
|
||||
VERBOSE INSTALL
|
||||
|
||||
Chances are you are reading this because the quick install steps above
|
||||
did not work for you. If this is the case, congratulations, you are
|
||||
among the elite few that actually reads documentation. It really is
|
||||
not a difficult install and once you have done it once you will fly
|
||||
through it.
|
||||
|
||||
Installing PHP can be done in four simple steps:
|
||||
|
||||
1. Unpack your distribution file.
|
||||
|
||||
You will have downloaded a file named something like php4xn.tar.gz.
|
||||
Unzip this file with a command like: gunzip php4xn.tar.gz
|
||||
You will have downloaded a file named something like php-4.0.x.tar.gz.
|
||||
Unzip this file with a command like: gunzip php-4.0.x.tar.gz
|
||||
|
||||
Next you have to untar it with: tar -xvf php4xn.tar
|
||||
Next you have to untar it with: tar -xvf php-4.0.x.tar
|
||||
|
||||
This will create a php-4.0.x directory. cd into this new directory.
|
||||
|
||||
2. Configure PHP.
|
||||
2a. Configure PHP (Dynamic Module) - Skip to 2b if you wish to build
|
||||
a static module
|
||||
|
||||
You now have to choose the options you would like. There are quite
|
||||
a few of them. To see a list, type: ./configure --help
|
||||
|
||||
The only options that you are likely to want to use are the ones in
|
||||
the last section entitled, "--enable and --with options recognized:"
|
||||
|
||||
A popular choice is to build the Apache module version. In order to
|
||||
build PHP as a dynamic module for Apache-1.3.x you have to first have
|
||||
Apache installed. Assuming Apache is already installed, make sure
|
||||
the shared object module is enabled. To check this, type: httpd -l
|
||||
You should see something like:
|
||||
|
||||
Compiled-in modules:
|
||||
http_core.c
|
||||
mod_so.c
|
||||
|
||||
You will most likely have a lot more modules than what is shown here.
|
||||
As long as mod_so.c shows up in the list, PHP should be happy.
|
||||
|
||||
Now, type: ./configure --with-mysql --with-apxs
|
||||
|
||||
If you get an error telling you that the apxs script could not be found,
|
||||
look for it on your system and if you find it, provide the full path to it
|
||||
as: --with-apxs=/path/to/apxs
|
||||
|
||||
You might also want other flags on this configure line. --with-mysql
|
||||
is just an example.
|
||||
|
||||
There are a few things that can go wrong during this configure step.
|
||||
The most common is that you have asked for an option and that the
|
||||
configure script can not find the files required to enable this
|
||||
option in PHP. Chances are you can provide the full path to the
|
||||
base directory under which the related files were installed. For
|
||||
example, if you have installed the GD library in /opt/gd which means
|
||||
that /opt/gd/include has your GD header files and /opt/gd/lib contains
|
||||
your GD library files, you would use --with-gd=/opt/gd
|
||||
|
||||
Skip to step 3 for compilation and installation instructions.
|
||||
|
||||
2b. Configure PHP (Static Module) - Skip if you performed 2a
|
||||
|
||||
You now have to choose the options you would like. There are quite
|
||||
a few of them. To see a list, type: ./configure --help
|
||||
@@ -77,8 +164,16 @@ Installing PHP can be done in four simple steps:
|
||||
Apache Configure script at least once before compiling PHP. It
|
||||
doesn't matter how you have Apache configured at this point.
|
||||
|
||||
Skip to step 3b at this point.
|
||||
|
||||
3. Compile and install the files. Simply type: make install
|
||||
|
||||
3a. Dynamic Module Installation
|
||||
|
||||
Nothing else is needed here. Proceed to step 4a.
|
||||
|
||||
3b. Static Module Installation
|
||||
|
||||
For the Apache module version this will copy the appropriate files
|
||||
to the src/modules/php4 directory in your Apache distribution if
|
||||
you are using Apache 1.3.x. If you are still running Apache 1.2.x
|
||||
@@ -136,11 +231,51 @@ Installing PHP can be done in four simple steps:
|
||||
somewhere. Re-edit Configuration and try again. If it goes well,
|
||||
type: make
|
||||
|
||||
4. Setting up the server.
|
||||
Assuming it compiles without errors, proceed to step 4b.
|
||||
|
||||
4a. Setting up the server. (Dynamic Module)
|
||||
|
||||
The make install command in step 3 should have done most of your
|
||||
work for you. It actually edits your httpd.conf file and tries to
|
||||
enable the dynamic PHP module. To verify this, look for a line that
|
||||
looks like this:
|
||||
|
||||
LoadModule php4_module libexec/libphp4.so
|
||||
|
||||
The actual path before the libphp4.so part might differ slightly. This
|
||||
is likely fine. If you are paranoid you can examine the output from the
|
||||
make install step to see where the libphp4.so file was actually put and
|
||||
place the full path to this file on this LoadModule line.
|
||||
|
||||
If somewhere in your httpd.conf file you have a ClearModuleList line
|
||||
then you also need this line:
|
||||
|
||||
AddModule mod_php4.c
|
||||
|
||||
And finally you need to tell Apache which file extension should trigger
|
||||
PHP. You do this by creating a special mime type and associating it
|
||||
with an extension. We suggest using:
|
||||
|
||||
AddType application/x-httpd-php .php
|
||||
|
||||
You are however free to use any extension you wish, including .html.
|
||||
|
||||
Note! If a line has a # at the beginning, then it is commented out
|
||||
and you need to remove the # for that line to take effect.
|
||||
|
||||
Once you have made these changes you should be ready to restart your
|
||||
server and try it out. Type: apachectl restart
|
||||
|
||||
The create a test file named test.php in your web tree somewhere and
|
||||
put some test PHP tags in it. <?phpinfo()?> is a good first test.
|
||||
This tag tells PHP to do a braindump and tells you all sorts of things
|
||||
about itself.
|
||||
|
||||
4b. Setting up the server. (Static Module)
|
||||
|
||||
You should now have a new httpd binary. Shut down your existing server,
|
||||
if you have one, and copy this new binary overtop of it. Perhaps make
|
||||
a backup of your previous one first. Then edit your conf/srm.conf file
|
||||
a backup of your previous one first. Then edit your conf/httpd.conf file
|
||||
and add the line:
|
||||
|
||||
AddType application/x-httpd-php .php
|
||||
@@ -154,13 +289,59 @@ Installing PHP can be done in four simple steps:
|
||||
Any file ending in .phps will now be displayed with full colour syntax
|
||||
highlighting instead of being executed.
|
||||
|
||||
When you are finished making changes to your srm.conf file, you can
|
||||
start up your server.
|
||||
When you are finished making changes to your httpd.conf file, you can
|
||||
start up your server. Note that on some older server setups, the
|
||||
AddType lines are in the conf/srm.conf file instead of conf/httpd.conf.
|
||||
|
||||
USING PHP3 AND PHP4 AS CONCURRENT APACHE MODULES
|
||||
Note! If a line has a # at the beginning, then it is commented out
|
||||
and you need to remove the # for that line to take effect.
|
||||
|
||||
WHY DISABLING -fPIC WORKS ON LINUX
|
||||
|
||||
From: Martin v. Loewis <martin@loewis.home.cs.tu-berlin.de>
|
||||
To: glibc-linux@ricardo.ecn.wfu.edu
|
||||
Subject: Re: Shared library -shared vs. -fpic
|
||||
|
||||
[In reply to Kaz Kylheku <kaz@ashi.footprints.net>]
|
||||
|
||||
> PIC stands for Position-Independent Code.
|
||||
|
||||
Correct.
|
||||
|
||||
> Code isn't position-independent (or ``relocatable'') cannot be
|
||||
> loaded at an arbitrary address;
|
||||
|
||||
Wrong.
|
||||
|
||||
> it requires some references to be patched at load time.
|
||||
|
||||
Correct.
|
||||
|
||||
> Shared libraries need to be relocatable because it's not known
|
||||
> beforehand what address they will be loaded at
|
||||
|
||||
Correct, depending on the meaning of "relocatable". PIC code typically
|
||||
does not contain relocations; that's why its position-independent.
|
||||
|
||||
> Just because you don't specify -fPIC doesn't mean that the compiler
|
||||
> won't emit position-independent code; the option prevents it from
|
||||
> emitting position-dependent code in situations where it otherwise
|
||||
> would.
|
||||
|
||||
Correct. However, a non-trivial shared library typically won't be
|
||||
position-independent unless explicitly compiled with
|
||||
-fPIC. Linux/glibc indeed does not require a shared library to be
|
||||
position-independent; instead, it will perform the relocations in the
|
||||
binary, even if they refer to code pages. As a result, those relocated
|
||||
pages won't be shared across processes, anymore.
|
||||
|
||||
Regards,
|
||||
Martin
|
||||
|
||||
USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES
|
||||
|
||||
Recent operating systems provide the ability to perform versioning and
|
||||
scoping. This features make it possible to let PHP3 and PHP4 run as
|
||||
scoping. This features make it possible to let PHP 3 and PHP 4 run as
|
||||
concurrent modules in one Apache server.
|
||||
|
||||
This feature is known to work on the following platforms:
|
||||
@@ -169,7 +350,7 @@ USING PHP3 AND PHP4 AS CONCURRENT APACHE MODULES
|
||||
- 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
|
||||
To enable it, configure PHP 3 and PHP 4 to use APXS (--with-apxs) and the
|
||||
necessary link extensions (--enable-versioning). Otherwise, all standard
|
||||
installations instructions apply. For example:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 2.01
|
||||
Copyright (c) 1999 The PHP Group. All rights reserved.
|
||||
The PHP License, version 2.02
|
||||
Copyright (c) 1999, 2000 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -37,12 +37,17 @@ are met:
|
||||
"This product includes PHP, freely available from
|
||||
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.
|
||||
6. The software incorporates the Zend Engine, a product of Zend
|
||||
Technologies, Ltd. ("Zend"). The Zend Engine is licensed to the
|
||||
PHP Association (pursuant to a grant from Zend that can be
|
||||
found at http://www.php.net/license/ZendGrant/) for
|
||||
distribution to you under this license agreement, only as a
|
||||
part of PHP. In the event that you separate the Zend Engine
|
||||
(or any portion thereof) from the rest of the software, or
|
||||
modify the Zend Engine, or any portion thereof, your use of the
|
||||
separated or modified Zend Engine software shall not be governed
|
||||
by this license, and instead shall be governed by the license
|
||||
set forth at http://www.zend.com/license/ZendLicense/.
|
||||
|
||||
|
||||
|
||||
|
||||
+28
@@ -26,6 +26,10 @@ EXTENSION: dba
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: dbase
|
||||
PRIMARY MAINTAINER: Jim Winstead <jimw@php.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: fdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
STATUS: Maintained
|
||||
@@ -42,6 +46,10 @@ EXTENSION: informix
|
||||
PRIMARY MAINTAINER: Danny Heijl <Danny.Heijl@cevi.be>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: interbase
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: java
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
STATUS: Maintained
|
||||
@@ -79,6 +87,18 @@ EXTENSION: pdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: pgsql
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
|
||||
STATUS: Odd fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: posix
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: recode
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: session
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
@@ -87,6 +107,10 @@ EXTENSION: snmp
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: swf
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: wddx
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
STATUS: Maintained
|
||||
@@ -95,6 +119,10 @@ EXTENSION: xml
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: yaz
|
||||
PRIMARY MAINTAINER: Adam Dickmeiss <adam@indexdata.dk>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: zlib
|
||||
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de>
|
||||
STATUS: Maintained
|
||||
|
||||
+7
-1
@@ -11,7 +11,7 @@ dbase Working
|
||||
aspell Working
|
||||
imap Working
|
||||
ldap Working
|
||||
oci8 Working (but no blob-support yet)
|
||||
oci8 Working
|
||||
oracle Working
|
||||
iptc Working
|
||||
informix Working
|
||||
@@ -19,3 +19,9 @@ zlib Working
|
||||
sysvshm Working
|
||||
odbc Working (except for persistent connections)
|
||||
MS SQL Working (tested on phpts and isapi versions)
|
||||
snmp Working
|
||||
gettext Working
|
||||
mcal Working
|
||||
interbase Working
|
||||
posix Working
|
||||
recode Working
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
ZEND_DIR = $(srcdir)/libzend
|
||||
SUBDIRS = libzend ext sapi $(TSRM_DIR) $(REGEX_DIR) . pear
|
||||
|
||||
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 reentrancy.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)
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
|
||||
ZEND_DIR = $(srcdir)/Zend
|
||||
SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) . $(PEAR_DIR)
|
||||
|
||||
LTLIBRARY_NAME = libphp4.la
|
||||
LTLIBRARY_SOURCES = stub.c
|
||||
|
||||
LTLIBRARY_DEPENDENCIES = \
|
||||
Zend/libZend.la \
|
||||
sapi/$(PHP_SAPI)/libsapi.la \
|
||||
main/libmain.la \
|
||||
$(REGEX_LIB) \
|
||||
$(EXT_LTLIBS) \
|
||||
$(TSRM_LIB)
|
||||
|
||||
LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS)
|
||||
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS)
|
||||
|
||||
PROGRAM_NAME = php
|
||||
PROGRAM_SOURCES = stub.c
|
||||
PROGRAM_LDADD = libphp4.la
|
||||
PROGRAM_LDFLAGS = -export-dynamic
|
||||
PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD)
|
||||
|
||||
targets = $(LTLIBRARY_NAME) $(PHP_PROGRAM)
|
||||
|
||||
install_targets = install-sapi install-modules
|
||||
|
||||
include $(top_srcdir)/build/rules.mk
|
||||
include $(top_srcdir)/build/library.mk
|
||||
include $(top_srcdir)/build/program.mk
|
||||
|
||||
install-sapi:
|
||||
@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
|
||||
-@$(mkinstalldirs) $(bindir)
|
||||
-@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
|
||||
for i in 0.0.0 0.0 0; do \
|
||||
if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \
|
||||
$(LN_S) $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); \
|
||||
break; \
|
||||
fi; \
|
||||
done; \
|
||||
fi
|
||||
$(INSTALL_IT)
|
||||
|
||||
install-modules:
|
||||
@test -d modules && \
|
||||
$(mkinstalldirs) $(moduledir) && \
|
||||
echo "installing shared modules into $(moduledir)" && \
|
||||
rm -f modules/*.la && \
|
||||
cp modules/* $(moduledir) >/dev/null 2>&1 || true
|
||||
|
||||
install-su: install-modules
|
||||
(cd pear && $(MAKE) install)
|
||||
|
||||
.NOEXPORT:
|
||||
@@ -1,18 +1,475 @@
|
||||
PHP 4.0 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
?? ?? ????, Version 4.0 Beta 4
|
||||
25 Jun 2000, Version 4.0.1
|
||||
- Fixed problems with POST requests under the NSAPI module (Roberto Biancardi)
|
||||
- Added spliti() function. (Thies)
|
||||
- Fixed serializer behaviour with regards to serializing objects which class
|
||||
definition was not available in the deserializing context. (Sascha)
|
||||
- Improve memory cache performance and increase cache size. (Stas, Zend Engine)
|
||||
- Added a crc32 checksum function - used by the UdmSearch search engine
|
||||
and currently run through a system call. This will speed up the UdmSearch
|
||||
php frontend significantly. (Rasmus)
|
||||
- Modified in_array() to not touch array pointer. (Andrei)
|
||||
- Added restore_error_handler(). (Zeev, Zend engine)
|
||||
- Fixed erroneous file names and line numbers in error situations under the
|
||||
multithreaded version of PHP - most noticeably Win32 (Zeev, Zend Engine)
|
||||
- Fixed problem with CGI crashing on certain servers especially Windows Apache
|
||||
& O'Reilly website (Andi)
|
||||
- Added Pi3Web SAPI module; run ./configure --with-pi3web to enable this.
|
||||
(Holger; zimpel@t-online.de)
|
||||
- Enhanced WDDX functions to call __sleep() and __wakeup() when working on
|
||||
objects. (Andrei)
|
||||
- Changed WDDX to serialize arrays as structs only if needed. (Thies)
|
||||
- Implemented max_execution_time under Win32 (Zeev)
|
||||
- Updated strtotime() to handle many more formats. It now has complete
|
||||
feature parity with GNU date command. (Andrei)
|
||||
- Added support for multiple arguments in unset(). (Faisal, Zend Engine)
|
||||
- Functions that expect a resource but are passed something else now return
|
||||
NULL instead of FALSE. (Thies, Zend Engine)
|
||||
- Fixed gmmktime(), on certain systems it incorrectly adjusted for the timezone
|
||||
offset and daylight savings time. (Andrei)
|
||||
- Moved VC++ Win32 project and workspace files to the win32 directory
|
||||
(Zeev)
|
||||
- Fixed checkdate() to not return true on non-numeric arguments (Rasmus)
|
||||
- Added --enable-c9x-inline option for compilers which support the new C9x
|
||||
standard. If you encounter undefined references to i_zend_is_true and
|
||||
other symbols, you should enable this. (Sascha, Zend Library)
|
||||
- Fixed a problem in ldap_add() and ldap_modify(), sometimes added trailing
|
||||
garbage to the values (Stig Venaas)
|
||||
- Fixed a problem with dbmopen() not handing 'c' correctly with dbm/db/ndbm
|
||||
databases. (JimJag)
|
||||
- Fixed a crash in number_format() when used with locales. (Andrei)
|
||||
- Fixed an initialization problem in the MS-SQL problem that could cause
|
||||
a crash in mssql_query() (Zeev)
|
||||
- Upgraded PCRE to version 3.2 and fixed a bug when anchored pattern
|
||||
matched an empty string. (Andrei)
|
||||
- Fixed a bug that prevented PHP from paying attention to the extension_dir
|
||||
directive with extensions that were loaded from the php.ini file (Zeev)
|
||||
- Changed set_error_handler() to return the name of the previously defined
|
||||
error handler, if any (Zeev, Zend Engine)
|
||||
- Declared <?php_track_vars?> officially dead. It didn't work in PHP 4.0.0
|
||||
either, but now it's gone for good (Zeev)
|
||||
- Make convert_cyr_string() binary safe and stop it from corrupting other
|
||||
PHP variables. (Andi)
|
||||
- Added functions array_unique, array_intersect and array_diff (Stig Venaas)
|
||||
- Fixed problem when using uninitialized values in comparisons with strings.
|
||||
They behave as empty strings again just like in PHP 3.
|
||||
(Andi & Zeev, Zend Engine)
|
||||
- Fixed 'Z' flag in date() to adjust for daylight savings time. (Andrei)
|
||||
- Fixed var_dump() not to modify the internal order of array elements (Zeev)
|
||||
- Fixed stripcslashes() to remove to strip \ in unknown escapes instead of
|
||||
leaving it. (Andrei)
|
||||
- Changed WDDX to always serialize arrays as structs. (Andrei)
|
||||
- Fixed include_once() to issue a warning in case the supplied file name is
|
||||
not found (Zeev, Zend Engine)
|
||||
- Fixed a bug in get_declared_classes() which could return the same class
|
||||
multiple times under certain circumstances (Zeev, Zend Engine)
|
||||
- Fixed a bug in rawurldecode() that would cause in rawurldecode() corrupting
|
||||
its argument (Zeev)
|
||||
- Parse errors (or other errors) in the php.ini files under Windows will no
|
||||
longer mess up the HTTP headers in CGI mode and are now displayed in a
|
||||
message box (Zeev)
|
||||
- Fixed a crash in OCIFetchStatement() when trying to read after all data
|
||||
has already been read. (Thies)
|
||||
- fopen_wrappers() are now extensible via modules (Hartmut Holzgraefe)
|
||||
- Make trim strip \0 to match php 3 (Rasmus)
|
||||
- Added function imagecreatefromxbm(). (Jouni)
|
||||
- Added function imagewbmp(). (Jouni, based on patch from Rune Nordbøe
|
||||
Skillingstad)
|
||||
- Added str_pad() for padding a string with an arbitrary string on left or
|
||||
right. (Andrei)
|
||||
- Made the short_tags, asp_tags and allow_call_time_pass_reference INI
|
||||
directives work on a per-directory basis as well, e.g. from .htaccess
|
||||
files. (Zeev)
|
||||
- Added fflush() function. (Eric Huss)
|
||||
- Fixed a problem with static variables, default function arguments and class
|
||||
member variables, that contained array values. (Andi & Zeev, Zend Engine)
|
||||
- Fix virtual() when used with output buffering (Marc Pohl)
|
||||
- Clean up constants in flock() function and add optional 3rd arg which
|
||||
is set to true on EWOULDBLOCK (Rasmus)
|
||||
- Added functions pg_loimport(), pg_loexport(). (Jouni)
|
||||
- Add SWF support to getimagesize() function (Derick Rethans)
|
||||
- Add support for both indexed and non-indexed arrays of file uploads
|
||||
eg. name="file[]" type="file" (Rasmus)
|
||||
- Added create_function(), which gives the ability to create functions
|
||||
on-the-fly (Zeev, Zend Engine)
|
||||
- Added support for comparisons of arrays (with arrays) and objects (with
|
||||
objects); The equality operator (==) performs an unordered comparison,
|
||||
whereas the identity operator (===) performs an ordered comparison (Zeev,
|
||||
Zend Engine)
|
||||
- Allow all functions that receive user-defined function callbacks to accept
|
||||
an array that contains an object and a method name, in place of a function
|
||||
name, e.g. usort($array, array($obj, "ObjSort")) (Zeev, Zend Engine)
|
||||
- Added set_error_handler() to allow custom error handling functions,
|
||||
instead of the built-in error handling code (Zeev, Zend Engine)
|
||||
- Renamed user_error() to trigger_error(); user_error() remains
|
||||
defined for compatibility (Zeev, Zend Engine)
|
||||
- Fix the global/static statements to require a trailing terminating
|
||||
semi-colon ';'. (Andi, Zend Engine)
|
||||
- Cleaned up PCRE extension and made it binary-safe. (Andrei)
|
||||
- Added third argument to in_array(). If it's true, then in_array()
|
||||
will use strict comparison instead of the default one. (Andrei)
|
||||
- Added pg_trace() and pg_untrace (Dominic J. Eidson & Zeev)
|
||||
- ignore_user_abort=Off is now default. (Thies)
|
||||
- Added array_merge_recursive() that will recursively merge values
|
||||
under the same keys. (Andrei)
|
||||
- fixed crash in OCIParse when parsing invalid SQL. (Thies)
|
||||
- Fixed a bug in mysql_connect() that made it ignore the socket argument, in
|
||||
case of non-persistent connects (Zeev)
|
||||
- Added disable_functions php.ini directive, to allow administrators to disable
|
||||
certain functions for security reasons (Zeev)
|
||||
- Fixed sessions on Win32. When setting the directory depth parameter in
|
||||
save_path you need to now delimit it with a ';' instead of ':', e.g
|
||||
"5;/tmp" instead of "5:/tmp" (Andi)
|
||||
- Changed the Apache handler's return status to 'Declined' when a requested
|
||||
PHP file could not be found. Returning 'Not Found' caused problems
|
||||
in the ErrorDocument handler stage in that $REDIRECT_REDIRECT_ERROR_NOTES
|
||||
was not getting set at all. Moving to 'Declined' should fix this and I
|
||||
can't see any other side effects. (Rasmus)
|
||||
- Fixed scanning decimal numbers in internationalized environments. They should
|
||||
always be in standard US format e.g. 23.3. (Andi, Zend Engine)
|
||||
- Added second argument to preg_quote() which allows quoting of
|
||||
one additional character, usually the regex delimiter. (Andrei)
|
||||
- Uncommitted outstanding OCI8 transactions are now rolled back
|
||||
before the connection is closed. (Thies)
|
||||
- ignore_user_abort() & friends should now work in CGI mode as well.
|
||||
(Patch by daniel.braun@ercom.fr)
|
||||
- Added extension YAZ (dickmeiss).
|
||||
- Fixed a crash bug triggered by certain cases of class redeclarations
|
||||
(Stanislav & Zeev, Zend Engine)
|
||||
- Fixed min()/max() segfault. (Andrei)
|
||||
- New module for reading EXIF header data from JPEG files. Most digital
|
||||
cameras will embed all sorts of information about a picture inside the
|
||||
jpeg images it generates. (Rasmus)
|
||||
- Fixed basename() bug where "file.ext///" would not return the same
|
||||
as "/path/file.ext///" (Rasmus)
|
||||
- Add the swf_ortho function. (Sterling)
|
||||
- Moved to virtual current working directory support. This highly improves the
|
||||
functionality and stability of multi-threaded versions of PHP (Andi, Sascha)
|
||||
|
||||
22 May 2000, Version 4.0.0 Release
|
||||
- Allow the writing of flash files to stdout.
|
||||
- Fixed a crash bug in .phps syntax-highlighted files (Andi)
|
||||
- Improved round() to allow specification of rounding precision.
|
||||
(Andrei, Todd Kirby <kirbyt@yahoo.com>)
|
||||
- Added SORT_REGULAR, SORT_NUMERIC, SORT_STRING flags that can be used with
|
||||
non-user sort functions for precise sorting behavior. (Andrei)
|
||||
- Fixed two 64-bit issues (startup crash, gethostbyaddr). (Sascha)
|
||||
- NULL values are now preserved in the return value of mysql_fetch_array()
|
||||
and mysql_fetch_object(). (Andrei)
|
||||
- Ported InterBase module finally from PHP 3 to PHP 4. Full support for
|
||||
InterBase 6. (Jouni)
|
||||
- Added swf_definepoly for drawing polygons to the SWF functions. (Sterling)
|
||||
- Ported imagegammacorrect from PHP3 to PHP4. (Sterling)
|
||||
- Added array_rand() function. (Andrei)
|
||||
|
||||
8 May 2000, Version 4.0 Release Candidate 2
|
||||
- NSAPI WIN32 Module compilable, untested (Shane)
|
||||
- Apache WIN32 Module compilable and lightly tested. (Shane)
|
||||
- Enabled assert() by default in php.ini-dist. (Andrei)
|
||||
- Put in safeguards in case dynamic code evaluation in assert() and
|
||||
preg_replace() with /e modifier fails. (Andrei)
|
||||
- Fixed infinite recursion when serializing $GLOBALS[] in WDDX. (Andrei)
|
||||
- Made WDDX serialization properly escape <, >, and &. Also speeded up
|
||||
the serialization in general. (Andrei)
|
||||
- Moved install-local to install-sapi for clarity. (Joey)
|
||||
- Improved extension build framework. Refer to README.SELF-CONTAINED-EXTENSIONS
|
||||
for an introduction. (Sascha)
|
||||
- ImagePolygon() is no longer limited by a maximum number of polygons.
|
||||
(Marc Pohl)
|
||||
- Added configure time checking for bcmath package. (Joey, Sascha)
|
||||
- Added get_declared_classes(). (Andrei, Zend Engine)
|
||||
- Add initial NSAPI module from Jayakumar Muthukumarasamy. (Rasmus)
|
||||
- Added the SWF module which allows you to create Macromedia Flash files via
|
||||
libswf. (Sterling)
|
||||
- Improved UNIX build system to support more vendor make tools (Sascha)
|
||||
- Updated natural comparison/sorting algorithm by Martin Pool
|
||||
<mbp@humbug.org.au>. (Andrei)
|
||||
- Fixed a crash in array_multisort() that happened when empty arrays
|
||||
were passed to it. (Andrei)
|
||||
- Added substr_count() from Peter Kovacs. (Andrei)
|
||||
- Add an optional third argument to fseek to indicate where to seek from.
|
||||
(Andrei)
|
||||
- OCIBindByName() will no longer complain about bindlength beeing zero. (Thies)
|
||||
- Converted the IMAP module to the high performance API (Zeev)
|
||||
- The fgetcsv() function now handles embedded end-of-line in a quoted field
|
||||
(Nick Talbott)
|
||||
- Added user_error(), to allow explicitly generate error messages from scripts
|
||||
(Zeev, Zend Engine)
|
||||
- Fixed a problem in long2ip() that occasionally returned incorrect IP address.
|
||||
(Evan, Andrei)
|
||||
- Fixed many memory leaks in the IMAP module (Stas, Andi, Zeev)
|
||||
- Fixed bug in number_format (Jon Forsberg)
|
||||
- Make error_prepend_string and error_append_string work (Rasmus)
|
||||
- array_walk() now automatically resets the array. (Andrei)
|
||||
- Added natural comparison/sorting routines strnatcmp(), strnatcasecmp(),
|
||||
natsort(), and natcasesort(). These are useful for comparing and sorting
|
||||
strings that contain numbers. Based on the code from Martin Pool
|
||||
<mbp@humbug.org.au>. See http://www.linuxcare.com.au/projects/natsort/
|
||||
for more info on natural sorting. (Andrei)
|
||||
- Zeus Webserver support (version 3.3.6+) for ISAPI (Ben Mansell)
|
||||
- Fixed several problems with the PATH_TRANSLATED and PHP_SELF under Apache
|
||||
(Paul Gregg & Zeev)
|
||||
- Ported ldap_get_values_len() function from PHP3 to PHP4. (Sterling)
|
||||
- Fixed a problem in include_once() with non constant arguments (Andi & Zeev,
|
||||
Zend Engine)
|
||||
- Added php.ini-optimized (Zeev)
|
||||
- Ported ldap_errno(), ldap_err2str() and ldap_error() from PHP3 to PHP4.
|
||||
(Sterling)
|
||||
- WDDX now defaults to ISO-8859-1. (Thies)
|
||||
- Fixed crash resulting from IMAP's error handling (Stas)
|
||||
- Added $HTTP_POST_FILES[filename][tmp_name] - it was previously impossible to
|
||||
retrieve the temporary name of an uploaded file using $HTTP_POST_FILES[]
|
||||
(Zeev)
|
||||
- Made the IMAP and LDAP modules compilable under Windows and thread-safe
|
||||
(Zeev)
|
||||
- Fixed a problem when dealing with large POST blocks in CGI mode (Zeev)
|
||||
- Added session_get_cookie_params() function. (Sterling)
|
||||
- Fixed return of stristr() to no longer always be lowercased. (Andrei)
|
||||
- Changed the Windows version of PHP so that a php.ini file is no
|
||||
longer mandatory (Zeev)
|
||||
- session_start() is now more verbose if headers cannot be send. (Thies)
|
||||
- Fixed a memory leak when using assign-op bitwise operators on strings (Zeev,
|
||||
Zend Engine)
|
||||
- Added support for reading properties that require arguments in the COM
|
||||
module - writing to them will only be supported in PHP 4.1 (Zeev)
|
||||
- Fixed a very old legacy memory leak in the COM module (Zeev)
|
||||
- Fixed problems with object-overloading support - noteably, COM and Java
|
||||
(Zeev, Zend Engine)
|
||||
- Fixed an overrun in WDDX. (Thies)
|
||||
- Fixed a crash bug with modules loaded through dl() not properly freeing their
|
||||
resources (Zeev, Zend Engine)
|
||||
- Added localtime() function. (Sterling)
|
||||
- Added the 'I' format option for the date function, this option will return
|
||||
true or false depending on whether or not daylight savings time is in effect.
|
||||
(Sterling)
|
||||
- Added gmstrftime() function. (Sterling)
|
||||
- snmp_walkoid is now an alias for snmp_realwalk. (Sterling)
|
||||
- Fixed a bug that could cause a crash when using 'global' inside large include
|
||||
files (Stas, Zend Engine)
|
||||
- Added --enable-libgcc switch to force linking against libgcc (Sascha)
|
||||
- Fixed dynamic loading where extension_dir had no trailing slash (Sascha)
|
||||
- Fixed dynamic loading on OpenBSD (Sascha)
|
||||
- Improved POSIX threads check. ZTS works now on at least Linux, Solaris,
|
||||
FreeBSD and OpenBSD (Sascha, TSRM)
|
||||
- Added !== operator support. (Torben, Zend Engine)
|
||||
|
||||
27 March 2000, Version 4.0 Release Candidate 1
|
||||
- Added support for UCD-SNMP 4.1.x (Sascha)
|
||||
- Fixed a data corruption bug in mysql_result(), if used in table.fieldname
|
||||
mode (Zeev)
|
||||
- Fixed a crash problem in func_num_args(), func_get_arg() and func_get_args()
|
||||
when used as function arguments (Andi, Zend Engine)
|
||||
- Added get_class_methods(string classname) function. (Andrei)
|
||||
- Added 'I' switch to test whether or not DST is active. (Sterling)
|
||||
- Fixed a data corruption bug in mysql_result(), if used in table.fieldname
|
||||
mode (Zeev)
|
||||
- Modified the registry INI entry reader (Win32) to work with drive letters.
|
||||
For example, if you wish to wish to specify INI entries for C:\foo\bar, you
|
||||
should create HKLM\PHP\Per Directory Values\C\foo\bar in the registry, and add
|
||||
string values for each directive you want to override in this directory (Zeev)
|
||||
- Fixed extract() for EXTR_PREFIX_SAME and EXTR_SKIP cases. (Andrei)
|
||||
- stristr() no longer modifies it's arguments. (Thies)
|
||||
- Don't default to iso-8859-1 since this confuses some browsers. (Rasmus)
|
||||
- Make it possible to specify both a port and a socket
|
||||
in mysql_[p]connect. (Rasmus)
|
||||
- Added --disable-pic for disabling generating PIC for shared objects
|
||||
on platforms which support it (i.e. Linux) (Sascha)
|
||||
- serialize()/unserialize() now call __sleep() and __wakeup() when
|
||||
working on objects. (Thies)
|
||||
- renamed to_string() method to __string_value() for consistency.
|
||||
(Thies, Zend Engine)
|
||||
- Fixed a bug in the third argument to define()
|
||||
- Added is_numeric() that returns true if the argument is a number
|
||||
or a numeric string. (Andrei)
|
||||
- domxml now supports libxml 2.0 Beta and drops support for older versions,
|
||||
due to massive changes in libxml
|
||||
- fixed possible crash in unserialize() if serialized data was
|
||||
corrupted. (Thies)
|
||||
- Changed $HTTP_STATE_VARS to $HTTP_SESSION_VARS. Use only the latter
|
||||
version now! (Andrei)
|
||||
- Added GD-JPEG Support (Rasmus)
|
||||
- Prevent from loading dynamic PHP modules which were compiled with different
|
||||
debug and thread safety modes than PHP, which resulted in a crash (Andi)
|
||||
- connection_aborted() and friends work again (Thies)
|
||||
- Upgraded to libtool 1.3.4 (Sascha)
|
||||
- UNIX configure creates config.nice in the build directory now which allows
|
||||
easy reuse of configuration options (Sascha)
|
||||
- Added support for embedded MySQL client library. Unless you specify a path
|
||||
to --with-mysql, the bundled MySQL client library will be used (Sascha)
|
||||
- Added include_once() and require_once() functionality (Andi, Zend Engine)
|
||||
- Removed support for pdflib < 3.0 (Uwe)
|
||||
- Added auto-registration of everything in $HTTP_SESSION_VARS[] if
|
||||
register_globals is turned off. (Andrei)
|
||||
- Cleaned up extension namespace (Stig)
|
||||
- OCINLogon() sessions are now closed again. (Thies)
|
||||
- Added ip2long() and long2ip(),
|
||||
courtesy of Faisal Nasim <faisal@nasim.org> (Andrei)
|
||||
- Added ftruncate() and fstat(),
|
||||
courtesy of Faisal Nasim <faisal@nasim.org> (Andrei)
|
||||
- Added parse_ini_file(). Currently implemented in non thread safe version
|
||||
of PHP, and currently lacks section support (Zeev)
|
||||
- "none" is now equivalent with "" in Apache config directives (Stig)
|
||||
- OCINLogon no longer crashes. (Thies)
|
||||
- Fixed comparisons of (string) "nan" with (string) "nan". (Thies, Zend Engine)
|
||||
- Switched back to the old $HTTP_*_VARS[] behavior - $HTTP_GET_VARS["foo"]
|
||||
and $foo are no longer references to each other, but separate variables
|
||||
like they were prior to PHP 4.0 Beta 4 (Zeev)
|
||||
- Fixed Sybase-DB compilation (Zeev)
|
||||
- Fixed a (fairly common) situation where error_reporting values would not be
|
||||
properly restored after a call to error_reporting(), in between requests
|
||||
(Zeev)
|
||||
- The various $HTTP_*_VARS[] are now protected, and cannot be manipulated by
|
||||
user input (Zeev)
|
||||
- Added ini_set() as an alias to ini_alter() (Zeev)
|
||||
- The string None is now recognized as a keyword by the php.ini processor, and
|
||||
can be used to denote an empty string (Zeev)
|
||||
- Added get_class_vars(string class_name) and get_object_vars(object obj)
|
||||
functions. (Andrei, Zend Engine)
|
||||
- Added pdf_set_parameter(), pdf_skew(), pdf_show_boxed() (Uwe)
|
||||
- Fixed comparison of (string) "inf" with (string) "inf", which was erroneously
|
||||
returning false (Zeev)
|
||||
- Implemented default_charset and default_mimetype config directives (Stig)
|
||||
- Ported T1lib support from PHP3. (Jouni)
|
||||
- Fixed -DEAPI inheritance from APXS. (Sascha)
|
||||
- Fixed possible crash in module-shutdown. (Thies)
|
||||
- Fixed safe_mode_protected_env_vars INI directive (Zeev)
|
||||
- Fixed getrusage() (Sascha)
|
||||
- Fixed OCI8 crash when returning cursors from stored-procedures. (Thies)
|
||||
|
||||
21 February 2000 Version 4.0 Beta 4 patch level 1
|
||||
- Fixed crash when magic_quotes were switched off. (Thies)
|
||||
- Support for pdflib 2.30 (Uwe)
|
||||
|
||||
20 February 2000, Version 4.0 Beta 4
|
||||
- Introduced $HTTP_POST_FILES[], that contains information about files uploaded
|
||||
through HTTP upload (Zeev)
|
||||
- Made PHP work under Microsoft Personal Web Server, under both Windows NT
|
||||
workstation and Windows 95 (Zeev)
|
||||
- Made multipart/form-data content obey to the variables_order directive (Zeev)
|
||||
- Updated the browscap module to work with PHP 4.0 (Zeev)
|
||||
- Recover gracefully in ISAPI after the client prematurely presses STOP (Andi)
|
||||
- Fixed bug in unset() on array offsets which are referenced more than once
|
||||
(Andi, Zend Engine)
|
||||
- Improved ISAPI module - it should no longer be necessary to set PHP as
|
||||
an ISAPI filter, only as an ISAPI extension, unless you wish to perform
|
||||
authentication using PHP. This didn't yet get enough testing, but it
|
||||
should work (Zeev)
|
||||
- Fixed RFC1867 file upload under Windows (Zeev)
|
||||
- Initital support for pdflib 2.20 (Uwe)
|
||||
- Added PostgreSQL support for DB (Rui Hirokawa <louis@cityfujisawa.ne.jp>)
|
||||
- Re-introduced "none" for disabling auto_prepend/append_file (Stig)
|
||||
- Added DB/storage (Stig, PEAR)
|
||||
- Introduced DB warnings (Stig, PEAR)
|
||||
- Fixed overrun in strip_tags (Stas)
|
||||
- Fixed crash in strip_tags() and related functions. (Thies)
|
||||
- Workaround for bogus POST-Data from IE/Mac. (Thies)
|
||||
Patch by Alain Malek <alain@virtua.ch>
|
||||
- Finished the server abstraction layer; All of the PHP code is now shared
|
||||
across different servers (Apache, CGI, IIS, etc.), except for thin
|
||||
interface modules (Zeev)
|
||||
- Added NULL-support in gettype(). (Thies)
|
||||
- base64_decode() will decode POST data correct. (Thies)
|
||||
Patch submitted by: Turadg Aleahmad <turadg@wise.berkeley.edu>
|
||||
- Much more work on domxml. Build xml tree, create xml doc works (Uwe)
|
||||
- Made foreach() work on objects. (Thies, Zend Engine)
|
||||
- Added domxml extension based on libxml, still little functionality (Uwe)
|
||||
- Fixed memory corruption in fgetss(), strip_tags() and gzgetss() (Zeev)
|
||||
- Updated calendar dynamic library to work with PHP 4. (Evan)
|
||||
- Added strncmp() function, courtesy of Walter. (Andrei)
|
||||
- Made the output of var_dump() more informative. (Thies)
|
||||
- Fixed some OCIBindByName() problems. (Thies)
|
||||
- Protect the ISAPI module against exceptions. Stack overflows in scripts are
|
||||
now nicely detected and handled (Zeev)
|
||||
- Fixed possible buffer-overflow in base64_decode. (Thies)
|
||||
- Fixed possible buffer-overflow in setcookie(). (Thies)
|
||||
- Fixed signal() bug that could cause the Apache master process to
|
||||
die. (Thies)
|
||||
- Added session_set_cookie_params() function. (Andrei)
|
||||
- If header information is sent after output has already been sent, the warning
|
||||
message will now state the filename and line number at which the first output
|
||||
was made (Zeev)
|
||||
- Added the XML Expat library to the standard PHP source distribution thanks
|
||||
to its author James Clark (Andi & Zeev)
|
||||
- Added XML support to the default Win32 build (Andi & Zeev)
|
||||
- Added socket_get_status() function. Renamed:
|
||||
set_socket_timeout() -> socket_set_timeout()
|
||||
set_socket_blocking() -> socket_set_blocking(). (Andrei)
|
||||
- Added realpath() function. (Andrei)
|
||||
- mktime interprets years in the range 0-70 now as 2000-2070. You can
|
||||
continue to specify the complete year (i.e. 1920) (Sascha)
|
||||
- Added the ability to control the environment variables the user is allowed
|
||||
to change in Safe Mode, using INI directives (Zeev)
|
||||
- Fixed a crash bug in strtr() working on large input strings (Zeev)
|
||||
- Ora_GetColumn()/Ora_FetchInto() now return NULL for NULL-Columns. (Thies)
|
||||
- OCI8 now supports binding of NULL-values. Module cleanups. (Thies)
|
||||
- Added ability to set timeout on socket read operations through
|
||||
set_socket_timeout() function. (Andrei)
|
||||
- Added implicit_flush INI directive (Zeev)
|
||||
- Added implicit_flush() to control whether flush() should be called
|
||||
implicitly after any output (Zeev)
|
||||
- Fixed a crash in pfsockopen() (Zeev)
|
||||
- Fixed a possible crash in phpinfo() (Zeev)
|
||||
- Added register_argc_argv INI directive, to allow to selectively disable
|
||||
the declaration of the $argv and $argc variables for increased
|
||||
performance (Zeev)
|
||||
- Added $HTTP_ENV_VARS[] and $HTTP_SERVER_VARS[] support, which similarly
|
||||
to $HTTP_GET_VARS[], contain environment and server variables. Setting
|
||||
register_globals to Off will now also prevent registration of the
|
||||
environment and server variables into the global scope (Zeev)
|
||||
- Renamed gpc_globals INI directive to register_globals (Zeev)
|
||||
- Introduced variables_order that deprecates gpc_order, and allows control
|
||||
over the server and environment variables, in addition to GET/POST/Cookies
|
||||
(Zeev)
|
||||
- new function cpdf_set_document_limits() (Uwe)
|
||||
- Applied safe-mode patch to popen(). (Patch by Kristian Köhntopp)
|
||||
- str_repeat() now returns correct length. (Thies)
|
||||
- Don't assume libz and libpng are installed for the GD checks (Rasmus)
|
||||
- Implemented support for <boolean> and <null> types according
|
||||
to WDDX version 1.0 (Andrei)
|
||||
- Made var_dump()/serialize()/unserialize() NULL aware. (Thies)
|
||||
- Added new NULL constant (Zeev, Zend Engine)
|
||||
- Fixed -c support in the standalone CGI binary (Zeev)
|
||||
- Increased PHP's performance by 5-15% using a new memory cache (Andi & Zeev,
|
||||
Zend Engine)
|
||||
- Improved the php.ini reader to support constants and bitwise operators (Zeev)
|
||||
- Fixed strrev() to no longer modify arg1. (Thies)
|
||||
- Fixed buffer overruns in iptcembed(). (Thies)
|
||||
- Fixed a bug in ODBC error reporting (Zeev)
|
||||
- Added PHP_Logo_GUID() and Zend_Logo_GUID() functions, that return the GUIDs
|
||||
of the PHP and Zend logos used in phpinfo() (Zeev)
|
||||
- Added GNU Pth support (Sascha, TSRM library)
|
||||
- Removed select(), fd_set() and fd_isset() - will be reimplemented soon! (Thies)
|
||||
- Improved Win32 performance significantly by using different mutexes (Zeev,
|
||||
TSRM library)
|
||||
- Made quotemeta() and preg_quote() binary-safe. (Andrei)
|
||||
- Added UDP support in fsockopen(). (Evan)
|
||||
- Added --disable-pear option (Andrei)
|
||||
- Renamed libzend repository to Zend (Zeev)
|
||||
- Added support for thttpd (Sascha)
|
||||
- Added session.cache_limiter and cache_expire options (Sascha)
|
||||
- Restored the PHP_VERSION and PHP_OS constants (Zeev)
|
||||
- Added get_loaded_extensions(), extension_loaded(), and
|
||||
get_extension_funcs() functions. (Andrei)
|
||||
- Added date/time stamping to PHP error log file. (Andrei, Joey)
|
||||
- Added is_subclass_of() function (Andrei, Zend Engine)
|
||||
- Implemented count_chars(). (Thies)
|
||||
- Added class_exists() function (Andrei, Zend Engine)
|
||||
- Made strspn() and strcspn() binary-safe. (Andrei)
|
||||
- Added array_multisort() function. (Andrei)
|
||||
- Made pageinfo.c thread-safe (Sascha)
|
||||
- Made implode() binary-safe (Andrei)
|
||||
- Made strstr(), stristr(), and ucwords() binary-safe() (Andrei)
|
||||
- Made strtoupper(), strtolower(), substr_replace() binary-safe. (Andrei)
|
||||
- Fix a crash in the Apache syntax highlighting mode (Zeev)
|
||||
- Fixed a crash in the Apache syntax highlighting mode (Zeev)
|
||||
- Report all ODBC error's not just the one on the top of the stack (lurcher)
|
||||
- OCI8 now returns NULL values in LONG columns correct. (Thies)
|
||||
- Added support for a C-like assert() function. (Thies)
|
||||
- Added CyberCash support. (Evan)
|
||||
- explode() is now binary-safe. (Thies)
|
||||
- strpos() is now binary-safe. (Thies)
|
||||
- added XML_Set_Object() function, now you can use the XML-Parser from
|
||||
- Made explode() binary-safe. (Thies)
|
||||
- Made strpos() binary-safe. (Thies)
|
||||
- Added XML_Set_Object() function, now you can use the XML-Parser from
|
||||
within an object. (Thies)
|
||||
- Session vars are now decoded into $HTTP_STATE_VARS[] array and the
|
||||
globals, depending on track_vars and gpc_globals settings (Andrei)
|
||||
@@ -20,13 +477,13 @@ PHP 4.0 NEWS
|
||||
to their full path (Zeev)
|
||||
- PHP 4 scripts will now obey the max_execution_time setting and actually
|
||||
time out (Rasmus)
|
||||
- Add configure command to phpinfo() output (Stig)
|
||||
- Add optional socket path to the mysql_?connect() functions (Rasmus)
|
||||
- Added configure command to phpinfo() output (Stig)
|
||||
- Added optional socket path to the mysql_?connect() functions (Rasmus)
|
||||
- Made mysql and gd work as shared extensions again (Stig)
|
||||
- Make the global GET/POST/Cookie variables and their $HTTP_*_VARS[] counterparts
|
||||
be references to each other (Zeev)
|
||||
- Added support for the 'use' keyword - behaves like 'require', but will not
|
||||
use the same file more than once (Andi & Zeev, Zend library)
|
||||
use the same file more than once (Andi & Zeev, Zend Engine)
|
||||
- Added check to see if a persistent connection is still valid with the
|
||||
ODBC interface before reusing (nick@easysoft.com)
|
||||
- Added DBMaker support (patch by Pax Tsai <paxtsai@lion.syscom.com.tw>)
|
||||
@@ -35,7 +492,7 @@ PHP 4.0 NEWS
|
||||
- Disable symlinks to urls (Rasmus)
|
||||
- Informix driver now reflects version of ESQL/C used (Danny)
|
||||
- Modified session_register() to take variable number of arguments (Andrei)
|
||||
- Fixed file descriptor leak in thread safe mode (Zeev, Zend library)
|
||||
- Fixed file descriptor leak in thread safe mode (Zeev, Zend Engine)
|
||||
- Added select(), fd_set() and fd_isset() (Evan)
|
||||
- cpdf support has been ported from php3, needs ClibPDF 2.x (Uwe)
|
||||
- Fixed a leak when using automatic output buffering (Zeev)
|
||||
@@ -44,7 +501,7 @@ PHP 4.0 NEWS
|
||||
- Fixed inconsistencies in the implementation of here-docs (Andi & Zeev, Zend
|
||||
library)
|
||||
- Fixed a problem with constant class-member initializations (Andi & Zeev,
|
||||
Zend library)
|
||||
Zend Engine)
|
||||
- Fixed float-compare in min(),max(),a[r]sort(),[r]sort() (Thies)
|
||||
- Implemented get_html_translation_table() function (Thies)
|
||||
- Implemented array_flip() function. Returns input-array with key, value
|
||||
@@ -64,7 +521,7 @@ November 16 1999, Version 4.0 Beta 3
|
||||
- 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)
|
||||
- Fixed 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)
|
||||
@@ -75,7 +532,7 @@ November 16 1999, Version 4.0 Beta 3
|
||||
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)
|
||||
by reference. (Andi & Zeev, Zend Engine)
|
||||
- Implemented getprotoby{name,number} (Evan)
|
||||
- Added array_pad() function. (Andrei)
|
||||
- Added new getservby{name,port} functions. (Evan)
|
||||
@@ -91,7 +548,7 @@ November 16 1999, Version 4.0 Beta 3
|
||||
- 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)
|
||||
- added === operator support. (Andi & Thies, Zend Engine)
|
||||
- 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)
|
||||
@@ -113,7 +570,7 @@ November 16 1999, Version 4.0 Beta 3
|
||||
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)
|
||||
- You can use resources as array-indices again (Thies, Zend Engine)
|
||||
- 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)
|
||||
@@ -122,16 +579,16 @@ November 16 1999, Version 4.0 Beta 3
|
||||
- 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)
|
||||
- Ported range() and shuffle() from PHP 3 to PHP 4 (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)
|
||||
Zend Engine)
|
||||
- Fixed backwards incompatibility with ereg() (Thies)
|
||||
- Updated Zend garbage collection with a much more thorough method.
|
||||
(Andi, Zend library)
|
||||
(Andi, Zend Engine)
|
||||
- Added the ability to use variable references in the array() construct.
|
||||
For example, array("foo" => &$foo). (Andi, Zend library)
|
||||
For example, array("foo" => &$foo). (Andi, Zend Engine)
|
||||
- Added array_reverse() function (Andrei)
|
||||
- Some more XML fixes/cleanups (Thies)
|
||||
- Updated preg_replace() so that if any argument passed in is an array
|
||||
@@ -157,8 +614,8 @@ November 16 1999, Version 4.0 Beta 3
|
||||
- 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)
|
||||
- Added support for the Easysoft ODBC-ODCB Bridge (martin@easysoft.com)
|
||||
- Fixed 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)
|
||||
@@ -244,15 +701,15 @@ November 16 1999, Version 4.0 Beta 3
|
||||
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 a bugglet when redefining a class at run-time (Andi, Zend Engine)
|
||||
- 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 include_path for Win32 (Andi, Zend Engine)
|
||||
- Fixed bug in ISAPI header sending function (Charles)
|
||||
- Fixed memory leak when using undefined values (Andi & Zeev, Zend library)
|
||||
- Fixed memory leak when using undefined values (Andi & Zeev, Zend Engine)
|
||||
- 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 some more class inheritance issues (Zeev, Zend Engine)
|
||||
- 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)
|
||||
@@ -305,25 +762,25 @@ August 9 1999, Version 4.0 Beta 2
|
||||
- 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)
|
||||
- Fixed various inheritance problems (Andi & Zeev, Zend Engine)
|
||||
- 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)
|
||||
overriding their children) (Zeev, Zend Engine)
|
||||
- Fixed backwards incompatibility with the "new" operator (Andi, Zend Engine)
|
||||
- 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)
|
||||
string (Zeev, Zend Engine)
|
||||
- Fixed a problem in inheritance from classes that are defined in include()d
|
||||
files (Zeev, Zend library)
|
||||
files (Zeev, Zend Engine)
|
||||
- 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)
|
||||
(Andi & Zeev, Zend Engine)
|
||||
- Fixed a crash problem in switch statements that had a string offset
|
||||
as a conditional (Andi & Zeev, Zend library)
|
||||
as a conditional (Andi & Zeev, Zend Engine)
|
||||
- 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
|
||||
@@ -346,7 +803,7 @@ August 9 1999, Version 4.0 Beta 2
|
||||
- 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)
|
||||
- Added missing E_ error level constants (Zeev, Zend Engine)
|
||||
- Fixed a bug in sending multiple HTTP Cookies under Apache (Zeev)
|
||||
- Fixed implicit connect on the MySQL, mSQL, PostgreSQL and Sybase
|
||||
modules (Zeev)
|
||||
|
||||
File renamed without changes.
+3
-1
@@ -62,7 +62,9 @@ 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.
|
||||
lines, you have to put # or @ at the beginning of _every_ such line. Every
|
||||
entry in NEWS has to have a name after it, so if you did it with someone's
|
||||
help, put both your names there.
|
||||
|
||||
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
|
||||
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
|
||||
WHAT IT IS
|
||||
|
||||
It's a tool for automatically creating the basic framework for a PHP module
|
||||
and writing C code handling arguments passed to your functions from a simple
|
||||
configuration file. See an example at the end of this file.
|
||||
|
||||
HOW TO USE IT
|
||||
|
||||
Very simple. First, cd do directory ext/ in PHP 4 sources. If you just need
|
||||
the basic framework and will be writing all the code in your functions
|
||||
yourself, you can now do
|
||||
|
||||
./ext_skel --extname=module_name
|
||||
|
||||
and everything you need is placed in directory module_name. In fact, if you
|
||||
don't need to test the existence of any external header files, libraries or
|
||||
functions in them, the module is already almost ready to be compiled in PHP.
|
||||
Just remove 3 comments in your_module_name/config.m4, cd back up to PHP
|
||||
sources top directory, and do
|
||||
|
||||
./buildconf; ./configure --enable-module_name; make
|
||||
|
||||
But if you already have planned the overall scheme of your module, what
|
||||
functions it will contain, their return types and the arguments they take
|
||||
(a very good idea) and don't want to bother yourself with creating function
|
||||
definitions and handling arguments passed yourself, it's time to create a
|
||||
function definitions file, which you will give as an argument to ext_skel
|
||||
with option
|
||||
|
||||
--proto=filename.
|
||||
|
||||
FORMAT OF FUNCTION DEFINITIONS FILE
|
||||
|
||||
All the definitions must be on one line. In it's simplest form, it's just
|
||||
the function name, ie.
|
||||
|
||||
my_function
|
||||
|
||||
but then you'll be left with an almost empty function body without any
|
||||
argument handling.
|
||||
|
||||
Arguments are given in parenthesis after the function name, and are of
|
||||
the form 'argument_type argument_name'. Arguments are separated from each
|
||||
other with a comma and optional space. Argument_type can be one of int,
|
||||
bool, double, float, string, array, object or mixed.
|
||||
|
||||
An optional argument is separated from the previous by an optional space,
|
||||
then '[' and of course comma and optional space, like all the other
|
||||
arguments. You should close a row of optional arguments with same amount of
|
||||
']'s as there where '['s. Currently, it does not harm if you forget to do it
|
||||
or there is a wrong amount of ']'s, but this may change in the future.
|
||||
|
||||
An example:
|
||||
|
||||
my_function(int arg1, int arg2 [, int arg3 [, int arg4]])
|
||||
|
||||
Arguments arg3 and arg4 are optional.
|
||||
|
||||
If possible, the function definition should also contain it's return type
|
||||
in front of the definition. It's not actually used for any C code generating
|
||||
purposes but PHP in-source documentation instead, and as such, very useful.
|
||||
It can be any of int, double, string, bool, array, object, resource, mixed
|
||||
or void.
|
||||
|
||||
The file must contain nothing else but function definitions, no comments or
|
||||
empty lines.
|
||||
|
||||
OTHER OPTIONS
|
||||
|
||||
--no-help
|
||||
|
||||
By default, ext_skel creates both comments in the source code and a test
|
||||
function to help first time module writers to get started and testing
|
||||
configuring and compiling their module. This option turns off all such things
|
||||
which may just annoy experienced PHP module coders. Especially useful with
|
||||
|
||||
--stubs=file
|
||||
|
||||
which will leave out also all module specific stuff and write just function
|
||||
stubs with function value declarations and passed argument handling, and
|
||||
function entries and definitions at the end of the file, for copying and
|
||||
pasting into an already existing module.
|
||||
|
||||
--assign-params
|
||||
--string-lens
|
||||
|
||||
By default, function proto 'void foo(string bar)' creates the following:
|
||||
...
|
||||
zval **bar;
|
||||
... (zend_get_parameters_ex() called in the middle...)
|
||||
convert_to_string_ex(bar);
|
||||
|
||||
Specifying both of these options changes the generated code to:
|
||||
...
|
||||
zval **bar_arg;
|
||||
int bar_len;
|
||||
char *bar = NULL;
|
||||
... (zend_get_parameters_ex() called in the middle...)
|
||||
convert_to_string_ex(bar_arg);
|
||||
bar = Z_STRVAL_PP(bar_arg);
|
||||
bar_len = Z_STRLEN_PP(bar_arg);
|
||||
|
||||
You shouldn't have to ask what happens if you leave --string-lens out. If you
|
||||
have to, it's questionable whether you should be reading this document.
|
||||
|
||||
--with-xml[=file]
|
||||
|
||||
Creates the basics for phpdoc .xml file.
|
||||
|
||||
--full-xml
|
||||
|
||||
Not implemented yet. When or if there will ever be created a framework for
|
||||
self-contained extensions to use phpdoc system for their documentation, this
|
||||
option enables it on the created xml file.
|
||||
|
||||
CURRENT LIMITATIONS, BUGS AND OTHER ODDITIES
|
||||
|
||||
Only arguments of types int, bool, double, float, string and array are
|
||||
handled. For other types you must write the code yourself. And for type
|
||||
mixed, it wouldn't even be possible to write anything, because only you
|
||||
know what to expect.
|
||||
|
||||
It can't handle correctly, and probably never will, variable list of
|
||||
of arguments. (void foo(int bar [, ...])
|
||||
|
||||
Don't trust too much the generated code. It tries to be useful in most of
|
||||
the situations you might encounter, but automatic code generating will never
|
||||
beat a programmer who knows the real situation at hand. axt_skel is generally
|
||||
best suited for quickly generating a wrapper for c-library functions you
|
||||
might want to have available in PHP too.
|
||||
|
||||
This program doesn't have a --help option. It has --no-help instead.
|
||||
|
||||
EXAMPLE
|
||||
|
||||
The following _one_ line
|
||||
|
||||
bool my_drawtext(resource image, string text, resource font, int x, int y [, int color])
|
||||
|
||||
will create this function definition for you (note that there are a few
|
||||
question marks to be replaced by you, and you must of course add your own
|
||||
value definitions too):
|
||||
|
||||
/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y[, int color])
|
||||
*/
|
||||
PHP_FUNCTION(my_drawtext)
|
||||
{
|
||||
zval **image, **text, **font, **x, **y, **color;
|
||||
int argc;
|
||||
int image_id = -1;
|
||||
int font_id = -1;
|
||||
???LS_FETCH();
|
||||
|
||||
argc = ZEND_NUM_ARGS();
|
||||
if (argc < 5 || argc > 6 || zend_get_parameters_ex(argc, &image, &text, &font, &x, &y, &color) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(???, ???, image, image_id, "???", ???G());
|
||||
ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???G());
|
||||
|
||||
switch (argc) {
|
||||
case 6:
|
||||
convert_to_long_ex(color);
|
||||
/* Fall-through. */
|
||||
case 5:
|
||||
convert_to_long_ex(y);
|
||||
convert_to_long_ex(x);
|
||||
/* font: fetching resources already handled. */
|
||||
convert_to_string_ex(text);
|
||||
/* image: fetching resources already handled. */
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
php_error(E_WARNING, "my_drawtext: not yet implemented");
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
$Id$
|
||||
=============================================================================
|
||||
|
||||
HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
|
||||
|
||||
A self-contained extension can be distributed independently of
|
||||
the PHP source. To create such an extension, three things are
|
||||
required:
|
||||
|
||||
- Makefile template (Makefile.in)
|
||||
- Configuration file (config.m4)
|
||||
- Source code for your module
|
||||
|
||||
We will describe now how to create these and how to put things
|
||||
together.
|
||||
|
||||
|
||||
CONVERTING AN EXISTING EXTENSION
|
||||
|
||||
Just to show you how easy it is to create a self-contained
|
||||
extension, we will convert an embedded extension into a
|
||||
self-contained one. Install PHP and execute the following
|
||||
commands.
|
||||
|
||||
$ mkdir /tmp/newext
|
||||
$ cd /tmp/newext
|
||||
|
||||
You now have an empty directory. We will copy the files from
|
||||
the mysql extension:
|
||||
|
||||
$ cp -rp php-4.0.X/ext/mysql/* .
|
||||
|
||||
It is time to finish the module. Run:
|
||||
|
||||
$ phpize
|
||||
|
||||
You can now ship the contents of the directory - the extension
|
||||
can live completely on its own.
|
||||
|
||||
The user instructions boil down to
|
||||
|
||||
$ ./configure \
|
||||
[--with-php-config=/path/to/php-config] \
|
||||
[--with-mysql=MYSQL-DIR]
|
||||
$ make install
|
||||
|
||||
The MySQL module will either use the embedded MySQL client
|
||||
library or the MySQL installation in MYSQL-DIR.
|
||||
|
||||
|
||||
DEFINING THE NEW EXTENSION
|
||||
|
||||
Our demo extension is called "foobar".
|
||||
|
||||
It consists of two source files "foo.c" and "bar.c"
|
||||
(and any arbitrary amount of header files, but that is not
|
||||
important here).
|
||||
|
||||
The demo extension does not reference any external
|
||||
libraries (that is important, because the user does not
|
||||
need to specify anything).
|
||||
|
||||
|
||||
CREATING THE MAKEFILE TEMPLATE
|
||||
|
||||
The Makefile Template (Makefile.in) contains three lines:
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
LTLIBRARY_SHARED_NAME = foobar.la
|
||||
LTLIBRARY_SOURCES = foo.c bar.c
|
||||
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
LTLIBRARY_SHARED_NAME specifies the name of the extension.
|
||||
It must be of the form `ext-name.la'.
|
||||
|
||||
LTLIBRARY_SOURCES specifies the names of the sources files. You can
|
||||
name an arbitrary number of source files here.
|
||||
|
||||
The final include directive includes the build rules (you usually
|
||||
don't need to care about what happens there). rules.mk and other
|
||||
files are installed by phpize which we will cover later.
|
||||
|
||||
|
||||
CREATING THE M4 CONFIGURATION FILE
|
||||
|
||||
The m4 configuration can perform additional checks. For a
|
||||
self-contained extension, you do not need more than a few
|
||||
macro calls.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
PHP_ARG_ENABLE(foobar,whether to enable foobar,
|
||||
[ --enable-foobar Enable foobar])
|
||||
|
||||
if test "$PHP_FOOBAR" != "no"; then
|
||||
PHP_EXTENSION(foobar, $ext_shared)
|
||||
fi
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
PHP_ARG_ENABLE will automatically set the correct variables, so
|
||||
that the extension will be enabled by PHP_EXTENSION in shared mode.
|
||||
|
||||
Please use always PHP_ARG_ENABLE or PHP_ARG_WITH. Even if you do not
|
||||
plan to distribute your module with PHP, these facilities allow you
|
||||
to integrate your module easily into the main PHP module framework.
|
||||
|
||||
CREATING SOURCE FILES
|
||||
|
||||
ext_skel can be of great help when creating the common code for all modules
|
||||
in PHP for you and also writing basic function definitions and C code for
|
||||
handling arguments passed to your functions. See README.EXT_SKEL for further
|
||||
information.
|
||||
|
||||
As for the rest, you are currently alone here. There are a lot of existing
|
||||
modules, use a simple module as a starting point and add your own code.
|
||||
|
||||
|
||||
CREATING THE SELF-CONTAINED EXTENSION
|
||||
|
||||
Put Makefile.in, config.m4 and the source files into one directory.
|
||||
Then run phpize (this is installed during make install by PHP 4.0).
|
||||
For example, if you configured PHP with --prefix=/php, you would run
|
||||
|
||||
$ /php/bin/phpize
|
||||
|
||||
This will automatically copy the necessary build files and create
|
||||
configure from your config.m4.
|
||||
|
||||
And that's it. You now have a self-contained extension.
|
||||
|
||||
INSTALLING A SELF-CONTAINED EXTENSION
|
||||
|
||||
An extension can be installed by running:
|
||||
|
||||
$ ./configure \
|
||||
[--with-php-config=/path/to/php-config]
|
||||
$ make install
|
||||
|
||||
ADDING SHARED MODULE SUPPORT TO A MODULE
|
||||
|
||||
In order to be useful, a self-contained extension must be loadable
|
||||
as a shared module. I will explain now how you can add shared module
|
||||
support to an existing module called foo.
|
||||
|
||||
1. In config.m4, use PHP_ARG_WITH/PHP_ARG_ENABLE. Then you will
|
||||
automatically be able to use --with-foo=shared or
|
||||
--enable-foo=shared.
|
||||
|
||||
2. In config.m4, use PHP_EXTENSION(foo, $ext_shared) to enable
|
||||
building the extension.
|
||||
|
||||
3. Add the following line to Makefile.in:
|
||||
|
||||
LTLIBRARY_SHARED_NAME = foo.la
|
||||
|
||||
4. Add the following lines to your C source file:
|
||||
|
||||
#ifdef COMPILE_DL_FOO
|
||||
ZEND_GET_MODULE(foo)
|
||||
#endif
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
Using PHP4 with the Zeus Web Server
|
||||
-----------------------------------
|
||||
|
||||
Zeus fully supports running PHP in combination with our webserver. A
|
||||
significant improvement in PHP 4 is that you can now run PHP as an
|
||||
ISAPI module, giving great performance benefits over traditional CGI
|
||||
code.
|
||||
|
||||
Note that you will need to be running at least version 3.3.6 of the
|
||||
webserver. If you are running an earlier version, please see our
|
||||
website (http://www.zeus.com) for upgrade instructions.
|
||||
|
||||
|
||||
To build the ISAPI version of PHP, start the configuration with:
|
||||
|
||||
./configure --with-zeus=/usr/local/zeus
|
||||
|
||||
Obviously, replace /usr/local/zeus with the location of where you have
|
||||
installed Zeus on your machine. For PHP to build successfully, you
|
||||
need to have 3.3.6 already installed, because the code relies on the
|
||||
presence of header files provided with the latest version.
|
||||
|
||||
You may have to adjust the environment variable LDFLAGS and EXTRA_LIBS
|
||||
in order to link in extra libraries. This depends on the platform on
|
||||
which you are building and also on the compiler used (see below). A
|
||||
standard GNU/Linux install with GCC should build fine with no changes.
|
||||
|
||||
|
||||
Configuring the webserver
|
||||
-------------------------
|
||||
|
||||
After running 'make' and 'make install', you will have a 'libphp4.so'
|
||||
file. Copy this file into a directory reserved for ISAPI
|
||||
binaries. Now, perform the following steps for each virtual server
|
||||
that you wish to run PHP on:
|
||||
|
||||
1) On the Admin server, go to 'edit server->path mapping'
|
||||
2) Add an alias to the directory with libphp4.so in it, mapped to
|
||||
/isapi/ (or a location of your choice). Make sure you set the alias
|
||||
type to ISAPI.
|
||||
3) Click 'update'
|
||||
4) Add a handler for file extension 'php' to be run by /isapi/libphp4.so
|
||||
5) Click 'update', then go back to the previous page.
|
||||
6) Click on the 'module configuration' button, ensure that ISAPI
|
||||
support is ticked.
|
||||
7) Click on the ISAPI link. At the bottom of the page, click the
|
||||
checkbox for running ISAPI extensions 'out of process'.
|
||||
8) Click 'update'. Then restart the virtual server. Done!
|
||||
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
*) Why does the compile fail at Zend/zend-scanner-cc.cc
|
||||
or Zend/zend-parser.c ?
|
||||
|
||||
These source files are auto-generated from the corresponding .y files.
|
||||
The default distribution of PHP contains pre-generated versions of these
|
||||
files that have caused problems for some people. The simplest solution is
|
||||
to delete the files. They will then be rebuilt correctly. You must have the
|
||||
following GNU tools to do this:
|
||||
|
||||
bison 1.28 or later
|
||||
flex 2.5.4 or later
|
||||
|
||||
*) Why does my PHP library fail to load?
|
||||
|
||||
After configuring Zeus, if you get a '502 Bad Gateway' error when
|
||||
accessing a PHP page, there are problems loading the PHP
|
||||
library. Check the error log ($ZEUSHOME/web/log/errors) for errors.
|
||||
|
||||
Failing to load the PHP ISAPI module is likely to be due to unresolved
|
||||
symbols in the module. A way to check for this is to visit our support
|
||||
page at http://support.zeus.com/faq/entries/isapi_error.html and run
|
||||
the program there on your libphp4.so. It will list any unresolved
|
||||
symbols.
|
||||
|
||||
*) My libphp4.so has unresolved symbols. How do I fix this?
|
||||
|
||||
You must ensure that the PHP build process links in the appropriate
|
||||
libraries that contain these symbols! The libraries required will
|
||||
depend on the platform you are running PHP on.
|
||||
|
||||
You may need to set one or two environment variables before running
|
||||
the 'configure' program to set up PHP; LDFLAGS and EXTRA_LIBS. Make
|
||||
sure that you also export these variables to the build process.
|
||||
(Type 'export LDFLAGS EXTRA_LIBS' in the shell to do this.)
|
||||
|
||||
Specific examples:
|
||||
|
||||
Solaris + gcc:
|
||||
Ensure you run ./configure with the `--enable-libgcc' parameter. You
|
||||
may need to set LDFLAGS to '-L/usr/local/egcs/lib' (path depends on
|
||||
your gcc installation)
|
||||
|
||||
|
||||
|
||||
For more information and help with Zeus, please visit our website:
|
||||
http://www.zeus.com
|
||||
@@ -1,36 +1,118 @@
|
||||
Things to do or at least think about doing in the future. Name in
|
||||
parenthesis means that person has taken on this project.
|
||||
|
||||
Zend
|
||||
----
|
||||
* allow foreach ($array as $k => &$val) syntax. right now we cannot
|
||||
traverse an array without copying each element.
|
||||
* look at replacing c-lib call tolower().
|
||||
|
||||
global
|
||||
------
|
||||
* make everything on the language-level independent of your locale setings.
|
||||
* always build the standalone executable as well as the chosen SAPI
|
||||
target.
|
||||
* make sure all source files have the "right" copyright.
|
||||
* the following modules still use PHP3_TLS_*() macros (and thereby don't
|
||||
work in ZTS mode): ext/dav/dav.c, ext/db/db.c, ext/gd/gd.c, ext/ldap/ldap.c
|
||||
* make sure that all ZTS globals get destructed. Most ts_allocate_id()
|
||||
calls should have a dtor entry.
|
||||
* activate all extensions by default that don't rely on external
|
||||
dependices. (eg ftp)
|
||||
* --enable-all in configure. (--enable-shared=max ...)
|
||||
* make configure print out a summary when it's done (like XEmacs)
|
||||
* replace standard functions which work on static data with
|
||||
reentrant-save functions
|
||||
* there is only one current directory per process; to make
|
||||
chdir() etc. thread-safe, we must introduce a per-thread
|
||||
current directory
|
||||
* on some platforms unimplemented function will just do nothing (eg symlink)
|
||||
they should print a warning or be not even defined!
|
||||
reentrancy-safe functions.
|
||||
* on some platforms unimplemented function will just do nothing (e.g. symlink)
|
||||
they should print a warning or not even be defined!
|
||||
* implement javadoc based function docs template system.
|
||||
* use thread-safe resolver functions (either require BIND 8 or adns).
|
||||
* provide optional IPv6 support.
|
||||
* make SAPI conform to CGI/1.1. Currently, all SAPI modules
|
||||
define REMOTE_ADDR etc. themselves and reach only various level
|
||||
of compliance.
|
||||
* find a better way to implement script timeouts. SIGVTALRM is used
|
||||
by some POSIX threads implementations (i.e. OpenBSD) and is not
|
||||
available in ZTS mode.
|
||||
* add aliases to functions to conform to new naming conventions, e.g.
|
||||
str_to_upper().
|
||||
|
||||
documentation
|
||||
-------------
|
||||
* add remarks in the documentation which functions are not implemented on win32.
|
||||
* add remarks in the documentation which functions are not binary-safe.
|
||||
|
||||
ext/dav
|
||||
--------
|
||||
* rewrite.
|
||||
|
||||
ext/mcrypt
|
||||
----------
|
||||
* port to mcrypt-2.6 or later
|
||||
|
||||
ext/oci8
|
||||
--------
|
||||
* map boolean value false to oracle NULL.
|
||||
* all OCIFetch*() functions should return 0 for no more data and false on error.
|
||||
* all OCIFetch*() functions should return 0 for no more data and false on error.
|
||||
* have a flag that trims trailing spaces from CHAR fields on retrieval.
|
||||
* make allow_call_time_pass_reference=Off working.
|
||||
|
||||
ext/pcre
|
||||
--------
|
||||
* have a non-greedy option for preg_replace().
|
||||
* have an option for preg_grep() to return keys as well.
|
||||
* update the online docs from version 3.1 man page
|
||||
|
||||
ext/session
|
||||
-----------
|
||||
* implement a call to set a session read-only to overcome
|
||||
the need to serialize frame-loads.
|
||||
* maybe implement finer-grained session variables that could be
|
||||
locked individually.
|
||||
|
||||
ext/standard
|
||||
------------
|
||||
* strpad() (Andrei)
|
||||
* advanced sort (Andrei)
|
||||
* NOT binary safe:
|
||||
strcspn()
|
||||
strtok()
|
||||
basename()
|
||||
dirname()
|
||||
strrpos()
|
||||
strrchr()
|
||||
quotemeta()
|
||||
strip_tags()
|
||||
* add a version number to data serialized via serialize().
|
||||
* array_add(). (Andrei)
|
||||
* implement pathinfo()
|
||||
$a = pathinfo("/some/file.bla");
|
||||
|
||||
=> array("dirname" => "/some/",
|
||||
"basename" => "file.bla",
|
||||
"extension" => "bla");
|
||||
|
||||
|
||||
We could also make it return just one part as a sting if used
|
||||
like this:
|
||||
|
||||
$a = pathinfo("/some/file.bla", PATHINFO_BASENAME);
|
||||
|
||||
* possibly modify parsing of GPC data to automatically create arrays if
|
||||
variable name is seen more than once.
|
||||
* implement regex-cache for url-functions.
|
||||
* strcase_replace(). (Andrei)
|
||||
* move socket related functions to fsock.c.
|
||||
* get_defined_funcs(), get_defined_vars().
|
||||
* NOT binary safe:
|
||||
strtok()
|
||||
basename()
|
||||
dirname()
|
||||
strrpos()
|
||||
strrchr()
|
||||
strip_tags()
|
||||
|
||||
ext/wddx
|
||||
--------
|
||||
* implement __sleep() and __wakeup() the way serialize()/unserialize() do.
|
||||
* See if we can support the remaining datatypes:
|
||||
dateTime
|
||||
binary
|
||||
recordset
|
||||
|
||||
http://www.wddx.org/WDDX_SDK_10a/7__References/WDDX_DTD.htm
|
||||
(Andrei)
|
||||
|
||||
* implement wddx_packet_as_javascript(). (Andrei)
|
||||
|
||||
other cool stuff
|
||||
----------------
|
||||
* PVM extension
|
||||
@@ -1,75 +0,0 @@
|
||||
|
||||
|
||||
This is the ChangeLog from PHP3 as of Apr 12 1999.
|
||||
|
||||
Entries should be removed from this file, if you transfer changes
|
||||
over to PHP4.
|
||||
|
||||
============================================================================
|
||||
|
||||
?? 1999, Version 3.0.8
|
||||
- added Oracle-OCI8 persistent connections
|
||||
- fixed OCIDefineByName crash.
|
||||
- fixed some NULL-column related problems in OCI8-module.
|
||||
- Some Informix driver improvements.
|
||||
- PUT method support (mlemos@acm.org)
|
||||
- Fix parameter count problem in odbc_setoption()
|
||||
- Really fix implode() this time. The fix in 3.0.7 was bogus
|
||||
- Make fgetss() slightly smarter
|
||||
- Add strip_tags() which uses the fgetss state-machine but acts on a string
|
||||
|
||||
March 1 1999, Version 3.0.7
|
||||
- Added pdf_put_image and pdf_execute_image
|
||||
- Initial work on an ImageMagick module - doesn't do anything yet
|
||||
- Make configure script detect Netscape's LDAP SDK automagically
|
||||
- Fixed Oracle-OCI8 module for windows.
|
||||
- Add OCIRowCount function. (Number of affected rows for update-statements)
|
||||
- Add OCIDefineByName function.
|
||||
- Change the behaviour of open_basedir. It's now possible to supply more
|
||||
than one directory. open_basedir paths from parent directories are now
|
||||
automatically inherited.
|
||||
- fix rand() and mt_rand() to make the ranges work correctly
|
||||
- htmlspecialchars() and htmlentities() are now binary safe.
|
||||
- Add extract() function.
|
||||
- Oracle-OCI8 driver now supports BLOBS/CLOBS and IN/OUT binding of local php
|
||||
variables.
|
||||
- Clean up apxs build
|
||||
- Add INSTALL.REDHAT file to walk RedHat users through the install
|
||||
- Add function_exists() function.
|
||||
- Add another version of WDDX module
|
||||
(we need to pick a single implementation here)
|
||||
- Fixed includes for iODBC to support both the old and the new LGPL version
|
||||
- Fix implode() bug - When imploding an array that contained unset() elements
|
||||
it wasn't correctly skipping past these
|
||||
- Add connection_status() function. This returns the raw bitfield which
|
||||
indicates whether the script terminated due to a user abort, a timeout
|
||||
or normally. Note that if ignore_user_abort is enabled, then both the
|
||||
timeout state and the user abort state can be active
|
||||
- Add connection_timeout() function. This one can be called in a shutdown
|
||||
function to tell you if you got there because of a timeout
|
||||
- Add ignore_user_abort() function and .ini/.conf directive of same name
|
||||
- Fix connection abort detection code - It should now work reliably with
|
||||
Apache. Also added a user-level connection_aborted() function designed to
|
||||
let people check whether the user aborted the connection in a user-level
|
||||
shutdown function.
|
||||
- Add pfsockopen() function
|
||||
- Improvements in FreeType support: Macintosh fonts work, and non-antialiased
|
||||
output is considerably cleaner <mka@satama.com>
|
||||
- Fixed checkdate() function, range of valid years is now 0 to 32767
|
||||
- hw_insertdocument() returns object id now
|
||||
- Add pdf_open() warning in configure and documentation
|
||||
- Add diskfreespace() function
|
||||
- Added aspell support
|
||||
- Iptcparse would sometimes find a wrong tag.
|
||||
- Force var_dump() to output headers
|
||||
- Add optional 3th parameter to ora_fetchinto.
|
||||
- Serialize and var_dump no longer show array elements that
|
||||
have been unset.
|
||||
- Add IptcEmbed() function (can replace an APP13-Marker in a JPEG file)
|
||||
- Add OCI8 module for Windows
|
||||
- Fix bug in pdf_close() function
|
||||
- Add WDDX support (see http://www.wddx.org for more info)
|
||||
- Add similar_text() function
|
||||
- Introduce simple regex compilation cache
|
||||
|
||||
|
||||
+14
-7
@@ -13,7 +13,6 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#include "TSRM.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -207,13 +206,18 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
|
||||
|
||||
|
||||
/* fetches the requested resource for the current thread */
|
||||
void *ts_resource(ts_rsrc_id id)
|
||||
TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
|
||||
{
|
||||
THREAD_T thread_id = tsrm_thread_id();
|
||||
THREAD_T thread_id;
|
||||
int hash_value;
|
||||
tsrm_tls_entry *thread_resources;
|
||||
void *resource;
|
||||
|
||||
if (th_id) {
|
||||
thread_id = *th_id;
|
||||
} else {
|
||||
thread_id = tsrm_thread_id();
|
||||
}
|
||||
tsrm_debug("Fetching resource id %d for thread %ld\n", id, (long) thread_id);
|
||||
tsrm_mutex_lock(tsmm_mutex);
|
||||
|
||||
@@ -326,7 +330,8 @@ TSRM_API MUTEX_T tsrm_mutex_alloc( void )
|
||||
MUTEX_T mutexp;
|
||||
|
||||
#ifdef WIN32
|
||||
mutexp = CreateMutex(NULL,FALSE,NULL);
|
||||
mutexp = malloc(sizeof(CRITICAL_SECTION));
|
||||
InitializeCriticalSection(mutexp);
|
||||
#elif defined(GNUPTH)
|
||||
mutexp = (MUTEX_T) malloc(sizeof(*mutexp));
|
||||
pth_mutex_init(mutexp);
|
||||
@@ -350,7 +355,7 @@ TSRM_API void tsrm_mutex_free( MUTEX_T mutexp )
|
||||
{
|
||||
if (mutexp) {
|
||||
#ifdef WIN32
|
||||
CloseHandle(mutexp);
|
||||
DeleteCriticalSection(mutexp);
|
||||
#elif defined(GNUPTH)
|
||||
free(mutexp);
|
||||
#elif defined(PTHREADS)
|
||||
@@ -375,7 +380,8 @@ TSRM_API int tsrm_mutex_lock( MUTEX_T mutexp )
|
||||
tsrm_debug("Mutex locked thread: %ld\n",tsrm_thread_id());
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
return WaitForSingleObject(mutexp,1000);
|
||||
EnterCriticalSection(mutexp);
|
||||
return 1;
|
||||
#elif defined(GNUPTH)
|
||||
return pth_mutex_acquire(mutexp, 0, NULL);
|
||||
#elif defined(PTHREADS)
|
||||
@@ -395,7 +401,8 @@ TSRM_API int tsrm_mutex_unlock( MUTEX_T mutexp )
|
||||
tsrm_debug("Mutex unlocked thread: %ld\n",tsrm_thread_id());
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
return ReleaseMutex(mutexp);
|
||||
LeaveCriticalSection(mutexp);
|
||||
return 1;
|
||||
#elif defined(GNUPTH)
|
||||
return pth_mutex_release(mutexp);
|
||||
#elif defined(PTHREADS)
|
||||
|
||||
+27
-2
@@ -19,6 +19,7 @@ CFG=TSRM - Win32 Debug_TS
|
||||
!MESSAGE
|
||||
!MESSAGE "TSRM - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TSRM - Win32 Release_TS" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "TSRM - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
@@ -41,7 +42,7 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "C:\Projects\TSRM" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "TSRM_EXPORTS" /D "_LIB" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x40d /d "_DEBUG"
|
||||
# ADD RSC /l 0x40d /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -64,7 +65,30 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "Release_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS_inline"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "TSRM___Win32_Release_TS_inline"
|
||||
# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS_inline"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release_TS_inline"
|
||||
# PROP Intermediate_Dir "Release_TS_inline"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -80,6 +104,7 @@ LIB32=link.exe -lib
|
||||
|
||||
# Name "TSRM - Win32 Debug_TS"
|
||||
# Name "TSRM - Win32 Release_TS"
|
||||
# Name "TSRM - Win32 Release_TS_inline"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
|
||||
+4
-3
@@ -49,9 +49,9 @@ typedef int ts_rsrc_id;
|
||||
/* Define THREAD_T and MUTEX_T */
|
||||
#if defined(WIN32)
|
||||
# define THREAD_T DWORD
|
||||
# define MUTEX_T void *
|
||||
# define MUTEX_T CRITICAL_SECTION *
|
||||
#elif defined(GNUPTH)
|
||||
# define THREAD_T pth_attr_t
|
||||
# define THREAD_T pth_t
|
||||
# define MUTEX_T pth_mutex_t *
|
||||
#elif defined(PTHREADS)
|
||||
# define THREAD_T pthread_t
|
||||
@@ -81,7 +81,8 @@ TSRM_API void tsrm_shutdown(void);
|
||||
TSRM_API ts_rsrc_id ts_allocate_id(size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor);
|
||||
|
||||
/* fetches the requested resource for the current thread */
|
||||
TSRM_API void *ts_resource(ts_rsrc_id id);
|
||||
TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id);
|
||||
#define ts_resource(id) ts_resource_ex(id, NULL)
|
||||
|
||||
/* frees all resources allocated for the current thread */
|
||||
TSRM_API void ts_free_thread(void);
|
||||
|
||||
+5
-17
@@ -7,27 +7,15 @@ 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
|
||||
|
||||
sinclude(tsrm.m4)
|
||||
|
||||
TSRM_BASIC_CHECKS
|
||||
|
||||
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)
|
||||
TSRM_PTHREAD
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
dnl Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
dnl
|
||||
dnl Redistribution and use in source and binary forms, with or without
|
||||
dnl modification, are permitted provided that the following conditions
|
||||
dnl are met:
|
||||
dnl
|
||||
dnl 1. Redistributions of source code must retain the above copyright
|
||||
dnl notice, this list of conditions and the following disclaimer.
|
||||
dnl
|
||||
dnl 2. Redistributions in binary form must reproduce the above copyright
|
||||
dnl notice, this list of conditions and the following disclaimer in
|
||||
dnl the documentation and/or other materials provided with the
|
||||
dnl distribution.
|
||||
dnl
|
||||
dnl THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY
|
||||
dnl EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SASCHA SCHUMANN OR
|
||||
dnl HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
dnl NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
dnl LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
dnl OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
dnl
|
||||
dnl PTHREADS_FLAGS
|
||||
dnl
|
||||
dnl Set some magic defines to achieve POSIX threads conformance
|
||||
dnl
|
||||
AC_DEFUN(PTHREADS_FLAGS,[
|
||||
if test -z "$host_alias"; then
|
||||
AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess)
|
||||
fi
|
||||
case "$host_alias" in
|
||||
*solaris*)
|
||||
PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";;
|
||||
*freebsd*)
|
||||
PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";;
|
||||
*linux*)
|
||||
PTHREAD_FLAGS="-D_REENTRANT";;
|
||||
*aix*)
|
||||
PTHREAD_FLAGS="-D_THREAD_SAFE";;
|
||||
*irix*)
|
||||
PTHREAD_FLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS";;
|
||||
*hpux*)
|
||||
PTHREAD_FLAGS="-D_REENTRANT";;
|
||||
*sco*)
|
||||
PTHREAD_FLAGS="-D_REENTRANT";;
|
||||
dnl Solves sigwait() problem, creates problems with u_long etc.
|
||||
dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";;
|
||||
esac
|
||||
|
||||
if test -n "$PTHREAD_FLAGS"; then
|
||||
CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS"
|
||||
fi
|
||||
])dnl
|
||||
dnl
|
||||
dnl PTHREADS_CHECK_COMPILE
|
||||
dnl
|
||||
dnl Check whether the current setup can use POSIX threads calls
|
||||
dnl
|
||||
AC_DEFUN(PTHREADS_CHECK_COMPILE, [
|
||||
AC_TRY_RUN( [
|
||||
#include <pthread.h>
|
||||
#include <stddef.h>
|
||||
|
||||
void *thread_routine(void *data) {
|
||||
return data;
|
||||
}
|
||||
|
||||
int main() {
|
||||
pthread_t thd;
|
||||
pthread_mutexattr_t mattr;
|
||||
int data = 1;
|
||||
pthread_mutexattr_init(&mattr);
|
||||
return pthread_create(&thd, NULL, thread_routine, &data);
|
||||
} ], [
|
||||
pthreads_working="yes"
|
||||
], [
|
||||
pthreads_working="no"
|
||||
], pthreads_working="no" ) ] )dnl
|
||||
dnl
|
||||
dnl PTHREADS_CHECK()
|
||||
dnl
|
||||
dnl Try to find a way to enable POSIX threads
|
||||
dnl
|
||||
dnl Magic flags
|
||||
dnl -kthread gcc (FreeBSD)
|
||||
dnl -Kthread UDK cc (UnixWare)
|
||||
dnl -mt WorkShop cc (Solaris)
|
||||
dnl -mthreads gcc (AIX)
|
||||
dnl -pthread gcc (Linux, FreeBSD, NetBSD, OpenBSD)
|
||||
dnl -pthreads gcc (Solaris)
|
||||
dnl -qthreaded AIX cc V5
|
||||
dnl -threads gcc (HP-UX)
|
||||
dnl
|
||||
AC_DEFUN(PTHREADS_CHECK,[
|
||||
|
||||
save_CFLAGS="$CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
PTHREADS_ASSIGN_VARS
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
|
||||
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
|
||||
ac_cv_pthreads_cflags=""
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
|
||||
ac_save="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $flag"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
CFLAGS="$ac_save"
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_cflags="$flag"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
|
||||
ac_cv_pthreads_lib=""
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
for lib in pthread pthreads c_r; do
|
||||
ac_save="$LIBS"
|
||||
LIBS="$LIBS -l$lib"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
LIBS="$ac_save"
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_lib="$lib"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
threads_result="POSIX Threads found"
|
||||
else
|
||||
threads_result="POSIX Threads not found"
|
||||
fi
|
||||
])dnl
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN(PTHREADS_ASSIGN_VARS,[
|
||||
if test -n "$ac_cv_pthreads_lib"; then
|
||||
LIBS="$LIBS -l$ac_cv_pthreads_lib"
|
||||
fi
|
||||
|
||||
if test -n "$ac_cv_pthreads_cflags"; then
|
||||
CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
|
||||
fi
|
||||
])dnl
|
||||
@@ -0,0 +1,98 @@
|
||||
|
||||
dnl TSRM_CHECK_GCC_ARG(ARG, ACTION-IF-FOUND, ACTION-IF-NOT_FOUND)
|
||||
AC_DEFUN(TSRM_CHECK_GCC_ARG,[
|
||||
gcc_arg_name=[ac_cv_gcc_arg]translit($1,A-Z-,a-z_)
|
||||
AC_CACHE_CHECK([whether $CC supports $1], [ac_cv_gcc_arg]translit($1,A-Z-,a-z_), [
|
||||
echo 'void somefunc() { };' > conftest.c
|
||||
cmd='$CC $1 -c conftest.c'
|
||||
if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then
|
||||
ac_result=no
|
||||
else
|
||||
ac_result=yes
|
||||
fi
|
||||
eval $gcc_arg_name=$ac_result
|
||||
rm -f conftest.*
|
||||
])
|
||||
if eval test "\$$gcc_arg_name" = "yes"; then
|
||||
$2
|
||||
else
|
||||
:
|
||||
$3
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(TSRM_BASIC_CHECKS,[
|
||||
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
dnl AC_REQUIRE([AM_PROG_CC_STDC])dnl
|
||||
AC_REQUIRE([AC_PROG_CC_C_O])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
|
||||
AC_CHECK_HEADERS(stdarg.h)
|
||||
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN(TSRM_CHECK_PTH,[
|
||||
|
||||
AC_MSG_CHECKING(for GNU Pth)
|
||||
PTH_PREFIX="`$1 --prefix`"
|
||||
if test -z "$PTH_PREFIX"; then
|
||||
AC_MSG_RESULT(Please check your Pth installation)
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS `$1 --cflags`"
|
||||
LDFLAGS="$LDFLAGS `$1 --ldflags`"
|
||||
LIBS="$LIBS `$1 --libs`"
|
||||
|
||||
AC_DEFINE(GNUPTH, 1, [Whether you use GNU Pth])
|
||||
AC_MSG_RESULT(yes - installed in $PTH_PREFIX)
|
||||
|
||||
])
|
||||
|
||||
sinclude(threads.m4)
|
||||
sinclude(TSRM/threads.m4)
|
||||
|
||||
AC_DEFUN(TSRM_CHECK_PTHREADS,[
|
||||
|
||||
PTHREADS_CHECK
|
||||
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
AC_MSG_ERROR(Your system seems to lack POSIX threads.)
|
||||
fi
|
||||
|
||||
AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
|
||||
|
||||
AC_MSG_CHECKING(for POSIX threads)
|
||||
AC_MSG_RESULT(yes)
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN(TSRM_OTHER_CHECKS,[
|
||||
|
||||
dnl For the thread implementations, we always use --with-*
|
||||
dnl to maintain consistency
|
||||
|
||||
AC_ARG_WITH(tsrm-pth,
|
||||
[ --with-tsrm-pth[=pth-config] Use GNU Pth.],[
|
||||
TSRM_PTH=$withval
|
||||
],[
|
||||
TSRM_PTH=no
|
||||
])
|
||||
|
||||
AC_ARG_WITH(tsrm-pthreads,
|
||||
[ --with-tsrm-pthreads Use POSIX threads (default)],[
|
||||
TSRM_PTHREADS=$withval
|
||||
],[
|
||||
TSRM_PTHREADS=yes
|
||||
])
|
||||
|
||||
test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config
|
||||
|
||||
if test "$TSRM_PTH" != "no"; then
|
||||
TSRM_CHECK_PTH($TSRM_PTH)
|
||||
elif test "$TSRM_PTHREADS" != "no"; then
|
||||
TSRM_CHECK_PTHREADS
|
||||
fi
|
||||
|
||||
])
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
---------------------------------------------------------------------------
|
||||
The Zend License, version 0.91
|
||||
Copyright (C) 1999 Andi Gutmans & Zeev Suraski
|
||||
The Zend License, version 0.92
|
||||
Copyright (C) 1999-2000 Zend Technologies Ltd.
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
The Zend scripting engine library is a product of Andi Gutmans and
|
||||
Zeev Suraski. It may be used and/or distributed under the terms of the
|
||||
Q Public License (QPL) version 1.0, enclosed below.
|
||||
The Zend scripting engine library is a product of Zend Technologies Ltd.
|
||||
It may be used and/or distributed under the terms of the Q Public
|
||||
License (QPL) version 1.0, enclosed below.
|
||||
|
||||
For more information about Zend please visit http://www.zend.com/
|
||||
For license related questions please mail license@zend.com
|
||||
@@ -113,4 +113,4 @@ OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
===========================================================================
|
||||
===========================================================================
|
||||
+21
-17
@@ -2,38 +2,42 @@
|
||||
|
||||
#CLEANFILES = zend-parser.c zend-parser.h zend-scanner.c zend-parser.output
|
||||
|
||||
ZEND_SCANNER = @ZEND_SCANNER@
|
||||
|
||||
AUTOMAKE_OPTIONS=foreign
|
||||
EXTRA_LTLIBRARIES=libzend_cc.la libzend_c.la
|
||||
noinst_LTLIBRARIES=$(ZEND_SCANNER) libzend.la
|
||||
EXTRA_LTLIBRARIES=libZend_cc.la libZend_c.la libZend_gcc.la
|
||||
noinst_LTLIBRARIES=$(ZEND_SCANNER) $(ZEND_GCC) libZend.la
|
||||
|
||||
libzend_cc_la_SOURCES=zend-scanner-cc.cc
|
||||
libzend_c_la_SOURCES=zend-scanner.c
|
||||
libZend_cc_la_SOURCES=zend-scanner-cc.cc
|
||||
libZend_c_la_SOURCES=zend-scanner.c
|
||||
|
||||
libzend_la_SOURCES=\
|
||||
libZend_gcc_la_SOURCES=zend_gcc_inline.c
|
||||
|
||||
libZend_la_SOURCES=\
|
||||
zend-parser.y \
|
||||
zend_alloc.c zend_compile.c zend_constants.c \
|
||||
zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.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_builtin_functions.c
|
||||
|
||||
libzend_la_LIBADD = $(ZEND_SCANNER)
|
||||
libzend_la_LDFLAGS = @EXTRA_LIBS@
|
||||
libzend_la_DEPENDENCIES = $(ZEND_SCANNER)
|
||||
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c
|
||||
|
||||
libZend_la_LIBADD = $(ZEND_SCANNER) $(ZEND_GCC)
|
||||
libZend_la_LDFLAGS = @EXTRA_LIBS@
|
||||
libZend_la_DEPENDENCIES = $(ZEND_SCANNER)
|
||||
|
||||
# automake isn't too clever about "non-standard" use of lex and yacc
|
||||
|
||||
zend-scanner.l: zend-parser.h
|
||||
$(libZend_la_OBJECTS) zend-scanner.lo zend-scanner-cc.lo: zend-parser.h
|
||||
|
||||
zend-scanner.c: zend-scanner.l
|
||||
zend-scanner.c: $(srcdir)/zend-scanner.l
|
||||
$(LEX) -Pzend -o$@ -i $(srcdir)/zend-scanner.l
|
||||
|
||||
zend-scanner-cc.cc: zend-scanner.l
|
||||
zend-scanner-cc.cc: $(srcdir)/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
|
||||
zend-parser.c: $(srcdir)/zend-parser.y
|
||||
$(YACC) -p zend -v -d $(srcdir)/zend-parser.y -o zend-parser.c
|
||||
|
||||
depend:
|
||||
|
||||
zend_execute.lo: $(srcdir)/zend_execute.c
|
||||
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c
|
||||
+1
-1
@@ -84,7 +84,7 @@ shamelessly lying about it. Here's why:
|
||||
|
||||
* static variable initializers only accept scalar values
|
||||
(in PHP 3.0 they accepted any valid expression). The impact
|
||||
should be somewhere in between void and non existant, since
|
||||
should be somewhere in between void and non existent, since
|
||||
initializing a static variable with anything but a simple
|
||||
static value makes no sense at all.
|
||||
|
||||
|
||||
+436
-373
@@ -1,373 +1,436 @@
|
||||
# Microsoft Developer Studio Project File - Name="libzend" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=libzend - Win32 Debug
|
||||
!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 "libzend.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 "libzend.mak" CFG="libzend - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "libzend - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "libzend - Win32 Debug" (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)" == "libzend - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# 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 "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# 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
|
||||
|
||||
!ELSEIF "$(CFG)" == "libzend - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /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 "_LIB" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=1 /FR /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
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "libzend - Win32 Release"
|
||||
# Name "libzend - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_alloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_constants.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute_API.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_extensions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_highlight.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_indent.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_llist.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_opcode.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_operators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ptr_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_sprintf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_variables.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FlexLexer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\modules.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_errors.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_extensions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_globals.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_highlight.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_indent.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_llist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_operators.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ptr_stack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_stack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_variables.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Parsers"
|
||||
|
||||
# PROP Default_Filter "y"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.y"
|
||||
|
||||
!IF "$(CFG)" == "libzend - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "libzend - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Scanners"
|
||||
|
||||
# PROP Default_Filter "l"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.l"
|
||||
|
||||
!IF "$(CFG)" == "libzend - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend-scanner.c zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "libzend - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend-scanner.c zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Text Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_BUGS
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_CHANGES
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_TODO
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resources"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
# Microsoft Developer Studio Project File - Name="Zend" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=Zend - Win32 Release_inline
|
||||
!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 "Zend.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 "Zend.mak" CFG="Zend - Win32 Release_inline"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Zend - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Zend - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Zend - Win32 Release_inline" (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)" == "Zend - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# 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 "_LIB" /D "Zend_EXPORTS" /D ZEND_DEBUG=0 /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# 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
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /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 "_LIB" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /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)" == "Zend - Win32 Release_inline"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "Zend___Win32_Release_inline"
|
||||
# PROP BASE Intermediate_Dir "Zend___Win32_Release_inline"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Output_Dir "Release_inline"
|
||||
# PROP Intermediate_Dir "Release_inline"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug" /D "_LIB" /D "Zend_EXPORTS" /D ZEND_DEBUG=0 /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /FR /FD /c
|
||||
# SUBTRACT BASE CPP /YX
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug" /D "_LIB" /D "Zend_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# 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 "Zend - Win32 Release"
|
||||
# Name "Zend - Win32 Debug"
|
||||
# Name "Zend - Win32 Release_inline"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_alloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_constants.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute_API.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_extensions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_gcc_inline.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_highlight.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_indent.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_llist.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_opcode.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_operators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ptr_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_sprintf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_variables.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FlexLexer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\modules.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_errors.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_extensions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_fast_cache.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_globals.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_highlight.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_indent.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_llist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_operators.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ptr_stack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_stack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_variables.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Parsers"
|
||||
|
||||
# PROP Default_Filter "y"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.y"
|
||||
|
||||
!IF "$(CFG)" == "Zend - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Scanners"
|
||||
|
||||
# PROP Default_Filter "l"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.l"
|
||||
|
||||
!IF "$(CFG)" == "Zend - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend-scanner.c zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend-scanner.c zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -i -Pzend -ozend-scanner.c zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Text Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_BUGS
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_CHANGES
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_TODO
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resources"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
+236
@@ -0,0 +1,236 @@
|
||||
|
||||
AC_DEFUN(LIBZEND_BISON_CHECK,[
|
||||
|
||||
if test "$YACC" != "bison -y"; then
|
||||
AC_MSG_WARN(You will need bison if you want to regenerate the Zend parser.)
|
||||
else
|
||||
AC_MSG_CHECKING(bison version)
|
||||
set `bison --version| sed -e 's/^GNU Bison version //' -e 's/\./ /'`
|
||||
if test "${1}" = "1" -a "${2}" -lt "25"; then
|
||||
AC_MSG_WARN(You will need bison 1.25 if you want to regenerate the Zend parser (found ${1}.${2}).)
|
||||
fi
|
||||
AC_MSG_RESULT(${1}.${2} (ok))
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN(LIBZEND_BASIC_CHECKS,[
|
||||
|
||||
AC_REQUIRE([AC_PROG_YACC])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_PROG_CC_C_O])
|
||||
AC_REQUIRE([AM_PROG_LEX])
|
||||
AC_REQUIRE([AC_HEADER_STDC])
|
||||
|
||||
LIBZEND_BISON_CHECK
|
||||
|
||||
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
|
||||
CFLAGS=`echo $CFLAGS | sed -e 's/-g//'`
|
||||
fi
|
||||
|
||||
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
|
||||
CPPFLAGS="$CPPFLAGS -traditional-cpp"
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS(
|
||||
limits.h \
|
||||
malloc.h \
|
||||
string.h \
|
||||
unistd.h \
|
||||
stdarg.h \
|
||||
sys/types.h \
|
||||
signal.h \
|
||||
unix.h \
|
||||
dlfcn.h)
|
||||
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"])
|
||||
AC_CHECK_FUNC(dlopen,[AC_DEFINE(HAVE_LIBDL, 1,[ ])])
|
||||
|
||||
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 )
|
||||
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_VPRINTF
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite)
|
||||
AC_ZEND_BROKEN_SPRINTF
|
||||
|
||||
AC_CHECK_FUNCS(finite isfinite isinf isnan)
|
||||
|
||||
ZEND_FP_EXCEPT
|
||||
|
||||
AC_SUBST(ZEND_SCANNER)
|
||||
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AC_DEFUN(LIBZEND_ENABLE_DEBUG,[
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug Compile with debugging symbols],[
|
||||
ZEND_DEBUG=$enableval
|
||||
],[
|
||||
ZEND_DEBUG=no
|
||||
])
|
||||
|
||||
])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AC_DEFUN(LIBZEND_OTHER_CHECKS,[
|
||||
|
||||
AC_ARG_ENABLE(c9x-inline,
|
||||
[ --enable-c9x-inline Enable C9x-inline semantics],[
|
||||
ZEND_C9X_INLINE=$enableval
|
||||
],[
|
||||
ZEND_C9X_INLINE=no
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(experimental-zts,
|
||||
[ --enable-experimental-zts This will most likely break your build],[
|
||||
ZEND_EXPERIMENTAL_ZTS=$enableval
|
||||
],[
|
||||
ZEND_EXPERIMENTAL_ZTS=no
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(inline-optimization,
|
||||
[ --enable-inline-optimization If you have much memory and are using
|
||||
gcc, you might try this.],[
|
||||
ZEND_INLINE_OPTIMIZATION=$enableval
|
||||
],[
|
||||
ZEND_INLINE_OPTIMIZATION=no
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE(memory-limit,
|
||||
[ --enable-memory-limit Compile with memory limit support. ], [
|
||||
ZEND_MEMORY_LIMIT=$enableval
|
||||
],[
|
||||
ZEND_MEMORY_LIMIT=no
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether to enable C9x-inline semantics)
|
||||
AC_MSG_RESULT($ZEND_C9X_INLINE)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable experimental ZTS)
|
||||
AC_MSG_RESULT($ZEND_EXPERIMENTAL_ZTS)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable inline optimization for GCC)
|
||||
AC_MSG_RESULT($ZEND_INLINE_OPTIMIZATION)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable a memory limit)
|
||||
AC_MSG_RESULT($ZEND_MEMORY_LIMIT)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable Zend debugging)
|
||||
AC_MSG_RESULT($ZEND_DEBUG)
|
||||
|
||||
if test "$ZEND_DEBUG" = "yes"; then
|
||||
AC_DEFINE(ZEND_DEBUG,1,[ ])
|
||||
echo " $CFLAGS" | grep ' -g' >/dev/null || DEBUG_CFLAGS="-g"
|
||||
test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
|
||||
test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
|
||||
DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
|
||||
else
|
||||
AC_DEFINE(ZEND_DEBUG,0,[ ])
|
||||
fi
|
||||
|
||||
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
|
||||
if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
|
||||
AC_DEFINE(ZTS,1,[ ])
|
||||
ZEND_SCANNER_TYPE=cc
|
||||
CPPFLAGS="$CPPFLAGS -I../TSRM"
|
||||
LIBZEND_CPLUSPLUS_CHECKS
|
||||
else
|
||||
ZEND_SCANNER_TYPE=c
|
||||
fi
|
||||
|
||||
if test "$ZEND_C9X_INLINE" = "yes"; then
|
||||
AC_DEFINE(C9X_INLINE_SEMANTICS, 1, [whether to enable C9x-inline semantics])
|
||||
else
|
||||
ZEND_GCC=libZend_gcc.la
|
||||
AC_SUBST(ZEND_GCC)
|
||||
fi
|
||||
|
||||
ZEND_SCANNER="libZend_${ZEND_SCANNER_TYPE}.la"
|
||||
|
||||
if test "$ZEND_MEMORY_LIMIT" = "yes"; then
|
||||
AC_DEFINE(MEMORY_LIMIT, 1, [Memory limit])
|
||||
else
|
||||
AC_DEFINE(MEMORY_LIMIT, 0, [Memory limit])
|
||||
fi
|
||||
|
||||
changequote({,})
|
||||
if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
|
||||
INLINE_CFLAGS=`echo $ac_n "$CFLAGS $ac_c" | sed s/-O[0-9]*//`
|
||||
else
|
||||
INLINE_CFLAGS="$CFLAGS"
|
||||
fi
|
||||
changequote([,])
|
||||
|
||||
AC_C_INLINE
|
||||
|
||||
AC_SUBST(INLINE_CFLAGS)
|
||||
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN(LIBZEND_CPLUSPLUS_CHECKS,[
|
||||
|
||||
dnl extra check to avoid C++ preprocessor testing if in non-ZTS mode
|
||||
|
||||
if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_CHECK_HEADER(stdiostream.h, [ AC_DEFINE(HAVE_STDIOSTREAM_H, [], Whether you have stdiostream.h) ])
|
||||
|
||||
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_CACHE_CHECK(for class istdiostream,ac_cv_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_cv_class_istdiostream=yes
|
||||
],[
|
||||
ac_cv_class_istdiostream=no
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_class_istdiostream" = "yes"; then
|
||||
AC_DEFINE(HAVE_CLASS_ISTDIOSTREAM, 1, [Whether you have class istdiostream])
|
||||
fi
|
||||
AC_LANG_C
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -1,379 +1,452 @@
|
||||
# Microsoft Developer Studio Project File - Name="libzendts" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=libzendts - 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 "libzendts.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 "libzendts.mak" CFG="libzendts - Win32 Debug_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "libzendts - Win32 Release_TS" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "libzendts - Win32 Debug_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)" == "libzendts - Win32 Release_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "Release_TS"
|
||||
# PROP BASE Intermediate_Dir "Release_TS"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 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_TS" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x40d /d "NDebug_TS"
|
||||
# ADD RSC /l 0x40d /d "NDebug_TS"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "libzendts - Win32 Debug_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "Debug_TS"
|
||||
# PROP BASE Intermediate_Dir "Debug_TS"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Output_Dir "Debug_TS"
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_Debug_TS" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_Debug_TS" /D "_LIB" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D "ZTS" /D ZEND_DEBUG=1 /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x40d /d "_Debug_TS"
|
||||
# ADD RSC /l 0x40d /d "_Debug_TS"
|
||||
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 "libzendts - Win32 Release_TS"
|
||||
# Name "libzendts - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_alloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_constants.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute_API.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_extensions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_highlight.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_indent.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_llist.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_opcode.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_operators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ptr_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_sprintf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_variables.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FlexLexer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\modules.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_errors.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_extensions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_highlight.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_indent.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_llist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_operators.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ptr_stack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_stack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_variables.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Parsers"
|
||||
|
||||
# PROP Default_Filter "y"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.y"
|
||||
|
||||
!IF "$(CFG)" == "libzendts - Win32 Release_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "libzendts - Win32 Debug_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Scanners"
|
||||
|
||||
# PROP Default_Filter "l"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.l"
|
||||
|
||||
!IF "$(CFG)" == "libzendts - Win32 Release_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "libzendts - Win32 Debug_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Text Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LICENSE
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_BUGS
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_CHANGES
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resources"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
# Microsoft Developer Studio Project File - Name="ZendTS" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=ZendTS - Win32 Release_TS_inline
|
||||
!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 "ZendTS.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 "ZendTS.mak" CFG="ZendTS - Win32 Release_TS_inline"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ZendTS - Win32 Release_TS" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ZendTS - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ZendTS - Win32 Release_TS_inline" (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)" == "ZendTS - Win32 Release_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "Release_TS"
|
||||
# PROP BASE Intermediate_Dir "Release_TS"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 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_TS" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x40d /d "NDebug_TS"
|
||||
# ADD RSC /l 0x40d /d "NDebug_TS"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "Debug_TS"
|
||||
# PROP BASE Intermediate_Dir "Debug_TS"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Output_Dir "Debug_TS"
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_Debug_TS" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_Debug_TS" /D ZEND_DEBUG=1 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x40d /d "_Debug_TS"
|
||||
# ADD RSC /l 0x40d /d "_Debug_TS"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Output_Dir "ZendTS___Win32_Release_TS_inline"
|
||||
# PROP BASE Intermediate_Dir "ZendTS___Win32_Release_TS_inline"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Output_Dir "Release_TS_inline"
|
||||
# PROP Intermediate_Dir "Release_TS_inline"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /FD /c
|
||||
# SUBTRACT BASE CPP /YX
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x40d /d "NDebug_TS"
|
||||
# ADD RSC /l 0x40d /d "NDebug_TS"
|
||||
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 "ZendTS - Win32 Release_TS"
|
||||
# Name "ZendTS - Win32 Debug_TS"
|
||||
# Name "ZendTS - Win32 Release_TS_inline"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_alloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_constants.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_dynamic_array.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute_API.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_extensions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_gcc_inline.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_highlight.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_indent.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_llist.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_opcode.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_operators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ptr_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_sprintf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_variables.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FlexLexer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\modules.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_alloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_dynamic_array.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_errors.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_execute_locks.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_extensions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_fast_cache.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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
|
||||
|
||||
SOURCE=.\zend_highlight.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_indent.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_list.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_llist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_operators.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_ptr_stack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_stack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_variables.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Parsers"
|
||||
|
||||
# PROP Default_Filter "y"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.y"
|
||||
|
||||
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
BuildCmds= \
|
||||
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)
|
||||
|
||||
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Scanners"
|
||||
|
||||
# PROP Default_Filter "l"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-scanner.l"
|
||||
|
||||
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
flex -+ -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Text Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LICENSE
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_BUGS
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ZEND_CHANGES
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resources"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
+15
-47
@@ -1,46 +1,18 @@
|
||||
#undef HAVE_CLASS_ISTDIOSTREAM
|
||||
|
||||
#define ZEND_API
|
||||
#define ZEND_DLEXPORT
|
||||
|
||||
@TOP@
|
||||
|
||||
/* This is the default configuration file to read */
|
||||
#define USE_CONFIG_FILE 1
|
||||
|
||||
/* these are defined by automake */
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
/* define uint by configure if it is missed (QNX and BSD derived) */
|
||||
#undef uint
|
||||
|
||||
/* define ulong by configure if it is missed (most probably is) */
|
||||
#undef ulong
|
||||
|
||||
/* Undefine if you want stricter XML/SGML compliance by default */
|
||||
/* (this disables "<?expression?>" by default) */
|
||||
#define T_DEFAULT_SHORT_OPEN_TAG 1
|
||||
|
||||
/* Define both of these if you want the bundled REGEX library */
|
||||
#define REGEX 0
|
||||
#define HSREGEX 0
|
||||
|
||||
#undef ZEND_DEBUG
|
||||
|
||||
/* Define if you want to enable bc style precision math support */
|
||||
#define WITH_BCMATH 0
|
||||
|
||||
/* Define if you want to enable memory limit support */
|
||||
#define MEMORY_LIMIT 0
|
||||
|
||||
/* Define if you have broken sprintf function like SunOS 4 */
|
||||
#define BROKEN_SPRINTF 0
|
||||
|
||||
/* Define to compile Zend thread safe */
|
||||
#undef ZTS
|
||||
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
@BOTTOM@
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
@@ -57,30 +29,26 @@
|
||||
# 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
|
||||
|
||||
#ifdef HAVE_FINITE
|
||||
#define zend_finite(a) finite(a)
|
||||
#elif defined(HAVE_ISFINITE)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_ISNAN) && defined(HAVE_ISINF)
|
||||
#define zend_finite(a) (isnan(a) ? 0 : isinf(a) ? 0 : 1)
|
||||
#elif defined(HAVE_ISNAN)
|
||||
#define zend_finite(a) (isnan(a) ? 0 : 1)
|
||||
#elif defined(HAVE_ISINF)
|
||||
#define zend_finite(a) (isinf(a) ? 0 : 1)
|
||||
#else
|
||||
#define zend_finite(a) (1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+32
-10
@@ -2,21 +2,43 @@ dnl $Id$
|
||||
dnl
|
||||
dnl This file contains local autoconf functions.
|
||||
|
||||
AC_DEFUN(ZEND_FP_EXCEPT,[
|
||||
AC_CACHE_CHECK(whether fp_except is defined, ac_cv_type_fp_except,[
|
||||
AC_TRY_COMPILE([
|
||||
#include <floatingpoint.h>
|
||||
],[
|
||||
fp_except x = (fp_except) 0;
|
||||
],[
|
||||
ac_cv_type_fp_except=yes
|
||||
],[
|
||||
ac_cv_type_fp_except=no
|
||||
],[
|
||||
ac_cv_type_fp_except=no
|
||||
])])
|
||||
if test "$ac_cv_type_fp_except" = "yes"; then
|
||||
AC_DEFINE(HAVE_FP_EXCEPT, 1, [whether floatingpoint.h defines fp_except])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Check for broken sprintf()
|
||||
dnl
|
||||
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(ZEND_BROKEN_SPRINTF,0)
|
||||
AC_MSG_RESULT(ok)
|
||||
],[
|
||||
AC_DEFINE(ZEND_BROKEN_SPRINTF,1)
|
||||
AC_MSG_RESULT(broken)
|
||||
],[
|
||||
AC_DEFINE(ZEND_BROKEN_SPRINTF,0)
|
||||
AC_MSG_RESULT(cannot check, guessing ok)
|
||||
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
|
||||
AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
|
||||
ac_cv_broken_sprintf=no
|
||||
],[
|
||||
ac_cv_broken_sprintf=yes
|
||||
],[
|
||||
ac_cv_broken_sprintf=no
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_broken_sprintf" = "yes"; then
|
||||
ac_result=1
|
||||
else
|
||||
ac_result=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(ZEND_BROKEN_SPRINTF, $ac_result, [Whether sprintf is broken])
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
|
||||
|
||||
+8
-173
@@ -6,48 +6,22 @@ AM_INIT_AUTOMAKE(zend, 0.80A)
|
||||
AM_CONFIG_HEADER(zend_config.h)
|
||||
AM_SANITY_CHECK
|
||||
AM_MAINTAINER_MODE
|
||||
AC_PROG_CC
|
||||
AM_PROG_LEX
|
||||
AM_PROG_CC_STDC
|
||||
ZEND_VERSION=$VERSION
|
||||
|
||||
dnl We want this one before the checks, so the checks can modify CFLAGS.
|
||||
test -z "$CFLAGS" && auto_cflags=1
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_YACC
|
||||
if test "$YACC" != "bison -y"; then
|
||||
AC_MSG_WARN(You will need bison if you want to regenerate the Zend parser.)
|
||||
else
|
||||
AC_MSG_CHECKING(bison version)
|
||||
set `bison --version| sed -e 's/^GNU Bison version //' -e 's/\./ /'`
|
||||
if test "$1" = "1" -a "$2" -lt "25"; then
|
||||
AC_MSG_WARN(You will need bison 1.25 if you want to regenerate the Zend parser (found $1.$2).)
|
||||
fi
|
||||
AC_MSG_RESULT($1.$2 (ok))
|
||||
fi
|
||||
AC_PROG_CC
|
||||
if test "$enable_thread_safety" = "yes" ; then
|
||||
AC_PROG_CXX
|
||||
fi
|
||||
AC_PROG_CC_C_O
|
||||
AM_PROG_LEX
|
||||
sinclude(Zend.m4)
|
||||
|
||||
LIBZEND_BASIC_CHECKS
|
||||
|
||||
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
|
||||
CPPFLAGS="$CPPFLAGS -traditional-cpp"
|
||||
fi
|
||||
|
||||
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
|
||||
CFLAGS=`echo $CFLAGS | sed -e 's/-g//'`
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
|
||||
@@ -58,147 +32,8 @@ if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
|
||||
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(c, dlopen, [
|
||||
# fake it
|
||||
AC_DEFINE(HAVE_LIBDL) ], [
|
||||
AC_CHECK_LIB(dl, dlopen, [
|
||||
LIBS="-ldl $LIBS"
|
||||
AC_DEFINE(HAVE_LIBDL) ], []) ])
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
||||
dnl QNX requires unix.h to allow functions in libunix to work properly
|
||||
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 )
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_VPRINTF
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_ALLOCA
|
||||
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,
|
||||
[ --disable-debug Compile without debugging symbols],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZEND_DEBUG,1)
|
||||
DEBUG_CFLAGS="-g"
|
||||
test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
|
||||
test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
|
||||
DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(ZEND_DEBUG,0)
|
||||
DEBUG_CFLAGS=""
|
||||
fi
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(ZEND_DEBUG,1)
|
||||
DEBUG_CFLAGS="-g"
|
||||
])
|
||||
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. ],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(MEMORY_LIMIT, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_DEFINE(MEMORY_LIMIT, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
],[
|
||||
AC_DEFINE(MEMORY_LIMIT, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
|
||||
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.],[
|
||||
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)
|
||||
|
||||
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_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
|
||||
LIBZEND_ENABLE_DEBUG
|
||||
LIBZEND_OTHER_CHECKS
|
||||
|
||||
EXTRA_LIBS="$LIBS"
|
||||
LIBS=""
|
||||
|
||||
+121
-72
@@ -3,12 +3,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -33,8 +33,6 @@
|
||||
#include "zend_list.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_operators.h"
|
||||
|
||||
#define YYERROR_VERBOSE
|
||||
#define YYSTYPE znode
|
||||
@@ -49,25 +47,25 @@
|
||||
%pure_parser
|
||||
%expect 4
|
||||
|
||||
%left T_INCLUDE T_EVAL T_IMPORT
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL
|
||||
%left ','
|
||||
%left T_LOGICAL_OR
|
||||
%left T_LOGICAL_XOR
|
||||
%left T_LOGICAL_AND
|
||||
%right T_PRINT
|
||||
%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL XT_OR_EQUAL T_SL_EQUAL T_SR_EQUAL
|
||||
%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL
|
||||
%left '?' ':'
|
||||
%left T_BOOLEAN_OR
|
||||
%left T_BOOLEAN_AND
|
||||
%left '|'
|
||||
%left '^'
|
||||
%left '&'
|
||||
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL
|
||||
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL
|
||||
%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
|
||||
%left T_SL T_SR
|
||||
%left '+' '-' '.'
|
||||
%left '*' '/' '%'
|
||||
%right '!' '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST '@'
|
||||
%right '!' '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
|
||||
%right '['
|
||||
%nonassoc T_NEW
|
||||
%token T_EXIT
|
||||
@@ -94,6 +92,8 @@
|
||||
%token T_ENDFOR
|
||||
%token T_FOREACH
|
||||
%token T_ENDFOREACH
|
||||
%token T_DECLARE
|
||||
%token T_ENDDECLARE
|
||||
%token T_AS
|
||||
%token T_SWITCH
|
||||
%token T_ENDSWITCH
|
||||
@@ -106,6 +106,7 @@
|
||||
%token T_CONST
|
||||
%token T_RETURN
|
||||
%token T_REQUIRE
|
||||
%token T_REQUIRE_ONCE
|
||||
%token T_USE
|
||||
%token T_GLOBAL
|
||||
%token T_STATIC
|
||||
@@ -127,14 +128,18 @@
|
||||
%token T_OPEN_TAG_WITH_ECHO
|
||||
%token T_CLOSE_TAG
|
||||
%token T_WHITESPACE
|
||||
%token T_HEREDOC
|
||||
%token T_START_HEREDOC
|
||||
%token T_END_HEREDOC
|
||||
%token T_DOLLAR_OPEN_CURLY_BRACES
|
||||
%token T_CURLY_OPEN
|
||||
%token T_PAAMAYIM_NEKUDOTAYIM
|
||||
%token T_PHP_TRACK_VARS
|
||||
|
||||
%% /* Rules */
|
||||
|
||||
start:
|
||||
top_statement_list
|
||||
;
|
||||
|
||||
top_statement_list:
|
||||
top_statement_list { do_extended_info(CLS_C); } top_statement { HANDLE_INTERACTIVE(); }
|
||||
| /* empty */
|
||||
@@ -160,11 +165,16 @@ inner_statement:
|
||||
|
||||
|
||||
statement:
|
||||
unticked_statement { do_ticks(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
unticked_statement:
|
||||
'{' inner_statement_list '}'
|
||||
| T_IF '(' expr ')' { do_if_cond(&$3, &$4 CLS_CC); } statement { do_if_after_statement(&$4, 1 CLS_CC); } elseif_list else_single { do_if_end(CLS_C); }
|
||||
| T_IF '(' expr ')' ':' { do_if_cond(&$3, &$4 CLS_CC); } inner_statement_list { do_if_after_statement(&$4, 1 CLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { do_if_end(CLS_C); }
|
||||
| T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { do_while_cond(&$4, &$5 CLS_CC); } while_statement { do_while_end(&$1, &$5 CLS_CC); }
|
||||
| T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); do_do_while_begin(CLS_C); } statement T_WHILE '(' expr ')' ';' { do_do_while_end(&$1, &$6 CLS_CC); }
|
||||
| T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); do_do_while_begin(CLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { do_do_while_end(&$1, &$5, &$7 CLS_CC); }
|
||||
| T_FOR
|
||||
'('
|
||||
for_expr
|
||||
@@ -179,20 +189,31 @@ statement:
|
||||
| T_BREAK expr ';' { do_brk_cont(ZEND_BRK, &$2 CLS_CC); }
|
||||
| T_CONTINUE ';' { do_brk_cont(ZEND_CONT, NULL CLS_CC); }
|
||||
| T_CONTINUE expr ';' { do_brk_cont(ZEND_CONT, &$2 CLS_CC); }
|
||||
| T_RETURN ';' { do_return(NULL CLS_CC); }
|
||||
| T_RETURN expr ';' { do_return(&$2 CLS_CC); }
|
||||
| T_GLOBAL global_var_list
|
||||
| T_STATIC static_var_list
|
||||
| T_RETURN ';' { do_return(NULL, 0 CLS_CC); }
|
||||
| T_RETURN expr_without_variable ';' { do_return(&$2, 0 CLS_CC); }
|
||||
| T_RETURN cvar ';' { do_return(&$2, 1 CLS_CC); }
|
||||
| T_GLOBAL global_var_list ';'
|
||||
| T_STATIC static_var_list ';'
|
||||
| T_ECHO echo_expr_list ';'
|
||||
| T_INLINE_HTML { do_echo(&$1 CLS_CC); }
|
||||
| expr ';' { do_free(&$1 CLS_CC); }
|
||||
| T_REQUIRE expr ';' { if ($2.op_type==IS_CONST && $2.u.constant.type==IS_STRING) { require_filename($2.u.constant.value.str.val CLS_CC); zval_dtor(&$2.u.constant); } else { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); } }
|
||||
| T_REQUIRE expr ';' { do_require(&$2, 0 CLS_CC); }
|
||||
| T_REQUIRE_ONCE use_filename ';' { do_require(&$2, 1 CLS_CC); }
|
||||
| T_USE use_filename ';' { use_filename($2.u.constant.value.str.val, $2.u.constant.value.str.len CLS_CC); zval_dtor(&$2.u.constant); }
|
||||
| T_UNSET '(' r_cvar ')' ';' { do_unset(&$3 CLS_CC); }
|
||||
| T_UNSET '(' unset_variables ')' ';'
|
||||
| T_FOREACH '(' expr T_AS { do_foreach_begin(&$1, &$3, &$2, &$4 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_DECLARE { do_declare_begin(CLS_C); } '(' declare_list ')' declare_statement { do_declare_end(CLS_C); }
|
||||
| ';' /* empty statement */
|
||||
;
|
||||
|
||||
unset_variables:
|
||||
unset_variable
|
||||
| unset_variables ',' unset_variable
|
||||
;
|
||||
|
||||
unset_variable:
|
||||
cvar { do_end_variable_parse(BP_VAR_UNSET, 0 CLS_CC); do_unset(&$1 CLS_CC); }
|
||||
;
|
||||
|
||||
use_filename:
|
||||
T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||
@@ -201,9 +222,14 @@ use_filename:
|
||||
|
||||
|
||||
declaration_statement:
|
||||
T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } T_STRING { do_begin_function_declaration(&$1, &$3, 0 CLS_CC); }
|
||||
unticked_declaration_statement { do_ticks(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
unticked_declaration_statement:
|
||||
T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
|
||||
'(' parameter_list ')' '{' inner_statement_list '}' { do_end_function_declaration(&$1 CLS_CC); }
|
||||
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } T_STRING { do_begin_function_declaration(&$1, &$3, 0 CLS_CC); }
|
||||
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
|
||||
parameter_list '(' inner_statement_list ')' ';' { do_end_function_declaration(&$1 CLS_CC); }
|
||||
| T_CLASS T_STRING { do_begin_class_declaration(&$2, NULL CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); }
|
||||
| T_CLASS T_STRING T_EXTENDS T_STRING { do_begin_class_declaration(&$2, &$4 CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); }
|
||||
@@ -228,6 +254,18 @@ foreach_statement:
|
||||
;
|
||||
|
||||
|
||||
declare_statement:
|
||||
statement
|
||||
| ':' inner_statement_list T_ENDDECLARE ';'
|
||||
;
|
||||
|
||||
|
||||
declare_list:
|
||||
T_STRING '=' static_scalar { do_declare_stmt(&$1, &$3 CLS_CC); }
|
||||
| declare_list ',' T_STRING '=' static_scalar { do_declare_stmt(&$3, &$5 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
switch_case_list:
|
||||
'{' case_list '}' { $$ = $2; }
|
||||
| '{' ';' case_list '}' { $$ = $3; }
|
||||
@@ -237,9 +275,9 @@ switch_case_list:
|
||||
|
||||
|
||||
case_list:
|
||||
/* empty */ { $$.u.opline_num = -1; }
|
||||
| case_list T_CASE expr case_separator { do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); }
|
||||
| case_list T_DEFAULT case_separator { do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); }
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| case_list T_CASE expr case_separator { do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST }
|
||||
| case_list T_DEFAULT case_separator { do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
|
||||
;
|
||||
|
||||
|
||||
@@ -293,12 +331,10 @@ non_empty_parameter_list:
|
||||
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
|
||||
| T_VARIABLE '=' T_UNSET { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE '=' T_UNSET { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -347,13 +383,16 @@ class_statement_list:
|
||||
|
||||
class_statement:
|
||||
T_VAR class_variable_decleration ';'
|
||||
| T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } T_STRING { do_begin_function_declaration(&$1, &$3, 1 CLS_CC); } '('
|
||||
| T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); } '('
|
||||
parameter_list ')' '{' inner_statement_list '}' { do_end_function_declaration(&$1 CLS_CC); }
|
||||
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } T_STRING { do_begin_function_declaration(&$1, &$3, 1 CLS_CC); }
|
||||
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); }
|
||||
parameter_list '(' inner_statement_list ')' ';' { do_end_function_declaration(&$1 CLS_CC); }
|
||||
|
||||
;
|
||||
|
||||
is_reference:
|
||||
/* empty */ { $$.op_type = ZEND_RETURN_VAL; }
|
||||
| '&' { $$.op_type = ZEND_RETURN_REF; }
|
||||
|
||||
class_variable_decleration:
|
||||
class_variable_decleration ',' T_VARIABLE { do_declare_property(&$3, NULL CLS_CC); }
|
||||
@@ -384,6 +423,7 @@ expr_without_variable:
|
||||
T_LIST '(' { do_list_init(CLS_C); } assignment_list ')' '=' expr { do_list_end(&$$, &$7 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); }
|
||||
| cvar '=' '&' function_call { 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);}
|
||||
| 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); }
|
||||
@@ -393,7 +433,7 @@ expr_without_variable:
|
||||
| cvar T_MOD_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_AND_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_OR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar XT_OR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_XOR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_SL_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| cvar T_SR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| rw_cvar T_INC { do_post_incdec(&$$, &$1, ZEND_POST_INC CLS_CC); }
|
||||
@@ -421,6 +461,7 @@ expr_without_variable:
|
||||
| '!' expr { do_unary_op(ZEND_BOOL_NOT, &$$, &$2 CLS_CC); }
|
||||
| '~' expr { do_unary_op(ZEND_BW_NOT, &$$, &$2 CLS_CC); }
|
||||
| expr T_IS_IDENTICAL expr { do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_IDENTICAL expr { do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_EQUAL expr { do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_EQUAL expr { do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '<' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 CLS_CC); }
|
||||
@@ -431,15 +472,7 @@ 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); $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num CLS_CC); do_extended_fcall_end(CLS_C); }
|
||||
| r_cvar '(' { do_extended_fcall_begin(CLS_C); do_begin_dynamic_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
| T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_class_member_function_call(&$1, &$3 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$3, &$$, &$6, 1, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
| function_call { $$ = $1; }
|
||||
| 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); }
|
||||
@@ -447,6 +480,7 @@ expr_without_variable:
|
||||
| T_ARRAY_CAST expr { do_cast(&$$, &$2, IS_ARRAY CLS_CC); }
|
||||
| T_OBJECT_CAST expr { do_cast(&$$, &$2, IS_OBJECT CLS_CC); }
|
||||
| T_BOOL_CAST expr { do_cast(&$$, &$2, IS_BOOL CLS_CC); }
|
||||
| T_UNSET_CAST expr { do_cast(&$$, &$2, IS_NULL CLS_CC); }
|
||||
| T_EXIT exit_expr { do_exit(&$$, &$2 CLS_CC); }
|
||||
| '@' { do_begin_silence(&$1 CLS_CC); } expr { do_end_silence(&$1 CLS_CC); $$ = $3; }
|
||||
| scalar { $$ = $1; }
|
||||
@@ -456,9 +490,22 @@ expr_without_variable:
|
||||
;
|
||||
|
||||
|
||||
function_call:
|
||||
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, $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, 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, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
;
|
||||
|
||||
|
||||
exit_expr:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| '(' ')' { $$.op_type = IS_UNUSED; }
|
||||
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
@@ -490,7 +537,7 @@ static_scalar: /* compile-time evaluated scalars */
|
||||
| T_STRING { do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); }
|
||||
| '+' static_scalar { $$ = $1; }
|
||||
| '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; }
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; }
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; }
|
||||
;
|
||||
|
||||
|
||||
@@ -500,15 +547,19 @@ scalar:
|
||||
| common_scalar { $$ = $1; }
|
||||
| '"' encaps_list '"' { $$ = $2; }
|
||||
| '\'' encaps_list '\'' { $$ = $2; }
|
||||
| T_HEREDOC encaps_list T_HEREDOC { $$ = $2; do_end_heredoc(CLS_C); }
|
||||
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; do_end_heredoc(CLS_C); }
|
||||
;
|
||||
|
||||
|
||||
static_array_pair_list:
|
||||
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
|
||||
| non_empty_static_array_pair_list { $$ = $1; }
|
||||
| non_empty_static_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
possible_comma:
|
||||
/* empty */
|
||||
| ','
|
||||
;
|
||||
|
||||
non_empty_static_array_pair_list:
|
||||
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { do_add_static_array_element(&$$, &$3, &$5); }
|
||||
@@ -522,6 +573,12 @@ expr:
|
||||
| expr_without_variable { $$ = $1; }
|
||||
;
|
||||
|
||||
/*
|
||||
w_expr:
|
||||
w_cvar { $$ = $1; }
|
||||
| expr_without_variable { $$ = $1; }
|
||||
;
|
||||
*/
|
||||
|
||||
|
||||
r_cvar:
|
||||
@@ -552,8 +609,9 @@ cvar_without_objects:
|
||||
|
||||
|
||||
reference_variable:
|
||||
dim_list ']' { $$ = $1; }
|
||||
| compound_variable { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
|
||||
| reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| compound_variable { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -562,39 +620,30 @@ compound_variable:
|
||||
| '$' '{' expr '}' { $$ = $3; }
|
||||
;
|
||||
|
||||
|
||||
dim_list:
|
||||
dim_list ']' '[' dim_offset { fetch_array_dim(&$$, &$1, &$4 CLS_CC); }
|
||||
| compound_variable { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); } '[' dim_offset { fetch_array_begin(&$$, &$1, &$4 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
dim_offset:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| expr { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
ref_list:
|
||||
object_property { $$ = $1; }
|
||||
| ref_list T_OBJECT_OPERATOR { do_push_object(&$1 CLS_CC); } object_property { $$ = $4; }
|
||||
;
|
||||
|
||||
object_property:
|
||||
scalar_object_property { znode tmp_znode; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC); }
|
||||
| object_dim_list ']' { $$ = $1; }
|
||||
object_dim_list { $$ = $1; }
|
||||
| cvar_without_objects { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); } { znode tmp_znode; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
|
||||
;
|
||||
|
||||
scalar_object_property:
|
||||
T_STRING { $$ = $1; }
|
||||
| '{' expr '}' { $$ = $2; }
|
||||
| cvar_without_objects { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
object_dim_list:
|
||||
object_dim_list ']' '[' dim_offset { fetch_array_dim(&$$, &$1, &$4 CLS_CC); }
|
||||
| T_STRING { znode tmp_znode, res; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&res, &tmp_znode, &$1 CLS_CC); $1 = res; } '[' dim_offset { fetch_array_dim(&$$, &$1, &$4 CLS_CC); }
|
||||
object_dim_list '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
|
||||
| object_dim_list '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| variable_name { znode tmp_znode; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
|
||||
;
|
||||
|
||||
variable_name:
|
||||
T_STRING { $$ = $1; }
|
||||
| '{' expr '}' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
@@ -610,7 +659,7 @@ assignment_list:
|
||||
|
||||
|
||||
assignment_list_element:
|
||||
w_cvar { do_add_list_element(&$1 CLS_CC); }
|
||||
cvar { do_add_list_element(&$1 CLS_CC); }
|
||||
| T_LIST '(' { do_new_list_begin(CLS_C); } assignment_list ')' { do_new_list_end(CLS_C); }
|
||||
| /* empty */ { do_add_list_element(NULL CLS_CC); }
|
||||
;
|
||||
@@ -618,7 +667,7 @@ assignment_list_element:
|
||||
|
||||
array_pair_list:
|
||||
/* empty */ { do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list { $$ = $1; }
|
||||
| non_empty_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_array_pair_list:
|
||||
@@ -639,11 +688,11 @@ encaps_list:
|
||||
| encaps_list T_ENCAPSED_AND_WHITESPACE { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_BAD_CHARACTER { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '[' { $2.u.constant.value.chval = '['; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list ']' { $2.u.constant.value.chval = ']'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '{' { $2.u.constant.value.chval = '{'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '}' { $2.u.constant.value.chval = '}'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.chval = '-'; do_add_char(&tmp, &$1, &$2 CLS_CC); $2.u.constant.value.chval = '>'; do_add_char(&$$, &tmp, &$2 CLS_CC); }
|
||||
| encaps_list '[' { $2.u.constant.value.lval = (long) '['; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list ']' { $2.u.constant.value.lval = (long) ']'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '{' { $2.u.constant.value.lval = (long) '{'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '}' { $2.u.constant.value.lval = (long) '}'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.lval = (long) '-'; do_add_char(&tmp, &$1, &$2 CLS_CC); $2.u.constant.value.lval = (long) '>'; do_add_char(&$$, &tmp, &$2 CLS_CC); }
|
||||
| /* empty */ { do_init_string(&$$ CLS_CC); }
|
||||
|
||||
;
|
||||
@@ -670,9 +719,9 @@ encaps_var_offset:
|
||||
internal_functions_in_yacc:
|
||||
T_ISSET '(' cvar ')' { do_isset_or_isempty(ZEND_ISSET, &$$, &$3 CLS_CC); }
|
||||
| T_EMPTY '(' cvar ')' { do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 CLS_CC); }
|
||||
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
|
||||
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
|
||||
| T_INCLUDE_ONCE expr { do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
|
||||
| T_EVAL '(' expr ')' { do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); }
|
||||
| T_IMPORT '(' expr ')' { do_include_or_eval(ZEND_IMPORT, &$$, &$3 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
+8
-10
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -33,21 +33,19 @@ public:
|
||||
#endif /* ZTS */
|
||||
|
||||
|
||||
#ifndef ZTS
|
||||
typedef struct _zend_lex_state {
|
||||
#ifndef ZTS
|
||||
YY_BUFFER_STATE buffer_state;
|
||||
int state;
|
||||
uint return_offset;
|
||||
uint lineno;
|
||||
FILE *in;
|
||||
char *filename;
|
||||
} zend_lex_state;
|
||||
#else
|
||||
typedef struct _zend_lex_state {
|
||||
ZendFlexLexer *ZFL;
|
||||
istream *input_file;
|
||||
} zend_lex_state;
|
||||
#endif
|
||||
uint lineno;
|
||||
char *filename;
|
||||
} zend_lex_state;
|
||||
|
||||
|
||||
void zend_fatal_scanner_error(char *);
|
||||
inline void restore_lexical_state(zend_lex_state * CLS_DC);
|
||||
|
||||
+138
-58
@@ -4,12 +4,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -33,8 +33,7 @@
|
||||
|
||||
%{
|
||||
|
||||
#if WIN32|WINNT
|
||||
#include <winsock.h>
|
||||
#ifdef ZEND_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
@@ -57,7 +56,7 @@
|
||||
# ifdef HAVE_STDIOSTREAM_H
|
||||
# include <stdiostream.h>
|
||||
# endif
|
||||
# if WIN32||WINNT
|
||||
# ifdef ZEND_WIN32
|
||||
# include <strstrea.h>
|
||||
# else
|
||||
# include <strstream.h>
|
||||
@@ -92,6 +91,7 @@ private:
|
||||
stdiobuf _file;
|
||||
public:
|
||||
istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
|
||||
stdiobuf* rdbuf()/* const */ { return &_file; }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -148,12 +148,12 @@ static inline void save_lexical_state(zend_lex_state *lex_state CLS_DC)
|
||||
#ifndef ZTS
|
||||
memcpy(&lex_state->buffer_state,&YY_CURRENT_BUFFER,sizeof(YY_BUFFER_STATE));
|
||||
lex_state->in = yyin;
|
||||
lex_state->lineno = CG(zend_lineno);
|
||||
lex_state->state = YYSTATE;
|
||||
lex_state->filename = zend_get_compiled_filename();
|
||||
#else
|
||||
lex_state->ZFL = CG(ZFL);
|
||||
#endif
|
||||
lex_state->filename = zend_get_compiled_filename(CLS_C);
|
||||
lex_state->lineno = CG(zend_lineno);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,13 +170,13 @@ inline void restore_lexical_state(zend_lex_state *lex_state CLS_DC)
|
||||
|
||||
yy_delete_buffer(original_buffer_state);
|
||||
yyin = lex_state->in;
|
||||
CG(zend_lineno) = lex_state->lineno;
|
||||
BEGIN(lex_state->state);
|
||||
zend_restore_compiled_filename(lex_state->filename);
|
||||
#else
|
||||
delete((ZendFlexLexer *) CG(ZFL));
|
||||
CG(ZFL) = lex_state->ZFL;
|
||||
#endif
|
||||
CG(zend_lineno) = lex_state->lineno;
|
||||
zend_restore_compiled_filename(lex_state->filename);
|
||||
}
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
case ZEND_HANDLE_FP:
|
||||
file_handle->opened_path = NULL;
|
||||
if (file_handle->handle.fp==stdin) {
|
||||
file_handle->handle.is = (ifstream *) &cin;
|
||||
file_handle->handle.is = &cin;
|
||||
} else {
|
||||
if (!file_handle->handle.fp) {
|
||||
return FAILURE;
|
||||
@@ -316,46 +316,66 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
END_EXTERN_C()
|
||||
|
||||
|
||||
ZEND_API zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ...)
|
||||
ZEND_API zend_op_array *zend_compile_files(int type CLS_DC, int file_count, ...)
|
||||
{
|
||||
va_list files;
|
||||
zend_op_array *op_array;
|
||||
|
||||
va_start(files, file_count);
|
||||
op_array = v_compile_files(mark_as_ref CLS_CC, file_count, files);
|
||||
op_array = zend_v_compile_files(type CLS_CC, file_count, files);
|
||||
va_end(files);
|
||||
return op_array;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count, va_list files)
|
||||
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
|
||||
zend_op_array *original_active_op_array = CG(active_op_array);
|
||||
zend_op_array *retval=NULL;
|
||||
zend_file_handle *file_handle;
|
||||
int i;
|
||||
int compiler_result;
|
||||
int compiled_files=0;
|
||||
int last_file=0;
|
||||
znode retval_znode;
|
||||
zend_bool original_in_compilation = CG(in_compilation);
|
||||
zend_file_handle **file_handles = (zend_file_handle **) do_alloca(file_count * sizeof(zend_file_handle *));
|
||||
|
||||
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
|
||||
retval_znode.op_type = IS_CONST;
|
||||
retval_znode.u.constant.type = IS_LONG;
|
||||
retval_znode.u.constant.value.lval = 1;
|
||||
retval_znode.u.constant.is_ref = 0;
|
||||
retval_znode.u.constant.refcount = 1;
|
||||
|
||||
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
|
||||
retval = op_array; /* success oriented */
|
||||
|
||||
for (i=0; i<file_count; i++) {
|
||||
file_handle = va_arg(files, zend_file_handle *);
|
||||
if (!file_handle) {
|
||||
file_handles[i] = va_arg(files, zend_file_handle *);
|
||||
if (file_handles[i]) {
|
||||
last_file = i;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<file_count; i++) {
|
||||
if (!file_handles[i]) {
|
||||
continue;
|
||||
}
|
||||
if (open_file_for_scanning(file_handle CLS_CC)==FAILURE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
|
||||
if (open_file_for_scanning(file_handles[i] CLS_CC)==FAILURE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handles[i]->filename);
|
||||
} else {
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
compiler_result = zendparse(CLS_C);
|
||||
zend_close_file_handle(file_handle CLS_CC);
|
||||
zend_close_file_handle(file_handles[i] CLS_CC);
|
||||
if (i == last_file) {
|
||||
do_return(&retval_znode, 0 CLS_CC);
|
||||
}
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
CG(unclean_shutdown) = 1;
|
||||
retval = NULL;
|
||||
@@ -367,25 +387,26 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
|
||||
|
||||
if (retval) {
|
||||
if (compiled_files>0) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array);
|
||||
if (mark_as_ref) {
|
||||
pass_include_eval(op_array);
|
||||
}
|
||||
} else {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
destroy_op_array(op_array);
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
}
|
||||
}
|
||||
free_alloca(file_handles);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
zend_op_array *compile_filename(zval *filename, zend_bool unique CLS_DC)
|
||||
zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
{
|
||||
zend_file_handle file_handle;
|
||||
zval tmp;
|
||||
zend_op_array *retval;
|
||||
int error_reporting=0;
|
||||
|
||||
if (filename->type != IS_STRING) {
|
||||
tmp = *filename;
|
||||
@@ -397,7 +418,25 @@ zend_op_array *compile_filename(zval *filename, zend_bool unique CLS_DC)
|
||||
file_handle.free_filename = 0;
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
file_handle.opened_path = NULL;
|
||||
retval = zend_compile_files(1 CLS_CC, 1, &file_handle);
|
||||
|
||||
|
||||
if (type==ZEND_REQUIRE) {
|
||||
/* We don't want to hear about inclusion failures; If we fail,
|
||||
* we'll generate a require failure
|
||||
*/
|
||||
error_reporting = EG(error_reporting);
|
||||
EG(error_reporting) = 0;
|
||||
}
|
||||
retval = zend_compile_files(type CLS_CC, 1, &file_handle);
|
||||
|
||||
if (type==ZEND_REQUIRE) {
|
||||
EG(error_reporting) = error_reporting;
|
||||
if (!retval) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, filename->value.str.val);
|
||||
zend_bailout();
|
||||
}
|
||||
}
|
||||
|
||||
if (filename==&tmp) {
|
||||
zval_dtor(&tmp);
|
||||
}
|
||||
@@ -409,7 +448,7 @@ static inline int prepare_string_for_scanning(zval *str CLS_DC)
|
||||
{
|
||||
#ifndef ZTS
|
||||
/* enforce two trailing NULLs for flex... */
|
||||
str->value.str.val = (char *) erealloc(str->value.str.val,str->value.str.len+2);
|
||||
STR_REALLOC(str->value.str.val, str->value.str.len+2);
|
||||
|
||||
str->value.str.val[str->value.str.len+1]=0;
|
||||
|
||||
@@ -421,6 +460,8 @@ static inline int prepare_string_for_scanning(zval *str CLS_DC)
|
||||
|
||||
CG(ZFL)->switch_streams(input_stream, &cout);
|
||||
#endif
|
||||
zend_set_compiled_filename("Eval code");
|
||||
CG(zend_lineno) = 1;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -433,18 +474,21 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
zend_op_array *retval;
|
||||
zval tmp;
|
||||
int compiler_result;
|
||||
zend_bool original_in_compilation = CG(in_compilation);
|
||||
|
||||
if (source_string->value.str.len==0) {
|
||||
efree(op_array);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CG(in_compilation) = 1;
|
||||
|
||||
tmp = *source_string;
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_string(&tmp);
|
||||
source_string = &tmp;
|
||||
|
||||
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
|
||||
op_array->type = ZEND_EVAL_CODE;
|
||||
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
if (prepare_string_for_scanning(source_string CLS_CC)==FAILURE) {
|
||||
destroy_op_array(op_array);
|
||||
@@ -459,31 +503,34 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
#endif
|
||||
compiler_result = zendparse(CLS_C);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
|
||||
if (compiler_result==1) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(unclean_shutdown)=1;
|
||||
retval = NULL;
|
||||
} else {
|
||||
do_return(NULL, 0 CLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array);
|
||||
pass_include_eval(op_array);
|
||||
retval = op_array;
|
||||
}
|
||||
}
|
||||
zval_dtor(&tmp);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
int require_filename(char *filename CLS_DC)
|
||||
int require_filename(char *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
file_handle.filename = filename;
|
||||
file_handle.free_filename = 0;
|
||||
if (require_file(&file_handle, 0 CLS_CC)==FAILURE) {
|
||||
if (require_file(&file_handle, unique CLS_CC)==FAILURE) {
|
||||
zend_bailout();
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
@@ -493,6 +540,10 @@ int require_filename(char *filename CLS_DC)
|
||||
|
||||
int use_filename(char *filename, uint filename_length CLS_DC)
|
||||
{
|
||||
zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()");
|
||||
return FAILURE;
|
||||
|
||||
#if 0
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.filename = (char *) emalloc(filename_length + zend_uv.import_use_extension_length);
|
||||
@@ -508,6 +559,7 @@ int use_filename(char *filename, uint filename_length CLS_DC)
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
return SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -534,6 +586,7 @@ int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC)
|
||||
pfh->type = ZEND_HANDLE_FILENAME;
|
||||
if (pfh->filename) {
|
||||
pfh->filename = estrdup(pfh->filename);
|
||||
pfh->free_filename = 1;
|
||||
}
|
||||
if (pfh->opened_path) {
|
||||
pfh->opened_path = strdup(pfh->opened_path);
|
||||
@@ -637,7 +690,7 @@ int yyFlexLexer::yylex()
|
||||
|
||||
|
||||
/* redefine YY_INPUT to handle urls for win32*/
|
||||
#if 0 /*WIN32|WINNT*/
|
||||
#if 0 /*defined(ZEND_WIN32)*/
|
||||
#define YY_INPUT(buf,result,max_size) \
|
||||
if ( yyin->_tmpfname != "url" ){ \
|
||||
if ( yy_current_buffer->yy_is_interactive ) \
|
||||
@@ -761,6 +814,14 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
return T_ENDFOREACH;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"declare" {
|
||||
return T_DECLARE;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"enddeclare" {
|
||||
return T_ENDDECLARE;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"as" {
|
||||
return T_AS;
|
||||
}
|
||||
@@ -860,6 +921,10 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
return T_BOOL_CAST;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}("unset"){TABS_AND_SPACES}")" {
|
||||
return T_UNSET_CAST;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"eval" {
|
||||
return T_EVAL;
|
||||
}
|
||||
@@ -868,14 +933,18 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
return T_INCLUDE;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"import" {
|
||||
return T_IMPORT;
|
||||
<ST_IN_SCRIPTING>"include_once" {
|
||||
return T_INCLUDE_ONCE;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"require" {
|
||||
return T_REQUIRE;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"require_once" {
|
||||
return T_REQUIRE_ONCE;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"use" {
|
||||
return T_USE;
|
||||
}
|
||||
@@ -924,6 +993,10 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
return T_IS_IDENTICAL;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"!==" {
|
||||
return T_IS_NOT_IDENTICAL;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"==" {
|
||||
return T_IS_EQUAL;
|
||||
}
|
||||
@@ -982,7 +1055,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"^=" {
|
||||
return XT_OR_EQUAL;
|
||||
return T_XOR_EQUAL;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"||" {
|
||||
@@ -1090,7 +1163,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING>"__FILE__" {
|
||||
char *filename = zend_get_compiled_filename();
|
||||
char *filename = zend_get_compiled_filename(CLS_C);
|
||||
|
||||
if (!filename) {
|
||||
filename = "";
|
||||
@@ -1150,6 +1223,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
zendlval->value.str.len = yyleng;
|
||||
zendlval->type = IS_STRING;
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
return T_OPEN_TAG;
|
||||
} else {
|
||||
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
|
||||
zendlval->value.str.len = yyleng;
|
||||
@@ -1170,9 +1244,12 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
|
||||
|
||||
<INITIAL>"<?php_track_vars?>"([\n]|"\r\n")? {
|
||||
zend_message_dispatcher(ZMSG_ENABLE_TRACK_VARS, NULL);
|
||||
zend_error(E_WARNING, "<?php_track_vars?> is no longer supported - please use the track_vars INI directive instead");
|
||||
HANDLE_NEWLINE(yytext[yyleng-1]);
|
||||
return T_PHP_TRACK_VARS;
|
||||
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
|
||||
zendlval->value.str.len = yyleng;
|
||||
zendlval->type = IS_STRING;
|
||||
return T_INLINE_HTML;
|
||||
}
|
||||
|
||||
<ST_IN_SCRIPTING,ST_DOUBLE_QUOTES,ST_HEREDOC,ST_BACKQUOTE>"$"{LABEL} {
|
||||
@@ -1245,14 +1322,15 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
|
||||
|
||||
<ST_IN_SCRIPTING>"%>"([\n]|"\r\n")? {
|
||||
zendlval->value.str.val = yytext; /* no copying - intentional */
|
||||
zendlval->value.str.len = yyleng;
|
||||
zendlval->type = IS_STRING;
|
||||
HANDLE_NEWLINES(yytext,yyleng);
|
||||
if (CG(asp_tags)) {
|
||||
BEGIN(INITIAL);
|
||||
zendlval->value.str.val = yytext; /* no copying - intentional */
|
||||
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
|
||||
} else {
|
||||
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
|
||||
return T_INLINE_HTML;
|
||||
}
|
||||
}
|
||||
@@ -1397,7 +1475,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
}
|
||||
CG(heredoc) = estrndup(s, CG(heredoc_len));
|
||||
BEGIN(ST_HEREDOC);
|
||||
return T_HEREDOC;
|
||||
return T_START_HEREDOC;
|
||||
}
|
||||
|
||||
|
||||
@@ -1432,6 +1510,8 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
}
|
||||
|
||||
if (label_len==CG(heredoc_len) && !memcmp(yytext, CG(heredoc), label_len)) {
|
||||
zendlval->value.str.val = estrndup(yytext, yyleng); /* unput destroys yytext */
|
||||
zendlval->value.str.len = yyleng;
|
||||
if (unput_semicolon) {
|
||||
unput(';');
|
||||
}
|
||||
@@ -1439,7 +1519,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
CG(heredoc)=NULL;
|
||||
CG(heredoc_len)=0;
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
return T_HEREDOC;
|
||||
return T_END_HEREDOC;
|
||||
} else {
|
||||
zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
|
||||
zendlval->value.str.len = yyleng;
|
||||
@@ -1483,7 +1563,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"$"[^a-zA-Z_\x7f-\xff{] {
|
||||
zendlval->value.chval = yytext[0];
|
||||
zendlval->value.lval = (long) yytext[0];
|
||||
if (yyleng == 2) {
|
||||
yyless(1);
|
||||
/*unput(yytext[1]);
|
||||
@@ -1495,12 +1575,12 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>{ENCAPSED_TOKENS} {
|
||||
zendlval->value.chval = yytext[0];
|
||||
zendlval->value.lval = (long) yytext[0];
|
||||
return yytext[0];
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
|
||||
zendlval->value.chval = yytext[0];
|
||||
zendlval->value.lval = (long) yytext[0];
|
||||
yy_push_state(ST_IN_SCRIPTING);
|
||||
/*unput('$');*/
|
||||
yyless(1);
|
||||
@@ -1509,54 +1589,54 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
|
||||
|
||||
<ST_SINGLE_QUOTE>"\\'" {
|
||||
zendlval->value.chval='\'';
|
||||
zendlval->value.lval = (long) '\'';
|
||||
return T_CHARACTER;
|
||||
}
|
||||
|
||||
<ST_SINGLE_QUOTE>"\\\\" {
|
||||
zendlval->value.chval='\\';
|
||||
zendlval->value.lval = (long)'\\';
|
||||
return T_CHARACTER;
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES>"\\\"" {
|
||||
zendlval->value.chval='"';
|
||||
zendlval->value.lval = (long) '"';
|
||||
return T_CHARACTER;
|
||||
}
|
||||
|
||||
<ST_BACKQUOTE>"\\`" {
|
||||
zendlval->value.chval='`';
|
||||
zendlval->value.lval = (long) '`';
|
||||
return T_CHARACTER;
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\"[0-7]{1,3} {
|
||||
zendlval->value.chval = (char) strtol (yytext+1, NULL, 8);
|
||||
zendlval->value.lval = strtol(yytext+1, NULL, 8);
|
||||
return T_CHARACTER;
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\x"[0-9A-Fa-f]{1,2} {
|
||||
zendlval->value.chval = (char) strtol (yytext+2, NULL, 16);
|
||||
zendlval->value.lval = strtol (yytext+2, NULL, 16);
|
||||
return T_CHARACTER;
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\". {
|
||||
switch (yytext[1]) {
|
||||
case 'n':
|
||||
zendlval->value.chval='\n';
|
||||
zendlval->value.lval = (long) '\n';
|
||||
break;
|
||||
case 't':
|
||||
zendlval->value.chval='\t';
|
||||
zendlval->value.lval = (long) '\t';
|
||||
break;
|
||||
case 'r':
|
||||
zendlval->value.chval='\r';
|
||||
zendlval->value.lval = (long) '\r';
|
||||
break;
|
||||
case '\\':
|
||||
zendlval->value.chval='\\';
|
||||
zendlval->value.lval = (long) '\\';
|
||||
break;
|
||||
case '$':
|
||||
zendlval->value.chval=yytext[1];
|
||||
zendlval->value.lval = (long) yytext[1];
|
||||
break;
|
||||
case '{':
|
||||
zendlval->value.chval=yytext[1];
|
||||
zendlval->value.lval = (long) yytext[1];
|
||||
break;
|
||||
default:
|
||||
zendlval->value.str.val = estrndup(yytext,yyleng);
|
||||
|
||||
+268
-51
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -19,8 +19,6 @@
|
||||
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_extensions.h"
|
||||
#include "modules.h"
|
||||
#include "zend_constants.h"
|
||||
@@ -38,21 +36,28 @@
|
||||
# define GLOBAL_CONSTANTS_TABLE CG(zend_constants)
|
||||
#endif
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
BOOL WINAPI IsDebuggerPresent(VOID);
|
||||
#endif
|
||||
|
||||
/* true multithread-shared globals */
|
||||
ZEND_API zend_class_entry zend_standard_class_def;
|
||||
ZEND_API int (*zend_printf)(const char *format, ...);
|
||||
ZEND_API int (*zend_write)(const char *str, uint str_length);
|
||||
ZEND_API void (*zend_error)(int type, const char *format, ...);
|
||||
ZEND_API void (*zend_message_dispatcher)(long message, void *data);
|
||||
ZEND_API zend_write_func_t zend_write;
|
||||
ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
|
||||
ZEND_API void (*zend_block_interruptions)(void);
|
||||
ZEND_API void (*zend_unblock_interruptions)(void);
|
||||
ZEND_API int (*zend_get_ini_entry)(char *name, uint name_length, zval *contents);
|
||||
ZEND_API void (*zend_ticks_function)(int ticks);
|
||||
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
|
||||
static void (*zend_message_dispatcher_p)(long message, void *data);
|
||||
static int (*zend_get_ini_entry_p)(char *name, uint name_length, zval *contents);
|
||||
|
||||
|
||||
#ifdef ZTS
|
||||
ZEND_API int compiler_globals_id;
|
||||
ZEND_API int executor_globals_id;
|
||||
int alloc_globals_id;
|
||||
ZEND_API int alloc_globals_id;
|
||||
HashTable *global_function_table;
|
||||
HashTable *global_class_table;
|
||||
HashTable *global_constants_table;
|
||||
@@ -60,13 +65,15 @@ HashTable *global_constants_table;
|
||||
|
||||
zend_utility_values zend_uv;
|
||||
|
||||
ZEND_API zval zval_used_for_init; /* True global variable */
|
||||
|
||||
/* version information */
|
||||
static char *zend_version_info;
|
||||
static uint zend_version_info_length;
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski\n"
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2000 Zend Technologies\n"
|
||||
|
||||
|
||||
#define PRINT_PVAL_INDENT 4
|
||||
#define PRINT_ZVAL_INDENT 4
|
||||
|
||||
static void print_hash(HashTable *ht, int indent)
|
||||
{
|
||||
@@ -79,7 +86,7 @@ static void print_hash(HashTable *ht, int indent)
|
||||
ZEND_PUTS(" ");
|
||||
}
|
||||
ZEND_PUTS("(\n");
|
||||
indent += PRINT_PVAL_INDENT;
|
||||
indent += PRINT_ZVAL_INDENT;
|
||||
zend_hash_internal_pointer_reset(ht);
|
||||
while (zend_hash_get_current_data(ht, (void **) &tmp) == SUCCESS) {
|
||||
for (i=0; i<indent; i++) {
|
||||
@@ -96,11 +103,11 @@ static void print_hash(HashTable *ht, int indent)
|
||||
break;
|
||||
}
|
||||
ZEND_PUTS("] => ");
|
||||
zend_print_zval_r(*tmp, indent+PRINT_PVAL_INDENT);
|
||||
zend_print_zval_r(*tmp, indent+PRINT_ZVAL_INDENT);
|
||||
ZEND_PUTS("\n");
|
||||
zend_hash_move_forward(ht);
|
||||
}
|
||||
indent -= PRINT_PVAL_INDENT;
|
||||
indent -= PRINT_ZVAL_INDENT;
|
||||
for (i=0; i<indent; i++) {
|
||||
ZEND_PUTS(" ");
|
||||
}
|
||||
@@ -115,8 +122,11 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
|
||||
return;
|
||||
}
|
||||
switch (expr->type) {
|
||||
case IS_NULL:
|
||||
expr_copy->value.str.len = 0;
|
||||
expr_copy->value.str.val = empty_string;
|
||||
break;
|
||||
case IS_BOOL:
|
||||
#if 1
|
||||
if (expr->value.lval) {
|
||||
expr_copy->value.str.len = 1;
|
||||
expr_copy->value.str.val = estrndup("1", 1);
|
||||
@@ -124,15 +134,6 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
|
||||
expr_copy->value.str.len = 0;
|
||||
expr_copy->value.str.val = empty_string;
|
||||
}
|
||||
#else
|
||||
if (expr->value.lval) {
|
||||
expr_copy->value.str.len = sizeof("true")-1;
|
||||
expr_copy->value.str.val = estrndup("true", expr_copy->value.str.len);
|
||||
} else {
|
||||
expr_copy->value.str.len = sizeof("false")-1;
|
||||
expr_copy->value.str.val = estrndup("false", expr_copy->value.str.len);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
expr_copy->value.str.val = (char *) emalloc(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG);
|
||||
@@ -144,10 +145,7 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
|
||||
break;
|
||||
case IS_OBJECT: {
|
||||
zval function_name;
|
||||
|
||||
function_name.value.str.len = sizeof("to_string")-1;
|
||||
function_name.value.str.val = estrndup("to_string", function_name.value.str.len);
|
||||
function_name.type = IS_STRING;
|
||||
ZVAL_STRING(&function_name,"__string_value",1);
|
||||
|
||||
if (call_user_function(NULL, expr, &function_name, expr_copy, 0, NULL)==FAILURE) {
|
||||
expr_copy->value.str.len = sizeof("Object")-1;
|
||||
@@ -168,6 +166,12 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
|
||||
|
||||
|
||||
ZEND_API int zend_print_zval(zval *expr, int indent)
|
||||
{
|
||||
return zend_print_zval_ex(zend_write, expr, indent);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent)
|
||||
{
|
||||
zval expr_copy;
|
||||
int use_copy;
|
||||
@@ -182,7 +186,7 @@ ZEND_API int zend_print_zval(zval *expr, int indent)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
ZEND_WRITE(expr->value.str.val,expr->value.str.len);
|
||||
write_func(expr->value.str.val,expr->value.str.len);
|
||||
if (use_copy) {
|
||||
zval_dtor(expr);
|
||||
}
|
||||
@@ -190,7 +194,13 @@ ZEND_API int zend_print_zval(zval *expr, int indent)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_print_zval_r(zval *expr, int indent)
|
||||
ZEND_API void zend_print_zval_r(zval *expr, int indent)
|
||||
{
|
||||
zend_print_zval_r_ex(zend_write, expr, indent);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent)
|
||||
{
|
||||
switch(expr->type) {
|
||||
case IS_ARRAY:
|
||||
@@ -213,7 +223,7 @@ static FILE *zend_fopen_wrapper(const char *filename, char **opened_path)
|
||||
if (opened_path) {
|
||||
*opened_path = strdup(filename);
|
||||
}
|
||||
return fopen(filename, "r");
|
||||
return fopen(filename, "rb");
|
||||
}
|
||||
|
||||
|
||||
@@ -223,7 +233,7 @@ static void register_standard_class(void)
|
||||
zend_standard_class_def.name_length = sizeof("stdClass") - 1;
|
||||
zend_standard_class_def.name = zend_strndup("stdClass", zend_standard_class_def.name_length);
|
||||
zend_standard_class_def.parent = NULL;
|
||||
zend_hash_init(&zend_standard_class_def.default_properties, 0, NULL, PVAL_PTR_DTOR, 1);
|
||||
zend_hash_init(&zend_standard_class_def.default_properties, 0, NULL, ZVAL_PTR_DTOR, 1);
|
||||
zend_hash_init(&zend_standard_class_def.function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1);
|
||||
zend_standard_class_def.handle_function_call = NULL;
|
||||
zend_standard_class_def.handle_property_get = NULL;
|
||||
@@ -234,6 +244,16 @@ static void register_standard_class(void)
|
||||
}
|
||||
|
||||
|
||||
static void zend_set_default_compile_time_values(CLS_D)
|
||||
{
|
||||
/* default compile-time values */
|
||||
CG(asp_tags) = 0;
|
||||
CG(short_tags) = 1;
|
||||
CG(allow_call_time_pass_reference) = 1;
|
||||
CG(extended_info) = 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ZTS
|
||||
static void compiler_globals_ctor(zend_compiler_globals *compiler_globals)
|
||||
{
|
||||
@@ -246,7 +266,9 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals)
|
||||
|
||||
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
|
||||
zend_hash_init(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1);
|
||||
zend_hash_copy(compiler_globals->class_table, global_class_table, zend_class_add_ref, &tmp_class, sizeof(zend_class_entry));
|
||||
zend_hash_copy(compiler_globals->class_table, global_class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry));
|
||||
|
||||
zend_set_default_compile_time_values(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
@@ -269,14 +291,15 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals)
|
||||
zend_startup_constants(ELS_C);
|
||||
zend_copy_constants(executor_globals->zend_constants, global_constants_table);
|
||||
}
|
||||
init_resource_plist(ELS_C);
|
||||
zend_init_rsrc_plist(ELS_C);
|
||||
EG(lambda_count)=0;
|
||||
}
|
||||
|
||||
|
||||
static void executor_globals_dtor(zend_executor_globals *executor_globals)
|
||||
{
|
||||
zend_shutdown_constants(ELS_C);
|
||||
destroy_resource_plist();
|
||||
zend_destroy_rsrc_plist(ELS_C);
|
||||
}
|
||||
|
||||
|
||||
@@ -287,8 +310,12 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/* FreeBSD floating point precision fix */
|
||||
#include <floatingpoint.h>
|
||||
#endif
|
||||
|
||||
int zend_startup(zend_utility_functions *utility_functions, char **extensions)
|
||||
int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions)
|
||||
{
|
||||
#ifdef ZTS
|
||||
zend_compiler_globals *compiler_globals;
|
||||
@@ -299,23 +326,39 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions)
|
||||
start_memory_manager(ALS_C);
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
{
|
||||
/* FreeBSD floating point precision fix */
|
||||
#ifdef HAVE_FP_EXCEPT
|
||||
fp_except
|
||||
#else
|
||||
fp_except_t
|
||||
#endif
|
||||
mask;
|
||||
|
||||
mask = fpgetmask();
|
||||
fpsetmask(mask & ~FP_X_IMP);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set up utility functions and values */
|
||||
zend_error = utility_functions->error_function;
|
||||
zend_error_cb = utility_functions->error_function;
|
||||
zend_printf = utility_functions->printf_function;
|
||||
zend_write = utility_functions->write_function;
|
||||
zend_write = (zend_write_func_t) utility_functions->write_function;
|
||||
zend_fopen = utility_functions->fopen_function;
|
||||
if (!zend_fopen) {
|
||||
zend_fopen = zend_fopen_wrapper;
|
||||
}
|
||||
zend_message_dispatcher = utility_functions->message_handler;
|
||||
zend_message_dispatcher_p = utility_functions->message_handler;
|
||||
zend_block_interruptions = utility_functions->block_interruptions;
|
||||
zend_unblock_interruptions = utility_functions->unblock_interruptions;
|
||||
zend_get_ini_entry = utility_functions->get_ini_entry;
|
||||
zend_get_ini_entry_p = utility_functions->get_ini_entry;
|
||||
zend_ticks_function = utility_functions->ticks_function;
|
||||
|
||||
zend_compile_files = compile_files;
|
||||
zend_v_compile_files = v_compile_files;
|
||||
zend_execute = execute;
|
||||
|
||||
zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1);
|
||||
zend_startup_extensions();
|
||||
|
||||
/* set up version */
|
||||
zend_version_info = strdup(ZEND_CORE_VERSION_INFO);
|
||||
@@ -327,7 +370,12 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions)
|
||||
zend_hash_init(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1);
|
||||
register_standard_class();
|
||||
zend_hash_init(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1);
|
||||
zend_hash_init(&list_destructors, 50, NULL, NULL, 1);
|
||||
zend_init_rsrc_list_dtors();
|
||||
|
||||
/* This zval can be used to initialize allocate zval's to an uninit'ed value */
|
||||
zval_used_for_init.is_ref = 0;
|
||||
zval_used_for_init.refcount = 1;
|
||||
zval_used_for_init.type = IS_NULL;
|
||||
|
||||
#ifdef ZTS
|
||||
global_constants_table = NULL;
|
||||
@@ -342,14 +390,17 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions)
|
||||
GLOBAL_CONSTANTS_TABLE = EG(zend_constants);
|
||||
#else
|
||||
zend_startup_constants();
|
||||
zend_set_default_compile_time_values(CLS_C);
|
||||
#endif
|
||||
zend_register_standard_constants(ELS_C);
|
||||
|
||||
#ifndef ZTS
|
||||
init_resource_plist(ELS_C);
|
||||
zend_init_rsrc_plist(ELS_C);
|
||||
#endif
|
||||
|
||||
zend_startup_builtin_functions();
|
||||
if (start_builtin_functions) {
|
||||
zend_startup_builtin_functions();
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -357,10 +408,13 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions)
|
||||
|
||||
void zend_shutdown()
|
||||
{
|
||||
#ifndef ZTS
|
||||
destroy_resource_plist();
|
||||
#ifdef ZEND_WIN32
|
||||
zend_shutdown_timeout_thread();
|
||||
#endif
|
||||
zend_hash_destroy(&list_destructors);
|
||||
#ifndef ZTS
|
||||
zend_destroy_rsrc_plist();
|
||||
#endif
|
||||
zend_destroy_rsrc_list_dtors();
|
||||
zend_hash_destroy(&module_registry);
|
||||
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
|
||||
free(GLOBAL_FUNCTION_TABLE);
|
||||
@@ -369,7 +423,7 @@ void zend_shutdown()
|
||||
zend_shutdown_extensions();
|
||||
free(zend_version_info);
|
||||
#ifndef ZTS
|
||||
zend_shutdown_constants(ELS_C);
|
||||
zend_shutdown_constants();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -435,10 +489,173 @@ void zend_activate(CLS_D ELS_DC)
|
||||
startup_scanner(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
void zend_activate_modules()
|
||||
{
|
||||
zend_hash_apply(&module_registry, (int (*)(void *)) module_registry_request_startup);
|
||||
}
|
||||
|
||||
void zend_deactivate_modules()
|
||||
{
|
||||
ELS_FETCH();
|
||||
EG(opline_ptr) = NULL; /* we're no longer executing anything */
|
||||
|
||||
zend_hash_apply(&module_registry, (int (*)(void *)) module_registry_cleanup);
|
||||
}
|
||||
|
||||
void zend_deactivate(CLS_D ELS_DC)
|
||||
{
|
||||
zend_hash_apply(&module_registry, (int (*)(void *)) module_registry_cleanup);
|
||||
EG(opline_ptr) = NULL; /* we're no longer executing anything */
|
||||
|
||||
shutdown_scanner(CLS_C);
|
||||
shutdown_executor(ELS_C);
|
||||
shutdown_compiler(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API void zend_message_dispatcher(long message, void *data)
|
||||
{
|
||||
if (zend_message_dispatcher_p) {
|
||||
zend_message_dispatcher_p(message, data);
|
||||
}
|
||||
}
|
||||
END_EXTERN_C()
|
||||
|
||||
|
||||
ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents)
|
||||
{
|
||||
if (zend_get_ini_entry_p) {
|
||||
return zend_get_ini_entry_p(name, name_length, contents);
|
||||
} else {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define ZEND_ERROR_BUFFER_SIZE 1024
|
||||
|
||||
ZEND_API void zend_error(int type, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
zval ***params;
|
||||
zval *retval;
|
||||
zval *error_type, *error_message;
|
||||
char *error_filename;
|
||||
uint error_lineno;
|
||||
ELS_FETCH();
|
||||
CLS_FETCH();
|
||||
|
||||
/* Obtain relevant filename and lineno */
|
||||
switch (type) {
|
||||
case E_CORE_ERROR:
|
||||
case E_CORE_WARNING:
|
||||
error_filename = NULL;
|
||||
error_lineno = 0;
|
||||
break;
|
||||
case E_PARSE:
|
||||
case E_COMPILE_ERROR:
|
||||
case E_COMPILE_WARNING:
|
||||
case E_ERROR:
|
||||
case E_NOTICE:
|
||||
case E_WARNING:
|
||||
case E_USER_ERROR:
|
||||
case E_USER_WARNING:
|
||||
case E_USER_NOTICE:
|
||||
if (zend_is_compiling()) {
|
||||
error_filename = zend_get_compiled_filename(CLS_C);
|
||||
error_lineno = zend_get_compiled_lineno(CLS_C);
|
||||
} else if (zend_is_executing()) {
|
||||
error_filename = zend_get_executed_filename(ELS_C);
|
||||
error_lineno = zend_get_executed_lineno(ELS_C);
|
||||
} else {
|
||||
error_filename = NULL;
|
||||
error_lineno = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error_filename = NULL;
|
||||
error_lineno = 0;
|
||||
break;
|
||||
}
|
||||
if (!error_filename) {
|
||||
error_filename = "Unknown";
|
||||
}
|
||||
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
/* if we don't have a user defined error handler */
|
||||
if (!EG(user_error_handler)) {
|
||||
zend_error_cb(type, error_filename, error_lineno, format, args);
|
||||
} else switch (type) {
|
||||
case E_ERROR:
|
||||
case E_PARSE:
|
||||
case E_CORE_ERROR:
|
||||
case E_CORE_WARNING:
|
||||
case E_COMPILE_ERROR:
|
||||
case E_COMPILE_WARNING:
|
||||
/* The error may not be safe to handle in user-space */
|
||||
zend_error_cb(type, error_filename, error_lineno, format, args);
|
||||
break;
|
||||
default:
|
||||
/* Handle the error in user space */
|
||||
ALLOC_INIT_ZVAL(error_message);
|
||||
ALLOC_INIT_ZVAL(error_type);
|
||||
error_message->value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE);
|
||||
|
||||
#ifdef HAVE_VSNPRINTF
|
||||
error_message->value.str.len = vsnprintf(error_message->value.str.val, ZEND_ERROR_BUFFER_SIZE, format, args);
|
||||
#else
|
||||
/* This is risky... */
|
||||
error_message->value.str.len = vsprintf(error_message->value.str.val, format, args);
|
||||
#endif
|
||||
error_message->type = IS_STRING;
|
||||
|
||||
error_type->value.lval = type;
|
||||
error_type->type = IS_LONG;
|
||||
|
||||
params = (zval ***) emalloc(sizeof(zval **)*2);
|
||||
params[0] = &error_type;
|
||||
params[1] = &error_message;
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, EG(user_error_handler), &retval, 2, params, 1, NULL)==SUCCESS) {
|
||||
zval_ptr_dtor(&retval);
|
||||
} else {
|
||||
/* The user error handler failed, use built-in error handler */
|
||||
zend_error_cb(type, error_filename, error_lineno, format, args);
|
||||
}
|
||||
efree(params);
|
||||
zval_ptr_dtor(&error_message);
|
||||
zval_ptr_dtor(&error_type);
|
||||
break;
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...)
|
||||
{
|
||||
#if ZEND_DEBUG
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
# ifdef ZEND_WIN32
|
||||
{
|
||||
char output_buf[1024];
|
||||
|
||||
vsnprintf(output_buf, 1024, format, args);
|
||||
OutputDebugString(output_buf);
|
||||
OutputDebugString("\n");
|
||||
if (trigger_break && IsDebuggerPresent()) {
|
||||
DebugBreak();
|
||||
}
|
||||
}
|
||||
# else
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
# endif
|
||||
va_end(args);
|
||||
#endif
|
||||
}
|
||||
+167
-40
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef _ZEND_H
|
||||
#define _ZEND_H
|
||||
|
||||
#define ZEND_VERSION "0.90"
|
||||
#define ZEND_VERSION "1.00"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_EXTERN_C() extern "C" {
|
||||
@@ -37,7 +37,7 @@
|
||||
* general definitions
|
||||
*/
|
||||
|
||||
#if (defined(WINNT) && WINNT) || (defined(WIN32) && WIN32)
|
||||
#ifdef ZEND_WIN32
|
||||
# include "zend_config.w32.h"
|
||||
#else
|
||||
# include "zend_config.h"
|
||||
@@ -53,6 +53,48 @@
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DLFCN_H
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBDL)
|
||||
|
||||
# ifndef RTLD_LAZY
|
||||
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
|
||||
# endif
|
||||
|
||||
# ifndef RTLD_GLOBAL
|
||||
# define RTLD_GLOBAL 0
|
||||
# endif
|
||||
|
||||
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
|
||||
# define DL_UNLOAD dlclose
|
||||
# define DL_FETCH_SYMBOL dlsym
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#elif defined(ZEND_WIN32)
|
||||
# define DL_LOAD(libname) LoadLibrary(libname)
|
||||
# define DL_FETCH_SYMBOL GetProcAddress
|
||||
# define DL_UNLOAD FreeLibrary
|
||||
# define DL_HANDLE HMODULE
|
||||
# define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#else
|
||||
# define DL_HANDLE void *
|
||||
# define ZEND_EXTENSIONS_SUPPORT 0
|
||||
#endif
|
||||
|
||||
#if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
#endif
|
||||
|
||||
#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32))
|
||||
# define do_alloca(p) alloca(p)
|
||||
# define free_alloca(p)
|
||||
#else
|
||||
# define do_alloca(p) emalloc(p)
|
||||
# define free_alloca(p) efree(p)
|
||||
#endif
|
||||
|
||||
#if ZEND_DEBUG
|
||||
#define ZEND_FILE_LINE_D char *__zend_filename, uint __zend_lineno
|
||||
#define ZEND_FILE_LINE_DC , ZEND_FILE_LINE_D
|
||||
@@ -86,6 +128,9 @@
|
||||
#include "zend_alloc.h"
|
||||
|
||||
typedef unsigned char zend_bool;
|
||||
typedef unsigned char zend_uchar;
|
||||
typedef unsigned int zend_uint;
|
||||
typedef unsigned short zend_ushort;
|
||||
|
||||
#undef SUCCESS
|
||||
#undef FAILURE
|
||||
@@ -96,8 +141,8 @@ typedef unsigned char zend_bool;
|
||||
#include "zend_hash.h"
|
||||
#include "zend_llist.h"
|
||||
|
||||
#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, HashTable *list, HashTable *plist, zval *this_ptr, int return_value_used
|
||||
#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, list, plist, this_ptr, return_value_used
|
||||
#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, zval *this_ptr, int return_value_used ELS_DC
|
||||
#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, this_ptr, return_value_used ELS_CC
|
||||
|
||||
/*
|
||||
* zval
|
||||
@@ -112,7 +157,6 @@ typedef union _zvalue_value {
|
||||
char *val;
|
||||
int len;
|
||||
} str;
|
||||
char chval; /* char value */
|
||||
HashTable *ht; /* hash table value */
|
||||
struct {
|
||||
zend_class_entry *ce;
|
||||
@@ -124,9 +168,9 @@ typedef union _zvalue_value {
|
||||
struct _zval_struct {
|
||||
/* Variable information */
|
||||
zvalue_value value; /* value */
|
||||
unsigned char type; /* active type */
|
||||
unsigned char is_ref;
|
||||
short refcount;
|
||||
zend_uchar type; /* active type */
|
||||
zend_uchar is_ref;
|
||||
zend_ushort refcount;
|
||||
};
|
||||
|
||||
|
||||
@@ -141,7 +185,7 @@ typedef struct _zend_function_entry {
|
||||
typedef struct _zend_property_reference {
|
||||
int type; /* read, write or r/w */
|
||||
zval *object;
|
||||
zend_llist elements_list;
|
||||
zend_llist *elements_list;
|
||||
} zend_property_reference;
|
||||
|
||||
|
||||
@@ -175,7 +219,7 @@ struct _zend_class_entry {
|
||||
|
||||
|
||||
typedef struct _zend_utility_functions {
|
||||
void (*error_function)(int type, const char *format, ...);
|
||||
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
int (*printf_function)(const char *format, ...);
|
||||
int (*write_function)(const char *str, uint str_length);
|
||||
FILE *(*fopen_function)(const char *filename, char **opened_path);
|
||||
@@ -183,35 +227,57 @@ typedef struct _zend_utility_functions {
|
||||
void (*block_interruptions)(void);
|
||||
void (*unblock_interruptions)(void);
|
||||
int (*get_ini_entry)(char *name, uint name_length, zval *contents);
|
||||
void (*ticks_function)(int ticks);
|
||||
} zend_utility_functions;
|
||||
|
||||
|
||||
typedef struct _zend_utility_values {
|
||||
unsigned char short_tags;
|
||||
unsigned char asp_tags;
|
||||
char *import_use_extension;
|
||||
uint import_use_extension_length;
|
||||
} zend_utility_values;
|
||||
|
||||
|
||||
typedef int (*zend_write_func_t)(const char *str, uint str_length);
|
||||
|
||||
|
||||
#undef MIN
|
||||
#undef MAX
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#define ZEND_STRL(str) (str), (sizeof(str)-1)
|
||||
#define ZEND_STRS(str) (str), (sizeof(str)
|
||||
#define ZEND_NORMALIZE_BOOL(n) \
|
||||
((n) ? (((n)>0) ? 1 : -1) : 0)
|
||||
|
||||
|
||||
/* data types */
|
||||
#define IS_NULL 0
|
||||
#define IS_LONG 1
|
||||
#define IS_DOUBLE 2
|
||||
#define IS_STRING 3
|
||||
#define IS_ARRAY 4
|
||||
#define IS_OBJECT 5
|
||||
#define IS_BC 6 /* for parser internal use only */
|
||||
#define IS_BOOL 7
|
||||
#define IS_RESOURCE 8
|
||||
#define IS_CONSTANT 9
|
||||
#define IS_METHOD 10 /* for overloaded function calls */
|
||||
#define IS_BOOL 6
|
||||
#define IS_RESOURCE 7
|
||||
#define IS_CONSTANT 8
|
||||
#define IS_CONSTANT_ARRAY 9
|
||||
|
||||
int zend_startup(zend_utility_functions *utility_functions, char **extensions);
|
||||
/* Special data type to temporarily mark large numbers */
|
||||
#define FLAG_IS_BC 10 /* for parser internal use only */
|
||||
|
||||
/* overloaded elements data types */
|
||||
#define OE_IS_ARRAY (1<<0)
|
||||
#define OE_IS_OBJECT (1<<1)
|
||||
#define OE_IS_METHOD (1<<2)
|
||||
|
||||
|
||||
/* Argument passing types */
|
||||
#define BYREF_NONE 0
|
||||
#define BYREF_FORCE 1
|
||||
#define BYREF_ALLOW 2
|
||||
#define BYREF_FORCE_REST 3
|
||||
|
||||
int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions);
|
||||
void zend_shutdown(void);
|
||||
|
||||
void zend_set_utility_values(zend_utility_values *utility_values);
|
||||
@@ -222,33 +288,54 @@ ZEND_API char *get_zend_version(void);
|
||||
|
||||
ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy);
|
||||
ZEND_API int zend_print_zval(zval *expr, int indent);
|
||||
ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent);
|
||||
ZEND_API void zend_print_zval_r(zval *expr, int indent);
|
||||
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent);
|
||||
|
||||
ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ...);
|
||||
#if ZEND_DEBUG
|
||||
#define Z_DBG(expr) (expr)
|
||||
#else
|
||||
#define Z_DBG(expr)
|
||||
#endif
|
||||
|
||||
ZEND_API extern char *empty_string;
|
||||
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); }
|
||||
#define STR_FREE(ptr) if (ptr && ptr!=empty_string) { efree(ptr); }
|
||||
#define STR_FREE_REL(ptr) if (ptr && ptr!=empty_string) { efree_rel(ptr); }
|
||||
|
||||
#define STR_REALLOC(ptr, size) \
|
||||
if (ptr!=empty_string) { \
|
||||
ptr = (char *) erealloc(ptr, size); \
|
||||
} else { \
|
||||
ptr = (char *) emalloc(size); \
|
||||
memset(ptr, 0, size); \
|
||||
}
|
||||
|
||||
/* output support */
|
||||
#define ZEND_WRITE(str, str_len) zend_write((str), (str_len))
|
||||
#define ZEND_PUTS(str) zend_write((str), strlen((str)))
|
||||
#define ZEND_PUTC(c) zend_write(&(c), 1), (c)
|
||||
|
||||
|
||||
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 ZEND_API zend_write_func_t zend_write;
|
||||
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
|
||||
extern ZEND_API void (*zend_block_interruptions)(void);
|
||||
extern ZEND_API void (*zend_unblock_interruptions)(void);
|
||||
extern ZEND_API void (*zend_message_dispatcher)(long message, void *data);
|
||||
extern ZEND_API int (*zend_get_ini_entry)(char *name, uint name_length, zval *contents);
|
||||
|
||||
extern ZEND_API void (*zend_ticks_function)(int ticks);
|
||||
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
|
||||
|
||||
ZEND_API void zend_error(int type, const char *format, ...);
|
||||
|
||||
void zenderror(char *error);
|
||||
|
||||
extern ZEND_API zend_class_entry zend_standard_class_def;
|
||||
extern zend_utility_values zend_uv;
|
||||
extern ZEND_API zval zval_used_for_init;
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZEND_UV(name) (zend_uv.name)
|
||||
@@ -257,39 +344,79 @@ END_EXTERN_C()
|
||||
#define HANDLE_BLOCK_INTERRUPTIONS() if (zend_block_interruptions) { zend_block_interruptions(); }
|
||||
#define HANDLE_UNBLOCK_INTERRUPTIONS() if (zend_unblock_interruptions) { zend_unblock_interruptions(); }
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API void zend_message_dispatcher(long message, void *data);
|
||||
END_EXTERN_C()
|
||||
|
||||
ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
|
||||
|
||||
/* Messages for applications of Zend */
|
||||
#define ZMSG_ENABLE_TRACK_VARS 1L
|
||||
#define ZMSG_FAILED_INCLUDE_FOPEN 2L
|
||||
#define ZMSG_FAILED_REQUIRE_FOPEN 3L
|
||||
#define ZMSG_FAILED_HIGHLIGHT_FOPEN 4L
|
||||
#define ZMSG_MEMORY_LEAK_DETECTED 5L
|
||||
#define ZMSG_MEMORY_LEAK_REPEATED 6L
|
||||
#define ZMSG_LOG_SCRIPT_NAME 7L
|
||||
#define ZMSG_FAILED_INCLUDE_FOPEN 1L
|
||||
#define ZMSG_FAILED_REQUIRE_FOPEN 2L
|
||||
#define ZMSG_FAILED_HIGHLIGHT_FOPEN 3L
|
||||
#define ZMSG_MEMORY_LEAK_DETECTED 4L
|
||||
#define ZMSG_MEMORY_LEAK_REPEATED 5L
|
||||
#define ZMSG_LOG_SCRIPT_NAME 6L
|
||||
|
||||
#define INIT_PZVAL(z) \
|
||||
(z)->refcount = 1; \
|
||||
(z)->is_ref = 0;
|
||||
|
||||
#define INIT_ZVAL(z) z = zval_used_for_init;
|
||||
|
||||
#define ALLOC_INIT_ZVAL(zp) \
|
||||
ALLOC_ZVAL(zp); \
|
||||
INIT_ZVAL(*zp);
|
||||
|
||||
#define MAKE_STD_ZVAL(zv) \
|
||||
zv = (zval *) emalloc(sizeof(zval)); \
|
||||
ALLOC_ZVAL(zv); \
|
||||
INIT_PZVAL(zv);
|
||||
|
||||
#define PZVAL_IS_REF(z) ((z)->is_ref)
|
||||
|
||||
#define SEPARATE_ZVAL(ppzv) \
|
||||
{ \
|
||||
zval *orig_ptr = *(ppzv); \
|
||||
\
|
||||
if (orig_ptr->refcount>1) { \
|
||||
orig_ptr->refcount--; \
|
||||
*(ppzv) = (zval *) emalloc(sizeof(zval)); \
|
||||
ALLOC_ZVAL(*(ppzv)); \
|
||||
**(ppzv) = *orig_ptr; \
|
||||
zval_copy_ctor(*(ppzv)); \
|
||||
(*(ppzv))->refcount=1; \
|
||||
(*(ppzv))->is_ref = 0; \
|
||||
(*(ppzv))->is_ref = 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define ZEND_MAX_RESERVED_RESOURCES 1
|
||||
#define SEPARATE_ZVAL_IF_NOT_REF(ppzv) \
|
||||
if (!PZVAL_IS_REF(*ppzv)) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
}
|
||||
|
||||
|
||||
#define COPY_PZVAL_TO_ZVAL(zv, pzv) \
|
||||
(zv) = *(pzv); \
|
||||
if ((pzv)->refcount>1) { \
|
||||
zval_copy_ctor(&(zv)); \
|
||||
(pzv)->refcount--; \
|
||||
} else { \
|
||||
FREE_ZVAL(pzv); \
|
||||
} \
|
||||
INIT_PZVAL(&(zv));
|
||||
|
||||
#define ZEND_MAX_RESERVED_RESOURCES 2
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
/* Only use this macro if you know for sure that all of the switches values
|
||||
are covered by its case statements */
|
||||
#define EMPTY_SWITCH_DEFAULT_CASE() \
|
||||
default: \
|
||||
__assume(0); \
|
||||
break;
|
||||
#else
|
||||
#define EMPTY_SWITCH_DEFAULT_CASE()
|
||||
#endif
|
||||
|
||||
#endif /* _ZEND_H */
|
||||
|
||||
|
||||
+242
-115
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -19,23 +19,21 @@
|
||||
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_execute.h"
|
||||
#include "zend_API.h"
|
||||
#include "modules.h"
|
||||
#include "zend_constants.h"
|
||||
#include "zend_operators.h"
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
/* these variables are true statics/globals, and have to be mutex'ed on every access */
|
||||
static int module_count=0;
|
||||
HashTable list_destructors, module_registry;
|
||||
HashTable module_registry;
|
||||
|
||||
/* this function doesn't check for too many parameters */
|
||||
ZEND_API int getParameters(int ht, int param_count,...)
|
||||
ZEND_API int zend_get_parameters(int ht, int param_count, ...)
|
||||
{
|
||||
void **p;
|
||||
int arg_count;
|
||||
@@ -43,7 +41,7 @@ ZEND_API int getParameters(int ht, int param_count,...)
|
||||
zval **param, *param_ptr;
|
||||
ELS_FETCH();
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
p = EG(argument_stack).top_element-2;
|
||||
arg_count = (ulong) *p;
|
||||
|
||||
if (param_count>arg_count) {
|
||||
@@ -52,22 +50,22 @@ ZEND_API int getParameters(int ht, int param_count,...)
|
||||
|
||||
va_start(ptr, param_count);
|
||||
|
||||
while (param_count>0) {
|
||||
while (param_count-->0) {
|
||||
param = va_arg(ptr, zval **);
|
||||
param_ptr = *(p-param_count);
|
||||
param_ptr = *(p-arg_count);
|
||||
if (!PZVAL_IS_REF(param_ptr) && param_ptr->refcount>1) {
|
||||
zval *new_tmp;
|
||||
|
||||
new_tmp = (zval *) emalloc(sizeof(zval));
|
||||
ALLOC_ZVAL(new_tmp);
|
||||
*new_tmp = *param_ptr;
|
||||
zval_copy_ctor(new_tmp);
|
||||
INIT_PZVAL(new_tmp);
|
||||
param_ptr = new_tmp;
|
||||
((zval *) *(p-param_count))->refcount--;
|
||||
*(p-param_count) = param_ptr;
|
||||
((zval *) *(p-arg_count))->refcount--;
|
||||
*(p-arg_count) = param_ptr;
|
||||
}
|
||||
*param = param_ptr;
|
||||
param_count--;
|
||||
arg_count--;
|
||||
}
|
||||
va_end(ptr);
|
||||
|
||||
@@ -75,36 +73,35 @@ ZEND_API int getParameters(int ht, int param_count,...)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int getParametersArray(int ht, int param_count, zval **argument_array)
|
||||
ZEND_API int zend_get_parameters_array(int ht, int param_count, zval **argument_array)
|
||||
{
|
||||
void **p;
|
||||
int arg_count;
|
||||
zval *param_ptr;
|
||||
ELS_FETCH();
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
p = EG(argument_stack).top_element-2;
|
||||
arg_count = (ulong) *p;
|
||||
|
||||
if (param_count>arg_count) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
while (param_count>0) {
|
||||
param_ptr = *(p-param_count);
|
||||
while (param_count-->0) {
|
||||
param_ptr = *(p-arg_count);
|
||||
if (!PZVAL_IS_REF(param_ptr) && param_ptr->refcount>1) {
|
||||
zval *new_tmp;
|
||||
|
||||
new_tmp = (zval *) emalloc(sizeof(zval));
|
||||
ALLOC_ZVAL(new_tmp);
|
||||
*new_tmp = *param_ptr;
|
||||
zval_copy_ctor(new_tmp);
|
||||
INIT_PZVAL(new_tmp);
|
||||
param_ptr = new_tmp;
|
||||
((zval *) *(p-param_count))->refcount--;
|
||||
*(p-param_count) = param_ptr;
|
||||
((zval *) *(p-arg_count))->refcount--;
|
||||
*(p-arg_count) = param_ptr;
|
||||
}
|
||||
*(argument_array++) = param_ptr;
|
||||
param_count--;
|
||||
arg_count--;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
@@ -115,7 +112,7 @@ ZEND_API int getParametersArray(int ht, int param_count, zval **argument_array)
|
||||
|
||||
/* Zend-optimized Extended functions */
|
||||
/* this function doesn't check for too many parameters */
|
||||
ZEND_API int getParametersEx(int param_count,...)
|
||||
ZEND_API int zend_get_parameters_ex(int param_count, ...)
|
||||
{
|
||||
void **p;
|
||||
int arg_count;
|
||||
@@ -123,7 +120,7 @@ ZEND_API int getParametersEx(int param_count,...)
|
||||
zval ***param;
|
||||
ELS_FETCH();
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
p = EG(argument_stack).top_element-2;
|
||||
arg_count = (ulong) *p;
|
||||
|
||||
if (param_count>arg_count) {
|
||||
@@ -131,9 +128,9 @@ ZEND_API int getParametersEx(int param_count,...)
|
||||
}
|
||||
|
||||
va_start(ptr, param_count);
|
||||
while (param_count>0) {
|
||||
while (param_count-->0) {
|
||||
param = va_arg(ptr, zval ***);
|
||||
*param = (zval **) p-(param_count--);
|
||||
*param = (zval **) p-(arg_count--);
|
||||
}
|
||||
va_end(ptr);
|
||||
|
||||
@@ -141,21 +138,21 @@ ZEND_API int getParametersEx(int param_count,...)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int getParametersArrayEx(int param_count, zval ***argument_array)
|
||||
ZEND_API int zend_get_parameters_array_ex(int param_count, zval ***argument_array)
|
||||
{
|
||||
void **p;
|
||||
int arg_count;
|
||||
ELS_FETCH();
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
p = EG(argument_stack).top_element-2;
|
||||
arg_count = (ulong) *p;
|
||||
|
||||
if (param_count>arg_count) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
while (param_count>0) {
|
||||
*(argument_array++) = (zval **) p-(param_count--);
|
||||
while (param_count-->0) {
|
||||
*(argument_array++) = (zval **) p-(arg_count--);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
@@ -169,7 +166,7 @@ ZEND_API int ParameterPassedByReference(int ht, uint n)
|
||||
zval *arg;
|
||||
ELS_FETCH();
|
||||
|
||||
p = EG(argument_stack).elements+EG(argument_stack).top-1;
|
||||
p = EG(argument_stack).elements+EG(argument_stack).top-2;
|
||||
arg_count = (ulong) *p;
|
||||
|
||||
if (n>arg_count) {
|
||||
@@ -186,11 +183,12 @@ ZEND_API void wrong_param_count()
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int array_init(zval *arg)
|
||||
ZEND_API inline int _array_init(zval *arg ZEND_FILE_LINE_DC)
|
||||
{
|
||||
arg->value.ht = (HashTable *) emalloc(sizeof(HashTable));
|
||||
if (!arg->value.ht || zend_hash_init(arg->value.ht, 0, NULL, PVAL_PTR_DTOR, 0)) {
|
||||
zend_error(E_CORE_ERROR, "Cannot allocate memory for array");
|
||||
ALLOC_HASHTABLE_REL(arg->value.ht);
|
||||
|
||||
if (!arg->value.ht || zend_hash_init(arg->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0)) {
|
||||
zend_error(E_ERROR, "Cannot allocate memory for array");
|
||||
return FAILURE;
|
||||
}
|
||||
arg->type = IS_ARRAY;
|
||||
@@ -198,26 +196,27 @@ ZEND_API inline int array_init(zval *arg)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int object_init_ex(zval *arg, zend_class_entry *class_type)
|
||||
ZEND_API inline int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC)
|
||||
{
|
||||
zval *tmp;
|
||||
|
||||
if (!class_type->constants_updated) {
|
||||
zend_hash_apply(&class_type->default_properties, (int (*)(void *)) zval_update_constant);
|
||||
zend_hash_apply_with_argument(&class_type->default_properties, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
|
||||
class_type->constants_updated = 1;
|
||||
}
|
||||
arg->value.obj.properties = (HashTable *) emalloc(sizeof(HashTable));
|
||||
zend_hash_init(arg->value.obj.properties, 0, NULL, PVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(arg->value.obj.properties, &class_type->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
ALLOC_HASHTABLE_REL(arg->value.obj.properties);
|
||||
zend_hash_init(arg->value.obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(arg->value.obj.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
arg->type = IS_OBJECT;
|
||||
arg->value.obj.ce = class_type;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int object_init(zval *arg)
|
||||
ZEND_API inline int _object_init(zval *arg ZEND_FILE_LINE_DC)
|
||||
{
|
||||
return object_init_ex(arg, &zend_standard_class_def);
|
||||
return _object_init_ex(arg, &zend_standard_class_def ZEND_FILE_LINE_CC);
|
||||
}
|
||||
|
||||
|
||||
@@ -230,8 +229,9 @@ ZEND_API inline int add_assoc_function(zval *arg, char *key,void (*function_ptr)
|
||||
|
||||
ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_LONG;
|
||||
tmp->value.lval = n;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -239,10 +239,21 @@ ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_assoc_unset(zval *arg, char *key)
|
||||
{
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_NULL;
|
||||
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_bool(zval *arg, char *key, int b)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_BOOL;
|
||||
tmp->value.lval = b;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -252,8 +263,9 @@ ZEND_API inline int add_assoc_bool(zval *arg, char *key, int b)
|
||||
|
||||
ZEND_API inline int add_assoc_resource(zval *arg, char *key, int r)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_RESOURCE;
|
||||
tmp->value.lval = r;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -263,8 +275,9 @@ ZEND_API inline int add_assoc_resource(zval *arg, char *key, int r)
|
||||
|
||||
ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_DOUBLE;
|
||||
tmp->value.dval = d;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -274,8 +287,9 @@ ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
|
||||
|
||||
ZEND_API inline int add_assoc_string(zval *arg, char *key, char *str, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = strlen(str);
|
||||
if (duplicate) {
|
||||
@@ -290,8 +304,9 @@ ZEND_API inline int add_assoc_string(zval *arg, char *key, char *str, int duplic
|
||||
|
||||
ZEND_API inline int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = length;
|
||||
if (duplicate) {
|
||||
@@ -306,8 +321,9 @@ ZEND_API inline int add_assoc_stringl(zval *arg, char *key, char *str, uint leng
|
||||
|
||||
ZEND_API inline int add_index_long(zval *arg, uint index, long n)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_LONG;
|
||||
tmp->value.lval = n;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -315,10 +331,22 @@ ZEND_API inline int add_index_long(zval *arg, uint index, long n)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_index_unset(zval *arg, uint index)
|
||||
{
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_NULL;
|
||||
INIT_PZVAL(tmp);
|
||||
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_index_bool(zval *arg, uint index, int b)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_BOOL;
|
||||
tmp->value.lval = b;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -328,8 +356,9 @@ ZEND_API inline int add_index_bool(zval *arg, uint index, int b)
|
||||
|
||||
ZEND_API inline int add_index_resource(zval *arg, uint index, int r)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_RESOURCE;
|
||||
tmp->value.lval = r;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -339,8 +368,9 @@ ZEND_API inline int add_index_resource(zval *arg, uint index, int r)
|
||||
|
||||
ZEND_API inline int add_index_double(zval *arg, uint index, double d)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_DOUBLE;
|
||||
tmp->value.dval = d;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -350,8 +380,9 @@ ZEND_API inline int add_index_double(zval *arg, uint index, double d)
|
||||
|
||||
ZEND_API inline int add_index_string(zval *arg, uint index, char *str, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = strlen(str);
|
||||
if (duplicate) {
|
||||
@@ -366,8 +397,9 @@ ZEND_API inline int add_index_string(zval *arg, uint index, char *str, int dupli
|
||||
|
||||
ZEND_API inline int add_index_stringl(zval *arg, uint index, char *str, uint length, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = length;
|
||||
if (duplicate) {
|
||||
@@ -382,8 +414,9 @@ ZEND_API inline int add_index_stringl(zval *arg, uint index, char *str, uint len
|
||||
|
||||
ZEND_API inline int add_next_index_long(zval *arg, long n)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_LONG;
|
||||
tmp->value.lval = n;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -391,10 +424,22 @@ ZEND_API inline int add_next_index_long(zval *arg, long n)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_next_index_unset(zval *arg)
|
||||
{
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_NULL;
|
||||
INIT_PZVAL(tmp);
|
||||
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int add_next_index_bool(zval *arg, int b)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_BOOL;
|
||||
tmp->value.lval = b;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -404,8 +449,9 @@ ZEND_API inline int add_next_index_bool(zval *arg, int b)
|
||||
|
||||
ZEND_API inline int add_next_index_resource(zval *arg, int r)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_RESOURCE;
|
||||
tmp->value.lval = r;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -415,8 +461,9 @@ ZEND_API inline int add_next_index_resource(zval *arg, int r)
|
||||
|
||||
ZEND_API inline int add_next_index_double(zval *arg, double d)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_DOUBLE;
|
||||
tmp->value.dval = d;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -426,8 +473,9 @@ ZEND_API inline int add_next_index_double(zval *arg, double d)
|
||||
|
||||
ZEND_API inline int add_next_index_string(zval *arg, char *str, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = strlen(str);
|
||||
if (duplicate) {
|
||||
@@ -442,8 +490,9 @@ ZEND_API inline int add_next_index_string(zval *arg, char *str, int duplicate)
|
||||
|
||||
ZEND_API inline int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = length;
|
||||
if (duplicate) {
|
||||
@@ -458,8 +507,9 @@ ZEND_API inline int add_next_index_stringl(zval *arg, char *str, uint length, in
|
||||
|
||||
ZEND_API inline int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = strlen(str);
|
||||
if (duplicate) {
|
||||
@@ -474,8 +524,9 @@ ZEND_API inline int add_get_assoc_string(zval *arg, char *key, char *str, void *
|
||||
|
||||
ZEND_API inline int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = length;
|
||||
if (duplicate) {
|
||||
@@ -490,8 +541,9 @@ ZEND_API inline int add_get_assoc_stringl(zval *arg, char *key, char *str, uint
|
||||
|
||||
ZEND_API inline int add_get_index_long(zval *arg, uint index, long l, void **dest)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_LONG;
|
||||
tmp->value.lval = l;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -501,8 +553,9 @@ ZEND_API inline int add_get_index_long(zval *arg, uint index, long l, void **des
|
||||
|
||||
ZEND_API inline int add_get_index_double(zval *arg, uint index, double d, void **dest)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_DOUBLE;
|
||||
tmp->value.dval= d;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -512,8 +565,9 @@ ZEND_API inline int add_get_index_double(zval *arg, uint index, double d, void *
|
||||
|
||||
ZEND_API inline int add_get_index_string(zval *arg, uint index, char *str, void **dest, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = strlen(str);
|
||||
if (duplicate) {
|
||||
@@ -528,8 +582,9 @@ ZEND_API inline int add_get_index_string(zval *arg, uint index, char *str, void
|
||||
|
||||
ZEND_API inline int add_get_index_stringl(zval *arg, uint index, char *str, uint length, void **dest, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = length;
|
||||
if (duplicate) {
|
||||
@@ -544,18 +599,41 @@ ZEND_API inline int add_get_index_stringl(zval *arg, uint index, char *str, uint
|
||||
|
||||
ZEND_API inline int add_property_long(zval *arg, char *key, long n)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_LONG;
|
||||
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_bool(zval *arg, char *key, int b)
|
||||
{
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_BOOL;
|
||||
tmp->value.lval = b;
|
||||
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_unset(zval *arg, char *key)
|
||||
{
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_NULL;
|
||||
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_resource(zval *arg, char *key, long n)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_RESOURCE;
|
||||
tmp->value.lval = n;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -565,8 +643,9 @@ ZEND_API inline int add_property_resource(zval *arg, char *key, long n)
|
||||
|
||||
ZEND_API inline int add_property_double(zval *arg, char *key, double d)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_DOUBLE;
|
||||
tmp->value.dval = d;
|
||||
INIT_PZVAL(tmp);
|
||||
@@ -576,8 +655,9 @@ ZEND_API inline int add_property_double(zval *arg, char *key, double d)
|
||||
|
||||
ZEND_API inline int add_property_string(zval *arg, char *key, char *str, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = strlen(str);
|
||||
if (duplicate) {
|
||||
@@ -592,8 +672,9 @@ ZEND_API inline int add_property_string(zval *arg, char *key, char *str, int dup
|
||||
|
||||
ZEND_API inline int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate)
|
||||
{
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->type = IS_STRING;
|
||||
tmp->value.str.len = length;
|
||||
if (duplicate) {
|
||||
@@ -606,12 +687,14 @@ ZEND_API inline int add_property_stringl(zval *arg, char *key, char *str, uint l
|
||||
}
|
||||
|
||||
|
||||
int zend_startup_module(zend_module_entry *module)
|
||||
ZEND_API int zend_startup_module(zend_module_entry *module)
|
||||
{
|
||||
if (module) {
|
||||
module->module_number = zend_next_free_module();
|
||||
if (module->module_startup_func) {
|
||||
if (module->module_startup_func(MODULE_PERSISTENT, module->module_number)==FAILURE) {
|
||||
ELS_FETCH();
|
||||
|
||||
if (module->module_startup_func(MODULE_PERSISTENT, module->module_number ELS_CC)==FAILURE) {
|
||||
zend_error(E_CORE_ERROR,"Unable to start %s module",module->name);
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -623,50 +706,38 @@ int zend_startup_module(zend_module_entry *module)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int _register_list_destructors(void (*list_destructor)(void *), void (*plist_destructor)(void *), int module_number)
|
||||
{
|
||||
list_destructors_entry ld;
|
||||
|
||||
#if 0
|
||||
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
|
||||
#endif
|
||||
|
||||
ld.list_destructor=(void (*)(void *)) list_destructor;
|
||||
ld.plist_destructor=(void (*)(void *)) plist_destructor;
|
||||
ld.module_number = module_number;
|
||||
ld.resource_id = list_destructors.nNextFreeElement;
|
||||
|
||||
if (zend_hash_next_index_insert(&list_destructors,(void *) &ld,sizeof(list_destructors_entry),NULL)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
return list_destructors.nNextFreeElement-1;
|
||||
}
|
||||
|
||||
|
||||
/* registers all functions in *library_functions in the function hash */
|
||||
int zend_register_functions(zend_function_entry *functions, HashTable *function_table)
|
||||
int zend_register_functions(zend_function_entry *functions, HashTable *function_table, int type)
|
||||
{
|
||||
zend_function_entry *ptr = functions;
|
||||
zend_internal_function internal_function;
|
||||
zend_function function;
|
||||
zend_internal_function *internal_function = (zend_internal_function *)&function;
|
||||
int count=0,unload=0;
|
||||
HashTable *target_function_table = function_table;
|
||||
int error_type;
|
||||
CLS_FETCH();
|
||||
|
||||
if (type==MODULE_PERSISTENT) {
|
||||
error_type = E_CORE_WARNING;
|
||||
} else {
|
||||
error_type = E_WARNING;
|
||||
}
|
||||
|
||||
if (!target_function_table) {
|
||||
target_function_table = CG(function_table);
|
||||
}
|
||||
internal_function.type = ZEND_INTERNAL_FUNCTION;
|
||||
internal_function->type = ZEND_INTERNAL_FUNCTION;
|
||||
|
||||
while (ptr->fname) {
|
||||
internal_function.handler = ptr->handler;
|
||||
internal_function.arg_types = ptr->func_arg_types;
|
||||
internal_function.function_name = ptr->fname;
|
||||
if (!internal_function.handler) {
|
||||
zend_error(E_CORE_WARNING,"Null function defined as active function");
|
||||
internal_function->handler = ptr->handler;
|
||||
internal_function->arg_types = ptr->func_arg_types;
|
||||
internal_function->function_name = ptr->fname;
|
||||
if (!internal_function->handler) {
|
||||
zend_error(error_type, "Null function defined as active function");
|
||||
zend_unregister_functions(functions, count, target_function_table);
|
||||
return FAILURE;
|
||||
}
|
||||
if (zend_hash_add(target_function_table, ptr->fname, strlen(ptr->fname)+1, &internal_function, sizeof(zend_internal_function), NULL) == FAILURE) {
|
||||
if (zend_hash_add(target_function_table, ptr->fname, strlen(ptr->fname)+1, &function, sizeof(zend_function), NULL) == FAILURE) {
|
||||
unload=1;
|
||||
break;
|
||||
}
|
||||
@@ -676,7 +747,7 @@ int zend_register_functions(zend_function_entry *functions, HashTable *function_
|
||||
if (unload) { /* before unloading, display all remaining bad function in the module */
|
||||
while (ptr->fname) {
|
||||
if (zend_hash_exists(target_function_table, ptr->fname, strlen(ptr->fname)+1)) {
|
||||
zend_error(E_CORE_WARNING, "Function registration failed - duplicate name - %s",ptr->fname);
|
||||
zend_error(error_type, "Function registration failed - duplicate name - %s",ptr->fname);
|
||||
}
|
||||
ptr++;
|
||||
}
|
||||
@@ -718,7 +789,7 @@ ZEND_API int zend_register_module(zend_module_entry *module)
|
||||
#if 0
|
||||
zend_printf("%s: Registering module %d\n",module->name, module->module_number);
|
||||
#endif
|
||||
if (module->functions && zend_register_functions(module->functions, NULL)==FAILURE) {
|
||||
if (module->functions && zend_register_functions(module->functions, NULL, module->type)==FAILURE) {
|
||||
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load",module->name);
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -730,8 +801,10 @@ ZEND_API int zend_register_module(zend_module_entry *module)
|
||||
void module_destructor(zend_module_entry *module)
|
||||
{
|
||||
if (module->type == MODULE_TEMPORARY) {
|
||||
zend_hash_apply_with_argument(&list_destructors, (int (*)(void *,void *)) clean_module_resource_destructors, (void *) &(module->module_number));
|
||||
zend_clean_module_rsrc_dtors(module->module_number);
|
||||
clean_module_constants(module->module_number);
|
||||
if (module->request_shutdown_func)
|
||||
module->request_shutdown_func(module->type, module->module_number);
|
||||
}
|
||||
|
||||
if (module->module_started && module->module_shutdown_func) {
|
||||
@@ -757,10 +830,12 @@ void module_destructor(zend_module_entry *module)
|
||||
int module_registry_request_startup(zend_module_entry *module)
|
||||
{
|
||||
if (module->request_startup_func) {
|
||||
ELS_FETCH();
|
||||
|
||||
#if 0
|
||||
zend_printf("%s: Request startup\n",module->name);
|
||||
#endif
|
||||
if (module->request_startup_func(module->type, module->module_number)==FAILURE) {
|
||||
if (module->request_startup_func(module->type, module->module_number ELS_CC)==FAILURE) {
|
||||
zend_error(E_WARNING, "request_startup() for %s module failed", module->name);
|
||||
exit(1);
|
||||
}
|
||||
@@ -798,8 +873,31 @@ int zend_next_free_module(void)
|
||||
return ++module_count;
|
||||
}
|
||||
|
||||
/* If parent_ce is not NULL then it inherits from parent_ce
|
||||
* If parent_ce is NULL and parent_name isn't then it looks for the parent and inherits from it
|
||||
* If both parent_ce and parent_name are NULL it does a regular class registration
|
||||
* If parent_name is specified but not found NULL is returned
|
||||
*/
|
||||
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name)
|
||||
{
|
||||
zend_class_entry *register_class;
|
||||
CLS_FETCH();
|
||||
|
||||
ZEND_API zend_class_entry *register_internal_class(zend_class_entry *class_entry)
|
||||
if (!parent_ce && parent_name) {
|
||||
if (zend_hash_find(CG(class_table), parent_name, strlen(parent_name)+1, (void **) &parent_ce)==FAILURE) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
register_class = zend_register_internal_class(class_entry);
|
||||
|
||||
if (parent_ce) {
|
||||
do_inheritance(register_class, parent_ce);
|
||||
}
|
||||
return register_class;
|
||||
}
|
||||
|
||||
ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry)
|
||||
{
|
||||
zend_class_entry *register_class;
|
||||
char *lowercase_name = zend_strndup(class_entry->name, class_entry->name_length);
|
||||
@@ -812,15 +910,16 @@ ZEND_API zend_class_entry *register_internal_class(zend_class_entry *class_entry
|
||||
class_entry->refcount = (int *) malloc(sizeof(int));
|
||||
*class_entry->refcount = 1;
|
||||
class_entry->constants_updated = 0;
|
||||
zend_hash_init(&class_entry->default_properties, 0, NULL, PVAL_PTR_DTOR, 1);
|
||||
zend_hash_init(&class_entry->default_properties, 0, NULL, ZVAL_PTR_DTOR, 1);
|
||||
zend_hash_init(&class_entry->function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1);
|
||||
|
||||
|
||||
if (class_entry->builtin_functions) {
|
||||
zend_register_functions(class_entry->builtin_functions, &class_entry->function_table, MODULE_PERSISTENT);
|
||||
}
|
||||
|
||||
zend_hash_update(CG(class_table), lowercase_name, class_entry->name_length+1, class_entry, sizeof(zend_class_entry), (void **) ®ister_class);
|
||||
free(lowercase_name);
|
||||
|
||||
if (class_entry->builtin_functions) {
|
||||
zend_register_functions(class_entry->builtin_functions, &class_entry->function_table);
|
||||
}
|
||||
return register_class;
|
||||
}
|
||||
|
||||
@@ -849,9 +948,37 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
va_start(symbol_table_list, num_symbol_tables);
|
||||
while(num_symbol_tables-- > 0) {
|
||||
symbol_table = va_arg(symbol_table_list, HashTable *);
|
||||
zend_hash_update_ptr(symbol_table, name, name_length + 1, symbol, sizeof(zval *), NULL);
|
||||
zend_hash_update(symbol_table, name, name_length + 1, &symbol, sizeof(zval *), NULL);
|
||||
zval_add_ref(&symbol);
|
||||
}
|
||||
va_end(symbol_table_list);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Disabled functions support */
|
||||
|
||||
static ZEND_FUNCTION(display_disabled_function)
|
||||
{
|
||||
zend_error(E_WARNING, "%s() has been disabled for security reasons.", get_active_function_name());
|
||||
}
|
||||
|
||||
|
||||
static zend_function_entry disabled_function[] = {
|
||||
ZEND_FE(display_disabled_function, NULL)
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length)
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
disabled_function[0].fname = function_name;
|
||||
return zend_register_functions(disabled_function, CG(function_table), MODULE_PERSISTENT);
|
||||
}
|
||||
+167
-33
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -23,13 +23,59 @@
|
||||
|
||||
#include "modules.h"
|
||||
#include "zend_list.h"
|
||||
#include "zend_fast_cache.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_execute.h"
|
||||
|
||||
|
||||
#define ZEND_FN(name) zend_if_##name
|
||||
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
|
||||
#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(zend_if_##name)
|
||||
#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
|
||||
|
||||
#define ZEND_NAMED_FE(zend_name, name, arg_types) { #zend_name, name, arg_types },
|
||||
#define ZEND_FE(name, arg_types) ZEND_NAMED_FE(name, ZEND_FN(name), arg_types)
|
||||
#define ZEND_FALIAS(name, alias, arg_types) ZEND_NAMED_FE(name, ZEND_FN(alias), arg_types)
|
||||
|
||||
#define ZEND_MINIT(module) zend_minit_##module
|
||||
#define ZEND_MSHUTDOWN(module) zend_mshutdown_##module
|
||||
#define ZEND_RINIT(module) zend_rinit_##module
|
||||
#define ZEND_RSHUTDOWN(module) zend_rshutdown_##module
|
||||
#define ZEND_MINFO(module) zend_info_##module
|
||||
#define ZEND_GINIT(module) zend_ginit_##module
|
||||
#define ZEND_GSHUTDOWN(module) zend_gshutdown_##module
|
||||
|
||||
#define ZEND_MINIT_FUNCTION(module) int ZEND_MINIT(module)(INIT_FUNC_ARGS)
|
||||
#define ZEND_MSHUTDOWN_FUNCTION(module) int ZEND_MSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS)
|
||||
#define ZEND_RINIT_FUNCTION(module) int ZEND_RINIT(module)(INIT_FUNC_ARGS)
|
||||
#define ZEND_RSHUTDOWN_FUNCTION(module) int ZEND_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS)
|
||||
#define ZEND_MINFO_FUNCTION(module) void ZEND_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS)
|
||||
#define ZEND_GINIT_FUNCTION(module) int ZEND_GINIT(module)(GINIT_FUNC_ARGS)
|
||||
#define ZEND_GSHUTDOWN_FUNCTION(module) int ZEND_GSHUTDOWN(module)(void)
|
||||
|
||||
#define ZEND_GET_MODULE(name) \
|
||||
ZEND_DLEXPORT zend_module_entry *get_module(void) { return &name##_module_entry; }
|
||||
|
||||
#define ZEND_BEGIN_MODULE_GLOBALS(module_name) \
|
||||
typedef struct _zend_##module_name##_globals {
|
||||
#define ZEND_END_MODULE_GLOBALS(module_name) \
|
||||
} zend_##module_name##_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
|
||||
#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
|
||||
static ts_rsrc_id module_name##_globals_id;
|
||||
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
|
||||
module_name##_globals_id = ts_allocate_id(sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
|
||||
|
||||
#else
|
||||
|
||||
#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
|
||||
static zend_##module_name##_globals module_name##_globals;
|
||||
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
|
||||
globals_ctor(&module_name##_globals);
|
||||
|
||||
#endif
|
||||
|
||||
#define ZEND_NAMED_FE(runtime_name, name, arg_types) { #runtime_name, name, arg_types },
|
||||
#define ZEND_FE(name, arg_types) ZEND_NAMED_FE(name, zend_if_##name, arg_types)
|
||||
|
||||
|
||||
#define INIT_CLASS_ENTRY(class_container, class_name, functions) \
|
||||
@@ -56,46 +102,52 @@
|
||||
|
||||
int zend_next_free_module(void);
|
||||
|
||||
ZEND_API int getParameters(int ht, int param_count,...);
|
||||
ZEND_API int getParametersArray(int ht, int param_count, zval **argument_array);
|
||||
ZEND_API int getParametersEx(int param_count,...);
|
||||
ZEND_API int getParametersArrayEx(int param_count, zval ***argument_array);
|
||||
ZEND_API int zend_get_parameters(int ht, int param_count, ...);
|
||||
ZEND_API int zend_get_parameters_array(int ht, int param_count, zval **argument_array);
|
||||
ZEND_API int zend_get_parameters_ex(int param_count, ...);
|
||||
ZEND_API int zend_get_parameters_array_ex(int param_count, zval ***argument_array);
|
||||
|
||||
ZEND_API int ParameterPassedByReference(int ht, uint n);
|
||||
|
||||
int zend_register_functions(zend_function_entry *functions, HashTable *function_table);
|
||||
int zend_register_functions(zend_function_entry *functions, HashTable *function_table, int type);
|
||||
void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table);
|
||||
ZEND_API int zend_register_module(zend_module_entry *module_entry);
|
||||
ZEND_API zend_class_entry *register_internal_class(zend_class_entry *class_entry);
|
||||
|
||||
ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry);
|
||||
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name);
|
||||
|
||||
ZEND_API zend_module_entry *zend_get_module(int module_number);
|
||||
ZEND_API int zend_disable_function(char *function_name, uint function_name_length);
|
||||
|
||||
ZEND_API void wrong_param_count(void);
|
||||
|
||||
#define getThis() (this_ptr)
|
||||
|
||||
#define WRONG_PARAM_COUNT { wrong_param_count(); return; }
|
||||
#define WRONG_PARAM_COUNT_WITH_RETVAL(ret) { wrong_param_count(); return ret; }
|
||||
#define ARG_COUNT(ht) (ht)
|
||||
#define WRONG_PARAM_COUNT ZEND_WRONG_PARAM_COUNT()
|
||||
#define WRONG_PARAM_COUNT_WITH_RETVAL(ret) ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret)
|
||||
#define ARG_COUNT(dummy) (ht)
|
||||
#define ZEND_NUM_ARGS() (ht)
|
||||
#define ZEND_WRONG_PARAM_COUNT() { wrong_param_count(); return; }
|
||||
#define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret) { wrong_param_count(); return ret; }
|
||||
|
||||
#define BYREF_NONE 0
|
||||
#define BYREF_FORCE 1
|
||||
#define BYREF_ALLOW 2
|
||||
#define BYREF_FORCE_REST 3
|
||||
|
||||
#if !(WIN32||WINNT)
|
||||
#ifndef ZEND_WIN32
|
||||
#define DLEXPORT
|
||||
#endif
|
||||
|
||||
int zend_startup_module(zend_module_entry *module);
|
||||
ZEND_API 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);
|
||||
#define array_init(arg) _array_init((arg) ZEND_FILE_LINE_CC)
|
||||
#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC)
|
||||
#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC)
|
||||
ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC);
|
||||
ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC);
|
||||
ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
|
||||
|
||||
/* 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_unset(zval *arg, char *key);
|
||||
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);
|
||||
@@ -103,6 +155,7 @@ 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_index_long(zval *arg, uint idx, long n);
|
||||
ZEND_API int add_index_unset(zval *arg, uint idx);
|
||||
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);
|
||||
@@ -110,6 +163,7 @@ 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_unset(zval *arg);
|
||||
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);
|
||||
@@ -123,10 +177,12 @@ ZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length,
|
||||
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 call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
|
||||
ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table);
|
||||
|
||||
ZEND_API int add_property_long(zval *arg, char *key, long l);
|
||||
ZEND_API int add_property_unset(zval *arg, char *key);
|
||||
ZEND_API int add_property_bool(zval *arg, char *key, int b);
|
||||
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);
|
||||
@@ -137,10 +193,58 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define add_method(arg,key,method) add_assoc_function((arg),(key),(method))
|
||||
|
||||
#define ZVAL_RESOURCE(z,l) { \
|
||||
(z)->type = IS_RESOURCE; \
|
||||
(z)->value.lval = l; \
|
||||
}
|
||||
#define ZVAL_BOOL(z,b) { \
|
||||
(z)->type = IS_BOOL; \
|
||||
(z)->value.lval = b; \
|
||||
}
|
||||
#define ZVAL_NULL(z) { \
|
||||
(z)->type = IS_NULL; \
|
||||
}
|
||||
#define ZVAL_LONG(z,l) { \
|
||||
(z)->type = IS_LONG; \
|
||||
(z)->value.lval = l; \
|
||||
}
|
||||
#define ZVAL_DOUBLE(z,d) { \
|
||||
(z)->type = IS_DOUBLE; \
|
||||
(z)->value.dval = d; \
|
||||
}
|
||||
#define ZVAL_STRING(z,s,duplicate) { \
|
||||
char *__s=(s); \
|
||||
(z)->value.str.len = strlen(__s); \
|
||||
(z)->value.str.val = (duplicate?estrndup(__s,(z)->value.str.len):__s); \
|
||||
(z)->type = IS_STRING; \
|
||||
}
|
||||
#define ZVAL_STRINGL(z,s,l,duplicate) { \
|
||||
char *__s=(s); int __l=l; \
|
||||
(z)->value.str.len = __l; \
|
||||
(z)->value.str.val = (duplicate?estrndup(__s,__l):__s); \
|
||||
(z)->type = IS_STRING; \
|
||||
}
|
||||
|
||||
#define ZVAL_EMPTY_STRING(z) { \
|
||||
(z)->value.str.len = 0; \
|
||||
(z)->value.str.val = empty_string \
|
||||
(z)->type = IS_STRING; \
|
||||
}
|
||||
|
||||
#define ZVAL_FALSE { (z)->value.lval = 0; (z)->type = IS_BOOL; }
|
||||
#define ZVAL_TRUE { (z)->value.lval = 1; (z)->type = IS_BOOL; }
|
||||
|
||||
#define RETVAL_RESOURCE(l) { \
|
||||
return_value->type = IS_RESOURCE;\
|
||||
return_value->value.lval = l; \
|
||||
}
|
||||
#define RETVAL_BOOL(b) { \
|
||||
return_value->type = IS_BOOL; \
|
||||
return_value->value.lval = b; \
|
||||
}
|
||||
#define RETVAL_NULL() { \
|
||||
return_value->type = IS_NULL; \
|
||||
}
|
||||
#define RETVAL_LONG(l) { \
|
||||
return_value->type = IS_LONG; \
|
||||
return_value->value.lval = l; \
|
||||
@@ -162,6 +266,12 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
return_value->type = IS_STRING; \
|
||||
}
|
||||
|
||||
#define RETVAL_EMPTY_STRING() { \
|
||||
return_value->value.str.len = 0; \
|
||||
return_value->value.str.val = empty_string \
|
||||
return_value->type = IS_STRING; \
|
||||
}
|
||||
|
||||
#define RETVAL_FALSE { return_value->value.lval = 0; return_value->type = IS_BOOL; }
|
||||
#define RETVAL_TRUE { return_value->value.lval = 1; return_value->type = IS_BOOL; }
|
||||
|
||||
@@ -170,6 +280,18 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
return_value->value.lval = l; \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define RETURN_BOOL(b) { \
|
||||
return_value->type = IS_BOOL; \
|
||||
return_value->value.lval = b; \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define RETURN_NULL() { \
|
||||
return_value->type = IS_NULL; \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define RETURN_LONG(l) { \
|
||||
return_value->type = IS_LONG; \
|
||||
return_value->value.lval = l; \
|
||||
@@ -195,14 +317,22 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
return; \
|
||||
}
|
||||
|
||||
#define RETURN_EMPTY_STRING() { \
|
||||
return_value->value.str.len = 0; \
|
||||
return_value->value.str.val = empty_string \
|
||||
return_value->type = IS_STRING; \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define RETURN_FALSE { RETVAL_FALSE; return; }
|
||||
#define RETURN_TRUE { RETVAL_TRUE; return; }
|
||||
|
||||
#define SET_VAR_STRING(n,v) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
zval *var; \
|
||||
char *str=(v); /* prevent 'v' from being evaluated more than once */ \
|
||||
\
|
||||
ALLOC_ZVAL(var); \
|
||||
var->value.str.val = (str); \
|
||||
var->value.str.len = strlen((str)); \
|
||||
var->type = IS_STRING; \
|
||||
@@ -212,8 +342,9 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define SET_VAR_STRINGL(n,v,l) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
zval *var; \
|
||||
\
|
||||
ALLOC_ZVAL(var); \
|
||||
var->value.str.val = (v); \
|
||||
var->value.str.len = (l); \
|
||||
var->type = IS_STRING; \
|
||||
@@ -223,8 +354,9 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define SET_VAR_LONG(n,v) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
zval *var; \
|
||||
\
|
||||
ALLOC_ZVAL(var); \
|
||||
var->value.lval = (v); \
|
||||
var->type = IS_LONG; \
|
||||
ZEND_SET_GLOBAL_VAR(n, var); \
|
||||
@@ -233,8 +365,9 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define SET_VAR_DOUBLE(n,v) { \
|
||||
{ \
|
||||
zval *var = (zval *) emalloc(sizeof(zval)); \
|
||||
zval *var; \
|
||||
\
|
||||
ALLOC_ZVAL(var); \
|
||||
var->value.dval = (v); \
|
||||
var->type = IS_DOUBLE; \
|
||||
ZEND_SET_GLOBAL_VAR(n, var); \
|
||||
@@ -263,7 +396,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
} \
|
||||
zval_dtor(*orig_var); \
|
||||
**orig_var = *(var); \
|
||||
efree(var); \
|
||||
FREE_ZVAL(var); \
|
||||
} else { \
|
||||
(var)->is_ref = _is_ref; \
|
||||
if (_refcount) { \
|
||||
@@ -281,6 +414,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), name, name_length, var, _refcount, _is_ref)
|
||||
|
||||
#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? (p)->value.obj.properties : NULL)))
|
||||
#define ZVAL_IS_NULL(z) ((z)->type==IS_NULL)
|
||||
|
||||
#endif /* _ZEND_API_H */
|
||||
|
||||
|
||||
+168
-45
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "zend.h"
|
||||
#include "zend_alloc.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_fast_cache.h"
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
# include <signal.h>
|
||||
#endif
|
||||
@@ -31,7 +32,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef ZTS
|
||||
static zend_alloc_globals alloc_globals;
|
||||
ZEND_API zend_alloc_globals alloc_globals;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -49,12 +50,12 @@ static zend_alloc_globals alloc_globals;
|
||||
|
||||
# if MEMORY_LIMIT
|
||||
# if ZEND_DEBUG
|
||||
#define CHECK_MEMORY_LIMIT(s) _CHECK_MEMORY_LIMIT(s, __zend_filename, __zend_lineno)
|
||||
#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, __zend_filename, __zend_lineno)
|
||||
# else
|
||||
#define CHECK_MEMORY_LIMIT(s) _CHECK_MEMORY_LIMIT(s,NULL,0)
|
||||
#define CHECK_MEMORY_LIMIT(s, rs) _CHECK_MEMORY_LIMIT(s, rs, NULL,0)
|
||||
# endif
|
||||
|
||||
#define _CHECK_MEMORY_LIMIT(s,file,lineno) { AG(allocated_memory) += (s);\
|
||||
#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\
|
||||
if (AG(memory_limit)<AG(allocated_memory)) {\
|
||||
if (!file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit),s); \
|
||||
@@ -66,7 +67,7 @@ static zend_alloc_globals alloc_globals;
|
||||
# endif
|
||||
|
||||
#ifndef CHECK_MEMORY_LIMIT
|
||||
#define CHECK_MEMORY_LIMIT(s)
|
||||
#define CHECK_MEMORY_LIMIT(s, rs)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -96,19 +97,32 @@ static zend_alloc_globals alloc_globals;
|
||||
} \
|
||||
AG(head) = p; \
|
||||
} \
|
||||
p->pLast = (mem_header *) NULL;
|
||||
p->pLast = (zend_mem_header *) NULL;
|
||||
|
||||
#define DECLARE_CACHE_VARS \
|
||||
unsigned int real_size; \
|
||||
unsigned int cache_index;
|
||||
|
||||
#define REAL_SIZE(size) ((size+7) & ~0x7)
|
||||
|
||||
#define CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size) \
|
||||
real_size = REAL_SIZE(size); \
|
||||
cache_index = real_size >> 3;
|
||||
|
||||
#define SIZE real_size
|
||||
|
||||
#define CACHE_INDEX cache_index
|
||||
|
||||
ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
mem_header *p;
|
||||
zend_mem_header *p;
|
||||
DECLARE_CACHE_VARS
|
||||
ALS_FETCH();
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
|
||||
|
||||
if (!ZEND_DISABLE_MEMORY_CACHE && (size < MAX_CACHED_MEMORY) && (AG(cache_count)[size] > 0)) {
|
||||
p = AG(cache)[size][--AG(cache_count)[size]];
|
||||
if (!ZEND_DISABLE_MEMORY_CACHE && (CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] > 0)) {
|
||||
p = AG(cache)[CACHE_INDEX][--AG(cache_count)[CACHE_INDEX]];
|
||||
#if ZEND_DEBUG
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
@@ -116,15 +130,26 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
p->orig_lineno = __zend_orig_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
p->reported = 0;
|
||||
AG(cache_stats)[CACHE_INDEX][1]++;
|
||||
#endif
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
p->persistent = 0;
|
||||
p->cached = 0;
|
||||
return (void *)((char *)p + sizeof(mem_header) + PLATFORM_PADDING);
|
||||
p->size = size;
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *)((char *)p + sizeof(zend_mem_header) + PLATFORM_PADDING);
|
||||
} else {
|
||||
p = (mem_header *) malloc(sizeof(mem_header) + size + PLATFORM_PADDING + END_ALIGNMENT(size) + END_MAGIC_SIZE);
|
||||
#if ZEND_DEBUG
|
||||
if (CACHE_INDEX<MAX_CACHED_MEMORY) {
|
||||
AG(cache_stats)[CACHE_INDEX][0]++;
|
||||
}
|
||||
#endif
|
||||
p = (zend_mem_header *) malloc(sizeof(zend_mem_header) + SIZE + PLATFORM_PADDING + END_ALIGNMENT(SIZE) + END_MAGIC_SIZE);
|
||||
}
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
|
||||
if (!p) {
|
||||
fprintf(stderr,"FATAL: emalloc(): Unable to allocate %ld bytes\n", (long) size);
|
||||
#if ZEND_DEBUG && defined(HAVE_KILL) && defined(HAVE_GETPID)
|
||||
@@ -137,7 +162,7 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
}
|
||||
p->persistent = p->cached = 0;
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
p->size = size;
|
||||
p->size = size; /* Save real size for correct cache output */
|
||||
#if ZEND_DEBUG
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
@@ -145,42 +170,47 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
p->orig_lineno = __zend_orig_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
p->reported = 0;
|
||||
*((long *)(((char *) p) + sizeof(mem_header)+size+PLATFORM_PADDING+END_ALIGNMENT(size))) = MEM_BLOCK_END_MAGIC;
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE))) = MEM_BLOCK_END_MAGIC;
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
CHECK_MEMORY_LIMIT(size);
|
||||
CHECK_MEMORY_LIMIT(size, SIZE);
|
||||
#endif
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *)((char *)p + sizeof(mem_header) + PLATFORM_PADDING);
|
||||
return (void *)((char *)p + sizeof(zend_mem_header) + PLATFORM_PADDING);
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - PLATFORM_PADDING);
|
||||
DECLARE_CACHE_VARS
|
||||
ALS_FETCH();
|
||||
|
||||
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
|
||||
#if ZEND_DEBUG
|
||||
if (!_mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
|
||||
return;
|
||||
}
|
||||
memset(ptr, 0x5a, p->size);
|
||||
memset(ptr, 0x5a, SIZE);
|
||||
#endif
|
||||
|
||||
if (!ZEND_DISABLE_MEMORY_CACHE
|
||||
&& !p->persistent && (p->size < MAX_CACHED_MEMORY) && (AG(cache_count)[p->size] < MAX_CACHED_ENTRIES)) {
|
||||
AG(cache)[p->size][AG(cache_count)[p->size]++] = p;
|
||||
&& !p->persistent && (CACHE_INDEX < MAX_CACHED_MEMORY) && (AG(cache_count)[CACHE_INDEX] < MAX_CACHED_ENTRIES)) {
|
||||
AG(cache)[CACHE_INDEX][AG(cache_count)[CACHE_INDEX]++] = p;
|
||||
p->cached = 1;
|
||||
#if ZEND_DEBUG
|
||||
p->magic = MEM_BLOCK_CACHED_MAGIC;
|
||||
#endif
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return;
|
||||
}
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
|
||||
#if MEMORY_LIMIT
|
||||
AG(allocated_memory) -= p->size;
|
||||
AG(allocated_memory) -= SIZE;
|
||||
#endif
|
||||
|
||||
free(p);
|
||||
@@ -192,14 +222,14 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
|
||||
{
|
||||
void *p;
|
||||
int final_size=size*nmemb;
|
||||
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
if (!p) {
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *) p;
|
||||
}
|
||||
memset(p,(int)NULL,final_size);
|
||||
memset(p,(int)NULL, final_size);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return p;
|
||||
}
|
||||
@@ -207,16 +237,20 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
|
||||
|
||||
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;
|
||||
zend_mem_header *p = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-PLATFORM_PADDING);
|
||||
zend_mem_header *orig = p;
|
||||
DECLARE_CACHE_VARS
|
||||
ALS_FETCH();
|
||||
|
||||
if (!ptr) {
|
||||
return _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
|
||||
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
|
||||
|
||||
HANDLE_BLOCK_INTERRUPTIONS();
|
||||
REMOVE_POINTER_FROM_LIST(p);
|
||||
p = (mem_header *) realloc(p,sizeof(mem_header)+size+PLATFORM_PADDING+END_ALIGNMENT(size)+END_MAGIC_SIZE);
|
||||
p = (zend_mem_header *) realloc(p,sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE)+END_MAGIC_SIZE);
|
||||
if (!p) {
|
||||
if (!allow_failure) {
|
||||
fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size);
|
||||
@@ -235,15 +269,15 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
|
||||
p->filename = __zend_filename;
|
||||
p->lineno = __zend_lineno;
|
||||
p->magic = MEM_BLOCK_START_MAGIC;
|
||||
*((long *)(((char *) p) + sizeof(mem_header)+size+PLATFORM_PADDING+END_ALIGNMENT(size))) = MEM_BLOCK_END_MAGIC;
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE))) = MEM_BLOCK_END_MAGIC;
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
CHECK_MEMORY_LIMIT(size - p->size);
|
||||
CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size));
|
||||
#endif
|
||||
p->size = size;
|
||||
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return (void *)((char *)p+sizeof(mem_header)+PLATFORM_PADDING);
|
||||
return (void *)((char *)p+sizeof(zend_mem_header)+PLATFORM_PADDING);
|
||||
}
|
||||
|
||||
|
||||
@@ -313,6 +347,11 @@ ZEND_API int zend_set_memory_limit(unsigned int memory_limit)
|
||||
|
||||
ZEND_API void start_memory_manager(ALS_D)
|
||||
{
|
||||
#ifndef ZTS
|
||||
int i, j;
|
||||
void *cached_entries[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
|
||||
#endif
|
||||
|
||||
AG(phead) = AG(head) = NULL;
|
||||
|
||||
#if MEMORY_LIMIT
|
||||
@@ -321,25 +360,60 @@ ZEND_API void start_memory_manager(ALS_D)
|
||||
AG(memory_exhausted)=0;
|
||||
#endif
|
||||
|
||||
memset(AG(cache_count),0,MAX_CACHED_MEMORY*sizeof(unsigned char));
|
||||
memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head)));
|
||||
memset(AG(cache_count),0,sizeof(AG(cache_count)));
|
||||
|
||||
#ifndef ZTS
|
||||
/* Initialize cache, to prevent fragmentation */
|
||||
/* We can't do this in ZTS mode, because calling emalloc() from within start_memory_manager()
|
||||
* will yield an endless recursion calling to alloc_globals_ctor()
|
||||
*/
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<PRE_INIT_CACHE_ENTRIES; j++) {
|
||||
cached_entries[i][j] = emalloc(8*i);
|
||||
}
|
||||
}
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<PRE_INIT_CACHE_ENTRIES; j++) {
|
||||
efree(cached_entries[i][j]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ZEND_DEBUG
|
||||
memset(AG(cache_stats), 0, sizeof(AG(cache_stats)));
|
||||
memset(AG(fast_cache_stats), 0, sizeof(AG(fast_cache_stats)));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
{
|
||||
mem_header *p, *t;
|
||||
zend_mem_header *p, *t;
|
||||
unsigned int fci, i, j;
|
||||
#if ZEND_DEBUG
|
||||
int had_leaks=0;
|
||||
#endif
|
||||
zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry;
|
||||
ALS_FETCH();
|
||||
|
||||
for (fci=0; fci<MAX_FAST_CACHE_TYPES; fci++) {
|
||||
fast_cache_list_entry = AG(fast_cache_list_head)[fci];
|
||||
while (fast_cache_list_entry) {
|
||||
next_fast_cache_list_entry = fast_cache_list_entry->next;
|
||||
efree(fast_cache_list_entry);
|
||||
fast_cache_list_entry = next_fast_cache_list_entry;
|
||||
}
|
||||
AG(fast_cache_list_head)[fci] = NULL;
|
||||
}
|
||||
|
||||
p=AG(head);
|
||||
t=AG(head);
|
||||
while (t) {
|
||||
if (!t->cached || clean_cache) {
|
||||
#if ZEND_DEBUG
|
||||
if (!t->cached && !t->reported) {
|
||||
mem_header *iterator;
|
||||
zend_mem_header *iterator;
|
||||
int total_leak=0, total_leak_count=0;
|
||||
|
||||
had_leaks=1;
|
||||
@@ -369,6 +443,54 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
t = t->pNext;
|
||||
}
|
||||
}
|
||||
|
||||
if(clean_cache) {
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<AG(cache_count)[i]; j++) {
|
||||
free(AG(cache)[i][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if (ZEND_DEBUG)
|
||||
do {
|
||||
zval display_memory_cache_stats;
|
||||
int i, j;
|
||||
|
||||
if (clean_cache) {
|
||||
/* we're shutting down completely, don't even touch the INI subsystem */
|
||||
break;
|
||||
}
|
||||
if (zend_get_ini_entry("display_memory_cache_stats", sizeof("display_memory_cache_stats"), &display_memory_cache_stats)==FAILURE) {
|
||||
break;
|
||||
}
|
||||
if (!atoi(display_memory_cache_stats.value.str.val)) {
|
||||
break;
|
||||
}
|
||||
fprintf(stderr, "Memory cache statistics\n"
|
||||
"-----------------------\n\n"
|
||||
"[zval, %2ld]\t\t%d / %d (%.2f%%)\n"
|
||||
"[hash, %2ld]\t\t%d / %d (%.2f%%)\n",
|
||||
(long) sizeof(zval),
|
||||
AG(fast_cache_stats)[ZVAL_CACHE_LIST][1], AG(fast_cache_stats)[ZVAL_CACHE_LIST][0]+AG(fast_cache_stats)[ZVAL_CACHE_LIST][1],
|
||||
((double) AG(fast_cache_stats)[ZVAL_CACHE_LIST][1] / (AG(fast_cache_stats)[ZVAL_CACHE_LIST][0]+AG(fast_cache_stats)[ZVAL_CACHE_LIST][1]))*100,
|
||||
(long) sizeof(HashTable),
|
||||
AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1], AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][0]+AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1],
|
||||
((double) AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1] / (AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][0]+AG(fast_cache_stats)[HASHTABLE_CACHE_LIST][1]))*100);
|
||||
|
||||
|
||||
for (i=0; i<MAX_CACHED_MEMORY; i+=2) {
|
||||
fprintf(stderr, "[%2d, %2d]\t\t", i, i+1);
|
||||
for (j=0; j<2; j++) {
|
||||
fprintf(stderr, "%d / %d (%.2f%%)\t\t",
|
||||
AG(cache_stats)[i+j][1], AG(cache_stats)[i+j][0]+AG(cache_stats)[i+j][1],
|
||||
((double) AG(cache_stats)[i+j][1] / (AG(cache_stats)[i+j][0]+AG(cache_stats)[i+j][1]))*100);
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
} while (0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -382,7 +504,7 @@ void zend_debug_alloc_output(char *format, ...)
|
||||
vsprintf(output_buf, format, args);
|
||||
va_end(args);
|
||||
|
||||
#if WIN32||WINNT
|
||||
#ifdef ZEND_WIN32
|
||||
OutputDebugString(output_buf);
|
||||
#else
|
||||
fprintf(stderr, output_buf);
|
||||
@@ -392,7 +514,7 @@ void zend_debug_alloc_output(char *format, ...)
|
||||
|
||||
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);
|
||||
zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - PLATFORM_PADDING);
|
||||
int no_cache_notice=0;
|
||||
int valid_beginning=1;
|
||||
int had_problems=0;
|
||||
@@ -454,7 +576,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
|
||||
|
||||
|
||||
if (valid_beginning
|
||||
&& *((long *)(((char *) p)+sizeof(mem_header)+p->size+PLATFORM_PADDING+END_ALIGNMENT(p->size))) != MEM_BLOCK_END_MAGIC) {
|
||||
&& *((long *)(((char *) p)+sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING+END_ALIGNMENT(REAL_SIZE(p->size)))) != MEM_BLOCK_END_MAGIC) {
|
||||
long magic_num = MEM_BLOCK_END_MAGIC;
|
||||
char *overflow_ptr, *magic_ptr=(char *) &magic_num;
|
||||
int overflows=0;
|
||||
@@ -464,7 +586,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
|
||||
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
|
||||
}
|
||||
had_problems=1;
|
||||
overflow_ptr = ((char *) p)+sizeof(mem_header)+p->size+PLATFORM_PADDING;
|
||||
overflow_ptr = ((char *) p)+sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING;
|
||||
|
||||
for (i=0; i<sizeof(long); i++) {
|
||||
if (overflow_ptr[i]!=magic_ptr[i]) {
|
||||
@@ -474,7 +596,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
|
||||
|
||||
zend_debug_alloc_output("%10s\t", "End:");
|
||||
zend_debug_alloc_output("Overflown (magic=0x%0.8lX instead of 0x%0.8lX)\n",
|
||||
*((long *)(((char *) p) + sizeof(mem_header)+p->size+PLATFORM_PADDING+END_ALIGNMENT(p->size))), MEM_BLOCK_END_MAGIC);
|
||||
*((long *)(((char *) p) + sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING+END_ALIGNMENT(REAL_SIZE(p->size)))), MEM_BLOCK_END_MAGIC);
|
||||
zend_debug_alloc_output("%10s\t","");
|
||||
if (overflows>=sizeof(long)) {
|
||||
zend_debug_alloc_output("At least %d bytes overflown\n", sizeof(long));
|
||||
@@ -505,7 +627,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
|
||||
|
||||
ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
{
|
||||
mem_header *p;
|
||||
zend_mem_header *p;
|
||||
int errors=0;
|
||||
ALS_FETCH();
|
||||
|
||||
@@ -516,7 +638,7 @@ ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D
|
||||
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) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
|
||||
if (!_mem_block_check((void *)((char *)p + sizeof(zend_mem_header) + PLATFORM_PADDING), (silent?2:3) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
|
||||
errors++;
|
||||
}
|
||||
p = p->pNext;
|
||||
@@ -527,9 +649,9 @@ ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D
|
||||
#endif
|
||||
|
||||
|
||||
ZEND_API void _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
ZEND_API int _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);
|
||||
zend_mem_header *p = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-PLATFORM_PADDING);
|
||||
ALS_FETCH();
|
||||
|
||||
#if ZEND_DEBUG
|
||||
@@ -546,6 +668,7 @@ ZEND_API void _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
/* add the block to the persistent list */
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return REAL_SIZE(p->size)+sizeof(zend_mem_header)+PLATFORM_PADDING;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+18
-12
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -26,11 +26,11 @@
|
||||
#include "zend_globals_macros.h"
|
||||
|
||||
#define MEM_BLOCK_START_MAGIC 0x7312F8DCL
|
||||
#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
|
||||
#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
|
||||
#define MEM_BLOCK_FREED_MAGIC 0x99954317L
|
||||
#define MEM_BLOCK_CACHED_MAGIC 0xFB8277DCL
|
||||
|
||||
typedef struct _mem_header {
|
||||
typedef struct _zend_mem_header {
|
||||
#if ZEND_DEBUG
|
||||
long magic;
|
||||
char *filename;
|
||||
@@ -39,12 +39,12 @@ typedef struct _mem_header {
|
||||
char *orig_filename;
|
||||
uint orig_lineno;
|
||||
#endif
|
||||
struct _mem_header *pNext;
|
||||
struct _mem_header *pLast;
|
||||
struct _zend_mem_header *pNext;
|
||||
struct _zend_mem_header *pLast;
|
||||
unsigned int size:30;
|
||||
unsigned int persistent:1;
|
||||
unsigned int cached:1;
|
||||
} mem_header;
|
||||
} zend_mem_header;
|
||||
|
||||
typedef union _align_test {
|
||||
void *ptr;
|
||||
@@ -52,11 +52,17 @@ typedef union _align_test {
|
||||
long lng;
|
||||
} align_test;
|
||||
|
||||
#define MAX_CACHED_MEMORY 64
|
||||
#define MAX_CACHED_ENTRIES 16
|
||||
#define MAX_CACHED_MEMORY 11
|
||||
#define MAX_CACHED_ENTRIES 256
|
||||
#define PRE_INIT_CACHE_ENTRIES 32
|
||||
|
||||
#if (defined (__GNUC__) && __GNUC__ >= 2)
|
||||
#define PLATFORM_ALIGNMENT (__alignof__ (align_test))
|
||||
#else
|
||||
#define PLATFORM_ALIGNMENT (sizeof(align_test))
|
||||
#define PLATFORM_PADDING (((PLATFORM_ALIGNMENT-sizeof(mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
|
||||
#endif
|
||||
|
||||
#define PLATFORM_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
|
||||
|
||||
ZEND_API char *zend_strndup(const char *s, unsigned int length);
|
||||
|
||||
@@ -68,7 +74,7 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
|
||||
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);
|
||||
ZEND_API int _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)
|
||||
|
||||
+503
-69
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -21,16 +21,17 @@
|
||||
#include "zend.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_builtin_functions.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_constants.h"
|
||||
|
||||
#undef ZEND_TEST_EXCEPTIONS
|
||||
|
||||
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(strncmp);
|
||||
static ZEND_FUNCTION(strcasecmp);
|
||||
static ZEND_FUNCTION(each);
|
||||
static ZEND_FUNCTION(error_reporting);
|
||||
@@ -39,11 +40,31 @@ static ZEND_FUNCTION(defined);
|
||||
static ZEND_FUNCTION(get_class);
|
||||
static ZEND_FUNCTION(get_parent_class);
|
||||
static ZEND_FUNCTION(method_exists);
|
||||
static ZEND_FUNCTION(class_exists);
|
||||
static ZEND_FUNCTION(function_exists);
|
||||
static ZEND_FUNCTION(leak);
|
||||
static ZEND_FUNCTION(get_used_files);
|
||||
static ZEND_FUNCTION(get_imported_files);
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
static ZEND_FUNCTION(crash);
|
||||
#endif
|
||||
static ZEND_FUNCTION(get_required_files);
|
||||
static ZEND_FUNCTION(get_included_files);
|
||||
static ZEND_FUNCTION(is_subclass_of);
|
||||
static ZEND_FUNCTION(get_class_vars);
|
||||
static ZEND_FUNCTION(get_object_vars);
|
||||
static ZEND_FUNCTION(get_class_methods);
|
||||
static ZEND_FUNCTION(trigger_error);
|
||||
static ZEND_FUNCTION(set_error_handler);
|
||||
static ZEND_FUNCTION(restore_error_handler);
|
||||
static ZEND_FUNCTION(get_declared_classes);
|
||||
static ZEND_FUNCTION(create_function);
|
||||
#if ZEND_DEBUG
|
||||
static ZEND_FUNCTION(zend_test_func);
|
||||
#endif
|
||||
|
||||
extern unsigned char first_arg_force_ref[];
|
||||
unsigned char first_arg_force_ref[] = { 1, BYREF_FORCE };
|
||||
unsigned char first_arg_allow_ref[] = { 1, BYREF_ALLOW };
|
||||
unsigned char second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };
|
||||
unsigned char second_arg_allow_ref[] = { 2, BYREF_NONE, BYREF_ALLOW };
|
||||
|
||||
static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(zend_version, NULL)
|
||||
@@ -52,6 +73,7 @@ static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(func_get_args, NULL)
|
||||
ZEND_FE(strlen, NULL)
|
||||
ZEND_FE(strcmp, NULL)
|
||||
ZEND_FE(strncmp, NULL)
|
||||
ZEND_FE(strcasecmp, NULL)
|
||||
ZEND_FE(each, first_arg_force_ref)
|
||||
ZEND_FE(error_reporting, NULL)
|
||||
@@ -60,16 +82,34 @@ static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(get_class, NULL)
|
||||
ZEND_FE(get_parent_class, NULL)
|
||||
ZEND_FE(method_exists, NULL)
|
||||
ZEND_FE(class_exists, NULL)
|
||||
ZEND_FE(function_exists, NULL)
|
||||
ZEND_FE(leak, NULL)
|
||||
ZEND_FE(get_used_files, NULL)
|
||||
ZEND_FE(get_imported_files, NULL)
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
ZEND_FE(crash, NULL)
|
||||
#endif
|
||||
ZEND_FE(get_required_files, NULL)
|
||||
ZEND_FE(get_included_files, NULL)
|
||||
ZEND_FE(is_subclass_of, NULL)
|
||||
ZEND_FE(get_class_vars, NULL)
|
||||
ZEND_FE(get_object_vars, NULL)
|
||||
ZEND_FE(get_class_methods, NULL)
|
||||
ZEND_FE(trigger_error, NULL)
|
||||
ZEND_FALIAS(user_error, trigger_error, NULL)
|
||||
ZEND_FE(set_error_handler, NULL)
|
||||
ZEND_FE(restore_error_handler, NULL)
|
||||
ZEND_FE(get_declared_classes, NULL)
|
||||
ZEND_FE(create_function, NULL)
|
||||
#if ZEND_DEBUG
|
||||
ZEND_FE(zend_test_func, NULL)
|
||||
#endif
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
int zend_startup_builtin_functions()
|
||||
{
|
||||
return zend_register_functions(builtin_functions, NULL);
|
||||
return zend_register_functions(builtin_functions, NULL, MODULE_PERSISTENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,12 +123,14 @@ ZEND_FUNCTION(func_num_args)
|
||||
{
|
||||
void **p;
|
||||
int arg_count;
|
||||
ELS_FETCH();
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
p = EG(argument_stack).top_element-1-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;
|
||||
p -= 1+arg_count;
|
||||
if (*p) {
|
||||
zend_error(E_ERROR, "func_num_args(): Can't be used as a function parameter");
|
||||
}
|
||||
--p;
|
||||
if (p>=EG(argument_stack).elements) {
|
||||
RETURN_LONG((ulong) *p);
|
||||
} else {
|
||||
@@ -105,26 +147,28 @@ ZEND_FUNCTION(func_get_arg)
|
||||
zval **z_requested_offset;
|
||||
zval *arg;
|
||||
long requested_offset;
|
||||
ELS_FETCH();
|
||||
|
||||
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &z_requested_offset)==FAILURE) {
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(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;
|
||||
p = EG(argument_stack).top_element-1-1;
|
||||
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_get_arg(); */
|
||||
p -= 1+arg_count;
|
||||
if (*p) {
|
||||
zend_error(E_ERROR, "func_get_arg(): Can't be used as a function parameter");
|
||||
}
|
||||
--p;
|
||||
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);
|
||||
if (requested_offset>=arg_count) {
|
||||
zend_error(E_WARNING, "func_get_arg(): Argument %d not passed to function", requested_offset);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -139,12 +183,15 @@ 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-1;
|
||||
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_get_args(); */
|
||||
p -= 1+arg_count;
|
||||
if (*p) {
|
||||
zend_error(E_ERROR, "func_get_args(): Can't be used as a function parameter");
|
||||
}
|
||||
--p;
|
||||
|
||||
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;
|
||||
@@ -156,7 +203,7 @@ ZEND_FUNCTION(func_get_args)
|
||||
for (i=0; i<arg_count; i++) {
|
||||
zval *element;
|
||||
|
||||
element = (zval *) emalloc(sizeof(zval));
|
||||
ALLOC_ZVAL(element);
|
||||
*element = **((zval **) (p-(arg_count-i)));
|
||||
zval_copy_ctor(element);
|
||||
INIT_PZVAL(element);
|
||||
@@ -171,7 +218,7 @@ ZEND_FUNCTION(strlen)
|
||||
{
|
||||
zval **str;
|
||||
|
||||
if (ARG_COUNT(ht) != 1 || getParametersEx(1, &str) == FAILURE) {
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(str);
|
||||
@@ -185,12 +232,28 @@ ZEND_FUNCTION(strcmp)
|
||||
{
|
||||
zval **s1, **s2;
|
||||
|
||||
if (ARG_COUNT(ht) != 2 || getParametersEx(2, &s1, &s2) == FAILURE) {
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
RETURN_LONG(zend_binary_strcmp(*s1,*s2));
|
||||
RETURN_LONG(zend_binary_zval_strcmp(*s1,*s2));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int strncmp(string str1, string str2, int len)
|
||||
Binary safe string comparison */
|
||||
ZEND_FUNCTION(strncmp)
|
||||
{
|
||||
zval **s1, **s2, **s3;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &s1, &s2, &s3) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
convert_to_long_ex(s3);
|
||||
RETURN_LONG(zend_binary_zval_strncmp(*s1,*s2,*s3));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -200,12 +263,12 @@ ZEND_FUNCTION(strcasecmp)
|
||||
{
|
||||
zval **s1, **s2;
|
||||
|
||||
if (ARG_COUNT(ht)!=2 || getParametersEx(2, &s1, &s2) == FAILURE) {
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
RETURN_LONG(zend_binary_strcasecmp(*s1, *s2));
|
||||
RETURN_LONG(zend_binary_zval_strcasecmp(*s1, *s2));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -217,7 +280,7 @@ ZEND_FUNCTION(each)
|
||||
zval **inserted_pointer;
|
||||
HashTable *target_hash;
|
||||
|
||||
if (ARG_COUNT(ht) != 1 || getParametersEx(1, &array) == FAILURE) {
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
target_hash = HASH_OF(*array);
|
||||
@@ -233,7 +296,7 @@ ZEND_FUNCTION(each)
|
||||
|
||||
/* add value elements */
|
||||
if (entry->is_ref) {
|
||||
tmp = (zval *)emalloc(sizeof(zval));
|
||||
ALLOC_ZVAL(tmp);
|
||||
*tmp = *entry;
|
||||
zval_copy_ctor(tmp);
|
||||
tmp->is_ref=0;
|
||||
@@ -242,7 +305,7 @@ ZEND_FUNCTION(each)
|
||||
}
|
||||
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);
|
||||
zend_hash_update(return_value->value.ht, "value", sizeof("value"), &entry, sizeof(zval *), NULL);
|
||||
entry->refcount++;
|
||||
|
||||
/* add the key elements */
|
||||
@@ -263,14 +326,13 @@ ZEND_FUNCTION(error_reporting)
|
||||
{
|
||||
zval **arg;
|
||||
int old_error_reporting;
|
||||
ELS_FETCH();
|
||||
|
||||
old_error_reporting = EG(error_reporting);
|
||||
switch (ARG_COUNT(ht)) {
|
||||
switch (ZEND_NUM_ARGS()) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
if (getParametersEx(1,&arg) == FAILURE) {
|
||||
if (zend_get_parameters_ex(1,&arg) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_long_ex(arg);
|
||||
@@ -289,17 +351,16 @@ ZEND_FUNCTION(define)
|
||||
zval **var, **val, **non_cs;
|
||||
int case_sensitive;
|
||||
zend_constant c;
|
||||
ELS_FETCH();
|
||||
|
||||
switch(ARG_COUNT(ht)) {
|
||||
switch(ZEND_NUM_ARGS()) {
|
||||
case 2:
|
||||
if (getParametersEx(2, &var, &val)==FAILURE) {
|
||||
if (zend_get_parameters_ex(2, &var, &val)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
case_sensitive = CONST_CS;
|
||||
break;
|
||||
case 3:
|
||||
if (getParametersEx(3, &var, &val, &non_cs)==FAILURE) {
|
||||
if (zend_get_parameters_ex(3, &var, &val, &non_cs)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_long_ex(non_cs);
|
||||
@@ -319,6 +380,7 @@ ZEND_FUNCTION(define)
|
||||
case IS_STRING:
|
||||
case IS_BOOL:
|
||||
case IS_RESOURCE:
|
||||
case IS_NULL:
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING,"Constants may only evaluate to scalar values");
|
||||
@@ -329,7 +391,7 @@ ZEND_FUNCTION(define)
|
||||
|
||||
c.value = **val;
|
||||
zval_copy_ctor(&c.value);
|
||||
c.flags = case_sensitive | ~CONST_PERSISTENT; /* non persistent */
|
||||
c.flags = case_sensitive; /* non persistent */
|
||||
c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len);
|
||||
c.name_len = (*var)->value.str.len+1;
|
||||
zend_register_constant(&c ELS_CC);
|
||||
@@ -342,7 +404,7 @@ ZEND_FUNCTION(defined)
|
||||
zval **var;
|
||||
zval c;
|
||||
|
||||
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &var)==FAILURE) {
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &var)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
@@ -356,14 +418,13 @@ ZEND_FUNCTION(defined)
|
||||
}
|
||||
|
||||
/* {{{ proto string get_class(object object)
|
||||
Retrieves the class name ...
|
||||
*/
|
||||
Retrieves the class name */
|
||||
ZEND_FUNCTION(get_class)
|
||||
{
|
||||
zval **arg;
|
||||
|
||||
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &arg)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if ((*arg)->type != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
@@ -373,14 +434,13 @@ ZEND_FUNCTION(get_class)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string get_parent_class(object object)
|
||||
Retrieves the parent class name ...
|
||||
*/
|
||||
Retrieves the parent class name */
|
||||
ZEND_FUNCTION(get_parent_class)
|
||||
{
|
||||
zval **arg;
|
||||
|
||||
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &arg)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (((*arg)->type != IS_OBJECT) || !(*arg)->value.obj.ce->parent) {
|
||||
RETURN_FALSE;
|
||||
@@ -389,35 +449,207 @@ ZEND_FUNCTION(get_parent_class)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool is_subclass_of(object object, string class_name)
|
||||
Returns true if the object has this class as one of its parents */
|
||||
ZEND_FUNCTION(is_subclass_of)
|
||||
{
|
||||
zval **obj, **class_name;
|
||||
char *lcname;
|
||||
zend_class_entry *parent_ce = NULL;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &obj, &class_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if ((*obj)->type != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
convert_to_string_ex(class_name);
|
||||
lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len);
|
||||
zend_str_tolower(lcname, (*class_name)->value.str.len);
|
||||
|
||||
for (parent_ce = (*obj)->value.obj.ce->parent; parent_ce != NULL; parent_ce = parent_ce->parent) {
|
||||
if (!strcmp(parent_ce->name, lcname)) {
|
||||
efree(lcname);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
}
|
||||
efree(lcname);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array get_class_vars(string class_name)
|
||||
Returns an array of default properties of the class */
|
||||
ZEND_FUNCTION(get_class_vars)
|
||||
{
|
||||
zval **class_name;
|
||||
char *lcname;
|
||||
zend_class_entry *ce;
|
||||
zval *tmp;
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(class_name);
|
||||
lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len);
|
||||
zend_str_tolower(lcname, (*class_name)->value.str.len);
|
||||
|
||||
if (zend_hash_find(CG(class_table), lcname, (*class_name)->value.str.len+1, (void **)&ce)==FAILURE) {
|
||||
efree(lcname);
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
efree(lcname);
|
||||
array_init(return_value);
|
||||
zend_hash_copy(return_value->value.ht, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array get_object_vars(object obj)
|
||||
Returns an array of object properties */
|
||||
ZEND_FUNCTION(get_object_vars)
|
||||
{
|
||||
zval **obj;
|
||||
zval *tmp;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &obj) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if ((*obj)->type != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_copy(return_value->value.ht, (*obj)->value.obj.properties,
|
||||
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array get_class_methods(string class_name)
|
||||
Returns an array of class methods' names */
|
||||
ZEND_FUNCTION(get_class_methods)
|
||||
{
|
||||
zval **class_name;
|
||||
zval *method_name;
|
||||
char *lcname;
|
||||
zend_class_entry *ce;
|
||||
char *string_key;
|
||||
ulong num_key;
|
||||
int key_type;
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(class_name);
|
||||
lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len);
|
||||
zend_str_tolower(lcname, (*class_name)->value.str.len);
|
||||
|
||||
if (zend_hash_find(CG(class_table), lcname, (*class_name)->value.str.len+1, (void **)&ce)==FAILURE) {
|
||||
efree(lcname);
|
||||
RETURN_NULL();
|
||||
} else {
|
||||
efree(lcname);
|
||||
array_init(return_value);
|
||||
zend_hash_internal_pointer_reset(&ce->function_table);
|
||||
while ((key_type = zend_hash_get_current_key(&ce->function_table, &string_key, &num_key)) != HASH_KEY_NON_EXISTANT) {
|
||||
if (key_type == HASH_KEY_IS_STRING) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
ZVAL_STRING(method_name, string_key, 0);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
}
|
||||
zend_hash_move_forward(&ce->function_table);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool method_exists(object object, string method)
|
||||
Checks if the class method exists ...
|
||||
*/
|
||||
Checks if the class method exists */
|
||||
ZEND_FUNCTION(method_exists)
|
||||
{
|
||||
zval **arg1, **arg2;
|
||||
zval **klass, **method_name;
|
||||
char *lcname;
|
||||
|
||||
if (ARG_COUNT(ht)!=2 || getParametersEx(2, &arg1, &arg2)==FAILURE) {
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &klass, &method_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if ((*klass)->type != IS_OBJECT) {
|
||||
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)) {
|
||||
convert_to_string_ex(method_name);
|
||||
lcname = estrndup((*method_name)->value.str.val, (*method_name)->value.str.len);
|
||||
zend_str_tolower(lcname, (*method_name)->value.str.len);
|
||||
if(zend_hash_exists(&(*klass)->value.obj.ce->function_table, lcname, (*method_name)->value.str.len+1)) {
|
||||
efree(lcname);
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
efree(lcname);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool class_exists(string classname)
|
||||
Checks if the class exists */
|
||||
ZEND_FUNCTION(class_exists)
|
||||
{
|
||||
zval **class_name;
|
||||
char *lcname;
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(class_name);
|
||||
lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len);
|
||||
zend_str_tolower(lcname, (*class_name)->value.str.len);
|
||||
if (zend_hash_exists(CG(class_table), lcname, (*class_name)->value.str.len+1)) {
|
||||
efree(lcname);
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
efree(lcname);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool function_exists(string function_name)
|
||||
Checks if the function exists */
|
||||
ZEND_FUNCTION(function_exists)
|
||||
{
|
||||
zval **function_name;
|
||||
char *lcname;
|
||||
int retval;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &function_name)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(function_name);
|
||||
lcname = estrndup((*function_name)->value.str.val, (*function_name)->value.str.len);
|
||||
zend_str_tolower(lcname, (*function_name)->value.str.len);
|
||||
|
||||
retval = zend_hash_exists(EG(function_table), lcname, (*function_name)->value.str.len+1);
|
||||
efree(lcname);
|
||||
|
||||
RETURN_BOOL(retval);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_FUNCTION(leak)
|
||||
{
|
||||
int leakbytes=3;
|
||||
zval **leak;
|
||||
|
||||
if (ARG_COUNT(ht)>=1) {
|
||||
if (getParametersEx(1, &leak)==SUCCESS) {
|
||||
if (ZEND_NUM_ARGS()>=1) {
|
||||
if (zend_get_parameters_ex(1, &leak)==SUCCESS) {
|
||||
convert_to_long_ex(leak);
|
||||
leakbytes = (*leak)->value.lval;
|
||||
}
|
||||
@@ -427,6 +659,16 @@ ZEND_FUNCTION(leak)
|
||||
}
|
||||
|
||||
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
ZEND_FUNCTION(crash)
|
||||
{
|
||||
char *nowhere=NULL;
|
||||
|
||||
memcpy(nowhere, "something", sizeof("something"));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int copy_import_use_file(zend_file_handle *fh, zval *array)
|
||||
{
|
||||
if (fh->filename) {
|
||||
@@ -447,19 +689,211 @@ static int copy_import_use_file(zend_file_handle *fh, zval *array)
|
||||
}
|
||||
|
||||
|
||||
ZEND_FUNCTION(get_used_files)
|
||||
/* {{{ proto array get_required_files(void)
|
||||
Returns an array with the file names that were require_once()'d */
|
||||
ZEND_FUNCTION(get_required_files)
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_apply_with_argument(&CG(used_files), (int (*)(void *, void *)) copy_import_use_file, return_value);
|
||||
zend_hash_apply_with_argument(&CG(used_files), (apply_func_arg_t) copy_import_use_file, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_FUNCTION(get_imported_files)
|
||||
/* {{{ proto array get_included_files(void)
|
||||
Returns an array with the file names that were include_once()'d */
|
||||
ZEND_FUNCTION(get_included_files)
|
||||
{
|
||||
ELS_FETCH();
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_apply_with_argument(&EG(imported_files), (int (*)(void *, void *)) copy_import_use_file, return_value);
|
||||
zend_hash_apply_with_argument(&EG(included_files), (apply_func_arg_t) copy_import_use_file, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto void trigger_error(string messsage [, int error_type])
|
||||
Generates a user-level error/warning/notice message */
|
||||
ZEND_FUNCTION(trigger_error)
|
||||
{
|
||||
int error_type = E_USER_NOTICE;
|
||||
zval **z_error_type, **z_error_message;
|
||||
|
||||
switch(ZEND_NUM_ARGS()) {
|
||||
case 1:
|
||||
if (zend_get_parameters_ex(1, &z_error_message)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (zend_get_parameters_ex(2, &z_error_message, &z_error_type)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_long_ex(z_error_type);
|
||||
error_type = (*z_error_type)->value.lval;
|
||||
switch (error_type) {
|
||||
case E_USER_ERROR:
|
||||
case E_USER_WARNING:
|
||||
case E_USER_NOTICE:
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Invalid error type specified");
|
||||
RETURN_FALSE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
convert_to_string_ex(z_error_message);
|
||||
zend_error(error_type, (*z_error_message)->value.str.val);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto string set_error_handler(string error_handler)
|
||||
Sets a user-defined error handler function. Returns the previously defined error handler, or false on error */
|
||||
ZEND_FUNCTION(set_error_handler)
|
||||
{
|
||||
zval **error_handler;
|
||||
zend_bool had_orig_error_handler=0;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &error_handler)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
convert_to_string_ex(error_handler);
|
||||
if (EG(user_error_handler)) {
|
||||
had_orig_error_handler = 1;
|
||||
*return_value = *EG(user_error_handler);
|
||||
zval_copy_ctor(return_value);
|
||||
zend_ptr_stack_push(&EG(user_error_handlers), EG(user_error_handler));
|
||||
}
|
||||
ALLOC_ZVAL(EG(user_error_handler));
|
||||
|
||||
if (Z_STRLEN_PP(error_handler)==0) { /* unset user-defined handler */
|
||||
FREE_ZVAL(EG(user_error_handler));
|
||||
EG(user_error_handler) = NULL;
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
*EG(user_error_handler) = **error_handler;
|
||||
zval_copy_ctor(EG(user_error_handler));
|
||||
|
||||
if (!had_orig_error_handler) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
|
||||
/* {{{ proto void restore_error_handler(void)
|
||||
Restores the previously defined error handler function */
|
||||
ZEND_FUNCTION(restore_error_handler)
|
||||
{
|
||||
if (EG(user_error_handler)) {
|
||||
zval_ptr_dtor(&EG(user_error_handler));
|
||||
}
|
||||
if (zend_ptr_stack_num_elements(&EG(user_error_handlers))==0) {
|
||||
EG(user_error_handler) = NULL;
|
||||
} else {
|
||||
EG(user_error_handler) = zend_ptr_stack_pop(&EG(user_error_handlers));
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
|
||||
static int copy_class_name(zend_class_entry *ce, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
{
|
||||
zval *array = va_arg(args, zval *);
|
||||
|
||||
if (hash_key->nKeyLength==0 || hash_key->arKey[0]!=0) {
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* {{{ proto array get_declared_classes(void)
|
||||
Returns an array of all declared classes. */
|
||||
ZEND_FUNCTION(get_declared_classes)
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_apply_with_arguments(CG(class_table), (apply_func_args_t)copy_class_name, 1, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
#define LAMBDA_TEMP_FUNCNAME "__lambda_func"
|
||||
|
||||
/* {{{ proto string create_function(string args, string code)
|
||||
Creates an anonymous function, and returns its name (funny, eh?) */
|
||||
ZEND_FUNCTION(create_function)
|
||||
{
|
||||
char *eval_code, *function_name;
|
||||
int eval_code_length, function_name_length;
|
||||
zval **z_function_args, **z_function_code;
|
||||
int retval;
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &z_function_args, &z_function_code)==FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(z_function_args);
|
||||
convert_to_string_ex(z_function_code);
|
||||
|
||||
eval_code_length = sizeof("function " LAMBDA_TEMP_FUNCNAME)
|
||||
+Z_STRLEN_PP(z_function_args)
|
||||
+2 /* for the args parentheses */
|
||||
+2 /* for the curly braces */
|
||||
+Z_STRLEN_PP(z_function_code);
|
||||
|
||||
eval_code = (char *) emalloc(eval_code_length);
|
||||
sprintf(eval_code, "function " LAMBDA_TEMP_FUNCNAME "(%s){%s}", Z_STRVAL_PP(z_function_args), Z_STRVAL_PP(z_function_code));
|
||||
|
||||
retval = zend_eval_string(eval_code, NULL CLS_CC ELS_CC);
|
||||
efree(eval_code);
|
||||
if (retval==SUCCESS) {
|
||||
zend_function *func;
|
||||
|
||||
if (zend_hash_find(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME), (void **) &func)==FAILURE) {
|
||||
zend_error(E_ERROR, "Unexpected inconsistency in create_function()");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
function_add_ref(func);
|
||||
|
||||
function_name = (char *) emalloc(sizeof("0lambda_")+MAX_LENGTH_OF_LONG);
|
||||
|
||||
do {
|
||||
sprintf(function_name, "%clambda_%d", 0, ++EG(lambda_count));
|
||||
function_name_length = strlen(function_name+1)+1;
|
||||
} while (zend_hash_add(EG(function_table), function_name, function_name_length+1, func, sizeof(zend_function), NULL)==FAILURE);
|
||||
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
|
||||
RETURN_STRINGL(function_name, function_name_length, 0);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
|
||||
ZEND_FUNCTION(zend_test_func)
|
||||
{
|
||||
zval *arg1, *arg2;
|
||||
|
||||
zend_get_parameters(ht, 2, &arg1, &arg2);
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
|
||||
+270
-135
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -23,11 +23,10 @@
|
||||
#include "zend_compile.h"
|
||||
#include "zend_llist.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
|
||||
ZEND_API zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
|
||||
ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
|
||||
|
||||
|
||||
#ifndef ZTS
|
||||
@@ -38,18 +37,6 @@ ZEND_API zend_executor_globals executor_globals;
|
||||
|
||||
#define SET_UNUSED(op) (op).op_type = IS_UNUSED
|
||||
|
||||
static int is_not_internal_function(zend_function *function)
|
||||
{
|
||||
return(function->type != ZEND_INTERNAL_FUNCTION);
|
||||
}
|
||||
|
||||
|
||||
static int is_not_internal_class(zend_class_entry *ce)
|
||||
{
|
||||
return(ce->type != ZEND_INTERNAL_CLASS);
|
||||
}
|
||||
|
||||
|
||||
static void free_filename(void *p)
|
||||
{
|
||||
efree(*((char **) p));
|
||||
@@ -71,17 +58,23 @@ static void build_runtime_defined_function_key(zval *result, zval *name, zend_op
|
||||
|
||||
/* 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);
|
||||
result->value.str.val = (char *) emalloc(result->value.str.len); /* Extra null byte is calculated a line before */
|
||||
sprintf(result->value.str.val, "%c%s%s%s", '\0', name->value.str.val, filename, lineno_buf);
|
||||
result->type = IS_STRING;
|
||||
result->refcount = 1;
|
||||
}
|
||||
|
||||
|
||||
static int zend_open_file_dtor_wrapper(zend_file_handle *fh)
|
||||
static void zend_open_file_dtor_wrapper(zend_file_handle *fh)
|
||||
{
|
||||
zend_open_file_dtor(fh);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static void init_compiler_declarables(CLS_D ELS_DC)
|
||||
{
|
||||
CG(declarables).ticks.type = IS_LONG;
|
||||
CG(declarables).ticks.value.lval = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,18 +85,18 @@ void init_compiler(CLS_D ELS_DC)
|
||||
zend_stack_init(&CG(switch_cond_stack));
|
||||
zend_stack_init(&CG(foreach_copy_stack));
|
||||
zend_stack_init(&CG(object_stack));
|
||||
zend_stack_init(&CG(declare_stack));
|
||||
CG(active_class_entry) = NULL;
|
||||
zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0);
|
||||
zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0);
|
||||
zend_llist_init(&CG(filenames_list), sizeof(char *), free_filename, 0);
|
||||
CG(short_tags) = ZEND_UV(short_tags);
|
||||
CG(asp_tags) = ZEND_UV(asp_tags);
|
||||
CG(handle_op_arrays) = 1;
|
||||
zend_hash_apply(&module_registry, (int (*)(void *)) module_registry_request_startup);
|
||||
init_resource_list(ELS_C);
|
||||
CG(in_compilation) = 0;
|
||||
zend_init_rsrc_list(ELS_C);
|
||||
CG(unclean_shutdown) = 0;
|
||||
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_open_file_dtor, 0);
|
||||
zend_hash_init(&CG(used_files), 5, NULL, (int (*)(void *)) zend_open_file_dtor_wrapper, 0);
|
||||
zend_hash_init(&CG(used_files), 5, NULL, (void (*)(void *)) zend_open_file_dtor_wrapper, 0);
|
||||
init_compiler_declarables(CLS_C ELS_CC);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,9 +107,8 @@ void shutdown_compiler(CLS_D)
|
||||
zend_stack_destroy(&CG(switch_cond_stack));
|
||||
zend_stack_destroy(&CG(foreach_copy_stack));
|
||||
zend_stack_destroy(&CG(object_stack));
|
||||
zend_stack_destroy(&CG(declare_stack));
|
||||
zend_llist_destroy(&CG(filenames_list));
|
||||
zend_hash_apply(CG(function_table), (int (*)(void *)) is_not_internal_function);
|
||||
zend_hash_apply(CG(class_table), (int (*)(void *)) is_not_internal_class);
|
||||
zend_llist_destroy(&CG(open_files));
|
||||
zend_hash_destroy(&CG(used_files));
|
||||
}
|
||||
@@ -140,15 +132,28 @@ ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename)
|
||||
CG(compiled_filename) = original_compiled_filename;
|
||||
}
|
||||
|
||||
ZEND_API char *zend_get_compiled_filename()
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
ZEND_API char *zend_get_compiled_filename(CLS_D)
|
||||
{
|
||||
return CG(compiled_filename);
|
||||
}
|
||||
|
||||
|
||||
static int get_temporary_variable(zend_op_array *op_array)
|
||||
ZEND_API int zend_get_compiled_lineno(CLS_D)
|
||||
{
|
||||
return CG(zend_lineno);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API zend_bool zend_is_compiling()
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
return CG(in_compilation);
|
||||
}
|
||||
|
||||
|
||||
static zend_uint get_temporary_variable(zend_op_array *op_array)
|
||||
{
|
||||
return (op_array->T)++;
|
||||
}
|
||||
@@ -269,6 +274,12 @@ void fetch_array_dim(znode *result, znode *parent, znode *dim CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void fetch_string_offset(znode *result, znode *parent, znode *offset CLS_DC)
|
||||
{
|
||||
fetch_array_dim(result, parent, offset CLS_CC);
|
||||
}
|
||||
|
||||
|
||||
void do_print(znode *result, znode *arg CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -384,9 +395,8 @@ void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC)
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_JMPZNZ;
|
||||
opline->result = *expr; /* the conditional expression */
|
||||
opline->op1 = *expr; /* the conditional expression */
|
||||
second_semicolon_token->u.opline_num = for_cond_op_number;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
|
||||
@@ -397,7 +407,7 @@ void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CL
|
||||
|
||||
opline->opcode = ZEND_JMP;
|
||||
opline->op1.u.opline_num = cond_start->u.opline_num;
|
||||
CG(active_op_array)->opcodes[second_semicolon_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array));
|
||||
CG(active_op_array)->opcodes[second_semicolon_token->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
@@ -546,6 +556,9 @@ void do_end_variable_parse(int type, int arg_offset CLS_DC)
|
||||
opline->opcode += 9; /* 3+3+3 */
|
||||
opline->extended_value = arg_offset;
|
||||
break;
|
||||
case BP_VAR_UNSET:
|
||||
opline->opcode += 12; /* 3+3+3+3 */
|
||||
break;
|
||||
}
|
||||
le = le->next;
|
||||
}
|
||||
@@ -632,33 +645,41 @@ void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
void do_free(znode *op1 CLS_DC)
|
||||
{
|
||||
if (op1->op_type==IS_TMP_VAR) {
|
||||
zend_op *last_opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
if ((last_opline->opcode == ZEND_DO_FCALL) || (last_opline->opcode == ZEND_DO_FCALL_BY_NAME)) {
|
||||
last_opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
} else {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_FREE;
|
||||
opline->op1 = *op1;
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
opline->opcode = ZEND_FREE;
|
||||
opline->op1 = *op1;
|
||||
SET_UNUSED(opline->op2);
|
||||
} else if (op1->op_type==IS_VAR) {
|
||||
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
|
||||
|
||||
if (opline->opcode == ZEND_END_SILENCE) {
|
||||
opline--;
|
||||
}
|
||||
if (opline->result.op_type == op1->op_type
|
||||
&& 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
|
||||
*/
|
||||
while (opline>CG(active_op_array)->opcodes) {
|
||||
/* This should be an object instantiation
|
||||
* Find JMP_NO_CTOR, mark the preceding ASSIGN and the
|
||||
* proceeding INIT_FCALL_BY_NAME as unused
|
||||
*/
|
||||
if (opline->opcode == ZEND_JMP_NO_CTOR) {
|
||||
(opline-1)->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
(opline+1)->op1.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
break;
|
||||
} else if (opline->opcode == ZEND_FETCH_DIM_R
|
||||
&& opline->op1.op_type == IS_VAR
|
||||
&& opline->op1.u.var == op1->u.var) {
|
||||
/* This should the end of a list() construct
|
||||
* Mark its result as unused
|
||||
*/
|
||||
opline->extended_value = ZEND_FETCH_STANDARD;
|
||||
break;
|
||||
} else if (opline->result.op_type==IS_VAR
|
||||
&& opline->result.u.var == op1->u.var) {
|
||||
break;
|
||||
}
|
||||
opline--;
|
||||
}
|
||||
@@ -667,7 +688,7 @@ void do_free(znode *op1 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method CLS_DC)
|
||||
void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC)
|
||||
{
|
||||
zend_op_array op_array;
|
||||
char *name = function_name->u.constant.value.str.val;
|
||||
@@ -677,9 +698,11 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
function_token->u.op_array = CG(active_op_array);
|
||||
zend_str_tolower(name, name_len);
|
||||
|
||||
init_op_array(&op_array, INITIAL_OP_ARRAY_SIZE);
|
||||
init_op_array(&op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
|
||||
|
||||
op_array.function_name = name;
|
||||
op_array.arg_types = NULL;
|
||||
op_array.return_reference = return_reference;
|
||||
|
||||
if (is_method) {
|
||||
zend_hash_update(&CG(active_class_entry)->function_table, name, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array));
|
||||
@@ -724,6 +747,7 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
|
||||
void do_end_function_declaration(znode *function_token CLS_DC)
|
||||
{
|
||||
do_return(NULL, 0 CLS_CC);
|
||||
pass_two(CG(active_op_array));
|
||||
CG(active_op_array) = function_token->u.op_array;
|
||||
|
||||
@@ -740,24 +764,26 @@ void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, un
|
||||
opline->opcode = op;
|
||||
opline->result = *var;
|
||||
opline->op1 = *offset;
|
||||
if ((op == ZEND_RECV_INIT) && initialization) {
|
||||
if ((op == ZEND_RECV_INIT)) {
|
||||
opline->op2 = *initialization;
|
||||
} else {
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
if (pass_type==BYREF_FORCE && !CG(active_op_array)->arg_types) {
|
||||
int i;
|
||||
if (!CG(active_op_array)->arg_types) {
|
||||
if (pass_type==BYREF_FORCE) {
|
||||
int i;
|
||||
|
||||
CG(active_op_array)->arg_types = (unsigned char *) emalloc(sizeof(unsigned char)*(offset->u.constant.value.lval+1));
|
||||
for (i=1; i<offset->u.constant.value.lval; i++) {
|
||||
CG(active_op_array)->arg_types[i] = BYREF_NONE;
|
||||
CG(active_op_array)->arg_types = (unsigned char *) emalloc(sizeof(unsigned char)*(offset->u.constant.value.lval+1));
|
||||
for (i=1; i<offset->u.constant.value.lval; i++) {
|
||||
CG(active_op_array)->arg_types[i] = BYREF_NONE;
|
||||
}
|
||||
CG(active_op_array)->arg_types[0]=(unsigned char) offset->u.constant.value.lval;
|
||||
CG(active_op_array)->arg_types[offset->u.constant.value.lval] = pass_type;
|
||||
}
|
||||
CG(active_op_array)->arg_types[0]=(unsigned char) offset->u.constant.value.lval;
|
||||
}
|
||||
if (CG(active_op_array)->arg_types) {
|
||||
} else {
|
||||
CG(active_op_array)->arg_types = (unsigned char *) erealloc(CG(active_op_array)->arg_types, sizeof(unsigned char)*(offset->u.constant.value.lval+1));
|
||||
CG(active_op_array)->arg_types[0]=(unsigned char) offset->u.constant.value.lval;
|
||||
CG(active_op_array)->arg_types[offset->u.constant.value.lval] = pass_type;
|
||||
CG(active_op_array)->arg_types[0]++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -839,7 +865,7 @@ void do_end_function_call(znode *function_name, znode *result, znode *argument_l
|
||||
}
|
||||
opline->op1 = *function_name;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->result.op_type = IS_VAR;
|
||||
*result = opline->result;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.constant.value.lval = is_method;
|
||||
@@ -855,8 +881,22 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
int original_op=op;
|
||||
zend_function **function_ptr_ptr, *function_ptr;
|
||||
|
||||
|
||||
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
|
||||
function_ptr = *function_ptr_ptr;
|
||||
|
||||
if (original_op==ZEND_SEND_REF
|
||||
&& !CG(allow_call_time_pass_reference)) {
|
||||
zend_error(E_COMPILE_WARNING,
|
||||
"Call-time pass-by-reference has been deprecated - argument passed by value; "
|
||||
"If you would like to pass it by reference, modify the declaration of %s(). "
|
||||
"If you would like to enable call-time pass-by-reference, you can set "
|
||||
"allow_call_time_pass_reference to true in your INI file. "
|
||||
"However, future versions may not support this any longer. ",
|
||||
(function_ptr?function_ptr->common.function_name:"[runtime function name]"),
|
||||
offset+1);
|
||||
}
|
||||
|
||||
if (function_ptr) {
|
||||
arg_types = function_ptr->common.arg_types;
|
||||
} else {
|
||||
@@ -920,7 +960,7 @@ static int generate_free_switch_expr(zend_switch_entry *switch_entry CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
if (switch_entry->cond.op_type == IS_UNUSED) {
|
||||
if (switch_entry->cond.op_type!=IS_VAR && switch_entry->cond.op_type!=IS_TMP_VAR) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -929,6 +969,7 @@ static int generate_free_switch_expr(zend_switch_entry *switch_entry CLS_DC)
|
||||
opline->opcode = ZEND_SWITCH_FREE;
|
||||
opline->op1 = switch_entry->cond;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -936,48 +977,66 @@ static int generate_free_foreach_copy(znode *foreach_copy CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
if (foreach_copy->op_type == IS_UNUSED) {
|
||||
if (foreach_copy->op_type!=IS_VAR && foreach_copy->op_type!=IS_TMP_VAR) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_FREE;
|
||||
opline->opcode = ZEND_SWITCH_FREE;
|
||||
opline->op1 = *foreach_copy;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void do_return(znode *expr CLS_DC)
|
||||
void do_return(znode *expr, int do_end_vparse CLS_DC)
|
||||
{
|
||||
zend_op *opline;
|
||||
|
||||
if (do_end_vparse) {
|
||||
if (CG(active_op_array)->return_reference) {
|
||||
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
} else {
|
||||
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
}
|
||||
}
|
||||
#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);
|
||||
zend_stack_apply_with_argument(&CG(switch_cond_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element, void *)) generate_free_switch_expr CLS_CC);
|
||||
zend_stack_apply_with_argument(&CG(foreach_copy_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element, void *)) generate_free_foreach_copy 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);
|
||||
zend_stack_apply(&CG(switch_cond_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element)) generate_free_switch_expr);
|
||||
zend_stack_apply(&CG(foreach_copy_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element)) generate_free_foreach_copy);
|
||||
#endif
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_RETURN;
|
||||
|
||||
if (expr) {
|
||||
opline->op1 = *expr;
|
||||
} else {
|
||||
var_uninit(&opline->op1.u.constant);
|
||||
opline->op1.op_type = IS_CONST;
|
||||
INIT_PZVAL(&opline->op1.u.constant);
|
||||
INIT_ZVAL(opline->op1.u.constant);
|
||||
}
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
|
||||
|
||||
static void function_add_ref(zend_function *function)
|
||||
ZEND_API void function_add_ref(zend_function *function)
|
||||
{
|
||||
if (function->type == ZEND_USER_FUNCTION) {
|
||||
(*((zend_op_array *) function)->refcount)++;
|
||||
zend_op_array *op_array = &function->op_array;
|
||||
|
||||
(*op_array->refcount)++;
|
||||
if (op_array->static_variables) {
|
||||
HashTable *static_variables = op_array->static_variables;
|
||||
zval *tmp_zval;
|
||||
|
||||
ALLOC_HASHTABLE(op_array->static_variables);
|
||||
zend_hash_init(op_array->static_variables, 2, NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(op_array->static_variables, static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_zval, sizeof(zval *));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -996,6 +1055,18 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
|
||||
}
|
||||
}
|
||||
|
||||
void do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce)
|
||||
{
|
||||
zend_function tmp_zend_function;
|
||||
zval *tmp;
|
||||
|
||||
/* Perform inheritance */
|
||||
zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0);
|
||||
zend_hash_merge(&ce->function_table, &parent_ce->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function), 0);
|
||||
ce->parent = parent_ce;
|
||||
do_inherit_parent_constructor(ce);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time)
|
||||
{
|
||||
@@ -1003,14 +1074,15 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
case ZEND_DECLARE_FUNCTION: {
|
||||
zend_function *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)++;
|
||||
zend_hash_find(function_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void *) &function);
|
||||
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) {
|
||||
if (!compile_time) {
|
||||
zend_error(E_ERROR, "Cannot redeclare %s()", opline->op2.u.constant.value.str.val);
|
||||
}
|
||||
return FAILURE;
|
||||
} else {
|
||||
(*function->op_array.refcount)++;
|
||||
function->op_array.static_variables = NULL; /* NULL out the unbound function */
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -1018,7 +1090,10 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
case ZEND_DECLARE_CLASS: {
|
||||
zend_class_entry *ce;
|
||||
|
||||
zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce);
|
||||
if (zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce)==FAILURE) {
|
||||
zend_error(E_ERROR, "Internal Zend error - Missing class information for %s", opline->op1.u.constant.value.str.val);
|
||||
return FAILURE;
|
||||
}
|
||||
(*ce->refcount)++;
|
||||
if (zend_hash_add(class_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, ce, sizeof(zend_class_entry), NULL)==FAILURE) {
|
||||
(*ce->refcount)--;
|
||||
@@ -1034,11 +1109,10 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
case ZEND_DECLARE_INHERITED_CLASS: {
|
||||
zend_class_entry *ce, *parent_ce;
|
||||
char *class_name, *parent_name;
|
||||
zend_function tmp_zend_function;
|
||||
zval *tmp;
|
||||
int found_ce;
|
||||
|
||||
zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce);
|
||||
(*ce->refcount)++;
|
||||
|
||||
found_ce = zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce);
|
||||
|
||||
/* Restore base class / derived class names */
|
||||
parent_name = opline->op2.u.constant.value.str.val;
|
||||
@@ -1048,6 +1122,13 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
}
|
||||
*class_name++ = 0;
|
||||
|
||||
if (found_ce==FAILURE) {
|
||||
zend_error(E_ERROR, "Cannot redeclare class %s", class_name);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
(*ce->refcount)++;
|
||||
|
||||
/* Obtain parent class */
|
||||
if (zend_hash_find(class_table, parent_name, strlen(parent_name)+1, (void **) &parent_ce)==FAILURE) {
|
||||
if (!compile_time) {
|
||||
@@ -1058,11 +1139,7 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
/* Perform inheritence */
|
||||
zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0);
|
||||
zend_hash_merge(&ce->function_table, &parent_ce->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function), 0);
|
||||
ce->parent = parent_ce;
|
||||
do_inherit_parent_constructor(ce);
|
||||
do_inheritance(ce, parent_ce);
|
||||
|
||||
/* Register the derived class */
|
||||
if (zend_hash_add(class_table, class_name, strlen(class_name)+1, ce, sizeof(zend_class_entry), NULL)==FAILURE) {
|
||||
@@ -1072,8 +1149,10 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
(*ce->refcount)--;
|
||||
zend_hash_destroy(&ce->function_table);
|
||||
zend_hash_destroy(&ce->default_properties);
|
||||
*(class_name-1) = ':';
|
||||
return FAILURE;
|
||||
}
|
||||
*(class_name-1) = ':';
|
||||
return SUCCESS;
|
||||
}
|
||||
break;
|
||||
@@ -1105,6 +1184,8 @@ void do_early_binding(CLS_D)
|
||||
zval_dtor(&opline->op1.u.constant);
|
||||
zval_dtor(&opline->op2.u.constant);
|
||||
opline->opcode = ZEND_NOP;
|
||||
memset(&opline->op1, 0, sizeof(znode));
|
||||
memset(&opline->op2, 0, sizeof(znode));
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
@@ -1187,7 +1268,7 @@ void do_do_while_begin(CLS_D)
|
||||
}
|
||||
|
||||
|
||||
void do_do_while_end(znode *do_token, znode *expr CLS_DC)
|
||||
void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -1196,7 +1277,7 @@ void do_do_while_end(znode *do_token, znode *expr CLS_DC)
|
||||
opline->op2.u.opline_num = do_token->u.opline_num;
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
do_end_loop(do_token->u.opline_num CLS_CC);
|
||||
do_end_loop(expr_open_bracket->u.opline_num CLS_CC);
|
||||
|
||||
DEC_BPC(CG(active_op_array));
|
||||
}
|
||||
@@ -1223,17 +1304,12 @@ void do_brk_cont(int op, znode *expr CLS_DC)
|
||||
void do_switch_cond(znode *cond CLS_DC)
|
||||
{
|
||||
zend_switch_entry switch_entry;
|
||||
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
|
||||
|
||||
switch_entry.cond = *cond;
|
||||
switch_entry.default_case = -1;
|
||||
switch_entry.control_var = -1;
|
||||
zend_stack_push(&CG(switch_cond_stack), (void *) &switch_entry, sizeof(switch_entry));
|
||||
|
||||
if (opline->result.op_type == IS_VAR) {
|
||||
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
|
||||
do_begin_loop(CLS_C);
|
||||
|
||||
INC_BPC(CG(active_op_array));
|
||||
@@ -1248,7 +1324,7 @@ void do_switch_end(znode *case_list CLS_DC)
|
||||
|
||||
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
|
||||
|
||||
if (case_list->u.opline_num != -1) { /* empty switch */
|
||||
if (case_list->op_type != IS_UNUSED) { /* non-empty switch */
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
|
||||
CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
|
||||
@@ -1269,11 +1345,13 @@ void do_switch_end(znode *case_list CLS_DC)
|
||||
CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].cont = CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].brk = get_next_op_number(CG(active_op_array));
|
||||
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*/
|
||||
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_VAR || switch_entry_ptr->cond.op_type==IS_TMP_VAR) {
|
||||
/* emit free for the switch condition*/
|
||||
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);
|
||||
}
|
||||
@@ -1313,7 +1391,7 @@ void do_case_before_statement(znode *case_list, znode *case_token, znode *case_e
|
||||
SET_UNUSED(opline->op2);
|
||||
case_token->u.opline_num = next_op_number;
|
||||
|
||||
if (case_list->u.opline_num==-1) {
|
||||
if (case_list->op_type==IS_UNUSED) {
|
||||
return;
|
||||
}
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
@@ -1372,7 +1450,7 @@ void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
|
||||
switch_entry_ptr->default_case = next_op_number;
|
||||
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
if (case_list->u.opline_num==-1) {
|
||||
if (case_list->op_type==IS_UNUSED) {
|
||||
return;
|
||||
}
|
||||
CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
|
||||
@@ -1382,7 +1460,7 @@ void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
|
||||
void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
int runtime_inheritence = 0;
|
||||
int runtime_inheritance = 0;
|
||||
|
||||
if (CG(active_class_entry)) {
|
||||
zend_error(E_COMPILE_ERROR, "Class declarations may not be nested");
|
||||
@@ -1398,7 +1476,7 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
zend_str_tolower(CG(class_entry).name, CG(class_entry).name_length);
|
||||
|
||||
zend_hash_init(&CG(class_entry).function_table, 10, NULL, ZEND_FUNCTION_DTOR, 0);
|
||||
zend_hash_init(&CG(class_entry).default_properties, 10, NULL, PVAL_PTR_DTOR, 0);
|
||||
zend_hash_init(&CG(class_entry).default_properties, 10, NULL, ZVAL_PTR_DTOR, 0);
|
||||
|
||||
/* code for inheritance from parent class */
|
||||
if (parent_class_name) {
|
||||
@@ -1410,16 +1488,16 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
|
||||
if (zend_hash_find(CG(class_table), parent_class_name->u.constant.value.str.val, parent_class_name->u.constant.value.str.len+1, (void **) &parent_class)==SUCCESS) {
|
||||
/* copy functions */
|
||||
zend_hash_copy(&CG(class_entry).function_table, &parent_class->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function));
|
||||
zend_hash_copy(&CG(class_entry).function_table, &parent_class->function_table, (copy_ctor_func_t) function_add_ref, &tmp_zend_function, sizeof(zend_function));
|
||||
|
||||
/* copy default properties */
|
||||
zend_hash_copy(&CG(class_entry).default_properties, &parent_class->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
zend_hash_copy(&CG(class_entry).default_properties, &parent_class->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
|
||||
CG(class_entry).parent = parent_class;
|
||||
|
||||
zval_dtor(&parent_class_name->u.constant);
|
||||
} else {
|
||||
runtime_inheritence = 1;
|
||||
runtime_inheritance = 1;
|
||||
CG(class_entry).parent = NULL;
|
||||
}
|
||||
} else {
|
||||
@@ -1436,7 +1514,7 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.refcount = 1;
|
||||
if (runtime_inheritence) {
|
||||
if (runtime_inheritance) {
|
||||
char *full_class_name;
|
||||
|
||||
opline->op2.u.constant.value.str.len = parent_class_name->u.constant.value.str.len+1+CG(class_entry).name_length;
|
||||
@@ -1471,7 +1549,9 @@ void do_end_class_declaration(CLS_D)
|
||||
void do_declare_property(znode *var_name, znode *value CLS_DC)
|
||||
{
|
||||
if (value) {
|
||||
zval *property = (zval *) emalloc(sizeof(zval));
|
||||
zval *property;
|
||||
|
||||
ALLOC_ZVAL(property);
|
||||
|
||||
*property = value->u.constant;
|
||||
zend_hash_update(&CG(active_class_entry)->default_properties, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL);
|
||||
@@ -1605,7 +1685,7 @@ void do_shell_exec(znode *result, znode *cmd CLS_DC)
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_DO_FCALL;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->op1.u.constant.value.str.val = estrndup("shell_exec",sizeof("shell_exec")-1);
|
||||
opline->op1.u.constant.value.str.len = sizeof("shell_exec")-1;
|
||||
INIT_PZVAL(&opline->op1.u.constant);
|
||||
@@ -1660,8 +1740,9 @@ void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref
|
||||
|
||||
void do_add_static_array_element(znode *result, znode *offset, znode *expr)
|
||||
{
|
||||
zval *element = (zval *) emalloc(sizeof(zval));
|
||||
zval *element;
|
||||
|
||||
ALLOC_ZVAL(element);
|
||||
*element = expr->u.constant;
|
||||
if (offset) {
|
||||
switch (offset->u.constant.type) {
|
||||
@@ -1686,7 +1767,7 @@ void do_add_list_element(znode *element CLS_DC)
|
||||
if (element) {
|
||||
lle.var = *element;
|
||||
zend_llist_copy(&lle.dimensions, &CG(dimension_llist));
|
||||
zend_llist_add_element(&CG(list_llist), &lle);
|
||||
zend_llist_prepend_element(&CG(list_llist), &lle);
|
||||
}
|
||||
(*((int *)CG(dimension_llist).tail->data))++;
|
||||
}
|
||||
@@ -1749,21 +1830,13 @@ void do_list_end(znode *result, znode *expr CLS_DC)
|
||||
opline->op2.u.constant.type = IS_LONG;
|
||||
opline->op2.u.constant.value.lval = *((int *) dimension->data);
|
||||
INIT_PZVAL(&opline->op2.u.constant);
|
||||
if (le == CG(list_llist).tail) {
|
||||
opline->extended_value = ZEND_FETCH_STANDARD;
|
||||
} else {
|
||||
opline->extended_value = ZEND_FETCH_ADD_LOCK;
|
||||
}
|
||||
opline->extended_value = ZEND_FETCH_ADD_LOCK;
|
||||
last_container = opline->result;
|
||||
dimension = dimension->next;
|
||||
}
|
||||
((list_llist_element *) le->data)->value = last_container;
|
||||
zend_llist_destroy(&((list_llist_element *) le->data)->dimensions);
|
||||
le = le->next;
|
||||
}
|
||||
|
||||
le = CG(list_llist).head;
|
||||
while (le) {
|
||||
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value CLS_CC);
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
le = le->next;
|
||||
@@ -1778,17 +1851,19 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
znode lval;
|
||||
znode result;
|
||||
|
||||
if (fetch_type==ZEND_FETCH_STATIC && static_assignment) {
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
convert_to_string(&varname->u.constant);
|
||||
*tmp = static_assignment->u.constant;
|
||||
if (!CG(active_op_array)->static_variables) {
|
||||
CG(active_op_array)->static_variables = (HashTable *) emalloc(sizeof(HashTable));
|
||||
zend_hash_init(CG(active_op_array)->static_variables, 2, NULL, PVAL_PTR_DTOR, 0);
|
||||
ALLOC_HASHTABLE(CG(active_op_array)->static_variables);
|
||||
zend_hash_init(CG(active_op_array)->static_variables, 2, NULL, ZVAL_PTR_DTOR, 0);
|
||||
}
|
||||
zend_hash_update_ptr(CG(active_op_array)->static_variables, varname->u.constant.value.str.val, varname->u.constant.value.str.len+1, tmp, sizeof(zval *), NULL);
|
||||
zend_hash_update(CG(active_op_array)->static_variables, varname->u.constant.value.str.val, varname->u.constant.value.str.len+1, &tmp, sizeof(zval *), NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -1799,14 +1874,14 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
|
||||
opline->op1 = *varname;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.fetch_type = fetch_type;
|
||||
result = opline->result;
|
||||
|
||||
if (varname->op_type == IS_CONST) {
|
||||
zval_copy_ctor(&varname->u.constant);
|
||||
}
|
||||
fetch_simple_variable(&lval, varname, 0 CLS_CC); /* Relies on the fact that the default fetch is BP_VAR_W */
|
||||
|
||||
|
||||
do_assign_ref(NULL, &lval, &opline->result CLS_CC);
|
||||
do_assign_ref(NULL, &lval, &result CLS_CC);
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
|
||||
@@ -1820,7 +1895,7 @@ void do_cast(znode *result, znode *expr, int type CLS_DC)
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *expr;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.constant.type = type;
|
||||
opline->extended_value = type;
|
||||
*result = opline->result;
|
||||
}
|
||||
|
||||
@@ -1830,12 +1905,29 @@ void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_INCLUDE_OR_EVAL;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *op1;
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.constant.value.lval = type;
|
||||
*result = opline->result;
|
||||
if (type==ZEND_REQUIRE) {
|
||||
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
if (filename->op_type==IS_CONST
|
||||
&& filename->u.constant.type==IS_STRING) {
|
||||
require_filename(filename->u.constant.value.str.val, unique CLS_CC);
|
||||
zval_dtor(&filename->u.constant);
|
||||
} else {
|
||||
znode result;
|
||||
|
||||
do_include_or_eval(ZEND_REQUIRE, &result, filename CLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1860,11 +1952,11 @@ void do_unset(znode *variable CLS_DC)
|
||||
last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
|
||||
|
||||
switch (last_op->opcode) {
|
||||
case ZEND_FETCH_R:
|
||||
case ZEND_FETCH_UNSET:
|
||||
last_op->opcode = ZEND_UNSET_VAR;
|
||||
break;
|
||||
case ZEND_FETCH_DIM_R:
|
||||
case ZEND_FETCH_OBJ_R:
|
||||
case ZEND_FETCH_DIM_UNSET:
|
||||
case ZEND_FETCH_OBJ_UNSET:
|
||||
last_op->opcode = ZEND_UNSET_DIM_OBJ;
|
||||
break;
|
||||
|
||||
@@ -1895,7 +1987,7 @@ void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_t
|
||||
|
||||
/* Preform array reset */
|
||||
opline->opcode = ZEND_FE_RESET;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *array;
|
||||
SET_UNUSED(opline->op2);
|
||||
@@ -1981,7 +2073,7 @@ void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
|
||||
|
||||
do_end_loop(foreach_token->u.opline_num CLS_CC);
|
||||
|
||||
do_free(open_brackets_token CLS_CC);
|
||||
generate_free_foreach_copy(open_brackets_token CLS_CC);
|
||||
|
||||
zend_stack_del_top(&CG(foreach_copy_stack));
|
||||
|
||||
@@ -1989,6 +2081,33 @@ void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_declare_begin(CLS_D)
|
||||
{
|
||||
zend_stack_push(&CG(declare_stack), &CG(declarables), sizeof(zend_declarables));
|
||||
}
|
||||
|
||||
|
||||
void do_declare_stmt(znode *var, znode *val CLS_DC)
|
||||
{
|
||||
convert_to_string(&var->u.constant);
|
||||
|
||||
if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "ticks", sizeof("ticks")-1)) {
|
||||
convert_to_long(&val->u.constant);
|
||||
CG(declarables).ticks = val->u.constant;
|
||||
}
|
||||
zval_dtor(&var->u.constant);
|
||||
}
|
||||
|
||||
|
||||
void do_declare_end(CLS_D)
|
||||
{
|
||||
zend_declarables *declarables;
|
||||
|
||||
zend_stack_top(&CG(declare_stack), (void **) &declarables);
|
||||
CG(declarables) = *declarables;
|
||||
}
|
||||
|
||||
|
||||
void do_end_heredoc(CLS_D)
|
||||
{
|
||||
int opline_num = get_next_op_number(CG(active_op_array))-1;
|
||||
@@ -2099,6 +2218,7 @@ void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colo
|
||||
DEC_BPC(CG(active_op_array));
|
||||
}
|
||||
|
||||
|
||||
void do_extended_info(CLS_D)
|
||||
{
|
||||
zend_op *opline;
|
||||
@@ -2114,6 +2234,7 @@ void do_extended_info(CLS_D)
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
|
||||
|
||||
void do_extended_fcall_begin(CLS_D)
|
||||
{
|
||||
zend_op *opline;
|
||||
@@ -2145,6 +2266,18 @@ void do_extended_fcall_end(CLS_D)
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
|
||||
void do_ticks(CLS_D)
|
||||
{
|
||||
if (CG(declarables).ticks.value.lval) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_TICKS;
|
||||
opline->op1.u.constant = CG(declarables).ticks;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
SET_UNUSED(opline->op2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int zendlex(znode *zendlval CLS_DC)
|
||||
{
|
||||
@@ -2156,7 +2289,6 @@ int zendlex(znode *zendlval CLS_DC)
|
||||
case T_COMMENT:
|
||||
case T_OPEN_TAG:
|
||||
case T_WHITESPACE:
|
||||
case T_PHP_TRACK_VARS:
|
||||
retval = zendlex(zendlval CLS_CC);
|
||||
break;
|
||||
case T_CLOSE_TAG:
|
||||
@@ -2165,6 +2297,9 @@ int zendlex(znode *zendlval CLS_DC)
|
||||
case T_OPEN_TAG_WITH_ECHO:
|
||||
retval = T_ECHO;
|
||||
break;
|
||||
case T_END_HEREDOC:
|
||||
efree(zendlval->u.constant.value.str.val);
|
||||
break;
|
||||
}
|
||||
|
||||
INIT_PZVAL(&zendlval->u.constant);
|
||||
|
||||
+178
-163
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -58,20 +58,20 @@ typedef struct _znode {
|
||||
union {
|
||||
zval constant;
|
||||
|
||||
int var;
|
||||
int opline_num;
|
||||
int fetch_type;
|
||||
zend_uint var;
|
||||
zend_uint opline_num; /* Needs to be signed */
|
||||
zend_uint fetch_type;
|
||||
zend_op_array *op_array;
|
||||
struct {
|
||||
int var; /* dummy */
|
||||
int type;
|
||||
zend_uint var; /* dummy */
|
||||
zend_uint type;
|
||||
} EA;
|
||||
} u;
|
||||
} znode;
|
||||
|
||||
|
||||
typedef struct _zend_op {
|
||||
int opcode;
|
||||
zend_uchar opcode;
|
||||
znode result;
|
||||
znode op1;
|
||||
znode op2;
|
||||
@@ -89,23 +89,22 @@ typedef struct _zend_brk_cont_element {
|
||||
|
||||
|
||||
struct _zend_op_array {
|
||||
int type; /* MUST be the first element of this struct! */
|
||||
zend_uchar type; /* MUST be the first element of this struct! */
|
||||
|
||||
unsigned char *arg_types; /* MUST be the second element of this struct! */
|
||||
zend_uchar *arg_types; /* MUST be the second element of this struct! */
|
||||
char *function_name; /* MUST be the third element of this struct! */
|
||||
|
||||
int *refcount;
|
||||
zend_uint *refcount;
|
||||
|
||||
zend_op *opcodes;
|
||||
int last, size;
|
||||
|
||||
int T;
|
||||
zend_uint last, size;
|
||||
|
||||
zend_uint T;
|
||||
|
||||
zend_brk_cont_element *brk_cont_array;
|
||||
int last_brk_cont;
|
||||
int current_brk_cont;
|
||||
unsigned char uses_globals;
|
||||
zend_uint last_brk_cont;
|
||||
zend_uint current_brk_cont;
|
||||
zend_bool uses_globals;
|
||||
|
||||
/* static variables support */
|
||||
HashTable *static_variables;
|
||||
@@ -115,31 +114,44 @@ struct _zend_op_array {
|
||||
int last_executed_op_number;
|
||||
int backpatch_count;
|
||||
#endif
|
||||
zend_bool return_reference;
|
||||
zend_bool done_pass_two;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
};
|
||||
|
||||
|
||||
typedef struct _zend_internal_function {
|
||||
int type; /* MUST be the first element of this struct! */
|
||||
zend_uchar type; /* MUST be the first element of this struct! */
|
||||
|
||||
unsigned char *arg_types; /* MUST be the second element of this struct */
|
||||
zend_uchar *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);
|
||||
} zend_internal_function;
|
||||
|
||||
|
||||
typedef struct _zend_overloaded_function {
|
||||
zend_uchar type; /* MUST be the first element of this struct! */
|
||||
|
||||
zend_uchar *arg_types; /* MUST be the second element of this struct */
|
||||
char *function_name; /* MUST be the third element of this struct */
|
||||
|
||||
zend_uint var;
|
||||
} zend_overloaded_function;
|
||||
|
||||
|
||||
typedef union _zend_function {
|
||||
int type; /* MUST be the first element of this struct! */
|
||||
zend_uchar type; /* MUST be the first element of this struct! */
|
||||
struct {
|
||||
int type; /* never used */
|
||||
unsigned char *arg_types;
|
||||
zend_uchar type; /* never used */
|
||||
zend_uchar *arg_types;
|
||||
char *function_name;
|
||||
} common;
|
||||
|
||||
zend_op_array op_array;
|
||||
zend_internal_function internal_function;
|
||||
zend_overloaded_function overloaded_function;
|
||||
} zend_function;
|
||||
|
||||
|
||||
@@ -165,7 +177,7 @@ typedef struct _list_llist_element {
|
||||
|
||||
|
||||
typedef struct _zend_file_handle {
|
||||
int type;
|
||||
zend_uchar type;
|
||||
char *filename;
|
||||
char *opened_path;
|
||||
union {
|
||||
@@ -179,7 +191,6 @@ typedef struct _zend_file_handle {
|
||||
} zend_file_handle;
|
||||
|
||||
|
||||
#include "zend_globals.h"
|
||||
|
||||
#define IS_CONST (1<<0)
|
||||
#define IS_TMP_VAR (1<<1)
|
||||
@@ -189,14 +200,20 @@ typedef struct _zend_file_handle {
|
||||
|
||||
#define EXT_TYPE_UNUSED (1<<0)
|
||||
|
||||
#include "zend_globals.h"
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
void init_compiler(CLS_D ELS_DC);
|
||||
void shutdown_compiler(CLS_D);
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
extern ZEND_API zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
|
||||
extern ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
|
||||
|
||||
void zend_activate(CLS_D ELS_DC);
|
||||
void zend_deactivate(CLS_D ELS_DC);
|
||||
void zend_activate_modules(void);
|
||||
void zend_deactivate_modules(void);
|
||||
|
||||
|
||||
int lex_scan(zval *zendlval CLS_DC);
|
||||
void startup_scanner(CLS_D);
|
||||
@@ -204,14 +221,14 @@ void shutdown_scanner(CLS_D);
|
||||
|
||||
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(void);
|
||||
ZEND_API char *zend_get_compiled_filename(CLS_D);
|
||||
ZEND_API int zend_get_compiled_lineno(CLS_D);
|
||||
|
||||
#ifdef ZTS
|
||||
const char *zend_get_zendtext(CLS_D);
|
||||
int zend_get_zendleng(CLS_D);
|
||||
#endif
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
/* parser-driven code generators */
|
||||
void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
@@ -227,6 +244,7 @@ void do_fetch_globals(znode *varname CLS_DC);
|
||||
|
||||
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);
|
||||
void fetch_string_offset(znode *result, znode *parent, znode *offset CLS_DC);
|
||||
void do_print(znode *result, znode *arg CLS_DC);
|
||||
void do_echo(znode *arg CLS_DC);
|
||||
typedef int (*unary_op_type)(zval *, zval *);
|
||||
@@ -236,7 +254,7 @@ ZEND_API void *get_binary_op(int opcode);
|
||||
void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC);
|
||||
void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC);
|
||||
void do_do_while_begin(CLS_D);
|
||||
void do_do_while_end(znode *do_token, znode *expr CLS_DC);
|
||||
void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC);
|
||||
|
||||
|
||||
void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC);
|
||||
@@ -260,15 +278,16 @@ void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC);
|
||||
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_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference 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);
|
||||
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, int is_dynamic_fcall CLS_DC);
|
||||
void do_return(znode *expr CLS_DC);
|
||||
void do_return(znode *expr, int do_end_vparse CLS_DC);
|
||||
ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time);
|
||||
void do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
|
||||
void do_early_binding(CLS_D);
|
||||
|
||||
void do_pass_param(znode *param, int op, int offset CLS_DC);
|
||||
@@ -316,6 +335,7 @@ void do_new_list_end(CLS_D);
|
||||
|
||||
void do_cast(znode *result, znode *expr, int type CLS_DC);
|
||||
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC);
|
||||
|
||||
void do_unset(znode *variable CLS_DC);
|
||||
void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
|
||||
@@ -324,6 +344,10 @@ void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_t
|
||||
void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
|
||||
void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
|
||||
|
||||
void do_declare_begin(CLS_D);
|
||||
void do_declare_stmt(znode *var, znode *val CLS_DC);
|
||||
void do_declare_end(CLS_D);
|
||||
|
||||
void do_end_heredoc(CLS_D);
|
||||
|
||||
void do_exit(znode *result, znode *message CLS_DC);
|
||||
@@ -339,47 +363,46 @@ void do_extended_info(CLS_D);
|
||||
void do_extended_fcall_begin(CLS_D);
|
||||
void do_extended_fcall_end(CLS_D);
|
||||
|
||||
void do_ticks(CLS_D);
|
||||
|
||||
ZEND_API void function_add_ref(zend_function *function);
|
||||
|
||||
#define INITIAL_OP_ARRAY_SIZE 64
|
||||
|
||||
|
||||
/* helper functions in zend-scanner.l */
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC);
|
||||
ZEND_API int require_filename(char *filename CLS_DC);
|
||||
ZEND_API int require_filename(char *filename, zend_bool unique CLS_DC);
|
||||
ZEND_API int use_filename(char *filename, uint filename_length CLS_DC);
|
||||
ZEND_API zend_op_array *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 *zend_compile_files(int type CLS_DC, int file_count, ...);
|
||||
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files);
|
||||
ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
|
||||
ZEND_API zend_op_array *compile_filename(zval *filename, zend_bool unique CLS_DC);
|
||||
ZEND_API zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_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 init_op_array(zend_op_array *op_array, int type, 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);
|
||||
ZEND_API void zend_open_file_dtor(zend_file_handle *fh);
|
||||
END_EXTERN_C()
|
||||
|
||||
ZEND_API int destroy_zend_function(zend_function *function);
|
||||
ZEND_API int destroy_zend_class(zend_class_entry *ce);
|
||||
ZEND_API void destroy_zend_function(zend_function *function);
|
||||
ZEND_API void destroy_zend_class(zend_class_entry *ce);
|
||||
void zend_class_add_ref(zend_class_entry *ce);
|
||||
|
||||
#define ZEND_FUNCTION_DTOR (int (*)(void *)) destroy_zend_function
|
||||
#define ZEND_CLASS_DTOR (int (*)(void *)) destroy_zend_class
|
||||
#define ZEND_FUNCTION_DTOR (void (*)(void *)) destroy_zend_function
|
||||
#define ZEND_CLASS_DTOR (void (*)(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);
|
||||
BEGIN_EXTERN_C()
|
||||
int pass_two(zend_op_array *op_array);
|
||||
void pass_include_eval(zend_op_array *op_array);
|
||||
END_EXTERN_C()
|
||||
ZEND_API void pass_include_eval(zend_op_array *op_array);
|
||||
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
|
||||
|
||||
ZEND_API zend_bool zend_is_compiling(void);
|
||||
|
||||
int zendlex(znode *zendlval CLS_DC);
|
||||
|
||||
|
||||
#define ZEND_NOP 0
|
||||
|
||||
#define ZEND_ADD 1
|
||||
@@ -397,115 +420,121 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_BOOL_NOT 13
|
||||
#define ZEND_BOOL_XOR 14
|
||||
#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_IS_NOT_IDENTICAL 16
|
||||
#define ZEND_IS_EQUAL 17
|
||||
#define ZEND_IS_NOT_EQUAL 18
|
||||
#define ZEND_IS_SMALLER 19
|
||||
#define ZEND_IS_SMALLER_OR_EQUAL 20
|
||||
#define ZEND_CAST 21
|
||||
#define ZEND_QM_ASSIGN 22
|
||||
|
||||
#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_ASSIGN_ADD 23
|
||||
#define ZEND_ASSIGN_SUB 24
|
||||
#define ZEND_ASSIGN_MUL 25
|
||||
#define ZEND_ASSIGN_DIV 26
|
||||
#define ZEND_ASSIGN_MOD 27
|
||||
#define ZEND_ASSIGN_SL 28
|
||||
#define ZEND_ASSIGN_SR 29
|
||||
#define ZEND_ASSIGN_CONCAT 30
|
||||
#define ZEND_ASSIGN_BW_OR 31
|
||||
#define ZEND_ASSIGN_BW_AND 32
|
||||
#define ZEND_ASSIGN_BW_XOR 33
|
||||
|
||||
#define ZEND_PRE_INC 33
|
||||
#define ZEND_PRE_DEC 34
|
||||
#define ZEND_POST_INC 35
|
||||
#define ZEND_POST_DEC 36
|
||||
#define ZEND_PRE_INC 34
|
||||
#define ZEND_PRE_DEC 35
|
||||
#define ZEND_POST_INC 36
|
||||
#define ZEND_POST_DEC 37
|
||||
|
||||
#define ZEND_ASSIGN 38
|
||||
#define ZEND_ASSIGN_REF 39
|
||||
|
||||
#define ZEND_ECHO 40
|
||||
#define ZEND_PRINT 41
|
||||
|
||||
#define ZEND_JMP 42
|
||||
#define ZEND_JMPZ 43
|
||||
#define ZEND_JMPNZ 44
|
||||
#define ZEND_JMPZNZ 45
|
||||
#define ZEND_JMPZ_EX 46
|
||||
#define ZEND_JMPNZ_EX 47
|
||||
#define ZEND_CASE 48
|
||||
#define ZEND_SWITCH_FREE 49
|
||||
#define ZEND_BRK 50
|
||||
#define ZEND_CONT 51
|
||||
#define ZEND_BOOL 52
|
||||
|
||||
#define ZEND_INIT_STRING 53
|
||||
#define ZEND_ADD_CHAR 54
|
||||
#define ZEND_ADD_STRING 55
|
||||
#define ZEND_ADD_VAR 56
|
||||
|
||||
#define ZEND_BEGIN_SILENCE 57
|
||||
#define ZEND_END_SILENCE 58
|
||||
|
||||
#define ZEND_INIT_FCALL_BY_NAME 59
|
||||
#define ZEND_DO_FCALL 60
|
||||
#define ZEND_DO_FCALL_BY_NAME 61
|
||||
#define ZEND_RETURN 62
|
||||
|
||||
#define ZEND_RECV 63
|
||||
#define ZEND_RECV_INIT 64
|
||||
|
||||
#define ZEND_ASSIGN 37
|
||||
#define ZEND_ASSIGN_REF 38
|
||||
#define ZEND_SEND_VAL 65
|
||||
#define ZEND_SEND_VAR 66
|
||||
#define ZEND_SEND_REF 67
|
||||
|
||||
#define ZEND_ECHO 39
|
||||
#define ZEND_PRINT 40
|
||||
|
||||
#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 52
|
||||
#define ZEND_ADD_CHAR 53
|
||||
#define ZEND_ADD_STRING 54
|
||||
#define ZEND_ADD_VAR 55
|
||||
|
||||
#define ZEND_BEGIN_SILENCE 56
|
||||
#define ZEND_END_SILENCE 57
|
||||
|
||||
#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 62
|
||||
#define ZEND_RECV_INIT 63
|
||||
#define ZEND_NEW 68
|
||||
#define ZEND_JMP_NO_CTOR 69
|
||||
#define ZEND_FREE 70
|
||||
|
||||
#define ZEND_SEND_VAL 64
|
||||
#define ZEND_SEND_VAR 65
|
||||
#define ZEND_SEND_REF 66
|
||||
|
||||
#define ZEND_NEW 67
|
||||
#define ZEND_JMP_NO_CTOR 68
|
||||
#define ZEND_FREE 69
|
||||
#define ZEND_INIT_ARRAY 71
|
||||
#define ZEND_ADD_ARRAY_ELEMENT 72
|
||||
|
||||
#define ZEND_INIT_ARRAY 70
|
||||
#define ZEND_ADD_ARRAY_ELEMENT 71
|
||||
#define ZEND_INCLUDE_OR_EVAL 73
|
||||
|
||||
#define ZEND_INCLUDE_OR_EVAL 72
|
||||
#define ZEND_UNSET_VAR 74
|
||||
#define ZEND_UNSET_DIM_OBJ 75
|
||||
#define ZEND_ISSET_ISEMPTY 76
|
||||
|
||||
#define ZEND_UNSET_VAR 73
|
||||
#define ZEND_UNSET_DIM_OBJ 74
|
||||
#define ZEND_ISSET_ISEMPTY 75
|
||||
#define ZEND_FE_RESET 77
|
||||
#define ZEND_FE_FETCH 78
|
||||
|
||||
#define ZEND_FE_RESET 76
|
||||
#define ZEND_FE_FETCH 77
|
||||
|
||||
#define ZEND_EXIT 78
|
||||
#define ZEND_EXIT 79
|
||||
|
||||
|
||||
/* the following 15 opcodes are 5 groups of 3 opcodes each, and must
|
||||
/* the following 18 opcodes are 6 groups of 3 opcodes each, and must
|
||||
* remain in that order!
|
||||
*/
|
||||
#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_R 80
|
||||
#define ZEND_FETCH_DIM_R 81
|
||||
#define ZEND_FETCH_OBJ_R 82
|
||||
#define ZEND_FETCH_W 83
|
||||
#define ZEND_FETCH_DIM_W 84
|
||||
#define ZEND_FETCH_OBJ_W 85
|
||||
#define ZEND_FETCH_RW 86
|
||||
#define ZEND_FETCH_DIM_RW 87
|
||||
#define ZEND_FETCH_OBJ_RW 88
|
||||
#define ZEND_FETCH_IS 89
|
||||
#define ZEND_FETCH_DIM_IS 90
|
||||
#define ZEND_FETCH_OBJ_IS 91
|
||||
#define ZEND_FETCH_FUNC_ARG 92
|
||||
#define ZEND_FETCH_DIM_FUNC_ARG 93
|
||||
#define ZEND_FETCH_OBJ_FUNC_ARG 94
|
||||
#define ZEND_FETCH_UNSET 95
|
||||
#define ZEND_FETCH_DIM_UNSET 96
|
||||
#define ZEND_FETCH_OBJ_UNSET 97
|
||||
|
||||
#define ZEND_FETCH_DIM_TMP_VAR 94
|
||||
#define ZEND_FETCH_CONSTANT 95
|
||||
#define ZEND_FETCH_DIM_TMP_VAR 98
|
||||
#define ZEND_FETCH_CONSTANT 99
|
||||
|
||||
#define ZEND_DECLARE_FUNCTION_OR_CLASS 96
|
||||
#define ZEND_DECLARE_FUNCTION_OR_CLASS 100
|
||||
|
||||
#define ZEND_EXT_STMT 97
|
||||
#define ZEND_EXT_FCALL_BEGIN 98
|
||||
#define ZEND_EXT_FCALL_END 99
|
||||
#define ZEND_EXT_NOP 100
|
||||
#define ZEND_EXT_STMT 101
|
||||
#define ZEND_EXT_FCALL_BEGIN 102
|
||||
#define ZEND_EXT_FCALL_END 103
|
||||
#define ZEND_EXT_NOP 104
|
||||
|
||||
#define ZEND_TICKS 105
|
||||
|
||||
/* end of block */
|
||||
|
||||
@@ -524,6 +553,7 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define BP_VAR_IS 3
|
||||
#define BP_VAR_NA 4 /* if not applicable */
|
||||
#define BP_VAR_FUNC_ARG 5
|
||||
#define BP_VAR_UNSET 6
|
||||
|
||||
|
||||
#define ZEND_INTERNAL_FUNCTION 1
|
||||
@@ -536,7 +566,8 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
|
||||
#define ZEND_EVAL (1<<0)
|
||||
#define ZEND_INCLUDE (1<<1)
|
||||
#define ZEND_IMPORT (1<<2)
|
||||
#define ZEND_INCLUDE_ONCE (1<<2)
|
||||
#define ZEND_REQUIRE (1<<3)
|
||||
|
||||
#define ZEND_ISSET (1<<0)
|
||||
#define ZEND_ISEMPTY (1<<1)
|
||||
@@ -570,27 +601,6 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
(ai).ptr = NULL; \
|
||||
}
|
||||
|
||||
#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) \
|
||||
( \
|
||||
@@ -609,4 +619,9 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
) \
|
||||
)
|
||||
|
||||
#define ZEND_RETURN_VAL 0
|
||||
#define ZEND_RETURN_REF 1
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* _COMPILE_H */
|
||||
+20
-11
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include <float.h>
|
||||
|
||||
typedef unsigned long ulong;
|
||||
typedef unsigned int uint;
|
||||
@@ -41,6 +42,11 @@ typedef unsigned int uint;
|
||||
#define HAVE_STDIOSTR_H 1
|
||||
#define HAVE_CLASS_ISTDIOSTREAM
|
||||
#define istdiostream stdiostream
|
||||
#define HAVE_STDARG_H 1
|
||||
#define HAVE_SNPRINTF 1
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
#define vsnprintf _vsnprintf
|
||||
|
||||
#ifdef inline
|
||||
#undef inline
|
||||
@@ -48,15 +54,16 @@ typedef unsigned int uint;
|
||||
|
||||
#define zend_sprintf sprintf
|
||||
|
||||
/* Visual C++ doesn't really work with inline for C */
|
||||
#define inline
|
||||
/* This will cause the compilation process to be MUCH longer, but will generate
|
||||
* a much quicker PHP binary
|
||||
*/
|
||||
#ifdef ZEND_WIN32_FORCE_INLINE
|
||||
# define inline __forceinline
|
||||
#else
|
||||
# define inline
|
||||
#endif
|
||||
|
||||
|
||||
#define DL_LOAD(libname) LoadLibrary(libname)
|
||||
#define DL_FETCH_SYMBOL GetProcAddress
|
||||
#define DL_UNLOAD FreeLibrary
|
||||
#define DL_HANDLE HMODULE
|
||||
#define ZEND_EXTENSIONS_SUPPORT 1
|
||||
#define zend_finite(A) _finite(A)
|
||||
|
||||
#ifdef LIBZEND_EXPORTS
|
||||
# define ZEND_API __declspec(dllexport)
|
||||
@@ -64,4 +71,6 @@ typedef unsigned int uint;
|
||||
# define ZEND_API __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#define ZEND_DLEXPORT __declspec(dllexport)
|
||||
|
||||
#endif /* _ZEND_CONFIG_W32_H */
|
||||
+21
-32
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -25,20 +25,21 @@
|
||||
#include "zend_globals.h"
|
||||
|
||||
|
||||
int free_zend_constant(zend_constant *c)
|
||||
void free_zend_constant(zend_constant *c)
|
||||
{
|
||||
if (!(c->flags & CONST_PERSISTENT)) {
|
||||
zval_dtor(&c->value);
|
||||
}
|
||||
free(c->name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void copy_zend_constant(zend_constant *c)
|
||||
{
|
||||
c->name = zend_strndup(c->name, c->name_len);
|
||||
zval_copy_ctor(&c->value);
|
||||
if (!(c->flags & CONST_PERSISTENT)) {
|
||||
zval_copy_ctor(&c->value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +47,7 @@ void zend_copy_constants(HashTable *target, HashTable *source)
|
||||
{
|
||||
zend_constant tmp_constant;
|
||||
|
||||
zend_hash_copy(target, source, (void (*)(void *)) copy_zend_constant, &tmp_constant, sizeof(zend_constant));
|
||||
zend_hash_copy(target, source, (copy_ctor_func_t) copy_zend_constant, &tmp_constant, sizeof(zend_constant));
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +81,7 @@ void clean_module_constants(int module_number)
|
||||
|
||||
int zend_startup_constants(ELS_D)
|
||||
{
|
||||
#if WIN32|WINNT
|
||||
#ifdef ZEND_WIN32
|
||||
DWORD dwBuild=0;
|
||||
DWORD dwVersion = GetVersion();
|
||||
DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
|
||||
@@ -99,26 +100,6 @@ int zend_startup_constants(ELS_D)
|
||||
|
||||
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 */
|
||||
if (dwVersion < 0x80000000){
|
||||
php3_os="WINNT";
|
||||
} else {
|
||||
php3_os="WIN32";
|
||||
}
|
||||
#else
|
||||
php3_os=PHP_OS;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
/* This should go back to PHP */
|
||||
REGISTER_MAIN_STRINGL_CONSTANT("PHP_VERSION", PHP_VERSION, sizeof(PHP_VERSION)-1, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_STRINGL_CONSTANT("PHP_OS", php3_os, strlen(php3_os), CONST_PERSISTENT | CONST_CS);
|
||||
#endif
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_ERROR", E_ERROR, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_WARNING", E_WARNING, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_PARSE", E_PARSE, CONST_PERSISTENT | CONST_CS);
|
||||
@@ -127,6 +108,9 @@ void zend_register_standard_constants(ELS_D)
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_CORE_WARNING", E_CORE_WARNING, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_ERROR", E_COMPILE_ERROR, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_WARNING", E_COMPILE_WARNING, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_USER_ERROR", E_USER_ERROR, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_USER_WARNING", E_USER_WARNING, CONST_PERSISTENT | CONST_CS);
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_USER_NOTICE", E_USER_NOTICE, CONST_PERSISTENT | CONST_CS);
|
||||
|
||||
REGISTER_MAIN_LONG_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT | CONST_CS);
|
||||
|
||||
@@ -138,17 +122,22 @@ void zend_register_standard_constants(ELS_D)
|
||||
c.flags = CONST_PERSISTENT;
|
||||
c.module_number = 0;
|
||||
|
||||
c.name = zend_strndup("TRUE",4);
|
||||
c.name_len = 5;
|
||||
c.name = zend_strndup(ZEND_STRL("TRUE"));
|
||||
c.name_len = sizeof("TRUE");
|
||||
c.value.value.lval = 1;
|
||||
c.value.type = IS_BOOL;
|
||||
zend_register_constant(&c ELS_CC);
|
||||
|
||||
c.name = zend_strndup("FALSE",5);
|
||||
c.name_len = 6;
|
||||
c.name = zend_strndup(ZEND_STRL("FALSE"));
|
||||
c.name_len = sizeof("FALSE");
|
||||
c.value.value.lval = 0;
|
||||
c.value.type = IS_BOOL;
|
||||
zend_register_constant(&c ELS_CC);
|
||||
|
||||
c.name = zend_strndup(ZEND_STRL("NULL"));
|
||||
c.name_len = sizeof("NULL");
|
||||
c.value.type = IS_NULL;
|
||||
zend_register_constant(&c ELS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -45,7 +45,7 @@ typedef struct _zend_constant {
|
||||
#define REGISTER_MAIN_STRINGL_CONSTANT(name,str,len,flags) zend_register_stringl_constant((name),sizeof(name),(str),(len),(flags),0 ELS_CC)
|
||||
|
||||
void clean_module_constants(int module_number);
|
||||
int free_zend_constant(zend_constant *c);
|
||||
void free_zend_constant(zend_constant *c);
|
||||
int zend_startup_constants(ELS_D);
|
||||
int zend_shutdown_constants(ELS_D);
|
||||
void zend_register_standard_constants(ELS_D);
|
||||
@@ -59,6 +59,6 @@ ZEND_API void zend_register_constant(zend_constant *c ELS_DC);
|
||||
void zend_copy_constants(HashTable *target, HashTable *sourc);
|
||||
void copy_zend_constant(zend_constant *c);
|
||||
|
||||
#define ZEND_CONSTANT_DTOR (int (*)(void *)) free_zend_constant
|
||||
#define ZEND_CONSTANT_DTOR (void (*)(void *)) free_zend_constant
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
typedef struct _dynamic_array {
|
||||
char *array;
|
||||
unsigned int element_size;
|
||||
unsigned int current;
|
||||
unsigned int allocated;
|
||||
} dynamic_array;
|
||||
|
||||
ZEND_API int zend_dynamic_array_init(dynamic_array *da, unsigned int element_size, unsigned int size)
|
||||
{
|
||||
da->element_size = element_size;
|
||||
da->allocated = size;
|
||||
da->current = 0;
|
||||
da->array = (char *) emalloc(size*element_size);
|
||||
if (da->array == NULL) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ZEND_API void *zend_dynamic_array_push(dynamic_array *da)
|
||||
{
|
||||
if (da->current == da->allocated) {
|
||||
da->allocated *= 2;
|
||||
da->array = (char *) erealloc(da->array, da->allocated*da->element_size);
|
||||
}
|
||||
return (void *)(da->array+(da->current++)*da->element_size);
|
||||
}
|
||||
|
||||
ZEND_API void *zend_dynamic_array_pop(dynamic_array *da)
|
||||
{
|
||||
return (void *)(da->array+(--(da->current))*da->element_size);
|
||||
|
||||
}
|
||||
|
||||
ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index)
|
||||
{
|
||||
if (index >= da->current) {
|
||||
return NULL;
|
||||
}
|
||||
return (void *)(da->array+index*da->element_size);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _DYNAMIC_ARRAY_H
|
||||
#define _DYNAMIC_ARRAY_H
|
||||
|
||||
typedef struct _dynamic_array {
|
||||
char *array;
|
||||
unsigned int element_size;
|
||||
unsigned int last_used;
|
||||
unsigned int allocated;
|
||||
} dynamic_array;
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API int zend_dynamic_array_init(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_push(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_pop(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index);
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* _ZEND_DYNAMIC_ARRAY_H */
|
||||
+7
-4
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -29,8 +29,11 @@
|
||||
#define E_CORE_WARNING (1<<5L)
|
||||
#define E_COMPILE_ERROR (1<<6L)
|
||||
#define E_COMPILE_WARNING (1<<7L)
|
||||
#define E_USER_ERROR (1<<8L)
|
||||
#define E_USER_WARNING (1<<9L)
|
||||
#define E_USER_NOTICE (1<<10L)
|
||||
|
||||
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING)
|
||||
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE)
|
||||
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
|
||||
|
||||
#endif /* _ZEND_ERRORS_H */
|
||||
|
||||
+626
-377
File diff suppressed because it is too large.
Load diff
+166
-12
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend_hash.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_execute_locks.h"
|
||||
|
||||
typedef union _temp_variable {
|
||||
zval tmp_var;
|
||||
@@ -33,8 +35,14 @@ typedef union _temp_variable {
|
||||
struct {
|
||||
zval tmp_var; /* a dummy */
|
||||
|
||||
zval *str;
|
||||
int offset;
|
||||
union {
|
||||
struct {
|
||||
zval *str;
|
||||
int offset;
|
||||
} str_offset;
|
||||
zend_property_reference overloaded_element;
|
||||
} data;
|
||||
|
||||
unsigned char type;
|
||||
} EA;
|
||||
} temp_variable;
|
||||
@@ -46,15 +54,95 @@ void init_executor(CLS_D ELS_DC);
|
||||
void shutdown_executor(ELS_D);
|
||||
void execute(zend_op_array *op_array ELS_DC);
|
||||
ZEND_API int zend_is_true(zval *op);
|
||||
ZEND_API inline void safe_free_zval_ptr(zval *p);
|
||||
ZEND_API void zend_eval_string(char *str, zval *retval CLS_DC ELS_DC);
|
||||
ZEND_API inline int i_zend_is_true(zval *op);
|
||||
ZEND_API int zval_update_constant(zval **pp);
|
||||
ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC);
|
||||
ZEND_API inline void safe_free_zval_ptr(zval *p)
|
||||
#if defined(C9X_INLINE_SEMANTICS)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
if (p!=EG(uninitialized_zval_ptr)) {
|
||||
FREE_ZVAL(p);
|
||||
}
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC);
|
||||
ZEND_API inline int i_zend_is_true(zval *op)
|
||||
#if defined(C9X_INLINE_SEMANTICS)
|
||||
{
|
||||
int result;
|
||||
|
||||
switch (op->type) {
|
||||
case IS_NULL:
|
||||
result = 0;
|
||||
break;
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
case IS_RESOURCE:
|
||||
result = (op->value.lval?1:0);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
result = (op->value.dval ? 1 : 0);
|
||||
break;
|
||||
case IS_STRING:
|
||||
if (op->value.str.len == 0
|
||||
|| (op->value.str.len==1 && op->value.str.val[0]=='0')) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = 1;
|
||||
}
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
result = (zend_hash_num_elements(op->value.ht)?1:0);
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
result = (zend_hash_num_elements(op->value.obj.properties)?1:0);
|
||||
break;
|
||||
default:
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
ZEND_API int zval_update_constant(zval **pp, void *arg);
|
||||
|
||||
/* dedicated Zend executor functions - do not use! */
|
||||
ZEND_API inline void zend_ptr_stack_clear_multiple(ELS_D);
|
||||
ZEND_API inline int zend_ptr_stack_get_arg(int requested_arg, void **data ELS_DC);
|
||||
ZEND_API inline void zend_ptr_stack_clear_multiple(ELS_D)
|
||||
#if defined(C9X_INLINE_SEMANTICS)
|
||||
{
|
||||
void **p = EG(argument_stack).top_element-2;
|
||||
int delete_count = (ulong) *p;
|
||||
|
||||
EG(argument_stack).top -= (delete_count+2);
|
||||
while (--delete_count>=0) {
|
||||
zval_ptr_dtor((zval **) --p);
|
||||
}
|
||||
EG(argument_stack).top_element = p;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
ZEND_API inline int zend_ptr_stack_get_arg(int requested_arg, void **data ELS_DC)
|
||||
#if defined(C9X_INLINE_SEMANTICS)
|
||||
{
|
||||
void **p = EG(argument_stack).top_element-2;
|
||||
int arg_count = (ulong) *p;
|
||||
|
||||
if (requested_arg>arg_count) {
|
||||
return FAILURE;
|
||||
}
|
||||
*data = (p-arg_count+requested_arg-1);
|
||||
return SUCCESS;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#if SUPPORT_INTERACTIVE
|
||||
void execute_new_code(CLS_D);
|
||||
@@ -65,12 +153,78 @@ void execute_new_code(CLS_D);
|
||||
ZEND_API char *get_active_function_name(void);
|
||||
ZEND_API char *zend_get_executed_filename(ELS_D);
|
||||
ZEND_API uint zend_get_executed_lineno(ELS_D);
|
||||
ZEND_API zend_bool zend_is_executing(void);
|
||||
|
||||
void zend_set_timeout(long seconds);
|
||||
void zend_unset_timeout(void);
|
||||
void zend_timeout(int dummy);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
void zend_init_timeout_thread();
|
||||
void zend_shutdown_timeout_thread();
|
||||
#define WM_REGISTER_ZEND_TIMEOUT (WM_USER+1)
|
||||
#define WM_UNREGISTER_ZEND_TIMEOUT (WM_USER+2)
|
||||
#endif
|
||||
|
||||
#define zendi_zval_copy_ctor(p) zval_copy_ctor(&(p))
|
||||
#define zendi_zval_dtor(p) zval_dtor(&(p))
|
||||
|
||||
#define active_opline (*EG(opline_ptr))
|
||||
|
||||
ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC)
|
||||
#if defined(C9X_INLINE_SEMANTICS)
|
||||
{
|
||||
zval *variable_ptr = *variable_ptr_ptr;
|
||||
zval *value_ptr;
|
||||
|
||||
|
||||
if (!value_ptr_ptr) {
|
||||
zend_error(E_ERROR, "Cannot create references to string offsets nor overloaded objects");
|
||||
return;
|
||||
}
|
||||
|
||||
value_ptr = *value_ptr_ptr;
|
||||
if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) {
|
||||
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
|
||||
/* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */
|
||||
} else if (variable_ptr_ptr != value_ptr_ptr) {
|
||||
variable_ptr->refcount--;
|
||||
if (variable_ptr->refcount==0) {
|
||||
zendi_zval_dtor(*variable_ptr);
|
||||
FREE_ZVAL(variable_ptr);
|
||||
}
|
||||
|
||||
if (!PZVAL_IS_REF(value_ptr)) {
|
||||
/* break it away */
|
||||
value_ptr->refcount--;
|
||||
if (value_ptr->refcount>0) {
|
||||
ALLOC_ZVAL(*value_ptr_ptr);
|
||||
**value_ptr_ptr = *value_ptr;
|
||||
value_ptr = *value_ptr_ptr;
|
||||
zendi_zval_copy_ctor(*value_ptr);
|
||||
}
|
||||
value_ptr->refcount = 1;
|
||||
value_ptr->is_ref = 1;
|
||||
}
|
||||
|
||||
*variable_ptr_ptr = value_ptr;
|
||||
value_ptr->refcount++;
|
||||
} else {
|
||||
if (variable_ptr->refcount>1) { /* we need to break away */
|
||||
SEPARATE_ZVAL(variable_ptr_ptr);
|
||||
}
|
||||
(*variable_ptr_ptr)->is_ref = 1;
|
||||
}
|
||||
|
||||
if (result && (result->op_type != IS_UNUSED)) {
|
||||
Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result);
|
||||
AI_USE_PTR(Ts[result->u.var].var);
|
||||
}
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
#define IS_OVERLOADED_OBJECT 1
|
||||
#define IS_STRING_OFFSET 2
|
||||
|
||||
+321
-170
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -26,14 +26,26 @@
|
||||
#include "zend_execute.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_ptr_stack.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_constants.h"
|
||||
#include "zend_extensions.h"
|
||||
#include "zend_execute_locks.h"
|
||||
#if HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
|
||||
ZEND_API void (*zend_execute)(zend_op_array *op_array ELS_DC);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
#include <process.h>
|
||||
/* true global */
|
||||
static WNDCLASS wc;
|
||||
static HWND timeout_window;
|
||||
static HANDLE timeout_thread_event;
|
||||
static DWORD timeout_thread_id;
|
||||
static int timeout_thread_initialized=0;
|
||||
#endif
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
static void (*original_sigsegv_handler)(int);
|
||||
@@ -79,26 +91,33 @@ static void zend_extension_deactivator(zend_extension *extension)
|
||||
}
|
||||
|
||||
|
||||
static int is_not_internal_function(zend_function *function)
|
||||
{
|
||||
return(function->type != ZEND_INTERNAL_FUNCTION);
|
||||
}
|
||||
|
||||
|
||||
static int is_not_internal_class(zend_class_entry *ce)
|
||||
{
|
||||
return(ce->type != ZEND_INTERNAL_CLASS);
|
||||
}
|
||||
|
||||
|
||||
void init_executor(CLS_D ELS_DC)
|
||||
{
|
||||
var_uninit(&EG(uninitialized_zval));
|
||||
var_uninit(&EG(error_zval));
|
||||
EG(uninitialized_zval).refcount = 1;
|
||||
EG(uninitialized_zval).is_ref=0;
|
||||
INIT_ZVAL(EG(uninitialized_zval));
|
||||
INIT_ZVAL(EG(error_zval));
|
||||
EG(uninitialized_zval_ptr)=&EG(uninitialized_zval);
|
||||
EG(error_zval).refcount = 1;
|
||||
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));
|
||||
/* destroys stack frame, therefore makes core dumps worthless */
|
||||
#if 0
|
||||
#if ZEND_DEBUG
|
||||
#if 0&&ZEND_DEBUG
|
||||
original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv);
|
||||
#endif
|
||||
#endif
|
||||
EG(return_value) = &EG(global_return_value);
|
||||
var_reset(EG(return_value));
|
||||
EG(return_value_ptr_ptr) = &EG(global_return_value_ptr);
|
||||
EG(global_return_value_ptr) = &EG(global_return_value);
|
||||
INIT_ZVAL(EG(global_return_value));
|
||||
|
||||
EG(symtable_cache_ptr) = EG(symtable_cache)-1;
|
||||
EG(symtable_cache_limit)=EG(symtable_cache)+SYMTABLE_CACHE_SIZE-1;
|
||||
EG(no_extensions)=0;
|
||||
@@ -106,25 +125,40 @@ void init_executor(CLS_D ELS_DC)
|
||||
EG(function_table) = CG(function_table);
|
||||
EG(class_table) = CG(class_table);
|
||||
|
||||
EG(in_execution) = 0;
|
||||
|
||||
zend_ptr_stack_init(&EG(argument_stack));
|
||||
|
||||
EG(main_op_array) = NULL;
|
||||
zend_hash_init(&EG(symbol_table), 50, NULL, PVAL_PTR_DTOR, 0);
|
||||
zend_hash_init(&EG(symbol_table), 50, NULL, ZVAL_PTR_DTOR, 0);
|
||||
EG(active_symbol_table) = &EG(symbol_table);
|
||||
|
||||
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_activator);
|
||||
EG(opline_ptr) = NULL;
|
||||
EG(garbage_ptr) = 0;
|
||||
|
||||
zend_hash_init(&EG(imported_files), 5, NULL, NULL, 0);
|
||||
zend_hash_init(&EG(included_files), 5, NULL, NULL, 0);
|
||||
|
||||
EG(ticks_count) = 0;
|
||||
|
||||
EG(user_error_handler) = NULL;
|
||||
|
||||
zend_ptr_stack_init(&EG(user_error_handlers));
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
EG(timed_out) = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void shutdown_executor(ELS_D)
|
||||
{
|
||||
zval_dtor(&EG(global_return_value));
|
||||
if (EG(global_return_value_ptr) == &EG(global_return_value)) {
|
||||
zval_dtor(&EG(global_return_value));
|
||||
} else {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
zend_ptr_stack_destroy(&EG(arg_types_stack));
|
||||
zend_stack_destroy(&EG(overloaded_objects_stack));
|
||||
|
||||
while (EG(symtable_cache_ptr)>=EG(symtable_cache)) {
|
||||
zend_hash_destroy(*EG(symtable_cache_ptr));
|
||||
@@ -135,23 +169,40 @@ void shutdown_executor(ELS_D)
|
||||
|
||||
zend_hash_destroy(&EG(symbol_table));
|
||||
|
||||
destroy_resource_list(); /* must be destroyed after the main symbol table is destroyed */
|
||||
while (EG(garbage_ptr)--) {
|
||||
if (EG(garbage)[EG(garbage_ptr)]->refcount==1) {
|
||||
zval_ptr_dtor(&EG(garbage)[EG(garbage_ptr)]);
|
||||
}
|
||||
}
|
||||
|
||||
zend_ptr_stack_destroy(&EG(argument_stack));
|
||||
|
||||
/* Destroy all op arrays */
|
||||
if (EG(main_op_array)) {
|
||||
destroy_op_array(EG(main_op_array));
|
||||
efree(EG(main_op_array));
|
||||
}
|
||||
zend_hash_apply(EG(function_table), (int (*)(void *)) is_not_internal_function);
|
||||
zend_hash_apply(EG(class_table), (int (*)(void *)) is_not_internal_class);
|
||||
|
||||
zend_destroy_rsrc_list(ELS_C); /* must be destroyed after the main symbol table and
|
||||
* op arrays are destroyed.
|
||||
*/
|
||||
|
||||
clean_non_persistent_constants();
|
||||
#if ZEND_DEBUG
|
||||
signal(SIGSEGV, original_sigsegv_handler);
|
||||
#endif
|
||||
while (EG(garbage_ptr)--) {
|
||||
zval_dtor(EG(garbage)[EG(garbage_ptr)]);
|
||||
efree(EG(garbage)[EG(garbage_ptr)]);
|
||||
|
||||
zend_hash_destroy(&EG(included_files));
|
||||
|
||||
if (EG(user_error_handler)) {
|
||||
zval_dtor(EG(user_error_handler));
|
||||
FREE_ZVAL(EG(user_error_handler));
|
||||
}
|
||||
|
||||
zend_hash_destroy(&EG(imported_files));
|
||||
zend_ptr_stack_clean(&EG(user_error_handlers), ZVAL_DESTRUCTOR, 1);
|
||||
zend_ptr_stack_destroy(&EG(user_error_handlers));
|
||||
}
|
||||
|
||||
|
||||
@@ -199,17 +250,15 @@ ZEND_API uint zend_get_executed_lineno(ELS_D)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline void safe_free_zval_ptr(zval *p)
|
||||
ZEND_API zend_bool zend_is_executing()
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
if (p!=EG(uninitialized_zval_ptr)) {
|
||||
efree(p);
|
||||
}
|
||||
return EG(in_execution);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
|
||||
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
|
||||
{
|
||||
#if DEBUG_ZEND>=2
|
||||
printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)->refcount-1);
|
||||
@@ -218,45 +267,11 @@ ZEND_API int _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
|
||||
if ((*zval_ptr)->refcount==0) {
|
||||
zval_dtor(*zval_ptr);
|
||||
safe_free_zval_ptr(*zval_ptr);
|
||||
} else if (((*zval_ptr)->refcount == 1) && ((*zval_ptr)->type != IS_OBJECT)) {
|
||||
(*zval_ptr)->is_ref = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline int i_zend_is_true(zval *op)
|
||||
{
|
||||
int result;
|
||||
|
||||
switch (op->type) {
|
||||
case IS_LONG:
|
||||
case IS_BOOL:
|
||||
case IS_RESOURCE:
|
||||
result = (op->value.lval?1:0);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
result = (op->value.dval ? 1 : 0);
|
||||
break;
|
||||
case IS_STRING:
|
||||
if (op->value.str.len == 0
|
||||
|| (op->value.str.len==1 && op->value.str.val[0]=='0')) {
|
||||
result = 0;
|
||||
} else {
|
||||
result = 1;
|
||||
}
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
result = (zend_hash_num_elements(op->value.ht)?1:0);
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
result = (zend_hash_num_elements(op->value.obj.properties)?1:0);
|
||||
break;
|
||||
default:
|
||||
result = 0;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API int zend_is_true(zval *op)
|
||||
{
|
||||
@@ -264,51 +279,71 @@ ZEND_API int zend_is_true(zval *op)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zval_update_constant(zval **pp)
|
||||
ZEND_API int zval_update_constant(zval **pp, void *arg)
|
||||
{
|
||||
zval *p = *pp;
|
||||
zend_bool inline_change = (zend_bool) (unsigned long) arg;
|
||||
|
||||
if (p->type == IS_CONSTANT) {
|
||||
zval c;
|
||||
int refcount = p->refcount;
|
||||
int refcount;
|
||||
|
||||
SEPARATE_ZVAL(pp);
|
||||
p = *pp;
|
||||
|
||||
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'",
|
||||
p->value.str.val,
|
||||
p->value.str.val);
|
||||
p->type = IS_STRING;
|
||||
if (!inline_change) {
|
||||
zval_copy_ctor(p);
|
||||
}
|
||||
} else {
|
||||
STR_FREE(p->value.str.val);
|
||||
if (inline_change) {
|
||||
STR_FREE(p->value.str.val);
|
||||
}
|
||||
*p = c;
|
||||
}
|
||||
INIT_PZVAL(p);
|
||||
p->refcount = refcount;
|
||||
} else if (p->type == IS_ARRAY) {
|
||||
zend_hash_apply(p->value.ht, (int (*)(void *)) zval_update_constant);
|
||||
} else if (p->type == IS_CONSTANT_ARRAY) {
|
||||
SEPARATE_ZVAL(pp);
|
||||
p = *pp;
|
||||
p->type = IS_ARRAY;
|
||||
zend_hash_apply_with_argument(p->value.ht, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval, int param_count, zval *params[])
|
||||
int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[])
|
||||
{
|
||||
zval ***params_array = (zval ***) emalloc(sizeof(zval **)*param_count);
|
||||
int i;
|
||||
int ex_retval;
|
||||
zval *local_retval_ptr;
|
||||
|
||||
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);
|
||||
ex_retval = call_user_function_ex(function_table, object, function_name, &local_retval_ptr, param_count, params_array, 1, NULL);
|
||||
if (local_retval_ptr) {
|
||||
COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
|
||||
} else {
|
||||
INIT_ZVAL(*retval_ptr);
|
||||
}
|
||||
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 call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table)
|
||||
{
|
||||
int i;
|
||||
zval *original_return_value;
|
||||
zval **original_return_value;
|
||||
HashTable *calling_symbol_table;
|
||||
zend_function_state function_state;
|
||||
zend_function_state *original_function_state_ptr;
|
||||
@@ -316,12 +351,32 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
zend_op **original_opline_ptr;
|
||||
ELS_FETCH();
|
||||
|
||||
*retval_ptr_ptr = NULL;
|
||||
|
||||
if (function_name->type==IS_ARRAY) { /* assume array($obj, $name) couple */
|
||||
zval **tmp_object_ptr, **tmp_real_function_name;
|
||||
|
||||
if (zend_hash_index_find(function_name->value.ht, 0, (void **) &tmp_object_ptr)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (zend_hash_index_find(function_name->value.ht, 1, (void **) &tmp_real_function_name)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
function_name = *tmp_real_function_name;
|
||||
object = *tmp_object_ptr;
|
||||
}
|
||||
|
||||
if (object) {
|
||||
if (object->type != IS_OBJECT) {
|
||||
return FAILURE;
|
||||
}
|
||||
function_table = &object->value.obj.ce->function_table;
|
||||
}
|
||||
|
||||
if (function_name->type!=IS_STRING) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
original_function_state_ptr = EG(function_state_ptr);
|
||||
zend_str_tolower(function_name->value.str.val, function_name->value.str.len);
|
||||
if (zend_hash_find(function_table, function_name->value.str.val, function_name->value.str.len+1, (void **) &function_state.function)==FAILURE) {
|
||||
@@ -341,7 +396,7 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
if (no_separation) {
|
||||
return FAILURE;
|
||||
}
|
||||
new_zval = (zval *) emalloc(sizeof(zval));
|
||||
ALLOC_ZVAL(new_zval);
|
||||
*new_zval = **params[i];
|
||||
zval_copy_ctor(new_zval);
|
||||
new_zval->refcount = 1;
|
||||
@@ -355,42 +410,50 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
(*params[i])->refcount++;
|
||||
param = *params[i];
|
||||
} else {
|
||||
param = (zval *) emalloc(sizeof(zval));
|
||||
ALLOC_ZVAL(param);
|
||||
*param = **(params[i]);
|
||||
INIT_PZVAL(param);
|
||||
}
|
||||
zend_ptr_stack_push(&EG(argument_stack), param);
|
||||
}
|
||||
|
||||
zend_ptr_stack_push(&EG(argument_stack), (void *) (long) param_count);
|
||||
zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) (long) param_count, NULL);
|
||||
|
||||
var_uninit(retval);
|
||||
if (function_state.function->type == ZEND_USER_FUNCTION) {
|
||||
calling_symbol_table = EG(active_symbol_table);
|
||||
EG(active_symbol_table) = (HashTable *) emalloc(sizeof(HashTable));
|
||||
zend_hash_init(EG(active_symbol_table), 0, NULL, PVAL_PTR_DTOR, 0);
|
||||
if (symbol_table) {
|
||||
EG(active_symbol_table) = symbol_table;
|
||||
} else {
|
||||
ALLOC_HASHTABLE(EG(active_symbol_table));
|
||||
zend_hash_init(EG(active_symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
}
|
||||
if (object) {
|
||||
zval *dummy = (zval *) emalloc(sizeof(zval)), **this_ptr;
|
||||
zval *dummy, **this_ptr;
|
||||
|
||||
var_uninit(dummy);
|
||||
INIT_PZVAL(dummy);
|
||||
zend_hash_update_ptr(EG(active_symbol_table), "this", sizeof("this"), dummy, sizeof(zval *), (void **) &this_ptr);
|
||||
ALLOC_ZVAL(dummy);
|
||||
INIT_ZVAL(*dummy);
|
||||
|
||||
zend_hash_update(EG(active_symbol_table), "this", sizeof("this"), &dummy, sizeof(zval *), (void **) &this_ptr);
|
||||
zend_assign_to_variable_reference(NULL, this_ptr, &object, NULL ELS_CC);
|
||||
}
|
||||
original_return_value = EG(return_value);
|
||||
original_return_value = EG(return_value_ptr_ptr);
|
||||
original_op_array = EG(active_op_array);
|
||||
EG(return_value) = retval;
|
||||
EG(return_value_ptr_ptr) = retval_ptr_ptr;
|
||||
EG(active_op_array) = (zend_op_array *) function_state.function;
|
||||
original_opline_ptr = EG(opline_ptr);
|
||||
original_opline_ptr = EG(opline_ptr);
|
||||
zend_execute(EG(active_op_array) ELS_CC);
|
||||
zend_hash_destroy(EG(active_symbol_table));
|
||||
efree(EG(active_symbol_table));
|
||||
if (!symbol_table) {
|
||||
zend_hash_destroy(EG(active_symbol_table));
|
||||
FREE_HASHTABLE(EG(active_symbol_table));
|
||||
}
|
||||
EG(active_symbol_table) = calling_symbol_table;
|
||||
EG(active_op_array) = original_op_array;
|
||||
EG(return_value)=original_return_value;
|
||||
EG(return_value_ptr_ptr)=original_return_value;
|
||||
EG(opline_ptr) = original_opline_ptr;
|
||||
} else {
|
||||
((zend_internal_function *) function_state.function)->handler(param_count, retval, &EG(regular_list), &EG(persistent_list), object, 1);
|
||||
ALLOC_INIT_ZVAL(*retval_ptr_ptr);
|
||||
((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, object, 1 ELS_CC);
|
||||
INIT_PZVAL(*retval_ptr_ptr);
|
||||
}
|
||||
zend_ptr_stack_clear_multiple(ELS_C);
|
||||
EG(function_state_ptr) = original_function_state_ptr;
|
||||
@@ -399,15 +462,16 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_eval_string(char *str, zval *retval CLS_DC ELS_DC)
|
||||
ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC)
|
||||
{
|
||||
zval pv;
|
||||
zend_op_array *new_op_array;
|
||||
zend_op_array *original_active_op_array = EG(active_op_array);
|
||||
zend_function_state *original_function_state_ptr = EG(function_state_ptr);
|
||||
int original_handle_op_arrays;
|
||||
int retval;
|
||||
|
||||
if (retval) {
|
||||
if (retval_ptr) {
|
||||
pv.value.str.len = strlen(str)+sizeof("return ;")-1;
|
||||
pv.value.str.val = emalloc(pv.value.str.len+1);
|
||||
strcpy(pv.value.str.val, "return ");
|
||||
@@ -427,80 +491,44 @@ ZEND_API void zend_eval_string(char *str, zval *retval CLS_DC ELS_DC)
|
||||
CG(handle_op_arrays) = original_handle_op_arrays;
|
||||
|
||||
if (new_op_array) {
|
||||
zval dummy_retval;
|
||||
zval *original_return_value = EG(return_value);
|
||||
zval *local_retval_ptr=NULL;
|
||||
zval **original_return_value_ptr_ptr = EG(return_value_ptr_ptr);
|
||||
zend_op **original_opline_ptr = EG(opline_ptr);
|
||||
|
||||
EG(return_value) = (retval?retval:&dummy_retval);
|
||||
var_reset(EG(return_value));
|
||||
EG(return_value_ptr_ptr) = &local_retval_ptr;
|
||||
EG(active_op_array) = new_op_array;
|
||||
EG(no_extensions)=1;
|
||||
|
||||
zend_execute(new_op_array ELS_CC);
|
||||
|
||||
if (local_retval_ptr) {
|
||||
if (retval_ptr) {
|
||||
COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
|
||||
} else {
|
||||
zval_ptr_dtor(&local_retval_ptr);
|
||||
}
|
||||
} else {
|
||||
if (retval_ptr) {
|
||||
INIT_ZVAL(*retval_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
EG(no_extensions)=0;
|
||||
EG(opline_ptr) = original_opline_ptr;
|
||||
EG(active_op_array) = original_active_op_array;
|
||||
EG(function_state_ptr) = original_function_state_ptr;
|
||||
destroy_op_array(new_op_array);
|
||||
efree(new_op_array);
|
||||
EG(return_value) = original_return_value;
|
||||
if (!retval) {
|
||||
zval_dtor(&dummy_retval);
|
||||
}
|
||||
EG(return_value_ptr_ptr) = original_return_value_ptr_ptr;
|
||||
retval = SUCCESS;
|
||||
} else {
|
||||
printf("Failed executing:\n%s\n", str);
|
||||
retval = FAILURE;
|
||||
}
|
||||
zval_dtor(&pv);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC)
|
||||
{
|
||||
zval *variable_ptr = *variable_ptr_ptr;
|
||||
zval *value_ptr;
|
||||
|
||||
|
||||
if (!value_ptr_ptr) {
|
||||
zend_error(E_ERROR, "Cannot create references to string offsets nor overloaded objects");
|
||||
return;
|
||||
}
|
||||
|
||||
value_ptr = *value_ptr_ptr;
|
||||
if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) {
|
||||
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
|
||||
/* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */
|
||||
} else if (variable_ptr_ptr != value_ptr_ptr) {
|
||||
variable_ptr->refcount--;
|
||||
if (variable_ptr->refcount==0) {
|
||||
zendi_zval_dtor(*variable_ptr);
|
||||
efree(variable_ptr);
|
||||
}
|
||||
|
||||
if (!PZVAL_IS_REF(value_ptr)) {
|
||||
/* break it away */
|
||||
value_ptr->refcount--;
|
||||
if (value_ptr->refcount>0) {
|
||||
*value_ptr_ptr = (zval *) emalloc(sizeof(zval));
|
||||
**value_ptr_ptr = *value_ptr;
|
||||
value_ptr = *value_ptr_ptr;
|
||||
zendi_zval_copy_ctor(*value_ptr);
|
||||
}
|
||||
value_ptr->refcount = 1;
|
||||
value_ptr->is_ref = 1;
|
||||
}
|
||||
|
||||
*variable_ptr_ptr = value_ptr;
|
||||
value_ptr->refcount++;
|
||||
} else {
|
||||
/* nothing to do */
|
||||
}
|
||||
|
||||
if (result && (result->op_type != IS_UNUSED)) {
|
||||
Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result);
|
||||
AI_USE_PTR(Ts[result->u.var].var);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if SUPPORT_INTERACTIVE
|
||||
void execute_new_code(CLS_D)
|
||||
@@ -522,32 +550,155 @@ void execute_new_code(CLS_D)
|
||||
#endif
|
||||
|
||||
|
||||
/* these are a dedicated, optimized, function, and shouldn't be used for any purpose
|
||||
* other than by Zend's executor
|
||||
*/
|
||||
ZEND_API inline void zend_ptr_stack_clear_multiple(ELS_D)
|
||||
void zend_timeout(int dummy)
|
||||
{
|
||||
void **p = EG(argument_stack).top_element-1;
|
||||
int delete_count = (ulong) *p;
|
||||
ELS_FETCH();
|
||||
|
||||
EG(argument_stack).top -= (delete_count+1);
|
||||
while (--delete_count>=0) {
|
||||
zval_ptr_dtor((zval **) --p);
|
||||
/* is there any point in this? we're terminating the request anyway...
|
||||
PLS_FETCH();
|
||||
|
||||
PG(connection_status) |= PHP_CONNECTION_TIMEOUT;
|
||||
*/
|
||||
zend_error(E_ERROR, "Maximum execution time of %d second%s exceeded",
|
||||
EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
|
||||
}
|
||||
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
case WM_REGISTER_ZEND_TIMEOUT:
|
||||
/* wParam is the thread id pointer, lParam is the timeout amount in seconds */
|
||||
SetTimer(timeout_window, wParam, lParam*1000, NULL);
|
||||
break;
|
||||
case WM_UNREGISTER_ZEND_TIMEOUT:
|
||||
/* wParam is the thread id pointer */
|
||||
KillTimer(timeout_window, wParam);
|
||||
break;
|
||||
case WM_TIMER: {
|
||||
#ifdef ZTS
|
||||
zend_executor_globals *executor_globals;
|
||||
|
||||
executor_globals = ts_resource_ex(executor_globals_id, &wParam);
|
||||
if (!executor_globals) {
|
||||
/* Thread died before receiving its timeout? */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
KillTimer(timeout_window, wParam);
|
||||
EG(timed_out) = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd,message,wParam,lParam);
|
||||
}
|
||||
EG(argument_stack).top_element = p;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API int zend_ptr_stack_get_arg(int requested_arg, void **data ELS_DC)
|
||||
static unsigned __stdcall timeout_thread_proc(void *pArgs)
|
||||
{
|
||||
void **p = EG(argument_stack).top_element-1;
|
||||
int arg_count = (ulong) *p;
|
||||
MSG message;
|
||||
|
||||
if (requested_arg>arg_count) {
|
||||
return FAILURE;
|
||||
wc.style=0;
|
||||
wc.lpfnWndProc = zend_timeout_WndProc;
|
||||
wc.cbClsExtra=0;
|
||||
wc.cbWndExtra=0;
|
||||
wc.hInstance=NULL;
|
||||
wc.hIcon=NULL;
|
||||
wc.hCursor=NULL;
|
||||
wc.hbrBackground=(HBRUSH)(COLOR_BACKGROUND + 5);
|
||||
wc.lpszMenuName=NULL;
|
||||
wc.lpszClassName = "Zend Timeout Window";
|
||||
if(!RegisterClass(&wc)) {
|
||||
return -1;
|
||||
}
|
||||
*data = (p-arg_count+requested_arg-1);
|
||||
return SUCCESS;
|
||||
timeout_window = CreateWindow(wc.lpszClassName, wc.lpszClassName, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);
|
||||
SetEvent(timeout_thread_event);
|
||||
while (GetMessage(&message, NULL, 0, 0)) {
|
||||
SendMessage(timeout_window, message.message, message.wParam, message.lParam);
|
||||
if (message.message == WM_QUIT) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
DestroyWindow(timeout_window);
|
||||
UnregisterClass(wc.lpszClassName, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void zend_init_timeout_thread()
|
||||
{
|
||||
timeout_thread_event = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
_beginthreadex(NULL, 0, timeout_thread_proc, NULL, 0, &timeout_thread_id);
|
||||
WaitForSingleObject(timeout_thread_event, INFINITE);
|
||||
}
|
||||
|
||||
|
||||
void zend_shutdown_timeout_thread()
|
||||
{
|
||||
if (!timeout_thread_initialized) {
|
||||
return;
|
||||
}
|
||||
PostThreadMessage(timeout_thread_id, WM_QUIT, 0, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* This one doesn't exists on QNX */
|
||||
#ifndef SIGPROF
|
||||
#define SIGPROF 27
|
||||
#endif
|
||||
|
||||
void zend_set_timeout(long seconds)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
EG(timeout_seconds) = seconds;
|
||||
#ifdef ZEND_WIN32
|
||||
if (timeout_thread_initialized==0 && InterlockedIncrement(&timeout_thread_initialized)==1) {
|
||||
/* We start up this process-wide thread here and not in zend_startup(), because if Zend
|
||||
* is initialized inside a DllMain(), you're not supposed to start threads from it.
|
||||
*/
|
||||
zend_init_timeout_thread();
|
||||
}
|
||||
PostThreadMessage(timeout_thread_id, WM_REGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) seconds);
|
||||
#else
|
||||
# ifdef HAVE_SETITIMER
|
||||
{
|
||||
struct itimerval t_r; /* timeout requested */
|
||||
|
||||
t_r.it_value.tv_sec = seconds;
|
||||
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
|
||||
|
||||
setitimer(ITIMER_PROF, &t_r, NULL);
|
||||
signal(SIGPROF, zend_timeout);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void zend_unset_timeout(void)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
PostThreadMessage(timeout_thread_id, WM_UNREGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) 0);
|
||||
#else
|
||||
# ifdef HAVE_SETITIMER
|
||||
{
|
||||
struct itimerval no_timeout;
|
||||
|
||||
no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0;
|
||||
|
||||
setitimer(ITIMER_PROF, &no_timeout, NULL);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef _ZEND_EXECUTE_LOCKS_H
|
||||
#define _ZEND_EXECUTE_LOCKS_H
|
||||
|
||||
#define PZVAL_LOCK(z) ((z)->refcount++)
|
||||
#define PZVAL_UNLOCK(z) { ((z)->refcount--); \
|
||||
if (!(z)->refcount) { \
|
||||
(z)->refcount = 1; \
|
||||
(z)->is_ref = 0; \
|
||||
EG(garbage)[EG(garbage_ptr)++] = (z); \
|
||||
if (EG(garbage_ptr) == 4) { \
|
||||
zval_ptr_dtor(&EG(garbage)[0]); \
|
||||
zval_ptr_dtor(&EG(garbage)[1]); \
|
||||
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); }
|
||||
|
||||
#endif /* _ZEND_EXECUTE_LOCKS_H */
|
||||
+64
-19
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -44,12 +44,12 @@ int zend_load_extension(char *path)
|
||||
{
|
||||
#if ZEND_EXTENSIONS_SUPPORT
|
||||
DL_HANDLE handle;
|
||||
zend_extension extension, *new_extension;
|
||||
zend_extension *new_extension;
|
||||
zend_extension_version_info *extension_version_info;
|
||||
|
||||
handle = DL_LOAD(path);
|
||||
if (!handle) {
|
||||
#if !(WIN32||WINNT)
|
||||
#ifndef ZEND_WIN32
|
||||
fprintf(stderr, "Failed loading %s: %s\n", path, dlerror());
|
||||
#else
|
||||
fprintf(stderr, "Failed loading %s\n", path);
|
||||
@@ -65,17 +65,18 @@ int zend_load_extension(char *path)
|
||||
}
|
||||
|
||||
if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) {
|
||||
fprintf(stderr, "%s requires Zend version %s or later\n"
|
||||
"Current version %s, API version %d\n",
|
||||
fprintf(stderr, "%s requires Zend Engine API version %d\n"
|
||||
"The installed Zend Engine API version is %d\n",
|
||||
new_extension->name,
|
||||
extension_version_info->required_zend_version,
|
||||
ZEND_VERSION,
|
||||
extension_version_info->zend_extension_api_no,
|
||||
ZEND_EXTENSION_API_NO);
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
} else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) {
|
||||
/* we may be able to allow for downwards compatability in some harmless cases. */
|
||||
fprintf(stderr, "%s is outdated (API version %d, current version %d)\n"
|
||||
fprintf(stderr, "%s designed to be used with the Zend Engine API %d is outdated\n"
|
||||
"It requires a more recent version of the Zend Engine\n"
|
||||
"The installed Zend Engine API version is %d\n"
|
||||
"Contact %s at %s for a later version of this module.\n",
|
||||
new_extension->name,
|
||||
extension_version_info->zend_extension_api_no,
|
||||
@@ -100,27 +101,41 @@ int zend_load_extension(char *path)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
return zend_register_extension(new_extension, handle);
|
||||
#else
|
||||
fprintf(stderr, "Extensions are not supported on this platform.\n");
|
||||
return FAILURE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
|
||||
{
|
||||
#if ZEND_EXTENSIONS_SUPPORT
|
||||
zend_extension extension;
|
||||
|
||||
if (new_extension->startup) {
|
||||
if (new_extension->startup(new_extension)!=SUCCESS) {
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
extension = *new_extension;
|
||||
extension.handle = handle;
|
||||
|
||||
zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension);
|
||||
|
||||
zend_llist_add_element(&zend_extensions, &extension);
|
||||
|
||||
/*fprintf(stderr, "Loaded %s, version %s\n", extension.name, extension.version);*/
|
||||
|
||||
zend_append_version_info(&extension);
|
||||
return SUCCESS;
|
||||
#else
|
||||
fprintf(stderr, "Extensions are not supported on this platform.\n");
|
||||
return FAILURE;
|
||||
/*fprintf(stderr, "Loaded %s, version %s\n", extension.name, extension.version);*/
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static void zend_extension_shutdown(zend_extension *extension)
|
||||
{
|
||||
#if ZEND_EXTENSIONS_SUPPORT
|
||||
@@ -131,6 +146,14 @@ static void zend_extension_shutdown(zend_extension *extension)
|
||||
}
|
||||
|
||||
|
||||
int zend_startup_extensions()
|
||||
{
|
||||
zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1);
|
||||
last_resource_number = 0;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void zend_shutdown_extensions()
|
||||
{
|
||||
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_shutdown);
|
||||
@@ -141,16 +164,38 @@ void zend_shutdown_extensions()
|
||||
void zend_extension_dtor(zend_extension *extension)
|
||||
{
|
||||
#if ZEND_EXTENSIONS_SUPPORT
|
||||
DL_UNLOAD(extension->handle);
|
||||
if (extension->handle) {
|
||||
DL_UNLOAD(extension->handle);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void zend_extension_message_dispatcher(zend_extension *extension, int num_args, va_list args)
|
||||
{
|
||||
int message;
|
||||
void *arg;
|
||||
|
||||
if (!extension->message_handler || num_args!=2) {
|
||||
return;
|
||||
}
|
||||
message = va_arg(args, int);
|
||||
arg = va_arg(args, void *);
|
||||
extension->message_handler(message, arg);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_extension_dispatch_message(int message, void *arg)
|
||||
{
|
||||
zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher, 2, message, arg);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_get_resource_handle(zend_extension *extension)
|
||||
{
|
||||
if (last_resource_number<4) {
|
||||
if (last_resource_number<ZEND_MAX_RESERVED_RESOURCES) {
|
||||
extension->resource_number = last_resource_number;
|
||||
return last_resource_number;
|
||||
return last_resource_number++;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
+18
-11
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "zend_compile.h"
|
||||
|
||||
#define ZEND_EXTENSION_API_NO 19990619
|
||||
#define ZEND_EXTENSION_API_NO 20000622
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
@@ -44,8 +44,10 @@ struct _zend_extension {
|
||||
|
||||
int (*startup)(zend_extension *extension);
|
||||
void (*shutdown)(zend_extension *extension);
|
||||
void (*activate)(void);
|
||||
void (*deactivate)(void);
|
||||
void (*activate)();
|
||||
void (*deactivate)();
|
||||
|
||||
void (*message_handler)(int message, void *arg);
|
||||
|
||||
void (*op_array_handler)(zend_op_array *op_array);
|
||||
|
||||
@@ -53,8 +55,8 @@ struct _zend_extension {
|
||||
void (*fcall_begin_handler)(zend_op_array *op_array);
|
||||
void (*fcall_end_handler)(zend_op_array *op_array);
|
||||
|
||||
void (*op_array_ctor)(void **resource);
|
||||
void (*op_array_dtor)(void **resource);
|
||||
void (*op_array_ctor)(zend_op_array *op_array);
|
||||
void (*op_array_dtor)(zend_op_array *op_array);
|
||||
|
||||
void *reserved1;
|
||||
void *reserved2;
|
||||
@@ -71,6 +73,9 @@ struct _zend_extension {
|
||||
|
||||
|
||||
ZEND_API int zend_get_resource_handle(zend_extension *extension);
|
||||
ZEND_API void zend_extension_dispatch_message(int message, void *arg);
|
||||
|
||||
#define ZEND_EXTMSG_NEW_EXTENSION 1
|
||||
|
||||
#ifdef ZTS
|
||||
#define ZTS_V 1
|
||||
@@ -80,7 +85,7 @@ ZEND_API int zend_get_resource_handle(zend_extension *extension);
|
||||
|
||||
|
||||
#define ZEND_EXTENSION() \
|
||||
ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, "0.90", ZTS_V, ZEND_DEBUG }
|
||||
ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, ZEND_VERSION, ZTS_V, ZEND_DEBUG }
|
||||
|
||||
#define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
|
||||
|
||||
@@ -88,9 +93,11 @@ ZEND_API int zend_get_resource_handle(zend_extension *extension);
|
||||
ZEND_API extern zend_llist zend_extensions;
|
||||
|
||||
void zend_extension_dtor(zend_extension *extension);
|
||||
int zend_load_extension(char *path);
|
||||
int zend_load_extensions(char **extension_paths);
|
||||
ZEND_API int zend_load_extension(char *path);
|
||||
ZEND_API int zend_load_extensions(char **extension_paths);
|
||||
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
|
||||
void zend_append_version_info(zend_extension *extension);
|
||||
int zend_startup_extensions(void);
|
||||
void zend_shutdown_extensions(void);
|
||||
|
||||
#endif /* _ZEND_EXTENSIONS_H */
|
||||
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ZEND_FAST_CACHE_H
|
||||
#define _ZEND_FAST_CACHE_H
|
||||
|
||||
#ifndef ZEND_ENABLE_FAST_CACHE
|
||||
# if ZEND_DEBUG
|
||||
# define ZEND_ENABLE_FAST_CACHE 0
|
||||
# else
|
||||
# define ZEND_ENABLE_FAST_CACHE 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef struct _zend_fast_cache_list_entry {
|
||||
struct _zend_fast_cache_list_entry *next;
|
||||
} zend_fast_cache_list_entry;
|
||||
|
||||
#define MAX_FAST_CACHE_TYPES 4
|
||||
|
||||
|
||||
#define ZVAL_CACHE_LIST 0
|
||||
#define HASHTABLE_CACHE_LIST 1
|
||||
|
||||
#if ZEND_ENABLE_FAST_CACHE
|
||||
|
||||
|
||||
#include "zend_globals.h"
|
||||
#include "zend_globals_macros.h"
|
||||
#include "zend_alloc.h"
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
# define RECORD_ZVAL_CACHE_HIT(fc_type) AG(fast_cache_stats)[fc_type][1]++;
|
||||
# define RECORD_ZVAL_CACHE_MISS(fc_type) AG(fast_cache_stats)[fc_type][0]++;
|
||||
#else
|
||||
# define RECORD_ZVAL_CACHE_HIT(fc_type)
|
||||
# define RECORD_ZVAL_CACHE_MISS(fc_type)
|
||||
#endif
|
||||
|
||||
|
||||
#define ZEND_FAST_ALLOC(p, type, fc_type) \
|
||||
{ \
|
||||
ALS_FETCH(); \
|
||||
\
|
||||
if (((p) = (type *) AG(fast_cache_list_head)[fc_type])) { \
|
||||
AG(fast_cache_list_head)[fc_type] = ((zend_fast_cache_list_entry *) AG(fast_cache_list_head)[fc_type])->next; \
|
||||
RECORD_ZVAL_CACHE_HIT(fc_type); \
|
||||
} else { \
|
||||
(p) = (type *) emalloc(sizeof(type)); \
|
||||
RECORD_ZVAL_CACHE_MISS(fc_type); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define ZEND_FAST_FREE(p, fc_type) \
|
||||
{ \
|
||||
ALS_FETCH(); \
|
||||
\
|
||||
((zend_fast_cache_list_entry *) (p))->next = AG(fast_cache_list_head)[fc_type]; \
|
||||
AG(fast_cache_list_head)[fc_type] = (zend_fast_cache_list_entry *) (p); \
|
||||
}
|
||||
|
||||
#define ZEND_FAST_ALLOC_REL(p, type, fc_type) \
|
||||
ZEND_FAST_ALLOC(p, type, fc_type)
|
||||
|
||||
#define ZEND_FAST_FREE_REL(p, fc_type) \
|
||||
ZEND_FAST_FREE(p, fc_type)
|
||||
|
||||
|
||||
#else /* !ZEND_ENABLE_FAST_CACHE */
|
||||
|
||||
#define ZEND_FAST_ALLOC(p, type, fc_type) \
|
||||
(p) = (type *) emalloc(sizeof(type))
|
||||
|
||||
#define ZEND_FAST_FREE(p, fc_type) \
|
||||
efree(p)
|
||||
|
||||
#define ZEND_FAST_ALLOC_REL(p, type, fc_type) \
|
||||
(p) = (type *) emalloc_rel(sizeof(type))
|
||||
|
||||
#define ZEND_FAST_FREE_REL(p, fc_type) \
|
||||
efree_rel(p)
|
||||
|
||||
#endif /* ZEND_ENABLE_FAST_CACHE */
|
||||
|
||||
|
||||
|
||||
|
||||
/* fast cache for zval's */
|
||||
#define ALLOC_ZVAL(z) \
|
||||
ZEND_FAST_ALLOC(z, zval, ZVAL_CACHE_LIST)
|
||||
|
||||
#define FREE_ZVAL(z) \
|
||||
ZEND_FAST_FREE(z, ZVAL_CACHE_LIST)
|
||||
|
||||
#define ALLOC_ZVAL_REL(z) \
|
||||
ZEND_FAST_ALLOC_REL(z, zval, ZVAL_CACHE_LIST)
|
||||
|
||||
#define FREE_ZVAL_REL(z) \
|
||||
ZEND_FAST_FREE_REL(z, ZVAL_CACHE_LIST)
|
||||
|
||||
/* fast cache for HashTables */
|
||||
#define ALLOC_HASHTABLE(ht) \
|
||||
ZEND_FAST_ALLOC(ht, HashTable, HASHTABLE_CACHE_LIST)
|
||||
|
||||
#define FREE_HASHTABLE(ht) \
|
||||
ZEND_FAST_FREE(ht, HASHTABLE_CACHE_LIST)
|
||||
|
||||
#define ALLOC_HASHTABLE_REL(ht) \
|
||||
ZEND_FAST_ALLOC_REL(ht, HashTable, HASHTABLE_CACHE_LIST)
|
||||
|
||||
#define FREE_HASHTABLE_REL(ht) \
|
||||
ZEND_FAST_FREE_REL(ht, HASHTABLE_CACHE_LIST)
|
||||
|
||||
#endif /* _ZEND_FAST_CACHE_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
/*
|
||||
* If C9X_INLINE_SEMANTICS is already defined here,
|
||||
* we assume the user does not want GCC inline semantics,
|
||||
* but compiles this file always.
|
||||
*/
|
||||
|
||||
#ifndef C9X_INLINE_SEMANTICS
|
||||
|
||||
#define C9X_INLINE_SEMANTICS
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#include "zend_execute.h"
|
||||
#include "zend_operators.h"
|
||||
|
||||
#endif
|
||||
+47
-14
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "zend_ptr_stack.h"
|
||||
#include "zend_hash.h"
|
||||
#include "zend_llist.h"
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
/* Define ZTS if you want a thread-safe Zend */
|
||||
/*#undef ZTS*/
|
||||
@@ -44,7 +45,7 @@ class ZendFlexLexer;
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API extern int compiler_globals_id;
|
||||
ZEND_API extern int executor_globals_id;
|
||||
extern int alloc_globals_id;
|
||||
ZEND_API extern int alloc_globals_id;
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif
|
||||
@@ -53,16 +54,22 @@ END_EXTERN_C()
|
||||
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend_execute.h"
|
||||
|
||||
/* excpt.h on Digital Unix 4.0 defines function_table */
|
||||
#undef function_table
|
||||
|
||||
|
||||
|
||||
typedef struct _zend_declarables {
|
||||
zval ticks;
|
||||
} zend_declarables;
|
||||
|
||||
|
||||
struct _zend_compiler_globals {
|
||||
zend_stack bp_stack;
|
||||
zend_stack switch_cond_stack;
|
||||
zend_stack foreach_copy_stack;
|
||||
zend_stack object_stack;
|
||||
zend_stack declare_stack;
|
||||
|
||||
zend_class_entry class_entry, *active_class_entry;
|
||||
|
||||
@@ -88,8 +95,12 @@ struct _zend_compiler_globals {
|
||||
|
||||
zend_llist filenames_list;
|
||||
|
||||
zend_bool in_compilation;
|
||||
zend_bool short_tags;
|
||||
zend_bool asp_tags;
|
||||
zend_bool allow_call_time_pass_reference;
|
||||
|
||||
zend_declarables declarables;
|
||||
|
||||
/* For extensions support */
|
||||
zend_bool extended_info; /* generate extension information for debugger/profiler */
|
||||
@@ -109,7 +120,7 @@ struct _zend_compiler_globals {
|
||||
|
||||
|
||||
struct _zend_executor_globals {
|
||||
zval *return_value;
|
||||
zval **return_value_ptr_ptr;
|
||||
|
||||
zval uninitialized_zval;
|
||||
zval *uninitialized_zval_ptr;
|
||||
@@ -119,7 +130,9 @@ struct _zend_executor_globals {
|
||||
|
||||
zend_function_state *function_state_ptr;
|
||||
zend_ptr_stack arg_types_stack;
|
||||
zend_stack overloaded_objects_stack;
|
||||
|
||||
/* for global return() support */
|
||||
zval *global_return_value_ptr;
|
||||
zval global_return_value;
|
||||
|
||||
/* symbol table cache */
|
||||
@@ -132,7 +145,7 @@ struct _zend_executor_globals {
|
||||
HashTable *active_symbol_table;
|
||||
HashTable symbol_table; /* main symbol table */
|
||||
|
||||
HashTable imported_files; /* files already included using 'import' */
|
||||
HashTable included_files; /* files already included */
|
||||
|
||||
jmp_buf bailout;
|
||||
|
||||
@@ -147,9 +160,17 @@ struct _zend_executor_globals {
|
||||
|
||||
long precision;
|
||||
|
||||
int ticks_count;
|
||||
|
||||
zend_bool in_execution;
|
||||
|
||||
/* for extended information support */
|
||||
zend_bool no_extensions;
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
zend_bool timed_out;
|
||||
#endif
|
||||
|
||||
HashTable regular_list;
|
||||
HashTable persistent_list;
|
||||
|
||||
@@ -161,6 +182,14 @@ struct _zend_executor_globals {
|
||||
zval *garbage[4];
|
||||
int garbage_ptr;
|
||||
|
||||
zval *user_error_handler;
|
||||
zend_ptr_stack user_error_handlers;
|
||||
|
||||
/* timeout support */
|
||||
int timeout_seconds;
|
||||
|
||||
int lambda_count;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
#if SUPPORT_INTERACTIVE
|
||||
int interactive;
|
||||
@@ -168,13 +197,18 @@ struct _zend_executor_globals {
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct _zend_alloc_globals {
|
||||
mem_header *head; /* standard list */
|
||||
mem_header *phead; /* persistent list */
|
||||
zend_mem_header *head; /* standard list */
|
||||
zend_mem_header *phead; /* persistent list */
|
||||
void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
|
||||
unsigned char cache_count[MAX_CACHED_MEMORY];
|
||||
unsigned int cache_count[MAX_CACHED_MEMORY];
|
||||
void *fast_cache_list_head[MAX_FAST_CACHE_TYPES];
|
||||
|
||||
#if ZEND_DEBUG
|
||||
/* for performance tuning */
|
||||
int cache_stats[MAX_CACHED_MEMORY][2];
|
||||
int fast_cache_stats[MAX_FAST_CACHE_TYPES][2];
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
unsigned int memory_limit;
|
||||
unsigned int allocated_memory;
|
||||
@@ -182,5 +216,4 @@ struct _zend_alloc_globals {
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#endif /* _T_GLOBALS_H */
|
||||
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -82,6 +82,7 @@ extern ZEND_API zend_executor_globals executor_globals;
|
||||
# define ALS_CC
|
||||
# define AG(v) (alloc_globals.v)
|
||||
# define ALS_FETCH()
|
||||
extern ZEND_API zend_alloc_globals alloc_globals;
|
||||
#endif
|
||||
|
||||
#endif /* _ZEND_GLOBALS_MACROS_H */
|
||||
|
||||
+503
-500
File diff suppressed because it is too large.
Load diff
+61
-40
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -29,46 +29,56 @@
|
||||
#define HASH_UPDATE (1<<0)
|
||||
#define HASH_ADD (1<<1)
|
||||
#define HASH_NEXT_INSERT (1<<2)
|
||||
#define HASH_ADD_PTR (1<<3)
|
||||
|
||||
#define HASH_DEL_KEY 0
|
||||
#define HASH_DEL_INDEX 1
|
||||
|
||||
struct hashtable;
|
||||
typedef int (*compare_func_t)(const void *, const void *);
|
||||
typedef void (*sort_func_t)(void *, size_t, register size_t, compare_func_t);
|
||||
typedef void (*dtor_func_t)(void *pDest);
|
||||
typedef int (*apply_func_t)(void *pDest);
|
||||
typedef int (*apply_func_arg_t)(void *pDest, void *argument);
|
||||
typedef ulong (*hash_func_t)(char *arKey, uint nKeyLength);
|
||||
typedef void (*copy_ctor_func_t)(void *pElement);
|
||||
|
||||
struct _hashtable;
|
||||
|
||||
typedef struct bucket {
|
||||
ulong h; /* Used for numeric indexing */
|
||||
uint nKeyLength;
|
||||
void *pData;
|
||||
void *pDataPtr;
|
||||
char bIsPointer;
|
||||
struct bucket *pListNext;
|
||||
struct bucket *pListLast;
|
||||
struct bucket *pNext;
|
||||
struct bucket *pLast;
|
||||
char arKey[1]; /* Must be last element */
|
||||
} Bucket;
|
||||
|
||||
typedef struct hashtable {
|
||||
typedef struct _hashtable {
|
||||
uint nTableSize;
|
||||
uint nHashSizeIndex;
|
||||
uint nNumOfElements;
|
||||
ulong nNextFreeElement;
|
||||
ulong(*pHashFunction) (char *arKey, uint nKeyLength);
|
||||
hash_func_t pHashFunction;
|
||||
Bucket *pInternalPointer; /* Used for element traversal */
|
||||
Bucket *pListHead;
|
||||
Bucket *pListTail;
|
||||
Bucket **arBuckets;
|
||||
int (*pDestructor) (void *pData);
|
||||
unsigned char persistent;
|
||||
dtor_func_t pDestructor;
|
||||
zend_bool persistent;
|
||||
unsigned char nApplyCount;
|
||||
#if ZEND_DEBUG
|
||||
int inconsistent;
|
||||
#endif
|
||||
} HashTable;
|
||||
|
||||
typedef int (*compare_func_t) (const void *, const void *);
|
||||
typedef void (*sort_func_t) (void *, size_t, register size_t, compare_func_t);
|
||||
typedef Bucket* HashPosition;
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
/* startup/shutdown */
|
||||
ZEND_API int zend_hash_init(HashTable *ht, uint nSize, ulong(*pHashFunction) (char *arKey, uint nKeyLength), int (*pDestructor) (void *pData), int persistent);
|
||||
ZEND_API int zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent);
|
||||
ZEND_API void zend_hash_destroy(HashTable *ht);
|
||||
|
||||
ZEND_API void zend_hash_clean(HashTable *ht);
|
||||
@@ -79,26 +89,18 @@ ZEND_API int zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength
|
||||
zend_hash_add_or_update(ht,arKey,nKeyLength,pData,nDataSize,pDest,HASH_UPDATE)
|
||||
#define zend_hash_add(ht,arKey,nKeyLength,pData,nDataSize,pDest) \
|
||||
zend_hash_add_or_update(ht,arKey,nKeyLength,pData,nDataSize,pDest,HASH_ADD)
|
||||
#define zend_hash_update_ptr(ht,arKey,nKeyLength,pData,nDataSize,pDest) \
|
||||
zend_hash_add_or_update(ht,arKey,nKeyLength,pData,0,pDest,(HASH_UPDATE|HASH_ADD_PTR))
|
||||
|
||||
ZEND_API int zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest,int flag);
|
||||
#define zend_hash_quick_update(ht,arKey,nKeyLength,h,pData,nDataSize,pDest) \
|
||||
zend_hash_quick_add_or_update(ht,arKey,nKeyLength,h,pData,nDataSize,pDest,HASH_UPDATE)
|
||||
#define zend_hash_quick_add(ht,arKey,nKeyLength,h,pData,nDataSize,pDest) \
|
||||
zend_hash_quick_add_or_update(ht,arKey,nKeyLength,h,pData,nDataSize,pDest,HASH_ADD)
|
||||
#define zend_hash_quick_update_ptr(ht,arKey,nKeyLength,h,pData,nDataSize,pDest) \
|
||||
zend_hash_quick_add_or_update(ht,arKey,nKeyLength,h,pData,0,pDest,HASH_UPDATE|HASH_ADD_PTR)
|
||||
|
||||
ZEND_API int zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag);
|
||||
#define zend_hash_index_update(ht,h,pData,nDataSize,pDest) \
|
||||
zend_hash_index_update_or_next_insert(ht,h,pData,nDataSize,pDest,HASH_UPDATE)
|
||||
#define zend_hash_next_index_insert(ht,pData,nDataSize,pDest) \
|
||||
zend_hash_index_update_or_next_insert(ht,0,pData,nDataSize,pDest,HASH_NEXT_INSERT)
|
||||
#define zend_hash_next_index_insert_ptr(ht,pData,nDataSize,pDest) \
|
||||
zend_hash_index_update_or_next_insert(ht,0,pData,nDataSize,pDest,HASH_NEXT_INSERT|HASH_ADD_PTR)
|
||||
|
||||
ZEND_API int zend_hash_pointer_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData);
|
||||
|
||||
typedef struct _zend_hash_key {
|
||||
char *arKey;
|
||||
@@ -107,16 +109,14 @@ typedef struct _zend_hash_key {
|
||||
} zend_hash_key;
|
||||
|
||||
|
||||
typedef int (*apply_func_args_t)(void *pDest, int num_args, va_list args, zend_hash_key *hash_key);
|
||||
|
||||
#define ZEND_STD_HASH_APPLIER \
|
||||
int (*)(void *element, int num_args, va_list args, zend_hash_key *hash_key)
|
||||
|
||||
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_graceful_destroy(HashTable *ht);
|
||||
ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func);
|
||||
ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *);
|
||||
ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, ZEND_STD_HASH_APPLIER, int, ...);
|
||||
|
||||
|
||||
@@ -139,24 +139,38 @@ ZEND_API int zend_hash_index_find(HashTable *ht, ulong h, void **pData);
|
||||
/* Misc */
|
||||
ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength);
|
||||
ZEND_API int zend_hash_index_exists(HashTable *ht, ulong h);
|
||||
ZEND_API int zend_hash_is_pointer(HashTable *ht, char *arKey, uint nKeyLength);
|
||||
ZEND_API int zend_hash_index_is_pointer(HashTable *ht, ulong h);
|
||||
ZEND_API ulong zend_hash_next_free_element(HashTable *ht);
|
||||
|
||||
/* traversing */
|
||||
ZEND_API void zend_hash_move_forward(HashTable *ht);
|
||||
ZEND_API void zend_hash_move_backwards(HashTable *ht);
|
||||
ZEND_API int zend_hash_get_current_key(HashTable *ht, char **str_index, ulong *num_index);
|
||||
ZEND_API int zend_hash_get_current_key_type(HashTable *ht);
|
||||
ZEND_API int zend_hash_get_current_data(HashTable *ht, void **pData);
|
||||
ZEND_API void zend_hash_internal_pointer_reset(HashTable *ht);
|
||||
ZEND_API void zend_hash_internal_pointer_end(HashTable *ht);
|
||||
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
|
||||
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
|
||||
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *str_length, ulong *num_index, HashPosition *pos);
|
||||
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos);
|
||||
ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos);
|
||||
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos);
|
||||
ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos);
|
||||
|
||||
#define zend_hash_move_forward(ht) \
|
||||
zend_hash_move_forward_ex(ht, NULL)
|
||||
#define zend_hash_move_backwards(ht) \
|
||||
zend_hash_move_backwards_ex(ht, NULL)
|
||||
#define zend_hash_get_current_key(ht, str_index, num_index) \
|
||||
zend_hash_get_current_key_ex(ht, str_index, NULL, num_index, NULL)
|
||||
#define zend_hash_get_current_key_type(ht) \
|
||||
zend_hash_get_current_key_type_ex(ht, NULL)
|
||||
#define zend_hash_get_current_data(ht, pData) \
|
||||
zend_hash_get_current_data_ex(ht, pData, NULL)
|
||||
#define zend_hash_internal_pointer_reset(ht) \
|
||||
zend_hash_internal_pointer_reset_ex(ht, NULL)
|
||||
#define zend_hash_internal_pointer_end(ht) \
|
||||
zend_hash_internal_pointer_end_ex(ht, NULL)
|
||||
|
||||
/* 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 void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size);
|
||||
ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite);
|
||||
ZEND_API 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_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered);
|
||||
ZEND_API int zend_hash_minmax(HashTable *ht, int (*compar)(const void *, const void *), int flag, void **pData);
|
||||
|
||||
ZEND_API int zend_hash_num_elements(HashTable *ht);
|
||||
|
||||
@@ -172,4 +186,11 @@ void zend_hash_display(HashTable *ht);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#define ZEND_INIT_SYMTABLE(ht) \
|
||||
ZEND_INIT_SYMTABLE_EX(ht, 2, 0)
|
||||
|
||||
#define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \
|
||||
zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent)
|
||||
|
||||
|
||||
#endif /* _HASH_ */
|
||||
+22
-10
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -33,7 +33,7 @@ extern int zendleng;
|
||||
#define zendleng zend_get_zendleng(CLS_C)
|
||||
#endif
|
||||
|
||||
static void html_putc(char c)
|
||||
ZEND_API void zend_html_putc(char c)
|
||||
{
|
||||
switch (c) {
|
||||
case '\n':
|
||||
@@ -61,12 +61,12 @@ static void html_putc(char c)
|
||||
}
|
||||
|
||||
|
||||
static void html_puts(char *s, uint len)
|
||||
ZEND_API void zend_html_puts(char *s, uint len)
|
||||
{
|
||||
register char *ptr=s, *end=s+len;
|
||||
|
||||
while (ptr<end) {
|
||||
html_putc(*ptr++);
|
||||
zend_html_putc(*ptr++);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
|
||||
int in_string=0;
|
||||
CLS_FETCH();
|
||||
|
||||
zend_printf("<code>");
|
||||
zend_printf("<font color=\"%s\">\n", last_color);
|
||||
/* highlight stuff coming back from zendlex() */
|
||||
token.type = 0;
|
||||
@@ -93,6 +94,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
|
||||
next_color = syntax_highlighter_ini->highlight_comment;
|
||||
break;
|
||||
case T_OPEN_TAG:
|
||||
case T_OPEN_TAG_WITH_ECHO:
|
||||
next_color = syntax_highlighter_ini->highlight_default;
|
||||
break;
|
||||
case T_CLOSE_TAG:
|
||||
@@ -106,7 +108,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
|
||||
in_string = !in_string;
|
||||
break;
|
||||
case T_WHITESPACE:
|
||||
html_puts(zendtext, zendleng); /* no color needed */
|
||||
zend_html_puts(zendtext, zendleng); /* no color needed */
|
||||
token.type = 0;
|
||||
continue;
|
||||
break;
|
||||
@@ -133,17 +135,18 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
|
||||
}
|
||||
}
|
||||
switch (token_type) {
|
||||
case T_DOLLAR_OPEN_CURLY_BRACES:
|
||||
html_puts("{", 1);
|
||||
case T_END_HEREDOC:
|
||||
zend_html_puts(token.value.str.val, token.value.str.len);
|
||||
break;
|
||||
default:
|
||||
html_puts(zendtext, zendleng);
|
||||
zend_html_puts(zendtext, zendleng);
|
||||
break;
|
||||
}
|
||||
|
||||
if (token.type == IS_STRING) {
|
||||
switch (token_type) {
|
||||
case T_OPEN_TAG:
|
||||
case T_OPEN_TAG_WITH_ECHO:
|
||||
case T_CLOSE_TAG:
|
||||
case T_WHITESPACE:
|
||||
break;
|
||||
@@ -151,6 +154,14 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
|
||||
efree(token.value.str.val);
|
||||
break;
|
||||
}
|
||||
} else if (token_type == T_END_HEREDOC) {
|
||||
zend_bool has_semicolon=(strchr(token.value.str.val, ';')?1:0);
|
||||
|
||||
efree(token.value.str.val);
|
||||
if (has_semicolon) {
|
||||
/* the following semicolon was unput(), ignore it */
|
||||
lex_scan(&token CLS_CC);
|
||||
}
|
||||
}
|
||||
token.type = 0;
|
||||
}
|
||||
@@ -158,6 +169,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
|
||||
zend_printf("</font>\n");
|
||||
}
|
||||
zend_printf("</font>\n");
|
||||
zend_printf("</code>");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -42,6 +42,8 @@ BEGIN_EXTERN_C()
|
||||
ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
||||
int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
||||
int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini);
|
||||
ZEND_API void zend_html_putc(char c);
|
||||
ZEND_API void zend_html_puts(char *s, uint len);
|
||||
END_EXTERN_C()
|
||||
|
||||
extern zend_syntax_highlighter_ini syntax_highlighter_ini;
|
||||
|
||||
+3
-3
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
|
||||
+3
-3
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
|
||||
+145
-40
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -27,10 +27,14 @@
|
||||
|
||||
ZEND_API int le_index_ptr;
|
||||
|
||||
static inline int zend_list_do_insert(HashTable *list,void *ptr, int type)
|
||||
/* true global */
|
||||
static HashTable list_destructors;
|
||||
|
||||
|
||||
static inline int zend_list_do_insert(HashTable *list, void *ptr, int type, zend_bool valid)
|
||||
{
|
||||
int index;
|
||||
list_entry le;
|
||||
zend_rsrc_list_entry le;
|
||||
|
||||
index = zend_hash_next_free_element(list);
|
||||
|
||||
@@ -39,13 +43,14 @@ static inline int zend_list_do_insert(HashTable *list,void *ptr, int type)
|
||||
le.ptr=ptr;
|
||||
le.type=type;
|
||||
le.refcount=1;
|
||||
zend_hash_index_update(list, index, (void *) &le, sizeof(list_entry), NULL);
|
||||
le.valid = valid;
|
||||
zend_hash_index_update(list, index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL);
|
||||
return index;
|
||||
}
|
||||
|
||||
static inline int zend_list_do_delete(HashTable *list,int id)
|
||||
{
|
||||
list_entry *le;
|
||||
zend_rsrc_list_entry *le;
|
||||
ELS_FETCH();
|
||||
|
||||
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
|
||||
@@ -63,7 +68,7 @@ static inline int zend_list_do_delete(HashTable *list,int id)
|
||||
|
||||
static inline void *zend_list_do_find(HashTable *list,int id, int *type)
|
||||
{
|
||||
list_entry *le;
|
||||
zend_rsrc_list_entry *le;
|
||||
|
||||
if (zend_hash_index_find(list, id, (void **) &le)==SUCCESS) {
|
||||
*type = le->type;
|
||||
@@ -79,7 +84,7 @@ ZEND_API int zend_list_insert(void *ptr, int type)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
return zend_list_do_insert(&EG(regular_list), ptr, type);
|
||||
return zend_list_do_insert(&EG(regular_list), ptr, type, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,13 +92,13 @@ ZEND_API int zend_plist_insert(void *ptr, int type)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
return zend_list_do_insert(&EG(persistent_list), ptr, type);
|
||||
return zend_list_do_insert(&EG(persistent_list), ptr, type, 1);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_list_addref(int id)
|
||||
{
|
||||
list_entry *le;
|
||||
zend_rsrc_list_entry *le;
|
||||
ELS_FETCH();
|
||||
|
||||
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
|
||||
@@ -122,6 +127,20 @@ ZEND_API int zend_plist_delete(int id)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_list_convert_to_number(int id)
|
||||
{
|
||||
zend_rsrc_list_entry *le;
|
||||
ELS_FETCH();
|
||||
|
||||
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS
|
||||
&& le->valid) {
|
||||
return id;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API void *zend_list_find(int id, int *type)
|
||||
{
|
||||
ELS_FETCH();
|
||||
@@ -139,7 +158,7 @@ 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);
|
||||
@@ -153,6 +172,22 @@ ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int r
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_register_false_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type)
|
||||
{
|
||||
int rsrc_id;
|
||||
ELS_FETCH();
|
||||
|
||||
rsrc_id = zend_list_do_insert(&EG(regular_list), rsrc_pointer, rsrc_type, 0);
|
||||
|
||||
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;
|
||||
@@ -180,8 +215,9 @@ ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resou
|
||||
|
||||
resource = zend_list_find(id, &actual_resource_type);
|
||||
if (!resource) {
|
||||
if (resource_type_name)
|
||||
if (resource_type_name) {
|
||||
zend_error(E_WARNING, "%d is not a valid %s resource", id, resource_type_name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -197,74 +233,79 @@ ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resou
|
||||
}
|
||||
va_end(resource_types);
|
||||
|
||||
if (resource_type_name)
|
||||
if (resource_type_name) {
|
||||
zend_error(E_WARNING, "Supplied resource is not a valid %s resource", resource_type_name);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int list_entry_destructor(void *ptr)
|
||||
void list_entry_destructor(void *ptr)
|
||||
{
|
||||
list_entry *le = (list_entry *) ptr;
|
||||
list_destructors_entry *ld;
|
||||
zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr;
|
||||
zend_rsrc_list_dtors_entry *ld;
|
||||
|
||||
if (zend_hash_index_find(&list_destructors,le->type,(void **) &ld)==SUCCESS) {
|
||||
if (ld->list_destructor) {
|
||||
(ld->list_destructor)(le->ptr);
|
||||
if (zend_hash_index_find(&list_destructors, le->type,(void **) &ld)==SUCCESS) {
|
||||
switch (ld->type) {
|
||||
case ZEND_RESOURCE_LIST_TYPE_STD:
|
||||
if (ld->list_dtor) {
|
||||
(ld->list_dtor)(le->ptr);
|
||||
}
|
||||
break;
|
||||
case ZEND_RESOURCE_LIST_TYPE_EX:
|
||||
if (ld->list_dtor_ex) {
|
||||
ld->list_dtor_ex(le);
|
||||
}
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
} else {
|
||||
zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)",le->type);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int plist_entry_destructor(void *ptr)
|
||||
void plist_entry_destructor(void *ptr)
|
||||
{
|
||||
list_entry *le = (list_entry *) ptr;
|
||||
list_destructors_entry *ld;
|
||||
zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr;
|
||||
zend_rsrc_list_dtors_entry *ld;
|
||||
|
||||
if (zend_hash_index_find(&list_destructors,le->type,(void **) &ld)==SUCCESS) {
|
||||
if (ld->plist_destructor) {
|
||||
(ld->plist_destructor)(le->ptr);
|
||||
if (zend_hash_index_find(&list_destructors, le->type,(void **) &ld)==SUCCESS) {
|
||||
if (ld->plist_dtor) {
|
||||
(ld->plist_dtor)(le->ptr);
|
||||
}
|
||||
} else {
|
||||
zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)",le->type);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int init_resource_list(ELS_D)
|
||||
int zend_init_rsrc_list(ELS_D)
|
||||
{
|
||||
return zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor, 0);
|
||||
}
|
||||
|
||||
|
||||
int init_resource_plist(ELS_D)
|
||||
int zend_init_rsrc_plist(ELS_D)
|
||||
{
|
||||
return zend_hash_init(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1);
|
||||
}
|
||||
|
||||
|
||||
void destroy_resource_list(void)
|
||||
void zend_destroy_rsrc_list(ELS_D)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
zend_hash_destroy(&EG(regular_list));
|
||||
zend_hash_graceful_destroy(&EG(regular_list));
|
||||
}
|
||||
|
||||
|
||||
void destroy_resource_plist(void)
|
||||
void zend_destroy_rsrc_plist(ELS_D)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
zend_hash_destroy(&EG(persistent_list));
|
||||
zend_hash_graceful_destroy(&EG(persistent_list));
|
||||
}
|
||||
|
||||
|
||||
static int clean_module_resource(list_entry *le, int *resource_id)
|
||||
static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id)
|
||||
{
|
||||
if (le->type == *resource_id) {
|
||||
return 1;
|
||||
@@ -274,11 +315,12 @@ static int clean_module_resource(list_entry *le, int *resource_id)
|
||||
}
|
||||
|
||||
|
||||
int clean_module_resource_destructors(list_destructors_entry *ld, int *module_number)
|
||||
static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number)
|
||||
{
|
||||
if (ld->module_number == *module_number) {
|
||||
ELS_FETCH();
|
||||
|
||||
zend_hash_apply_with_argument(&EG(regular_list), (int (*)(void *,void *)) clean_module_resource, (void *) &(ld->resource_id));
|
||||
zend_hash_apply_with_argument(&EG(persistent_list), (int (*)(void *,void *)) clean_module_resource, (void *) &(ld->resource_id));
|
||||
return 1;
|
||||
} else {
|
||||
@@ -287,6 +329,69 @@ int clean_module_resource_destructors(list_destructors_entry *ld, int *module_nu
|
||||
}
|
||||
|
||||
|
||||
void zend_clean_module_rsrc_dtors(int module_number)
|
||||
{
|
||||
zend_hash_apply_with_argument(&list_destructors, (int (*)(void *,void *)) zend_clean_module_rsrc_dtors_cb, (void *) &module_number);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number)
|
||||
{
|
||||
zend_rsrc_list_dtors_entry lde;
|
||||
|
||||
#if 0
|
||||
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
|
||||
#endif
|
||||
|
||||
lde.list_dtor=(void (*)(void *)) ld;
|
||||
lde.plist_dtor=(void (*)(void *)) pld;
|
||||
lde.list_dtor_ex = lde.plist_dtor_ex = NULL;
|
||||
lde.module_number = module_number;
|
||||
lde.resource_id = list_destructors.nNextFreeElement;
|
||||
lde.type = ZEND_RESOURCE_LIST_TYPE_STD;
|
||||
|
||||
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
return list_destructors.nNextFreeElement-1;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, int module_number)
|
||||
{
|
||||
zend_rsrc_list_dtors_entry lde;
|
||||
|
||||
#if 0
|
||||
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
|
||||
#endif
|
||||
|
||||
lde.list_dtor = NULL;
|
||||
lde.plist_dtor = NULL;
|
||||
lde.list_dtor_ex = ld;
|
||||
lde.plist_dtor_ex = pld;
|
||||
lde.module_number = module_number;
|
||||
lde.resource_id = list_destructors.nNextFreeElement;
|
||||
lde.type = ZEND_RESOURCE_LIST_TYPE_EX;
|
||||
|
||||
if (zend_hash_next_index_insert(&list_destructors,(void *) &lde, sizeof(zend_rsrc_list_dtors_entry),NULL)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
return list_destructors.nNextFreeElement-1;
|
||||
}
|
||||
|
||||
|
||||
int zend_init_rsrc_list_dtors()
|
||||
{
|
||||
return zend_hash_init(&list_destructors, 50, NULL, NULL, 1);
|
||||
}
|
||||
|
||||
|
||||
void zend_destroy_rsrc_list_dtors()
|
||||
{
|
||||
zend_hash_destroy(&list_destructors);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+37
-20
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -24,42 +24,59 @@
|
||||
#include "zend_hash.h"
|
||||
#include "zend_globals.h"
|
||||
|
||||
extern HashTable list_destructors;
|
||||
|
||||
typedef struct _list_entry {
|
||||
#define ZEND_RESOURCE_LIST_TYPE_STD 1
|
||||
#define ZEND_RESOURCE_LIST_TYPE_EX 2
|
||||
|
||||
typedef struct _zend_rsrc_list_entry {
|
||||
void *ptr;
|
||||
int type;
|
||||
int refcount;
|
||||
} list_entry;
|
||||
zend_bool valid;
|
||||
} zend_rsrc_list_entry;
|
||||
|
||||
typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *le);
|
||||
|
||||
typedef struct _zend_rsrc_list_dtors_entry {
|
||||
/* old style destructors */
|
||||
void (*list_dtor)(void *);
|
||||
void (*plist_dtor)(void *);
|
||||
|
||||
/* new style destructors */
|
||||
rsrc_dtor_func_t list_dtor_ex;
|
||||
rsrc_dtor_func_t plist_dtor_ex;
|
||||
|
||||
typedef struct _list_destructors_entry {
|
||||
void (*list_destructor)(void *);
|
||||
void (*plist_destructor)(void *);
|
||||
int module_number;
|
||||
int resource_id;
|
||||
} list_destructors_entry;
|
||||
unsigned char type;
|
||||
} zend_rsrc_list_dtors_entry;
|
||||
|
||||
#define register_list_destructors(ld,pld) _register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number);
|
||||
ZEND_API int _register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number);
|
||||
|
||||
#define register_list_destructors(ld, pld) zend_register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number);
|
||||
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number);
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, int module_number);
|
||||
|
||||
enum list_entry_type {
|
||||
LE_DB=1000
|
||||
};
|
||||
|
||||
int list_entry_destructor(void *ptr);
|
||||
int plist_entry_destructor(void *ptr);
|
||||
void list_entry_destructor(void *ptr);
|
||||
void plist_entry_destructor(void *ptr);
|
||||
|
||||
int clean_module_resource_destructors(list_destructors_entry *ld, int *module_number);
|
||||
int init_resource_list(ELS_D);
|
||||
int init_resource_plist(ELS_D);
|
||||
void destroy_resource_list(void);
|
||||
void destroy_resource_plist(void);
|
||||
void zend_clean_module_rsrc_dtors(int module_number);
|
||||
int zend_init_rsrc_list(ELS_D);
|
||||
int zend_init_rsrc_plist(ELS_D);
|
||||
void zend_destroy_rsrc_list(ELS_D);
|
||||
void zend_destroy_rsrc_plist(ELS_D);
|
||||
int zend_init_rsrc_list_dtors();
|
||||
void zend_destroy_rsrc_list_dtors();
|
||||
|
||||
ZEND_API int zend_list_insert(void *ptr, int type);
|
||||
ZEND_API int zend_plist_insert(void *ptr, int type);
|
||||
ZEND_API int zend_list_addref(int id);
|
||||
ZEND_API int zend_list_delete(int id);
|
||||
ZEND_API int zend_plist_delete(int id);
|
||||
ZEND_API int zend_list_convert_to_number(int id);
|
||||
ZEND_API void *zend_list_find(int id, int *type);
|
||||
ZEND_API void *zend_plist_find(int id, int *type);
|
||||
|
||||
@@ -70,7 +87,7 @@ extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
|
||||
|
||||
#define ZEND_VERIFY_RESOURCE(rsrc) \
|
||||
if (!rsrc) { \
|
||||
RETURN_FALSE; \
|
||||
RETURN_NULL(); \
|
||||
}
|
||||
|
||||
#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \
|
||||
|
||||
+81
-23
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -81,7 +81,7 @@ ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare
|
||||
}
|
||||
if (l->dtor) {
|
||||
l->dtor(current->data);
|
||||
efree(current);
|
||||
pefree(current, l->persistent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ ZEND_API void zend_llist_remove_tail(zend_llist *l)
|
||||
l->tail->prev->next = NULL;
|
||||
}
|
||||
l->tail = l->tail->prev;
|
||||
efree(old_tail);
|
||||
pefree(old_tail, l->persistent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +148,43 @@ ZEND_API void zend_llist_apply(zend_llist *l, void (*func)(void *data))
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func)
|
||||
{
|
||||
int list_size=0, i;
|
||||
|
||||
zend_llist_element **elements;
|
||||
zend_llist_element *element, **ptr;
|
||||
|
||||
for (element=l->head; element; element=element->next) {
|
||||
list_size++;
|
||||
}
|
||||
|
||||
if (list_size == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
elements = (zend_llist_element **) emalloc(list_size*sizeof(zend_llist_element *));
|
||||
|
||||
ptr = &elements[0];
|
||||
|
||||
for (element=l->head; element; element=element->next) {
|
||||
*ptr++ = element;
|
||||
}
|
||||
|
||||
qsort(elements, list_size, sizeof(zend_llist_element *), (int (*)(const void *, const void *)) comp_func);
|
||||
|
||||
l->head = elements[0];
|
||||
elements[0]->prev = NULL;
|
||||
|
||||
for (i=1; i<list_size; i++) {
|
||||
elements[i]->prev = elements[i-1];
|
||||
elements[i-1]->next = elements[i];
|
||||
}
|
||||
elements[i-1]->next = NULL;
|
||||
l->tail = elements[i-1];
|
||||
efree(elements);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_llist_apply_with_argument(zend_llist *l, void (*func)(void *data, void *arg), void *arg)
|
||||
{
|
||||
@@ -159,6 +196,19 @@ ZEND_API void zend_llist_apply_with_argument(zend_llist *l, void (*func)(void *d
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...)
|
||||
{
|
||||
zend_llist_element *element;
|
||||
va_list args;
|
||||
|
||||
va_start(args, num_args);
|
||||
for (element=l->head; element; element=element->next) {
|
||||
func(element->data, num_args, args);
|
||||
}
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_llist_count(zend_llist *l)
|
||||
{
|
||||
zend_llist_element *element;
|
||||
@@ -171,46 +221,54 @@ ZEND_API int zend_llist_count(zend_llist *l)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void *zend_llist_get_first(zend_llist *l)
|
||||
ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos)
|
||||
{
|
||||
l->traverse_ptr = l->head;
|
||||
if (l->traverse_ptr) {
|
||||
return l->traverse_ptr->data;
|
||||
zend_llist_position *current = pos ? pos : &l->traverse_ptr;
|
||||
|
||||
*current = l->head;
|
||||
if (*current) {
|
||||
return (*current)->data;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void *zend_llist_get_last(zend_llist *l)
|
||||
ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos)
|
||||
{
|
||||
l->traverse_ptr = l->tail;
|
||||
if (l->traverse_ptr) {
|
||||
return l->traverse_ptr->data;
|
||||
zend_llist_position *current = pos ? pos : &l->traverse_ptr;
|
||||
|
||||
*current = l->tail;
|
||||
if (*current) {
|
||||
return (*current)->data;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void *zend_llist_get_next(zend_llist *l)
|
||||
ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos)
|
||||
{
|
||||
if (l->traverse_ptr) {
|
||||
l->traverse_ptr = l->traverse_ptr->next;
|
||||
if (l->traverse_ptr) {
|
||||
return l->traverse_ptr->data;
|
||||
zend_llist_position *current = pos ? pos : &l->traverse_ptr;
|
||||
|
||||
if (*current) {
|
||||
*current = (*current)->next;
|
||||
if (*current) {
|
||||
return (*current)->data;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void *zend_llist_get_prev(zend_llist *l)
|
||||
ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos)
|
||||
{
|
||||
if (l->traverse_ptr) {
|
||||
l->traverse_ptr = l->traverse_ptr->prev;
|
||||
if (l->traverse_ptr) {
|
||||
return l->traverse_ptr->data;
|
||||
zend_llist_position *current = pos ? pos : &l->traverse_ptr;
|
||||
|
||||
if (*current) {
|
||||
*current = (*current)->prev;
|
||||
if (*current) {
|
||||
return (*current)->data;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
||||
+24
-9
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -38,6 +38,13 @@ typedef struct _zend_llist {
|
||||
zend_llist_element *traverse_ptr;
|
||||
} zend_llist;
|
||||
|
||||
typedef int (*llist_compare_func_t)(const zend_llist_element *, const zend_llist_element *);
|
||||
typedef void(*llist_apply_with_arg_func_t)(void *data, void *arg);
|
||||
typedef void(*llist_apply_with_args_func_t)(void *data, int num_args, va_list args);
|
||||
typedef void (*llist_apply_func_t)(void *);
|
||||
|
||||
typedef zend_llist_element* zend_llist_position;
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API void zend_llist_init(zend_llist *l, size_t size, void (*dtor)(void *data), unsigned char persistent);
|
||||
ZEND_API void zend_llist_add_element(zend_llist *l, void *element);
|
||||
@@ -47,15 +54,23 @@ ZEND_API void zend_llist_destroy(zend_llist *l);
|
||||
ZEND_API void zend_llist_clean(zend_llist *l);
|
||||
ZEND_API void zend_llist_remove_tail(zend_llist *l);
|
||||
ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src);
|
||||
ZEND_API void zend_llist_apply(zend_llist *l, void (*func)(void *data));
|
||||
ZEND_API void zend_llist_apply_with_argument(zend_llist *l, void (*func)(void *data, void *arg), void *arg);
|
||||
ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t);
|
||||
ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t, void *arg);
|
||||
ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...);
|
||||
ZEND_API int zend_llist_count(zend_llist *l);
|
||||
ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func);
|
||||
|
||||
/* traversal */
|
||||
ZEND_API void *zend_llist_get_first(zend_llist *l);
|
||||
ZEND_API void *zend_llist_get_last(zend_llist *l);
|
||||
ZEND_API void *zend_llist_get_next(zend_llist *l);
|
||||
ZEND_API void *zend_llist_get_prev(zend_llist *l);
|
||||
ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos);
|
||||
ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos);
|
||||
ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos);
|
||||
ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos);
|
||||
|
||||
#define zend_llist_get_first(l) zend_llist_get_first_ex(l, NULL)
|
||||
#define zend_llist_get_last(l) zend_llist_get_last_ex(l, NULL)
|
||||
#define zend_llist_get_next(l) zend_llist_get_next_ex(l, NULL)
|
||||
#define zend_llist_get_prev(l) zend_llist_get_prev_ex(l, NULL)
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* _ZEND_LLIST_H */
|
||||
+28
-7
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -21,13 +21,30 @@
|
||||
#ifndef _MODULES_H
|
||||
#define _MODULES_H
|
||||
|
||||
#define INIT_FUNC_ARGS int type, int module_number
|
||||
#define INIT_FUNC_ARGS_PASSTHRU type, module_number
|
||||
#define INIT_FUNC_ARGS int type, int module_number ELS_DC
|
||||
#define INIT_FUNC_ARGS_PASSTHRU type, module_number ELS_CC
|
||||
#define SHUTDOWN_FUNC_ARGS int type, int module_number
|
||||
#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
|
||||
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module
|
||||
#define GINIT_FUNC_ARGS void
|
||||
#define GINIT_FUNC_ARGS_PASSTHRU
|
||||
|
||||
#define STANDARD_MODULE_PROPERTIES_EX 0, 0, NULL, 0
|
||||
extern unsigned char first_arg_force_ref[];
|
||||
extern unsigned char first_arg_allow_ref[];
|
||||
extern unsigned char second_arg_force_ref[];
|
||||
extern unsigned char second_arg_allow_ref[];
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#define ZEND_MODULE_API_NO 20000609
|
||||
#ifdef ZTS
|
||||
#define USING_ZTS 1
|
||||
#else
|
||||
#define USING_ZTS 0
|
||||
#endif
|
||||
|
||||
#define STANDARD_MODULE_PROPERTIES_EX 0, 0, 0, NULL, 0, ZEND_DEBUG, USING_ZTS, ZEND_MODULE_API_NO
|
||||
|
||||
#define STANDARD_MODULE_PROPERTIES \
|
||||
NULL, NULL, STANDARD_MODULE_PROPERTIES_EX
|
||||
@@ -47,10 +64,14 @@ struct _zend_module_entry {
|
||||
void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
|
||||
int (*global_startup_func)(void);
|
||||
int (*global_shutdown_func)(void);
|
||||
int globals_id;
|
||||
int module_started;
|
||||
unsigned char type;
|
||||
void *handle;
|
||||
int module_number;
|
||||
unsigned char zend_debug;
|
||||
unsigned char zts;
|
||||
unsigned int zend_api;
|
||||
};
|
||||
|
||||
|
||||
@@ -60,5 +81,5 @@ 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
|
||||
#define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor
|
||||
#endif
|
||||
+33
-36
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -23,8 +23,6 @@
|
||||
#include "zend.h"
|
||||
#include "zend_alloc.h"
|
||||
#include "zend_compile.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_extensions.h"
|
||||
#include "zend_API.h"
|
||||
|
||||
@@ -32,11 +30,7 @@
|
||||
static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array)
|
||||
{
|
||||
if (extension->op_array_ctor) {
|
||||
if (extension->resource_number>=0) {
|
||||
extension->op_array_ctor(&op_array->reserved[extension->resource_number]);
|
||||
} else {
|
||||
extension->op_array_ctor(NULL);
|
||||
}
|
||||
extension->op_array_ctor(op_array);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,11 +38,7 @@ static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend
|
||||
static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array)
|
||||
{
|
||||
if (extension->op_array_dtor) {
|
||||
if (extension->resource_number>=0) {
|
||||
extension->op_array_dtor(&op_array->reserved[extension->resource_number]);
|
||||
} else {
|
||||
extension->op_array_dtor(NULL);
|
||||
}
|
||||
extension->op_array_dtor(op_array);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,9 +50,9 @@ static void op_array_alloc_ops(zend_op_array *op_array)
|
||||
|
||||
|
||||
|
||||
void init_op_array(zend_op_array *op_array, int initial_ops_size)
|
||||
void init_op_array(zend_op_array *op_array, int type, int initial_ops_size)
|
||||
{
|
||||
op_array->type = ZEND_USER_FUNCTION;
|
||||
op_array->type = type;
|
||||
#if SUPPORT_INTERACTIVE
|
||||
{
|
||||
ELS_FETCH();
|
||||
@@ -78,7 +68,7 @@ void init_op_array(zend_op_array *op_array, int initial_ops_size)
|
||||
}
|
||||
#endif
|
||||
|
||||
op_array->refcount = (int *) emalloc(sizeof(int));
|
||||
op_array->refcount = (zend_uint *) emalloc(sizeof(zend_uint));
|
||||
*op_array->refcount = 1;
|
||||
op_array->size = initial_ops_size;
|
||||
op_array->last = 0;
|
||||
@@ -99,11 +89,14 @@ void init_op_array(zend_op_array *op_array, int initial_ops_size)
|
||||
|
||||
op_array->uses_globals = 0;
|
||||
|
||||
op_array->return_reference = 0;
|
||||
op_array->done_pass_two = 0;
|
||||
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_ctor_handler, op_array);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int destroy_zend_function(zend_function *function)
|
||||
ZEND_API void destroy_zend_function(zend_function *function)
|
||||
{
|
||||
switch (function->type) {
|
||||
case ZEND_USER_FUNCTION:
|
||||
@@ -113,14 +106,13 @@ ZEND_API int destroy_zend_function(zend_function *function)
|
||||
/* do nothing */
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int destroy_zend_class(zend_class_entry *ce)
|
||||
ZEND_API void destroy_zend_class(zend_class_entry *ce)
|
||||
{
|
||||
if (--(*ce->refcount)>0) {
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
switch (ce->type) {
|
||||
case ZEND_USER_CLASS:
|
||||
@@ -136,7 +128,6 @@ ZEND_API int destroy_zend_class(zend_class_entry *ce)
|
||||
zend_hash_destroy(&ce->default_properties);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,6 +142,11 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
|
||||
zend_op *opline = op_array->opcodes;
|
||||
zend_op *end = op_array->opcodes+op_array->last;
|
||||
|
||||
if (op_array->static_variables) {
|
||||
zend_hash_destroy(op_array->static_variables);
|
||||
FREE_HASHTABLE(op_array->static_variables);
|
||||
}
|
||||
|
||||
if (--(*op_array->refcount)>0) {
|
||||
return;
|
||||
}
|
||||
@@ -182,31 +178,26 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
|
||||
if (op_array->brk_cont_array) {
|
||||
efree(op_array->brk_cont_array);
|
||||
}
|
||||
if (op_array->static_variables) {
|
||||
zend_hash_destroy(op_array->static_variables);
|
||||
efree(op_array->static_variables);
|
||||
if (op_array->done_pass_two) {
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_dtor_handler, op_array);
|
||||
}
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_dtor_handler, op_array);
|
||||
}
|
||||
|
||||
|
||||
void init_op(zend_op *op CLS_DC)
|
||||
{
|
||||
memset(&op->result, 0, sizeof(znode));
|
||||
op->lineno = CG(zend_lineno);
|
||||
op->filename = zend_get_compiled_filename();
|
||||
op->filename = zend_get_compiled_filename(CLS_C);
|
||||
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;
|
||||
memset(&op->op1, 0, sizeof(znode));
|
||||
memset(&op->op2, 0, sizeof(znode));
|
||||
}
|
||||
|
||||
zend_op *get_next_op(zend_op_array *op_array CLS_DC)
|
||||
{
|
||||
int next_op_num = op_array->last++;
|
||||
zend_uint next_op_num = op_array->last++;
|
||||
zend_op *next_op;
|
||||
|
||||
if (next_op_num >= op_array->size) {
|
||||
@@ -301,20 +292,23 @@ int pass_two(zend_op_array *op_array)
|
||||
if (CG(handle_op_arrays)) {
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_handler, op_array);
|
||||
}
|
||||
op_array->done_pass_two = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void pass_include_eval(zend_op_array *op_array)
|
||||
ZEND_API void pass_include_eval(zend_op_array *op_array)
|
||||
{
|
||||
zend_op *opline=op_array->opcodes, *end=opline+op_array->last;
|
||||
|
||||
while (opline<end) {
|
||||
if (opline->op1.op_type==IS_CONST) {
|
||||
opline->op1.u.constant.is_ref = 1;
|
||||
opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */
|
||||
}
|
||||
if (opline->op2.op_type==IS_CONST) {
|
||||
opline->op2.u.constant.is_ref = 1;
|
||||
opline->op2.u.constant.refcount = 2;
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
@@ -383,6 +377,9 @@ ZEND_API void *get_binary_op(int opcode)
|
||||
case ZEND_IS_IDENTICAL:
|
||||
return (void *) is_identical_function;
|
||||
break;
|
||||
case ZEND_IS_NOT_IDENTICAL:
|
||||
return (void *) is_not_identical_function;
|
||||
break;
|
||||
case ZEND_IS_EQUAL:
|
||||
return (void *) is_equal_function;
|
||||
break;
|
||||
|
||||
+393
-137
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -23,17 +23,65 @@
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_list.h"
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
#if WITH_BCMATH
|
||||
#include "functions/number.h"
|
||||
#include "ext/bcmath/number.h"
|
||||
#endif
|
||||
|
||||
ZEND_API double zend_string_to_double(const char *number, zend_uint length)
|
||||
{
|
||||
double divisor = 10.0;
|
||||
double result = 0.0;
|
||||
double exponent;
|
||||
const char *end = number+length;
|
||||
const char *digit = number;
|
||||
|
||||
if (!length) {
|
||||
return result;
|
||||
}
|
||||
|
||||
while (digit < end) {
|
||||
if ((*digit <= '9' && *digit >= '0')) {
|
||||
result *= 10;
|
||||
result += *digit - '0';
|
||||
} else if (*digit == '.') {
|
||||
digit++;
|
||||
break;
|
||||
} else if (toupper(*digit) == 'E') {
|
||||
exponent = (double) atoi(digit+1);
|
||||
result *= pow(10.0, exponent);
|
||||
return result;
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
digit++;
|
||||
}
|
||||
|
||||
while (digit < end) {
|
||||
if ((*digit <= '9' && *digit >= '0')) {
|
||||
result += (*digit - '0') / divisor;
|
||||
divisor *= 10;
|
||||
} else if (toupper(*digit) == 'E') {
|
||||
exponent = (double) atoi(digit+1);
|
||||
result *= pow(10.0, exponent);
|
||||
return result;
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
digit++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void convert_scalar_to_number(zval *op)
|
||||
{
|
||||
char *strval;
|
||||
@@ -44,11 +92,8 @@ ZEND_API void convert_scalar_to_number(zval *op)
|
||||
case IS_DOUBLE:
|
||||
case IS_LONG:
|
||||
break;
|
||||
case IS_BOOL:
|
||||
op->type = IS_LONG;
|
||||
break;
|
||||
#if WITH_BCMATH
|
||||
case IS_BC:
|
||||
case FLAG_IS_BC:
|
||||
op->type = IS_DOUBLE; /* may have lost significant digits */
|
||||
break;
|
||||
#endif
|
||||
@@ -60,6 +105,9 @@ ZEND_API void convert_scalar_to_number(zval *op)
|
||||
STR_FREE(strval);
|
||||
} else if (op->type==IS_BOOL || op->type==IS_RESOURCE) {
|
||||
op->type = IS_LONG;
|
||||
} else if (op->type==IS_NULL) {
|
||||
op->type = IS_LONG;
|
||||
op->value.lval = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +119,7 @@ ZEND_API void convert_scalar_to_number(zval *op)
|
||||
case IS_DOUBLE: \
|
||||
case IS_LONG: \
|
||||
break; \
|
||||
case IS_BC: \
|
||||
case FLAG_IS_BC: \
|
||||
(holder).type = IS_DOUBLE; /* may have lost significant digits */ \
|
||||
break; \
|
||||
default: \
|
||||
@@ -84,6 +132,10 @@ ZEND_API void convert_scalar_to_number(zval *op)
|
||||
(holder).value.lval = (op)->value.lval; \
|
||||
(holder).type = IS_LONG; \
|
||||
(op) = &(holder); \
|
||||
} else if ((op)->type==IS_NULL) { \
|
||||
(holder).value.lval = 0; \
|
||||
(holder).type = IS_LONG; \
|
||||
(op) = &(holder); \
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +149,9 @@ ZEND_API void convert_scalar_to_number(zval *op)
|
||||
(op) = &(holder); \
|
||||
} else if ((op)->type != IS_LONG) { \
|
||||
switch ((op)->type) { \
|
||||
case IS_NULL: \
|
||||
(holder).value.lval = 0; \
|
||||
break; \
|
||||
case IS_DOUBLE: \
|
||||
(holder).value.lval = (long) (op)->value.dval; \
|
||||
break; \
|
||||
@@ -124,6 +179,9 @@ ZEND_API void convert_scalar_to_number(zval *op)
|
||||
convert_to_boolean(op); \
|
||||
} else if ((op)->type != IS_BOOL) { \
|
||||
switch ((op)->type) { \
|
||||
case IS_NULL: \
|
||||
(holder).value.lval = 0; \
|
||||
break; \
|
||||
case IS_RESOURCE: \
|
||||
case IS_LONG: \
|
||||
(holder).value.lval = ((op)->value.lval ? 1 : 0); \
|
||||
@@ -166,6 +224,9 @@ ZEND_API void convert_to_long_base(zval *op, int base)
|
||||
long tmp;
|
||||
|
||||
switch (op->type) {
|
||||
case IS_NULL:
|
||||
op->value.lval = 0;
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
@@ -205,11 +266,13 @@ ZEND_API void convert_to_double(zval *op)
|
||||
double tmp;
|
||||
|
||||
switch (op->type) {
|
||||
case IS_NULL:
|
||||
op->value.dval = 0.0;
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
op->value.dval = (double) op->value.lval;
|
||||
op->type = IS_DOUBLE;
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
break;
|
||||
@@ -217,28 +280,32 @@ ZEND_API void convert_to_double(zval *op)
|
||||
strval = op->value.str.val;
|
||||
|
||||
op->value.dval = strtod(strval, NULL);
|
||||
op->type = IS_DOUBLE;
|
||||
STR_FREE(strval);
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
tmp = (zend_hash_num_elements(op->value.ht)?1:0);
|
||||
zval_dtor(op);
|
||||
op->value.dval = tmp;
|
||||
op->type = IS_DOUBLE;
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
tmp = (zend_hash_num_elements(op->value.obj.properties)?1:0);
|
||||
zval_dtor(op);
|
||||
op->value.dval = tmp;
|
||||
op->type = IS_DOUBLE;
|
||||
break;
|
||||
default:
|
||||
zend_error(E_WARNING, "Cannot convert to real value (type=%d)", op->type);
|
||||
zval_dtor(op);
|
||||
op->value.dval = 0;
|
||||
op->type = IS_DOUBLE;
|
||||
break;
|
||||
}
|
||||
op->type = IS_DOUBLE;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void convert_to_null(zval *op)
|
||||
{
|
||||
zval_dtor(op);
|
||||
op->type = IS_NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -250,6 +317,9 @@ ZEND_API void convert_to_boolean(zval *op)
|
||||
switch (op->type) {
|
||||
case IS_BOOL:
|
||||
break;
|
||||
case IS_NULL:
|
||||
op->value.lval = 0;
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
case IS_LONG:
|
||||
op->value.lval = (op->value.lval ? 1 : 0);
|
||||
@@ -287,45 +357,55 @@ ZEND_API void convert_to_boolean(zval *op)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void convert_to_string(zval *op)
|
||||
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
|
||||
{
|
||||
long lval;
|
||||
double dval;
|
||||
ELS_FETCH();
|
||||
|
||||
switch (op->type) {
|
||||
case IS_NULL:
|
||||
op->value.str.val = empty_string;
|
||||
op->value.str.len = 0;
|
||||
break;
|
||||
case IS_STRING:
|
||||
break;
|
||||
case IS_BOOL:
|
||||
if (op->value.lval) {
|
||||
op->value.str.val = estrndup("1", 1);
|
||||
op->value.str.val = estrndup_rel("1", 1);
|
||||
op->value.str.len = 1;
|
||||
} else {
|
||||
op->value.str.val = empty_string;
|
||||
op->value.str.len = 0;
|
||||
}
|
||||
break;
|
||||
case IS_RESOURCE: {
|
||||
long tmp = op->value.lval;
|
||||
op->value.str.val = (char *) emalloc(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG);
|
||||
op->value.str.len = sprintf(op->value.str.val, "Resource id #%ld", tmp);
|
||||
break;
|
||||
}
|
||||
case IS_LONG:
|
||||
lval = op->value.lval;
|
||||
|
||||
op->value.str.val = (char *) emalloc(MAX_LENGTH_OF_LONG + 1);
|
||||
op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_LONG + 1);
|
||||
op->value.str.len = zend_sprintf(op->value.str.val, "%ld", lval); /* SAFE */
|
||||
break;
|
||||
case IS_DOUBLE: {
|
||||
dval = op->value.dval;
|
||||
op->value.str.val = (char *) emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
|
||||
op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
|
||||
op->value.str.len = zend_sprintf(op->value.str.val, "%.*G", (int) EG(precision), dval); /* SAFE */
|
||||
/* %G already handles removing trailing zeros from the fractional part, yay */
|
||||
break;
|
||||
}
|
||||
case IS_ARRAY:
|
||||
zval_dtor(op);
|
||||
op->value.str.val = estrndup("Array",sizeof("Array")-1);
|
||||
op->value.str.val = estrndup_rel("Array",sizeof("Array")-1);
|
||||
op->value.str.len = sizeof("Array")-1;
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
zval_dtor(op);
|
||||
op->value.str.val = estrndup("Object",sizeof("Object")-1);
|
||||
op->value.str.val = estrndup_rel("Object",sizeof("Object")-1);
|
||||
op->value.str.len = sizeof("Object")-1;
|
||||
break;
|
||||
default:
|
||||
@@ -339,21 +419,22 @@ ZEND_API void convert_to_string(zval *op)
|
||||
|
||||
static void convert_scalar_to_array(zval *op, int type)
|
||||
{
|
||||
zval *entry = (zval *) emalloc(sizeof(zval));
|
||||
zval *entry;
|
||||
|
||||
ALLOC_ZVAL(entry);
|
||||
*entry = *op;
|
||||
INIT_PZVAL(entry);
|
||||
|
||||
switch (type) {
|
||||
case IS_ARRAY:
|
||||
op->value.ht = (HashTable *) emalloc(sizeof(HashTable));
|
||||
zend_hash_init(op->value.ht, 0, NULL, PVAL_PTR_DTOR, 0);
|
||||
ALLOC_HASHTABLE(op->value.ht);
|
||||
zend_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_index_update(op->value.ht, 0, (void *) &entry, sizeof(zval *), NULL);
|
||||
op->type = IS_ARRAY;
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
op->value.obj.properties = (HashTable *) emalloc(sizeof(HashTable));
|
||||
zend_hash_init(op->value.obj.properties, 0, NULL, PVAL_PTR_DTOR, 0);
|
||||
ALLOC_HASHTABLE(op->value.obj.properties);
|
||||
zend_hash_init(op->value.obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_update(op->value.obj.properties, "scalar", sizeof("scalar"), (void *) &entry, sizeof(zval *), NULL);
|
||||
op->value.obj.ce = &zend_standard_class_def;
|
||||
op->type = IS_OBJECT;
|
||||
@@ -372,6 +453,10 @@ ZEND_API void convert_to_array(zval *op)
|
||||
op->type = IS_ARRAY;
|
||||
op->value.ht = op->value.obj.properties;
|
||||
return;
|
||||
case IS_NULL:
|
||||
ALLOC_HASHTABLE(op->value.ht);
|
||||
zend_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
op->type = IS_ARRAY;
|
||||
break;
|
||||
default:
|
||||
convert_scalar_to_array(op, IS_ARRAY);
|
||||
@@ -391,6 +476,11 @@ ZEND_API void convert_to_object(zval *op)
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
return;
|
||||
case IS_NULL:
|
||||
ALLOC_HASHTABLE(op->value.obj.properties);
|
||||
zend_hash_init(op->value.obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
op->value.obj.ce = &zend_standard_class_def;
|
||||
op->type = IS_OBJECT;
|
||||
break;
|
||||
default:
|
||||
convert_scalar_to_array(op, IS_OBJECT);
|
||||
@@ -687,7 +777,8 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2)
|
||||
|
||||
if (op1->type == IS_STRING && op2->type == IS_STRING) {
|
||||
zval *longer, *shorter;
|
||||
int i;
|
||||
char *result_str;
|
||||
int i, result_len;
|
||||
|
||||
if (op1->value.str.len >= op2->value.str.len) {
|
||||
longer = op1;
|
||||
@@ -697,11 +788,17 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2)
|
||||
shorter = op1;
|
||||
}
|
||||
|
||||
result->value.str.len = longer->value.str.len;
|
||||
result->value.str.val = estrndup(longer->value.str.val, longer->value.str.len);
|
||||
result->type = IS_STRING;
|
||||
result_len = longer->value.str.len;
|
||||
result_str = estrndup(longer->value.str.val, longer->value.str.len);
|
||||
for (i = 0; i < shorter->value.str.len; i++) {
|
||||
result->value.str.val[i] |= shorter->value.str.val[i];
|
||||
result_str[i] |= shorter->value.str.val[i];
|
||||
}
|
||||
if (result==op1) {
|
||||
efree(result->value.str.val);
|
||||
}
|
||||
result->value.str.val = result_str;
|
||||
result->value.str.len = result_len;
|
||||
return SUCCESS;
|
||||
}
|
||||
zendi_convert_to_long(op1, op1_copy, result);
|
||||
@@ -719,7 +816,8 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2)
|
||||
|
||||
if (op1->type == IS_STRING && op2->type == IS_STRING) {
|
||||
zval *longer, *shorter;
|
||||
int i;
|
||||
char *result_str;
|
||||
int i, result_len;
|
||||
|
||||
if (op1->value.str.len >= op2->value.str.len) {
|
||||
longer = op1;
|
||||
@@ -729,11 +827,17 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2)
|
||||
shorter = op1;
|
||||
}
|
||||
|
||||
result->value.str.len = shorter->value.str.len;
|
||||
result->value.str.val = estrndup(shorter->value.str.val, shorter->value.str.len);
|
||||
result->type = IS_STRING;
|
||||
result_len = shorter->value.str.len;
|
||||
result_str = estrndup(shorter->value.str.val, shorter->value.str.len);
|
||||
for (i = 0; i < shorter->value.str.len; i++) {
|
||||
result->value.str.val[i] &= longer->value.str.val[i];
|
||||
result_str[i] &= longer->value.str.val[i];
|
||||
}
|
||||
if (result==op1) {
|
||||
efree(result->value.str.val);
|
||||
}
|
||||
result->value.str.val = result_str;
|
||||
result->value.str.len = result_len;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -753,7 +857,8 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2)
|
||||
|
||||
if (op1->type == IS_STRING && op2->type == IS_STRING) {
|
||||
zval *longer, *shorter;
|
||||
int i;
|
||||
char *result_str;
|
||||
int i, result_len;
|
||||
|
||||
if (op1->value.str.len >= op2->value.str.len) {
|
||||
longer = op1;
|
||||
@@ -763,11 +868,17 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2)
|
||||
shorter = op1;
|
||||
}
|
||||
|
||||
result->value.str.len = shorter->value.str.len;
|
||||
result->value.str.val = estrndup(shorter->value.str.val, shorter->value.str.len);
|
||||
result->type = IS_STRING;
|
||||
result_len = shorter->value.str.len;
|
||||
result_str = estrndup(shorter->value.str.val, shorter->value.str.len);
|
||||
for (i = 0; i < shorter->value.str.len; i++) {
|
||||
result->value.str.val[i] ^= longer->value.str.val[i];
|
||||
result_str[i] ^= longer->value.str.val[i];
|
||||
}
|
||||
if (result==op1) {
|
||||
efree(result->value.str.val);
|
||||
}
|
||||
result->value.str.val = result_str;
|
||||
result->value.str.len = result_len;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -810,7 +921,7 @@ ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
result->value.str.len = op1->value.str.len + 1;
|
||||
result->value.str.val = (char *) erealloc(op1->value.str.val, result->value.str.len+1);
|
||||
result->value.str.val[result->value.str.len - 1] = op2->value.chval;
|
||||
result->value.str.val[result->value.str.len - 1] = (char) op2->value.lval;
|
||||
result->value.str.val[result->value.str.len] = 0;
|
||||
result->type = IS_STRING;
|
||||
return SUCCESS;
|
||||
@@ -875,45 +986,151 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
int use_copy1, use_copy2;
|
||||
|
||||
zend_make_printable_zval(op1, &op1_copy, &use_copy1);
|
||||
zend_make_printable_zval(op2, &op2_copy, &use_copy2);
|
||||
|
||||
if (use_copy1) {
|
||||
op1 = &op1_copy;
|
||||
}
|
||||
if (use_copy2) {
|
||||
op2 = &op2_copy;
|
||||
}
|
||||
|
||||
result->value.lval = zend_binary_zval_strcmp(op1, op2);
|
||||
result->type = IS_LONG;
|
||||
|
||||
if (use_copy1) {
|
||||
zval_dtor(op1);
|
||||
}
|
||||
if (use_copy2) {
|
||||
zval_dtor(op2);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
op1_copy = *op1;
|
||||
zval_copy_ctor(&op1_copy);
|
||||
|
||||
op2_copy = *op2;
|
||||
zval_copy_ctor(&op2_copy);
|
||||
|
||||
convert_to_double(&op1_copy);
|
||||
convert_to_double(&op2_copy);
|
||||
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(op1_copy.value.dval-op2_copy.value.dval);
|
||||
result->type = IS_LONG;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
zval op1_copy, op2_copy;
|
||||
|
||||
if ((op1->type == IS_NULL && op2->type == IS_STRING)
|
||||
|| (op2->type == IS_NULL && op1->type == IS_STRING)) {
|
||||
if (op1->type == IS_NULL) {
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = zend_binary_strcmp("", 0, op2->value.str.val, op2->value.str.len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = zend_binary_strcmp(op1->value.str.val, op1->value.str.len, "", 0);
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
if (op1->type == IS_STRING && op2->type == IS_STRING) {
|
||||
zendi_smart_strcmp(result, op1, op2);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (op1->type == IS_BOOL || op2->type == IS_BOOL) {
|
||||
if (op1->type == IS_BOOL || op2->type == IS_BOOL
|
||||
|| op1->type == IS_NULL || op2->type == IS_NULL) {
|
||||
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;
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
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;
|
||||
result->value.lval = op1->value.lval - op2->value.lval;
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
|
||||
return SUCCESS;
|
||||
}
|
||||
if ((op1->type == IS_DOUBLE || op1->type == IS_LONG)
|
||||
&& (op2->type == IS_DOUBLE || op2->type == IS_LONG)) {
|
||||
result->value.dval = (op1->type == IS_LONG ? (double) op1->value.lval : op1->value.dval) - (op2->type == IS_LONG ? (double) op2->value.lval : op2->value.dval);
|
||||
result->type = IS_DOUBLE;
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval);
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
if ((op1->type==IS_ARRAY || op1->type==IS_OBJECT)
|
||||
&& (op2->type==IS_ARRAY || op2->type==IS_OBJECT)) {
|
||||
zend_error(E_WARNING,"Cannot compare arrays or objects");
|
||||
if (op1->type==IS_ARRAY && op2->type==IS_ARRAY) {
|
||||
zend_compare_arrays(result, op1, op2);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (op1->type==IS_OBJECT && op2->type==IS_OBJECT) {
|
||||
zend_compare_objects(result, op1, op2);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (op1->type==IS_ARRAY) {
|
||||
result->value.lval = 1;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
if (op2->type==IS_ARRAY) {
|
||||
result->value.lval = -1;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
if (op1->type==IS_OBJECT) {
|
||||
result->value.lval = 1;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
if (op2->type==IS_OBJECT) {
|
||||
result->value.lval = -1;
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
var_reset(result);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
static int hash_zval_identical_function(const zval **z1, const zval **z2)
|
||||
{
|
||||
zval result;
|
||||
|
||||
/* is_identical_function() returns 1 in case of identity and 0 in case
|
||||
* of a difference;
|
||||
* whereas this comparison function is expected to return 0 on identity,
|
||||
* and non zero otherwise.
|
||||
*/
|
||||
if (is_identical_function(&result, (zval *) *z1, (zval *) *z2)==FAILURE) {
|
||||
return 1;
|
||||
}
|
||||
return !result.value.lval;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
result->type = IS_BOOL;
|
||||
@@ -922,15 +1139,16 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
|
||||
return SUCCESS;
|
||||
}
|
||||
switch (op1->type) {
|
||||
case IS_NULL:
|
||||
result->value.lval = (op2->type==IS_NULL);
|
||||
break;
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
case IS_RESOURCE:
|
||||
result->value.lval = (op1->value.lval == op2->value.lval);
|
||||
return SUCCESS;
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
result->value.lval = (op1->value.dval == op2->value.dval);
|
||||
return SUCCESS;
|
||||
break;
|
||||
case IS_STRING:
|
||||
if ((op1->value.str.len == op2->value.str.len)
|
||||
@@ -939,17 +1157,44 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
|
||||
} else {
|
||||
result->value.lval = 0;
|
||||
}
|
||||
return SUCCESS;
|
||||
break;
|
||||
case IS_ARRAY:
|
||||
case IS_OBJECT:
|
||||
zend_error(E_WARNING,"Cannot compare arrays or objects");
|
||||
if (zend_hash_compare(op1->value.ht, op2->value.ht, (compare_func_t) hash_zval_identical_function, 1)==0) {
|
||||
result->value.lval = 1;
|
||||
} else {
|
||||
result->value.lval = 0;
|
||||
}
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
if (op1->value.obj.ce != op2->value.obj.ce) {
|
||||
result->value.lval = 0;
|
||||
} else {
|
||||
if (zend_hash_compare(op1->value.obj.properties, op2->value.obj.properties, (compare_func_t) hash_zval_identical_function, 1)==0) {
|
||||
result->value.lval = 1;
|
||||
} else {
|
||||
result->value.lval = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
var_reset(result);
|
||||
return FAILURE;
|
||||
}
|
||||
var_reset(result);
|
||||
return FAILURE;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
result->type = IS_BOOL;
|
||||
if (is_identical_function( result, op1, op2 ) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
result->value.lval = !result->value.lval;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
if (compare_function(result, op1, op2) == FAILURE) {
|
||||
@@ -986,6 +1231,7 @@ ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2)
|
||||
return FAILURE;
|
||||
}
|
||||
if (result->type == IS_LONG) {
|
||||
result->type = IS_BOOL;
|
||||
if (result->value.lval < 0) {
|
||||
result->value.lval = 1;
|
||||
} else {
|
||||
@@ -994,7 +1240,7 @@ ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2)
|
||||
return SUCCESS;
|
||||
}
|
||||
if (result->type == IS_DOUBLE) {
|
||||
result->type = IS_LONG;
|
||||
result->type = IS_BOOL;
|
||||
if (result->value.dval < 0) {
|
||||
result->value.lval = 1;
|
||||
} else {
|
||||
@@ -1013,6 +1259,7 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2)
|
||||
return FAILURE;
|
||||
}
|
||||
if (result->type == IS_LONG) {
|
||||
result->type = IS_BOOL;
|
||||
if (result->value.lval <= 0) {
|
||||
result->value.lval = 1;
|
||||
} else {
|
||||
@@ -1021,7 +1268,7 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2)
|
||||
return SUCCESS;
|
||||
}
|
||||
if (result->type == IS_DOUBLE) {
|
||||
result->type = IS_LONG;
|
||||
result->type = IS_BOOL;
|
||||
if (result->value.dval <= 0) {
|
||||
result->value.lval = 1;
|
||||
} else {
|
||||
@@ -1118,14 +1365,12 @@ ZEND_API int increment_function(zval *op1)
|
||||
case IS_DOUBLE:
|
||||
op1->value.dval = op1->value.dval + 1;
|
||||
break;
|
||||
case IS_NULL:
|
||||
op1->value.lval = 1;
|
||||
op1->type = IS_LONG;
|
||||
break;
|
||||
case IS_STRING: /* Perl style string increment */
|
||||
if (op1->value.str.len==0) { /* consider as 0 */
|
||||
STR_FREE(op1->value.str.val);
|
||||
op1->value.lval = 1;
|
||||
op1->type = IS_LONG;
|
||||
} else {
|
||||
increment_string(op1);
|
||||
}
|
||||
increment_string(op1);
|
||||
break;
|
||||
default:
|
||||
return FAILURE;
|
||||
@@ -1184,43 +1429,67 @@ ZEND_API void zend_str_tolower(char *str, unsigned int length)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_strcmp(zval *s1, zval *s2)
|
||||
ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2)
|
||||
{
|
||||
int retval;
|
||||
|
||||
retval = memcmp(s1->value.str.val, s2->value.str.val, MIN(s1->value.str.len,s2->value.str.len));
|
||||
retval = memcmp(s1, s2, MIN(len1, len2));
|
||||
if (!retval) {
|
||||
return (s1->value.str.len - s2->value.str.len);
|
||||
return (len1 - len2);
|
||||
} else {
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length)
|
||||
{
|
||||
int retval;
|
||||
|
||||
retval = memcmp(s1, s2, MIN(length, MIN(len1, len2)));
|
||||
if (!retval) {
|
||||
return (MIN(length, len1) - MIN(length, len2));
|
||||
} else {
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_strcasecmp(zval *s1, zval *s2)
|
||||
ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2)
|
||||
{
|
||||
const unsigned char *p1 = (const unsigned char *)s1->value.str.val;
|
||||
const unsigned char *p2 = (const unsigned char *)s2->value.str.val;
|
||||
unsigned char c1 = 0, c2 = 0;
|
||||
int len1, len2;
|
||||
int len;
|
||||
int c1,c2;
|
||||
|
||||
len1 = s1->value.str.len;
|
||||
len2 = s2->value.str.len;
|
||||
if (len1 != len2 || !len1) {
|
||||
return len1 - len2;
|
||||
}
|
||||
len = MIN(len1, len2);
|
||||
|
||||
while (len1--) {
|
||||
c1 = tolower(*p1++);
|
||||
c2 = tolower(*p2++);
|
||||
while (len--) {
|
||||
c1 = tolower(*s1++);
|
||||
c2 = tolower(*s2++);
|
||||
if (c1 != c2) {
|
||||
break;
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
|
||||
return c1 - c2;
|
||||
return len1 - len2;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2)
|
||||
{
|
||||
return zend_binary_strcmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len);
|
||||
}
|
||||
|
||||
ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3)
|
||||
{
|
||||
return zend_binary_strncmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2)
|
||||
{
|
||||
return zend_binary_strcasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
{
|
||||
int ret1,ret2;
|
||||
@@ -1230,7 +1499,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1)) &&
|
||||
(ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2))) {
|
||||
#if WITH_BCMATH
|
||||
if ((ret1==IS_BC) || (ret2==IS_BC)) {
|
||||
if ((ret1==FLAG_IS_BC) || (ret2==FLAG_IS_BC)) {
|
||||
bc_num first, second;
|
||||
|
||||
/* use the BC math library to compare the numbers */
|
||||
@@ -1239,6 +1508,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
str2num(&first,s1->value.str.val,100); /* this scale should do */
|
||||
str2num(&second,s2->value.str.val,100); /* ditto */
|
||||
result->value.lval = bc_compare(first,second);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
@@ -1251,79 +1521,65 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
dval2 = strtod(s2->value.str.val, NULL);
|
||||
}
|
||||
result->value.dval = dval1 - dval2;
|
||||
result->type = IS_DOUBLE;
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval);
|
||||
result->type = IS_LONG;
|
||||
} else { /* they both have to be long's */
|
||||
result->value.lval = lval1 - lval2;
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
}
|
||||
} else {
|
||||
result->value.lval = zend_binary_strcmp(s1,s2);
|
||||
result->value.lval = zend_binary_zval_strcmp(s1, s2);
|
||||
result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static int hash_zval_compare_function(const zval **z1, const zval **z2)
|
||||
{
|
||||
zval result;
|
||||
|
||||
if (compare_function(&result, (zval *) *z1, (zval *) *z2)==FAILURE) {
|
||||
return 1;
|
||||
}
|
||||
return result.value.lval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2)
|
||||
{
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2)
|
||||
{
|
||||
zend_compare_symbol_tables(result, a1->value.ht, a2->value.ht);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2)
|
||||
{
|
||||
if (o1->value.obj.ce != o2->value.obj.ce) {
|
||||
result->value.lval = 1; /* Comparing objects of different types is pretty much meaningless */
|
||||
result->type = IS_LONG;
|
||||
return;
|
||||
}
|
||||
zend_compare_symbol_tables(result, o1->value.obj.properties, o2->value.obj.properties);
|
||||
}
|
||||
|
||||
|
||||
/* returns 0 for non-numeric string
|
||||
* returns IS_DOUBLE for floating point string, and assigns the value to *dval (if it's not NULL)
|
||||
* returns IS_LONG for integer strings, and assigns the value to *lval (if it's not NULL)
|
||||
* returns IS_BC if the number might lose accuracy when converted to a double
|
||||
* returns FLAG_IS_BC if the number might lose accuracy when converted to a double
|
||||
*/
|
||||
|
||||
#if 1
|
||||
ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double *dval)
|
||||
{
|
||||
long local_lval;
|
||||
double local_dval;
|
||||
char *end_ptr;
|
||||
|
||||
if (!length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno=0;
|
||||
local_lval = strtol(str, &end_ptr, 10);
|
||||
if (errno!=ERANGE && end_ptr == str+length) { /* integer string */
|
||||
if (lval) {
|
||||
*lval = local_lval;
|
||||
}
|
||||
return IS_LONG;
|
||||
}
|
||||
|
||||
errno=0;
|
||||
local_dval = strtod(str, &end_ptr);
|
||||
if (errno!=ERANGE && end_ptr == str+length) { /* floating point string */
|
||||
if (dval) {
|
||||
*dval = local_dval;
|
||||
}
|
||||
#if WITH_BCMATH
|
||||
if (length>16) {
|
||||
register char *ptr=str, *end=str+length;
|
||||
|
||||
while(ptr<end) {
|
||||
switch(*ptr++) {
|
||||
case 'e':
|
||||
case 'E':
|
||||
/* scientific notation, not handled by the BC library */
|
||||
return IS_DOUBLE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return IS_BC;
|
||||
} else {
|
||||
return IS_DOUBLE;
|
||||
}
|
||||
#else
|
||||
return IS_DOUBLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
#if 0
|
||||
|
||||
static inline int is_numeric_string(char *str, int length, long *lval, double *dval)
|
||||
{
|
||||
|
||||
+140
-46
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -21,6 +21,17 @@
|
||||
#ifndef _OPERATORS_H
|
||||
#define _OPERATORS_H
|
||||
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
|
||||
#if WITH_BCMATH
|
||||
#include "ext/bcmath/number.h"
|
||||
#endif
|
||||
|
||||
#define MAX_LENGTH_OF_LONG 18
|
||||
#define MAX_LENGTH_OF_DOUBLE 32
|
||||
|
||||
@@ -43,82 +54,141 @@ 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_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 inline int is_numeric_string(char *str, int length, long *lval, double *dval)
|
||||
#if defined(C9X_INLINE_SEMANTICS)
|
||||
{
|
||||
long local_lval;
|
||||
double local_dval;
|
||||
char *end_ptr;
|
||||
|
||||
if (!length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
errno=0;
|
||||
local_lval = strtol(str, &end_ptr, 10);
|
||||
if (errno!=ERANGE && end_ptr == str+length) { /* integer string */
|
||||
if (lval) {
|
||||
*lval = local_lval;
|
||||
}
|
||||
return IS_LONG;
|
||||
}
|
||||
|
||||
errno=0;
|
||||
local_dval = strtod(str, &end_ptr);
|
||||
if (errno!=ERANGE && end_ptr == str+length) { /* floating point string */
|
||||
if (! zend_finite(local_dval)) {
|
||||
/* "inf","nan" and maybe other weird ones */
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dval) {
|
||||
*dval = local_dval;
|
||||
}
|
||||
#if WITH_BCMATH
|
||||
if (length>16) {
|
||||
register char *ptr=str, *end=str+length;
|
||||
|
||||
while(ptr<end) {
|
||||
switch(*ptr++) {
|
||||
case 'e':
|
||||
case 'E':
|
||||
/* scientific notation, not handled by the BC library */
|
||||
return IS_DOUBLE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FLAG_IS_BC;
|
||||
} else {
|
||||
return IS_DOUBLE;
|
||||
}
|
||||
#else
|
||||
return IS_DOUBLE;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
;
|
||||
#endif
|
||||
|
||||
ZEND_API int increment_function(zval *op1);
|
||||
ZEND_API int decrement_function(zval *op2);
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
ZEND_API void convert_scalar_to_number(zval *op);
|
||||
ZEND_API void convert_to_string(zval *op);
|
||||
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC);
|
||||
ZEND_API void convert_to_long(zval *op);
|
||||
ZEND_API void convert_to_double(zval *op);
|
||||
ZEND_API void convert_to_long_base(zval *op, int base);
|
||||
ZEND_API void convert_to_null(zval *op);
|
||||
ZEND_API void convert_to_boolean(zval *op);
|
||||
ZEND_API void convert_to_array(zval *op);
|
||||
ZEND_API void convert_to_object(zval *op);
|
||||
ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API void convert_to_double(zval *op);
|
||||
#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC)
|
||||
|
||||
ZEND_API double zend_string_to_double(const char *number, zend_uint length);
|
||||
END_EXTERN_C()
|
||||
|
||||
ZEND_API int zval_is_true(zval *op);
|
||||
ZEND_API int compare_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2);
|
||||
ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2);
|
||||
|
||||
ZEND_API void zend_str_tolower(char *str, unsigned int length);
|
||||
ZEND_API int zend_binary_strcmp(zval *s1, zval *s2);
|
||||
ZEND_API int zend_binary_strcasecmp(zval *s1, zval *s2);
|
||||
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2);
|
||||
ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3);
|
||||
ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2);
|
||||
ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2);
|
||||
ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length);
|
||||
ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2);
|
||||
|
||||
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
|
||||
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2);
|
||||
ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2);
|
||||
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
|
||||
|
||||
#define convert_to_long_ex(ppzv) \
|
||||
if ((*ppzv)->type!=IS_LONG) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
|
||||
#define convert_to_ex_master(ppzv, lower_type, upper_type) \
|
||||
if ((*ppzv)->type!=IS_##upper_type) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
} \
|
||||
convert_to_long(*ppzv); \
|
||||
convert_to_##lower_type(*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_writable_ex_master(ppzv, lower_type, upper_type) \
|
||||
if ((*ppzv)->type!=IS_##upper_type) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
convert_to_##lower_type(*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_boolean_ex(ppzv) convert_to_ex_master(ppzv, boolean, BOOL)
|
||||
#define convert_to_long_ex(ppzv) convert_to_ex_master(ppzv, long, LONG)
|
||||
#define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE)
|
||||
#define convert_to_string_ex(ppzv) convert_to_ex_master(ppzv, string, STRING)
|
||||
#define convert_to_array_ex(ppzv) convert_to_ex_master(ppzv, array, ARRAY)
|
||||
#define convert_to_object_ex(ppzv) convert_to_ex_master(ppzv, object, OBJECT)
|
||||
#define convert_to_null_ex(ppzv) convert_to_ex_master(ppzv, null, NULL)
|
||||
|
||||
#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_writable_boolean_ex(ppzv) convert_to_writable_ex_master(ppzv, boolean, BOOL)
|
||||
#define convert_to_writable_long_ex(ppzv) convert_to_writable_ex_master(ppzv, long, LONG)
|
||||
#define convert_to_writable_double_ex(ppzv) convert_to_writable_ex_master(ppzv, double, DOUBLE)
|
||||
#define convert_to_writable_string_ex(ppzv) convert_to_writable_ex_master(ppzv, string, STRING)
|
||||
#define convert_to_writable_array_ex(ppzv) convert_to_writable_ex_master(ppzv, array, ARRAY)
|
||||
#define convert_to_writable_object_ex(ppzv) convert_to_writable_ex_master(ppzv, object, OBJECT)
|
||||
#define convert_to_writable_null_ex(ppzv) convert_to_writable_ex_master(ppzv, null, NULL)
|
||||
|
||||
#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) { \
|
||||
@@ -128,4 +198,28 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
|
||||
convert_scalar_to_number(*ppzv); \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define Z_LVAL(zval) (zval).value.lval
|
||||
#define Z_DVAL(zval) (zval).value.dval
|
||||
#define Z_STRVAL(zval) (zval).value.str.val
|
||||
#define Z_STRLEN(zval) (zval).value.str.len
|
||||
#define Z_ARRVAL(zval) (zval).value.ht
|
||||
|
||||
#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p)
|
||||
#define Z_DVAL_P(zval_p) Z_DVAL(*zval_p)
|
||||
#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p)
|
||||
#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p)
|
||||
#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p)
|
||||
|
||||
#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp)
|
||||
#define Z_DVAL_PP(zval_pp) Z_DVAL(**zval_pp)
|
||||
#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp)
|
||||
#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp)
|
||||
#define Z_ARRVAL_PP(zval_pp) Z_ARRVAL(**zval_pp)
|
||||
|
||||
#define Z_TYPE(zval) (zval).type
|
||||
#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p)
|
||||
#define Z_TYPE_PP(zval_pp) Z_TYPE(**zval_pp)
|
||||
|
||||
#endif
|
||||
+17
-6
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -42,7 +42,7 @@ ZEND_API inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr)
|
||||
*(stack->top_element++) = ptr;
|
||||
}
|
||||
|
||||
ZEND_API inline void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count,...)
|
||||
ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...)
|
||||
{
|
||||
va_list ptr;
|
||||
void *elem;
|
||||
@@ -64,7 +64,7 @@ ZEND_API inline void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count,...)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API inline void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count,...)
|
||||
ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...)
|
||||
{
|
||||
va_list ptr;
|
||||
void **elem;
|
||||
@@ -104,11 +104,22 @@ ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *))
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *))
|
||||
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements)
|
||||
{
|
||||
zend_ptr_stack_apply(stack, func);
|
||||
if (free_elements) {
|
||||
int i = stack->top;
|
||||
|
||||
while (--i >= 0) {
|
||||
efree(stack->elements[i]);
|
||||
}
|
||||
}
|
||||
stack->top = 0;
|
||||
stack->top_element = stack->elements;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack)
|
||||
{
|
||||
return stack->top;
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -22,7 +22,7 @@
|
||||
#define _ZEND_PTR_STACK_H
|
||||
|
||||
typedef struct _zend_ptr_stack {
|
||||
short top, max;
|
||||
int top, max;
|
||||
void **elements;
|
||||
void **top_element;
|
||||
} zend_ptr_stack;
|
||||
@@ -32,11 +32,12 @@ typedef struct _zend_ptr_stack {
|
||||
|
||||
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_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_n_pop(zend_ptr_stack *stack, int count, ...);
|
||||
ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack);
|
||||
ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *));
|
||||
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *));
|
||||
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements);
|
||||
ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack);
|
||||
|
||||
#endif /* _ZEND_PTR_STACK_H */
|
||||
+4
-4
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -26,7 +26,7 @@
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#if BROKEN_SPRINTF
|
||||
#if ZEND_BROKEN_SPRINTF
|
||||
int zend_sprintf(char *buffer, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
+5
-5
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -118,7 +118,7 @@ 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(zend_stack *stack, int type, int (*apply_function)(void *element))
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -141,7 +141,7 @@ ZEND_API void zend_stack_apply(zend_stack *stack, int (*apply_function)(void *el
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int (*apply_function)(void *element, void *arg), int type, void *arg)
|
||||
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
+5
-5
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -38,8 +38,8 @@ 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);
|
||||
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element));
|
||||
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg);
|
||||
|
||||
#define ZEND_STACK_APPLY_TOPDOWN 1
|
||||
#define ZEND_STACK_APPLY_BOTTOMUP 2
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "zend_static_allocator.h"
|
||||
|
||||
/* Not checking emalloc() and erealloc() return values as they are supposed to bailout */
|
||||
|
||||
inline static void block_init(Block *block, zend_uint block_size)
|
||||
{
|
||||
block->pos = block->bp = (char *) emalloc(block_size);
|
||||
block->end = block->bp + block_size;
|
||||
}
|
||||
|
||||
inline static char *block_allocate(Block *block, zend_uint size)
|
||||
{
|
||||
char *retval = block->pos;
|
||||
if ((block->pos += size) >= block->end) {
|
||||
return (char *)NULL;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
inline static void block_destroy(Block *block)
|
||||
{
|
||||
efree(block->bp);
|
||||
}
|
||||
|
||||
void static_allocator_init(StaticAllocator *sa)
|
||||
{
|
||||
sa->Blocks = (Block *) emalloc(sizeof(Block));
|
||||
block_init(sa->Blocks, ALLOCATOR_BLOCK_SIZE);
|
||||
sa->num_blocks = 1;
|
||||
sa->current_block = 0;
|
||||
}
|
||||
|
||||
char *static_allocator_allocate(StaticAllocator *sa, zend_uint size)
|
||||
{
|
||||
char *retval;
|
||||
|
||||
retval = block_allocate(&sa->Blocks[sa->current_block], size);
|
||||
if (retval) {
|
||||
return retval;
|
||||
}
|
||||
sa->Blocks = (Block *) erealloc(sa->Blocks, ++sa->num_blocks);
|
||||
sa->current_block++;
|
||||
block_init(&sa->Blocks[sa->current_block], (size > ALLOCATOR_BLOCK_SIZE) ? size : ALLOCATOR_BLOCK_SIZE);
|
||||
retval = block_allocate(&sa->Blocks[sa->current_block], size);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void static_allocator_destroy(StaticAllocator *sa)
|
||||
{
|
||||
zend_uint i;
|
||||
|
||||
for (i=0; i<sa->num_blocks; i++) {
|
||||
block_free(&sa->Blocks[i]);
|
||||
}
|
||||
efree(sa->Blocks);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef _STATIC_ALLOCATOR_H
|
||||
#define _STATIC_ALLOCATOR_H
|
||||
|
||||
#define ALLOCATOR_BLOCK_SIZE 400000
|
||||
|
||||
/* Temporary */
|
||||
typedef unsigned int zend_uint;
|
||||
#define emalloc(s) malloc(s)
|
||||
#define efree(p) free(p)
|
||||
|
||||
typedef struct _Block {
|
||||
char *bp;
|
||||
char *pos;
|
||||
char *end;
|
||||
} Block;
|
||||
|
||||
typedef struct _StaticAllocator {
|
||||
Block *Blocks;
|
||||
zend_uint num_blocks;
|
||||
zend_uint current_block;
|
||||
} StaticAllocator;
|
||||
|
||||
void static_allocator_init(StaticAllocator *sa);
|
||||
char *static_allocator_allocate(StaticAllocator *sa, zend_uint size);
|
||||
void static_allocator_destroy(StaticAllocator *sa);
|
||||
|
||||
#endif /* _STATIC_ALLOCATOR_H */
|
||||
+35
-35
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "zend_API.h"
|
||||
#include "zend_globals.h"
|
||||
#include "zend_constants.h"
|
||||
#include "zend_variables.h"
|
||||
#include "zend_list.h"
|
||||
|
||||
ZEND_API char *empty_string = ""; /* in order to save emalloc() and efree() time for
|
||||
@@ -32,47 +31,49 @@ ZEND_API char *empty_string = ""; /* in order to save emalloc() and efree() time
|
||||
* The macro STR_FREE() will not efree() it.
|
||||
*/
|
||||
|
||||
ZEND_API char *undefined_variable_string = "\0";
|
||||
|
||||
/* this function MUST set the value for the variable to an empty string */
|
||||
/* and empty strings must be evaluated as FALSE */
|
||||
ZEND_API inline void var_reset(zval *var)
|
||||
{
|
||||
#if 0
|
||||
var->type = IS_STRING;
|
||||
var->value.str.val = empty_string;
|
||||
var->value.str.len = 0;
|
||||
#else
|
||||
var->type = IS_BOOL;
|
||||
var->value.lval = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
ZEND_API inline void var_uninit(zval *var)
|
||||
{
|
||||
var->type = IS_STRING;
|
||||
var->value.str.val = undefined_variable_string;
|
||||
var->value.str.len = 0;
|
||||
var->type = IS_NULL;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
{
|
||||
if (zvalue->type==IS_LONG) {
|
||||
return 1;
|
||||
return;
|
||||
}
|
||||
switch(zvalue->type) {
|
||||
case IS_STRING:
|
||||
case IS_CONSTANT:
|
||||
STR_FREE_REL(zvalue->value.str.val);
|
||||
break;
|
||||
case IS_ARRAY: {
|
||||
case IS_ARRAY:
|
||||
case IS_CONSTANT_ARRAY: {
|
||||
ELS_FETCH();
|
||||
|
||||
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
|
||||
zend_hash_destroy(zvalue->value.ht);
|
||||
efree_rel(zvalue->value.ht);
|
||||
FREE_HASHTABLE(zvalue->value.ht);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IS_OBJECT:
|
||||
zend_hash_destroy(zvalue->value.obj.properties);
|
||||
efree_rel(zvalue->value.obj.properties);
|
||||
FREE_HASHTABLE(zvalue->value.obj.properties);
|
||||
break;
|
||||
case IS_RESOURCE:
|
||||
/* destroy resource */
|
||||
@@ -81,25 +82,25 @@ ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
case IS_LONG:
|
||||
case IS_DOUBLE:
|
||||
case IS_BOOL:
|
||||
case IS_NULL:
|
||||
default:
|
||||
return 1;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void zval_del_ref(zval **p)
|
||||
ZEND_API void zval_del_ref(zval **p)
|
||||
{
|
||||
(*p)->refcount--;
|
||||
if ((*p)->refcount==0) {
|
||||
zval_dtor(*p);
|
||||
efree(*p);
|
||||
FREE_ZVAL(*p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void zval_add_ref(zval **p)
|
||||
ZEND_API void zval_add_ref(zval **p)
|
||||
{
|
||||
(*p)->refcount++;
|
||||
}
|
||||
@@ -113,21 +114,20 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
break;
|
||||
case IS_BOOL:
|
||||
case IS_LONG:
|
||||
case IS_NULL:
|
||||
break;
|
||||
case IS_CONSTANT:
|
||||
case IS_STRING:
|
||||
if (zvalue->value.str.val) {
|
||||
if (zvalue->value.str.len==0) {
|
||||
if (zvalue->value.str.val==undefined_variable_string) {
|
||||
zvalue->value.str.val = undefined_variable_string;
|
||||
} else {
|
||||
zvalue->value.str.val = empty_string;
|
||||
}
|
||||
zvalue->value.str.val = empty_string;
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len);
|
||||
break;
|
||||
case IS_ARRAY: {
|
||||
case IS_ARRAY:
|
||||
case IS_CONSTANT_ARRAY: {
|
||||
zval *tmp;
|
||||
HashTable *original_ht = zvalue->value.ht;
|
||||
ELS_FETCH();
|
||||
@@ -138,18 +138,18 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
} else if (zvalue->value.ht==&EG(symbol_table)) {
|
||||
return SUCCESS; /* do nothing */
|
||||
}
|
||||
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 *));
|
||||
ALLOC_HASHTABLE_REL(zvalue->value.ht);
|
||||
zend_hash_init(zvalue->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(zvalue->value.ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
break;
|
||||
case IS_OBJECT: {
|
||||
zval *tmp;
|
||||
HashTable *original_ht = zvalue->value.obj.properties;
|
||||
|
||||
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 *));
|
||||
ALLOC_HASHTABLE_REL(zvalue->value.obj.properties);
|
||||
zend_hash_init(zvalue->value.obj.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
|
||||
zend_hash_copy(zvalue->value.obj.properties, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -170,16 +170,16 @@ ZEND_API int _zval_copy_ctor_wrapper(zval *zvalue)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int _zval_dtor_wrapper(zval *zvalue)
|
||||
ZEND_API void _zval_dtor_wrapper(zval *zvalue)
|
||||
{
|
||||
return zval_dtor(zvalue);
|
||||
zval_dtor(zvalue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API int _zval_ptr_dtor_wrapper(zval **zval_ptr)
|
||||
ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr)
|
||||
{
|
||||
return zval_ptr_dtor(zval_ptr);
|
||||
zval_ptr_dtor(zval_ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+12
-12
@@ -2,12 +2,12 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
|
||||
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 0.91 of the Zend license, |
|
||||
| This source file is subject to version 0.92 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.zend.com/license/0_91.txt. |
|
||||
| http://www.zend.com/license/0_92.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
@@ -26,16 +26,16 @@ ZEND_API int zend_print_variable(zval *var);
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
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);
|
||||
ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC);
|
||||
ZEND_API void _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);
|
||||
ZEND_API void _zval_dtor_wrapper(zval *zvalue);
|
||||
ZEND_API void _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
|
||||
@@ -48,12 +48,12 @@ ZEND_API int _zval_ptr_dtor_wrapper(zval **zval_ptr);
|
||||
END_EXTERN_C()
|
||||
|
||||
|
||||
void zval_add_ref(zval **p);
|
||||
void zval_del_ref(zval **p);
|
||||
ZEND_API void zval_add_ref(zval **p);
|
||||
ZEND_API 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
|
||||
#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper
|
||||
#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper
|
||||
#define ZVAL_COPY_CTOR (void (*)(void *)) zval_copy_ctor_wrapper
|
||||
|
||||
ZEND_API void var_reset(zval *var);
|
||||
ZEND_API void var_uninit(zval *var);
|
||||
|
||||
+1
-126
@@ -1,126 +1 @@
|
||||
/* This is the default configuration file to read -*- C -*- */
|
||||
|
||||
#undef socklen_t
|
||||
|
||||
/* these are defined by automake */
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
#undef HAVE_STRUCT_FLOCK
|
||||
#undef HAVE_TM_GMTOFF
|
||||
|
||||
#define CONFIGURATION_FILE_PATH "php.ini"
|
||||
#define USE_CONFIG_FILE 1
|
||||
|
||||
#undef HAVE_DMALLOC
|
||||
|
||||
/* Some global constants defined by conigure */
|
||||
#undef PHP_BUILD_DATE
|
||||
#undef PHP_OS
|
||||
#undef PHP_UNAME
|
||||
|
||||
/* define uint by configure if it is missed (QNX and BSD derived) */
|
||||
#undef uint
|
||||
|
||||
/* define ulong by configure if it is missed (most probably is) */
|
||||
#undef ulong
|
||||
|
||||
/* type check for in_addr_t */
|
||||
#undef in_addr_t
|
||||
|
||||
/* Define if you have dirent.h but opendir() resides in libc rather than in libdir */
|
||||
/* This will cause HAVE_DIRENT_H defined twice sometimes, but it should be problem */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the resolv library (-lresolv). */
|
||||
#undef HAVE_LIBRESOLV
|
||||
|
||||
/* Define if you have the pam library (-lpam). */
|
||||
#define HAVE_LIBPAM 0
|
||||
|
||||
/* Define if you have the bind library (-lbind). */
|
||||
#define HAVE_LIBBIND 0
|
||||
|
||||
/* Define if you have Netscape LDAP instead of umich ldap or openldap*/
|
||||
#define HAVE_NSLDAP 0
|
||||
|
||||
/* Define if you want safe mode enabled by default. */
|
||||
#define PHP_SAFE_MODE 0
|
||||
|
||||
/* Set to the path to the dir containing safe mode executables */
|
||||
#define PHP_SAFE_MODE_EXEC_DIR /usr/local/php/bin
|
||||
|
||||
/* Define if you want POST/GET/Cookie track variables by default */
|
||||
#define PHP_TRACK_VARS 0
|
||||
|
||||
/* Undefine if you want stricter XML/SGML compliance by default */
|
||||
/* (this disables "<?expression?>" by default) */
|
||||
#define DEFAULT_SHORT_OPEN_TAG 1
|
||||
|
||||
/* Undefine if you do not want PHP by default to escape "'" */
|
||||
/* in GET/POST/Cookie data */
|
||||
#define MAGIC_QUOTES 1
|
||||
|
||||
/* Define both of these if you want the bundled REGEX library */
|
||||
#define REGEX 0
|
||||
#define HSREGEX 0
|
||||
|
||||
/* Define if you have and want to use libnsl */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define if you have and want to use libsocket */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Define if you have the sendmail program available */
|
||||
#define HAVE_SENDMAIL 0
|
||||
|
||||
/* Define if you are compiling PHP as an Apache module */
|
||||
#define APACHE 0
|
||||
|
||||
/* Define if you are compiling PHP as an Apache module with mod_charset patch applied (aka Russian Apache)*/
|
||||
#define USE_TRANSFER_TABLES 0
|
||||
|
||||
/* Define if you are compiling PHP as an fhttpd module */
|
||||
#define FHTTPD 0
|
||||
|
||||
/* Define if your Apache creates an ap_config.h header file (only 1.3b6 and later) */
|
||||
#define HAVE_AP_CONFIG_H 0
|
||||
|
||||
/* Define if your Apache has src/include/compat.h */
|
||||
#define HAVE_OLD_COMPAT_H 0
|
||||
|
||||
/* Define if your Apache has src/include/ap_compat.h */
|
||||
#define HAVE_AP_COMPAT_H 0
|
||||
|
||||
#ifndef DEBUG /* should be set to ZEND_DEBUG */
|
||||
#define DEBUG 0
|
||||
#endif
|
||||
|
||||
/* Define if you want to enable PHP RPC (experimental) */
|
||||
#define PHP_RPC 0
|
||||
|
||||
/* Define if you want to prevent the CGI from working unless REDIRECT_STATUS is defined in the environment */
|
||||
#define FORCE_CGI_REDIRECT 0
|
||||
|
||||
/* Define if you want to prevent the CGI from using path_info and path_translated */
|
||||
#define DISCARD_PATH 0
|
||||
|
||||
/* Define if you want include() and other functions to be able to open
|
||||
* http and ftp URLs as files.
|
||||
*/
|
||||
#define PHP3_URL_FOPEN 0
|
||||
|
||||
/* Define if you have broken header files like SunOS 4 */
|
||||
#define MISSING_FCLOSE_DECL 0
|
||||
|
||||
/* Define if you have broken sprintf function like SunOS 4 */
|
||||
#define BROKEN_SPRINTF 0
|
||||
|
||||
/* Define to compile PHP/Zend thread safe */
|
||||
#undef ZTS
|
||||
|
||||
/* Define when compiling with Zeus support */
|
||||
#undef WITH_ZEUS
|
||||
|
||||
/* Define if struct sockaddr contains the field sa_len */
|
||||
#undef HAVE_SOCKADDR_SA_LEN
|
||||
/* Leave this file alone */
|
||||
+579
-65
@@ -2,6 +2,404 @@ dnl $Id$
|
||||
dnl
|
||||
dnl This file contains local autoconf functions.
|
||||
|
||||
sinclude(dynlib.m4)
|
||||
|
||||
dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD)
|
||||
dnl
|
||||
dnl Use this macro, if you need to add libraries and or library search
|
||||
dnl paths to the PHP build system which are only given in compiler
|
||||
dnl notation.
|
||||
dnl
|
||||
AC_DEFUN(PHP_EVAL_LIBLINE,[
|
||||
for ac_i in $1; do
|
||||
case "$ac_i" in
|
||||
-l*)
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
AC_ADD_LIBRARY($ac_ii,,$2)
|
||||
;;
|
||||
-L*)
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
AC_ADD_LIBPATH($ac_ii,$2)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
])
|
||||
|
||||
dnl PHP_EVAL_INCLINE(LINE)
|
||||
dnl
|
||||
dnl Use this macro, if you need to add header search paths to the PHP
|
||||
dnl build system which are only given in compiler notation.
|
||||
dnl
|
||||
AC_DEFUN(PHP_EVAL_INCLINE,[
|
||||
for ac_i in $1; do
|
||||
case "$ac_i" in
|
||||
-I*)
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
AC_ADD_INCLUDE($ac_ii)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_READDIR_R_TYPE,[
|
||||
dnl HAVE_READDIR_R is also defined by libmysql
|
||||
AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no)
|
||||
if test "$ac_cv_func_readdir_r" = "yes"; then
|
||||
AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[
|
||||
AC_TRY_RUN([
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
|
||||
main() {
|
||||
DIR *dir;
|
||||
struct dirent entry, *pentry;
|
||||
|
||||
dir = opendir("/");
|
||||
if (!dir)
|
||||
exit(1);
|
||||
if (readdir_r(dir, &entry, &pentry) == 0)
|
||||
exit(0);
|
||||
exit(1);
|
||||
}
|
||||
],[
|
||||
ac_cv_what_readdir_r=POSIX
|
||||
],[
|
||||
AC_TRY_CPP([
|
||||
#define _REENTRANT
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
int readdir_r(DIR *, struct dirent *);
|
||||
],[
|
||||
ac_cv_what_readdir_r=old-style
|
||||
],[
|
||||
ac_cv_what_readdir_r=none
|
||||
])
|
||||
],[
|
||||
ac_cv_what_readdir_r=none
|
||||
])
|
||||
])
|
||||
case "$ac_cv_what_readdir_r" in
|
||||
POSIX)
|
||||
AC_DEFINE(HAVE_POSIX_READDIR_R,1,[whether you have POSIX readdir_r]);;
|
||||
old-style)
|
||||
AC_DEFINE(HAVE_OLD_READDIR_R,1,[whether you have old-style readdir_r]);;
|
||||
esac
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_SHLIB_SUFFIX_NAME,[
|
||||
PHP_SUBST(SHLIB_SUFFIX_NAME)
|
||||
SHLIB_SUFFIX_NAME=so
|
||||
case "$host_alias" in
|
||||
*hpux*)
|
||||
SHLIB_SUFFIX_NAME=sl
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_DEBUG_MACRO,[
|
||||
DEBUG_LOG="$1"
|
||||
cat >$1 <<X
|
||||
CONFIGURE: $CONFIGURE_COMMAND
|
||||
CC: $CC
|
||||
CFLAGS: $CFLAGS
|
||||
CPPFLAGS: $CPPFLAGS
|
||||
CXX: $CXX
|
||||
CXXFLAGS: $CXXFLAGS
|
||||
INCLUDES: $INCLUDES
|
||||
LDFLAGS: $LDFLAGS
|
||||
LIBS: $LIBS
|
||||
DLIBS: $DLIBS
|
||||
SAPI: $PHP_SAPI
|
||||
PHP_RPATHS: $PHP_RPATHS
|
||||
uname -a: `uname -a`
|
||||
|
||||
X
|
||||
cat >conftest.$ac_ext <<X
|
||||
main()
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
X
|
||||
(eval echo \"$ac_link\"; eval $ac_link && ./conftest) >>$1 2>&1
|
||||
rm -fr conftest*
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_MISSING_TIME_R_DECL,[
|
||||
AC_MSG_CHECKING(for missing declarations of reentrant functions)
|
||||
AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[
|
||||
:
|
||||
],[
|
||||
AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared])
|
||||
])
|
||||
AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = gmtime_r],[
|
||||
:
|
||||
],[
|
||||
AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared])
|
||||
])
|
||||
AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = asctime_r],[
|
||||
:
|
||||
],[
|
||||
AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared])
|
||||
])
|
||||
AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = ctime_r],[
|
||||
:
|
||||
],[
|
||||
AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared])
|
||||
])
|
||||
AC_TRY_COMPILE([#include <string.h>],[char *(*func)() = strtok_r],[
|
||||
:
|
||||
],[
|
||||
AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
|
||||
])
|
||||
AC_MSG_RESULT(done)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_LIBGCC_LIBPATH(gcc)
|
||||
dnl Stores the location of libgcc in libgcc_libpath
|
||||
dnl
|
||||
AC_DEFUN(PHP_LIBGCC_LIBPATH,[
|
||||
changequote({,})
|
||||
libgcc_libpath="`$1 --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'`"
|
||||
changequote([,])
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_ARG_ANALYZE,[
|
||||
case "[$]$1" in
|
||||
shared,*)
|
||||
ext_output="yes, shared"
|
||||
ext_shared=yes
|
||||
$1=`echo $ac_n "[$]$1$ac_c"|sed s/^shared,//`
|
||||
;;
|
||||
shared)
|
||||
ext_output="yes, shared"
|
||||
ext_shared=yes
|
||||
$1=yes
|
||||
;;
|
||||
no)
|
||||
ext_output="no"
|
||||
ext_shared=no
|
||||
;;
|
||||
*)
|
||||
ext_output="yes"
|
||||
ext_shared=no
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$php_always_shared" = "yes"; then
|
||||
ext_output="yes, shared"
|
||||
ext_shared=yes
|
||||
test "[$]$1" = "no" && $1=yes
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT($ext_output)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val])
|
||||
dnl Sets PHP_ARG_NAME either to the user value or to the default value.
|
||||
dnl default-val defaults to no.
|
||||
dnl
|
||||
AC_DEFUN(PHP_ARG_WITH,[
|
||||
PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_REAL_ARG_WITH,[
|
||||
AC_MSG_CHECKING($2)
|
||||
AC_ARG_WITH($1,[$3],$5=[$]withval,$5=ifelse($4,,no,$4))
|
||||
PHP_ARG_ANALYZE($5)
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val])
|
||||
dnl Sets PHP_ARG_NAME either to the user value or to the default value.
|
||||
dnl default-val defaults to no.
|
||||
dnl
|
||||
AC_DEFUN(PHP_ARG_ENABLE,[
|
||||
PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_REAL_ARG_ENABLE,[
|
||||
AC_MSG_CHECKING($2)
|
||||
AC_ARG_ENABLE($1,[$3],$5=[$]enableval,$5=ifelse($4,,no,$4))
|
||||
PHP_ARG_ANALYZE($5)
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_MODULE_PTR,[
|
||||
EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS $1,"
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_CONFIG_NICE,[
|
||||
rm -f $1
|
||||
cat >$1<<EOF
|
||||
#! /bin/sh
|
||||
#
|
||||
# Created by configure
|
||||
|
||||
EOF
|
||||
|
||||
for arg in [$]0 "[$]@"; do
|
||||
echo "\"[$]arg\" \\" >> $1
|
||||
done
|
||||
echo '"[$]@"' >> $1
|
||||
chmod +x $1
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_TIME_R_TYPE,[
|
||||
AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[
|
||||
AC_TRY_RUN([
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
main() {
|
||||
char buf[27];
|
||||
struct tm t;
|
||||
time_t old = 0;
|
||||
int r, s;
|
||||
|
||||
s = gmtime_r(&old, &t);
|
||||
r = (int) asctime_r(&t, buf, 26);
|
||||
if (r == s && s == 0) exit(0);
|
||||
exit(1);
|
||||
}
|
||||
],[
|
||||
ac_cv_time_r_type=hpux
|
||||
],[
|
||||
ac_cv_time_r_type=POSIX
|
||||
],[
|
||||
ac_cv_time_r_type=POSIX
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_time_r_type" = "hpux"; then
|
||||
AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_SUBST,[
|
||||
PHP_VAR_SUBST="$PHP_VAR_SUBST $1"
|
||||
AC_SUBST($1)
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_FAST_OUTPUT,[
|
||||
PHP_FAST_OUTPUT_FILES="$PHP_FAST_OUTPUT_FILES $1"
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_MKDIR_P_CHECK,[
|
||||
AC_CACHE_CHECK(for working mkdir -p, ac_cv_mkdir_p,[
|
||||
test -d conftestdir && rm -rf conftestdir
|
||||
mkdir -p conftestdir/somedir >/dev/null 2>&1
|
||||
if test -d conftestdir/somedir; then
|
||||
ac_cv_mkdir_p=yes
|
||||
else
|
||||
ac_cv_mkdir_p=no
|
||||
fi
|
||||
rm -rf conftestdir
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_GEN_CONFIG_VARS,[
|
||||
PHP_MKDIR_P_CHECK
|
||||
echo creating config_vars.mk
|
||||
> config_vars.mk
|
||||
for i in $PHP_VAR_SUBST; do
|
||||
eval echo "$i = \$$i" >> config_vars.mk
|
||||
done
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_GEN_MAKEFILES,[
|
||||
$SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $PHP_FAST_OUTPUT_FILES
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_TM_GMTOFF,[
|
||||
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
|
||||
[AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;],
|
||||
ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
|
||||
|
||||
if test "$ac_cv_struct_tm_gmtoff" = yes; then
|
||||
AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl PHP_CONFIGURE_PART(MESSAGE)
|
||||
dnl Idea borrowed from mm
|
||||
AC_DEFUN(PHP_CONFIGURE_PART,[
|
||||
AC_MSG_RESULT()
|
||||
AC_MSG_RESULT(${T_MD}$1${T_ME})
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_PROG_SENDMAIL,[
|
||||
AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/lib/sendmail, $PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib)
|
||||
if test -n "$PROG_SENDMAIL"; then
|
||||
AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_RUNPATH_SWITCH,[
|
||||
dnl check for -R, etc. switch
|
||||
AC_MSG_CHECKING(if compiler supports -R)
|
||||
AC_CACHE_VAL(php_cv_cc_dashr,[
|
||||
SAVE_LIBS="${LIBS}"
|
||||
LIBS="-R /usr/lib ${LIBS}"
|
||||
AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
|
||||
LIBS="${SAVE_LIBS}"])
|
||||
AC_MSG_RESULT($php_cv_cc_dashr)
|
||||
if test $php_cv_cc_dashr = "yes"; then
|
||||
ld_runpath_switch="-R"
|
||||
else
|
||||
AC_MSG_CHECKING([if compiler supports -Wl,-rpath,])
|
||||
AC_CACHE_VAL(php_cv_cc_rpath,[
|
||||
SAVE_LIBS="${LIBS}"
|
||||
LIBS="-Wl,-rpath,/usr/lib ${LIBS}"
|
||||
AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
|
||||
LIBS="${SAVE_LIBS}"])
|
||||
AC_MSG_RESULT($php_cv_cc_rpath)
|
||||
if test $php_cv_cc_rpath = "yes"; then
|
||||
ld_runpath_switch="-Wl,-rpath,"
|
||||
else
|
||||
dnl something innocuous
|
||||
ld_runpath_switch="-L"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_STRUCT_FLOCK,[
|
||||
AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock,
|
||||
AC_TRY_COMPILE([
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
],
|
||||
[struct flock x;],
|
||||
[
|
||||
ac_cv_struct_flock=yes
|
||||
],[
|
||||
ac_cv_struct_flock=no
|
||||
])
|
||||
)
|
||||
if test "$ac_cv_struct_flock" = "yes" ; then
|
||||
AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_SOCKLEN_T,[
|
||||
AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t,
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
],[
|
||||
socklen_t x;
|
||||
],[
|
||||
ac_cv_socklen_t=yes
|
||||
],[
|
||||
ac_cv_socklen_t=no
|
||||
]))
|
||||
if test "$ac_cv_socklen_t" = "yes"; then
|
||||
AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_SET_SYM_FILE(path)
|
||||
dnl
|
||||
@@ -16,7 +414,10 @@ dnl
|
||||
dnl PHP_BUILD_THREAD_SAFE
|
||||
dnl
|
||||
AC_DEFUN(PHP_BUILD_THREAD_SAFE,[
|
||||
PHP_THREAD_SAFETY=yes
|
||||
enable_experimental_zts=yes
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
AC_MSG_ERROR(ZTS currently requires working POSIX threads. Your system does not support this.)
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -46,7 +447,9 @@ dnl
|
||||
dnl execute code, if variable is not set in namespace
|
||||
dnl
|
||||
AC_DEFUN(AC_PHP_ONCE,[
|
||||
unique=`echo $ac_n "$2$ac_c" | tr -c -d a-zA-Z0-9`
|
||||
changequote({,})
|
||||
unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'`
|
||||
changequote([,])
|
||||
cmd="echo $ac_n \"\$$1$unique$ac_c\""
|
||||
if test -n "$unique" && test "`eval $cmd`" = "" ; then
|
||||
eval "$1$unique=set"
|
||||
@@ -63,25 +466,31 @@ AC_DEFUN(AC_EXPAND_PATH,[
|
||||
if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then
|
||||
$2="$1"
|
||||
else
|
||||
ep_dir="`dirname \"$1\"`"
|
||||
changequote({,})
|
||||
ep_dir="`echo $1|sed 's%/*[^/][^/]*$%%'`"
|
||||
changequote([,])
|
||||
ep_realdir="`(cd \"$ep_dir\" && pwd)`"
|
||||
$2="$ep_realdir/`basename \"$1\"`"
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_ADD_LIBPATH(path)
|
||||
dnl AC_ADD_LIBPATH(path[, shared-libadd])
|
||||
dnl
|
||||
dnl add a library to linkpath/runpath
|
||||
dnl
|
||||
AC_DEFUN(AC_ADD_LIBPATH,[
|
||||
if test "$1" != "/usr/lib"; then
|
||||
AC_EXPAND_PATH($1, ai_p)
|
||||
AC_PHP_ONCE(LIBPATH, $ai_p, [
|
||||
test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
|
||||
LDFLAGS="$LDFLAGS -L$ai_p"
|
||||
PHP_RPATHS="$PHP_RPATHS $ai_p"
|
||||
])
|
||||
if test "$ext_shared" = "yes" && test -n "$2"; then
|
||||
$2="-R$1 -L$1 [$]$2"
|
||||
else
|
||||
AC_PHP_ONCE(LIBPATH, $ai_p, [
|
||||
test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
|
||||
LDFLAGS="$LDFLAGS -L$ai_p"
|
||||
PHP_RPATHS="$PHP_RPATHS $ai_p"
|
||||
])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -91,14 +500,14 @@ dnl
|
||||
dnl builds RPATH from PHP_RPATHS
|
||||
dnl
|
||||
AC_DEFUN(AC_BUILD_RPATH,[
|
||||
if test "$enable_rpath" = "yes" && test -n "$PHP_RPATHS"; then
|
||||
if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS"; then
|
||||
OLD_RPATHS="$PHP_RPATHS"
|
||||
PHP_RPATHS=""
|
||||
for i in $OLD_RPATHS; do
|
||||
PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
|
||||
PHP_RPATHS="$PHP_RPATHS -R $i"
|
||||
NATIVE_RPATHS="$NATIVE_RPATHS ${ld_runpath_switch}$i"
|
||||
done
|
||||
PHP_RPATHS=""
|
||||
for i in $OLD_RPATHS; do
|
||||
PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
|
||||
PHP_RPATHS="$PHP_RPATHS -R $i"
|
||||
NATIVE_RPATHS="$NATIVE_RPATHS ${ld_runpath_switch}$i"
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -116,31 +525,79 @@ AC_DEFUN(AC_ADD_INCLUDE,[
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_X_ADD_LIBRARY,[
|
||||
ifelse($2,,$3="-l$1 [$]$3", $3="[$]$3 -l$1")
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_ADD_LIBRARY(library[, append])
|
||||
dnl AC_ADD_LIBRARY(library[, append[, shared-libadd]])
|
||||
dnl
|
||||
dnl add a library to the link line
|
||||
dnl
|
||||
AC_DEFUN(AC_ADD_LIBRARY,[
|
||||
case "$1" in
|
||||
c|c_r|pthread*) ;;
|
||||
*)
|
||||
ifelse($3,,[
|
||||
AC_PHP_ONCE(LIBRARY, $1, [
|
||||
PHP_X_ADD_LIBRARY($1,$2,LIBS)
|
||||
])
|
||||
],[
|
||||
if test "$ext_shared" = "yes"; then
|
||||
PHP_X_ADD_LIBRARY($1,$2,$3)
|
||||
else
|
||||
AC_ADD_LIBRARY($1,$2)
|
||||
fi
|
||||
])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_ADD_LIBRARY_DEFER(library[, append])
|
||||
dnl
|
||||
dnl add a library to the link line (deferred)
|
||||
AC_DEFUN(AC_ADD_LIBRARY_DEFER,[
|
||||
AC_PHP_ONCE(LIBRARY, $1, [
|
||||
if test -z "$2"; then
|
||||
LIBS="-l$1 $LIBS"
|
||||
else
|
||||
LIBS="$LIBS -l$1"
|
||||
fi
|
||||
ifelse($#, 1, DLIBS="-l$1 $DLIBS", DLIBS="$DLIBS -l$1")
|
||||
])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_ADD_LIBRARY_WITH_PATH(library, path)
|
||||
dnl AC_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd])
|
||||
dnl
|
||||
dnl add a library to the link line and path to linkpath/runpath
|
||||
dnl add a library to the link line and path to linkpath/runpath.
|
||||
dnl if shared-libadd is not empty and $ext_shared is yes,
|
||||
dnl shared-libadd will be assigned the library information
|
||||
dnl
|
||||
AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH,[
|
||||
AC_ADD_LIBPATH($2)
|
||||
ifelse($3,,[
|
||||
if test -n "$2"; then
|
||||
AC_ADD_LIBPATH($2)
|
||||
fi
|
||||
AC_ADD_LIBRARY($1)
|
||||
],[
|
||||
if test "$ext_shared" = "yes"; then
|
||||
$3="-l$1 [$]$3"
|
||||
if test -n "$2"; then
|
||||
AC_ADD_LIBPATH($2,$3)
|
||||
fi
|
||||
else
|
||||
AC_ADD_LIBRARY_WITH_PATH($1,$2)
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_ADD_LIBRARY_DEFER_WITH_PATH(library, path)
|
||||
dnl
|
||||
dnl add a library to the link line (deferred)
|
||||
dnl and path to linkpath/runpath (not deferred)
|
||||
dnl
|
||||
AC_DEFUN(AC_ADD_LIBRARY_DEFER_WITH_PATH,[
|
||||
AC_ADD_LIBPATH($2)
|
||||
AC_ADD_LIBRARY_DEFER($1)
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
|
||||
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
|
||||
@@ -152,7 +609,9 @@ dnl
|
||||
AC_DEFUN(AC_CHECK_CC_OPTION,[
|
||||
echo "main(){return 0;}" > conftest.$ac_ext
|
||||
opt="$1"
|
||||
var=`echo $ac_n "$opt$ac_c"|tr -c a-zA-Z0-9 _`
|
||||
changequote({,})
|
||||
var=`echo $opt|sed 's/[^a-zA-Z0-9]/_/g'`
|
||||
changequote([,])
|
||||
AC_MSG_CHECKING([if compiler supports -$1 really])
|
||||
ac_php_compile="${CC-cc} -$opt -o conftest $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1"
|
||||
if eval $ac_php_compile 2>&1 | egrep "$opt" > /dev/null 2>&1 ; then
|
||||
@@ -174,21 +633,19 @@ 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)
|
||||
PHP_OUTPUT(regex/Makefile)
|
||||
AC_DEFINE(HSREGEX,1,[ ])
|
||||
AC_DEFINE(REGEX,1,[ ])
|
||||
PHP_FAST_OUTPUT(regex/Makefile)
|
||||
elif test "$REGEX_TYPE" = "system"; then
|
||||
AC_DEFINE(REGEX,0)
|
||||
elif test "$REGEX_TYPE" = "apache"; then
|
||||
AC_DEFINE(REGEX,2)
|
||||
AC_DEFINE(REGEX,0,[ ])
|
||||
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)
|
||||
PHP_SUBST(REGEX_DIR)
|
||||
PHP_SUBST(REGEX_LIB)
|
||||
PHP_SUBST(HSREGEX)
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -197,10 +654,10 @@ dnl
|
||||
AC_DEFUN(AC_MISSING_FCLOSE_DECL,[
|
||||
AC_MSG_CHECKING([for fclose declaration])
|
||||
AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[
|
||||
AC_DEFINE(MISSING_FCLOSE_DECL,0)
|
||||
AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ])
|
||||
AC_MSG_RESULT(ok)
|
||||
],[
|
||||
AC_DEFINE(MISSING_FCLOSE_DECL,1)
|
||||
AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ])
|
||||
AC_MSG_RESULT(missing)
|
||||
])
|
||||
])
|
||||
@@ -209,17 +666,20 @@ dnl
|
||||
dnl Check for broken sprintf()
|
||||
dnl
|
||||
AC_DEFUN(AC_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_MSG_RESULT(ok)
|
||||
],[
|
||||
AC_DEFINE(BROKEN_SPRINTF,1)
|
||||
AC_MSG_RESULT(broken)
|
||||
],[
|
||||
AC_DEFINE(BROKEN_SPRINTF,0)
|
||||
AC_MSG_RESULT(cannot check, guessing ok)
|
||||
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
|
||||
AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
|
||||
ac_cv_broken_sprintf=no
|
||||
],[
|
||||
ac_cv_broken_sprintf=yes
|
||||
],[
|
||||
ac_cv_broken_sprintf=no
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_broken_sprintf" = "yes"; then
|
||||
AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [ ])
|
||||
else
|
||||
AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [ ])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -232,26 +692,37 @@ dnl "shared" can be set to "shared" or "yes" to build the extension as
|
||||
dnl a dynamically loadable library.
|
||||
dnl
|
||||
AC_DEFUN(PHP_EXTENSION,[
|
||||
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
|
||||
AC_DEFINE_UNQUOTED(COMPILE_DL_`echo $1|tr a-z A-Z`, 1, Whether to build $1 as dynamic module)
|
||||
EXT_SHARED="$EXT_SHARED $1"
|
||||
fi
|
||||
PHP_OUTPUT(ext/$1/Makefile)
|
||||
EXT_SUBDIRS="$EXT_SUBDIRS $1"
|
||||
|
||||
if test -d "$abs_srcdir/ext/$1"; then
|
||||
dnl ---------------------------------------------- Internal Module
|
||||
ext_builddir="ext/$1"
|
||||
ext_srcdir="$abs_srcdir/ext/$1"
|
||||
else
|
||||
dnl ---------------------------------------------- External Module
|
||||
ext_builddir="."
|
||||
ext_srcdir="$abs_srcdir"
|
||||
fi
|
||||
|
||||
if test "$2" != "shared" && test "$2" != "yes"; then
|
||||
dnl ---------------------------------------------- Static module
|
||||
LIB_BUILD($ext_builddir)
|
||||
EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/lib$1.la"
|
||||
EXT_STATIC="$EXT_STATIC $1"
|
||||
else
|
||||
dnl ---------------------------------------------- Shared module
|
||||
LIB_BUILD($ext_builddir,yes)
|
||||
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
|
||||
fi
|
||||
|
||||
PHP_FAST_OUTPUT($ext_builddir/Makefile)
|
||||
])
|
||||
|
||||
AC_SUBST(EXT_SUBDIRS)
|
||||
AC_SUBST(EXT_STATIC)
|
||||
AC_SUBST(EXT_SHARED)
|
||||
AC_SUBST(EXT_LIBS)
|
||||
AC_SUBST(EXT_LTLIBS)
|
||||
PHP_SUBST(EXT_SUBDIRS)
|
||||
PHP_SUBST(EXT_STATIC)
|
||||
PHP_SUBST(EXT_SHARED)
|
||||
PHP_SUBST(EXT_LIBS)
|
||||
PHP_SUBST(EXT_LTLIBS)
|
||||
|
||||
dnl
|
||||
dnl Solaris requires main code to be position independent in order
|
||||
@@ -298,6 +769,9 @@ AC_DEFUN(PHP_WITH_SHARED,[
|
||||
shared=no
|
||||
;;
|
||||
esac
|
||||
if test -n "$php_always_shared"; then
|
||||
shared=yes
|
||||
fi
|
||||
])
|
||||
|
||||
dnl The problem is that the default compilation flags in Solaris 2.6 won't
|
||||
@@ -349,14 +823,54 @@ AC_DEFUN(AC_SOCKADDR_SA_LEN,[
|
||||
#include <sys/socket.h>],
|
||||
[struct sockaddr s; s.sa_len;],
|
||||
[ac_cv_sockaddr_sa_len=yes
|
||||
AC_DEFINE(HAVE_SOCKADDR_SA_LEN)],
|
||||
AC_DEFINE(HAVE_SOCKADDR_SA_LEN,1,[ ])],
|
||||
[ac_cv_sockaddr_sa_len=no])
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
dnl ## PHP_AC_OUTPUT(file)
|
||||
dnl ## 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"
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_DECLARED_TIMEZONE,[
|
||||
AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
],[
|
||||
time_t foo = (time_t) timezone;
|
||||
],[
|
||||
ac_cv_declared_timezone=yes
|
||||
],[
|
||||
ac_cv_declared_timezone=no
|
||||
])])
|
||||
if test "$ac_cv_declared_timezone" = "yes"; then
|
||||
AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_EBCDIC,[
|
||||
AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
|
||||
AC_TRY_RUN( [
|
||||
int main(void) {
|
||||
return (unsigned char)'A' != (unsigned char)0xC1;
|
||||
}
|
||||
],[
|
||||
ac_cv_ebcdic="yes"
|
||||
],[
|
||||
ac_cv_ebcdic="no"
|
||||
],[
|
||||
ac_cv_ebcdic="no"
|
||||
])])
|
||||
if test "$ac_cv_ebcdic" = "yes"; then
|
||||
AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC])
|
||||
fi
|
||||
])
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ php3_write()
|
||||
|
||||
php4_write()
|
||||
{
|
||||
pval *newval = (pval *) emalloc(sizeof(pval));
|
||||
pval *newval = ALLOC_ZVAL();
|
||||
|
||||
newval->refcount=1;
|
||||
newval->is_ref=0;
|
||||
|
||||
+8
-8
@@ -39,7 +39,7 @@
|
||||
#define PHP_BINNAME "@BINNAME@"
|
||||
#define PHP_CFLAGS "@CFLAGS@"
|
||||
#define PHP_DBASE_LIB ""
|
||||
#define PHP_DEBUG "@DEBUG_CFLAGS@"
|
||||
#define PHP_BUILD_DEBUG "@DEBUG_CFLAGS@"
|
||||
#define PHP_GDBM_INCLUDE ""
|
||||
#define PHP_HSREGEX ""
|
||||
#define PHP_IBASE_INCLUDE ""
|
||||
@@ -62,13 +62,12 @@
|
||||
#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 ""
|
||||
#define PHP_ORACLE_LIBS ""
|
||||
#define PHP_ORACLE_SHLIBS ""
|
||||
#define PHP_ORACLE_STLIBS ""
|
||||
#define PHP_ORACLE_VERSION ""
|
||||
#define PHP_OCI8_SHARED_LIBADD "@OCI8_SHARED_LIBADD@"
|
||||
#define PHP_OCI8_DIR "@OCI8_DIR@"
|
||||
#define PHP_OCI8_VERSION "@OCI8_VERSION@"
|
||||
#define PHP_ORACLE_SHARED_LIBADD "@ORACLE_SHARED_LIBADD@"
|
||||
#define PHP_ORACLE_DIR "@ORACLE_DIR@"
|
||||
#define PHP_ORACLE_VERSION "@ORACLE_VERSION@"
|
||||
#define PHP_PGSQL_INCLUDE ""
|
||||
#define PHP_PGSQL_LFLAGS ""
|
||||
#define PHP_PGSQL_LIBS ""
|
||||
@@ -88,3 +87,4 @@
|
||||
#define PHP_LDAP_LIBS ""
|
||||
#define PHP_VELOCIS_INCLUDE ""
|
||||
#define PHP_VELOCIS_LIBS ""
|
||||
#define PHP_EXTENSION_DIR "@EXTENSION_DIR@"
|
||||
@@ -1,93 +0,0 @@
|
||||
# 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 = ltconfig ltmain.sh config.guess config.sub
|
||||
|
||||
SUBDIRS = libzend TSRM
|
||||
|
||||
STAMP = buildmk.stamp
|
||||
|
||||
makefile_am_files = Makefile.am $(shell find ext sapi regex pear -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) configure $(config_h_in)
|
||||
|
||||
all: $(targets)
|
||||
@for i in $(SUBDIRS); do \
|
||||
test -d $$i || (test -d ../$$i && ln -s ../$$i $$i); \
|
||||
(cd $$i>/dev/null && $(MAKE) -f build.mk AMFLAGS=$(AMFLAGS)); \
|
||||
done
|
||||
|
||||
all: $(STAMP)
|
||||
|
||||
$(STAMP): buildcheck.sh
|
||||
@./buildcheck.sh && touch $(STAMP)
|
||||
|
||||
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) > $@
|
||||
|
||||
$(makefile_in_files): $(makefile_am_files) aclocal.m4
|
||||
@echo rebuilding Makefile.in\'s
|
||||
@for i in $(LT_TARGETS); do \
|
||||
if test -f "$$i"; then \
|
||||
mv $$i $$i.bak; \
|
||||
cp $$i.bak $$i; \
|
||||
fi; \
|
||||
done
|
||||
@automake -a -i $(AMFLAGS) $(makefile_files) 2>&1 \
|
||||
| grep -v PHP_OUTPUT_FILES || true >&2
|
||||
@for i in $(LT_TARGETS); do mv $$i.bak $$i; done
|
||||
|
||||
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
|
||||
@@ -0,0 +1,77 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
# Makefile to generate build tools
|
||||
#
|
||||
|
||||
SUBDIRS = Zend TSRM
|
||||
|
||||
STAMP = buildmk.stamp
|
||||
|
||||
ALWAYS = generated_lists
|
||||
|
||||
all: $(STAMP) $(ALWAYS)
|
||||
@$(MAKE) AMFLAGS=$(AMFLAGS) -s -f build/build2.mk
|
||||
|
||||
generated_lists:
|
||||
@echo makefile_am_files = Zend/Makefile.am \
|
||||
TSRM/Makefile.am > $@
|
||||
@echo config_h_files = Zend/acconfig.h TSRM/acconfig.h >> $@
|
||||
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 \
|
||||
Zend/acinclude.m4 ext/*/config.m4 sapi/*/config.m4 >> $@
|
||||
|
||||
$(STAMP): build/buildcheck.sh
|
||||
@build/buildcheck.sh && touch $(STAMP)
|
||||
|
||||
snapshot:
|
||||
distname='$(DISTNAME)'; \
|
||||
if test -z "$$distname"; then \
|
||||
distname='php4-snapshot'; \
|
||||
fi; \
|
||||
myname=`basename \`pwd\`` ; \
|
||||
cd .. && cp -rp $$myname $$distname; \
|
||||
cd $$distname; \
|
||||
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/build.mk; \
|
||||
cd ..; \
|
||||
tar cf $$distname.tar $$distname; \
|
||||
rm -rf $$distname $$distname.tar.*; \
|
||||
bzip2 -9 $$distname.tar; \
|
||||
md5sum $$distname.tar.bz2; \
|
||||
sync; sleep 2; \
|
||||
md5sum $$distname.tar.bz2; \
|
||||
bzip2 -t $$distname.tar.bz2
|
||||
|
||||
cvsclean:
|
||||
@for i in `find . -name .cvsignore`; do \
|
||||
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore` *.o *.a || true); \
|
||||
done
|
||||
@rm -f $(SUBDIRS) 2>/dev/null || true
|
||||
|
||||
.PHONY: $(ALWAYS) snapshot cvsclean
|
||||
@@ -0,0 +1,82 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
|
||||
include generated_lists
|
||||
|
||||
TOUCH_FILES = mkinstalldirs install-sh missing
|
||||
|
||||
LT_TARGETS = ltconfig ltmain.sh config.guess config.sub
|
||||
|
||||
makefile_in_files = $(makefile_am_files:.am=.in)
|
||||
makefile_files = $(makefile_am_files:e.am=e)
|
||||
|
||||
config_h_in = php_config.h.in
|
||||
|
||||
acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
|
||||
|
||||
targets = $(TOUCH_FILES) $(makefile_in_files) configure $(config_h_in)
|
||||
|
||||
|
||||
all: Zend/Makefile.am TSRM/Makefile.am $(targets)
|
||||
|
||||
Zend/Makefile.am:
|
||||
test -d Zend || (test -d ../Zend && ln -s ../Zend Zend)
|
||||
|
||||
TSRM/Makefile.am:
|
||||
test -d TSRM || (test -d ../TSRM && ln -s ../TSRM TSRM)
|
||||
|
||||
acconfig.h: $(acconfig_h_SOURCES)
|
||||
@echo rebuilding $@
|
||||
cat $(acconfig_h_SOURCES) > $@
|
||||
|
||||
$(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_files)
|
||||
@echo rebuilding Makefile templates
|
||||
@for i in $(LT_TARGETS); do \
|
||||
if test -f "$$i"; then \
|
||||
mv $$i $$i.bak; \
|
||||
cp $$i.bak $$i; \
|
||||
fi; \
|
||||
done
|
||||
@test -f want_dependencies || flag=-i; \
|
||||
automake -a $$flag $(AMFLAGS) $(makefile_files) \
|
||||
|| true >&2
|
||||
@for i in $(LT_TARGETS); do mv $$i.bak $$i; done
|
||||
|
||||
aclocal.m4: configure.in acinclude.m4 dynlib.m4
|
||||
aclocal
|
||||
|
||||
$(config_h_in): configure acconfig.h
|
||||
# explicitly remove target since autoheader does not seem to work
|
||||
# correctly otherwise (timestamps are not updated)
|
||||
@echo rebuilding $@
|
||||
@rm -f $@
|
||||
@autoheader 2>&1 | (grep -v 'warning: AC_TRY_RUN called without default to allow cross compiling'||true)
|
||||
|
||||
$(TOUCH_FILES):
|
||||
touch $(TOUCH_FILES)
|
||||
|
||||
configure: aclocal.m4 configure.in $(config_m4_files)
|
||||
@echo rebuilding $@
|
||||
@autoconf 2>&1 | (grep -v 'warning: AC_TRY_RUN called without default to allow cross compiling'||true)
|
||||
@@ -48,7 +48,7 @@ exit 1
|
||||
fi
|
||||
lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
|
||||
IFS=.; set $lt_version; IFS=' '
|
||||
if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3"
|
||||
if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" && (test "$3" = "c" || test "$3" -ge "3")
|
||||
then
|
||||
echo "buildconf: libtool version $lt_pversion (ok)"
|
||||
else
|
||||
@@ -0,0 +1,5 @@
|
||||
all: all-recursive
|
||||
|
||||
include $(builddir)/libs.mk
|
||||
|
||||
include $(top_srcdir)/build/rules.mk
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id: fastgen.sh,v 1.7 2000-06-11 10:33:39 sas Exp $
|
||||
#
|
||||
|
||||
srcdir=$1
|
||||
shift
|
||||
|
||||
mkdir_p=$1
|
||||
shift
|
||||
|
||||
top_srcdir=`(cd $srcdir; pwd)`
|
||||
top_builddir=`pwd`
|
||||
|
||||
if test "$mkdir_p" = "yes"; then
|
||||
mkdir_p="mkdir -p"
|
||||
else
|
||||
mkdir_p="$top_srcdir/helpers/mkdir.sh"
|
||||
fi
|
||||
|
||||
for makefile in $@; do
|
||||
echo "creating $makefile"
|
||||
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
|
||||
$mkdir_p "$dir/"
|
||||
|
||||
cat - $top_srcdir/$makefile.in <<EOF >$makefile
|
||||
top_srcdir = $top_srcdir
|
||||
top_builddir = $top_builddir
|
||||
srcdir = $top_srcdir/$dir
|
||||
builddir = $top_builddir/$dir
|
||||
VPATH = $top_srcdir/$dir
|
||||
EOF
|
||||
|
||||
test -z "$dir" || touch $dir/.deps
|
||||
done
|
||||
@@ -0,0 +1,30 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo)
|
||||
|
||||
$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
|
||||
$(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD)
|
||||
@@ -0,0 +1,31 @@
|
||||
# Copyright (c) 1999 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
targets = $(LTLIBRARY_NAME)
|
||||
|
||||
include $(top_srcdir)/build/rules.mk
|
||||
include $(top_srcdir)/build/library.mk
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Created: Thu Aug 15 11:57:33 1996 too
|
||||
# Last modified: Mon Dec 27 09:23:56 1999 too
|
||||
#
|
||||
# Copyright (c) 1996-1999 Tomi Ollila. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
die "Usage: mkdep CPP-command [CPP options] file1 [file2...]\n"
|
||||
if ($#ARGV < 1);
|
||||
|
||||
$cmdl = shift(@ARGV);
|
||||
|
||||
$cmdl = "$cmdl " . shift (@ARGV) while ($ARGV[0] =~ /^-[A-Z]/);
|
||||
|
||||
while ($file = shift(@ARGV))
|
||||
{
|
||||
$file =~ s/\.o$/.c/;
|
||||
|
||||
open(F, "$cmdl $file|");
|
||||
|
||||
&parseout;
|
||||
|
||||
close(F);
|
||||
}
|
||||
|
||||
|
||||
sub initinit
|
||||
{
|
||||
%used = ();
|
||||
$of = $file;
|
||||
$of =~ s/\.c$/.lo/;
|
||||
$str = "$of:\t$file";
|
||||
$len = length $str;
|
||||
}
|
||||
|
||||
sub initstr
|
||||
{
|
||||
$str = "\t";
|
||||
$len = length $str;
|
||||
}
|
||||
|
||||
sub parseout
|
||||
{
|
||||
&initinit;
|
||||
while (<F>)
|
||||
{
|
||||
next unless (/^# [0-9]* "(.*\.h)"/);
|
||||
|
||||
next if ($1 =~ /^\//);
|
||||
|
||||
next if $used{$1};
|
||||
|
||||
$used{$1} = 1;
|
||||
|
||||
$nlen = length($1) + 1;
|
||||
|
||||
if ($len + $nlen > 72)
|
||||
{
|
||||
print $str, "\\\n";
|
||||
&initstr;
|
||||
$str = $str . $1;
|
||||
}
|
||||
else { $str = $str . " " . $1; }
|
||||
|
||||
$len += $nlen;
|
||||
|
||||
}
|
||||
print $str, "\n";
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
PROGRAM_OBJECTS = $(PROGRAM_SOURCES:.c=.lo)
|
||||
|
||||
$(PROGRAM_NAME): $(PROGRAM_DEPENDENCIES) $(PROGRAM_OBJECTS)
|
||||
$(LINK) $(PROGRAM_LDFLAGS) $(PROGRAM_OBJECTS) $(PROGRAM_LDADD)
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
|
||||
all: all-recursive
|
||||
install: install-recursive
|
||||
|
||||
distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
|
||||
@otarget=`echo $@|sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for i in $$list; do \
|
||||
target="$$otarget"; \
|
||||
echo "Making $$target in $$i"; \
|
||||
if test "$$i" = "."; then \
|
||||
ok=yes; \
|
||||
target="$$target-p"; \
|
||||
fi; \
|
||||
(cd $$i && $(MAKE) $$target) || exit 1; \
|
||||
done; \
|
||||
if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
|
||||
if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi
|
||||
|
||||
all-p: $(targets)
|
||||
install-p: $(targets) $(install_targets)
|
||||
distclean-p depend-p clean-p:
|
||||
|
||||
depend: depend-recursive
|
||||
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
|
||||
|
||||
clean: clean-recursive clean-x
|
||||
|
||||
clean-x:
|
||||
rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
|
||||
rm -rf .libs
|
||||
|
||||
distclean: distclean-recursive clean-x
|
||||
rm -f config.cache config.log config.status config_vars.mk libtool \
|
||||
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
|
||||
|
||||
include $(builddir)/.deps
|
||||
|
||||
.PHONY: all-recursive clean-recursive install-recursive \
|
||||
$(install_targets) install all clean depend depend-recursive shared \
|
||||
distclean-recursive distclean clean-x all-p install-p distclean-p \
|
||||
depend-p clean-p
|
||||
@@ -0,0 +1,116 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -f -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
install_targets = install-modules
|
||||
|
||||
all: all-recursive
|
||||
install: install-recursive
|
||||
|
||||
distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
|
||||
@otarget=`echo $@|sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for i in $$list; do \
|
||||
target="$$otarget"; \
|
||||
echo "Making $$target in $$i"; \
|
||||
if test "$$i" = "."; then \
|
||||
ok=yes; \
|
||||
target="$$target-p"; \
|
||||
fi; \
|
||||
(cd $$i && $(MAKE) $$target) || exit 1; \
|
||||
done; \
|
||||
if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
|
||||
if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi
|
||||
|
||||
all-p: $(targets)
|
||||
install-p: $(targets) $(install_targets)
|
||||
distclean-p depend-p clean-p:
|
||||
|
||||
depend: depend-recursive
|
||||
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
|
||||
|
||||
clean: clean-recursive clean-x
|
||||
|
||||
clean-x:
|
||||
rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
|
||||
rm -rf .libs
|
||||
|
||||
distclean: distclean-recursive clean-x
|
||||
rm -f config.cache config.log config.status config_vars.mk libtool \
|
||||
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
|
||||
|
||||
install-modules:
|
||||
@test -d modules && \
|
||||
$(mkinstalldirs) $(moduledir) && \
|
||||
echo "installing shared modules into $(moduledir)" && \
|
||||
rm -f modules/*.la && \
|
||||
cp modules/* $(moduledir) || true
|
||||
|
||||
include $(builddir)/.deps
|
||||
|
||||
.PHONY: all-recursive clean-recursive install-recursive \
|
||||
$(install_targets) install all clean depend depend-recursive shared \
|
||||
distclean-recursive distclean clean-x all-p install-p distclean-p \
|
||||
depend-p clean-p
|
||||
Executable
+716
@@ -0,0 +1,716 @@
|
||||
#!/bin/sh
|
||||
##
|
||||
## GNU shtool -- The GNU Portable Shell Tool
|
||||
## Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>
|
||||
##
|
||||
## See http://www.gnu.org/software/shtool/ for more information.
|
||||
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
|
||||
##
|
||||
## Version 1.4.9 (16-Apr-2000)
|
||||
## Ingredients: 3/17 available modules
|
||||
##
|
||||
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of 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.
|
||||
##
|
||||
## 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 the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
## USA, or contact Ralf S. Engelschall <rse@engelschall.com>.
|
||||
##
|
||||
## Notice: Given that you include this file verbatim into your own
|
||||
## source tree, you are justified in saying that it remains separate
|
||||
## from your package, and that this way you are simply just using GNU
|
||||
## shtool. So, in this situation, there is no requirement that your
|
||||
## package itself is licensed under the GNU General Public License in
|
||||
## order to take advantage of GNU shtool.
|
||||
##
|
||||
|
||||
##
|
||||
## Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]
|
||||
##
|
||||
## Available commands:
|
||||
## echo Print string with optional construct expansion
|
||||
## install Install a program, script or datafile
|
||||
## mkdir Make one or more directories
|
||||
##
|
||||
## Not available commands (because module was not built-in):
|
||||
## mdate Pretty-print modification time of a file or dir
|
||||
## table Pretty-print a field-separated list as a table
|
||||
## prop Display progress with a running propeller
|
||||
## move Move files with simultaneous substitution
|
||||
## mkln Make link with calculation of relative paths
|
||||
## mkshadow Make a shadow tree through symbolic links
|
||||
## fixperm Fix file permissions inside a source tree
|
||||
## tarball Roll distribution tarballs
|
||||
## guessos Simple operating system guesser
|
||||
## arx Extended archive command
|
||||
## slo Separate linker options by library class
|
||||
## scpp Sharing C Pre-Processor
|
||||
## version Generate and maintain a version information file
|
||||
## path Deal with program paths
|
||||
##
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "$0:Error: invalid command line" 1>&2
|
||||
echo "$0:Hint: run \`$0 -h' for usage" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
|
||||
echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)"
|
||||
echo "Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>"
|
||||
echo "Report bugs to <bug-shtool@gnu.org>"
|
||||
echo ''
|
||||
echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
|
||||
echo ''
|
||||
echo 'Available global <options>:'
|
||||
echo ' -v, --version display shtool version information'
|
||||
echo ' -h, --help display shtool usage help page (this one)'
|
||||
echo ' -d, --debug display shell trace information'
|
||||
echo ''
|
||||
echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
|
||||
echo ' echo [-n] [-e] [<str> ...]'
|
||||
echo ' install [-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>]'
|
||||
echo ' [-e<ext>] <file> <path>'
|
||||
echo ' mkdir [-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]'
|
||||
echo ''
|
||||
echo 'Not available <cmd-name> (because module was not built-in):'
|
||||
echo ' mdate [-n] [-z] [-s] [-d] [-f<str>] [-o<spec>] <path>'
|
||||
echo ' table [-F<sep>] [-w<width>] [-c<cols>] [-s<strip>] <str><sep><str>...'
|
||||
echo ' prop [-p<str>]'
|
||||
echo ' move [-v] [-t] [-e] [-p] <src-file> <dst-file>'
|
||||
echo ' mkln [-t] [-f] [-s] <src-path> [<src-path> ...] <dst-path>'
|
||||
echo ' mkshadow [-v] [-t] [-a] <src-dir> <dst-dir>'
|
||||
echo ' fixperm [-v] [-t] <path> [<path> ...]'
|
||||
echo ' tarball [-t] [-v] [-o <tarball>] [-c <prog>] [-d <dir>] [-u'
|
||||
echo ' <user>] [-g <group>] [-e <pattern>] <path> [<path> ...]'
|
||||
echo ' guessos '
|
||||
echo ' arx [-t] [-C<cmd>] <op> <archive> [<file> ...]'
|
||||
echo ' slo [-p<str>] -- -L<dir> -l<lib> [-L<dir> -l<lib> ...]'
|
||||
echo ' scpp [-v] [-p] [-f<filter>] [-o<ofile>] [-t<tfile>] [-M<mark>]'
|
||||
echo ' [-D<dname>] [-C<cname>] <file> [<file> ...]'
|
||||
echo ' version [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-i<knob>]'
|
||||
echo ' [-d<type>] <file>'
|
||||
echo ' path [-s] [-r] [-d] [-b] [-m] [-p<path>] <str> [<str> ...]'
|
||||
echo ''
|
||||
exit 0
|
||||
fi
|
||||
if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
|
||||
echo "GNU shtool 1.4.9 (16-Apr-2000)"
|
||||
exit 0
|
||||
fi
|
||||
if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
|
||||
shift
|
||||
set -x
|
||||
fi
|
||||
name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'`
|
||||
case "$name" in
|
||||
echo|install|mkdir )
|
||||
# implicit tool command selection
|
||||
tool="$name"
|
||||
;;
|
||||
* )
|
||||
# explicit tool command selection
|
||||
tool="$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
arg_spec=""
|
||||
opt_spec=""
|
||||
gen_tmpfile=no
|
||||
|
||||
##
|
||||
## DISPATCH INTO SCRIPT PROLOG
|
||||
##
|
||||
|
||||
case $tool in
|
||||
echo )
|
||||
str_tool="echo"
|
||||
str_usage="[-n] [-e] [<str> ...]"
|
||||
arg_spec="0+"
|
||||
opt_spec="n.e."
|
||||
opt_n=no
|
||||
opt_e=no
|
||||
;;
|
||||
install )
|
||||
str_tool="install"
|
||||
str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<ext>] <file> <path>"
|
||||
arg_spec="2="
|
||||
opt_spec="v.t.c.C.s.m:o:g:e:"
|
||||
opt_v=no
|
||||
opt_t=no
|
||||
opt_c=no
|
||||
opt_C=no
|
||||
opt_s=no
|
||||
opt_m=""
|
||||
opt_o=""
|
||||
opt_g=""
|
||||
opt_e=""
|
||||
;;
|
||||
mkdir )
|
||||
str_tool="mkdir"
|
||||
str_usage="[-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]"
|
||||
arg_spec="1+"
|
||||
opt_spec="t.f.p.m:"
|
||||
opt_t=no
|
||||
opt_f=no
|
||||
opt_p=no
|
||||
opt_m=""
|
||||
;;
|
||||
-* )
|
||||
echo "$0:Error: unknown option \`$tool'" 2>&1
|
||||
echo "$0:Hint: run \`$0 -h' for usage" 2>&1
|
||||
exit 1
|
||||
;;
|
||||
* )
|
||||
echo "$0:Error: unknown command \`$tool'" 2>&1
|
||||
echo "$0:Hint: run \`$0 -h' for usage" 2>&1
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
##
|
||||
## COMMON UTILITY CODE
|
||||
##
|
||||
|
||||
# determine name of tool
|
||||
if [ ".$tool" != . ]; then
|
||||
# used inside shtool script
|
||||
toolcmd="$0 $tool"
|
||||
toolcmdhelp="shtool $tool"
|
||||
msgprefix="shtool:$tool"
|
||||
else
|
||||
# used as standalone script
|
||||
toolcmd="$0"
|
||||
toolcmdhelp="sh $0"
|
||||
msgprefix="$str_tool"
|
||||
fi
|
||||
|
||||
# parse argument specification string
|
||||
eval `echo $arg_spec |\
|
||||
sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'`
|
||||
|
||||
# parse option specification string
|
||||
eval `echo h.$opt_spec |\
|
||||
sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'`
|
||||
|
||||
# interate over argument line
|
||||
opt_PREV=''
|
||||
while [ $# -gt 0 ]; do
|
||||
# special option stops processing
|
||||
if [ ".$1" = ".--" ]; then
|
||||
shift
|
||||
break
|
||||
fi
|
||||
|
||||
# determine option and argument
|
||||
opt_ARG_OK=no
|
||||
if [ ".$opt_PREV" != . ]; then
|
||||
# merge previous seen option with argument
|
||||
opt_OPT="$opt_PREV"
|
||||
opt_ARG="$1"
|
||||
opt_ARG_OK=yes
|
||||
opt_PREV=''
|
||||
else
|
||||
# split argument into option and argument
|
||||
case "$1" in
|
||||
-[a-zA-Z0-9]*)
|
||||
eval `echo "x$1" |\
|
||||
sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \
|
||||
-e 's/";\(.*\)$/"; opt_ARG="\1"/'`
|
||||
;;
|
||||
-[a-zA-Z0-9])
|
||||
opt_OPT=`echo "x$1" | cut -c3-`
|
||||
opt_ARG=''
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# eat up option
|
||||
shift
|
||||
|
||||
# determine whether option needs an argument
|
||||
eval "opt_MODE=\$opt_MODE_${opt_OPT}"
|
||||
if [ ".$opt_ARG" = . -a ".$opt_ARG_OK" != .yes ]; then
|
||||
if [ ".$opt_MODE" = ".:" -o ".$opt_MODE" = ".+" ]; then
|
||||
opt_PREV="$opt_OPT"
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
# process option
|
||||
case $opt_MODE in
|
||||
'.' )
|
||||
# boolean option
|
||||
eval "opt_${opt_OPT}=yes"
|
||||
;;
|
||||
':' )
|
||||
# option with argument (multiple occurances override)
|
||||
eval "opt_${opt_OPT}=\"\$opt_ARG\""
|
||||
;;
|
||||
'+' )
|
||||
# option with argument (multiple occurances append)
|
||||
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT} \$opt_ARG\""
|
||||
;;
|
||||
* )
|
||||
echo "$msgprefix:Error: unknown option: \`-$opt_OPT'" 1>&2
|
||||
echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ ".$opt_PREV" != . ]; then
|
||||
echo "$msgprefix:Error: missing argument to option \`-$opt_PREV'" 1>&2
|
||||
echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# process help option
|
||||
if [ ".$opt_h" = .yes ]; then
|
||||
echo "Usage: $toolcmdhelp $str_usage"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# complain about incorrect number of arguments
|
||||
case $arg_MODE in
|
||||
'=' )
|
||||
if [ $# -ne $arg_NUMS ]; then
|
||||
echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2
|
||||
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
'+' )
|
||||
if [ $# -lt $arg_NUMS ]; then
|
||||
echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2
|
||||
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# establish a temporary file on request
|
||||
if [ ".$gen_tmpfile" = .yes ]; then
|
||||
if [ ".$TMPDIR" != . ]; then
|
||||
tmpdir="$TMPDIR"
|
||||
elif [ ".$TEMPDIR" != . ]; then
|
||||
tmpdir="$TEMPDIR"
|
||||
else
|
||||
tmpdir="/tmp"
|
||||
fi
|
||||
tmpfile="$tmpdir/.shtool.$$"
|
||||
rm -f $tmpfile >/dev/null 2>&1
|
||||
touch $tmpfile
|
||||
fi
|
||||
|
||||
##
|
||||
## DISPATCH INTO SCRIPT BODY
|
||||
##
|
||||
|
||||
case $tool in
|
||||
|
||||
echo )
|
||||
##
|
||||
## echo -- Print string with optional construct expansion
|
||||
## Copyright (c) 1998-2000 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Originally written for WML as buildinfo
|
||||
##
|
||||
|
||||
text="$*"
|
||||
|
||||
# check for broken escape sequence expansion
|
||||
seo=''
|
||||
bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'`
|
||||
if [ ".$bytes" != .3 ]; then
|
||||
bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'`
|
||||
if [ ".$bytes" = .3 ]; then
|
||||
seo='-E'
|
||||
fi
|
||||
fi
|
||||
|
||||
# check for existing -n option (to suppress newline)
|
||||
minusn=''
|
||||
bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'`
|
||||
if [ ".$bytes" = .3 ]; then
|
||||
minusn='-n'
|
||||
fi
|
||||
|
||||
# determine terminal bold sequence
|
||||
term_bold=''
|
||||
term_norm=''
|
||||
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
|
||||
case $TERM in
|
||||
# for the most important terminal types we directly know the sequences
|
||||
xterm|xterm*|vt220|vt220*)
|
||||
term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' </dev/null 2>/dev/null`
|
||||
term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' </dev/null 2>/dev/null`
|
||||
;;
|
||||
vt100|vt100*)
|
||||
term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' </dev/null 2>/dev/null`
|
||||
term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' </dev/null 2>/dev/null`
|
||||
;;
|
||||
# for all others, we try to use a possibly existing `tput' or `tcout' utility
|
||||
* )
|
||||
paths=`echo $PATH | sed -e 's/:/ /g'`
|
||||
for tool in tput tcout; do
|
||||
for dir in $paths; do
|
||||
if [ -r "$dir/$tool" ]; then
|
||||
for seq in bold md smso; do # 'smso' is last
|
||||
bold="`$dir/$tool $seq 2>/dev/null`"
|
||||
if [ ".$bold" != . ]; then
|
||||
term_bold="$bold"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ ".$term_bold" != . ]; then
|
||||
for seq in sgr0 me rmso reset; do # 'reset' is last
|
||||
norm="`$dir/$tool $seq 2>/dev/null`"
|
||||
if [ ".$norm" != . ]; then
|
||||
term_norm="$norm"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
if [ ".$term_bold" = . -o ".$term_norm" = . ]; then
|
||||
echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
# determine user name
|
||||
username=''
|
||||
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then
|
||||
username="$LOGNAME"
|
||||
if [ ".$username" = . ]; then
|
||||
username="$USER"
|
||||
if [ ".$username" = . ]; then
|
||||
username="`(whoami) 2>/dev/null |\
|
||||
awk '{ printf("%s", $1); }'`"
|
||||
if [ ".$username" = . ]; then
|
||||
username="`(who am i) 2>/dev/null |\
|
||||
awk '{ printf("%s", $1); }'`"
|
||||
if [ ".$username" = . ]; then
|
||||
username='unknown'
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# determine user id
|
||||
userid=''
|
||||
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then
|
||||
userid="`(id -u) 2>/dev/null`"
|
||||
if [ ".$userid" = . ]; then
|
||||
str="`(id) 2>/dev/null`"
|
||||
if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then
|
||||
userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'`
|
||||
fi
|
||||
if [ ".$userid" = . ]; then
|
||||
userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
|
||||
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
|
||||
if [ ".$userid" = . ]; then
|
||||
userid=`(ypcat passwd) 2>/dev/null |
|
||||
egrep "^${username}:" | \
|
||||
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
|
||||
if [ ".$userid" = . ]; then
|
||||
userid='?'
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# determine host name
|
||||
hostname=''
|
||||
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then
|
||||
hostname="`(uname -n) 2>/dev/null |\
|
||||
awk '{ printf("%s", $1); }'`"
|
||||
if [ ".$hostname" = . ]; then
|
||||
hostname="`(hostname) 2>/dev/null |\
|
||||
awk '{ printf("%s", $1); }'`"
|
||||
if [ ".$hostname" = . ]; then
|
||||
hostname='unknown'
|
||||
fi
|
||||
fi
|
||||
case $hostname in
|
||||
*.* )
|
||||
domainname=".`echo $hostname | cut -d. -f2-`"
|
||||
hostname="`echo $hostname | cut -d. -f1`"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# determine domain name
|
||||
domainname=''
|
||||
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then
|
||||
if [ ".$domainname" = . ]; then
|
||||
if [ -f /etc/resolv.conf ]; then
|
||||
domainname="`egrep '^[ ]*domain' /etc/resolv.conf | head -1 |\
|
||||
sed -e 's/.*domain//' \
|
||||
-e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
|
||||
-e 's/^\.//' -e 's/^/./' |\
|
||||
awk '{ printf("%s", $1); }'`"
|
||||
if [ ".$domainname" = . ]; then
|
||||
domainname="`egrep '^[ ]*search' /etc/resolv.conf | head -1 |\
|
||||
sed -e 's/.*search//' \
|
||||
-e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
|
||||
-e 's/ .*//' -e 's/ .*//' \
|
||||
-e 's/^\.//' -e 's/^/./' |\
|
||||
awk '{ printf("%s", $1); }'`"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# determine current time
|
||||
time_day=''
|
||||
time_month=''
|
||||
time_year=''
|
||||
time_monthname=''
|
||||
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then
|
||||
time_day=`date '+%d'`
|
||||
time_month=`date '+%m'`
|
||||
time_year=`date '+%Y' 2>/dev/null`
|
||||
if [ ".$time_year" = . ]; then
|
||||
time_year=`date '+%y'`
|
||||
case $time_year in
|
||||
[5-9][0-9]) time_year="19$time_year" ;;
|
||||
[0-4][0-9]) time_year="20$time_year" ;;
|
||||
esac
|
||||
fi
|
||||
case $time_month in
|
||||
1|01) time_monthname='Jan' ;;
|
||||
2|02) time_monthname='Feb' ;;
|
||||
3|03) time_monthname='Mar' ;;
|
||||
4|04) time_monthname='Apr' ;;
|
||||
5|05) time_monthname='May' ;;
|
||||
6|06) time_monthname='Jun' ;;
|
||||
7|07) time_monthname='Jul' ;;
|
||||
8|08) time_monthname='Aug' ;;
|
||||
9|09) time_monthname='Sep' ;;
|
||||
10) time_monthname='Oct' ;;
|
||||
11) time_monthname='Nov' ;;
|
||||
12) time_monthname='Dec' ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# expand special ``%x'' constructs
|
||||
if [ ".$opt_e" = .yes ]; then
|
||||
text=`echo $seo "$text" |\
|
||||
sed -e "s/%B/${term_bold}/g" \
|
||||
-e "s/%b/${term_norm}/g" \
|
||||
-e "s/%u/${username}/g" \
|
||||
-e "s/%U/${userid}/g" \
|
||||
-e "s/%h/${hostname}/g" \
|
||||
-e "s/%d/${domainname}/g" \
|
||||
-e "s/%D/${time_day}/g" \
|
||||
-e "s/%M/${time_month}/g" \
|
||||
-e "s/%Y/${time_year}/g" \
|
||||
-e "s/%m/${time_monthname}/g" 2>/dev/null`
|
||||
fi
|
||||
|
||||
# create output
|
||||
if [ .$opt_n = .no ]; then
|
||||
echo $seo "$text"
|
||||
else
|
||||
# the harder part: echo -n is best, because
|
||||
# awk may complain about some \xx sequences.
|
||||
if [ ".$minusn" != . ]; then
|
||||
echo $seo $minusn "$text"
|
||||
else
|
||||
echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
install )
|
||||
##
|
||||
## install -- Install a program, script or datafile
|
||||
## Copyright (c) 1997-2000 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Originally written for shtool
|
||||
##
|
||||
|
||||
src="$1"
|
||||
dst="$2"
|
||||
|
||||
# If destination is a directory, append the input filename
|
||||
if [ -d $dst ]; then
|
||||
dst=`echo "$dst" | sed -e 's:/$::'`
|
||||
dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
|
||||
dst="$dst/$dstfile"
|
||||
fi
|
||||
|
||||
# Add a possible extension to src and dst
|
||||
if [ ".$opt_e" != . ]; then
|
||||
src="$src$opt_e"
|
||||
dst="$dst$opt_e"
|
||||
fi
|
||||
|
||||
# Check for correct arguments
|
||||
if [ ".$src" = ".$dst" ]; then
|
||||
echo "$msgprefix:Error: source and destination are the same" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make a temp file name in the destination directory
|
||||
dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'`
|
||||
dsttmp="$dstdir/#INST@$$#"
|
||||
|
||||
# Verbosity
|
||||
if [ ".$opt_v" = .yes ]; then
|
||||
echo "$src -> $dst" 1>&2
|
||||
fi
|
||||
|
||||
# Copy or move the file name to the temp name
|
||||
# (because we might be not allowed to change the source)
|
||||
if [ ".$opt_C" = .yes ]; then
|
||||
opt_c=yes
|
||||
fi
|
||||
if [ ".$opt_c" = .yes ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "cp $src $dsttmp" 1>&2
|
||||
fi
|
||||
cp $src $dsttmp || exit $?
|
||||
else
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "mv $src $dsttmp" 1>&2
|
||||
fi
|
||||
mv $src $dsttmp || exit $?
|
||||
fi
|
||||
|
||||
# Adjust the target file
|
||||
# (we do chmod last to preserve setuid bits)
|
||||
if [ ".$opt_s" = .yes ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "strip $dsttmp" 1>&2
|
||||
fi
|
||||
strip $dsttmp || exit $?
|
||||
fi
|
||||
if [ ".$opt_o" != . ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "chown $opt_o $dsttmp" 1>&2
|
||||
fi
|
||||
chown $opt_o $dsttmp || exit $?
|
||||
fi
|
||||
if [ ".$opt_g" != . ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "chgrp $opt_g $dsttmp" 1>&2
|
||||
fi
|
||||
chgrp $opt_g $dsttmp || exit $?
|
||||
fi
|
||||
if [ ".$opt_m" != . ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "chmod $opt_m $dsttmp" 1>&2
|
||||
fi
|
||||
chmod $opt_m $dsttmp || exit $?
|
||||
fi
|
||||
|
||||
# Determine whether to do a quick install
|
||||
# (has to be done _after_ the strip was already done)
|
||||
quick=no
|
||||
if [ ".$opt_C" = .yes ]; then
|
||||
if [ -r $dst ]; then
|
||||
if cmp -s $src $dst; then
|
||||
quick=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Finally install the file to the real destination
|
||||
if [ $quick = yes ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "rm -f $dsttmp" 1>&2
|
||||
fi
|
||||
rm -f $dsttmp
|
||||
else
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "rm -f $dst && mv $dsttmp $dst" 1>&2
|
||||
fi
|
||||
rm -f $dst && mv $dsttmp $dst
|
||||
fi
|
||||
;;
|
||||
|
||||
mkdir )
|
||||
##
|
||||
## mkdir -- Make one or more directories
|
||||
## Copyright (c) 1996-2000 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Originally written for public domain by Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
## Cleaned up and enhanced for shtool
|
||||
##
|
||||
|
||||
errstatus=0
|
||||
for p in ${1+"$@"}; do
|
||||
# if the directory already exists...
|
||||
if [ -d "$p" ]; then
|
||||
if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then
|
||||
echo "$msgprefix:Error: directory already exists: $p" 1>&2
|
||||
errstatus=1
|
||||
break
|
||||
else
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
# if the directory has to be created...
|
||||
if [ ".$opt_p" = .no ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "mkdir $p" 1>&2
|
||||
fi
|
||||
mkdir $p || errstatus=$?
|
||||
else
|
||||
# the smart situation
|
||||
set fnord `echo ":$p" |\
|
||||
sed -e 's/^:\//%/' \
|
||||
-e 's/^://' \
|
||||
-e 's/\// /g' \
|
||||
-e 's/^%/\//'`
|
||||
shift
|
||||
pathcomp=''
|
||||
for d in ${1+"$@"}; do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp="./$pathcomp" ;;
|
||||
esac
|
||||
if [ ! -d "$pathcomp" ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
fi
|
||||
mkdir $pathcomp || errstatus=$?
|
||||
if [ ".$opt_m" != . ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "chmod $opt_m $pathcomp" 1>&2
|
||||
fi
|
||||
chmod $opt_m $pathcomp || errstatus=$?
|
||||
fi
|
||||
fi
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
fi
|
||||
done
|
||||
exit $errstatus
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
##EOF##
|
||||
@@ -26,4 +26,4 @@ else
|
||||
subdirs=''
|
||||
fi
|
||||
|
||||
${MAKE:-make} -s -f build.mk AMFLAGS="$automake_flags" $subdirs
|
||||
${MAKE:-make} -s -f build/build.mk AMFLAGS="$automake_flags"
|
||||
Loaded 100 of 973 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user