mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-16 13:36:38 +00:00
Compare commits
763
Commits
php-4.0RC1
...
php-4.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bebb83af0f | ||
|
|
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 |
No files matched your search
@@ -11,6 +11,8 @@ 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)
|
||||
|
||||
@@ -295,10 +297,10 @@ Installing PHP can be done in four simple steps:
|
||||
and you need to remove the # for that line to take effect.
|
||||
|
||||
|
||||
USING PHP3 AND PHP4 AS CONCURRENT APACHE MODULES
|
||||
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:
|
||||
@@ -307,7 +309,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,5 +1,5 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 2.01
|
||||
The PHP License, version 2.02
|
||||
Copyright (c) 1999, 2000 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
@@ -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.92
|
||||
of the Zend License.
|
||||
The license is bundled with the Zend engine, and is available
|
||||
at http://www.zend.com/license/0_92.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/.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,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
|
||||
|
||||
@@ -20,3 +20,6 @@ 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
|
||||
+27
-14
@@ -1,9 +1,4 @@
|
||||
|
||||
DEPTH = .
|
||||
topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
ZEND_DIR = $(srcdir)/Zend
|
||||
SUBDIRS = Zend ext sapi $(TSRM_DIR) $(REGEX_DIR) . $(PEAR_DIR)
|
||||
|
||||
@@ -13,8 +8,8 @@ LTLIBRARY_SOURCES = \
|
||||
main.c internal_functions.c snprintf.c php_sprintf.c \
|
||||
configuration-parser.c configuration-scanner.c \
|
||||
safe_mode.c fopen-wrappers.c php_realpath.c alloca.c \
|
||||
php_ini.c SAPI.c rfc1867.c dlist.c php_content_types.c strlcpy.c \
|
||||
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c
|
||||
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
|
||||
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c php_virtual_cwd.c
|
||||
|
||||
LTLIBRARY_DEPENDENCIES = \
|
||||
Zend/libZend.la \
|
||||
@@ -34,21 +29,39 @@ PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD)
|
||||
|
||||
targets = $(LTLIBRARY_NAME) $(PROGRAM_NAME)
|
||||
|
||||
install_targets = install-local install-modules
|
||||
install_targets = install-sapi install-modules
|
||||
|
||||
include $(topsrcdir)/build/rules.mk
|
||||
include $(topsrcdir)/build/library.mk
|
||||
include $(topsrcdir)/build/program.mk
|
||||
include $(top_srcdir)/build/rules.mk
|
||||
include $(top_srcdir)/build/library.mk
|
||||
include $(top_srcdir)/build/program.mk
|
||||
|
||||
install-local:
|
||||
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)
|
||||
|
||||
configuration-parser.h configuration-parser.c: configuration-parser.y
|
||||
install-modules:
|
||||
@test -d modules && \
|
||||
$(mkinstalldirs) $(moduledir) && \
|
||||
echo "installing shared modules into $(moduledir)" && \
|
||||
rm -f modules/*.la && \
|
||||
cp modules/* $(moduledir) || true
|
||||
|
||||
install-su: install-modules
|
||||
(cd pear && $(MAKE) install)
|
||||
|
||||
configuration-parser.h configuration-parser.c: $(srcdir)/configuration-parser.y
|
||||
$(YACC) -p cfg -v -d $< -o configuration-parser.c
|
||||
|
||||
configuration-scanner.c: configuration-scanner.l
|
||||
configuration-scanner.c: $(srcdir)/configuration-scanner.l
|
||||
$(LEX) -Pcfg -o$@ -i $<
|
||||
|
||||
internal_functions.c: internal_functions.c.in config.status
|
||||
|
||||
@@ -1,22 +1,137 @@
|
||||
PHP 4.0 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
22 May 2000, Version 4.0.0 Release
|
||||
- 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 library)
|
||||
- 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)
|
||||
when used as function arguments (Andi, Zend Engine)
|
||||
- Added get_class_methods(string classname) function. (Andrei)
|
||||
- Don't default to iso-8859-1 since this confuses some browsers (Rasmus)
|
||||
- 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)
|
||||
- Make it possible to specify both a port and a socket in
|
||||
mysql_[p]connect (Rasmus)
|
||||
- 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 library)
|
||||
(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)
|
||||
@@ -26,11 +141,16 @@ PHP 4.0 NEWS
|
||||
corrupted. (Thies)
|
||||
- Changed $HTTP_STATE_VARS to $HTTP_SESSION_VARS. Use only the latter
|
||||
version now! (Andrei)
|
||||
- Add GD-JPEG Support (Rasmus)
|
||||
- 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)
|
||||
- Added include_once() and require_once() functionality (Andi, Zend library)
|
||||
- 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)
|
||||
@@ -44,21 +164,22 @@ PHP 4.0 NEWS
|
||||
of PHP, and currently lacks section support (Zeev)
|
||||
- "none" is now equivalent with "" in Apache config directives (Stig)
|
||||
- OCINLogon no longer crashes. (Thies)
|
||||
- Fix comparisons of (string) "nan" with (string) "nan". (Thies, Zend library)
|
||||
- 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)
|
||||
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 library)
|
||||
- Add pdf_set_parameter(), pdf_skew(), pdf_show_boxed() (Uwe)
|
||||
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)
|
||||
@@ -81,8 +202,8 @@ PHP 4.0 NEWS
|
||||
- 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)
|
||||
- Fix bug in unset() on array offsets which are referenced more than once
|
||||
(Andi, Zend library)
|
||||
- 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
|
||||
@@ -93,7 +214,7 @@ PHP 4.0 NEWS
|
||||
- Re-introduced "none" for disabling auto_prepend/append_file (Stig)
|
||||
- Added DB/storage (Stig, PEAR)
|
||||
- Introduced DB warnings (Stig, PEAR)
|
||||
- Fix overrun in strip_tags (Stas)
|
||||
- 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>
|
||||
@@ -104,7 +225,7 @@ PHP 4.0 NEWS
|
||||
- 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 library)
|
||||
- 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)
|
||||
@@ -160,10 +281,10 @@ PHP 4.0 NEWS
|
||||
- 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 library)
|
||||
- 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 library)
|
||||
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)
|
||||
@@ -184,16 +305,16 @@ PHP 4.0 NEWS
|
||||
- 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 library)
|
||||
- Added is_subclass_of() function (Andrei, Zend Engine)
|
||||
- Implemented count_chars(). (Thies)
|
||||
- Added class_exists() function (Andrei, Zend library)
|
||||
- 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)
|
||||
@@ -214,7 +335,7 @@ PHP 4.0 NEWS
|
||||
- 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>)
|
||||
@@ -223,7 +344,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)
|
||||
@@ -232,7 +353,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
|
||||
@@ -252,7 +373,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)
|
||||
@@ -263,7 +384,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)
|
||||
@@ -279,7 +400,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)
|
||||
@@ -301,7 +422,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)
|
||||
@@ -314,12 +435,12 @@ November 16 1999, Version 4.0 Beta 3
|
||||
- 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
|
||||
@@ -345,8 +466,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)
|
||||
@@ -432,15 +553,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)
|
||||
@@ -493,25 +614,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
|
||||
@@ -534,7 +655,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
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
$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/rules.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])
|
||||
|
||||
PHP_EXTENSION(foobar, $ext_shared)
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
PHP_ARG_ENABLE will automatically set the correct variables, so
|
||||
that the extension will be enabled by PHP_EXTENSION in shared mode.
|
||||
|
||||
|
||||
CREATING SOURCE FILES
|
||||
|
||||
[You are currently alone here. There are a lot of existing modules,
|
||||
use a simply module as a starting point and add your own code.]
|
||||
|
||||
|
||||
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
|
||||
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
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 my PHP library fail to load?
|
||||
|
||||
After configuring Zeus, if you get a '502 Bad Gatway' 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
|
||||
@@ -3,18 +3,17 @@ parenthesis means that person has taken on this project.
|
||||
|
||||
Zend
|
||||
----
|
||||
* allow foreach ($array as $k => &$val) syntax. right now we can not
|
||||
* allow foreach ($array as $k => &$val) syntax. right now we cannot
|
||||
traverse an array without copying each element.
|
||||
* look al replacing c-lib call tolower().
|
||||
* look at replacing c-lib call tolower().
|
||||
|
||||
global
|
||||
------
|
||||
* 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
|
||||
* let every module (source-file) have it's own module & function_entry
|
||||
block. Right now the math functions are in math.c but the corresponding
|
||||
function-entries are in basic_functions.
|
||||
* 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
|
||||
@@ -22,65 +21,58 @@ global
|
||||
* --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!
|
||||
* banish the legacy of php3_ prefixes
|
||||
* implement javadoc based function docs template system
|
||||
* use thread-safe resolver functions (either require BIND 8 or adns)
|
||||
* check for incorrect *_r (time related) on HPSUX
|
||||
* provide optional IPv6 support
|
||||
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/pcre
|
||||
--------
|
||||
* use/support latest pcre v3.1.
|
||||
|
||||
ext/wddx
|
||||
--------
|
||||
* See if we can support the remaining datatypes:
|
||||
dateTime
|
||||
binary
|
||||
recordset
|
||||
|
||||
http://www.wddx.org/WDDX_SDK_10a/7__References/WDDX_DTD.htm
|
||||
|
||||
* implement wddx_packet_as_javascript(). (Andrei)
|
||||
|
||||
ext/dav
|
||||
--------
|
||||
* rewrite
|
||||
* rewrite.
|
||||
|
||||
ext/mcrypt
|
||||
----------
|
||||
* port to mcrypt-2.6 or later
|
||||
|
||||
ext/oci8
|
||||
--------
|
||||
* all OCIFetch*() functions should return 0 for no more data and false on error.
|
||||
* have a flag that trims trailing spaces from CHAR fields on retrieval.
|
||||
|
||||
ext/snmp
|
||||
ext/pcre
|
||||
--------
|
||||
* port to latest UCD-SNMP 4.1 (even doesn't compile)
|
||||
|
||||
* 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/standard
|
||||
------------
|
||||
* add a version number to data serialized via serialize().
|
||||
* array_add(), array_rand() (Andrei)
|
||||
* implement pathinfo()
|
||||
* array_add(), array_uniq(). (Andrei)
|
||||
* implement pathinfo() (what the heck is it?)
|
||||
* possibly modify parsing of GPC data to automatically create arrays if
|
||||
variable name is seen more than once.
|
||||
* implement regex-cache for url-functions.
|
||||
* strpad() (Andrei)
|
||||
* stri_replace() (Andrei)
|
||||
* comparing arrays semantically (like Python) (Andrei)
|
||||
* move socket related functions to fsock.c
|
||||
* strpad(). (Andrei)
|
||||
* strcase_replace(). (Andrei)
|
||||
* comparing arrays semantically (like Python). (Andrei)
|
||||
* move socket related functions to fsock.c.
|
||||
* get_defined_funcs(), get_defined_vars().
|
||||
* NOT binary safe:
|
||||
strtok()
|
||||
basename()
|
||||
@@ -89,6 +81,19 @@ ext/standard
|
||||
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
|
||||
|
||||
|
||||
+29
-12
@@ -45,12 +45,17 @@ AC_DEFUN(PTHREADS_FLAGS,[
|
||||
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
|
||||
@@ -60,6 +65,7 @@ dnl
|
||||
AC_DEFUN(PTHREADS_CHECK_COMPILE, [
|
||||
AC_TRY_RUN( [
|
||||
#include <pthread.h>
|
||||
#include <stddef.h>
|
||||
|
||||
void *thread_routine(void *data) {
|
||||
return data;
|
||||
@@ -67,7 +73,9 @@ void *thread_routine(void *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"
|
||||
@@ -80,28 +88,26 @@ dnl
|
||||
dnl Try to find a way to enable POSIX threads
|
||||
dnl
|
||||
AC_DEFUN(PTHREADS_CHECK,[
|
||||
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
|
||||
|
||||
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 -pthreads -pthread -mthreads; do
|
||||
for flag in -pthreads -pthread -mthreads -Kthread; do
|
||||
ac_save="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $flag"
|
||||
PTHREADS_CHECK_COMPILE
|
||||
PTHREADS_CHECK_COMPILE
|
||||
CFLAGS="$ac_save"
|
||||
if test "$pthreads_working" = "yes"; then
|
||||
ac_cv_pthreads_cflags="$flag"
|
||||
break
|
||||
fi
|
||||
CFLAGS="$ac_save"
|
||||
done
|
||||
fi
|
||||
])
|
||||
@@ -113,11 +119,11 @@ if test "$pthreads_working" != "yes"; then
|
||||
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
|
||||
LIBS="$ac_save"
|
||||
done
|
||||
fi
|
||||
])
|
||||
@@ -128,3 +134,14 @@ 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
|
||||
+4
-4
@@ -23,16 +23,16 @@ 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:
|
||||
|
||||
+3
-8
@@ -50,13 +50,8 @@ dlfcn.h)
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
AC_CHECK_LIB(c, dlopen, [
|
||||
# fake it
|
||||
AC_DEFINE(HAVE_LIBDL) ], [
|
||||
AC_CHECK_LIB(dl, dlopen, [
|
||||
LIBS="-ldl $LIBS"
|
||||
AC_DEFINE(HAVE_LIBDL) ], []) ])
|
||||
|
||||
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 )
|
||||
@@ -67,7 +62,7 @@ dnl Checks for library functions.
|
||||
AC_FUNC_VPRINTF
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol)
|
||||
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite)
|
||||
AC_ZEND_BROKEN_SPRINTF
|
||||
|
||||
AC_SUBST(ZEND_SCANNER)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#define ZEND_API
|
||||
#define ZEND_DLEXPORT
|
||||
|
||||
@TOP@
|
||||
|
||||
|
||||
+13
-12
@@ -60,7 +60,7 @@
|
||||
%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 '+' '-' '.'
|
||||
@@ -268,9 +268,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; }
|
||||
;
|
||||
|
||||
|
||||
@@ -454,6 +454,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); }
|
||||
@@ -496,8 +497,8 @@ function_call:
|
||||
|
||||
|
||||
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; }
|
||||
;
|
||||
|
||||
@@ -680,11 +681,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); }
|
||||
|
||||
;
|
||||
@@ -711,7 +712,7 @@ 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); }
|
||||
;
|
||||
|
||||
+36
-29
@@ -316,19 +316,19 @@ 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));
|
||||
@@ -348,7 +348,7 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
|
||||
retval_znode.u.constant.is_ref = 0;
|
||||
retval_znode.u.constant.refcount = 1;
|
||||
|
||||
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
|
||||
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 */
|
||||
@@ -389,9 +389,6 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
|
||||
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);
|
||||
@@ -404,7 +401,7 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
|
||||
}
|
||||
|
||||
|
||||
zend_op_array *compile_filename(int mode, zval *filename CLS_DC ELS_DC)
|
||||
zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
{
|
||||
zend_file_handle file_handle;
|
||||
zval tmp;
|
||||
@@ -423,16 +420,16 @@ zend_op_array *compile_filename(int mode, zval *filename CLS_DC ELS_DC)
|
||||
file_handle.opened_path = NULL;
|
||||
|
||||
|
||||
if (mode==ZEND_REQUIRE) {
|
||||
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(1 CLS_CC, 1, &file_handle);
|
||||
retval = zend_compile_files(type CLS_CC, 1, &file_handle);
|
||||
|
||||
if (mode==ZEND_REQUIRE) {
|
||||
if (type==ZEND_REQUIRE) {
|
||||
EG(error_reporting) = error_reporting;
|
||||
if (!retval) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, filename->value.str.val);
|
||||
@@ -489,8 +486,7 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
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);
|
||||
@@ -542,6 +538,10 @@ int require_filename(char *filename, zend_bool unique 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);
|
||||
@@ -557,6 +557,7 @@ int use_filename(char *filename, uint filename_length CLS_DC)
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
return SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -583,6 +584,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);
|
||||
@@ -989,6 +991,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;
|
||||
}
|
||||
@@ -1310,14 +1316,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;
|
||||
}
|
||||
}
|
||||
@@ -1550,7 +1557,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]);
|
||||
@@ -1562,12 +1569,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);
|
||||
@@ -1576,54 +1583,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);
|
||||
|
||||
+127
-12
@@ -40,7 +40,6 @@
|
||||
ZEND_API zend_class_entry zend_standard_class_def;
|
||||
ZEND_API int (*zend_printf)(const char *format, ...);
|
||||
ZEND_API zend_write_func_t zend_write;
|
||||
ZEND_API void (*zend_error)(int type, const char *format, ...);
|
||||
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);
|
||||
@@ -48,6 +47,12 @@ ZEND_API void (*zend_ticks_function)(int ticks);
|
||||
static void (*zend_message_dispatcher_p)(long message, void *data);
|
||||
static int (*zend_get_ini_entry_p)(char *name, uint name_length, zval *contents);
|
||||
|
||||
#if ZEND_NEW_ERROR_HANDLING
|
||||
static void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
#else
|
||||
ZEND_API void (*zend_error_cb)(int type, const char *format, ...);
|
||||
#endif
|
||||
|
||||
#ifdef ZTS
|
||||
ZEND_API int compiler_globals_id;
|
||||
ZEND_API int executor_globals_id;
|
||||
@@ -64,7 +69,7 @@ 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-2000 Zend Technologies Ltd.\n"
|
||||
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2000 Zend Technologies\n"
|
||||
|
||||
|
||||
#define PRINT_ZVAL_INDENT 4
|
||||
@@ -275,14 +280,14 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
static void executor_globals_dtor(zend_executor_globals *executor_globals)
|
||||
{
|
||||
zend_shutdown_constants(ELS_C);
|
||||
destroy_resource_plist(ELS_C);
|
||||
zend_destroy_rsrc_plist(ELS_C);
|
||||
}
|
||||
|
||||
|
||||
@@ -306,7 +311,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
#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 = (zend_write_func_t) utility_functions->write_function;
|
||||
zend_fopen = utility_functions->fopen_function;
|
||||
@@ -319,10 +324,10 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
zend_get_ini_entry_p = utility_functions->get_ini_entry;
|
||||
zend_ticks_function = utility_functions->ticks_function;
|
||||
|
||||
zend_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);
|
||||
@@ -334,7 +339,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
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;
|
||||
@@ -358,7 +363,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
zend_register_standard_constants(ELS_C);
|
||||
|
||||
#ifndef ZTS
|
||||
init_resource_plist(ELS_C);
|
||||
zend_init_rsrc_plist(ELS_C);
|
||||
#endif
|
||||
|
||||
if (start_builtin_functions) {
|
||||
@@ -372,9 +377,9 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
void zend_shutdown()
|
||||
{
|
||||
#ifndef ZTS
|
||||
destroy_resource_plist();
|
||||
zend_destroy_rsrc_plist();
|
||||
#endif
|
||||
zend_hash_destroy(&list_destructors);
|
||||
zend_destroy_rsrc_list_dtors();
|
||||
zend_hash_destroy(&module_registry);
|
||||
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
|
||||
free(GLOBAL_FUNCTION_TABLE);
|
||||
@@ -455,10 +460,18 @@ 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);
|
||||
@@ -483,3 +496,105 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents)
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if ZEND_NEW_ERROR_HANDLING
|
||||
|
||||
#define ZEND_ERROR_BUFFER_SIZE 1024
|
||||
|
||||
ZEND_API void zend_error(int type, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
zval **params;
|
||||
zval retval;
|
||||
zval error_type, error_message;
|
||||
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 */
|
||||
INIT_PZVAL(&error_message);
|
||||
INIT_PZVAL(&error_type);
|
||||
error_message.value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE);
|
||||
|
||||
/* error_message.value.str.len = vsnprintf(error_message->value.str.val, error_message->value.str.len-1, format, args); */
|
||||
error_message.value.str.len = vsprintf(error_message.value.str.val, format, args);
|
||||
error_message.type = IS_STRING;
|
||||
|
||||
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(CG(function_table), NULL, EG(user_error_handler), &retval, 2, params)==SUCCESS) {
|
||||
zval_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);
|
||||
efree(error_message.value.str.val);
|
||||
break;
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+18
-6
@@ -21,7 +21,9 @@
|
||||
#ifndef _ZEND_H
|
||||
#define _ZEND_H
|
||||
|
||||
#define ZEND_VERSION "0.92"
|
||||
#define ZEND_VERSION "1.00"
|
||||
|
||||
#define ZEND_NEW_ERROR_HANDLING 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_EXTERN_C() extern "C" {
|
||||
@@ -157,7 +159,6 @@ typedef union _zvalue_value {
|
||||
char *val;
|
||||
int len;
|
||||
} str;
|
||||
char chval; /* char value */
|
||||
HashTable *ht; /* hash table value */
|
||||
struct {
|
||||
zend_class_entry *ce;
|
||||
@@ -186,7 +187,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;
|
||||
|
||||
|
||||
@@ -220,7 +221,11 @@ struct _zend_class_entry {
|
||||
|
||||
|
||||
typedef struct _zend_utility_functions {
|
||||
#if ZEND_NEW_ERROR_HANDLING
|
||||
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
#else
|
||||
void (*error_function)(int type, const char *format, ...);
|
||||
#endif
|
||||
int (*printf_function)(const char *format, ...);
|
||||
int (*write_function)(const char *str, uint str_length);
|
||||
FILE *(*fopen_function)(const char *filename, char **opened_path);
|
||||
@@ -315,12 +320,19 @@ ZEND_API extern char *empty_string;
|
||||
BEGIN_EXTERN_C()
|
||||
extern ZEND_API int (*zend_printf)(const char *format, ...);
|
||||
extern ZEND_API zend_write_func_t zend_write;
|
||||
extern ZEND_API void (*zend_error)(int type, const char *format, ...);
|
||||
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
|
||||
extern ZEND_API void (*zend_block_interruptions)(void);
|
||||
extern ZEND_API void (*zend_unblock_interruptions)(void);
|
||||
extern ZEND_API void (*zend_ticks_function)(int ticks);
|
||||
|
||||
|
||||
|
||||
#if ZEND_NEW_ERROR_HANDLING
|
||||
ZEND_API void zend_error(int type, const char *format, ...);
|
||||
#else
|
||||
#define zend_error zend_error_cb
|
||||
ZEND_API void (*zend_error_cb)(int type, const char *format, ...);
|
||||
#endif
|
||||
|
||||
void zenderror(char *error);
|
||||
|
||||
extern ZEND_API zend_class_entry zend_standard_class_def;
|
||||
@@ -397,7 +409,7 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
} \
|
||||
INIT_PZVAL(&(zv));
|
||||
|
||||
#define ZEND_MAX_RESERVED_RESOURCES 1
|
||||
#define ZEND_MAX_RESERVED_RESOURCES 2
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
/* Only use this macro if you know for sure that all of the switches values
|
||||
|
||||
+4
-22
@@ -30,7 +30,7 @@
|
||||
|
||||
/* 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 zend_get_parameters(int ht, int param_count, ...)
|
||||
@@ -707,26 +707,6 @@ ZEND_API 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)
|
||||
{
|
||||
@@ -815,8 +795,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) {
|
||||
|
||||
+50
-6
@@ -27,12 +27,54 @@
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.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) \
|
||||
@@ -76,10 +118,12 @@ 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 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; }
|
||||
|
||||
#ifndef ZEND_WIN32
|
||||
#define DLEXPORT
|
||||
|
||||
+23
-1
@@ -319,6 +319,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
|
||||
@@ -334,6 +339,23 @@ ZEND_API void start_memory_manager(ALS_D)
|
||||
|
||||
memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head)));
|
||||
memset(AG(cache_count),0,MAX_CACHED_MEMORY*sizeof(unsigned char));
|
||||
|
||||
#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<MAX_CACHED_ENTRIES; j++) {
|
||||
cached_entries[i][j] = emalloc(i);
|
||||
}
|
||||
}
|
||||
for (i=1; i<MAX_CACHED_MEMORY; i++) {
|
||||
for (j=0; j<MAX_CACHED_ENTRIES; j++) {
|
||||
efree(cached_entries[i][j]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -611,7 +633,7 @@ ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
||||
/* add the block to the persistent list */
|
||||
ADD_POINTER_TO_LIST(p);
|
||||
HANDLE_UNBLOCK_INTERRUPTIONS();
|
||||
return p->size;
|
||||
return p->size+sizeof(zend_mem_header)+PLATFORM_PADDING;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+120
-22
@@ -46,12 +46,15 @@ static ZEND_FUNCTION(leak);
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
static ZEND_FUNCTION(crash);
|
||||
#endif
|
||||
static ZEND_FUNCTION(get_used_files);
|
||||
static ZEND_FUNCTION(get_required_files);
|
||||
static ZEND_FUNCTION(get_included_files);
|
||||
static ZEND_FUNCTION(is_subclass_of);
|
||||
static ZEND_FUNCTION(get_class_vars);
|
||||
static ZEND_FUNCTION(get_object_vars);
|
||||
static ZEND_FUNCTION(get_class_methods);
|
||||
static ZEND_FUNCTION(user_error);
|
||||
static ZEND_FUNCTION(set_user_error_handler);
|
||||
static ZEND_FUNCTION(get_declared_classes);
|
||||
|
||||
unsigned char first_arg_force_ref[] = { 1, BYREF_FORCE };
|
||||
unsigned char first_arg_allow_ref[] = { 1, BYREF_ALLOW };
|
||||
@@ -80,12 +83,15 @@ static zend_function_entry builtin_functions[] = {
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
ZEND_FE(crash, NULL)
|
||||
#endif
|
||||
ZEND_FE(get_used_files, NULL)
|
||||
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(user_error, NULL)
|
||||
ZEND_FE(set_user_error_handler, NULL)
|
||||
ZEND_FE(get_declared_classes, NULL)
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -107,14 +113,13 @@ ZEND_FUNCTION(func_num_args)
|
||||
void **p;
|
||||
int arg_count;
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
if (p) {
|
||||
p = EG(argument_stack).top_element-1-1;
|
||||
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
|
||||
p -= 1+arg_count;
|
||||
if (*p) {
|
||||
zend_error(E_ERROR, "func_num_args(): Can't be used as a function parameter");
|
||||
}
|
||||
--p;
|
||||
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
|
||||
|
||||
p = EG(argument_stack).top_element-1-arg_count-2;
|
||||
if (p>=EG(argument_stack).elements) {
|
||||
RETURN_LONG((ulong) *p);
|
||||
} else {
|
||||
@@ -138,14 +143,13 @@ ZEND_FUNCTION(func_get_arg)
|
||||
convert_to_long_ex(z_requested_offset);
|
||||
requested_offset = (*z_requested_offset)->value.lval;
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
if (p) {
|
||||
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;
|
||||
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
|
||||
|
||||
p = EG(argument_stack).top_element-1-arg_count-2;
|
||||
--p;
|
||||
if (p<EG(argument_stack).elements) {
|
||||
zend_error(E_WARNING, "func_get_arg(): Called from the global scope - no function context");
|
||||
RETURN_FALSE;
|
||||
@@ -169,15 +173,14 @@ ZEND_FUNCTION(func_get_args)
|
||||
int arg_count;
|
||||
int i;
|
||||
|
||||
p = EG(argument_stack).top_element-1;
|
||||
if (p) {
|
||||
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;
|
||||
|
||||
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
|
||||
--p;
|
||||
|
||||
p = EG(argument_stack).top_element-1-arg_count-2;
|
||||
if (p<EG(argument_stack).elements) {
|
||||
zend_error(E_WARNING, "func_get_args(): Called from the global scope - no function context");
|
||||
RETURN_FALSE;
|
||||
@@ -675,17 +678,112 @@ 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);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto array get_included_files(void)
|
||||
Returns an array with the file names that were include_once()'d */
|
||||
ZEND_FUNCTION(get_included_files)
|
||||
{
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_apply_with_argument(&EG(included_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 user_error(string messsage [, int error_type])
|
||||
Generates a user-level error/warning/notice message */
|
||||
ZEND_FUNCTION(user_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;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
ZEND_FUNCTION(set_user_error_handler)
|
||||
{
|
||||
zval **error_handler;
|
||||
|
||||
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)) {
|
||||
zval_dtor(EG(user_error_handler));
|
||||
} else {
|
||||
ALLOC_ZVAL(EG(user_error_handler));
|
||||
}
|
||||
|
||||
*EG(user_error_handler) = **error_handler;
|
||||
zval_copy_ctor(EG(user_error_handler));
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
static int copy_class_name(zend_class_entry *ce, zval *array)
|
||||
{
|
||||
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_argument(CG(class_table), (apply_func_arg_t)copy_class_name, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
+43
-34
@@ -26,7 +26,7 @@
|
||||
#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
|
||||
@@ -107,7 +107,7 @@ void init_compiler(CLS_D ELS_DC)
|
||||
CG(allow_call_time_pass_reference) = ZEND_UV(allow_call_time_pass_reference);
|
||||
CG(handle_op_arrays) = 1;
|
||||
CG(in_compilation) = 0;
|
||||
init_resource_list(ELS_C);
|
||||
zend_init_rsrc_list(ELS_C);
|
||||
CG(unclean_shutdown) = 0;
|
||||
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_open_file_dtor, 0);
|
||||
zend_hash_init(&CG(used_files), 5, NULL, (void (*)(void *)) zend_open_file_dtor_wrapper, 0);
|
||||
@@ -412,9 +412,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);
|
||||
}
|
||||
|
||||
@@ -425,7 +424,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);
|
||||
|
||||
@@ -716,7 +715,7 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
function_token->u.op_array = CG(active_op_array);
|
||||
zend_str_tolower(name, name_len);
|
||||
|
||||
init_op_array(&op_array, 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;
|
||||
@@ -787,19 +786,21 @@ void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, un
|
||||
} 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]++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -906,9 +907,9 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
|
||||
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"
|
||||
"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.",
|
||||
"However, future versions may not support this any longer. ",
|
||||
(function_ptr?function_ptr->common.function_name:"[runtime function name]"),
|
||||
offset+1);
|
||||
}
|
||||
@@ -976,7 +977,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;
|
||||
}
|
||||
|
||||
@@ -993,7 +994,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -1018,11 +1019,11 @@ void do_return(znode *expr, int do_end_vparse CLS_DC)
|
||||
}
|
||||
}
|
||||
#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);
|
||||
@@ -1140,6 +1141,7 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
ce->parent = parent_ce;
|
||||
do_inherit_parent_constructor(ce);
|
||||
|
||||
|
||||
/* Register the derived class */
|
||||
if (zend_hash_add(class_table, class_name, strlen(class_name)+1, ce, sizeof(zend_class_entry), NULL)==FAILURE) {
|
||||
if (!compile_time) {
|
||||
@@ -1148,8 +1150,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;
|
||||
@@ -1181,6 +1185,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);
|
||||
}
|
||||
@@ -1319,7 +1325,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;
|
||||
@@ -1340,11 +1346,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);
|
||||
}
|
||||
@@ -1384,7 +1392,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));
|
||||
@@ -1443,7 +1451,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;
|
||||
@@ -1844,6 +1852,7 @@ 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;
|
||||
@@ -1866,14 +1875,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;
|
||||
}
|
||||
|
||||
@@ -1887,7 +1896,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;
|
||||
}
|
||||
|
||||
|
||||
+112
-98
@@ -59,8 +59,8 @@ typedef struct _znode {
|
||||
zval constant;
|
||||
|
||||
zend_uint var;
|
||||
int opline_num; /* Needs to be signed */
|
||||
zend_uchar fetch_type;
|
||||
zend_uint opline_num; /* Needs to be signed */
|
||||
zend_uint fetch_type;
|
||||
zend_op_array *op_array;
|
||||
struct {
|
||||
zend_uint var; /* dummy */
|
||||
@@ -115,6 +115,7 @@ struct _zend_op_array {
|
||||
int backpatch_count;
|
||||
#endif
|
||||
zend_bool return_reference;
|
||||
zend_bool done_pass_two;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
};
|
||||
@@ -130,6 +131,16 @@ typedef struct _zend_internal_function {
|
||||
} 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 {
|
||||
zend_uchar type; /* MUST be the first element of this struct! */
|
||||
struct {
|
||||
@@ -140,6 +151,7 @@ typedef union _zend_function {
|
||||
|
||||
zend_op_array op_array;
|
||||
zend_internal_function internal_function;
|
||||
zend_overloaded_function overloaded_function;
|
||||
} zend_function;
|
||||
|
||||
|
||||
@@ -194,11 +206,12 @@ BEGIN_EXTERN_C()
|
||||
void init_compiler(CLS_D ELS_DC);
|
||||
void shutdown_compiler(CLS_D);
|
||||
|
||||
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);
|
||||
@@ -357,12 +370,12 @@ void do_ticks(CLS_D);
|
||||
ZEND_API int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC);
|
||||
ZEND_API int require_filename(char *filename, zend_bool unique CLS_DC);
|
||||
ZEND_API int use_filename(char *filename, uint filename_length CLS_DC);
|
||||
ZEND_API zend_op_array *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(int mode, zval *filename CLS_DC ELS_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);
|
||||
@@ -380,7 +393,7 @@ int get_next_op_number(zend_op_array *op_array);
|
||||
int print_class(zend_class_entry *class_entry);
|
||||
void print_op_array(zend_op_array *op_array, int optimizations);
|
||||
int pass_two(zend_op_array *op_array);
|
||||
void pass_include_eval(zend_op_array *op_array);
|
||||
ZEND_API void pass_include_eval(zend_op_array *op_array);
|
||||
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
|
||||
ZEND_API zend_bool zend_is_compiling(void);
|
||||
|
||||
@@ -403,120 +416,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_ASSIGN 37
|
||||
#define ZEND_ASSIGN_REF 38
|
||||
#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 39
|
||||
#define ZEND_PRINT 40
|
||||
#define ZEND_ECHO 40
|
||||
#define ZEND_PRINT 41
|
||||
|
||||
#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_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 52
|
||||
#define ZEND_ADD_CHAR 53
|
||||
#define ZEND_ADD_STRING 54
|
||||
#define ZEND_ADD_VAR 55
|
||||
#define ZEND_INIT_STRING 53
|
||||
#define ZEND_ADD_CHAR 54
|
||||
#define ZEND_ADD_STRING 55
|
||||
#define ZEND_ADD_VAR 56
|
||||
|
||||
#define ZEND_BEGIN_SILENCE 56
|
||||
#define ZEND_END_SILENCE 57
|
||||
#define ZEND_BEGIN_SILENCE 57
|
||||
#define ZEND_END_SILENCE 58
|
||||
|
||||
#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_INIT_FCALL_BY_NAME 59
|
||||
#define ZEND_DO_FCALL 60
|
||||
#define ZEND_DO_FCALL_BY_NAME 61
|
||||
#define ZEND_RETURN 62
|
||||
|
||||
#define ZEND_RECV 62
|
||||
#define ZEND_RECV_INIT 63
|
||||
#define ZEND_RECV 63
|
||||
#define ZEND_RECV_INIT 64
|
||||
|
||||
#define ZEND_SEND_VAL 64
|
||||
#define ZEND_SEND_VAR 65
|
||||
#define ZEND_SEND_REF 66
|
||||
#define ZEND_SEND_VAL 65
|
||||
#define ZEND_SEND_VAR 66
|
||||
#define ZEND_SEND_REF 67
|
||||
|
||||
#define ZEND_NEW 67
|
||||
#define ZEND_JMP_NO_CTOR 68
|
||||
#define ZEND_FREE 69
|
||||
#define ZEND_NEW 68
|
||||
#define ZEND_JMP_NO_CTOR 69
|
||||
#define ZEND_FREE 70
|
||||
|
||||
#define ZEND_INIT_ARRAY 70
|
||||
#define ZEND_ADD_ARRAY_ELEMENT 71
|
||||
#define ZEND_INIT_ARRAY 71
|
||||
#define ZEND_ADD_ARRAY_ELEMENT 72
|
||||
|
||||
#define ZEND_INCLUDE_OR_EVAL 72
|
||||
#define ZEND_INCLUDE_OR_EVAL 73
|
||||
|
||||
#define ZEND_UNSET_VAR 73
|
||||
#define ZEND_UNSET_DIM_OBJ 74
|
||||
#define ZEND_ISSET_ISEMPTY 75
|
||||
#define ZEND_UNSET_VAR 74
|
||||
#define ZEND_UNSET_DIM_OBJ 75
|
||||
#define ZEND_ISSET_ISEMPTY 76
|
||||
|
||||
#define ZEND_FE_RESET 76
|
||||
#define ZEND_FE_FETCH 77
|
||||
#define ZEND_FE_RESET 77
|
||||
#define ZEND_FE_FETCH 78
|
||||
|
||||
#define ZEND_EXIT 78
|
||||
#define ZEND_EXIT 79
|
||||
|
||||
|
||||
/* 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_UNSET 94
|
||||
#define ZEND_FETCH_DIM_UNSET 95
|
||||
#define ZEND_FETCH_OBJ_UNSET 96
|
||||
#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 97
|
||||
#define ZEND_FETCH_CONSTANT 98
|
||||
#define ZEND_FETCH_DIM_TMP_VAR 98
|
||||
#define ZEND_FETCH_CONSTANT 99
|
||||
|
||||
#define ZEND_DECLARE_FUNCTION_OR_CLASS 99
|
||||
#define ZEND_DECLARE_FUNCTION_OR_CLASS 100
|
||||
|
||||
#define ZEND_EXT_STMT 100
|
||||
#define ZEND_EXT_FCALL_BEGIN 101
|
||||
#define ZEND_EXT_FCALL_END 102
|
||||
#define ZEND_EXT_NOP 103
|
||||
#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 104
|
||||
#define ZEND_TICKS 105
|
||||
|
||||
/* end of block */
|
||||
|
||||
|
||||
@@ -66,4 +66,6 @@ typedef unsigned int uint;
|
||||
# define ZEND_API __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#define ZEND_DLEXPORT __declspec(dllexport)
|
||||
|
||||
#endif /* _ZEND_CONFIG_W32_H */
|
||||
@@ -108,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);
|
||||
|
||||
|
||||
+4
-1
@@ -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 */
|
||||
|
||||
+112
-95
@@ -54,9 +54,9 @@
|
||||
|
||||
|
||||
/* Prototypes */
|
||||
static zval get_overloaded_property(ELS_D);
|
||||
static void set_overloaded_property(zval *value ELS_DC);
|
||||
static void call_overloaded_function(int arg_count, zval *return_value ELS_DC);
|
||||
static zval get_overloaded_property(temp_variable *T ELS_DC);
|
||||
static void set_overloaded_property(temp_variable *T, zval *value ELS_DC);
|
||||
static void call_overloaded_function(temp_variable *T, int arg_count, zval *return_value ELS_DC);
|
||||
static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type ELS_DC);
|
||||
static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type ELS_DC);
|
||||
static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type ELS_DC);
|
||||
@@ -96,21 +96,21 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
|
||||
|
||||
switch (Ts[node->u.var].EA.type) {
|
||||
case IS_OVERLOADED_OBJECT:
|
||||
Ts[node->u.var].tmp_var = get_overloaded_property(ELS_C);
|
||||
Ts[node->u.var].tmp_var = get_overloaded_property(&Ts[node->u.var] ELS_CC);
|
||||
Ts[node->u.var].tmp_var.refcount=1;
|
||||
Ts[node->u.var].tmp_var.is_ref=1;
|
||||
return &Ts[node->u.var].tmp_var;
|
||||
break;
|
||||
case IS_STRING_OFFSET: {
|
||||
temp_variable *T = &Ts[node->u.var];
|
||||
zval *str = T->EA.str;
|
||||
zval *str = T->EA.data.str_offset.str;
|
||||
|
||||
if (T->EA.str->type != IS_STRING
|
||||
|| (T->EA.str->value.str.len <= T->EA.offset)) {
|
||||
if (T->EA.data.str_offset.str->type != IS_STRING
|
||||
|| (T->EA.data.str_offset.str->value.str.len <= T->EA.data.str_offset.offset)) {
|
||||
T->tmp_var.value.str.val = empty_string;
|
||||
T->tmp_var.value.str.len = 0;
|
||||
} else {
|
||||
char c = str->value.str.val[T->EA.offset];
|
||||
char c = str->value.str.val[T->EA.data.str_offset.offset];
|
||||
|
||||
T->tmp_var.value.str.val = estrndup(&c, 1);
|
||||
T->tmp_var.value.str.len = 1;
|
||||
@@ -148,7 +148,7 @@ static inline zval *_get_object_zval_ptr(znode *node, temp_variable *Ts, int *sh
|
||||
return Ts[node->u.var].var.ptr;
|
||||
} else {
|
||||
if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) {
|
||||
PZVAL_UNLOCK(Ts[node->u.var].EA.str);
|
||||
PZVAL_UNLOCK(Ts[node->u.var].EA.data.str_offset.str);
|
||||
}
|
||||
*should_free = 1;
|
||||
return NULL;
|
||||
@@ -169,7 +169,7 @@ static inline zval **_get_zval_ptr_ptr(znode *node, temp_variable *Ts ELS_DC)
|
||||
if (Ts[node->u.var].var.ptr_ptr) {
|
||||
PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr);
|
||||
} else if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) {
|
||||
PZVAL_UNLOCK(Ts[node->u.var].EA.str);
|
||||
PZVAL_UNLOCK(Ts[node->u.var].EA.data.str_offset.str);
|
||||
}
|
||||
return Ts[node->u.var].var.ptr_ptr;
|
||||
} else {
|
||||
@@ -262,7 +262,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
if (!variable_ptr_ptr) {
|
||||
switch (Ts[op1->u.var].EA.type) {
|
||||
case IS_OVERLOADED_OBJECT:
|
||||
set_overloaded_property(value ELS_CC);
|
||||
set_overloaded_property(&Ts[op1->u.var], value ELS_CC);
|
||||
if (type == IS_TMP_VAR) {
|
||||
zval_dtor(value);
|
||||
}
|
||||
@@ -270,8 +270,8 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
case IS_STRING_OFFSET: {
|
||||
temp_variable *T = &Ts[op1->u.var];
|
||||
|
||||
if (T->EA.str->type == IS_STRING
|
||||
&& (T->EA.offset < T->EA.str->value.str.len)) {
|
||||
if (T->EA.data.str_offset.str->type == IS_STRING
|
||||
&& (T->EA.data.str_offset.offset < T->EA.data.str_offset.str->value.str.len)) {
|
||||
zval tmp;
|
||||
zval *final_value = value;
|
||||
|
||||
@@ -284,7 +284,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
final_value = &tmp;
|
||||
}
|
||||
|
||||
T->EA.str->value.str.val[T->EA.offset] = final_value->value.str.val[0];
|
||||
T->EA.data.str_offset.str->value.str.val[T->EA.data.str_offset.offset] = final_value->value.str.val[0];
|
||||
if (op2
|
||||
&& op2->op_type == IS_VAR
|
||||
&& value==&Ts[op2->u.var].tmp_var) {
|
||||
@@ -295,10 +295,10 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
|
||||
}
|
||||
/*
|
||||
* the value of an assignment to a string offset is undefined
|
||||
Ts[result->u.var].var = &T->EA.str;
|
||||
Ts[result->u.var].var = &T->EA.data.str_offset.str;
|
||||
*/
|
||||
}
|
||||
/* zval_ptr_dtor(&T->EA.str); Nuke this line if it doesn't cause a leak */
|
||||
/* zval_ptr_dtor(&T->EA.data.str_offset.str); Nuke this line if it doesn't cause a leak */
|
||||
T->tmp_var.type = IS_STRING;
|
||||
}
|
||||
break;
|
||||
@@ -623,7 +623,6 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
|
||||
|
||||
if (container_ptr == NULL) {
|
||||
zend_property_reference *property_reference;
|
||||
zend_overloaded_element overloaded_element;
|
||||
|
||||
if (Ts[op1->u.var].EA.type == IS_STRING_OFFSET) {
|
||||
@@ -649,9 +648,8 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
zval_copy_ctor(&overloaded_element.element);
|
||||
}
|
||||
|
||||
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
|
||||
|
||||
zend_llist_add_element(&property_reference->elements_list, &overloaded_element);
|
||||
Ts[result->u.var].EA = Ts[op1->u.var].EA;
|
||||
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
|
||||
|
||||
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
|
||||
*retval = NULL;
|
||||
@@ -712,6 +710,9 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
*retval = &EG(uninitialized_zval_ptr);
|
||||
SELECTIVE_PZVAL_LOCK(**retval, result);
|
||||
FREE_OP(op2, free_op2);
|
||||
if (type==BP_VAR_W || type==BP_VAR_RW) {
|
||||
zend_error(E_WARNING, "Cannot use a NULL value as an array");
|
||||
}
|
||||
break;
|
||||
case IS_STRING: {
|
||||
zval *offset;
|
||||
@@ -733,9 +734,9 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
|
||||
}
|
||||
container = *container_ptr;
|
||||
Ts[result->u.var].EA.str = container;
|
||||
Ts[result->u.var].EA.data.str_offset.str = container;
|
||||
PZVAL_LOCK(container);
|
||||
Ts[result->u.var].EA.offset = offset->value.lval;
|
||||
Ts[result->u.var].EA.data.str_offset.offset = offset->value.lval;
|
||||
Ts[result->u.var].EA.type = IS_STRING_OFFSET;
|
||||
FREE_OP(op2, free_op2);
|
||||
*retval = NULL;
|
||||
@@ -753,6 +754,9 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
}
|
||||
FREE_OP(op2, free_op2);
|
||||
SELECTIVE_PZVAL_LOCK(**retval, result);
|
||||
if (type==BP_VAR_W || type==BP_VAR_RW) {
|
||||
zend_error(E_WARNING, "Cannot use a scalar value as an array");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -784,11 +788,10 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
|
||||
|
||||
|
||||
if (container_ptr == NULL) {
|
||||
zend_property_reference *property_reference;
|
||||
zend_overloaded_element overloaded_element;
|
||||
|
||||
if (Ts[op1->u.var].EA.type == IS_STRING_OFFSET) {
|
||||
zval_ptr_dtor(&Ts[op1->u.var].EA.str);
|
||||
zval_ptr_dtor(&Ts[op1->u.var].EA.data.str_offset.str);
|
||||
switch (type) {
|
||||
case BP_VAR_R:
|
||||
case BP_VAR_IS:
|
||||
@@ -810,9 +813,8 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
|
||||
zval_copy_ctor(&overloaded_element.element);
|
||||
}
|
||||
|
||||
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
|
||||
|
||||
zend_llist_add_element(&property_reference->elements_list, &overloaded_element);
|
||||
Ts[result->u.var].EA = Ts[op1->u.var].EA;
|
||||
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
|
||||
|
||||
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
|
||||
*retval = NULL;
|
||||
@@ -828,27 +830,27 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
|
||||
|
||||
if (container->type == IS_OBJECT
|
||||
&& container->value.obj.ce->handle_property_get) {
|
||||
zend_property_reference property_reference;
|
||||
zend_overloaded_element overloaded_element;
|
||||
|
||||
property_reference.object = container;
|
||||
property_reference.type = type;
|
||||
zend_llist_init(&property_reference.elements_list, sizeof(zend_overloaded_element), NULL, 0);
|
||||
Ts[result->u.var].EA.data.overloaded_element.object = container;
|
||||
Ts[result->u.var].EA.data.overloaded_element.type = type;
|
||||
Ts[result->u.var].EA.data.overloaded_element.elements_list = (zend_llist *) emalloc(sizeof(zend_llist));
|
||||
zend_llist_init(Ts[result->u.var].EA.data.overloaded_element.elements_list, sizeof(zend_overloaded_element), NULL, 0);
|
||||
overloaded_element.element = *get_zval_ptr(op2, Ts, &free_op2, type);
|
||||
overloaded_element.type = OE_IS_OBJECT;
|
||||
if (!free_op2) {
|
||||
zval_copy_ctor(&overloaded_element.element);
|
||||
}
|
||||
zend_llist_add_element(&property_reference.elements_list, &overloaded_element);
|
||||
zend_stack_push(&EG(overloaded_objects_stack), &property_reference, sizeof(zend_property_reference));
|
||||
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
|
||||
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
|
||||
*retval = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (container->type == IS_STRING && container->value.str.len==0) {
|
||||
if (container->type==IS_NULL
|
||||
|| (container->type==IS_BOOL && container->value.lval==0)
|
||||
|| (container->type==IS_STRING && container->value.str.len==0)) {
|
||||
switch (type) {
|
||||
case BP_VAR_RW:
|
||||
case BP_VAR_W:
|
||||
@@ -895,43 +897,31 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
|
||||
}
|
||||
|
||||
|
||||
static zval get_overloaded_property(ELS_D)
|
||||
static zval get_overloaded_property(temp_variable *T ELS_DC)
|
||||
{
|
||||
zend_property_reference *property_reference;
|
||||
zval result;
|
||||
|
||||
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
|
||||
result = (property_reference->object)->value.obj.ce->handle_property_get(property_reference);
|
||||
result = (T->EA.data.overloaded_element.object)->value.obj.ce->handle_property_get(&T->EA.data.overloaded_element);
|
||||
|
||||
zend_llist_destroy(&property_reference->elements_list);
|
||||
|
||||
zend_stack_del_top(&EG(overloaded_objects_stack));
|
||||
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
|
||||
efree(T->EA.data.overloaded_element.elements_list);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static void set_overloaded_property(zval *value ELS_DC)
|
||||
static void set_overloaded_property(temp_variable *T, zval *value ELS_DC)
|
||||
{
|
||||
zend_property_reference *property_reference;
|
||||
|
||||
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
|
||||
(property_reference->object)->value.obj.ce->handle_property_set(property_reference, value);
|
||||
|
||||
zend_llist_destroy(&property_reference->elements_list);
|
||||
|
||||
zend_stack_del_top(&EG(overloaded_objects_stack));
|
||||
(T->EA.data.overloaded_element.object)->value.obj.ce->handle_property_set(&T->EA.data.overloaded_element, value);
|
||||
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
|
||||
efree(T->EA.data.overloaded_element.elements_list);
|
||||
}
|
||||
|
||||
|
||||
static void call_overloaded_function(int arg_count, zval *return_value ELS_DC)
|
||||
static void call_overloaded_function(temp_variable *T, int arg_count, zval *return_value ELS_DC)
|
||||
{
|
||||
zend_property_reference *property_reference;
|
||||
|
||||
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
|
||||
(property_reference->object)->value.obj.ce->handle_function_call(arg_count, return_value, property_reference->object, 1 ELS_CC, property_reference);
|
||||
zend_llist_destroy(&property_reference->elements_list);
|
||||
|
||||
zend_stack_del_top(&EG(overloaded_objects_stack));
|
||||
(T->EA.data.overloaded_element.object)->value.obj.ce->handle_function_call(arg_count, return_value, T->EA.data.overloaded_element.object, 1 ELS_CC, &T->EA.data.overloaded_element);
|
||||
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
|
||||
efree(T->EA.data.overloaded_element.elements_list);
|
||||
}
|
||||
|
||||
|
||||
@@ -1051,6 +1041,9 @@ void execute(zend_op_array *op_array ELS_DC)
|
||||
case ZEND_IS_IDENTICAL:
|
||||
EG(binary_op) = is_identical_function;
|
||||
goto binary_op_addr;
|
||||
case ZEND_IS_NOT_IDENTICAL:
|
||||
EG(binary_op) = is_not_identical_function;
|
||||
goto binary_op_addr;
|
||||
case ZEND_IS_EQUAL:
|
||||
EG(binary_op) = is_equal_function;
|
||||
goto binary_op_addr;
|
||||
@@ -1367,18 +1360,18 @@ binary_assign_op_addr: {
|
||||
}
|
||||
NEXT_OPCODE();
|
||||
case ZEND_JMPZNZ: {
|
||||
znode *res = &opline->result;
|
||||
znode *res = &opline->op1;
|
||||
|
||||
if (!zend_is_true(get_zval_ptr(res, Ts, &EG(free_op1), BP_VAR_R))) {
|
||||
if (zend_is_true(get_zval_ptr(res, Ts, &EG(free_op1), BP_VAR_R))) {
|
||||
#if DEBUG_ZEND>=2
|
||||
printf("Conditional jmp on true to %d\n", opline->extended_value);
|
||||
#endif
|
||||
opline = &op_array->opcodes[opline->extended_value];
|
||||
} else {
|
||||
#if DEBUG_ZEND>=2
|
||||
printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num);
|
||||
#endif
|
||||
opline = &op_array->opcodes[opline->op2.u.opline_num];
|
||||
} else {
|
||||
#if DEBUG_ZEND>=2
|
||||
printf("Conditional jmp on true to %d\n", opline->op1.u.opline_num);
|
||||
#endif
|
||||
opline = &op_array->opcodes[opline->op1.u.opline_num];
|
||||
}
|
||||
FREE_OP(res, EG(free_op1));
|
||||
}
|
||||
@@ -1515,31 +1508,28 @@ binary_assign_op_addr: {
|
||||
if ((!object.ptr && Ts[opline->op1.u.var].EA.type==IS_OVERLOADED_OBJECT)
|
||||
|| ((object.ptr && object.ptr->type==IS_OBJECT) && (object.ptr->value.obj.ce->handle_function_call))) { /* overloaded function call */
|
||||
zend_overloaded_element overloaded_element;
|
||||
zend_property_reference *property_reference;
|
||||
|
||||
overloaded_element.element = *function_name;
|
||||
overloaded_element.type = OE_IS_METHOD;
|
||||
|
||||
if (object.ptr) {
|
||||
zend_property_reference property_reference;
|
||||
|
||||
property_reference.object = object.ptr;
|
||||
property_reference.type = BP_VAR_NA;
|
||||
zend_llist_init(&property_reference.elements_list, sizeof(zend_overloaded_element), NULL, 0);
|
||||
zend_stack_push(&EG(overloaded_objects_stack), &property_reference, sizeof(zend_property_reference));
|
||||
Ts[opline->op1.u.var].EA.data.overloaded_element.object = object.ptr;
|
||||
Ts[opline->op1.u.var].EA.data.overloaded_element.type = BP_VAR_NA;
|
||||
Ts[opline->op1.u.var].EA.data.overloaded_element.elements_list = (zend_llist *) emalloc(sizeof(zend_llist));
|
||||
zend_llist_init(Ts[opline->op1.u.var].EA.data.overloaded_element.elements_list, sizeof(zend_overloaded_element), NULL, 0);
|
||||
}
|
||||
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
|
||||
zend_llist_add_element(&property_reference->elements_list, &overloaded_element);
|
||||
zend_llist_add_element(Ts[opline->op1.u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
|
||||
fbc = (zend_function *) emalloc(sizeof(zend_function));
|
||||
fbc->type = ZEND_OVERLOADED_FUNCTION;
|
||||
fbc->common.arg_types = NULL;
|
||||
fbc->overloaded_function.var = opline->op1.u.var;
|
||||
goto overloaded_function_call_cont;
|
||||
}
|
||||
|
||||
if (!object.ptr || object.ptr->type != IS_OBJECT) {
|
||||
zend_error(E_ERROR, "Call to a member function on a non-object");
|
||||
}
|
||||
object.ptr->refcount++; /* For this pointer */
|
||||
object.ptr->refcount++; /* For $this pointer */
|
||||
active_function_table = &(object.ptr->value.obj.ce->function_table);
|
||||
}
|
||||
} else { /* function pointer */
|
||||
@@ -1643,7 +1633,7 @@ do_fcall_common:
|
||||
} else { /* ZEND_OVERLOADED_FUNCTION */
|
||||
ALLOC_ZVAL(Ts[opline->result.u.var].var.ptr);
|
||||
INIT_ZVAL(*(Ts[opline->result.u.var].var.ptr));
|
||||
call_overloaded_function(opline->extended_value, Ts[opline->result.u.var].var.ptr ELS_CC);
|
||||
call_overloaded_function(&Ts[fbc->overloaded_function.var], opline->extended_value, Ts[opline->result.u.var].var.ptr ELS_CC);
|
||||
efree(fbc);
|
||||
if (!return_value_used) {
|
||||
zval_ptr_dtor(&Ts[opline->result.u.var].var.ptr);
|
||||
@@ -1884,7 +1874,7 @@ send_by_ref:
|
||||
} else {
|
||||
switch_expr_is_overloaded = 1;
|
||||
if (Ts[opline->op1.u.var].EA.type==IS_STRING_OFFSET) {
|
||||
Ts[opline->op1.u.var].EA.str->refcount++;
|
||||
Ts[opline->op1.u.var].EA.data.str_offset.str->refcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2012,7 +2002,7 @@ send_by_ref:
|
||||
if (!EG(free_op1)) {
|
||||
zendi_zval_copy_ctor(*result);
|
||||
}
|
||||
switch (opline->op2.u.constant.type) {
|
||||
switch (opline->extended_value) {
|
||||
case IS_NULL:
|
||||
convert_to_null(result);
|
||||
break;
|
||||
@@ -2041,38 +2031,65 @@ send_by_ref:
|
||||
zend_op_array *new_op_array=NULL;
|
||||
zval **original_return_value = EG(return_value_ptr_ptr);
|
||||
int return_value_used;
|
||||
zval *inc_filename = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
zval tmp_inc_filename;
|
||||
CLS_FETCH();
|
||||
|
||||
if (inc_filename->type!=IS_STRING) {
|
||||
tmp_inc_filename = *inc_filename;
|
||||
zval_copy_ctor(&tmp_inc_filename);
|
||||
convert_to_string(&tmp_inc_filename);
|
||||
inc_filename = &tmp_inc_filename;
|
||||
}
|
||||
|
||||
return_value_used = RETURN_VALUE_USED(opline);
|
||||
|
||||
switch (opline->op2.u.constant.value.lval) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
{
|
||||
FILE *inc_file;
|
||||
case ZEND_INCLUDE_ONCE: {
|
||||
char *opened_path;
|
||||
int dummy = 0;
|
||||
int dummy = 1;
|
||||
zend_file_handle file_handle;
|
||||
|
||||
inc_file = zend_fopen(opline->op1.u.constant.value.str.val, &opened_path);
|
||||
file_handle.handle.fp = zend_fopen(inc_filename->value.str.val, &opened_path);
|
||||
file_handle.type = ZEND_HANDLE_FP;
|
||||
file_handle.filename = inc_filename->value.str.val;
|
||||
file_handle.free_filename = 0;
|
||||
|
||||
if (inc_file && opened_path) {
|
||||
if (zend_hash_add(&EG(included_files), opened_path, strlen(opened_path)+1, (void *)&dummy, sizeof(int), NULL)==FAILURE) {
|
||||
fclose(inc_file);
|
||||
if (file_handle.handle.fp) {
|
||||
if (!opened_path || zend_hash_add(&EG(included_files), opened_path, strlen(opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) {
|
||||
new_op_array = zend_compile_files(ZEND_INCLUDE CLS_CC, 1, &file_handle);
|
||||
if (new_op_array) {
|
||||
pass_include_eval(new_op_array);
|
||||
} else {
|
||||
fclose(file_handle.handle.fp);
|
||||
}
|
||||
} else {
|
||||
fclose(file_handle.handle.fp);
|
||||
}
|
||||
if (opened_path) {
|
||||
free(opened_path);
|
||||
break;
|
||||
}
|
||||
fclose(inc_file);
|
||||
free(opened_path);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ZEND_INCLUDE:
|
||||
case ZEND_REQUIRE:
|
||||
new_op_array = compile_filename(opline->op2.u.constant.value.lval, get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R) CLS_CC ELS_CC);
|
||||
{
|
||||
new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename CLS_CC ELS_CC);
|
||||
if (new_op_array) {
|
||||
pass_include_eval(new_op_array);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ZEND_EVAL:
|
||||
new_op_array = compile_string(get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R) CLS_CC);
|
||||
new_op_array = compile_string(inc_filename CLS_CC);
|
||||
break;
|
||||
EMPTY_SWITCH_DEFAULT_CASE()
|
||||
}
|
||||
if (inc_filename==&tmp_inc_filename) {
|
||||
zval_dtor(&tmp_inc_filename);
|
||||
}
|
||||
FREE_OP(&opline->op1, EG(free_op1));
|
||||
Ts[opline->result.u.var].var.ptr = NULL;
|
||||
Ts[opline->result.u.var].var.ptr_ptr = &Ts[opline->result.u.var].var.ptr;
|
||||
@@ -2255,8 +2272,8 @@ send_by_ref:
|
||||
|
||||
if (!var) {
|
||||
if (Ts[opline->op1.u.var].EA.type==IS_STRING_OFFSET) {
|
||||
if (Ts[opline->op1.u.var].EA.offset>=0
|
||||
&& Ts[opline->op1.u.var].EA.offset<Ts[opline->op1.u.var].EA.str->value.str.len) {
|
||||
if (Ts[opline->op1.u.var].EA.data.str_offset.offset>=0
|
||||
&& Ts[opline->op1.u.var].EA.data.str_offset.offset<Ts[opline->op1.u.var].EA.data.str_offset.str->value.str.len) {
|
||||
isset = 1;
|
||||
} else {
|
||||
isset = 0;
|
||||
@@ -2278,7 +2295,7 @@ send_by_ref:
|
||||
case ZEND_ISEMPTY:
|
||||
if (!var) {
|
||||
if (!isset
|
||||
|| Ts[opline->op1.u.var].EA.str->value.str.val[Ts[opline->op1.u.var].EA.offset]=='0') {
|
||||
|| Ts[opline->op1.u.var].EA.data.str_offset.str->value.str.val[Ts[opline->op1.u.var].EA.data.str_offset.offset]=='0') {
|
||||
Ts[opline->result.u.var].tmp_var.value.lval = 1;
|
||||
} else {
|
||||
Ts[opline->result.u.var].tmp_var.value.lval = 0;
|
||||
|
||||
+9
-3
@@ -33,8 +33,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;
|
||||
@@ -47,7 +53,7 @@ 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_ptr CLS_DC ELS_DC);
|
||||
ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC);
|
||||
ZEND_API inline int i_zend_is_true(zval *op);
|
||||
ZEND_API int zval_update_constant(zval **pp);
|
||||
ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC);
|
||||
|
||||
+26
-8
@@ -85,7 +85,6 @@ void init_executor(CLS_D ELS_DC)
|
||||
EG(uninitialized_zval_ptr)=&EG(uninitialized_zval);
|
||||
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&&ZEND_DEBUG
|
||||
original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv);
|
||||
@@ -116,14 +115,19 @@ void init_executor(CLS_D ELS_DC)
|
||||
zend_hash_init(&EG(included_files), 5, NULL, NULL, 0);
|
||||
|
||||
EG(ticks_count) = 0;
|
||||
|
||||
EG(user_error_handler) = NULL;
|
||||
}
|
||||
|
||||
|
||||
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));
|
||||
@@ -140,7 +144,7 @@ void shutdown_executor(ELS_D)
|
||||
}
|
||||
}
|
||||
|
||||
destroy_resource_list(ELS_C); /* must be destroyed after the main symbol table is destroyed */
|
||||
zend_destroy_rsrc_list(ELS_C); /* must be destroyed after the main symbol table is destroyed */
|
||||
|
||||
zend_ptr_stack_destroy(&EG(argument_stack));
|
||||
if (EG(main_op_array)) {
|
||||
@@ -152,8 +156,12 @@ void shutdown_executor(ELS_D)
|
||||
signal(SIGSEGV, original_sigsegv_handler);
|
||||
#endif
|
||||
|
||||
|
||||
zend_hash_destroy(&EG(included_files));
|
||||
|
||||
if (EG(user_error_handler)) {
|
||||
zval_dtor(EG(user_error_handler));
|
||||
FREE_ZVAL(EG(user_error_handler));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +292,12 @@ ZEND_API int zval_update_constant(zval **pp)
|
||||
|
||||
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'",
|
||||
@@ -298,6 +311,8 @@ ZEND_API int zval_update_constant(zval **pp)
|
||||
INIT_PZVAL(p);
|
||||
p->refcount = refcount;
|
||||
} else if (p->type == IS_ARRAY) {
|
||||
SEPARATE_ZVAL(pp);
|
||||
p = *pp;
|
||||
zend_hash_apply(p->value.ht, (int (*)(void *)) zval_update_constant);
|
||||
}
|
||||
return 0;
|
||||
@@ -423,13 +438,14 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_eval_string(char *str, zval *retval_ptr 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_ptr) {
|
||||
pv.value.str.len = strlen(str)+sizeof("return ;")-1;
|
||||
@@ -480,10 +496,12 @@ ZEND_API void zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC)
|
||||
destroy_op_array(new_op_array);
|
||||
efree(new_op_array);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+54
-10
@@ -44,7 +44,7 @@ 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);
|
||||
@@ -100,27 +100,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 +145,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 +163,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;
|
||||
}
|
||||
|
||||
+12
-5
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "zend_compile.h"
|
||||
|
||||
#define ZEND_EXTENSION_API_NO 20000306
|
||||
#define ZEND_EXTENSION_API_NO 20000521
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
@@ -47,14 +47,16 @@ struct _zend_extension {
|
||||
void (*activate)();
|
||||
void (*deactivate)();
|
||||
|
||||
void (*message_handler)(int message, void *arg);
|
||||
|
||||
void (*op_array_handler)(zend_op_array *op_array);
|
||||
|
||||
void (*statement_handler)(zend_op_array *op_array);
|
||||
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
|
||||
@@ -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 */
|
||||
+2
-1
@@ -131,7 +131,6 @@ 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;
|
||||
@@ -180,6 +179,8 @@ struct _zend_executor_globals {
|
||||
zval *garbage[4];
|
||||
int garbage_ptr;
|
||||
|
||||
zval *user_error_handler;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
#if SUPPORT_INTERACTIVE
|
||||
int interactive;
|
||||
|
||||
+4
-1
@@ -946,7 +946,7 @@ ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos)
|
||||
|
||||
|
||||
/* This function should be made binary safe */
|
||||
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *num_index, HashPosition *pos)
|
||||
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *str_length, ulong *num_index, HashPosition *pos)
|
||||
{
|
||||
Bucket *p;
|
||||
|
||||
@@ -958,6 +958,9 @@ ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong
|
||||
if (p->nKeyLength) {
|
||||
*str_index = (char *) pemalloc(p->nKeyLength, ht->persistent);
|
||||
memcpy(*str_index, p->arKey, p->nKeyLength);
|
||||
if (str_length) {
|
||||
*str_length = p->nKeyLength;
|
||||
}
|
||||
return HASH_KEY_IS_STRING;
|
||||
} else {
|
||||
*num_index = p->h;
|
||||
|
||||
+9
-2
@@ -141,7 +141,7 @@ ZEND_API ulong zend_hash_next_free_element(HashTable *ht);
|
||||
/* traversing */
|
||||
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 *num_index, 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);
|
||||
@@ -152,7 +152,7 @@ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos
|
||||
#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, num_index, NULL)
|
||||
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) \
|
||||
@@ -182,4 +182,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_ */
|
||||
@@ -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++);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,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;
|
||||
@@ -136,10 +136,10 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
|
||||
}
|
||||
switch (token_type) {
|
||||
case T_END_HEREDOC:
|
||||
html_puts(token.value.str.val, token.value.str.len);
|
||||
zend_html_puts(token.value.str.val, token.value.str.len);
|
||||
break;
|
||||
default:
|
||||
html_puts(zendtext, zendleng);
|
||||
zend_html_puts(zendtext, zendleng);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
+133
-24
@@ -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();
|
||||
@@ -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;
|
||||
@@ -206,12 +241,22 @@ ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resou
|
||||
|
||||
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);
|
||||
@@ -221,12 +266,12 @@ void list_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);
|
||||
@@ -234,31 +279,31 @@ void plist_entry_destructor(void *ptr)
|
||||
}
|
||||
|
||||
|
||||
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(ELS_D)
|
||||
void zend_destroy_rsrc_list(ELS_D)
|
||||
{
|
||||
zend_hash_graceful_destroy(&EG(regular_list));
|
||||
}
|
||||
|
||||
|
||||
void destroy_resource_plist(ELS_D)
|
||||
void zend_destroy_rsrc_plist(ELS_D)
|
||||
{
|
||||
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;
|
||||
@@ -268,11 +313,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 {
|
||||
@@ -281,6 +327,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
|
||||
|
||||
+31
-14
@@ -24,23 +24,37 @@
|
||||
#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
|
||||
@@ -49,17 +63,20 @@ enum list_entry_type {
|
||||
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(ELS_D);
|
||||
void destroy_resource_plist(ELS_D);
|
||||
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);
|
||||
|
||||
|
||||
+15
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,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;
|
||||
|
||||
+5
-1
@@ -38,7 +38,10 @@ 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 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 zend_llist_element* zend_llist_position;
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
@@ -52,6 +55,7 @@ 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_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);
|
||||
|
||||
|
||||
+3
-2
@@ -37,7 +37,7 @@ extern unsigned char second_arg_allow_ref[];
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#define ZEND_MODULE_API_NO 20000313
|
||||
#define ZEND_MODULE_API_NO 20000401
|
||||
|
||||
#ifdef ZTS
|
||||
#define USING_ZTS 1
|
||||
@@ -45,7 +45,7 @@ extern unsigned char second_arg_allow_ref[];
|
||||
#define USING_ZTS 0
|
||||
#endif
|
||||
|
||||
#define STANDARD_MODULE_PROPERTIES_EX 0, 0, NULL, 0, ZEND_DEBUG, USING_ZTS, ZEND_MODULE_API_NO
|
||||
#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
|
||||
@@ -65,6 +65,7 @@ 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;
|
||||
|
||||
+16
-20
@@ -30,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,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();
|
||||
@@ -98,6 +90,7 @@ 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);
|
||||
}
|
||||
@@ -185,22 +178,21 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
|
||||
if (op_array->brk_cont_array) {
|
||||
efree(op_array->brk_cont_array);
|
||||
}
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_dtor_handler, op_array);
|
||||
if (op_array->done_pass_two) {
|
||||
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(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)
|
||||
@@ -300,11 +292,12 @@ 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;
|
||||
|
||||
@@ -384,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;
|
||||
|
||||
+132
-32
@@ -32,6 +32,18 @@
|
||||
#include "zend_list.h"
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
#ifndef HAVE_FINITE
|
||||
#ifndef finite /* in case it's already a macro */
|
||||
#define finite(a) isfinite(a) /* HPUX 11 only has isfinite() */
|
||||
#endif
|
||||
#else
|
||||
#if HAVE_IEEEFP_H
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define NORMALIZE_BOOL(n) \
|
||||
((n) ? (((n)>0) ? 1 : -1) : 0)
|
||||
|
||||
#if WITH_BCMATH
|
||||
#include "ext/bcmath/number.h"
|
||||
@@ -313,7 +325,7 @@ 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;
|
||||
@@ -328,34 +340,40 @@ ZEND_API void convert_to_string(zval *op)
|
||||
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:
|
||||
@@ -727,7 +745,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;
|
||||
@@ -738,11 +757,16 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2)
|
||||
}
|
||||
|
||||
result->type = IS_STRING;
|
||||
result->value.str.len = longer->value.str.len;
|
||||
result->value.str.val = estrndup(longer->value.str.val, longer->value.str.len);
|
||||
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);
|
||||
@@ -760,7 +784,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;
|
||||
@@ -771,11 +796,16 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2)
|
||||
}
|
||||
|
||||
result->type = IS_STRING;
|
||||
result->value.str.len = shorter->value.str.len;
|
||||
result->value.str.val = estrndup(shorter->value.str.val, shorter->value.str.len);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -795,7 +825,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;
|
||||
@@ -806,11 +837,16 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2)
|
||||
}
|
||||
|
||||
result->type = IS_STRING;
|
||||
result->value.str.len = shorter->value.str.len;
|
||||
result->value.str.val = estrndup(shorter->value.str.val, shorter->value.str.len);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -853,7 +889,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;
|
||||
@@ -918,6 +954,52 @@ 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 = 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;
|
||||
@@ -932,7 +1014,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
|
||||
zendi_convert_to_boolean(op1, op1_copy, result);
|
||||
zendi_convert_to_boolean(op2, op2_copy, result);
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = op1->value.lval - op2->value.lval;
|
||||
result->value.lval = NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -941,13 +1023,14 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
|
||||
|
||||
if (op1->type == IS_LONG && op2->type == IS_LONG) {
|
||||
result->type = IS_LONG;
|
||||
result->value.lval = op1->value.lval - op2->value.lval;
|
||||
result->value.lval = 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 = NORMALIZE_BOOL(result->value.dval);
|
||||
result->type = IS_LONG;
|
||||
return SUCCESS;
|
||||
}
|
||||
if ((op1->type==IS_ARRAY || op1->type==IS_OBJECT)
|
||||
@@ -999,6 +1082,18 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
@@ -1035,6 +1130,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 {
|
||||
@@ -1043,7 +1139,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 {
|
||||
@@ -1062,6 +1158,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 {
|
||||
@@ -1070,7 +1167,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 {
|
||||
@@ -1258,21 +1355,20 @@ ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint
|
||||
|
||||
ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2)
|
||||
{
|
||||
unsigned char c1 = 0, c2 = 0;
|
||||
int len;
|
||||
int c1,c2;
|
||||
|
||||
if (len1 != len2 || !len1) {
|
||||
return len1 - len2;
|
||||
}
|
||||
len = MIN(len1, len2);
|
||||
|
||||
while (len1--) {
|
||||
while (len--) {
|
||||
c1 = tolower(*s1++);
|
||||
c2 = tolower(*s2++);
|
||||
if (c1 != c2) {
|
||||
break;
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
|
||||
return c1 - c2;
|
||||
return len1 - len2;
|
||||
}
|
||||
|
||||
|
||||
@@ -1311,6 +1407,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
str2num(&first,s1->value.str.val,100); /* this scale should do */
|
||||
str2num(&second,s2->value.str.val,100); /* ditto */
|
||||
result->value.lval = bc_compare(first,second);
|
||||
result->value.lval = NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
free_num(&first);
|
||||
free_num(&second);
|
||||
@@ -1323,13 +1420,16 @@ 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 = NORMALIZE_BOOL(result->value.dval);
|
||||
result->type = IS_LONG;
|
||||
} else { /* they both have to be long's */
|
||||
result->value.lval = lval1 - lval2;
|
||||
result->value.lval = NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
}
|
||||
} else {
|
||||
result->value.lval = zend_binary_zval_strcmp(s1, s2);
|
||||
result->value.lval = NORMALIZE_BOOL(result->value.lval);
|
||||
result->type = IS_LONG;
|
||||
}
|
||||
return;
|
||||
|
||||
+46
-1
@@ -43,6 +43,7 @@ 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);
|
||||
@@ -53,7 +54,7 @@ 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);
|
||||
@@ -63,16 +64,20 @@ 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);
|
||||
#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC)
|
||||
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_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);
|
||||
@@ -85,6 +90,13 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
|
||||
convert_to_##lower_type(*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_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)
|
||||
@@ -93,6 +105,15 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
|
||||
#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_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_scalar_to_number_ex(ppzv) \
|
||||
if ((*ppzv)->type!=IS_LONG && (*ppzv)->type!=IS_DOUBLE) { \
|
||||
if (!(*ppzv)->is_ref) { \
|
||||
@@ -101,4 +122,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
|
||||
+2
-2
@@ -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;
|
||||
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
@@ -89,7 +89,7 @@ ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
}
|
||||
|
||||
|
||||
void zval_del_ref(zval **p)
|
||||
ZEND_API void zval_del_ref(zval **p)
|
||||
{
|
||||
(*p)->refcount--;
|
||||
if ((*p)->refcount==0) {
|
||||
@@ -99,7 +99,7 @@ void zval_del_ref(zval **p)
|
||||
}
|
||||
|
||||
|
||||
void zval_add_ref(zval **p)
|
||||
ZEND_API void zval_add_ref(zval **p)
|
||||
{
|
||||
(*p)->refcount++;
|
||||
}
|
||||
@@ -115,6 +115,7 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
|
||||
case IS_LONG:
|
||||
case IS_NULL:
|
||||
break;
|
||||
case IS_CONSTANT:
|
||||
case IS_STRING:
|
||||
if (zvalue->value.str.val) {
|
||||
if (zvalue->value.str.len==0) {
|
||||
|
||||
@@ -48,8 +48,8 @@ ZEND_API void _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 ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper
|
||||
#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
/* Set to the path to the dir containing safe mode executables */
|
||||
#define PHP_SAFE_MODE_EXEC_DIR /usr/local/php/bin
|
||||
|
||||
/* Define if PHP to setup it's own SIGCHLD handler */
|
||||
#define PHP_SIGCHILD 0
|
||||
|
||||
/* Define if you want POST/GET/Cookie track variables by default */
|
||||
#define PHP_TRACK_VARS 0
|
||||
|
||||
|
||||
+228
-32
@@ -2,6 +2,147 @@ dnl $Id$
|
||||
dnl
|
||||
dnl This file contains local autoconf functions.
|
||||
|
||||
sinclude(dynlib.m4)
|
||||
|
||||
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"; 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,"
|
||||
])
|
||||
@@ -23,27 +164,28 @@ EOF
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_TIME_R_TYPE,[
|
||||
AC_CACHE_CHECK(for time_r type, ac_cv_time_r_type,[
|
||||
AC_CACHE_CHECK(for *time_r type, 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;
|
||||
int r, s;
|
||||
|
||||
gmtime_r(&old, &t);
|
||||
s = gmtime_r(&old, &t);
|
||||
r = (int) asctime_r(&t, buf, 26);
|
||||
if (r == -1 || (r > 0 && r <= 26)) exit(0);
|
||||
if (r == s && s == 0) exit(0);
|
||||
exit(1);
|
||||
}
|
||||
],[
|
||||
ac_cv_time_r_type=hpux
|
||||
],[
|
||||
ac_cv_time_r_type=normal
|
||||
ac_cv_time_r_type=SUSV2
|
||||
],[
|
||||
ac_cv_time_r_type=normal
|
||||
ac_cv_time_r_type=SUSV2
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_time_r_type" = "hpux"; then
|
||||
@@ -186,6 +328,9 @@ dnl PHP_BUILD_THREAD_SAFE
|
||||
dnl
|
||||
AC_DEFUN(PHP_BUILD_THREAD_SAFE,[
|
||||
enable_experimental_zts=yes
|
||||
if test "$pthreads_working" != "yes"; then
|
||||
AC_MSG_ERROR(ZTS currently requires working POSIX threads. Your system does not support this.)
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -232,7 +377,9 @@ 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
|
||||
@@ -260,14 +407,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
|
||||
])
|
||||
|
||||
@@ -292,7 +439,9 @@ dnl add a library to the link line
|
||||
dnl
|
||||
AC_DEFUN(AC_ADD_LIBRARY,[
|
||||
AC_PHP_ONCE(LIBRARY, $1, [
|
||||
ifelse($#, 1, LIBS="-l$1 $LIBS", LIBS="$LIBS -l$1")
|
||||
if test "$1" != "c"; then
|
||||
ifelse($#, 1, LIBS="-l$1 $LIBS", LIBS="$LIBS -l$1")
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
@@ -307,13 +456,32 @@ AC_DEFUN(AC_ADD_LIBRARY_DEFER,[
|
||||
])
|
||||
|
||||
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
|
||||
if test -n "$2"; then
|
||||
$3="-R$2 -L$2 -l$1 [$]$3"
|
||||
else
|
||||
$3="-l$1 [$]$3"
|
||||
fi
|
||||
else
|
||||
if test -n "$2"; then
|
||||
AC_ADD_LIBPATH($2)
|
||||
fi
|
||||
AC_ADD_LIBRARY($1)
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -418,21 +586,30 @@ 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 "$abs_srcdir/ext/$1" ; then
|
||||
ext_src_base="$abs_srcdir/ext/$1/"
|
||||
ext_base="ext/$1/"
|
||||
EXT_SUBDIRS="$EXT_SUBDIRS $1"
|
||||
if test "$2" != "shared" && test "$2" != "yes" && test -z "$php_always_shared"; then
|
||||
_extlib="lib$1.a"
|
||||
EXT_LTLIBS="$EXT_LTLIBS ext/$1/lib$1.la"
|
||||
EXT_LIBS="$EXT_LIBS $1/$_extlib"
|
||||
EXT_STATIC="$EXT_STATIC $1"
|
||||
else
|
||||
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
|
||||
EXT_SHARED="$EXT_SHARED $1"
|
||||
fi
|
||||
PHP_FAST_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)
|
||||
])
|
||||
|
||||
PHP_SUBST(EXT_SUBDIRS)
|
||||
@@ -572,3 +749,22 @@ AC_DEFUN(PHP_DECLARED_TIMEZONE,[
|
||||
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,, [Define if system uses EBCDIC])
|
||||
fi
|
||||
])
|
||||
|
||||
+7
-7
@@ -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@"
|
||||
+3
-10
@@ -39,14 +39,7 @@ acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
|
||||
targets = $(TOUCH_FILES) $(makefile_in_files) configure $(config_h_in)
|
||||
|
||||
|
||||
all: .deps Zend/Makefile.am TSRM/Makefile.am $(targets)
|
||||
|
||||
.deps:
|
||||
@echo creating empty dependencies
|
||||
for i in `find ext sapi regex -type d \! -name \*CVS`; do \
|
||||
list="$$list $$i/.deps"; \
|
||||
done; \
|
||||
touch $$list pear/.deps $@
|
||||
all: Zend/Makefile.am TSRM/Makefile.am $(targets)
|
||||
|
||||
Zend/Makefile.am:
|
||||
test -d Zend || (test -d ../Zend && ln -s ../Zend Zend)
|
||||
@@ -59,7 +52,7 @@ acconfig.h: $(acconfig_h_SOURCES)
|
||||
cat $(acconfig_h_SOURCES) > $@
|
||||
|
||||
$(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_files)
|
||||
@echo rebuilding Makefile.in\'s
|
||||
@echo rebuilding Makefile templates
|
||||
@for i in $(LT_TARGETS); do \
|
||||
if test -f "$$i"; then \
|
||||
mv $$i $$i.bak; \
|
||||
@@ -71,7 +64,7 @@ $(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_f
|
||||
|| true >&2
|
||||
@for i in $(LT_TARGETS); do mv $$i.bak $$i; done
|
||||
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
aclocal.m4: configure.in acinclude.m4 dynlib.m4
|
||||
aclocal
|
||||
|
||||
$(config_h_in): configure acconfig.h
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
all: all-recursive
|
||||
|
||||
include $(builddir)/libs.mk
|
||||
|
||||
include $(top_srcdir)/build/rules.mk
|
||||
+22
-12
@@ -23,29 +23,39 @@
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id: fastgen.sh,v 1.2 2000-01-01 20:48:42 sas Exp $
|
||||
# $Id: fastgen.sh,v 1.6 2000-05-12 07:37:42 sas Exp $
|
||||
#
|
||||
|
||||
srcdir=$1
|
||||
shift
|
||||
|
||||
topsrcdir=`(cd $srcdir; pwd)`
|
||||
|
||||
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="$topsrcdir/build/shtool mkdir -f -p"
|
||||
mkdir_p="$top_srcdir/helpers/mkdir.sh"
|
||||
fi
|
||||
|
||||
for i in $@ ; do
|
||||
echo "creating $i"
|
||||
dir=`dirname $i`
|
||||
$mkdir_p $dir
|
||||
sed \
|
||||
-e s#@topsrcdir@#$topsrcdir# \
|
||||
-e s#@srcdir@#$topsrcdir/$dir# \
|
||||
< $topsrcdir/$i.in > $i
|
||||
for makefile in $@; do
|
||||
echo "creating $makefile"
|
||||
# portable dirname
|
||||
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
|
||||
$mkdir_p "$dir/"
|
||||
|
||||
(cat <<EOF
|
||||
top_srcdir = $top_srcdir
|
||||
top_builddir = $top_builddir
|
||||
srcdir = $top_srcdir/$dir
|
||||
builddir = $top_builddir/$dir
|
||||
VPATH = $top_srcdir/$dir
|
||||
EOF
|
||||
)| cat - $top_srcdir/$makefile.in > $makefile
|
||||
|
||||
test -z "$dir" || touch $dir/.deps
|
||||
|
||||
done
|
||||
@@ -28,18 +28,3 @@ LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo)
|
||||
|
||||
$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
|
||||
$(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD)
|
||||
|
||||
$(LTLIBRARY_SHARED_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
|
||||
@test -d $(phplibdir) || $(mkinstalldirs) $(phplibdir)
|
||||
$(LINK) -avoid-version -module -rpath $(phplibdir) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_SHARED_LIBADD)
|
||||
$(SHLIBTOOL) --mode=install cp $@ $(phplibdir)
|
||||
|
||||
shared:
|
||||
@if test -z '$(LTLIBRARY_SHARED_NAME)'; then \
|
||||
echo "LTLIBRARY_SHARED_NAME is empty. Double check your Makefile.in"; \
|
||||
fi
|
||||
@if test '$(SHLIBTOOL)' != '$(LIBTOOL)'; then \
|
||||
$(MAKE) 'LIBTOOL=$(SHLIBTOOL)' $(LTLIBRARY_SHARED_NAME); \
|
||||
else \
|
||||
$(MAKE) $(LTLIBRARY_SHARED_NAME); \
|
||||
fi; \
|
||||
+2
-2
@@ -26,6 +26,6 @@
|
||||
|
||||
targets = $(LTLIBRARY_NAME)
|
||||
|
||||
include $(topsrcdir)/build/rules.mk
|
||||
include $(topsrcdir)/build/library.mk
|
||||
include $(top_srcdir)/build/rules.mk
|
||||
include $(top_srcdir)/build/library.mk
|
||||
|
||||
+22
-39
@@ -24,24 +24,22 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(DEPTH)/config_vars.mk
|
||||
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
|
||||
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)
|
||||
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(DEPTH)
|
||||
|
||||
moduledir = $(libdir)/php/modules
|
||||
top_srcdir = $(topsrcdir)
|
||||
top_builddir = $(DEPTH)
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .lo .o .s .y .l
|
||||
.SUFFIXES: .slo .c .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
@@ -49,17 +47,14 @@ top_builddir = $(DEPTH)
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.S.lo:
|
||||
$(PHP_COMPILE)
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
@@ -76,48 +71,36 @@ install: install-recursive
|
||||
|
||||
distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
|
||||
@otarget=`echo $@|sed s/-recursive//`; \
|
||||
if test '$(NO_RECURSION)' != "$$otarget"; then \
|
||||
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; \
|
||||
fi; \
|
||||
if test -n '$(make_shared)'; then \
|
||||
$(MAKE) shared || exit 1; \
|
||||
fi;
|
||||
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 > .deps
|
||||
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 *.la *.o $(CLEANFILES)
|
||||
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 $(srcdir)/.deps
|
||||
include $(builddir)/.deps
|
||||
|
||||
.PHONY: all-recursive clean-recursive install-recursive \
|
||||
$(install_targets) install all clean depend depend-recursive shared \
|
||||
|
||||
+23
-36
@@ -24,7 +24,7 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(DEPTH)/config_vars.mk
|
||||
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)
|
||||
@@ -33,15 +33,13 @@ 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)
|
||||
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(DEPTH)
|
||||
|
||||
moduledir = $(libdir)/php/modules
|
||||
top_srcdir = $(topsrcdir)
|
||||
top_builddir = $(DEPTH)
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .lo .o .s .y .l
|
||||
.SUFFIXES: .slo .c .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
@@ -49,17 +47,14 @@ top_builddir = $(DEPTH)
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.S.lo:
|
||||
$(PHP_COMPILE)
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
@@ -70,44 +65,36 @@ top_builddir = $(DEPTH)
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
#################################
|
||||
# Simplified Makefile
|
||||
install_targets = install-modules
|
||||
|
||||
all: shared
|
||||
install: shared install-modules
|
||||
|
||||
#################################
|
||||
|
||||
#all: all-recursive
|
||||
all: all-recursive
|
||||
install: install-recursive
|
||||
|
||||
distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
|
||||
@otarget=`echo $@|sed s/-recursive//`; \
|
||||
if test '$(NO_RECURSION)' != "$$otarget"; then \
|
||||
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; \
|
||||
test "$otarget" = "all" && test -z '$(targets)' && ok=yes; \
|
||||
test "$ok" = "yes" || $(MAKE) "$$otarget-p" || exit 1; \
|
||||
fi;
|
||||
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 > .deps
|
||||
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 *.la *.o $(CLEANFILES)
|
||||
rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
|
||||
rm -rf .libs
|
||||
|
||||
distclean: distclean-recursive clean-x
|
||||
@@ -121,7 +108,7 @@ install-modules:
|
||||
rm -f modules/*.la && \
|
||||
cp modules/* $(moduledir) || true
|
||||
|
||||
include $(srcdir)/.deps
|
||||
include $(builddir)/.deps
|
||||
|
||||
.PHONY: all-recursive clean-recursive install-recursive \
|
||||
$(install_targets) install all clean depend depend-recursive shared \
|
||||
|
||||
+85
-76
@@ -1,12 +1,12 @@
|
||||
#!/bin/sh
|
||||
##
|
||||
## GNU shtool -- The GNU Portable Shell Tool
|
||||
## Copyright (c) 1994-1999 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## 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.7 (24-Dec-1999)
|
||||
## Version 1.4.9 (16-Apr-2000)
|
||||
## Ingredients: 3/17 available modules
|
||||
##
|
||||
|
||||
@@ -44,14 +44,14 @@
|
||||
##
|
||||
## 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
|
||||
## table Pretty-print a field-separated list as a table
|
||||
## prop Display progress with a running propeller
|
||||
## move Move files with simultan substitution
|
||||
## move Move files with simultaneous substitution
|
||||
## mkln Make link with calculation of relative paths
|
||||
## mkshadow Make a shadow tree
|
||||
## mkshadow Make a shadow tree through symbolic links
|
||||
## fixperm Fix file permissions inside a source tree
|
||||
## tarball Roll distribution tarballs
|
||||
## guessos Simple OS/platform guesser
|
||||
## guessos Simple operating system guesser
|
||||
## arx Extended archive command
|
||||
## slo Separate linker options by library class
|
||||
## scpp Sharing C Pre-Processor
|
||||
@@ -65,8 +65,8 @@ if [ $# -eq 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
|
||||
echo "This is GNU shtool, version 1.4.7 (24-Dec-1999)"
|
||||
echo "Copyright (c) 1994-1999 Ralf S. Engelschall <rse@engelschall.com>"
|
||||
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>]]"
|
||||
@@ -94,9 +94,9 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
|
||||
echo ' <user>] [-g <group>] [-e <pattern>] <path> [<path> ...]'
|
||||
echo ' guessos '
|
||||
echo ' arx [-t] [-C<cmd>] <op> <archive> [<file> ...]'
|
||||
echo ' slo -- -L<dir> -l<lib> [ -L<dir> -l<lib> ... ]'
|
||||
echo ' scpp [-v] [-p] [-o<ofile>] [-t<tfile>] [-M<mark>] [-D<dname>]'
|
||||
echo ' [-C<cname>] <file> [<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> ...]'
|
||||
@@ -104,7 +104,7 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
|
||||
exit 0
|
||||
fi
|
||||
if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
|
||||
echo "GNU shtool 1.4.7 (24-Dec-1999)"
|
||||
echo "GNU shtool 1.4.9 (16-Apr-2000)"
|
||||
exit 0
|
||||
fi
|
||||
if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
|
||||
@@ -136,13 +136,20 @@ case $tool in
|
||||
str_tool="echo"
|
||||
str_usage="[-n] [-e] [<str> ...]"
|
||||
arg_spec="0+"
|
||||
opt_spec="ne"
|
||||
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="vtcCsm:o:g:e:"
|
||||
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=""
|
||||
@@ -152,9 +159,17 @@ case $tool in
|
||||
str_tool="mkdir"
|
||||
str_usage="[-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]"
|
||||
arg_spec="1+"
|
||||
opt_spec="tfpm:"
|
||||
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
|
||||
@@ -168,30 +183,24 @@ esac
|
||||
|
||||
# determine name of tool
|
||||
if [ ".$tool" != . ]; then
|
||||
# inside shtool
|
||||
# used inside shtool script
|
||||
toolcmd="$0 $tool"
|
||||
toolcmdhelp="shtool $tool"
|
||||
msgprefix="shtool:$tool"
|
||||
else
|
||||
# standalone
|
||||
# used as standalone script
|
||||
toolcmd="$0"
|
||||
toolcmdhelp="sh.$tool"
|
||||
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"/'`
|
||||
test ".$arg_MODE" = . && arg_MODE="="
|
||||
eval `echo $arg_spec |\
|
||||
sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'`
|
||||
|
||||
# parse option specification string
|
||||
for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][:+]*\)/\1 /g'`; do
|
||||
opt_MODE="."
|
||||
eval `echo $opt |\
|
||||
sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \
|
||||
-e 's/";\([:+]\)/"; opt_MODE="\1";/'`
|
||||
eval "opt_MODE_${opt_THIS}=${opt_MODE}"
|
||||
test "$opt_MODE" = . && eval "opt_${opt_THIS}=no"
|
||||
done
|
||||
eval `echo h.$opt_spec |\
|
||||
sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'`
|
||||
|
||||
# interate over argument line
|
||||
opt_PREV=''
|
||||
@@ -209,7 +218,7 @@ while [ $# -gt 0 ]; do
|
||||
opt_OPT="$opt_PREV"
|
||||
opt_ARG="$1"
|
||||
opt_ARG_OK=yes
|
||||
opt_PREV=""
|
||||
opt_PREV=''
|
||||
else
|
||||
# split argument into option and argument
|
||||
case "$1" in
|
||||
@@ -219,8 +228,7 @@ while [ $# -gt 0 ]; do
|
||||
-e 's/";\(.*\)$/"; opt_ARG="\1"/'`
|
||||
;;
|
||||
-[a-zA-Z0-9])
|
||||
opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \
|
||||
"OPT=$1" </dev/null"`
|
||||
opt_OPT=`echo "x$1" | cut -c3-`
|
||||
opt_ARG=''
|
||||
;;
|
||||
*)
|
||||
@@ -243,15 +251,15 @@ while [ $# -gt 0 ]; do
|
||||
|
||||
# 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\""
|
||||
;;
|
||||
@@ -276,14 +284,14 @@ 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
|
||||
@@ -294,13 +302,12 @@ esac
|
||||
|
||||
# establish a temporary file on request
|
||||
if [ ".$gen_tmpfile" = .yes ]; then
|
||||
tmpdir="/tmp"
|
||||
if [ ".$TMPDIR" != . ]; then
|
||||
tmpdir="$TMPDIR"
|
||||
elif [ ".$TEMPDIR" != . ]; then
|
||||
tmpdir="$TEMPDIR"
|
||||
else
|
||||
if [ ".$TEMPDIR" != . ]; then
|
||||
tmpdir="$TEMPDIR"
|
||||
fi
|
||||
tmpdir="/tmp"
|
||||
fi
|
||||
tmpfile="$tmpdir/.shtool.$$"
|
||||
rm -f $tmpfile >/dev/null 2>&1
|
||||
@@ -316,7 +323,7 @@ case $tool in
|
||||
echo )
|
||||
##
|
||||
## echo -- Print string with optional construct expansion
|
||||
## Copyright (c) 1998-1999 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Copyright (c) 1998-2000 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Originally written for WML as buildinfo
|
||||
##
|
||||
|
||||
@@ -343,8 +350,8 @@ echo )
|
||||
term_bold=''
|
||||
term_norm=''
|
||||
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
|
||||
# the most important terminals we directly know
|
||||
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`
|
||||
@@ -353,35 +360,37 @@ echo )
|
||||
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`
|
||||
;;
|
||||
esac
|
||||
# then try 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"
|
||||
# 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" != . ]; 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
|
||||
if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
|
||||
break;
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
done
|
||||
;;
|
||||
esac
|
||||
if [ ".$term_bold" = . -o ".$term_norm" = . ]; then
|
||||
echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2
|
||||
fi
|
||||
@@ -525,7 +534,7 @@ echo )
|
||||
echo $seo "$text"
|
||||
else
|
||||
# the harder part: echo -n is best, because
|
||||
# awk complains about some \xx sequences.
|
||||
# awk may complain about some \xx sequences.
|
||||
if [ ".$minusn" != . ]; then
|
||||
echo $seo $minusn "$text"
|
||||
else
|
||||
@@ -537,7 +546,7 @@ echo )
|
||||
install )
|
||||
##
|
||||
## install -- Install a program, script or datafile
|
||||
## Copyright (c) 1997-1999 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Copyright (c) 1997-2000 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## Originally written for shtool
|
||||
##
|
||||
|
||||
@@ -644,24 +653,24 @@ install )
|
||||
mkdir )
|
||||
##
|
||||
## mkdir -- Make one or more directories
|
||||
## Copyright (c) 1996-1999 Ralf S. Engelschall <rse@engelschall.com>
|
||||
## 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
|
||||
# when the directory already exists...
|
||||
# if the directory already exists...
|
||||
if [ -d "$p" ]; then
|
||||
if [ ".$opt_f" = .no ]; then
|
||||
echo "$msgprefix:Error: file exists: $p" 1>&2
|
||||
if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then
|
||||
echo "$msgprefix:Error: directory already exists: $p" 1>&2
|
||||
errstatus=1
|
||||
break
|
||||
else
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
# when the directory has to be created
|
||||
# if the directory has to be created...
|
||||
if [ ".$opt_p" = .no ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "mkdir $p" 1>&2
|
||||
@@ -675,7 +684,7 @@ mkdir )
|
||||
-e 's/\// /g' \
|
||||
-e 's/^%/\//'`
|
||||
shift
|
||||
pathcomp=
|
||||
pathcomp=''
|
||||
for d in ${1+"$@"}; do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
|
||||
+190
-148
@@ -7,12 +7,6 @@ AC_INIT(main.c)
|
||||
|
||||
PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile)
|
||||
|
||||
dnl Because ``make install'' is often performed by the superuser,
|
||||
dnl we create the libs subdirectory as the user who configures PHP.
|
||||
dnl Otherwise, the current user will not be able to delete libs
|
||||
dnl or the contents of libs.
|
||||
test -d libs || mkdir libs
|
||||
|
||||
if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
|
||||
AC_MSG_ERROR(--with-shared-apache is not supported. Please refer to the documentation for using APXS)
|
||||
fi
|
||||
@@ -33,6 +27,14 @@ php_shtool="$srcdir/build/shtool"
|
||||
T_MD=`$php_shtool echo -n -e %B`
|
||||
T_ME=`$php_shtool echo -n -e %b`
|
||||
|
||||
dnl Because ``make install'' is often performed by the superuser,
|
||||
dnl we create the libs subdirectory as the user who configures PHP.
|
||||
dnl Otherwise, the current user will not be able to delete libs
|
||||
dnl or the contents of libs.
|
||||
|
||||
$php_shtool mkdir -p libs
|
||||
rm -f libs/*
|
||||
|
||||
dnl ## Diversion 2 is the initial checking of OS features, programs,
|
||||
dnl ## libraries and so on.
|
||||
|
||||
@@ -48,12 +50,8 @@ dnl ## All of these are normally in the extension directories.
|
||||
|
||||
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
|
||||
|
||||
divert(2)
|
||||
|
||||
PHP_CONFIGURE_PART(Running system checks)
|
||||
|
||||
dnl ## This is where the version number is changed from now on!
|
||||
AM_INIT_AUTOMAKE(php, 4.0RC1)
|
||||
AM_INIT_AUTOMAKE(php, 4.0.0)
|
||||
|
||||
PHP_VERSION=$VERSION
|
||||
echo "/* automatically generated by configure */" > php_version.h.new
|
||||
@@ -74,12 +72,6 @@ AC_CANONICAL_HOST
|
||||
dnl We want this one before the checks, so the checks can modify CFLAGS.
|
||||
test -z "$CFLAGS" && auto_cflags=1
|
||||
|
||||
dnl ## If we're using cc on HP-UX, add -Ae -D_HPUX_SOURCE [obsolete]
|
||||
dnl ## if test -n "$auto_cflags" && test "`uname -s 2>/dev/null`" = "HP-UX"
|
||||
dnl ## then
|
||||
dnl ## test -n "$GCC" || CFLAGS="-Ae $CFLAGS -D_HPUX_SOURCE"
|
||||
dnl ## fi
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_YACC
|
||||
if test "$YACC" != "bison -y"; then
|
||||
@@ -95,11 +87,8 @@ else
|
||||
AC_MSG_RESULT($1.$2 (ok))
|
||||
fi
|
||||
|
||||
dnl ## there has to be a better way...
|
||||
dnl ## OLDLIBS=$LIBS; LIBS=""
|
||||
AC_PROG_CC
|
||||
AC_AIX
|
||||
dnl ## LIBS=$OLDLIBS
|
||||
|
||||
AM_PROG_CC_STDC
|
||||
|
||||
@@ -121,6 +110,37 @@ sinclude(Zend/acinclude.m4)
|
||||
sinclude(Zend/Zend.m4)
|
||||
sinclude(TSRM/tsrm.m4)
|
||||
|
||||
divert(2)
|
||||
|
||||
PTHREADS_CHECK
|
||||
|
||||
PHP_SHLIB_SUFFIX_NAME
|
||||
|
||||
PHP_SAPI=cgi
|
||||
PHP_BUILD_PROGRAM
|
||||
dnl paths to the targets relative to the build directory
|
||||
SAPI_PROGRAM=php
|
||||
SAPI_SHARED=libs/libphp4.$SHLIB_SUFFIX_NAME
|
||||
SAPI_STATIC=libs/libphp4.a
|
||||
|
||||
PHP_CONFIGURE_PART(Configuring SAPI modules)
|
||||
|
||||
esyscmd(./scripts/config-stubs sapi)
|
||||
|
||||
AC_MSG_CHECKING(for chosen SAPI module)
|
||||
AC_MSG_RESULT($PHP_SAPI)
|
||||
|
||||
if test "$enable_experimental_zts" = "yes"; then
|
||||
PTHREADS_ASSIGN_VARS
|
||||
PTHREADS_FLAGS
|
||||
fi
|
||||
|
||||
divert(3)
|
||||
|
||||
PHP_CONFIGURE_PART(Running system checks)
|
||||
|
||||
PHP_MISSING_TIME_R_DECL
|
||||
|
||||
dnl check for -R, etc. switch
|
||||
AC_MSG_CHECKING(whether compiler supports -R)
|
||||
AC_CACHE_VAL(php_cv_cc_dashr,[
|
||||
@@ -153,20 +173,20 @@ if test -n "$PROG_SENDMAIL"; then
|
||||
AC_DEFINE(HAVE_SENDMAIL)
|
||||
fi
|
||||
|
||||
dnl Check whether the system uses EBCDIC (not ASCII) as its native codeset
|
||||
PHP_EBCDIC
|
||||
|
||||
dnl
|
||||
dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
|
||||
dnl and source packages. This should be harmless on other OSs.
|
||||
dnl
|
||||
if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
|
||||
CFLAGS="$CFLAGS -I/usr/pkg/include"
|
||||
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
|
||||
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
|
||||
fi
|
||||
|
||||
INCLUDES="-I\$(top_builddir)/Zend -I\$(top_srcdir)"
|
||||
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend -I\$(top_srcdir)"
|
||||
|
||||
AC_CHECK_LIB(nsl, gethostname, [
|
||||
AC_ADD_LIBRARY(nsl)
|
||||
AC_DEFINE(HAVE_LIBNSL) ], [])
|
||||
|
||||
AC_CHECK_LIB(socket, socket, [
|
||||
AC_ADD_LIBRARY(socket)
|
||||
@@ -175,14 +195,33 @@ AC_CHECK_LIB(socket, socket, [
|
||||
AC_ADD_LIBRARY(socket)
|
||||
])])
|
||||
|
||||
AC_CHECK_LIB(nsl, gethostbyaddr, [
|
||||
dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try
|
||||
dnl to avoid -lnsl checks, if we already have the functions which
|
||||
dnl are usually in libnsl
|
||||
|
||||
unset ac_cv_func_yp_get_default_domain
|
||||
AC_CHECK_FUNC(yp_get_default_domain,
|
||||
[php_no_nsl_checks=yes],[ ])
|
||||
unset ac_cv_func_yp_get_default_domain
|
||||
|
||||
if test "$php_no_nsl_checks" != "yes"; then
|
||||
|
||||
AC_CHECK_LIB(nsl, gethostname, [
|
||||
AC_ADD_LIBRARY(nsl)
|
||||
AC_DEFINE(HAVE_LIBNSL) ], [])
|
||||
AC_DEFINE(HAVE_LIBNSL) ],[
|
||||
AC_CHECK_LIB(nsl, gethostbyaddr, [
|
||||
AC_ADD_LIBRARY(nsl)
|
||||
AC_DEFINE(HAVE_LIBNSL) ], [])
|
||||
])
|
||||
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(crypt, crypt, [
|
||||
AC_ADD_LIBRARY(crypt)
|
||||
AC_DEFINE(HAVE_LIBCRYPT,1,[ ]) ], [])
|
||||
|
||||
AC_CHECK_LIB(dl, dlopen,[AC_ADD_LIBRARY(dl)])
|
||||
|
||||
dnl The sin may be in a library which need not be specifed
|
||||
dnl as well as res_search resides in libsocket
|
||||
AC_CHECK_LIB(m, sin)
|
||||
@@ -227,6 +266,7 @@ crypt.h \
|
||||
dlfcn.h \
|
||||
fcntl.h \
|
||||
grp.h \
|
||||
ieeefp.h \
|
||||
limits.h \
|
||||
locale.h \
|
||||
memory.h \
|
||||
@@ -246,6 +286,7 @@ sys/time.h \
|
||||
sys/types.h \
|
||||
sys/varargs.h \
|
||||
sys/wait.h \
|
||||
sys/resource.h \
|
||||
syslog.h \
|
||||
unistd.h \
|
||||
unix.h \
|
||||
@@ -306,7 +347,6 @@ putenv \
|
||||
random \
|
||||
rand_r \
|
||||
regcomp \
|
||||
rint \
|
||||
setitimer \
|
||||
setlocale \
|
||||
setsockopt \
|
||||
@@ -360,50 +400,32 @@ if test $ac_cv_type_in_addr_t = no; then
|
||||
AC_DEFINE(in_addr_t, u_int)
|
||||
fi
|
||||
|
||||
divert(3)
|
||||
divert(4)
|
||||
|
||||
|
||||
|
||||
abs_srcdir=`(cd $srcdir; pwd)`
|
||||
abs_builddir=`pwd`
|
||||
|
||||
AC_MSG_CHECKING(whether to use a configuration file)
|
||||
AC_ARG_WITH(config-file-path,
|
||||
PHP_ARG_WITH(config-file-path,whether to use a configuration file,
|
||||
[ --with-config-file-path=PATH
|
||||
Sets the path in which to look for php.ini.
|
||||
defaults to /usr/local/lib],
|
||||
[
|
||||
if test "$withval" = "yes"; then
|
||||
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "/usr/local/lib")
|
||||
AC_DEFINE(USE_CONFIG_FILE, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
if test "$withval" != "no"; then
|
||||
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "$withval")
|
||||
AC_DEFINE(USE_CONFIG_FILE, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_DEFINE(CONFIGURATION_FILE_PATH, 0)
|
||||
AC_DEFINE(USE_CONFIG_FILE, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "/usr/local/lib")
|
||||
defaults to /usr/local/lib], yes)
|
||||
|
||||
if test "$PHP_CONFIG_FILE_PATH" = "yes"; then
|
||||
PHP_CONFIG_FILE_PATH="/usr/local/lib"
|
||||
fi
|
||||
|
||||
if test "$PHP_CONFIG_FILE_PATH" != "no"; then
|
||||
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "$PHP_CONFIG_FILE_PATH")
|
||||
AC_DEFINE(USE_CONFIG_FILE, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
])
|
||||
else
|
||||
AC_DEFINE(CONFIGURATION_FILE_PATH, 0)
|
||||
AC_DEFINE(USE_CONFIG_FILE, 0)
|
||||
fi
|
||||
|
||||
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --disable-debug Compile without debugging symbols], [
|
||||
PHP_DEBUG=$enableval
|
||||
],[
|
||||
PHP_DEBUG=yes
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING(whether to include debugging symbols)
|
||||
AC_MSG_RESULT($PHP_DEBUG)
|
||||
PHP_ARG_ENABLE(debug, whether to include debugging symbols,
|
||||
[ --disable-debug Compile without debugging symbols.], yes)
|
||||
|
||||
if test "$PHP_DEBUG" = "yes"; then
|
||||
PHP_DEBUG=1
|
||||
@@ -416,23 +438,14 @@ fi
|
||||
|
||||
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
|
||||
PHP_ARG_ENABLE(safe-mode, whether to enable safe mode by default,
|
||||
[ --enable-safe-mode Enable safe mode by default.])
|
||||
|
||||
AC_MSG_CHECKING(whether to enable safe mode by default)
|
||||
AC_ARG_ENABLE(safe-mode,
|
||||
[ --enable-safe-mode Enable safe mode by default.],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(PHP_SAFE_MODE, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_DEFINE(PHP_SAFE_MODE, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
],[
|
||||
AC_DEFINE(PHP_SAFE_MODE, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
|
||||
if test "$PHP_SAFE_MODE" = "yes"; then
|
||||
AC_DEFINE(PHP_SAFE_MODE, 1)
|
||||
else
|
||||
AC_DEFINE(PHP_SAFE_MODE, 0)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for safe mode exec dir)
|
||||
AC_ARG_WITH(exec-dir,
|
||||
@@ -456,55 +469,48 @@ AC_ARG_WITH(exec-dir,
|
||||
AC_MSG_RESULT(/usr/local/php/bin)
|
||||
])
|
||||
|
||||
PHP_ARG_ENABLE(sigchild,whether to enable PHP's own SIGCHLD handler,
|
||||
[ --enable-sigchild Enable PHP's own SIGCHLD handler.],no)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable track_vars variables by default)
|
||||
AC_ARG_ENABLE(track-vars,
|
||||
[ --enable-track-vars Enable GET/POST/Cookie track variables by default.],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(PHP_TRACK_VARS, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_DEFINE(PHP_TRACK_VARS, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
],[
|
||||
AC_DEFINE(PHP_TRACK_VARS, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
if test "$PHP_SIGCHILD" = "yes"; then
|
||||
AC_DEFINE(PHP_SIGCHILD, 1)
|
||||
else
|
||||
AC_DEFINE(PHP_SIGCHILD, 0)
|
||||
fi
|
||||
|
||||
PHP_ARG_ENABLE(track-vars,whether to enable track_vars variables by default,
|
||||
[ --enable-track-vars Enable GET/POST/Cookie track variables by default.],yes)
|
||||
|
||||
AC_MSG_CHECKING(whether to enable magic quotes by default)
|
||||
AC_ARG_ENABLE(magic-quotes,
|
||||
[ --enable-magic-quotes Enable magic quotes by default.],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(MAGIC_QUOTES, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_DEFINE(MAGIC_QUOTES, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
],[
|
||||
AC_DEFINE(MAGIC_QUOTES, 0)
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
if test "$PHP_TRACK_VARS" = "yes"; then
|
||||
AC_DEFINE(PHP_TRACK_VARS, 1)
|
||||
else
|
||||
AC_DEFINE(PHP_TRACK_VARS, 0)
|
||||
fi
|
||||
|
||||
PHP_ARG_ENABLE(magic-quotes,whether to enable magic quotes by default,
|
||||
[ --enable-magic-quotes Enable magic quotes by default.])
|
||||
|
||||
AC_MSG_CHECKING(whether to enable runpaths)
|
||||
AC_ARG_ENABLE(rpath,
|
||||
if test "$PHP_MAGIC_QUOTES" = "yes"; then
|
||||
AC_DEFINE(MAGIC_QUOTES, 1)
|
||||
else
|
||||
AC_DEFINE(MAGIC_QUOTES, 0)
|
||||
fi
|
||||
|
||||
PHP_ARG_ENABLE(rpath, whether to enable runpaths,
|
||||
[ --disable-rpath Disable passing additional runtime library
|
||||
search paths],
|
||||
[
|
||||
if test "$enableval" = "no"; then
|
||||
enable_rpath=no
|
||||
else
|
||||
enable_rpath=yes
|
||||
search paths], yes)
|
||||
|
||||
PHP_ARG_ENABLE(libgcc, whether to explicitly link against libgcc,
|
||||
[ --enable-libgcc Enable explicitly linking against libgcc])
|
||||
|
||||
if test "$PHP_LIBGCC" = "yes"; then
|
||||
PHP_LIBGCC_LIBPATH(gcc)
|
||||
if test -z "$libgcc_libpath"; then
|
||||
AC_MSG_ERROR(Cannot locate libgcc. Make sure that gcc is in your path)
|
||||
fi
|
||||
],[
|
||||
enable_rpath=yes
|
||||
])
|
||||
AC_MSG_RESULT($enable_rpath)
|
||||
AC_ADD_LIBPATH($libgcc_libpath)
|
||||
AC_ADD_LIBRARY(gcc, yes)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether to enable short tags by default)
|
||||
AC_ARG_ENABLE(short-tags,
|
||||
@@ -577,23 +583,8 @@ if test "$PHP_PEAR" = "yes"; then
|
||||
PEAR_DIR=pear
|
||||
fi
|
||||
|
||||
|
||||
PHP_SAPI=cgi
|
||||
PHP_BUILD_PROGRAM
|
||||
dnl paths to the targets relative to the build directory
|
||||
SAPI_PROGRAM=php
|
||||
dnl on HP-UX, the extension is .sl. Need to improve this
|
||||
SAPI_SHARED=libs/libphp4.so
|
||||
SAPI_STATIC=libs/libphp4.a
|
||||
|
||||
PHP_CONFIGURE_PART(Configuring SAPI modules)
|
||||
|
||||
esyscmd(./scripts/config-stubs sapi)
|
||||
|
||||
AC_MSG_CHECKING(for chosen SAPI module)
|
||||
AC_MSG_RESULT($PHP_SAPI)
|
||||
|
||||
divert(4)
|
||||
divert(5)
|
||||
|
||||
PHP_CONFIGURE_PART(Configuring extensions)
|
||||
|
||||
@@ -619,7 +610,7 @@ if test "$PHP_VERSIONING" = "yes"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
divert(5)
|
||||
divert(6)
|
||||
|
||||
enable_shared=yes
|
||||
enable_static=yes
|
||||
@@ -643,8 +634,6 @@ fi
|
||||
|
||||
PHP_REGEX
|
||||
|
||||
PTHREADS_FLAGS
|
||||
|
||||
PHP_CONFIGURE_PART(Configuring Zend)
|
||||
LIBZEND_BASIC_CHECKS
|
||||
LIBZEND_OTHER_CHECKS
|
||||
@@ -682,12 +671,34 @@ fi
|
||||
|
||||
|
||||
phplibdir="`pwd`/modules"
|
||||
$php_shtool mkdir -p $phplibdir
|
||||
phptempdir="`pwd`/libs"
|
||||
|
||||
test "$prefix" = "NONE" && prefix="/usr/local"
|
||||
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
|
||||
|
||||
dnl Build extension directory path
|
||||
|
||||
if test "$PHP_DEBUG" = "1"; then
|
||||
PART1=debug
|
||||
else
|
||||
PART1=no-debug
|
||||
fi
|
||||
|
||||
if test "$enable_experimental_zts" = "yes"; then
|
||||
PART2=zts
|
||||
else
|
||||
PART2=non-zts
|
||||
fi
|
||||
|
||||
ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO ' $srcdir/Zend/modules.h|sed 's/#define ZEND_MODULE_API_NO //'`
|
||||
|
||||
EXTENSION_DIR="$prefix/lib/php/extensions/$PART1-$PART2-$ZEND_MODULE_API_NO"
|
||||
|
||||
AC_BUILD_RPATH
|
||||
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
|
||||
|
||||
|
||||
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
|
||||
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE")
|
||||
PHP_UNAME=`uname -a`
|
||||
@@ -715,6 +726,7 @@ PHP_SUBST(CPPFLAGS)
|
||||
PHP_SUBST(CXX)
|
||||
PHP_SUBST(DEBUG_CFLAGS)
|
||||
PHP_SUBST(DEFS)
|
||||
PHP_SUBST(EXTENSION_DIR)
|
||||
PHP_SUBST(EXTRA_LDFLAGS)
|
||||
PHP_SUBST(EXTRA_LIBS)
|
||||
PHP_SUBST(INCLUDES)
|
||||
@@ -723,6 +735,7 @@ PHP_SUBST(LEX)
|
||||
PHP_SUBST(LEX_OUTPUT_ROOT)
|
||||
PHP_SUBST(LFLAGS)
|
||||
PHP_SUBST(LIBTOOL)
|
||||
PHP_SUBST(LN_S)
|
||||
PHP_SUBST(NATIVE_RPATHS)
|
||||
PHP_SUBST(PEAR_DIR)
|
||||
PHP_SUBST(PHP_BUILD_DATE)
|
||||
@@ -735,7 +748,7 @@ PHP_SUBST(PHP_SAPI)
|
||||
PHP_SUBST(PHP_VERSION)
|
||||
PHP_SUBST(PROG_SENDMAIL)
|
||||
PHP_SUBST(SHELL)
|
||||
PHP_SUBST(SHLIBTOOL)
|
||||
PHP_SUBST(SHARED_LIBTOOL)
|
||||
PHP_SUBST(TSRM_DIR)
|
||||
PHP_SUBST(TSRM_LIB)
|
||||
PHP_SUBST(WARNING_LEVEL)
|
||||
@@ -746,6 +759,8 @@ PHP_CONFIGURE_PART(Configuring libtool)
|
||||
old_CC="$CC"
|
||||
|
||||
if test "$PHP_THREAD_SAFETY" = "yes" && test -n "$ac_cv_pthreads_cflags"; then
|
||||
CXXFLAGS="$CXXFLAGS $ac_cv_pthreads_cflags"
|
||||
INLINE_CFLAGS="$INLINE_CFLAGS $ac_cv_pthreads_cflags"
|
||||
cat >meta_ccld<<EOF
|
||||
#! /bin/sh
|
||||
exec $CC $ac_cv_pthreads_cflags \$@
|
||||
@@ -754,6 +769,12 @@ EOF
|
||||
chmod +x meta_ccld
|
||||
fi
|
||||
|
||||
dnl This will go away, if we have a facility to run per-extension code
|
||||
dnl after the thread_safety decision was done
|
||||
if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then
|
||||
CPPFLAGS="$CPPFLAGS -DTHREAD=1"
|
||||
fi
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
if test "$enable_debug" != "yes"; then
|
||||
AM_SET_LIBTOOL_VARIABLE([--silent])
|
||||
@@ -762,12 +783,12 @@ fi
|
||||
PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
|
||||
|
||||
if test "$enable_shared" = "yes"; then
|
||||
SHLIBTOOL='$(LIBTOOL)'
|
||||
SHARED_LIBTOOL='$(LIBTOOL)'
|
||||
else
|
||||
if test -n "$EXT_SHARED"; then
|
||||
if test "$lib_build_shared" = "yes"; then
|
||||
PHP_CONFIGURE_PART(Configuring shared libtool)
|
||||
$SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
|
||||
SHLIBTOOL='$(SHELL) $(top_builddir)/shlibtool'
|
||||
SHARED_LIBTOOL='$(SHELL) $(top_builddir)/shlibtool'
|
||||
else
|
||||
PHP_COMPILE='$(COMPILE) -c $< && touch $@'
|
||||
fi
|
||||
@@ -787,12 +808,10 @@ EOF
|
||||
fi
|
||||
changequote([,])
|
||||
|
||||
test "$prefix" = "NONE" && prefix="/usr/local"
|
||||
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
|
||||
|
||||
PHP_CONFIGURE_PART(Generating files)
|
||||
|
||||
PHP_FAST_GENERATE
|
||||
touch .deps
|
||||
|
||||
#libphp4.module
|
||||
AC_OUTPUT([php4.spec Zend/Makefile
|
||||
@@ -841,7 +860,7 @@ if true; then
|
||||
echo "+--------------------------------------------------------------------+"
|
||||
echo "| WARNING: Your $APXS script is most likely broken."
|
||||
echo "| |"
|
||||
echo "| Please go read http://www.php.net/FAQ.php3#4.11 and make the |"
|
||||
echo "| Please go read http://www.php.net/FAQ.php3#6.11 and make the |"
|
||||
echo "| changes described there and try again. |"
|
||||
fi
|
||||
|
||||
@@ -860,6 +879,23 @@ if true; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if test -n "$DEBUG_LOG"; then
|
||||
rm -f config.cache
|
||||
cat <<X
|
||||
+--------------------------------------------------------------------+
|
||||
| ATTENTION! |
|
||||
| Something is likely to be screwed up here, because the configure |
|
||||
| script was not able to detect a simple feature on your platform. |
|
||||
| This is often caused by incorrect configuration parameters. Please |
|
||||
| see the file debug.log for error messages. |
|
||||
| |
|
||||
| If you are unable to fix this, send the file debug.log to the |
|
||||
| php-install@lists.php.net mailing list and include appropiate |
|
||||
| information about your setup. |
|
||||
X
|
||||
fi
|
||||
|
||||
echo "+--------------------------------------------------------------------+"
|
||||
echo "| License: |"
|
||||
echo "| This software is subject to the PHP License, available in this |"
|
||||
@@ -869,6 +905,12 @@ if true; then
|
||||
echo "| the installation process at this point. |"
|
||||
echo "+--------------------------------------------------------------------+"
|
||||
|
||||
cat<<X
|
||||
|
||||
Thank you for using PHP.
|
||||
|
||||
X
|
||||
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
@@ -1,424 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 1991 Kendall Bennett.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Filename: $RCSfile$
|
||||
* Version: $Revision$
|
||||
*
|
||||
* Language: ANSI C
|
||||
* Environment: any
|
||||
*
|
||||
* Description: Module to implement doubly linked lists. Includes a routine
|
||||
* to peform a mergesort on the doubly linked list.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Revision History:
|
||||
* -----------------
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 1999/08/23 19:43:01 sas
|
||||
* malloc.h is deprecated, use stdlib.h instead
|
||||
*
|
||||
* Revision 1.1 1999/07/19 18:58:44 andrey
|
||||
* Moving dlist stuff into core.
|
||||
*
|
||||
* Revision 1.2 1999/05/11 00:01:42 zeev
|
||||
* * Get Apache to work. POST doesn't work yet.
|
||||
* * There are now -I directives for the absolute path of php4, php4/Zend and the builddir for
|
||||
* the Apache module, so we can #include any php/Zend header.
|
||||
* * Rename config.h to php_config.h
|
||||
*
|
||||
* Revision 1.1 1999/04/21 23:11:20 ssb
|
||||
* moved apache, com and hyperwave into ext/
|
||||
*
|
||||
* Revision 1.1.1.1 1999/04/07 21:03:31 zeev
|
||||
* PHP 4.0
|
||||
*
|
||||
* Revision 1.1.1.1 1999/03/17 04:29:11 andi
|
||||
* PHP4
|
||||
*
|
||||
* Revision 1.1.1.1 1998/12/21 07:56:22 andi
|
||||
* Trying to start the zend CVS tree
|
||||
*
|
||||
* Revision 1.1 1998/08/12 09:29:16 steinm
|
||||
* First version of Hyperwave module.
|
||||
*
|
||||
* Revision 1.5 91/12/31 19:39:49 kjb
|
||||
* Modified include file directories.
|
||||
*
|
||||
* Revision 1.4 91/10/28 03:16:39 kjb
|
||||
* Ported to the Iris.
|
||||
*
|
||||
* Revision 1.3 91/09/27 03:09:18 kjb
|
||||
* Cosmetic change.
|
||||
*
|
||||
* Revision 1.2 91/09/03 18:27:42 ROOT_DOS
|
||||
* Ported to UNIX.
|
||||
*
|
||||
* Revision 1.1 91/09/01 18:35:23 ROOT_DOS
|
||||
* Initial revision
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef MSVC5
|
||||
#include "php_config.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include "dlist.h"
|
||||
|
||||
#define PUBLIC
|
||||
#define PRIVATE static
|
||||
|
||||
PUBLIC void *dlst_newnode(int size)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: dlst_newnode
|
||||
* Parameters: size - Amount of memory to allocate for node
|
||||
* Returns: Pointer to the allocated node's user space.
|
||||
*
|
||||
* Description: Allocates the memory required for a node, adding a small
|
||||
* header at the start of the node. We return a reference to
|
||||
* the user space of the node, as if it had been allocated via
|
||||
* malloc().
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
PHP_DLST_BUCKET *node;
|
||||
|
||||
if ( !(node = (PHP_DLST_BUCKET*)malloc(size + sizeof(PHP_DLST_BUCKET))) ) {
|
||||
fprintf(stderr,"Not enough memory to allocate list node.\n");
|
||||
/* raise(SIGABRT);*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return PHP_DLST_USERSPACE(node); /* Return pointer to user space */
|
||||
}
|
||||
|
||||
PUBLIC void dlst_freenode(void *node)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: dlst_freenode
|
||||
* Parameters: node - Node to free.
|
||||
*
|
||||
* Description: Frees a node previously allocated with lst_newnode().
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
free(PHP_DLST_HEADER(node));
|
||||
}
|
||||
|
||||
PUBLIC DLIST *dlst_init(void)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: dlst_init
|
||||
* Returns: Pointer to a newly created list.
|
||||
*
|
||||
* Description: Initialises a list and returns a pointer to it.
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
DLIST *l;
|
||||
|
||||
if ((l = (DLIST*)malloc(sizeof(DLIST))) != NULL) {
|
||||
l->count = 0;
|
||||
l->head = &(l->hz[0]);
|
||||
l->z = &(l->hz[1]);
|
||||
l->head->next = l->z->next = l->z;
|
||||
l->z->prev = l->head->prev = l->head;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"Insufficient memory to allocate list\n");
|
||||
/*raise(SIGABRT);*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
PUBLIC void dlst_kill(DLIST *l,void (*freeNode)(void *node))
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: dlst_kill
|
||||
* Parameters: l - List to kill
|
||||
* freeNode - Pointer to user routine to free a node
|
||||
*
|
||||
* Description: Kills the list l, by deleting all of the elements contained
|
||||
* within the list one by one and then deleting the list
|
||||
* itself. Note that we call the user supplied routine
|
||||
* (*freeNode)() to free each list node. This allows the user
|
||||
* program to perform any extra processing needed to kill each
|
||||
* node (if each node contains pointers to other items on the
|
||||
* heap for example). If no extra processing is required, just
|
||||
* pass the address of dlst_freenode(), ie:
|
||||
*
|
||||
* dlst_kill(myList,dlst_freenode);
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
PHP_DLST_BUCKET *n,*p;
|
||||
|
||||
n = l->head->next;
|
||||
while (n != l->z) { /* Free all nodes in list */
|
||||
p = n;
|
||||
n = n->next;
|
||||
(*freeNode)(PHP_DLST_USERSPACE(p));
|
||||
}
|
||||
free(l); /* Free the list itself */
|
||||
}
|
||||
|
||||
PUBLIC void dlst_insertafter(DLIST *l,void *node,void *after)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: lst_insertafter
|
||||
* Parameters: l - List to insert node into
|
||||
* node - Pointer to user space of node to insert
|
||||
* after - Pointer to user space of node to insert node after
|
||||
*
|
||||
* Description: Inserts a new node into the list after the node 'after'. To
|
||||
* insert a new node at the beginning of the list, user the
|
||||
* macro PHP_DLST_HEAD in place of 'after'. ie:
|
||||
*
|
||||
* dlst_insertafter(mylist,node,PHP_DLST_HEAD(mylist));
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(node),*a = PHP_DLST_HEADER(after);
|
||||
|
||||
n->next = a->next;
|
||||
a->next = n;
|
||||
n->prev = a;
|
||||
n->next->prev = n;
|
||||
l->count++;
|
||||
}
|
||||
|
||||
PUBLIC void *dlst_deletenext(DLIST *l,void *node)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: lst_deletenext
|
||||
* Parameters: l - List to delete node from.
|
||||
* node - Node to delete the next node from
|
||||
* Returns: Pointer to the deleted node's userspace.
|
||||
*
|
||||
* Description: Removes the node AFTER 'node' from the list l.
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(node);
|
||||
|
||||
node = PHP_DLST_USERSPACE(n->next);
|
||||
n->next->next->prev = n;
|
||||
n->next = n->next->next;
|
||||
l->count--;
|
||||
return node;
|
||||
}
|
||||
|
||||
PUBLIC void *dlst_first(DLIST *l)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: dlst_first
|
||||
* Parameters: l - List to obtain first node from
|
||||
* Returns: Pointer to first node in list, NULL if list is empty.
|
||||
*
|
||||
* Description: Returns a pointer to the user space of the first node in
|
||||
* the list. If the list is empty, we return NULL.
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
PHP_DLST_BUCKET *n;
|
||||
|
||||
n = l->head->next;
|
||||
return (n == l->z ? NULL : PHP_DLST_USERSPACE(n));
|
||||
}
|
||||
|
||||
PUBLIC void *dlst_last(DLIST *l)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: dlst_last
|
||||
* Parameters: l - List to obtain last node from
|
||||
* Returns: Pointer to last node in list, NULL if list is empty.
|
||||
*
|
||||
* Description: Returns a pointer to the user space of the last node in
|
||||
* the list. If the list is empty, we return NULL.
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
PHP_DLST_BUCKET *n;
|
||||
|
||||
n = l->z->prev;
|
||||
return (n == l->head ? NULL : PHP_DLST_USERSPACE(n));
|
||||
}
|
||||
|
||||
PUBLIC void *dlst_next(void *prev)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: dlst_next
|
||||
* Parameters: prev - Previous node in list to obtain next node from
|
||||
* Returns: Pointer to the next node in the list, NULL at end of list.
|
||||
*
|
||||
* Description: Returns a pointer to the user space of the next node in the
|
||||
* list given a pointer to the user space of the previous node.
|
||||
* If we have reached the end of the list, we return NULL. The
|
||||
* end of the list is detected when the next pointer of a node
|
||||
* points back to itself, as does the dummy last node's next
|
||||
* pointer. This enables us to detect the end of the list
|
||||
* without needed access to the list data structure itself.
|
||||
*
|
||||
* NOTE: We do no checking to ensure that 'prev' is NOT a
|
||||
* NULL pointer.
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(prev);
|
||||
|
||||
n = n->next;
|
||||
return (n == n->next ? NULL : PHP_DLST_USERSPACE(n));
|
||||
}
|
||||
|
||||
PUBLIC void *dlst_prev(void *next)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: dlst_prev
|
||||
* Parameters: next - Next node in list to obtain previous node from
|
||||
* Returns: Pointer to the previous node in the list, NULL at start list.
|
||||
*
|
||||
* Description: Returns a pointer to the user space of the prev node in the
|
||||
* list given a pointer to the user space of the next node.
|
||||
* If we have reached the start of the list, we return NULL. The
|
||||
* start of the list is detected when the prev pointer of a node
|
||||
* points back to itself, as does the dummy head node's prev
|
||||
* pointer. This enables us to detect the start of the list
|
||||
* without needed access to the list data structure itself.
|
||||
*
|
||||
* NOTE: We do no checking to ensure that 'next' is NOT a
|
||||
* NULL pointer.
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(next);
|
||||
|
||||
n = n->prev;
|
||||
return (n == n->prev ? NULL : PHP_DLST_USERSPACE(n));
|
||||
}
|
||||
|
||||
/* Static globals required by merge() */
|
||||
|
||||
static PHP_DLST_BUCKET *z;
|
||||
static int (*cmp)(void*,void*);
|
||||
|
||||
PRIVATE PHP_DLST_BUCKET *merge(PHP_DLST_BUCKET *a,PHP_DLST_BUCKET *b,PHP_DLST_BUCKET **end)
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: merge
|
||||
* Parameters: a,b - Sublist's to merge
|
||||
* Returns: Pointer to the merged sublists.
|
||||
*
|
||||
* Description: Merges two sorted lists of nodes together into a single
|
||||
* sorted list.
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
PHP_DLST_BUCKET *c;
|
||||
|
||||
/* Go through the lists, merging them together in sorted order */
|
||||
|
||||
c = z;
|
||||
while (a != z && b != z) {
|
||||
if ((*cmp)(PHP_DLST_USERSPACE(a),PHP_DLST_USERSPACE(b)) <= 0) {
|
||||
c->next = a; c = a; a = a->next;
|
||||
}
|
||||
else {
|
||||
c->next = b; c = b; b = b->next;
|
||||
}
|
||||
};
|
||||
|
||||
/* If one of the lists is not exhausted, then re-attach it to the end
|
||||
* of the newly merged list
|
||||
*/
|
||||
|
||||
if (a != z) c->next = a;
|
||||
if (b != z) c->next = b;
|
||||
|
||||
/* Set *end to point to the end of the newly merged list */
|
||||
|
||||
while (c->next != z) c = c->next;
|
||||
*end = c;
|
||||
|
||||
/* Determine the start of the merged lists, and reset z to point to
|
||||
* itself
|
||||
*/
|
||||
|
||||
c = z->next; z->next = z;
|
||||
return c;
|
||||
}
|
||||
|
||||
PUBLIC void dlst_mergesort(DLIST *l,int (*cmp_func)(void*,void*))
|
||||
/****************************************************************************
|
||||
*
|
||||
* Function: dlst_mergesort
|
||||
* Parameters: l - List to merge sort
|
||||
* cmp_func - Function to compare two user spaces
|
||||
*
|
||||
* Description: Mergesort's all the nodes in the list. 'cmp' must point to
|
||||
* a comparison function that can compare the user spaces of
|
||||
* two different nodes. 'cmp' should work the same as
|
||||
* strcmp(), in terms of the values it returns. Rather than
|
||||
* waste processing time keeping the previous pointers up to
|
||||
* date while performing the mergesort, we simply run through
|
||||
* the list at the end of the sort to fix the previous pointers.
|
||||
*
|
||||
****************************************************************************/
|
||||
{
|
||||
int i,N;
|
||||
PHP_DLST_BUCKET *a,*b; /* Pointers to sublists to merge */
|
||||
PHP_DLST_BUCKET *c; /* Pointer to end of sorted sublists */
|
||||
PHP_DLST_BUCKET *head; /* Pointer to dummy head node for list */
|
||||
PHP_DLST_BUCKET *todo; /* Pointer to sublists yet to be sorted */
|
||||
PHP_DLST_BUCKET *t; /* Temporary */
|
||||
|
||||
/* Set up globals required by merge() and pointer to head */
|
||||
|
||||
z = l->z; cmp = cmp_func; head = l->head;
|
||||
|
||||
for (N = 1,a = z; a != head->next; N = N + N) {
|
||||
todo = head->next; c = head;
|
||||
while (todo != z) {
|
||||
|
||||
/* Build first sublist to be merged, and splice from main list
|
||||
*/
|
||||
|
||||
a = t = todo;
|
||||
for (i = 1; i < N; i++) t = t->next;
|
||||
b = t->next; t->next = z; t = b;
|
||||
|
||||
/* Build second sublist to be merged and splice from main list
|
||||
*/
|
||||
|
||||
for (i = 1; i < N; i++) t = t->next;
|
||||
todo = t->next; t->next = z;
|
||||
|
||||
/* Merge the two sublists created, and set 'c' to point to the
|
||||
* end of the newly merged sublists.
|
||||
*/
|
||||
|
||||
c->next = merge(a,b,&t); c = t;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix the previous pointers for the list */
|
||||
|
||||
a = b = l->head;
|
||||
b = b->next;
|
||||
while (1) {
|
||||
b->prev = a;
|
||||
if (b == z)
|
||||
break;
|
||||
a = a->next;
|
||||
b = b->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 1991 Kendall Bennett.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Filename: $RCSfile$
|
||||
* Version: $Revision$
|
||||
*
|
||||
* Language: ANSI C
|
||||
* Environment: any
|
||||
*
|
||||
* Description: Header file for doubly linked list routines.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Revision History:
|
||||
* -----------------
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1 1999/04/21 23:11:20 ssb
|
||||
* moved apache, com and hyperwave into ext/
|
||||
*
|
||||
* Revision 1.1.1.1 1999/04/07 21:03:20 zeev
|
||||
* PHP 4.0
|
||||
*
|
||||
* Revision 1.1.1.1 1999/03/17 04:29:11 andi
|
||||
* PHP4
|
||||
*
|
||||
* Revision 1.1.1.1 1998/12/21 07:56:22 andi
|
||||
* Trying to start the zend CVS tree
|
||||
*
|
||||
* Revision 1.2 1998/08/14 15:51:12 shane
|
||||
* Some work on getting hyperwave to work on windows. hg_comm needs a lot of work.
|
||||
*
|
||||
* Mainly, signals, fnctl, bzero, bcopy, etc are not portable functions. Most of this
|
||||
* will have to be rewriten for windows.
|
||||
*
|
||||
* Revision 1.1 1998/08/12 09:29:16 steinm
|
||||
* First version of Hyperwave module.
|
||||
*
|
||||
* Revision 1.5 91/12/31 19:40:54 kjb
|
||||
*
|
||||
* Modified include files directories.
|
||||
*
|
||||
* Revision 1.4 91/09/27 03:10:41 kjb
|
||||
* Added compatibility with C++.
|
||||
*
|
||||
* Revision 1.3 91/09/26 10:07:16 kjb
|
||||
* Took out extern references
|
||||
*
|
||||
* Revision 1.2 91/09/01 19:37:20 ROOT_DOS
|
||||
* Changed DLST_TAIL macro so that it returns a pointer to the REAL last
|
||||
* node of the list, not the dummy last node (l->z).
|
||||
*
|
||||
* Revision 1.1 91/09/01 18:38:23 ROOT_DOS
|
||||
* Initial revision
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __DLIST_H
|
||||
#define __DLIST_H
|
||||
|
||||
#ifndef __DEBUG_H
|
||||
/*#include "debug.h"*/
|
||||
#endif
|
||||
|
||||
/*---------------------- Macros and type definitions ----------------------*/
|
||||
|
||||
typedef struct PHP_DLST_BUCKET {
|
||||
struct PHP_DLST_BUCKET *next;
|
||||
struct PHP_DLST_BUCKET *prev;
|
||||
} PHP_DLST_BUCKET;
|
||||
|
||||
/* necessary for AIX 4.2.x */
|
||||
|
||||
#ifdef hz
|
||||
#undef hz
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int count; /* Number of elements currently in list */
|
||||
PHP_DLST_BUCKET *head; /* Pointer to head element of list */
|
||||
PHP_DLST_BUCKET *z; /* Pointer to last node of list */
|
||||
PHP_DLST_BUCKET hz[2]; /* Space for head and z nodes */
|
||||
} DLIST;
|
||||
|
||||
/* Return a pointer to the user space given the address of the header of
|
||||
* a node.
|
||||
*/
|
||||
|
||||
#define PHP_DLST_USERSPACE(h) ((void*)((PHP_DLST_BUCKET*)(h) + 1))
|
||||
|
||||
/* Return a pointer to the header of a node, given the address of the
|
||||
* user space.
|
||||
*/
|
||||
|
||||
#define PHP_DLST_HEADER(n) ((PHP_DLST_BUCKET*)(n) - 1)
|
||||
|
||||
/* Return a pointer to the user space of the list's head node. This user
|
||||
* space does not actually exist, but it is useful to be able to address
|
||||
* it to enable insertion at the start of the list.
|
||||
*/
|
||||
|
||||
#define PHP_DLST_HEAD(l) PHP_DLST_USERSPACE((l)->head)
|
||||
|
||||
/* Return a pointer to the user space of the last node in list. */
|
||||
|
||||
#define PHP_DLST_TAIL(l) PHP_DLST_USERSPACE((l)->z->prev)
|
||||
|
||||
/* Determine if a list is empty
|
||||
*/
|
||||
|
||||
#define PHP_DLST_EMPTY(l) ((l)->count == 0)
|
||||
|
||||
/*-------------------------- Function Prototypes --------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void *dlst_newnode(int size);
|
||||
void dlst_freenode(void *node);
|
||||
DLIST *dlst_init(void);
|
||||
void dlst_kill(DLIST *l,void (*freeNode)(void *node));
|
||||
void dlst_insertafter(DLIST *l,void *node,void *after);
|
||||
void *dlst_deletenext(DLIST *l,void *node);
|
||||
void *dlst_first(DLIST *l);
|
||||
void *dlst_last(DLIST *l);
|
||||
void *dlst_next(void *prev);
|
||||
void *dlst_prev(void *next);
|
||||
void dlst_mergesort(DLIST *l,int (*cmp_func)(void*,void*));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
|
||||
|
||||
AC_DEFUN(LIB_SHARED_CONVENIENCE,[
|
||||
lib_target="\$(LTLIBRARY_NAME)"
|
||||
cat >>$1<<EOF
|
||||
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
|
||||
\$(SHARED_LIBTOOL) --mode=link \$(CCLD) \$(CFLAGS) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
|
||||
|
||||
EOF
|
||||
])
|
||||
|
||||
AC_DEFUN(LIB_SHARED_MODULE,[
|
||||
lib_target="\$(LTLIBRARY_SHARED_NAME)"
|
||||
cat >>$1<<EOF
|
||||
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
|
||||
\$(SHARED_LIBTOOL) --mode=link \$(CCLD) \$(CFLAGS) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
|
||||
\$(SHARED_LIBTOOL) --mode=install cp \[$]@ \$(phplibdir)
|
||||
|
||||
EOF
|
||||
])
|
||||
|
||||
AC_DEFUN(LIB_STATIC_CONVENIENCE,[
|
||||
lib_target="\$(LTLIBRARY_NAME)"
|
||||
cat >>$1<<EOF
|
||||
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
|
||||
\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)
|
||||
|
||||
EOF
|
||||
])
|
||||
|
||||
dnl LIB_BUILD(path, shared, convenience)
|
||||
dnl sets up path to build a shared/static convenience/module
|
||||
AC_DEFUN(LIB_BUILD,[
|
||||
lib_makefile="$1/libs.mk"
|
||||
lib_target=""
|
||||
|
||||
$php_shtool mkdir -p $1
|
||||
cat >$lib_makefile<<EOF
|
||||
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo)
|
||||
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
|
||||
EOF
|
||||
|
||||
if test "$2" = "shared" || test "$2" = "yes"; then
|
||||
lib_build_shared=yes
|
||||
if test -n "$3"; then
|
||||
dnl ---------------------------------------- Shared Convenience
|
||||
LIB_SHARED_CONVENIENCE($lib_makefile)
|
||||
else
|
||||
dnl ---------------------------------------- Shared Module
|
||||
LIB_SHARED_MODULE($lib_makefile)
|
||||
fi
|
||||
else
|
||||
dnl ---------------------------------------- Static Convenience = Static Module
|
||||
LIB_STATIC_CONVENIENCE($lib_makefile)
|
||||
fi
|
||||
|
||||
dnl ---------------------------------------- Generate build targets
|
||||
if test -n "$lib_target"; then
|
||||
cat >>$lib_makefile<<EOF
|
||||
targets = $lib_target
|
||||
EOF
|
||||
fi
|
||||
])
|
||||
+2
-19
@@ -1,21 +1,4 @@
|
||||
|
||||
DEPTH = ..
|
||||
topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
SUBDIRS = $(EXT_SUBDIRS)
|
||||
|
||||
SUBDIRS = $(EXT_STATIC) $(EXT_SHARED)
|
||||
|
||||
all:
|
||||
@list='$(EXT_STATIC)'; for i in $$list; do \
|
||||
echo "Making all in $$i"; \
|
||||
(cd $$i && $(MAKE) all) || exit 1; \
|
||||
done
|
||||
@list='$(EXT_SHARED)'; for i in $$list; do \
|
||||
echo "Making shared in $$i"; \
|
||||
(cd $$i && $(MAKE) shared) || exit 1; \
|
||||
done
|
||||
|
||||
NO_RECURSION = all
|
||||
|
||||
include $(topsrcdir)/build/rules.mk
|
||||
include $(top_srcdir)/build/rules.mk
|
||||
@@ -1,10 +1,5 @@
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libaspell.la
|
||||
LTLIBRARY_SOURCES = aspell.c
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
+10
-7
@@ -4,10 +4,10 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.01 of the PHP license, |
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_01.txt. |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
@@ -19,7 +19,8 @@
|
||||
/* $Id$ */
|
||||
|
||||
#include "php.h"
|
||||
#if defined(COMPILE_DL)
|
||||
|
||||
#if defined(COMPILE_DL) || defined(COMPILE_DL_ASPELL)
|
||||
#include "phpdl.h"
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
@@ -30,6 +31,7 @@
|
||||
|
||||
#include "php_aspell.h"
|
||||
#include <aspell-c.h>
|
||||
#include "ext/standard/info.h"
|
||||
|
||||
function_entry aspell_functions[] = {
|
||||
PHP_FE(aspell_new, NULL)
|
||||
@@ -46,8 +48,8 @@ zend_module_entry aspell_module_entry = {
|
||||
};
|
||||
|
||||
|
||||
#if COMPILE_DL
|
||||
DLEXPORT zend_module_entry *get_module(void) { return &aspell_module_entry; }
|
||||
#if defined(COMPILE_DL) || defined(COMPILE_DL_ASPELL)
|
||||
ZEND_GET_MODULE(aspell)
|
||||
#endif
|
||||
|
||||
static void php_aspell_close(aspell *sc)
|
||||
@@ -194,8 +196,9 @@ PHP_FUNCTION(aspell_check_raw)
|
||||
|
||||
PHP_MINFO_FUNCTION(aspell)
|
||||
{
|
||||
php_printf("ASpell support enabled");
|
||||
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "ASpell Support", "enabled");
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,11 +1,6 @@
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libbcmath.la
|
||||
LTLIBRARY_SOURCES = bcmath.c number.c
|
||||
LTLIBRARY_SHARED_NAME = bcmath.la
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
+4
-4
@@ -4,10 +4,10 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.01 of the PHP license, |
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_01.txt. |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
@@ -40,8 +40,8 @@ zend_module_entry bcmath_module_entry = {
|
||||
"bcmath", bcmath_functions, NULL, NULL, PHP_RINIT(bcmath), PHP_RSHUTDOWN(bcmath), NULL, STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#if COMPILE_DL
|
||||
zend_module_entry *get_module() { return &bcmath_module_entry; };
|
||||
#if defined(COMPILE_DL) || defined(COMPILE_DL_BCMATH)
|
||||
ZEND_GET_MODULE(bcmath)
|
||||
#endif
|
||||
|
||||
#ifndef THREAD_SAFE
|
||||
|
||||
+13
-15
@@ -1,20 +1,18 @@
|
||||
dnl $Id$
|
||||
|
||||
AC_MSG_CHECKING(whether to enable bc style precision math functions)
|
||||
AC_ARG_ENABLE(bcmath,
|
||||
PHP_ARG_ENABLE(bcmath,whether to enable bc style precision math functions,
|
||||
[ --enable-bcmath Compile with bc style precision math functions.
|
||||
Read README-BCMATH for instructions on how to
|
||||
get this module installed. ],
|
||||
[
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath])
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_EXTENSION(bcmath)
|
||||
else
|
||||
AC_DEFINE(WITH_BCMATH, 0,[ ])
|
||||
AC_MSG_RESULT(no)
|
||||
get this module installed. ])
|
||||
|
||||
if test "$PHP_BCMATH" != "no"; then
|
||||
AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath])
|
||||
PHP_EXTENSION(bcmath, $ext_shared)
|
||||
if test ! -f $ext_srcdir/number.c || grep "Dummy File" $ext_srcdir/number.c >/dev/null; then
|
||||
AC_MSG_ERROR(You do not have the bcmath package. Please read the README.BCMATH file.)
|
||||
fi
|
||||
],[
|
||||
AC_DEFINE(WITH_BCMATH, 0,[ ])
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
fi
|
||||
|
||||
dnl ## Local Variables:
|
||||
dnl ## tab-width: 4
|
||||
dnl ## End:
|
||||
@@ -0,0 +1,6 @@
|
||||
|
||||
LTLIBRARY_NAME = libcalendar.la
|
||||
LTLIBRARY_SOURCES = calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c
|
||||
LTLIBRARY_SHARED_NAME = calendar.la
|
||||
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Shane Caraveo <shane@caraveo.com> |
|
||||
| Colin Viebrock <cmv@easydns.com> |
|
||||
| Hartmut Holzgraefe <hartmut@six.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
/* $Id: */
|
||||
|
||||
#include "php.h"
|
||||
#include "php_calendar.h"
|
||||
#include "sdncal.h"
|
||||
#include <time.h>
|
||||
|
||||
/* {{{ proto int unixtojd([int timestamp])
|
||||
Convert UNIX timestamp to Julian Day */
|
||||
PHP_FUNCTION(unixtojd)
|
||||
{
|
||||
pval *timestamp;
|
||||
long jdate;
|
||||
time_t t;
|
||||
struct tm *ta, tmbuf;
|
||||
int myargc=ARG_COUNT(ht);
|
||||
|
||||
if ((myargc > 1) || (zend_get_parameters(ht,myargc, ×tamp) != SUCCESS)) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if(myargc==1) {
|
||||
convert_to_long(timestamp);
|
||||
t = timestamp->value.lval;
|
||||
} else {
|
||||
t = time(NULL);
|
||||
}
|
||||
|
||||
ta = php_localtime_r(&t, &tmbuf);
|
||||
jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1,ta->tm_mday);
|
||||
|
||||
RETURN_LONG(jdate);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int jdtounix(int jday)
|
||||
Convert Julian Day to UNIX timestamp */
|
||||
PHP_FUNCTION(jdtounix)
|
||||
{
|
||||
pval *jday;
|
||||
long uday;
|
||||
|
||||
if ((ARG_COUNT(ht)!= 1) || (zend_get_parameters(ht,1, &jday) != SUCCESS)) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long(jday);
|
||||
|
||||
uday = jday->value.lval - 2440588 /* J.D. of 1.1.1970 */;
|
||||
|
||||
if(uday<0) RETURN_FALSE; /* before beginning of unix epoch */
|
||||
if(uday>24755) RETURN_FALSE; /* behind end of unix epoch */
|
||||
|
||||
RETURN_LONG(uday*24*3600);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -0,0 +1,334 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Shane Caraveo <shane@caraveo.com> |
|
||||
| Colin Viebrock <cmv@easydns.com> |
|
||||
| Hartmut Holzgraefe <hartmut@six.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
/* $Id: */
|
||||
|
||||
#include "php.h"
|
||||
#include "php_calendar.h"
|
||||
#include "sdncal.h"
|
||||
|
||||
function_entry calendar_functions[] = {
|
||||
PHP_FE(jdtogregorian, NULL)
|
||||
PHP_FE(gregoriantojd, NULL)
|
||||
PHP_FE(jdtojulian, NULL)
|
||||
PHP_FE(juliantojd, NULL)
|
||||
PHP_FE(jdtojewish, NULL)
|
||||
PHP_FE(jewishtojd, NULL)
|
||||
PHP_FE(jdtofrench, NULL)
|
||||
PHP_FE(frenchtojd, NULL)
|
||||
PHP_FE(jddayofweek, NULL)
|
||||
PHP_FE(jdmonthname, NULL)
|
||||
PHP_FE(easter_date, NULL)
|
||||
PHP_FE(easter_days, NULL)
|
||||
PHP_FE(unixtojd, NULL)
|
||||
PHP_FE(jdtounix, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
zend_module_entry calendar_module_entry = {
|
||||
"Calendar",
|
||||
calendar_functions,
|
||||
NULL, /*PHP_MINIT(calendar),*/
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(calendar),
|
||||
STANDARD_MODULE_PROPERTIES,
|
||||
};
|
||||
|
||||
#if COMPILE_DL
|
||||
ZEND_GET_MODULE(calendar)
|
||||
#endif
|
||||
|
||||
PHP_MINIT_FUNCTION(calendar)
|
||||
{
|
||||
/*
|
||||
REGISTER_INT_CONSTANT("CAL_EASTER_TO_xxx",0, CONST_CS | CONST_PERSISTENT);
|
||||
*/
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MINFO_FUNCTION(calendar)
|
||||
{
|
||||
php_printf("Calendar support enabled");
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto string jdtogregorian(int juliandaycount)
|
||||
Convert a julian day count to a gregorian calendar date */
|
||||
PHP_FUNCTION(jdtogregorian)
|
||||
{
|
||||
pval **julday;
|
||||
int year, month, day;
|
||||
char date[10];
|
||||
|
||||
if (zend_get_parameters_ex(1, &julday) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(julday);
|
||||
SdnToGregorian((*julday)->value.lval, &year, &month, &day);
|
||||
sprintf(date, "%i/%i/%i", month, day, year);
|
||||
|
||||
RETURN_STRING(date,1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int gregoriantojd(int month, int day, int year)
|
||||
Convert a gregorian calendar date to julian day count */
|
||||
PHP_FUNCTION(gregoriantojd)
|
||||
{
|
||||
pval **year, **month, **day;
|
||||
int jdate;
|
||||
|
||||
if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(month);
|
||||
convert_to_long_ex(day);
|
||||
convert_to_long_ex(year);
|
||||
|
||||
jdate = GregorianToSdn((*year)->value.lval, (*month)->value.lval,(*day)->value.lval);
|
||||
|
||||
RETURN_LONG(jdate);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string jdtojulian(int juliandaycount)
|
||||
Convert a julian day count to a julian calendar date */
|
||||
PHP_FUNCTION(jdtojulian)
|
||||
{
|
||||
pval **julday;
|
||||
int year, month, day;
|
||||
char date[10];
|
||||
|
||||
if (zend_get_parameters_ex(1, &julday) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(julday);
|
||||
SdnToJulian((*julday)->value.lval, &year, &month, &day);
|
||||
sprintf(date, "%i/%i/%i", month, day, year);
|
||||
|
||||
RETURN_STRING(date,1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto int juliantojd(int month, int day, int year)
|
||||
Convert a julian calendar date to julian day count */
|
||||
PHP_FUNCTION(juliantojd)
|
||||
{
|
||||
pval **year, **month, **day;
|
||||
int jdate;
|
||||
|
||||
if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(month);
|
||||
convert_to_long_ex(day);
|
||||
convert_to_long_ex(year);
|
||||
|
||||
jdate = JulianToSdn((*year)->value.lval,(*month)->value.lval, (*day)->value.lval);
|
||||
|
||||
RETURN_LONG(jdate);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto string jdtojewish(int juliandaycount)
|
||||
Convert a julian day count to a jewish calendar date */
|
||||
PHP_FUNCTION(jdtojewish)
|
||||
{
|
||||
pval **julday;
|
||||
int year, month, day;
|
||||
char date[10];
|
||||
|
||||
if (zend_get_parameters_ex(1, &julday) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(julday);
|
||||
|
||||
SdnToJewish((*julday)->value.lval, &year, &month, &day);
|
||||
sprintf(date, "%i/%i/%i", month, day, year);
|
||||
|
||||
RETURN_STRING(date,1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto int jewishtojd(int month, int day, int year)
|
||||
Convert a jewish calendar date to a julian day count */
|
||||
PHP_FUNCTION(jewishtojd)
|
||||
{
|
||||
pval **year, **month, **day;
|
||||
int jdate;
|
||||
|
||||
if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(month);
|
||||
convert_to_long_ex(day);
|
||||
convert_to_long_ex(year);
|
||||
|
||||
jdate = JewishToSdn((*year)->value.lval,(*month)->value.lval, (*day)->value.lval);
|
||||
|
||||
RETURN_LONG(jdate);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto string jdtofrench(int juliandaycount)
|
||||
Convert a julian day count to a french republic calendar date */
|
||||
PHP_FUNCTION(jdtofrench)
|
||||
{
|
||||
pval **julday;
|
||||
int year, month, day;
|
||||
char date[10];
|
||||
|
||||
if (zend_get_parameters_ex(1, &julday) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(julday);
|
||||
|
||||
SdnToFrench((*julday)->value.lval, &year, &month, &day);
|
||||
sprintf(date, "%i/%i/%i", month, day, year);
|
||||
|
||||
RETURN_STRING(date,1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto int frenchtojd(int month, int day, int year)
|
||||
Convert a french republic calendar date to julian day count */
|
||||
PHP_FUNCTION(frenchtojd)
|
||||
{
|
||||
pval **year, **month, **day;
|
||||
int jdate;
|
||||
|
||||
if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(month);
|
||||
convert_to_long_ex(day);
|
||||
convert_to_long_ex(year);
|
||||
|
||||
jdate = FrenchToSdn((*year)->value.lval,(*month)->value.lval,(*day)->value.lval);
|
||||
|
||||
RETURN_LONG(jdate);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto mixed jddayofweek(int juliandaycount [, int mode])
|
||||
Returns name or number of day of week from julian day count */
|
||||
PHP_FUNCTION(jddayofweek)
|
||||
{
|
||||
pval *julday, *mode;
|
||||
int day;
|
||||
char *daynamel, *daynames;
|
||||
int myargc=ARG_COUNT(ht),mymode=0;
|
||||
|
||||
if ((myargc < 1) || (myargc > 2) || (zend_get_parameters(ht,myargc, &julday, &mode) != SUCCESS)) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long(julday);
|
||||
if(myargc==2) {
|
||||
convert_to_long(mode);
|
||||
mymode = mode->value.lval;
|
||||
}
|
||||
|
||||
day = DayOfWeek(julday->value.lval);
|
||||
daynamel = DayNameLong[day];
|
||||
daynames = DayNameShort[day];
|
||||
|
||||
switch (mymode) {
|
||||
case 0L:
|
||||
RETURN_LONG(day);
|
||||
break;
|
||||
case 1L:
|
||||
RETURN_STRING(daynamel,1);
|
||||
break;
|
||||
case 2L:
|
||||
RETURN_STRING(daynames,1);
|
||||
break;
|
||||
default:
|
||||
RETURN_LONG(day);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto string jdmonthname(int juliandaycount, int mode)
|
||||
Returns name of month for julian day count */
|
||||
PHP_FUNCTION(jdmonthname)
|
||||
{
|
||||
pval **julday, **mode;
|
||||
char *monthname = NULL;
|
||||
int month, day, year;
|
||||
|
||||
if (zend_get_parameters_ex(2, &julday, &mode) != SUCCESS) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(julday);
|
||||
convert_to_long_ex(mode);
|
||||
|
||||
switch((*mode)->value.lval) {
|
||||
case 0L: /* gregorian or julian month */
|
||||
SdnToGregorian((*julday)->value.lval,&year, &month, &day);
|
||||
monthname = MonthNameShort[month];
|
||||
break;
|
||||
case 1L: /* gregorian or julian month */
|
||||
SdnToGregorian((*julday)->value.lval,&year, &month, &day);
|
||||
monthname = MonthNameLong[month];
|
||||
break;
|
||||
case 2L: /* gregorian or julian month */
|
||||
SdnToJulian((*julday)->value.lval, &year,&month, &day);
|
||||
monthname = MonthNameShort[month];
|
||||
break;
|
||||
case 3L: /* gregorian or julian month */
|
||||
SdnToJulian((*julday)->value.lval, &year,&month, &day);
|
||||
monthname = MonthNameLong[month];
|
||||
break;
|
||||
case 4L: /* jewish month */
|
||||
SdnToJewish((*julday)->value.lval, &year,&month, &day);
|
||||
monthname = JewishMonthName[month];
|
||||
break;
|
||||
case 5L: /* french month */
|
||||
SdnToFrench((*julday)->value.lval, &year,&month, &day);
|
||||
monthname = FrenchMonthName[month];
|
||||
break;
|
||||
default: /* default gregorian */
|
||||
/* FIXME - need to set monthname to something here ?? */
|
||||
break;
|
||||
}
|
||||
|
||||
RETURN_STRING(monthname,1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
# Microsoft Developer Studio Project File - Name="calendar" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=calendar - Win32 Release_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 "calendar.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 "calendar.mak" CFG="calendar - Win32 Release_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "calendar - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "calendar - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "calendar - Win32 Release_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release_TS"
|
||||
# PROP BASE Intermediate_Dir "Release_TS"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release_TS"
|
||||
# PROP Intermediate_Dir "Release_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL" /D "DBNTWIN32" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CALENDAR_EXPORTS" /D "COMPILE_DL" /D ZTS=1 /D ZEND_WIN32=1 /D PHP_WIN32=1 /D ZEND_DEBUG=0 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
# ADD RSC /l 0x406 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_calendar.dll" /libpath:"..\..\Release_TS"
|
||||
|
||||
!ELSEIF "$(CFG)" == "calendar - Win32 Debug_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Debug_TS"
|
||||
# PROP BASE Intermediate_Dir "Debug_TS"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Debug_TS"
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL" /D "DBNTWIN32" /D ZTS=1 /D MSSQL70=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CALENDAR_EXPORTS" /D "COMPILE_DL" /D ZTS=1 /D ZEND_WIN32=1 /D PHP_WIN32=1 /D ZEND_DEBUG=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
# ADD RSC /l 0x406 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS" /libpath:"mssql-70"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_calendar.dll" /libpath:"..\..\Debug_TS"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "calendar - Win32 Release_TS"
|
||||
# Name "calendar - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cal_unix.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\calendar.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dow.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\easter.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\french.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gregor.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\jewish.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\julian.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\calendar.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\sdncal.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,9 @@
|
||||
dnl $Id$
|
||||
|
||||
PHP_ARG_ENABLE(calendar,whether to enable calendar conversion support,
|
||||
[ --enable-calendar Enable support for calendar conversion])
|
||||
|
||||
if test "$PHP_CALENDAR" = "yes"; then
|
||||
AC_DEFINE(HAVE_CALENDAR,1,[ ])
|
||||
PHP_EXTENSION(calendar, $ext_shared)
|
||||
fi
|
||||
@@ -0,0 +1,67 @@
|
||||
|
||||
/* $selId: dow.c,v 2.0 1995/10/24 01:13:06 lees Exp $
|
||||
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
|
||||
* Permission granted to use, copy, modify, distribute and sell so long as
|
||||
* the above copyright and this permission statement are retained in all
|
||||
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* These are the externally visible components of this file:
|
||||
*
|
||||
* int
|
||||
* DayOfWeek(
|
||||
* long int sdn);
|
||||
*
|
||||
* Convert a SDN to a day-of-week number (0 to 6). Where 0 stands for
|
||||
* Sunday, 1 for Monday, etc. and 6 stands for Saturday.
|
||||
*
|
||||
* char *DayNameShort[7];
|
||||
*
|
||||
* Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to
|
||||
* the abbreviated (three character) name of the day.
|
||||
*
|
||||
* char *DayNameLong[7];
|
||||
*
|
||||
* Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to
|
||||
* the name of the day.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "sdncal.h"
|
||||
|
||||
int DayOfWeek(
|
||||
long int sdn)
|
||||
{
|
||||
int dow;
|
||||
|
||||
dow = (sdn + 1) % 7;
|
||||
if (dow >= 0) {
|
||||
return (dow);
|
||||
} else {
|
||||
return (dow + 7);
|
||||
}
|
||||
}
|
||||
|
||||
char *DayNameShort[7] =
|
||||
{
|
||||
"Sun",
|
||||
"Mon",
|
||||
"Tue",
|
||||
"Wed",
|
||||
"Thu",
|
||||
"Fri",
|
||||
"Sat"
|
||||
};
|
||||
|
||||
char *DayNameLong[7] =
|
||||
{
|
||||
"Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday"
|
||||
};
|
||||
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Shane Caraveo <shane@caraveo.com> |
|
||||
| Colin Viebrock <cmv@easydns.com> |
|
||||
| Hartmut Holzgraefe <hartmut@six.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
/* $Id: */
|
||||
|
||||
#include "php.h"
|
||||
#include "php_calendar.h"
|
||||
#include "sdncal.h"
|
||||
#include <time.h>
|
||||
|
||||
static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
|
||||
{
|
||||
|
||||
/* based on code by Simon Kershaw, <webmaster@ely.anglican.org> */
|
||||
|
||||
pval *year_arg;
|
||||
struct tm *ta, te;
|
||||
time_t the_time;
|
||||
long year, golden, solar, lunar, pfm, dom, tmp, easter;
|
||||
|
||||
switch(ARG_COUNT(ht)) {
|
||||
case 0:
|
||||
the_time = time(NULL);
|
||||
ta = localtime(&the_time);
|
||||
year = ta->tm_year + 1900;
|
||||
break;
|
||||
case 1:
|
||||
if (getParameters(ht, 1, &year_arg) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long(year_arg);
|
||||
year = year_arg->value.lval;
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */
|
||||
php3_error(E_WARNING, "easter_date() is only valid for years between 1970 and 2037 inclusive");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
golden = (year % 19) + 1; /* the Golden number */
|
||||
|
||||
if ( year <= 1752 ) { /* JULIAN CALENDAR */
|
||||
dom = (year + (year/4) + 5) % 7; /* the "Dominical number" - finding a Sunday */
|
||||
if (dom < 0) {
|
||||
dom += 7;
|
||||
}
|
||||
|
||||
pfm = (3 - (11*golden) - 7) % 30; /* uncorrected date of the Paschal full moon */
|
||||
if (pfm < 0) {
|
||||
pfm += 30;
|
||||
}
|
||||
} else { /* GREGORIAN CALENDAR */
|
||||
dom = (year + (year/4) - (year/100) + (year/400)) % 7; /* the "Domincal number" */
|
||||
if (dom < 0) {
|
||||
dom += 7;
|
||||
}
|
||||
|
||||
solar = (year-1600)/100 - (year-1600)/400; /* the solar and lunar corrections */
|
||||
lunar = (((year-1400) / 100) * 8) / 25;
|
||||
|
||||
pfm = (3 - (11*golden) + solar - lunar) % 30; /* uncorrected date of the Paschal full moon */
|
||||
if (pfm < 0) {
|
||||
pfm += 30;
|
||||
}
|
||||
}
|
||||
|
||||
if ((pfm == 29) || (pfm == 28 && golden > 11)) { /* corrected date of the Paschal full moon */
|
||||
pfm--; /* - days after 21st March */
|
||||
}
|
||||
|
||||
tmp = (4-pfm-dom) % 7;
|
||||
if (tmp < 0) {
|
||||
tmp += 7;
|
||||
}
|
||||
|
||||
easter = pfm + tmp + 1; /* Easter as the number of days after 21st March */
|
||||
|
||||
if (gm) { /* return a timestamp */
|
||||
te.tm_isdst = -1;
|
||||
te.tm_year = year-1900;
|
||||
te.tm_sec = 0;
|
||||
te.tm_min = 0;
|
||||
te.tm_hour = 0;
|
||||
|
||||
if (easter < 11) {
|
||||
te.tm_mon = 2; /* March */
|
||||
te.tm_mday = easter+21;
|
||||
} else {
|
||||
te.tm_mon = 3; /* April */
|
||||
te.tm_mday = easter-10;
|
||||
}
|
||||
|
||||
return_value->value.lval = mktime(&te);
|
||||
} else { /* return the days after March 21 */
|
||||
return_value->value.lval = easter;
|
||||
}
|
||||
|
||||
return_value->type = IS_LONG;
|
||||
|
||||
}
|
||||
|
||||
/* {{{ proto int easter_date([int year])
|
||||
Return the timestamp of midnight on Easter of a given year (defaults to current year) */
|
||||
PHP_FUNCTION(easter_date)
|
||||
{
|
||||
_cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int easter_days([int year])
|
||||
Return the number of days after March 21 that Easter falls on for a given year (defaults to current year) */
|
||||
PHP_FUNCTION(easter_days)
|
||||
{
|
||||
_cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
@@ -0,0 +1,150 @@
|
||||
/* $selId: french.c,v 2.0 1995/10/24 01:13:06 lees Exp $
|
||||
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
|
||||
* Permission granted to use, copy, modify, distribute and sell so long as
|
||||
* the above copyright and this permission statement are retained in all
|
||||
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* These are the externally visible components of this file:
|
||||
*
|
||||
* void
|
||||
* SdnToFrench(
|
||||
* long int sdn,
|
||||
* int *pYear,
|
||||
* int *pMonth,
|
||||
* int *pDay);
|
||||
*
|
||||
* Convert a SDN to a French republican calendar date. If the input SDN is
|
||||
* before the first day of year 1 or after the last day of year 14, the
|
||||
* three output values will all be set to zero, otherwise *pYear will be in
|
||||
* the range 1 to 14 inclusive; *pMonth will be in the range 1 to 13
|
||||
* inclusive; *pDay will be in the range 1 to 30 inclusive. If *pMonth is
|
||||
* 13, the SDN represents one of the holidays at the end of the year and
|
||||
* *pDay will be in the range 1 to 6 inclusive.
|
||||
*
|
||||
* long int
|
||||
* FrenchToSdn(
|
||||
* int year,
|
||||
* int month,
|
||||
* int day);
|
||||
*
|
||||
* Convert a French republican calendar date to a SDN. Zero is returned
|
||||
* when the input date is detected as invalid or out of the supported
|
||||
* range. The return value will be > 0 for all valid, supported dates, but
|
||||
* there are some invalid dates that will return a positive value. To
|
||||
* verify that a date is valid, convert it to SDN and then back and compare
|
||||
* with the original.
|
||||
*
|
||||
* char *FrenchMonthName[14];
|
||||
*
|
||||
* Convert a French republican month number (1 to 13) to the name of the
|
||||
* French republican month (null terminated). An index of 13 (for the
|
||||
* "extra" days at the end of the year) will return the string "Extra". An
|
||||
* index of zero will return a zero length string.
|
||||
*
|
||||
* VALID RANGE
|
||||
*
|
||||
* These routines only convert dates in years 1 through 14 (Gregorian
|
||||
* dates 22 September 1792 through 22 September 1806). This more than
|
||||
* covers the period when the calendar was in use.
|
||||
*
|
||||
* I would support a wider range of dates, but I have not been able to
|
||||
* find an authoritative definition of when leap years were to have
|
||||
* occurred. There are suggestions that it was to skip a leap year ever
|
||||
* 100 years like the Gregorian calendar.
|
||||
*
|
||||
* CALENDAR OVERVIEW
|
||||
*
|
||||
* The French republican calendar was adopted in October 1793 during
|
||||
* the French Revolution and was abandoned in January 1806. The intent
|
||||
* was to create a new calendar system that was based on scientific
|
||||
* principals, not religious traditions.
|
||||
*
|
||||
* The year is divided into 12 months of 30 days each. The remaining 5
|
||||
* to 6 days in the year are grouped at the end and are holidays. Each
|
||||
* month is divided into three decades (instead of weeks) of 10 days
|
||||
* each.
|
||||
*
|
||||
* The epoch (first day of the first year) is 22 September 1792 in the
|
||||
* Gregorian calendar. Leap years are every fourth year (year 3, 7,
|
||||
* 11, etc.)
|
||||
*
|
||||
* TESTING
|
||||
*
|
||||
* This algorithm has been tested from the year 1 to 14. The source
|
||||
* code of the verification program is included in this package.
|
||||
*
|
||||
* REFERENCES
|
||||
*
|
||||
* I have found no detailed, authoritative reference on this calendar.
|
||||
* The algorithms are based on a preponderance of less authoritative
|
||||
* sources.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "sdncal.h"
|
||||
|
||||
#define SDN_OFFSET 2375474
|
||||
#define DAYS_PER_4_YEARS 1461
|
||||
#define DAYS_PER_MONTH 30
|
||||
#define FIRST_VALID 2375840
|
||||
#define LAST_VALID 2380952
|
||||
|
||||
void SdnToFrench(
|
||||
long int sdn,
|
||||
int *pYear,
|
||||
int *pMonth,
|
||||
int *pDay)
|
||||
{
|
||||
long int temp;
|
||||
int dayOfYear;
|
||||
|
||||
if (sdn < FIRST_VALID || sdn > LAST_VALID) {
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
return;
|
||||
}
|
||||
temp = (sdn - SDN_OFFSET) * 4 - 1;
|
||||
*pYear = temp / DAYS_PER_4_YEARS;
|
||||
dayOfYear = (temp % DAYS_PER_4_YEARS) / 4;
|
||||
*pMonth = dayOfYear / DAYS_PER_MONTH + 1;
|
||||
*pDay = dayOfYear % DAYS_PER_MONTH + 1;
|
||||
}
|
||||
|
||||
long int FrenchToSdn(
|
||||
int year,
|
||||
int month,
|
||||
int day)
|
||||
{
|
||||
/* check for invalid dates */
|
||||
if (year < 1 || year > 14 ||
|
||||
month < 1 || month > 13 ||
|
||||
day < 1 || day > 30) {
|
||||
return (0);
|
||||
}
|
||||
return ((year * DAYS_PER_4_YEARS) / 4
|
||||
+ (month - 1) * DAYS_PER_MONTH
|
||||
+ day
|
||||
+ SDN_OFFSET);
|
||||
}
|
||||
|
||||
char *FrenchMonthName[14] =
|
||||
{
|
||||
"",
|
||||
"Vendemiaire",
|
||||
"Brumaire",
|
||||
"Frimaire",
|
||||
"Nivose",
|
||||
"Pluviose",
|
||||
"Ventose",
|
||||
"Germinal",
|
||||
"Floreal",
|
||||
"Prairial",
|
||||
"Messidor",
|
||||
"Thermidor",
|
||||
"Fructidor",
|
||||
"Extra"
|
||||
};
|
||||
@@ -0,0 +1,265 @@
|
||||
/* $selId: gregor.c,v 2.0 1995/10/24 01:13:06 lees Exp $
|
||||
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
|
||||
* Permission granted to use, copy, modify, distribute and sell so long as
|
||||
* the above copyright and this permission statement are retained in all
|
||||
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* These are the externally visible components of this file:
|
||||
*
|
||||
* void
|
||||
* SdnToGregorian(
|
||||
* long int sdn,
|
||||
* int *pYear,
|
||||
* int *pMonth,
|
||||
* int *pDay);
|
||||
*
|
||||
* Convert a SDN to a Gregorian calendar date. If the input SDN is less
|
||||
* than 1, the three output values will all be set to zero, otherwise
|
||||
* *pYear will be >= -4714 and != 0; *pMonth will be in the range 1 to 12
|
||||
* inclusive; *pDay will be in the range 1 to 31 inclusive.
|
||||
*
|
||||
* long int
|
||||
* GregorianToSdn(
|
||||
* int inputYear,
|
||||
* int inputMonth,
|
||||
* int inputDay);
|
||||
*
|
||||
* Convert a Gregorian calendar date to a SDN. Zero is returned when the
|
||||
* input date is detected as invalid or out of the supported range. The
|
||||
* return value will be > 0 for all valid, supported dates, but there are
|
||||
* some invalid dates that will return a positive value. To verify that a
|
||||
* date is valid, convert it to SDN and then back and compare with the
|
||||
* original.
|
||||
*
|
||||
* char *MonthNameShort[13];
|
||||
*
|
||||
* Convert a Gregorian month number (1 to 12) to the abbreviated (three
|
||||
* character) name of the Gregorian month (null terminated). An index of
|
||||
* zero will return a zero length string.
|
||||
*
|
||||
* char *MonthNameLong[13];
|
||||
*
|
||||
* Convert a Gregorian month number (1 to 12) to the name of the Gregorian
|
||||
* month (null terminated). An index of zero will return a zero length
|
||||
* string.
|
||||
*
|
||||
* VALID RANGE
|
||||
*
|
||||
* 4714 B.C. to at least 10000 A.D.
|
||||
*
|
||||
* Although this software can handle dates all the way back to 4714
|
||||
* B.C., such use may not be meaningful. The Gregorian calendar was
|
||||
* not instituted until October 15, 1582 (or October 5, 1582 in the
|
||||
* Julian calendar). Some countries did not accept it until much
|
||||
* later. For example, Britain converted in 1752, The USSR in 1918 and
|
||||
* Greece in 1923. Most European countries used the Julian calendar
|
||||
* prior to the Gregorian.
|
||||
*
|
||||
* CALENDAR OVERVIEW
|
||||
*
|
||||
* The Gregorian calendar is a modified version of the Julian calendar.
|
||||
* The only difference being the specification of leap years. The
|
||||
* Julian calendar specifies that every year that is a multiple of 4
|
||||
* will be a leap year. This leads to a year that is 365.25 days long,
|
||||
* but the current accepted value for the tropical year is 365.242199
|
||||
* days.
|
||||
*
|
||||
* To correct this error in the length of the year and to bring the
|
||||
* vernal equinox back to March 21, Pope Gregory XIII issued a papal
|
||||
* bull declaring that Thursday October 4, 1582 would be followed by
|
||||
* Friday October 15, 1582 and that centennial years would only be a
|
||||
* leap year if they were a multiple of 400. This shortened the year
|
||||
* by 3 days per 400 years, giving a year of 365.2425 days.
|
||||
*
|
||||
* Another recently proposed change in the leap year rule is to make
|
||||
* years that are multiples of 4000 not a leap year, but this has never
|
||||
* been officially accepted and this rule is not implemented in these
|
||||
* algorithms.
|
||||
*
|
||||
* ALGORITHMS
|
||||
*
|
||||
* The calculations are based on three different cycles: a 400 year
|
||||
* cycle of leap years, a 4 year cycle of leap years and a 5 month
|
||||
* cycle of month lengths.
|
||||
*
|
||||
* The 5 month cycle is used to account for the varying lengths of
|
||||
* months. You will notice that the lengths alternate between 30
|
||||
* and 31 days, except for three anomalies: both July and August
|
||||
* have 31 days, both December and January have 31, and February
|
||||
* is less than 30. Starting with March, the lengths are in a
|
||||
* cycle of 5 months (31, 30, 31, 30, 31):
|
||||
*
|
||||
* Mar 31 days \
|
||||
* Apr 30 days |
|
||||
* May 31 days > First cycle
|
||||
* Jun 30 days |
|
||||
* Jul 31 days /
|
||||
*
|
||||
* Aug 31 days \
|
||||
* Sep 30 days |
|
||||
* Oct 31 days > Second cycle
|
||||
* Nov 30 days |
|
||||
* Dec 31 days /
|
||||
*
|
||||
* Jan 31 days \
|
||||
* Feb 28/9 days |
|
||||
* > Third cycle (incomplete)
|
||||
*
|
||||
* For this reason the calculations (internally) assume that the
|
||||
* year starts with March 1.
|
||||
*
|
||||
* TESTING
|
||||
*
|
||||
* This algorithm has been tested from the year 4714 B.C. to 10000
|
||||
* A.D. The source code of the verification program is included in
|
||||
* this package.
|
||||
*
|
||||
* REFERENCES
|
||||
*
|
||||
* Conversions Between Calendar Date and Julian Day Number by Robert J.
|
||||
* Tantzen, Communications of the Association for Computing Machinery
|
||||
* August 1963. (Also published in Collected Algorithms from CACM,
|
||||
* algorithm number 199).
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "sdncal.h"
|
||||
|
||||
#define SDN_OFFSET 32045
|
||||
#define DAYS_PER_5_MONTHS 153
|
||||
#define DAYS_PER_4_YEARS 1461
|
||||
#define DAYS_PER_400_YEARS 146097
|
||||
|
||||
void SdnToGregorian(
|
||||
long int sdn,
|
||||
int *pYear,
|
||||
int *pMonth,
|
||||
int *pDay)
|
||||
{
|
||||
int century;
|
||||
int year;
|
||||
int month;
|
||||
int day;
|
||||
long int temp;
|
||||
int dayOfYear;
|
||||
|
||||
if (sdn <= 0) {
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
return;
|
||||
}
|
||||
temp = (sdn + SDN_OFFSET) * 4 - 1;
|
||||
|
||||
/* Calculate the century (year/100). */
|
||||
century = temp / DAYS_PER_400_YEARS;
|
||||
|
||||
/* Calculate the year and day of year (1 <= dayOfYear <= 366). */
|
||||
temp = ((temp % DAYS_PER_400_YEARS) / 4) * 4 + 3;
|
||||
year = (century * 100) + (temp / DAYS_PER_4_YEARS);
|
||||
dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1;
|
||||
|
||||
/* Calculate the month and day of month. */
|
||||
temp = dayOfYear * 5 - 3;
|
||||
month = temp / DAYS_PER_5_MONTHS;
|
||||
day = (temp % DAYS_PER_5_MONTHS) / 5 + 1;
|
||||
|
||||
/* Convert to the normal beginning of the year. */
|
||||
if (month < 10) {
|
||||
month += 3;
|
||||
} else {
|
||||
year += 1;
|
||||
month -= 9;
|
||||
}
|
||||
|
||||
/* Adjust to the B.C./A.D. type numbering. */
|
||||
year -= 4800;
|
||||
if (year <= 0)
|
||||
year--;
|
||||
|
||||
*pYear = year;
|
||||
*pMonth = month;
|
||||
*pDay = day;
|
||||
}
|
||||
|
||||
long int GregorianToSdn(
|
||||
int inputYear,
|
||||
int inputMonth,
|
||||
int inputDay)
|
||||
{
|
||||
int year;
|
||||
int month;
|
||||
|
||||
/* check for invalid dates */
|
||||
if (inputYear == 0 || inputYear < -4714 ||
|
||||
inputMonth <= 0 || inputMonth > 12 ||
|
||||
inputDay <= 0 || inputDay > 31) {
|
||||
return (0);
|
||||
}
|
||||
/* check for dates before SDN 1 (Nov 25, 4714 B.C.) */
|
||||
if (inputYear == -4714) {
|
||||
if (inputMonth < 11) {
|
||||
return (0);
|
||||
}
|
||||
if (inputMonth == 11 && inputDay < 25) {
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
/* Make year always a positive number. */
|
||||
if (inputYear < 0) {
|
||||
year = inputYear + 4801;
|
||||
} else {
|
||||
year = inputYear + 4800;
|
||||
}
|
||||
|
||||
/* Adjust the start of the year. */
|
||||
if (inputMonth > 2) {
|
||||
month = inputMonth - 3;
|
||||
} else {
|
||||
month = inputMonth + 9;
|
||||
year--;
|
||||
}
|
||||
|
||||
return (((year / 100) * DAYS_PER_400_YEARS) / 4
|
||||
+ ((year % 100) * DAYS_PER_4_YEARS) / 4
|
||||
+ (month * DAYS_PER_5_MONTHS + 2) / 5
|
||||
+ inputDay
|
||||
- SDN_OFFSET);
|
||||
}
|
||||
|
||||
char *MonthNameShort[13] =
|
||||
{
|
||||
"",
|
||||
"Jan",
|
||||
"Feb",
|
||||
"Mar",
|
||||
"Apr",
|
||||
"May",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Aug",
|
||||
"Sep",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Dec"
|
||||
};
|
||||
|
||||
char *MonthNameLong[13] =
|
||||
{
|
||||
"",
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December"
|
||||
};
|
||||
@@ -0,0 +1,732 @@
|
||||
/* $selId: jewish.c,v 2.0 1995/10/24 01:13:06 lees Exp $
|
||||
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
|
||||
* Permission granted to use, copy, modify, distribute and sell so long as
|
||||
* the above copyright and this permission statement are retained in all
|
||||
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* These are the externally visible components of this file:
|
||||
*
|
||||
* void
|
||||
* SdnToJewish(
|
||||
* long int sdn,
|
||||
* int *pYear,
|
||||
* int *pMonth,
|
||||
* int *pDay);
|
||||
*
|
||||
* Convert a SDN to a Jewish calendar date. If the input SDN is before the
|
||||
* first day of year 1, the three output values will all be set to zero,
|
||||
* otherwise *pYear will be > 0; *pMonth will be in the range 1 to 13
|
||||
* inclusive; *pDay will be in the range 1 to 30 inclusive. Note that Adar
|
||||
* II is assigned the month number 7 and Elul is always 13.
|
||||
*
|
||||
* long int
|
||||
* JewishToSdn(
|
||||
* int year,
|
||||
* int month,
|
||||
* int day);
|
||||
*
|
||||
* Convert a Jewish calendar date to a SDN. Zero is returned when the
|
||||
* input date is detected as invalid or out of the supported range. The
|
||||
* return value will be > 0 for all valid, supported dates, but there are
|
||||
* some invalid dates that will return a positive value. To verify that a
|
||||
* date is valid, convert it to SDN and then back and compare with the
|
||||
* original.
|
||||
*
|
||||
* char *JewishMonthName[14];
|
||||
*
|
||||
* Convert a Jewish month number (1 to 13) to the name of the Jewish month
|
||||
* (null terminated). An index of zero will return a zero length string.
|
||||
*
|
||||
* VALID RANGE
|
||||
*
|
||||
* Although this software can handle dates all the way back to the year
|
||||
* 1 (3761 B.C.), such use may not be meaningful.
|
||||
*
|
||||
* The Jewish calendar has been in use for several thousand years, but
|
||||
* in the early days there was no formula to determine the start of a
|
||||
* month. A new month was started when the new moon was first
|
||||
* observed.
|
||||
*
|
||||
* It is not clear when the current rule based calendar replaced the
|
||||
* observation based calendar. According to the book "Jewish Calendar
|
||||
* Mystery Dispelled" by George Zinberg, the patriarch Hillel II
|
||||
* published these rules in 358 A.D. But, according to The
|
||||
* Encyclopedia Judaica, Hillel II may have only published the 19 year
|
||||
* rule for determining the occurrence of leap years.
|
||||
*
|
||||
* I have yet to find a specific date when the current set of rules
|
||||
* were known to be in use.
|
||||
*
|
||||
* CALENDAR OVERVIEW
|
||||
*
|
||||
* The Jewish calendar is based on lunar as well as solar cycles. A
|
||||
* month always starts on or near a new moon and has either 29 or 30
|
||||
* days (a lunar cycle is about 29 1/2 days). Twelve of these
|
||||
* alternating 29-30 day months gives a year of 354 days, which is
|
||||
* about 11 1/4 days short of a solar year.
|
||||
*
|
||||
* Since a month is defined to be a lunar cycle (new moon to new moon),
|
||||
* this 11 1/4 day difference cannot be overcome by adding days to a
|
||||
* month as with the Gregorian calendar, so an entire month is
|
||||
* periodically added to the year, making some years 13 months long.
|
||||
*
|
||||
* For astronomical as well as ceremonial reasons, the start of a new
|
||||
* year may be delayed until a day or two after the new moon causing
|
||||
* years to vary in length. Leap years can be from 383 to 385 days and
|
||||
* common years can be from 353 to 355 days. These are the months of
|
||||
* the year and their possible lengths:
|
||||
*
|
||||
* COMMON YEAR LEAP YEAR
|
||||
* 1 Tishri 30 30 30 30 30 30
|
||||
* 2 Heshvan 29 29 30 29 29 30 (variable)
|
||||
* 3 Kislev 29 30 30 29 30 30 (variable)
|
||||
* 4 Tevet 29 29 29 29 29 29
|
||||
* 5 Shevat 30 30 30 30 30 30
|
||||
* 6 Adar I 29 29 29 30 30 30 (variable)
|
||||
* 7 Adar II -- -- -- 29 29 29 (optional)
|
||||
* 8 Nisan 30 30 30 30 30 30
|
||||
* 9 Iyyar 29 29 29 29 29 29
|
||||
* 10 Sivan 30 30 30 30 30 30
|
||||
* 11 Tammuz 29 29 29 29 29 29
|
||||
* 12 Av 30 30 30 30 30 30
|
||||
* 13 Elul 29 29 29 29 29 29
|
||||
* --- --- --- --- --- ---
|
||||
* 353 354 355 383 384 385
|
||||
*
|
||||
* Note that the month names and other words that appear in this file
|
||||
* have multiple possible spellings in the Roman character set. I have
|
||||
* chosen to use the spellings found in the Encyclopedia Judaica.
|
||||
*
|
||||
* Adar II, the month added for leap years, is sometimes referred to as
|
||||
* the 13th month, but I have chosen to assign it the number 7 to keep
|
||||
* the months in chronological order. This may not be consistent with
|
||||
* other numbering schemes.
|
||||
*
|
||||
* Leap years occur in a fixed pattern of 19 years called the metonic
|
||||
* cycle. The 3rd, 6th, 8th, 11th, 14th, 17th and 19th years of this
|
||||
* cycle are leap years. The first metonic cycle starts with Jewish
|
||||
* year 1, or 3761/60 B.C. This is believed to be the year of
|
||||
* creation.
|
||||
*
|
||||
* To construct the calendar for a year, you must first find the length
|
||||
* of the year by determining the first day of the year (Tishri 1, or
|
||||
* Rosh Ha-Shanah) and the first day of the following year. This
|
||||
* selects one of the six possible month length configurations listed
|
||||
* above.
|
||||
*
|
||||
* Finding the first day of the year is the most difficult part.
|
||||
* Finding the date and time of the new moon (or molad) is the first
|
||||
* step. For this purpose, the lunar cycle is assumed to be 29 days 12
|
||||
* hours and 793 halakim. A halakim is 1/1080th of an hour or 3 1/3
|
||||
* seconds. (This assumed value is only about 1/2 second less than the
|
||||
* value used by modern astronomers -- not bad for a number that was
|
||||
* determined so long ago.) The first molad of year 1 occurred on
|
||||
* Sunday at 11:20:11 P.M. This would actually be Monday, because the
|
||||
* Jewish day is considered to begin at sunset.
|
||||
*
|
||||
* Since sunset varies, the day is assumed to begin at 6:00 P.M. for
|
||||
* calendar calculation purposes. So, the first molad was 5 hours 793
|
||||
* halakim after the start of Tishri 1, 0001 (which was Monday
|
||||
* September 7, 4761 B.C. by the Gregorian calendar). All subsequent
|
||||
* molads can be calculated from this starting point by adding the
|
||||
* length of a lunar cycle.
|
||||
*
|
||||
* Once the molad that starts a year is determined the actual start of
|
||||
* the year (Tishri 1) can be determined. Tishri 1 will be the day of
|
||||
* the molad unless it is delayed by one of the following four rules
|
||||
* (called dehiyyot). Each rule can delay the start of the year by one
|
||||
* day, and since rule #1 can combine with one of the other rules, it
|
||||
* can be delayed as much as two days.
|
||||
*
|
||||
* 1. Tishri 1 must never be Sunday, Wednesday or Friday. (This
|
||||
* is largely to prevent certain holidays from occurring on the
|
||||
* day before or after the Sabbath.)
|
||||
*
|
||||
* 2. If the molad occurs on or after noon, Tishri 1 must be
|
||||
* delayed.
|
||||
*
|
||||
* 3. If it is a common (not leap) year and the molad occurs on
|
||||
* Tuesday at or after 3:11:20 A.M., Tishri 1 must be delayed.
|
||||
*
|
||||
* 4. If it is the year following a leap year and the molad occurs
|
||||
* on Monday at or after 9:32:43 and 1/3 sec, Tishri 1 must be
|
||||
* delayed.
|
||||
*
|
||||
* GLOSSARY
|
||||
*
|
||||
* dehiyyot The set of 4 rules that determine when the new year
|
||||
* starts relative to the molad.
|
||||
*
|
||||
* halakim 1/1080th of an hour or 3 1/3 seconds.
|
||||
*
|
||||
* lunar cycle The period of time between mean conjunctions of the
|
||||
* sun and moon (new moon to new moon). This is
|
||||
* assumed to be 29 days 12 hours and 793 halakim for
|
||||
* calendar purposes.
|
||||
*
|
||||
* metonic cycle A 19 year cycle which determines which years are
|
||||
* leap years and which are common years. The 3rd,
|
||||
* 6th, 8th, 11th, 14th, 17th and 19th years of this
|
||||
* cycle are leap years.
|
||||
*
|
||||
* molad The date and time of the mean conjunction of the
|
||||
* sun and moon (new moon). This is the approximate
|
||||
* beginning of a month.
|
||||
*
|
||||
* Rosh Ha-Shanah The first day of the Jewish year (Tishri 1).
|
||||
*
|
||||
* Tishri The first month of the Jewish year.
|
||||
*
|
||||
* ALGORITHMS
|
||||
*
|
||||
* SERIAL DAY NUMBER TO JEWISH DATE
|
||||
*
|
||||
* The simplest approach would be to use the rules stated above to find
|
||||
* the molad of Tishri before and after the given day number. Then use
|
||||
* the molads to find Tishri 1 of the current and following years.
|
||||
* From this the length of the year can be determined and thus the
|
||||
* length of each month. But this method is used as a last resort.
|
||||
*
|
||||
* The first 59 days of the year are the same regardless of the length
|
||||
* of the year. As a result, only the day number of the start of the
|
||||
* year is required.
|
||||
*
|
||||
* Similarly, the last 6 months do not change from year to year. And
|
||||
* since it can be determined whether the year is a leap year by simple
|
||||
* division, the lengths of Adar I and II can be easily calculated. In
|
||||
* fact, all dates after the 3rd month are consistent from year to year
|
||||
* (once it is known whether it is a leap year).
|
||||
*
|
||||
* This means that if the given day number falls in the 3rd month or on
|
||||
* the 30th day of the 2nd month the length of the year must be found,
|
||||
* but in no other case.
|
||||
*
|
||||
* So, the approach used is to take the given day number and round it
|
||||
* to the closest molad of Tishri (first new moon of the year). The
|
||||
* rounding is not really to the *closest* molad, but is such that if
|
||||
* the day number is before the middle of the 3rd month the molad at
|
||||
* the start of the year is found, otherwise the molad at the end of
|
||||
* the year is found.
|
||||
*
|
||||
* Only if the day number is actually found to be in the ambiguous
|
||||
* period of 29 to 31 days is the other molad calculated.
|
||||
*
|
||||
* JEWISH DATE TO SERIAL DAY NUMBER
|
||||
*
|
||||
* The year number is used to find which 19 year metonic cycle contains
|
||||
* the date and which year within the cycle (this is a division and
|
||||
* modulus). This also determines whether it is a leap year.
|
||||
*
|
||||
* If the month is 1 or 2, the calculation is simple addition to the
|
||||
* first of the year.
|
||||
*
|
||||
* If the month is 8 (Nisan) or greater, the calculation is simple
|
||||
* subtraction from beginning of the following year.
|
||||
*
|
||||
* If the month is 4 to 7, it is considered whether it is a leap year
|
||||
* and then simple subtraction from the beginning of the following year
|
||||
* is used.
|
||||
*
|
||||
* Only if it is the 3rd month is both the start and end of the year
|
||||
* required.
|
||||
*
|
||||
* TESTING
|
||||
*
|
||||
* This algorithm has been tested in two ways. First, 510 dates from a
|
||||
* table in "Jewish Calendar Mystery Dispelled" were calculated and
|
||||
* compared to the table. Second, the calculation algorithm described
|
||||
* in "Jewish Calendar Mystery Dispelled" was coded and used to verify
|
||||
* all dates from the year 1 (3761 B.C.) to the year 13760 (10000
|
||||
* A.D.).
|
||||
*
|
||||
* The source code of the verification program is included in this
|
||||
* package.
|
||||
*
|
||||
* REFERENCES
|
||||
*
|
||||
* The Encyclopedia Judaica, the entry for "Calendar"
|
||||
*
|
||||
* The Jewish Encyclopedia
|
||||
*
|
||||
* Jewish Calendar Mystery Dispelled by George Zinberg, Vantage Press,
|
||||
* 1963
|
||||
*
|
||||
* The Comprehensive Hebrew Calendar by Arthur Spier, Behrman House
|
||||
*
|
||||
* The Book of Calendars [note that this work contains many typos]
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "sdncal.h"
|
||||
|
||||
#define HALAKIM_PER_HOUR 1080
|
||||
#define HALAKIM_PER_DAY 25920
|
||||
#define HALAKIM_PER_LUNAR_CYCLE ((29 * HALAKIM_PER_DAY) + 13753)
|
||||
#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7))
|
||||
|
||||
#define SDN_OFFSET 347997
|
||||
#define NEW_MOON_OF_CREATION 31524
|
||||
|
||||
#define SUNDAY 0
|
||||
#define MONDAY 1
|
||||
#define TUESDAY 2
|
||||
#define WEDNESDAY 3
|
||||
#define THURSDAY 4
|
||||
#define FRIDAY 5
|
||||
#define SATURDAY 6
|
||||
|
||||
#define NOON (18 * HALAKIM_PER_HOUR)
|
||||
#define AM3_11_20 ((9 * HALAKIM_PER_HOUR) + 204)
|
||||
#define AM9_32_43 ((15 * HALAKIM_PER_HOUR) + 589)
|
||||
|
||||
static int monthsPerYear[19] =
|
||||
{
|
||||
12, 12, 13, 12, 12, 13, 12, 13, 12, 12, 13, 12, 12, 13, 12, 12, 13, 12, 13
|
||||
};
|
||||
|
||||
static int yearOffset[19] =
|
||||
{
|
||||
0, 12, 24, 37, 49, 61, 74, 86, 99, 111, 123,
|
||||
136, 148, 160, 173, 185, 197, 210, 222
|
||||
};
|
||||
|
||||
char *JewishMonthName[14] =
|
||||
{
|
||||
"",
|
||||
"Tishri",
|
||||
"Heshvan",
|
||||
"Kislev",
|
||||
"Tevet",
|
||||
"Shevat",
|
||||
"AdarI",
|
||||
"AdarII",
|
||||
"Nisan",
|
||||
"Iyyar",
|
||||
"Sivan",
|
||||
"Tammuz",
|
||||
"Av",
|
||||
"Elul"
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* Given the year within the 19 year metonic cycle and the time of a molad
|
||||
* (new moon) which starts that year, this routine will calculate what day
|
||||
* will be the actual start of the year (Tishri 1 or Rosh Ha-Shanah). This
|
||||
* first day of the year will be the day of the molad unless one of 4 rules
|
||||
* (called dehiyyot) delays it. These 4 rules can delay the start of the
|
||||
* year by as much as 2 days.
|
||||
*/
|
||||
static long int Tishri1(
|
||||
int metonicYear,
|
||||
long int moladDay,
|
||||
long int moladHalakim)
|
||||
{
|
||||
long int tishri1;
|
||||
int dow;
|
||||
int leapYear;
|
||||
int lastWasLeapYear;
|
||||
|
||||
tishri1 = moladDay;
|
||||
dow = tishri1 % 7;
|
||||
leapYear = metonicYear == 2 || metonicYear == 5 || metonicYear == 7
|
||||
|| metonicYear == 10 || metonicYear == 13 || metonicYear == 16
|
||||
|| metonicYear == 18;
|
||||
lastWasLeapYear = metonicYear == 3 || metonicYear == 6
|
||||
|| metonicYear == 8 || metonicYear == 11 || metonicYear == 14
|
||||
|| metonicYear == 17 || metonicYear == 0;
|
||||
|
||||
/* Apply rules 2, 3 and 4. */
|
||||
if ((moladHalakim >= NOON) ||
|
||||
((!leapYear) && dow == TUESDAY && moladHalakim >= AM3_11_20) ||
|
||||
(lastWasLeapYear && dow == MONDAY && moladHalakim >= AM9_32_43)) {
|
||||
tishri1++;
|
||||
dow++;
|
||||
if (dow == 7) {
|
||||
dow = 0;
|
||||
}
|
||||
}
|
||||
/* Apply rule 1 after the others because it can cause an additional
|
||||
* delay of one day. */
|
||||
if (dow == WEDNESDAY || dow == FRIDAY || dow == SUNDAY) {
|
||||
tishri1++;
|
||||
}
|
||||
return (tishri1);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Given a metonic cycle number, calculate the date and time of the molad
|
||||
* (new moon) that starts that cycle. Since the length of a metonic cycle
|
||||
* is a constant, this is a simple calculation, except that it requires an
|
||||
* intermediate value which is bigger that 32 bits. Because this
|
||||
* intermediate value only needs 36 to 37 bits and the other numbers are
|
||||
* constants, the process has been reduced to just a few steps.
|
||||
*/
|
||||
static void MoladOfMetonicCycle(
|
||||
int metonicCycle,
|
||||
long int *pMoladDay,
|
||||
long int *pMoladHalakim)
|
||||
{
|
||||
register unsigned long int r1, r2, d1, d2;
|
||||
|
||||
/* Start with the time of the first molad after creation. */
|
||||
r1 = NEW_MOON_OF_CREATION;
|
||||
|
||||
/* Calculate metonicCycle * HALAKIM_PER_METONIC_CYCLE. The upper 32
|
||||
* bits of the result will be in r2 and the lower 16 bits will be
|
||||
* in r1. */
|
||||
r1 += metonicCycle * (HALAKIM_PER_METONIC_CYCLE & 0xFFFF);
|
||||
r2 = r1 >> 16;
|
||||
r2 += metonicCycle * ((HALAKIM_PER_METONIC_CYCLE >> 16) & 0xFFFF);
|
||||
|
||||
/* Calculate r2r1 / HALAKIM_PER_DAY. The remainder will be in r1, the
|
||||
* upper 16 bits of the quotient will be in d2 and the lower 16 bits
|
||||
* will be in d1. */
|
||||
d2 = r2 / HALAKIM_PER_DAY;
|
||||
r2 -= d2 * HALAKIM_PER_DAY;
|
||||
r1 = (r2 << 16) | (r1 & 0xFFFF);
|
||||
d1 = r1 / HALAKIM_PER_DAY;
|
||||
r1 -= d1 * HALAKIM_PER_DAY;
|
||||
|
||||
*pMoladDay = (d2 << 16) | d1;
|
||||
*pMoladHalakim = r1;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Given a day number, find the molad of Tishri (the new moon at the start
|
||||
* of a year) which is closest to that day number. It's not really the
|
||||
* *closest* molad that we want here. If the input day is in the first two
|
||||
* months, we want the molad at the start of the year. If the input day is
|
||||
* in the fourth to last months, we want the molad at the end of the year.
|
||||
* If the input day is in the third month, it doesn't matter which molad is
|
||||
* returned, because both will be required. This type of "rounding" allows
|
||||
* us to avoid calculating the length of the year in most cases.
|
||||
*/
|
||||
static void FindTishriMolad(
|
||||
long int inputDay,
|
||||
int *pMetonicCycle,
|
||||
int *pMetonicYear,
|
||||
long int *pMoladDay,
|
||||
long int *pMoladHalakim)
|
||||
{
|
||||
long int moladDay;
|
||||
long int moladHalakim;
|
||||
int metonicCycle;
|
||||
int metonicYear;
|
||||
|
||||
/* Estimate the metonic cycle number. Note that this may be an under
|
||||
* estimate because there are 6939.6896 days in a metonic cycle not
|
||||
* 6940, but it will never be an over estimate. The loop below will
|
||||
* correct for any error in this estimate. */
|
||||
metonicCycle = (inputDay + 310) / 6940;
|
||||
|
||||
/* Calculate the time of the starting molad for this metonic cycle. */
|
||||
MoladOfMetonicCycle(metonicCycle, &moladDay, &moladHalakim);
|
||||
|
||||
/* If the above was an under estimate, increment the cycle number until
|
||||
* the correct one is found. For modern dates this loop is about 98.6%
|
||||
* likely to not execute, even once, because the above estimate is
|
||||
* really quite close. */
|
||||
while (moladDay < inputDay - 6940 + 310) {
|
||||
metonicCycle++;
|
||||
moladHalakim += HALAKIM_PER_METONIC_CYCLE;
|
||||
moladDay += moladHalakim / HALAKIM_PER_DAY;
|
||||
moladHalakim = moladHalakim % HALAKIM_PER_DAY;
|
||||
}
|
||||
|
||||
/* Find the molad of Tishri closest to this date. */
|
||||
for (metonicYear = 0; metonicYear < 18; metonicYear++) {
|
||||
if (moladDay > inputDay - 74) {
|
||||
break;
|
||||
}
|
||||
moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear];
|
||||
moladDay += moladHalakim / HALAKIM_PER_DAY;
|
||||
moladHalakim = moladHalakim % HALAKIM_PER_DAY;
|
||||
}
|
||||
|
||||
*pMetonicCycle = metonicCycle;
|
||||
*pMetonicYear = metonicYear;
|
||||
*pMoladDay = moladDay;
|
||||
*pMoladHalakim = moladHalakim;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Given a year, find the number of the first day of that year and the date
|
||||
* and time of the starting molad.
|
||||
*/
|
||||
static void FindStartOfYear(
|
||||
int year,
|
||||
int *pMetonicCycle,
|
||||
int *pMetonicYear,
|
||||
long int *pMoladDay,
|
||||
long int *pMoladHalakim,
|
||||
int *pTishri1)
|
||||
{
|
||||
*pMetonicCycle = (year - 1) / 19;
|
||||
*pMetonicYear = (year - 1) % 19;
|
||||
MoladOfMetonicCycle(*pMetonicCycle, pMoladDay, pMoladHalakim);
|
||||
|
||||
*pMoladHalakim += HALAKIM_PER_LUNAR_CYCLE * yearOffset[*pMetonicYear];
|
||||
*pMoladDay += *pMoladHalakim / HALAKIM_PER_DAY;
|
||||
*pMoladHalakim = *pMoladHalakim % HALAKIM_PER_DAY;
|
||||
|
||||
*pTishri1 = Tishri1(*pMetonicYear, *pMoladDay, *pMoladHalakim);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Given a serial day number (SDN), find the corresponding year, month and
|
||||
* day in the Jewish calendar. The three output values will always be
|
||||
* modified. If the input SDN is before the first day of year 1, they will
|
||||
* all be set to zero, otherwise *pYear will be > 0; *pMonth will be in the
|
||||
* range 1 to 13 inclusive; *pDay will be in the range 1 to 30 inclusive.
|
||||
*/
|
||||
void SdnToJewish(
|
||||
long int sdn,
|
||||
int *pYear,
|
||||
int *pMonth,
|
||||
int *pDay)
|
||||
{
|
||||
long int inputDay;
|
||||
long int day;
|
||||
long int halakim;
|
||||
int metonicCycle;
|
||||
int metonicYear;
|
||||
int tishri1;
|
||||
int tishri1After;
|
||||
int yearLength;
|
||||
|
||||
if (sdn <= SDN_OFFSET) {
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
return;
|
||||
}
|
||||
inputDay = sdn - SDN_OFFSET;
|
||||
|
||||
FindTishriMolad(inputDay, &metonicCycle, &metonicYear, &day, &halakim);
|
||||
tishri1 = Tishri1(metonicYear, day, halakim);
|
||||
|
||||
if (inputDay >= tishri1) {
|
||||
/* It found Tishri 1 at the start of the year. */
|
||||
*pYear = metonicCycle * 19 + metonicYear + 1;
|
||||
if (inputDay < tishri1 + 59) {
|
||||
if (inputDay < tishri1 + 30) {
|
||||
*pMonth = 1;
|
||||
*pDay = inputDay - tishri1 + 1;
|
||||
} else {
|
||||
*pMonth = 2;
|
||||
*pDay = inputDay - tishri1 - 29;
|
||||
}
|
||||
return;
|
||||
}
|
||||
/* We need the length of the year to figure this out, so find
|
||||
* Tishri 1 of the next year. */
|
||||
halakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear];
|
||||
day += halakim / HALAKIM_PER_DAY;
|
||||
halakim = halakim % HALAKIM_PER_DAY;
|
||||
tishri1After = Tishri1((metonicYear + 1) % 19, day, halakim);
|
||||
} else {
|
||||
/* It found Tishri 1 at the end of the year. */
|
||||
*pYear = metonicCycle * 19 + metonicYear;
|
||||
if (inputDay >= tishri1 - 177) {
|
||||
/* It is one of the last 6 months of the year. */
|
||||
if (inputDay > tishri1 - 30) {
|
||||
*pMonth = 13;
|
||||
*pDay = inputDay - tishri1 + 30;
|
||||
} else if (inputDay > tishri1 - 60) {
|
||||
*pMonth = 12;
|
||||
*pDay = inputDay - tishri1 + 60;
|
||||
} else if (inputDay > tishri1 - 89) {
|
||||
*pMonth = 11;
|
||||
*pDay = inputDay - tishri1 + 89;
|
||||
} else if (inputDay > tishri1 - 119) {
|
||||
*pMonth = 10;
|
||||
*pDay = inputDay - tishri1 + 119;
|
||||
} else if (inputDay > tishri1 - 148) {
|
||||
*pMonth = 9;
|
||||
*pDay = inputDay - tishri1 + 148;
|
||||
} else {
|
||||
*pMonth = 8;
|
||||
*pDay = inputDay - tishri1 + 178;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
if (monthsPerYear[(*pYear - 1) % 19] == 13) {
|
||||
*pMonth = 7;
|
||||
*pDay = inputDay - tishri1 + 207;
|
||||
if (*pDay > 0)
|
||||
return;
|
||||
(*pMonth)--;
|
||||
(*pDay) += 30;
|
||||
if (*pDay > 0)
|
||||
return;
|
||||
(*pMonth)--;
|
||||
(*pDay) += 30;
|
||||
} else {
|
||||
*pMonth = 6;
|
||||
*pDay = inputDay - tishri1 + 207;
|
||||
if (*pDay > 0)
|
||||
return;
|
||||
(*pMonth)--;
|
||||
(*pDay) += 30;
|
||||
}
|
||||
if (*pDay > 0)
|
||||
return;
|
||||
(*pMonth)--;
|
||||
(*pDay) += 29;
|
||||
if (*pDay > 0)
|
||||
return;
|
||||
|
||||
/* We need the length of the year to figure this out, so find
|
||||
* Tishri 1 of this year. */
|
||||
tishri1After = tishri1;
|
||||
FindTishriMolad(day - 365,
|
||||
&metonicCycle, &metonicYear, &day, &halakim);
|
||||
tishri1 = Tishri1(metonicYear, day, halakim);
|
||||
}
|
||||
}
|
||||
|
||||
yearLength = tishri1After - tishri1;
|
||||
day = inputDay - tishri1 - 29;
|
||||
if (yearLength == 355 || yearLength == 385) {
|
||||
/* Heshvan has 30 days */
|
||||
if (day <= 30) {
|
||||
*pMonth = 2;
|
||||
*pDay = day;
|
||||
return;
|
||||
}
|
||||
day -= 30;
|
||||
} else {
|
||||
/* Heshvan has 29 days */
|
||||
if (day <= 29) {
|
||||
*pMonth = 2;
|
||||
*pDay = day;
|
||||
return;
|
||||
}
|
||||
day -= 29;
|
||||
}
|
||||
|
||||
/* It has to be Kislev. */
|
||||
*pMonth = 3;
|
||||
*pDay = day;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Given a year, month and day in the Jewish calendar, find the
|
||||
* corresponding serial day number (SDN). Zero is returned when the input
|
||||
* date is detected as invalid. The return value will be > 0 for all valid
|
||||
* dates, but there are some invalid dates that will return a positive
|
||||
* value. To verify that a date is valid, convert it to SDN and then back
|
||||
* and compare with the original.
|
||||
*/
|
||||
long int JewishToSdn(
|
||||
int year,
|
||||
int month,
|
||||
int day)
|
||||
{
|
||||
long int sdn;
|
||||
int metonicCycle;
|
||||
int metonicYear;
|
||||
int tishri1;
|
||||
int tishri1After;
|
||||
long int moladDay;
|
||||
long int moladHalakim;
|
||||
int yearLength;
|
||||
int lengthOfAdarIAndII;
|
||||
|
||||
if (year <= 0 || day <= 0 || day > 30) {
|
||||
return (0);
|
||||
}
|
||||
switch (month) {
|
||||
case 1:
|
||||
case 2:
|
||||
/* It is Tishri or Heshvan - don't need the year length. */
|
||||
FindStartOfYear(year, &metonicCycle, &metonicYear,
|
||||
&moladDay, &moladHalakim, &tishri1);
|
||||
if (month == 1) {
|
||||
sdn = tishri1 + day - 1;
|
||||
} else {
|
||||
sdn = tishri1 + day + 29;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* It is Kislev - must find the year length. */
|
||||
|
||||
/* Find the start of the year. */
|
||||
FindStartOfYear(year, &metonicCycle, &metonicYear,
|
||||
&moladDay, &moladHalakim, &tishri1);
|
||||
|
||||
/* Find the end of the year. */
|
||||
moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear];
|
||||
moladDay += moladHalakim / HALAKIM_PER_DAY;
|
||||
moladHalakim = moladHalakim % HALAKIM_PER_DAY;
|
||||
tishri1After = Tishri1((metonicYear + 1) % 19, moladDay, moladHalakim);
|
||||
|
||||
yearLength = tishri1After - tishri1;
|
||||
|
||||
if (yearLength == 355 || yearLength == 385) {
|
||||
sdn = tishri1 + day + 59;
|
||||
} else {
|
||||
sdn = tishri1 + day + 58;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
/* It is Tevet, Shevat or Adar I - don't need the year length. */
|
||||
|
||||
FindStartOfYear(year + 1, &metonicCycle, &metonicYear,
|
||||
&moladDay, &moladHalakim, &tishri1After);
|
||||
|
||||
if (monthsPerYear[(year - 1) % 19] == 12) {
|
||||
lengthOfAdarIAndII = 29;
|
||||
} else {
|
||||
lengthOfAdarIAndII = 59;
|
||||
}
|
||||
|
||||
if (month == 4) {
|
||||
sdn = tishri1After + day - lengthOfAdarIAndII - 237;
|
||||
} else if (month == 5) {
|
||||
sdn = tishri1After + day - lengthOfAdarIAndII - 208;
|
||||
} else {
|
||||
sdn = tishri1After + day - lengthOfAdarIAndII - 178;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* It is Adar II or later - don't need the year length. */
|
||||
FindStartOfYear(year + 1, &metonicCycle, &metonicYear,
|
||||
&moladDay, &moladHalakim, &tishri1After);
|
||||
|
||||
switch (month) {
|
||||
case 7:
|
||||
sdn = tishri1After + day - 207;
|
||||
break;
|
||||
case 8:
|
||||
sdn = tishri1After + day - 178;
|
||||
break;
|
||||
case 9:
|
||||
sdn = tishri1After + day - 148;
|
||||
break;
|
||||
case 10:
|
||||
sdn = tishri1After + day - 119;
|
||||
break;
|
||||
case 11:
|
||||
sdn = tishri1After + day - 89;
|
||||
break;
|
||||
case 12:
|
||||
sdn = tishri1After + day - 60;
|
||||
break;
|
||||
case 13:
|
||||
sdn = tishri1After + day - 30;
|
||||
break;
|
||||
default:
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
return (sdn + SDN_OFFSET);
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
/* $selId: julian.c,v 2.0 1995/10/24 01:13:06 lees Exp $
|
||||
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
|
||||
* Permission granted to use, copy, modify, distribute and sell so long as
|
||||
* the above copyright and this permission statement are retained in all
|
||||
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* These are the externally visible components of this file:
|
||||
*
|
||||
* void
|
||||
* SdnToJulian(
|
||||
* long int sdn,
|
||||
* int *pYear,
|
||||
* int *pMonth,
|
||||
* int *pDay);
|
||||
*
|
||||
* Convert a SDN to a Julian calendar date. If the input SDN is less than
|
||||
* 1, the three output values will all be set to zero, otherwise *pYear
|
||||
* will be >= -4713 and != 0; *pMonth will be in the range 1 to 12
|
||||
* inclusive; *pDay will be in the range 1 to 31 inclusive.
|
||||
*
|
||||
* long int
|
||||
* JulianToSdn(
|
||||
* int inputYear,
|
||||
* int inputMonth,
|
||||
* int inputDay);
|
||||
*
|
||||
* Convert a Julian calendar date to a SDN. Zero is returned when the
|
||||
* input date is detected as invalid or out of the supported range. The
|
||||
* return value will be > 0 for all valid, supported dates, but there are
|
||||
* some invalid dates that will return a positive value. To verify that a
|
||||
* date is valid, convert it to SDN and then back and compare with the
|
||||
* original.
|
||||
*
|
||||
* VALID RANGE
|
||||
*
|
||||
* 4713 B.C. to at least 10000 A.D.
|
||||
*
|
||||
* Although this software can handle dates all the way back to 4713
|
||||
* B.C., such use may not be meaningful. The calendar was created in
|
||||
* 46 B.C., but the details did not stabilize until at least 8 A.D.,
|
||||
* and perhaps as late at the 4th century. Also, the beginning of a
|
||||
* year varied from one culture to another - not all accepted January
|
||||
* as the first month.
|
||||
*
|
||||
* CALENDAR OVERVIEW
|
||||
*
|
||||
* Julias Ceasar created the calendar in 46 B.C. as a modified form of
|
||||
* the old Roman republican calendar which was based on lunar cycles.
|
||||
* The new Julian calendar set fixed lengths for the months, abandoning
|
||||
* the lunar cycle. It also specified that there would be exactly 12
|
||||
* months per year and 365.25 days per year with every 4th year being a
|
||||
* leap year.
|
||||
*
|
||||
* Note that the current accepted value for the tropical year is
|
||||
* 365.242199 days, not 365.25. This lead to an 11 day shift in the
|
||||
* calendar with respect to the seasons by the 16th century when the
|
||||
* Gregorian calendar was created to replace the Julian calendar.
|
||||
*
|
||||
* The difference between the Julian and today's Gregorian calendar is
|
||||
* that the Gregorian does not make centennial years leap years unless
|
||||
* they are a multiple of 400, which leads to a year of 365.2425 days.
|
||||
* In other words, in the Gregorian calendar, 1700, 1800 and 1900 are
|
||||
* not leap years, but 2000 is. All centennial years are leap years in
|
||||
* the Julian calendar.
|
||||
*
|
||||
* The details are unknown, but the lengths of the months were adjusted
|
||||
* until they finally stablized in 8 A.D. with their current lengths:
|
||||
*
|
||||
* January 31
|
||||
* February 28/29
|
||||
* March 31
|
||||
* April 30
|
||||
* May 31
|
||||
* June 30
|
||||
* Quintilis/July 31
|
||||
* Sextilis/August 31
|
||||
* September 30
|
||||
* October 31
|
||||
* November 30
|
||||
* December 31
|
||||
*
|
||||
* In the early days of the calendar, the days of the month were not
|
||||
* numbered as we do today. The numbers ran backwards (decreasing) and
|
||||
* were counted from the Ides (15th of the month - which in the old
|
||||
* Roman republican lunar calendar would have been the full moon) or
|
||||
* from the Nonae (9th day before the Ides) or from the beginning of
|
||||
* the next month.
|
||||
*
|
||||
* In the early years, the beginning of the year varied, sometimes
|
||||
* based on the ascension of rulers. It was not always the first of
|
||||
* January.
|
||||
*
|
||||
* Also, today's epoch, 1 A.D. or the birth of Jesus Christ, did not
|
||||
* come into use until several centuries later when Christianity became
|
||||
* a dominant religion.
|
||||
*
|
||||
* ALGORITHMS
|
||||
*
|
||||
* The calculations are based on two different cycles: a 4 year cycle
|
||||
* of leap years and a 5 month cycle of month lengths.
|
||||
*
|
||||
* The 5 month cycle is used to account for the varying lengths of
|
||||
* months. You will notice that the lengths alternate between 30 and
|
||||
* 31 days, except for three anomalies: both July and August have 31
|
||||
* days, both December and January have 31, and February is less than
|
||||
* 30. Starting with March, the lengths are in a cycle of 5 months
|
||||
* (31, 30, 31, 30, 31):
|
||||
*
|
||||
* Mar 31 days \
|
||||
* Apr 30 days |
|
||||
* May 31 days > First cycle
|
||||
* Jun 30 days |
|
||||
* Jul 31 days /
|
||||
*
|
||||
* Aug 31 days \
|
||||
* Sep 30 days |
|
||||
* Oct 31 days > Second cycle
|
||||
* Nov 30 days |
|
||||
* Dec 31 days /
|
||||
*
|
||||
* Jan 31 days \
|
||||
* Feb 28/9 days |
|
||||
* > Third cycle (incomplete)
|
||||
*
|
||||
* For this reason the calculations (internally) assume that the year
|
||||
* starts with March 1.
|
||||
*
|
||||
* TESTING
|
||||
*
|
||||
* This algorithm has been tested from the year 4713 B.C. to 10000 A.D.
|
||||
* The source code of the verification program is included in this
|
||||
* package.
|
||||
*
|
||||
* REFERENCES
|
||||
*
|
||||
* Conversions Between Calendar Date and Julian Day Number by Robert J.
|
||||
* Tantzen, Communications of the Association for Computing Machinery
|
||||
* August 1963. (Also published in Collected Algorithms from CACM,
|
||||
* algorithm number 199). [Note: the published algorithm is for the
|
||||
* Gregorian calendar, but was adjusted to use the Julian calendar's
|
||||
* simpler leap year rule.]
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#include "sdncal.h"
|
||||
|
||||
#define SDN_OFFSET 32083
|
||||
#define DAYS_PER_5_MONTHS 153
|
||||
#define DAYS_PER_4_YEARS 1461
|
||||
|
||||
void SdnToJulian(
|
||||
long int sdn,
|
||||
int *pYear,
|
||||
int *pMonth,
|
||||
int *pDay)
|
||||
{
|
||||
int year;
|
||||
int month;
|
||||
int day;
|
||||
long int temp;
|
||||
int dayOfYear;
|
||||
|
||||
if (sdn <= 0) {
|
||||
*pYear = 0;
|
||||
*pMonth = 0;
|
||||
*pDay = 0;
|
||||
return;
|
||||
}
|
||||
temp = (sdn + SDN_OFFSET) * 4 - 1;
|
||||
|
||||
/* Calculate the year and day of year (1 <= dayOfYear <= 366). */
|
||||
year = temp / DAYS_PER_4_YEARS;
|
||||
dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1;
|
||||
|
||||
/* Calculate the month and day of month. */
|
||||
temp = dayOfYear * 5 - 3;
|
||||
month = temp / DAYS_PER_5_MONTHS;
|
||||
day = (temp % DAYS_PER_5_MONTHS) / 5 + 1;
|
||||
|
||||
/* Convert to the normal beginning of the year. */
|
||||
if (month < 10) {
|
||||
month += 3;
|
||||
} else {
|
||||
year += 1;
|
||||
month -= 9;
|
||||
}
|
||||
|
||||
/* Adjust to the B.C./A.D. type numbering. */
|
||||
year -= 4800;
|
||||
if (year <= 0)
|
||||
year--;
|
||||
|
||||
*pYear = year;
|
||||
*pMonth = month;
|
||||
*pDay = day;
|
||||
}
|
||||
|
||||
long int JulianToSdn(
|
||||
int inputYear,
|
||||
int inputMonth,
|
||||
int inputDay)
|
||||
{
|
||||
int year;
|
||||
int month;
|
||||
|
||||
/* check for invalid dates */
|
||||
if (inputYear == 0 || inputYear < -4713 ||
|
||||
inputMonth <= 0 || inputMonth > 12 ||
|
||||
inputDay <= 0 || inputDay > 31) {
|
||||
return (0);
|
||||
}
|
||||
/* check for dates before SDN 1 (Jan 2, 4713 B.C.) */
|
||||
if (inputYear == -4713) {
|
||||
if (inputMonth == 1 && inputDay == 1) {
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
/* Make year always a positive number. */
|
||||
if (inputYear < 0) {
|
||||
year = inputYear + 4801;
|
||||
} else {
|
||||
year = inputYear + 4800;
|
||||
}
|
||||
|
||||
/* Adjust the start of the year. */
|
||||
if (inputMonth > 2) {
|
||||
month = inputMonth - 3;
|
||||
} else {
|
||||
month = inputMonth + 9;
|
||||
year--;
|
||||
}
|
||||
|
||||
return ((year * DAYS_PER_4_YEARS) / 4
|
||||
+ (month * DAYS_PER_5_MONTHS + 2) / 5
|
||||
+ inputDay
|
||||
- SDN_OFFSET);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
#ifndef _INCLUDED_CALENDAR_H
|
||||
#define _INCLUDED_CALENDAR_H
|
||||
|
||||
|
||||
|
||||
extern zend_module_entry calendar_module_entry;
|
||||
#define calendar_module_ptr & calendar_module_entry
|
||||
|
||||
|
||||
|
||||
/* Functions */
|
||||
|
||||
PHP_MINIT_FUNCTION(calendar);
|
||||
PHP_RINIT_FUNCTION(calendar);
|
||||
PHP_RSHUTDOWN_FUNCTION(calendar);
|
||||
PHP_MINFO_FUNCTION(calendar);
|
||||
|
||||
PHP_FUNCTION(jdtogregorian);
|
||||
PHP_FUNCTION(gregoriantojd);
|
||||
PHP_FUNCTION(jdtojulian);
|
||||
PHP_FUNCTION(juliantojd);
|
||||
PHP_FUNCTION(jdtojewish);
|
||||
PHP_FUNCTION(jewishtojd);
|
||||
PHP_FUNCTION(jdtofrench);
|
||||
PHP_FUNCTION(frenchtojd);
|
||||
PHP_FUNCTION(jddayofweek);
|
||||
PHP_FUNCTION(jdmonthname);
|
||||
PHP_FUNCTION(easter_days);
|
||||
PHP_FUNCTION(easter_date);
|
||||
PHP_FUNCTION(unixtojd);
|
||||
PHP_FUNCTION(jdtounix);
|
||||
|
||||
|
||||
#define phpext_calendar_ptr calendar_module_ptr
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,96 @@
|
||||
#ifndef _INCLUDED_SDNCAL_H
|
||||
#define _INCLUDED_SDNCAL_H
|
||||
/*
|
||||
* This code has been modified for use with PHP
|
||||
* by Shane Caraveo shane@caraveo.com
|
||||
* see below for more details
|
||||
*
|
||||
*/
|
||||
|
||||
/* $selId: sdncal.h,v 2.0 1995/10/24 01:13:06 lees Exp $
|
||||
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
|
||||
* Permission granted to use, copy, modify, distribute and sell so long as
|
||||
* the above copyright and this permission statement are retained in all
|
||||
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* This package defines a set of routines that convert calendar dates to
|
||||
* and from a serial day number (SDN). The SDN is a serial numbering of
|
||||
* days where SDN 1 is November 25, 4714 BC in the Gregorian calendar and
|
||||
* SDN 2447893 is January 1, 1990. This system of day numbering is
|
||||
* sometimes referred to as Julian days, but to avoid confusion with the
|
||||
* Julian calendar, it is referred to as serial day numbers here. The term
|
||||
* Julian days is also used to mean the number of days since the beginning
|
||||
* of the current year.
|
||||
*
|
||||
* The SDN can be used as an intermediate step in converting from one
|
||||
* calendar system to another (such as Gregorian to Jewish). It can also
|
||||
* be used for date computations such as easily comparing two dates,
|
||||
* determining the day of the week, finding the date of yesterday or
|
||||
* calculating the number of days between two dates.
|
||||
*
|
||||
* When using this software on 16 bit systems, be careful to store SDNs in
|
||||
* a long int, because it will not fit in the 16 bits that some systems
|
||||
* allocate to an int.
|
||||
*
|
||||
* For each calendar, there are two routines provided. One converts dates
|
||||
* in that calendar to SDN and the other converts SDN to calendar dates.
|
||||
* The routines are named SdnTo<CALENDAR>() and <CALENDAR>ToSdn(), where
|
||||
* <CALENDAR> is the name of the calendar system.
|
||||
*
|
||||
* SDN values less than one are not supported. If a conversion routine
|
||||
* returns an SDN of zero, this means that the date given is either invalid
|
||||
* or is outside the supported range for that calendar.
|
||||
*
|
||||
* At least some validity checks are performed on input dates. For
|
||||
* example, a negative month number will result in the return of zero for
|
||||
* the SDN. A returned SDN greater than one does not necessarily mean that
|
||||
* the input date was valid. To determine if the date is valid, convert it
|
||||
* to SDN, and if the SDN is greater than zero, convert it back to a date
|
||||
* and compare to the original. For example:
|
||||
*
|
||||
* int y1, m1, d1;
|
||||
* int y2, m2, d2;
|
||||
* long int sdn;
|
||||
* ...
|
||||
* sdn = GregorianToSdn(y1, m1, d1);
|
||||
* if (sdn > 0) {
|
||||
* SdnToGregorian(sdn, &y2, &m2, &d2);
|
||||
* if (y1 == y2 && m1 == m2 && d1 == d2) {
|
||||
* ... date is valid ...
|
||||
* }
|
||||
* }
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/* Gregorian calendar conversions. */
|
||||
void SdnToGregorian(long int sdn, int *pYear, int *pMonth, int *pDay);
|
||||
long int GregorianToSdn(int year, int month, int day);
|
||||
extern char *MonthNameShort[13];
|
||||
extern char *MonthNameLong[13];
|
||||
|
||||
/* Julian calendar conversions. */
|
||||
void SdnToJulian(long int sdn, int *pYear, int *pMonth, int *pDay);
|
||||
long int JulianToSdn(int year, int month, int day);
|
||||
|
||||
/* Jewish calendar conversions. */
|
||||
void SdnToJewish(long int sdn, int *pYear, int *pMonth, int *pDay);
|
||||
long int JewishToSdn(int year, int month, int day);
|
||||
extern char *JewishMonthName[14];
|
||||
|
||||
/* French republic calendar conversions. */
|
||||
void SdnToFrench(long int sdn, int *pYear, int *pMonth, int *pDay);
|
||||
long int FrenchToSdn(int inputYear, int inputMonth, int inputDay);
|
||||
extern char *FrenchMonthName[14];
|
||||
|
||||
/* Islamic calendar conversions. */
|
||||
/* Not implemented yet. */
|
||||
|
||||
/* Day of week conversion. 0=Sunday, 6=Saturday */
|
||||
int DayOfWeek(long int sdn);
|
||||
extern char *DayNameShort[7];
|
||||
extern char *DayNameLong[7];
|
||||
|
||||
#endif /* _INCLUDED_SDNCAL_H */
|
||||
@@ -1,10 +1,5 @@
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libcpdf.la
|
||||
LTLIBRARY_SOURCES = cpdf.c
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
+1
-1
@@ -11,7 +11,7 @@ AC_ARG_WITH(cpdflib,
|
||||
AC_MSG_RESULT(no) ;;
|
||||
yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_EXTENSION(cpdflib)
|
||||
PHP_EXTENSION(cpdf)
|
||||
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
|
||||
[AC_MSG_ERROR(Cpdf module requires cpdflib >= 2.)])
|
||||
AC_ADD_LIBRARY(cpdf)
|
||||
|
||||
+8
-4
@@ -42,7 +42,6 @@
|
||||
#include "php_globals.h"
|
||||
#include "ext/standard/php_standard.h"
|
||||
#include "ext/standard/head.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include <math.h>
|
||||
#if HAVE_LIBGD13
|
||||
#include <gd.h>
|
||||
@@ -58,6 +57,7 @@
|
||||
|
||||
#if HAVE_CPDFLIB
|
||||
#include "php_cpdf.h"
|
||||
#include "ext/standard/info.h"
|
||||
|
||||
#ifdef THREAD_SAFE
|
||||
DWORD CPDFlibTls;
|
||||
@@ -158,9 +158,9 @@ zend_module_entry cpdf_module_entry = {
|
||||
"cpdf", cpdf_functions, PHP_MINIT(cpdf), PHP_MSHUTDOWN(cpdf), PHP_RINIT(cpdf), NULL, PHP_MINFO(cpdf), STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#if COMPILE_DL
|
||||
#if defined(COMPILE_DL) || defined(COMPILE_DL_CPDF)
|
||||
#include "dl/phpdl.h"
|
||||
DLEXPORT zend_module_entry *get_module(void) { return &cpdf_module_entry; }
|
||||
ZEND_GET_MODULE(cpdf)
|
||||
#endif
|
||||
|
||||
static void _free_outline(CPDFoutlineEntry *outline)
|
||||
@@ -187,7 +187,11 @@ PHP_RINIT_FUNCTION(cpdf)
|
||||
|
||||
PHP_MINFO_FUNCTION(cpdf) {
|
||||
/* need to use a PHPAPI function here because it is external module in windows */
|
||||
php_printf("Version %s", cpdf_version());
|
||||
/* (don't knwo if that still applies (cmv) */
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "CPDF Support", "enabled");
|
||||
php_info_print_table_row(2, "Version", cpdf_version() );
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
PHP_MSHUTDOWN_FUNCTION(cpdf){
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libcybercash.la
|
||||
LTLIBRARY_SOURCES = cybercash.c
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
+1
-6
@@ -1,10 +1,5 @@
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libdav.la
|
||||
LTLIBRARY_SOURCES = dav.c
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
+9
-5
@@ -4,10 +4,10 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.01 of the PHP license, |
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_01.txt. |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
@@ -19,7 +19,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
#define IS_EXT_MODULE
|
||||
#if COMPILE_DL
|
||||
#if defined(COMPILE_DL) || defined(COMPILE_DL_DAV)
|
||||
# if PHP_31
|
||||
# include "../phpdl.h"
|
||||
# else
|
||||
@@ -36,6 +36,7 @@
|
||||
#if HAVE_MOD_DAV
|
||||
|
||||
# include "mod_dav.h"
|
||||
#include "ext/standard/info.h"
|
||||
|
||||
/* {{{ thread safety stuff */
|
||||
|
||||
@@ -67,8 +68,8 @@ phpdav_module php_dav_module;
|
||||
/* }}} */
|
||||
/* {{{ dynamically loadable module stuff */
|
||||
|
||||
# if COMPILE_DL
|
||||
DLEXPORT zend_module_entry *get_module() { return &phpdav_module_entry; };
|
||||
#if defined(COMPILE_DL) || defined(COMPILE_DL_DAV)
|
||||
ZEND_GET_MODULE(phpdav)
|
||||
# endif /* COMPILE_DL */
|
||||
|
||||
/* }}} */
|
||||
@@ -158,6 +159,9 @@ PHP_RSHUTDOWN_FUNCTION(phpdav)
|
||||
|
||||
PHP_MINFO_FUNCTION(phpdav);
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "DAV Support", "enabled");
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
/* {{{ extension-internal functions */
|
||||
|
||||
+1
-6
@@ -1,10 +1,5 @@
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libdb.la
|
||||
LTLIBRARY_SOURCES = db.c
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
+2
-2
@@ -2,7 +2,7 @@ dnl $Id$
|
||||
dnl config.m4 for extension db
|
||||
dnl don't forget to call PHP_EXTENSION(db)
|
||||
|
||||
divert(2)dnl
|
||||
divert(3)dnl
|
||||
|
||||
AC_CHECK_HEADERS(db1/ndbm.h)
|
||||
|
||||
@@ -27,7 +27,7 @@ AC_DEFUN(AC_PREFERRED_DB_LIB,[
|
||||
|
||||
AC_PREFERRED_DB_LIB
|
||||
|
||||
divert(4)dnl
|
||||
divert(5)dnl
|
||||
|
||||
if test "$DBM_LIB" = "-lgdbm"; then
|
||||
AC_CHECK_HEADER(gdbm.h, [ GDBM_INCLUDE="" ], [
|
||||
|
||||
+48
-12
@@ -4,10 +4,10 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.01 of the PHP license, |
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_01.txt. |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/* $Id$ */
|
||||
#define IS_EXT_MODULE
|
||||
#if COMPILE_DL
|
||||
#if defined(COMPILE_DL) || defined(COMPILE_DL_DB)
|
||||
# include "dl/phpdl.h"
|
||||
#endif
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "safe_mode.h"
|
||||
#include "fopen-wrappers.h"
|
||||
#include "ext/standard/flock_compat.h"
|
||||
#include "ext/standard/info.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -122,7 +123,7 @@ static int php_dbm_key_exists(DBM *dbf, datum key_datum) {
|
||||
#define DBM_CREATE_MODE "a+b"
|
||||
#define DBM_NEW_MODE "w+b"
|
||||
#define DBM_DEFAULT_MODE "r"
|
||||
#define DBM_OPEN(filename, mode) fopen(filename, mode)
|
||||
#define DBM_OPEN(filename, mode) V_FOPEN(filename, mode)
|
||||
#define DBM_CLOSE(dbf) fclose(dbf)
|
||||
#define DBM_STORE(dbf, key, value, mode) flatfile_store(dbf, key, value, mode)
|
||||
#define DBM_FETCH(dbf, key) flatfile_fetch(dbf, key)
|
||||
@@ -230,16 +231,23 @@ static char *php_get_info_db(void)
|
||||
|
||||
PHP_MINFO_FUNCTION(db)
|
||||
{
|
||||
/* this isn't pretty ... should break out the info a bit more (cmv) */
|
||||
php_info_print_box_start(0);
|
||||
php_printf(php_get_info_db());
|
||||
php_info_print_box_end();
|
||||
}
|
||||
|
||||
/* {{{ proto string dblist(void)
|
||||
Describes the dbm-compatible library being used */
|
||||
PHP_FUNCTION(dblist)
|
||||
{
|
||||
char *str = php_get_info_db();
|
||||
RETURN_STRING(str,1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto int dbmopen(string filename, string mode)
|
||||
Opens a dbm database */
|
||||
PHP_FUNCTION(dbmopen) {
|
||||
pval *filename, *mode;
|
||||
dbm_info *info=NULL;
|
||||
@@ -260,6 +268,8 @@ PHP_FUNCTION(dbmopen) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
dbm_info *php_dbm_open(char *filename, char *mode) {
|
||||
dbm_info *info;
|
||||
@@ -315,7 +325,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
|
||||
strcat(lockfn, ".lck");
|
||||
|
||||
#if NFS_HACK
|
||||
while((last_try = stat(lockfn,&sb))==0) {
|
||||
while((last_try = V_STAT(lockfn,&sb))==0) {
|
||||
retries++;
|
||||
php_sleep(1);
|
||||
if (retries>30) break;
|
||||
@@ -329,7 +339,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
|
||||
}
|
||||
#else /* NFS_HACK */
|
||||
|
||||
lockfd = open(lockfn,O_RDWR|O_CREAT,0644);
|
||||
lockfd = V_OPEN((lockfn,O_RDWR|O_CREAT,0644));
|
||||
|
||||
if (lockfd) {
|
||||
flock(lockfd,LOCK_EX);
|
||||
@@ -398,6 +408,8 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* {{{ proto bool dbmclose(int dbm_identifier)
|
||||
Closes a dbm database */
|
||||
PHP_FUNCTION(dbmclose) {
|
||||
pval *id;
|
||||
|
||||
@@ -412,6 +424,7 @@ PHP_FUNCTION(dbmclose) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
int php_dbm_close(dbm_info *info) {
|
||||
int ret = 0;
|
||||
@@ -424,7 +437,7 @@ int php_dbm_close(dbm_info *info) {
|
||||
unlink(info->lockfn);
|
||||
#else
|
||||
if (info->lockfn) {
|
||||
lockfd = open(info->lockfn,O_RDWR,0644);
|
||||
lockfd = V_OPEN((info->lockfn,O_RDWR,0644));
|
||||
flock(lockfd,LOCK_UN);
|
||||
close(lockfd);
|
||||
}
|
||||
@@ -446,6 +459,8 @@ int php_dbm_close(dbm_info *info) {
|
||||
* ret = 0 success
|
||||
* ret = 1 key already exists - nothing done
|
||||
*/
|
||||
/* {{{ proto int dbminsert(int dbm_identifier, string key, string value)
|
||||
Inserts a value for a key in a dbm database */
|
||||
PHP_FUNCTION(dbminsert)
|
||||
{
|
||||
pval *id, *key, *value;
|
||||
@@ -467,6 +482,9 @@ PHP_FUNCTION(dbminsert)
|
||||
ret = php_dbm_insert(info, key->value.str.val, value->value.str.val);
|
||||
RETURN_LONG(ret);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
|
||||
int php_dbm_insert(dbm_info *info, char *key, char *value) {
|
||||
datum key_datum, value_datum;
|
||||
@@ -499,6 +517,8 @@ int php_dbm_insert(dbm_info *info, char *key, char *value) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* {{{ proto int dbmreplace(int dbm_identifier, string key, string value)
|
||||
Replaces the value for a key in a dbm database */
|
||||
PHP_FUNCTION(dbmreplace)
|
||||
{
|
||||
pval *id, *key, *value;
|
||||
@@ -520,6 +540,7 @@ PHP_FUNCTION(dbmreplace)
|
||||
ret = php_dbm_replace(info, key->value.str.val, value->value.str.val);
|
||||
RETURN_LONG(ret);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
int php_dbm_replace(dbm_info *info, char *key, char *value) {
|
||||
DBM_TYPE dbf;
|
||||
@@ -555,6 +576,8 @@ int php_dbm_replace(dbm_info *info, char *key, char *value) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* {{{ proto string dbmfetch(int dbm_identifier, string key)
|
||||
Fetches a value for a key from a dbm database */
|
||||
PHP_FUNCTION(dbmfetch)
|
||||
{
|
||||
pval *id, *key;
|
||||
@@ -579,6 +602,7 @@ PHP_FUNCTION(dbmfetch)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
char *php_dbm_fetch(dbm_info *info, char *key) {
|
||||
datum key_datum, value_datum;
|
||||
@@ -625,7 +649,8 @@ char *php_dbm_fetch(dbm_info *info, char *key) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto int dbmexists(int dbm_identifier, string key)
|
||||
Tells if a value exists for a key in a dbm database */
|
||||
PHP_FUNCTION(dbmexists)
|
||||
{
|
||||
pval *id, *key;
|
||||
@@ -646,6 +671,7 @@ PHP_FUNCTION(dbmexists)
|
||||
ret = php_dbm_exists(info, key->value.str.val);
|
||||
RETURN_LONG(ret);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
int php_dbm_exists(dbm_info *info, char *key) {
|
||||
datum key_datum;
|
||||
@@ -668,7 +694,9 @@ int php_dbm_exists(dbm_info *info, char *key) {
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto int dbmdelete(int dbm_identifier, string key)
|
||||
Deletes the value for a key from a dbm database */
|
||||
PHP_FUNCTION(dbmdelete)
|
||||
{
|
||||
pval *id, *key;
|
||||
@@ -689,6 +717,7 @@ PHP_FUNCTION(dbmdelete)
|
||||
ret = php_dbm_delete(info, key->value.str.val);
|
||||
RETURN_LONG(ret);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
int php_dbm_delete(dbm_info *info, char *key) {
|
||||
datum key_datum;
|
||||
@@ -711,6 +740,8 @@ int php_dbm_delete(dbm_info *info, char *key) {
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/* {{{ string dbmfirstkey(int dbm_identifier)
|
||||
Retrieves the first key from a dbm database */
|
||||
PHP_FUNCTION(dbmfirstkey)
|
||||
{
|
||||
pval *id;
|
||||
@@ -736,6 +767,7 @@ PHP_FUNCTION(dbmfirstkey)
|
||||
return_value->type = IS_STRING;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
char *php_dbm_first_key(dbm_info *info) {
|
||||
datum ret_datum;
|
||||
@@ -768,6 +800,8 @@ char *php_dbm_first_key(dbm_info *info) {
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/* {{{ proto string dbmnextkey(int dbm_identifier, string key)
|
||||
Retrieves the next key from a dbm database */
|
||||
PHP_FUNCTION(dbmnextkey)
|
||||
{
|
||||
pval *id, *key;
|
||||
@@ -794,6 +828,8 @@ PHP_FUNCTION(dbmnextkey)
|
||||
return_value->type = IS_STRING;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
char *php_dbm_nextkey(dbm_info *info, char *key) {
|
||||
datum key_datum, ret_datum;
|
||||
@@ -1136,8 +1172,8 @@ zend_module_entry dbm_module_entry = {
|
||||
"db", dbm_functions, PHP_MINIT(db), PHP_MSHUTDOWN(db), PHP_RINIT(db), NULL, PHP_MINFO(db), STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#if COMPILE_DL
|
||||
DLEXPORT zend_module_entry *get_module(void) { return &dbm_module_entry; }
|
||||
#if defined(COMPILE_DL) || defined(COMPILE_DL_DB)
|
||||
ZEND_GET_MODULE(dbm)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -89,7 +89,4 @@ PHP_FUNCTION(dbmdelete);
|
||||
PHP_FUNCTION(dbmfirstkey);
|
||||
PHP_FUNCTION(dbmnextkey);
|
||||
|
||||
#undef phpext_db_ptr
|
||||
#define phpext_db_ptr NULL
|
||||
|
||||
#endif /* _PHP_DB_H */
|
||||
+3
-6
@@ -1,11 +1,8 @@
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @topsrcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LTLIBRARY_NAME = libdba.la
|
||||
LTLIBRARY_SOURCES = dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c \
|
||||
dba_ndbm.c dba_db3.c
|
||||
LTLIBRARY_SHARED_NAME = dba.la
|
||||
LTLIBRARY_SHARED_LIBADD = $(DBA_SHARED_LIBADD)
|
||||
|
||||
include $(topsrcdir)/build/ltlib.mk
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
+8
-6
@@ -33,7 +33,7 @@ AC_DEFUN(AC_DBA_STD_CHECK,[
|
||||
dnl Attach THIS_x to DBA_x
|
||||
AC_DEFUN(AC_DBA_STD_ATTACH,[
|
||||
AC_ADD_INCLUDE($THIS_INCLUDE)
|
||||
AC_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS)
|
||||
AC_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD)
|
||||
|
||||
THIS_INCLUDE=""
|
||||
THIS_LIBS=""
|
||||
@@ -52,7 +52,8 @@ AC_DEFUN(AC_DBA_STD_RESULT,[
|
||||
THIS_RESULT=""
|
||||
])
|
||||
|
||||
|
||||
PHP_ARG_ENABLE(dba,whether to enable DBA,
|
||||
[ --enable-dba=shared Build DBA as a shared module])
|
||||
|
||||
AC_ARG_WITH(gdbm,
|
||||
[ --with-gdbm[=DIR] Include GDBM support],[
|
||||
@@ -155,18 +156,18 @@ AC_DBA_STD_RESULT
|
||||
AC_ARG_WITH(db3,
|
||||
[ --with-db3[=DIR] Include Berkeley DB3 support],[
|
||||
if test "$withval" != "no"; then
|
||||
for i in /usr/local /usr $withval; do
|
||||
for i in /usr/local /usr /usr/local/BerkeleyDB.3.0 $withval; do
|
||||
if test -f "$i/include/db.h" ; then
|
||||
THIS_PREFIX="$i"
|
||||
DB3_EXTRA="db.h"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if test -n "$DB3_EXTRA"; then
|
||||
AC_DEFINE_UNQUOTED(DB3_INCLUDE_FILE, "$DB3_EXTRA", [ ])
|
||||
fi
|
||||
|
||||
for LIB in db; do
|
||||
for LIB in db db-3; do
|
||||
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
|
||||
AC_CHECK_LIB($LIB, db_create, [AC_DEFINE(DBA_DB3,1,[ ]) THIS_LIBS="$LIB"])
|
||||
])
|
||||
@@ -230,7 +231,8 @@ AC_MSG_CHECKING(whether to enable DBA interface)
|
||||
if test "$HAVE_DBA" = "1"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_DBA, 1, [ ])
|
||||
PHP_EXTENSION(dba)
|
||||
PHP_EXTENSION(dba,$ext_shared)
|
||||
PHP_SUBST(DBA_SHARED_LIBADD)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(HAVE_DBA, 0, [ ])
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#if HAVE_DBA
|
||||
|
||||
#include "php_dba.h"
|
||||
#include "ext/standard/info.h"
|
||||
|
||||
#include "php_gdbm.h"
|
||||
#include "php_ndbm.h"
|
||||
@@ -71,6 +72,10 @@ zend_module_entry dba_module_entry = {
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#ifdef COMPILE_DL_DBA
|
||||
ZEND_GET_MODULE(dba)
|
||||
#endif
|
||||
|
||||
typedef struct dba_handler {
|
||||
char *name;
|
||||
int (*open)(dba_info *);
|
||||
@@ -197,13 +202,16 @@ static PHP_MSHUTDOWN_FUNCTION(dba)
|
||||
|
||||
static PHP_MINFO_FUNCTION(dba)
|
||||
{
|
||||
/* could be prettier (cmv) */
|
||||
dba_handler *hptr;
|
||||
|
||||
php_info_print_box_start(0);
|
||||
PUTS("V1 ($Id$)");
|
||||
for(hptr = handler; hptr->name; hptr++) {
|
||||
PUTS(" ");
|
||||
PUTS(hptr->name);
|
||||
}
|
||||
php_info_print_box_end();
|
||||
}
|
||||
|
||||
static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ DBA_OPEN_FUNC(cdb)
|
||||
cdb = malloc(sizeof *cdb);
|
||||
memset(cdb, 0, sizeof *cdb);
|
||||
|
||||
cdb->fd = open(info->path, gmode);
|
||||
cdb->fd = V_OPEN((info->path, gmode));
|
||||
if(cdb->fd < 0) {
|
||||
free(cdb);
|
||||
return FAILURE;
|
||||
|
||||
Loaded 100 of 481 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user