mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-08 09:47:30 +00:00
Compare commits
371
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd54e13688 | ||
|
|
56498d48b4 | ||
|
|
a15887434d | ||
|
|
3a10285392 | ||
|
|
e7f10a41f2 | ||
|
|
e97c8ff013 | ||
|
|
b1d4fcb33c | ||
|
|
1b4d8c0fb6 | ||
|
|
fad9bab629 | ||
|
|
83ba61245c | ||
|
|
4a915571f5 | ||
|
|
9aabb6c08d | ||
|
|
54e911aa4f | ||
|
|
69e2d48738 | ||
|
|
ed50eba46d | ||
|
|
32f6eeb3bd | ||
|
|
8a36eb220e | ||
|
|
5b2719d9b3 | ||
|
|
4c06a45dc5 | ||
|
|
b75610a9f3 | ||
|
|
6e10dc5456 | ||
|
|
fc3acfc4d5 | ||
|
|
0b719aa462 | ||
|
|
e783d75ed3 | ||
|
|
ecbc0255d9 | ||
|
|
827672cd78 | ||
|
|
490de54fb5 | ||
|
|
315f4f5658 | ||
|
|
7eeda99a05 | ||
|
|
390d1cd1b7 | ||
|
|
3f969d0b84 | ||
|
|
626fc9a773 | ||
|
|
ab458219ec | ||
|
|
eea3a56973 | ||
|
|
58abfc5426 | ||
|
|
0b8ca80e57 | ||
|
|
989203cf9c | ||
|
|
1f7b735290 | ||
|
|
39770d99ea | ||
|
|
66dfb8aac1 | ||
|
|
40404d7337 | ||
|
|
bf94671c3c | ||
|
|
c66bc46bb1 | ||
|
|
35a9a1878e | ||
|
|
2eb8688f29 | ||
|
|
b2cecd9d8b | ||
|
|
365edaddd4 | ||
|
|
b79db079a6 | ||
|
|
9d39ada3d0 | ||
|
|
f872296aaf | ||
|
|
280a79a319 | ||
|
|
70ef0577a3 | ||
|
|
d584491ddf | ||
|
|
0435c2e306 | ||
|
|
1192fe545f | ||
|
|
6a8440fb70 | ||
|
|
82d7c4294c | ||
|
|
0e6db7dc82 | ||
|
|
483c99ad73 | ||
|
|
a0b745a053 | ||
|
|
64b8ea5963 | ||
|
|
4f343428d1 | ||
|
|
9893e9316e | ||
|
|
c9b4568f3e | ||
|
|
4a474b8120 | ||
|
|
83d4cbf15e | ||
|
|
4df36948c8 | ||
|
|
c6cd319cd4 | ||
|
|
5905971122 | ||
|
|
ad04898e05 | ||
|
|
c1894bbf96 | ||
|
|
8a1db559b6 | ||
|
|
c708eefcd4 | ||
|
|
e0818297f1 | ||
|
|
f6e38a2e95 | ||
|
|
f1ec9035fc | ||
|
|
681f50bf4e | ||
|
|
03471b21ee | ||
|
|
6cbdaf985f | ||
|
|
b853731aaf | ||
|
|
b224dd96bd | ||
|
|
fbbc249f2b | ||
|
|
51856230d3 | ||
|
|
c542f9a3f4 | ||
|
|
3f97600862 | ||
|
|
b2c2220971 | ||
|
|
04855ca11c | ||
|
|
f08b599821 | ||
|
|
b6f0d041f9 | ||
|
|
681f6d53bb | ||
|
|
d33f42d53f | ||
|
|
7248d68d49 | ||
|
|
c9dfdd38a7 | ||
|
|
d4dd261436 | ||
|
|
9c86c11abf | ||
|
|
d7c43de3ce | ||
|
|
876bac4823 | ||
|
|
693180c1a2 | ||
|
|
a8be2cf641 | ||
|
|
ba4ddf32b4 | ||
|
|
7ca4354c22 | ||
|
|
0181cae318 | ||
|
|
4850e34bf3 | ||
|
|
5875af9372 | ||
|
|
39671d8915 | ||
|
|
9d4081896c | ||
|
|
2ec7ccdf4c | ||
|
|
4694c419cf | ||
|
|
d076f5f2d9 | ||
|
|
8a5ceac253 | ||
|
|
c8eb56cc59 | ||
|
|
a4cf34619d | ||
|
|
4e7ab5ec7b | ||
|
|
0508a61421 | ||
|
|
25b9ee5a74 | ||
|
|
96b221755a | ||
|
|
3cb026db73 | ||
|
|
b28f6eba38 | ||
|
|
2604cb987a | ||
|
|
91944be3f7 | ||
|
|
636c4e81e2 | ||
|
|
4ee0040869 | ||
|
|
bee5b60a22 | ||
|
|
ae49ebf198 | ||
|
|
adfbf4a92f | ||
|
|
1955412c3d | ||
|
|
d89c5b231c | ||
|
|
207814916d | ||
|
|
5d09d7d811 | ||
|
|
69b914e2dd | ||
|
|
3af4ba7e01 | ||
|
|
8ba5d5ef9c | ||
|
|
0222b7ab41 | ||
|
|
60676f19a5 | ||
|
|
d5e9318210 | ||
|
|
381d04e197 | ||
|
|
3c2ec3e5f3 | ||
|
|
b422c552d7 | ||
|
|
d22ebb3cb6 | ||
|
|
000773e7b9 | ||
|
|
3c049ddcdd | ||
|
|
4b1380e31c | ||
|
|
bac08af4cb | ||
|
|
03049aa8ac | ||
|
|
2011db174b | ||
|
|
479a96ed89 | ||
|
|
732f891f3c | ||
|
|
d0e48e92b6 | ||
|
|
3a1b4fda7e | ||
|
|
10247c67fa | ||
|
|
cb3ffd56eb | ||
|
|
7632bca956 | ||
|
|
542d2d623c | ||
|
|
0b686eaa2a | ||
|
|
e4b2f8351e | ||
|
|
c8443dc1b9 | ||
|
|
410ac013e8 | ||
|
|
b43df683ee | ||
|
|
18ded31f4c | ||
|
|
dc2362069e | ||
|
|
4bed072f11 | ||
|
|
02feba6c05 | ||
|
|
6ce467dc13 | ||
|
|
19741cc37a | ||
|
|
8e0ae5d152 | ||
|
|
1bbea8d0eb | ||
|
|
82115ea039 | ||
|
|
99d3b9bfe8 | ||
|
|
6d7cc46e38 | ||
|
|
251b83076e | ||
|
|
849fe880ea | ||
|
|
5ab6783471 | ||
|
|
1d0f45ea6b | ||
|
|
30ccec36b9 | ||
|
|
c799959568 | ||
|
|
892e949196 | ||
|
|
8ef1279f2b | ||
|
|
4d6f3b40a7 | ||
|
|
80d878279b | ||
|
|
45e9e3a9fe | ||
|
|
5a7409ee1a | ||
|
|
50161c9ee8 | ||
|
|
b6978fe1af | ||
|
|
1d68a02df3 | ||
|
|
320105bcd8 | ||
|
|
6358dad0e1 | ||
|
|
c8b8a908ca | ||
|
|
ce0c4a7991 | ||
|
|
d3aeebdd1f | ||
|
|
c86ec8b1a9 | ||
|
|
f75db1e3cb | ||
|
|
67daa655f6 | ||
|
|
42eeda50d4 | ||
|
|
9b9f9fa4dd | ||
|
|
cd599d17c0 | ||
|
|
9e6e64955f | ||
|
|
6aada077a0 | ||
|
|
4ba16a1169 | ||
|
|
1f84023b05 | ||
|
|
e325e06693 | ||
|
|
97c698a178 | ||
|
|
fbdf502307 | ||
|
|
cf8d95b922 | ||
|
|
e103155d92 | ||
|
|
61df257c0f | ||
|
|
705e6f2ec6 | ||
|
|
c2357ccc26 | ||
|
|
cba39bcd9c | ||
|
|
0691afb08c | ||
|
|
48b5c6d900 | ||
|
|
595ca6b588 | ||
|
|
7a45e3cb89 | ||
|
|
f8d74acd93 | ||
|
|
c34f41b7c5 | ||
|
|
79b0a56c51 | ||
|
|
3f4c8e665a | ||
|
|
f112b68668 | ||
|
|
07b5d74022 | ||
|
|
c698e14635 | ||
|
|
90eac6a390 | ||
|
|
0959b16f87 | ||
|
|
0c57780b11 | ||
|
|
53a3f074ab | ||
|
|
c4b2498bae | ||
|
|
ea98567404 | ||
|
|
382dd4a394 | ||
|
|
890ae1e244 | ||
|
|
c80f2bcba2 | ||
|
|
1b8ee02fd6 | ||
|
|
c1ceeaf830 | ||
|
|
867160a751 | ||
|
|
d484ad1d6c | ||
|
|
3aad950735 | ||
|
|
4f96d15f33 | ||
|
|
ba0e3f2145 | ||
|
|
b436f97a53 | ||
|
|
8751bcb8eb | ||
|
|
7c7e5a9081 | ||
|
|
c28eac2f6c | ||
|
|
d93732179b | ||
|
|
1f793fd06c | ||
|
|
56ecc78983 | ||
|
|
056401fa6c | ||
|
|
8a8b5dacc6 | ||
|
|
80612a97eb | ||
|
|
c675a39b73 | ||
|
|
ffad41019e | ||
|
|
41360c24b6 | ||
|
|
9148b4d16b | ||
|
|
9608acbe19 | ||
|
|
e85ba0901a | ||
|
|
81b8e08b13 | ||
|
|
fdd374fddb | ||
|
|
15902929e8 | ||
|
|
ce635bdb3c | ||
|
|
185f6e95d8 | ||
|
|
d06c2d9eb1 | ||
|
|
d06c4b2e3f | ||
|
|
c9dca64075 | ||
|
|
7795aca4ca | ||
|
|
28273dfaa2 | ||
|
|
65bb194d65 | ||
|
|
08c6773691 | ||
|
|
05edda2222 | ||
|
|
92c21585f2 | ||
|
|
f1ed420604 | ||
|
|
636d126e16 | ||
|
|
78dfa91e1f | ||
|
|
61a058f538 | ||
|
|
744dce0da0 | ||
|
|
e46ea8864c | ||
|
|
51fe68fd51 | ||
|
|
159abaa900 | ||
|
|
821042278e | ||
|
|
97c200b170 | ||
|
|
9e750e64b9 | ||
|
|
1a5d90c4ea | ||
|
|
e1a3604103 | ||
|
|
e871d2f036 | ||
|
|
468b509759 | ||
|
|
bba7086ac3 | ||
|
|
6f8f6c521c | ||
|
|
5090b1e8d5 | ||
|
|
93acbedce8 | ||
|
|
20c007b229 | ||
|
|
4992408771 | ||
|
|
caa3b6c9b6 | ||
|
|
4f4e553b6a | ||
|
|
3f158be18a | ||
|
|
2acc8630fe | ||
|
|
85a5e901e8 | ||
|
|
fcb595e4d2 | ||
|
|
04720d3b3b | ||
|
|
bab5db79f6 | ||
|
|
45ab04fa40 | ||
|
|
b78c48f7bc | ||
|
|
a120608807 | ||
|
|
66f9f8bf38 | ||
|
|
17797f951c | ||
|
|
25c8009825 | ||
|
|
2336c0148e | ||
|
|
490de4de57 | ||
|
|
3000566259 | ||
|
|
b47bb87004 | ||
|
|
e5015ed581 | ||
|
|
d6f2f2c396 | ||
|
|
b283eec42a | ||
|
|
23df217463 | ||
|
|
a1adc81f30 | ||
|
|
25240885a5 | ||
|
|
26300a8ebf | ||
|
|
34bee836b1 | ||
|
|
a2cb77aa82 | ||
|
|
5779f26561 | ||
|
|
e67defffbe | ||
|
|
e59bcdbfb8 | ||
|
|
a7e8750446 | ||
|
|
5c8fca1757 | ||
|
|
5e8db7f495 | ||
|
|
0fac6f738f | ||
|
|
9c555fe96a | ||
|
|
7dcf456dd6 | ||
|
|
a6c6f6a5c3 | ||
|
|
0855453e83 | ||
|
|
c06692e9ec | ||
|
|
609577d882 | ||
|
|
f0203f6288 | ||
|
|
01a83f8cb0 | ||
|
|
57faf76605 | ||
|
|
9a2d9b993d | ||
|
|
1030d7a7d8 | ||
|
|
4d692049b2 | ||
|
|
14e86fcf0a | ||
|
|
048717c09c | ||
|
|
7999f6ddf6 | ||
|
|
8a4f3d3973 | ||
|
|
f3b757eead | ||
|
|
472c727186 | ||
|
|
3bc8b9dc9c | ||
|
|
831e15d0d1 | ||
|
|
a2cdb7726f | ||
|
|
40fd4fb21b | ||
|
|
b5f74d44e9 | ||
|
|
ea3a3a1a2d | ||
|
|
bfcd9c4f28 | ||
|
|
46b8f7e38b | ||
|
|
8bf2339870 | ||
|
|
e31a7fcdfc | ||
|
|
6f7eaa5531 | ||
|
|
d8790d9e2c | ||
|
|
5d02c74b6b | ||
|
|
d9960867fd | ||
|
|
5c62b32823 | ||
|
|
4b8823d427 | ||
|
|
55801d5330 | ||
|
|
54e168ce42 | ||
|
|
e05fbd00c2 | ||
|
|
edcbd1862e | ||
|
|
83341c39da | ||
|
|
6de4e2e382 | ||
|
|
b5d39b4820 | ||
|
|
8289c85438 | ||
|
|
635532053e | ||
|
|
6ebea7d35e | ||
|
|
8bd88acada | ||
|
|
1fd0a0eeed | ||
|
|
97893e6a19 | ||
|
|
97cb10bc9e | ||
|
|
f59cbb9ed1 | ||
|
|
c6569921d7 | ||
|
|
05684f2d86 |
No files matched your search
+22
-13
@@ -65,8 +65,9 @@ MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: servlet
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: thttpd
|
||||
MAINTENANCE: Unknown
|
||||
@@ -94,7 +95,7 @@ STATUS: Unknown
|
||||
EXTENSION: hyperwave
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: informix
|
||||
PRIMARY MAINTAINER: Danny Heijl <Danny.Heijl@cevi.be>
|
||||
@@ -179,9 +180,9 @@ MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cpdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <Uwe.Steinmann@fernuni-hagen.de>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: CURL
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
@@ -195,8 +196,14 @@ MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: domxml
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dotnet
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: exif
|
||||
MAINTENANCE: Unknown
|
||||
@@ -223,16 +230,17 @@ STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: icap
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
STATUS: Obsolete
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: imap
|
||||
MAINTENANCE: Unknown
|
||||
PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: java
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ldap
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
@@ -240,7 +248,8 @@ MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcal
|
||||
MAINTENANCE: Unknown
|
||||
PRIMARY MAINTAINER: Chuck Hagenbuch <chuck@horde.org>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcrypt
|
||||
@@ -262,7 +271,7 @@ STATUS: Working
|
||||
EXTENSION: pdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pfpro
|
||||
PRIMARY MAINTAINER: David Croft <david@infotrek.co.uk>
|
||||
|
||||
@@ -5,6 +5,15 @@ For the impatient here is a quick set of steps that will build PHP as
|
||||
first a dynamic Apache module (DSO) for Apache 1.3.x with MySQL support
|
||||
and then a static module. A more verbose explanation follows.
|
||||
|
||||
For installing PHP on other web servers, refer to one of the following
|
||||
files:
|
||||
|
||||
sapi/aolserver/README
|
||||
sapi/pi3web/README
|
||||
sapi/servlet/README
|
||||
sapi/thttpd/README
|
||||
README.Zeus
|
||||
|
||||
Note! Only install either the static module or the dynamic one. Do not
|
||||
install both.
|
||||
|
||||
|
||||
@@ -1,20 +1,70 @@
|
||||
PHP 4.0 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
?? ??? 2000, Version 4.0.2
|
||||
29 Aug 2000, Version 4.0.2
|
||||
- PHP 3 regression testing framework re-born (Stig)
|
||||
- Added php_uname() function (Stig)
|
||||
- Made a minor change to allow building with OpenLDAP 2.0 (Stig Venaas)
|
||||
- Fixed a bug in preg_replace() that would truncate subject string if the
|
||||
first argument was en empty array. (Andrei)
|
||||
- Added ob_get_length function (Stig)
|
||||
- Fixed a bug that did not respect limit parameter in preg_replace() when
|
||||
using /e modifier. (Andrei)
|
||||
- Added ability for each xml_set_*_handler() function to take the
|
||||
array($obj, 'method') syntax for the handler argument as well
|
||||
as the normal function name. (Andrei)
|
||||
- Updated array_walk() to be able to accept array($obj, 'method')
|
||||
syntax for the walk function. (Andrei)
|
||||
- Fixed segfault with fgets(), fgetcsv(), fgetss(), and fread() when
|
||||
called with negative length argument. (Torben)
|
||||
- Fix by-reference parameters passing for xml_ functions and for scanf functions (Stas)
|
||||
- Added experimental Oracle LDAP SDK support. 8.1.6 or later needed. Configure
|
||||
with something like --with-ldap=/usr/local/oracle/product/8.1.6 (Stig Venaas)
|
||||
- Fixed memory leaks in eval(); A script that used eval() extensively, could
|
||||
end up consuming very large amounts of memory during execution (Zeev, Zend
|
||||
Engine)
|
||||
- Fixed memory_limit feature, which did not work properly in previous versions
|
||||
(Zeev, Zend Engine)
|
||||
- Fixed stdout support with the swf extension. (Sterling)
|
||||
- Fixed byte order for ip2long and long2ip (Stas)
|
||||
- Fixed dbase_add_record. (Sterling)
|
||||
- Added support for libmcrypt 2.4.4 (Derick)
|
||||
- Added strncasecmp function (Andi, Zend Engine)
|
||||
- Fixed FTP module to accept multiline server replies (Jani)
|
||||
- Fixed switch which only has a single default rule. (Andi, Zend Engine)
|
||||
- Fixed problem with nested foreach()'s. (Andi, Zend Engine)
|
||||
- The CCVS module is now stable and compiling. It compiles as a CGI and into
|
||||
Apache cleanly without warnings. (Brendan W. McAdams)
|
||||
- Fixed mSQL_close(). (nick@loman.net)
|
||||
- Made return() in a require()'d file work like return() in an include()'d
|
||||
file (Andi & Zeev, Zend Engine)
|
||||
- Changed require_once() to work using the same table as include_once()
|
||||
(Andi & Zeev, Zend Engine)
|
||||
- Fixed PostgreSQL module to work when the link handle is omitted (Zeev)
|
||||
- Fixed the Sybase modules to work properly with PHP 4.0 (Zeev)
|
||||
- Fixed CLOB handling in OCI8 driver when using variable-width
|
||||
character sets. (Thies)
|
||||
- Added 4th optional parameter to sybase_[p]connect to specify the charset
|
||||
for the connection (alf@alpha.ulatina.ac.cr)
|
||||
- Fixed support for current thttpd releases. (Sascha)
|
||||
- Added support for kerberized IMAP library using --with-kerberos
|
||||
(Rasmus, Sascha)
|
||||
- Virtualize realpath, chmod, chown and utime (Stas)
|
||||
- Support content-encoding headers in file upload MIME parts
|
||||
(Ragnar Kjørstad)
|
||||
- Fixed warning when shutting down OCINLogon() connections. (Thies)
|
||||
- Fixed \n in session variables bug on Win32 (Stas)
|
||||
- OCIError() would sometimes not report failed connections. (Thies)
|
||||
- Fix HEAD request bug on an Apache ErrorDocument redirect and preserve
|
||||
- Fixed HEAD request bug on an Apache ErrorDocument redirect and preserve
|
||||
the status code across the redirect as well. (Rasmus)
|
||||
- Add Olympus-specific tags to read_exif_data() (Rasmus)
|
||||
- Added Olympus-specific tags to read_exif_data() (Rasmus)
|
||||
- Fixed bug in imap_fetchheader() where using FT_PREFETCHTEXT didn't return
|
||||
the body. Bug #4447. (Jani)
|
||||
- Fixed exec() returning "\0" when output is empty
|
||||
- Added XML_Parser class in PEAR (Stig)
|
||||
- Added "make test" target in pear/ and added some regression tests (Stig)
|
||||
- Fix bug in strip_tags function as per bug #5857 (Rasmus)
|
||||
- Fix reading of IPTC via GetImageInfo() for certain JPEG files. (Thies)
|
||||
- Fixed bug in strip_tags function as per bug #5857 (Rasmus)
|
||||
- Fixed reading of IPTC via GetImageInfo() for certain JPEG files. (Thies)
|
||||
- Improved the output-buffering functions to be re-entrant (Zeev)
|
||||
- Made ldap_add(), ldap_modify(), ldap_mod_add(), ldap_mod_replace()
|
||||
binary-safe. Original patch: Terrence Miao <terrence_miao@email.com> (Jani)
|
||||
@@ -24,9 +74,10 @@ PHP 4.0 NEWS
|
||||
- Bug-report and fix submitted by Michel Alexeline <alexel@dr15.cnrs.fr>
|
||||
- Make ext_skel create a Makefile.in set up to handle shared extension
|
||||
support automatically (Rasmus)
|
||||
- Fix php_realpath not to die on non-existing files (needed for touch()) (Stas and china@thewrittenword.com)
|
||||
- Fix get_browser() function (Stas)
|
||||
- Fix symbol clash which caused a DSO problem on OpenBSD (Rob Black and
|
||||
- Fixed php_realpath not to die on non-existing files (needed for touch())
|
||||
(Stas and china@thewrittenword.com)
|
||||
- Fixed get_browser() function (Stas)
|
||||
- Fixed symbol clash which caused a DSO problem on OpenBSD (Rob Black and
|
||||
anil@recoil.org)
|
||||
- Added new function: ldap_compare(). (Jani)
|
||||
- Fixed a bug in ldap_get_entries() and ldap_get_attributes(). (Jani)
|
||||
@@ -57,9 +108,9 @@ PHP 4.0 NEWS
|
||||
- You can now call Ora_Error() without prameters to get the reason
|
||||
for a failed connection attempt. (Kirill Maximov)
|
||||
- New extension "pfpro" for interface with Verisign Payflow Pro (David Croft)
|
||||
- Add IMG_GIF, IMG_JPG, IMG_JPEG, IMG_PNG and IMG_WBMP constants for
|
||||
- Added IMG_GIF, IMG_JPG, IMG_JPEG, IMG_PNG and IMG_WBMP constants for
|
||||
imagetypes() function (Rasmus)
|
||||
- Add ImageTypes() function which returns a bitfield with the supported
|
||||
- Added ImageTypes() function which returns a bitfield with the supported
|
||||
image formats. 1=gif, 2=jpeg, 4=png and 8=wbmp (Rasmus)
|
||||
- Make it possible to specify an empty string as a thousands-seperator
|
||||
in number_format() (Rasmus)
|
||||
@@ -206,7 +257,7 @@ PHP 4.0 NEWS
|
||||
- Added fflush() function. (Eric Huss)
|
||||
- Fixed a problem with static variables, default function arguments and class
|
||||
member variables, that contained array values. (Andi & Zeev, Zend Engine)
|
||||
- Fix virtual() when used with output buffering (Marc Pohl)
|
||||
- Fixed virtual() when used with output buffering (Marc Pohl)
|
||||
- Clean up constants in flock() function and add optional 3rd arg which
|
||||
is set to true on EWOULDBLOCK (Rasmus)
|
||||
- Added functions pg_loimport(), pg_loexport(). (Jouni)
|
||||
@@ -226,7 +277,7 @@ PHP 4.0 NEWS
|
||||
instead of the built-in error handling code (Zeev, Zend Engine)
|
||||
- Renamed user_error() to trigger_error(); user_error() remains
|
||||
defined for compatibility (Zeev, Zend Engine)
|
||||
- Fix the global/static statements to require a trailing terminating
|
||||
- Fixed the global/static statements to require a trailing terminating
|
||||
semi-colon ';'. (Andi, Zend Engine)
|
||||
- Cleaned up PCRE extension and made it binary-safe. (Andrei)
|
||||
- Added third argument to in_array(). If it's true, then in_array()
|
||||
@@ -301,7 +352,7 @@ PHP 4.0 NEWS
|
||||
(Marc Pohl)
|
||||
- Added configure time checking for bcmath package. (Joey, Sascha)
|
||||
- Added get_declared_classes(). (Andrei, Zend Engine)
|
||||
- Add initial NSAPI module from Jayakumar Muthukumarasamy. (Rasmus)
|
||||
- Added 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)
|
||||
@@ -310,7 +361,7 @@ PHP 4.0 NEWS
|
||||
- Fixed a crash in array_multisort() that happened when empty arrays
|
||||
were passed to it. (Andrei)
|
||||
- Added substr_count() from Peter Kovacs. (Andrei)
|
||||
- Add an optional third argument to fseek to indicate where to seek from.
|
||||
- Added an optional third argument to fseek to indicate where to seek from.
|
||||
(Andrei)
|
||||
- OCIBindByName() will no longer complain about bindlength beeing zero. (Thies)
|
||||
- Converted the IMAP module to the high performance API (Zeev)
|
||||
|
||||
@@ -6,6 +6,7 @@ Zend
|
||||
* allow foreach ($array as $k => &$val) syntax. right now we cannot
|
||||
traverse an array without copying each element.
|
||||
* look at replacing c-lib call tolower().
|
||||
* make hash API functions work with HASH_OF() to save time.
|
||||
|
||||
global
|
||||
------
|
||||
@@ -15,6 +16,7 @@ global
|
||||
* make sure all source files have the "right" copyright.
|
||||
* the following modules still use PHP3_TLS_*() macros (and thereby don't
|
||||
work in ZTS mode): ext/dav/dav.c, ext/db/db.c, ext/gd/gd.c, ext/ldap/ldap.c
|
||||
* INI system causes segfaults in ZTS mode (operates on static HashTable)
|
||||
* make sure that all ZTS globals get destructed. Most ts_allocate_id()
|
||||
calls should have a dtor entry.
|
||||
* activate all extensions by default that don't rely on external
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
AUTOMAKE_OPTIONS=foreign
|
||||
noinst_LTLIBRARIES=libtsrm.la
|
||||
libtsrm_la_SOURCES = TSRM.c
|
||||
|
||||
depend:
|
||||
+23
-8
@@ -35,18 +35,33 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
# define zend_sprintf sprintf
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(NAN)
|
||||
#define zend_isnan(a) (((a)==NAN)?1:0)
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FINITE
|
||||
#define zend_finite(a) finite(a)
|
||||
#elif defined(HAVE_ISFINITE)
|
||||
#elif defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(HAVE_ISNAN) && defined(HAVE_ISINF)
|
||||
#define zend_finite(a) (isnan(a) ? 0 : isinf(a) ? 0 : 1)
|
||||
#elif defined(HAVE_ISNAN)
|
||||
#define zend_finite(a) (isnan(a) ? 0 : 1)
|
||||
#elif defined(HAVE_ISINF)
|
||||
#define zend_finite(a) (isinf(a) ? 0 : 1)
|
||||
#elif defined(fpclassify)
|
||||
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
|
||||
#else
|
||||
#define zend_finite(a) (1)
|
||||
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+6
-8
@@ -47,7 +47,7 @@
|
||||
%pure_parser
|
||||
%expect 4
|
||||
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
|
||||
%left ','
|
||||
%left T_LOGICAL_OR
|
||||
%left T_LOGICAL_XOR
|
||||
@@ -105,8 +105,6 @@
|
||||
%token T_FUNCTION
|
||||
%token T_CONST
|
||||
%token T_RETURN
|
||||
%token T_REQUIRE
|
||||
%token T_REQUIRE_ONCE
|
||||
%token T_USE
|
||||
%token T_GLOBAL
|
||||
%token T_STATIC
|
||||
@@ -197,11 +195,10 @@ unticked_statement:
|
||||
| T_ECHO echo_expr_list ';'
|
||||
| T_INLINE_HTML { do_echo(&$1 CLS_CC); }
|
||||
| expr ';' { do_free(&$1 CLS_CC); }
|
||||
| T_REQUIRE expr ';' { do_require(&$2, 0 CLS_CC); }
|
||||
| T_REQUIRE_ONCE use_filename ';' { do_require(&$2, 1 CLS_CC); }
|
||||
| T_USE use_filename ';' { use_filename($2.u.constant.value.str.val, $2.u.constant.value.str.len CLS_CC); zval_dtor(&$2.u.constant); }
|
||||
| T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); }
|
||||
| T_UNSET '(' unset_variables ')' ';'
|
||||
| T_FOREACH '(' expr T_AS { do_foreach_begin(&$1, &$3, &$2, &$4 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_FOREACH '(' w_cvar T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 1 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_FOREACH '(' expr_without_variable T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 0 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_DECLARE { do_declare_begin(CLS_C); } '(' declare_list ')' declare_statement { do_declare_end(CLS_C); }
|
||||
| ';' /* empty statement */
|
||||
;
|
||||
@@ -487,7 +484,6 @@ expr_without_variable:
|
||||
| T_PRINT expr { do_print(&$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
function_call:
|
||||
T_STRING '(' { $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
@@ -720,6 +716,8 @@ internal_functions_in_yacc:
|
||||
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
|
||||
| T_INCLUDE_ONCE expr { do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
|
||||
| T_EVAL '(' expr ')' { do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); }
|
||||
| T_REQUIRE expr { do_include_or_eval(ZEND_REQUIRE, &$$, &$2 CLS_CC); }
|
||||
| T_REQUIRE_ONCE use_filename { do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
+66
-168
@@ -183,7 +183,7 @@ inline void restore_lexical_state(zend_lex_state *lex_state CLS_DC)
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
|
||||
ZEND_API void zend_open_file_dtor(zend_file_handle *fh)
|
||||
ZEND_API void zend_file_handle_dtor(zend_file_handle *fh)
|
||||
{
|
||||
switch (fh->type) {
|
||||
case ZEND_HANDLE_FP:
|
||||
@@ -235,7 +235,7 @@ int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
{
|
||||
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
|
||||
}
|
||||
@@ -243,7 +243,7 @@ ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
|
||||
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
{
|
||||
char *file_path;
|
||||
char *file_path=NULL;
|
||||
|
||||
#ifndef ZTS
|
||||
switch (file_handle->type) {
|
||||
@@ -252,19 +252,20 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
file_path = file_handle->opened_path;
|
||||
break;
|
||||
case ZEND_HANDLE_FD:
|
||||
file_path = file_handle->filename;
|
||||
file_handle->opened_path = NULL;
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->handle.fp = fdopen(file_handle->handle.fd, "r");
|
||||
break;
|
||||
case ZEND_HANDLE_FP:
|
||||
file_path = file_handle->filename;
|
||||
file_handle->opened_path = NULL;
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->handle.fp = file_handle->handle.fp;
|
||||
break;
|
||||
}
|
||||
if (!file_handle->handle.fp) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (!file_path) {
|
||||
file_path = file_handle->filename;
|
||||
}
|
||||
file_handle->type = ZEND_HANDLE_FP;
|
||||
if (file_handle->handle.fp != stdin) {
|
||||
zend_llist_add_element(&CG(open_files), file_handle);
|
||||
@@ -276,7 +277,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
#else
|
||||
switch (file_handle->type) {
|
||||
case ZEND_HANDLE_FD:
|
||||
file_handle->opened_path = NULL;
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->handle.is = new ifstream(file_handle->handle.fd);
|
||||
file_handle->type = ZEND_HANDLE_FSTREAM;
|
||||
break;
|
||||
@@ -291,7 +292,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
break;
|
||||
}
|
||||
case ZEND_HANDLE_FP:
|
||||
file_handle->opened_path = NULL;
|
||||
/* file_handle->opened_path = NULL; */
|
||||
if (file_handle->handle.fp==stdin) {
|
||||
file_handle->handle.is = &cin;
|
||||
} else {
|
||||
@@ -324,31 +325,16 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
END_EXTERN_C()
|
||||
|
||||
|
||||
ZEND_API zend_op_array *zend_compile_files(int type CLS_DC, int file_count, ...)
|
||||
{
|
||||
va_list files;
|
||||
zend_op_array *op_array;
|
||||
|
||||
va_start(files, file_count);
|
||||
op_array = zend_v_compile_files(type CLS_CC, file_count, files);
|
||||
va_end(files);
|
||||
return op_array;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files)
|
||||
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS_DC)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
|
||||
zend_op_array *original_active_op_array = CG(active_op_array);
|
||||
zend_op_array *retval=NULL;
|
||||
int i;
|
||||
int compiler_result;
|
||||
int compiled_files=0;
|
||||
int last_file=0;
|
||||
zend_bool compilation_successful=0;
|
||||
znode retval_znode;
|
||||
zend_bool original_in_compilation = CG(in_compilation);
|
||||
zend_file_handle **file_handles = (zend_file_handle **) do_alloca(file_count * sizeof(zend_file_handle *));
|
||||
|
||||
retval_znode.op_type = IS_CONST;
|
||||
retval_znode.u.constant.type = IS_LONG;
|
||||
@@ -356,55 +342,42 @@ ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list
|
||||
retval_znode.u.constant.is_ref = 0;
|
||||
retval_znode.u.constant.refcount = 1;
|
||||
|
||||
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
|
||||
retval = op_array; /* success oriented */
|
||||
|
||||
for (i=0; i<file_count; i++) {
|
||||
file_handles[i] = va_arg(files, zend_file_handle *);
|
||||
if (file_handles[i]) {
|
||||
last_file = i;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<file_count; i++) {
|
||||
if (!file_handles[i]) {
|
||||
continue;
|
||||
}
|
||||
if (open_file_for_scanning(file_handles[i] CLS_CC)==FAILURE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handles[i]->filename);
|
||||
if (open_file_for_scanning(file_handle CLS_CC)==FAILURE) {
|
||||
if (type==ZEND_REQUIRE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
|
||||
zend_bailout();
|
||||
} else {
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
compiler_result = zendparse(CLS_C);
|
||||
zend_close_file_handle(file_handles[i] CLS_CC);
|
||||
if (i == last_file) {
|
||||
do_return(&retval_znode, 0 CLS_CC);
|
||||
}
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
CG(unclean_shutdown) = 1;
|
||||
retval = NULL;
|
||||
break;
|
||||
}
|
||||
compiled_files++;
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
|
||||
}
|
||||
compilation_successful=0;
|
||||
} else {
|
||||
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE CLS_CC);
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
compiler_result = zendparse(CLS_C);
|
||||
do_return(&retval_znode, 0 CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
CG(unclean_shutdown) = 1;
|
||||
retval = NULL;
|
||||
}
|
||||
compilation_successful=1;
|
||||
}
|
||||
|
||||
if (retval) {
|
||||
if (compiled_files>0) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
if (compilation_successful) {
|
||||
pass_two(op_array);
|
||||
} else {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
destroy_op_array(op_array);
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
}
|
||||
}
|
||||
free_alloca(file_handles);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -414,7 +387,6 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
zend_file_handle file_handle;
|
||||
zval tmp;
|
||||
zend_op_array *retval;
|
||||
int error_reporting=0;
|
||||
|
||||
if (filename->type != IS_STRING) {
|
||||
tmp = *filename;
|
||||
@@ -428,22 +400,8 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
file_handle.opened_path = NULL;
|
||||
|
||||
|
||||
if (type==ZEND_REQUIRE) {
|
||||
/* We don't want to hear about inclusion failures; If we fail,
|
||||
* we'll generate a require failure
|
||||
*/
|
||||
error_reporting = EG(error_reporting);
|
||||
EG(error_reporting) = 0;
|
||||
}
|
||||
retval = zend_compile_files(type CLS_CC, 1, &file_handle);
|
||||
|
||||
if (type==ZEND_REQUIRE) {
|
||||
EG(error_reporting) = error_reporting;
|
||||
if (!retval) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, filename->value.str.val);
|
||||
zend_bailout();
|
||||
}
|
||||
}
|
||||
retval = zend_compile_file(&file_handle, type CLS_CC);
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
|
||||
if (filename==&tmp) {
|
||||
zval_dtor(&tmp);
|
||||
@@ -451,8 +409,11 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
static inline int prepare_string_for_scanning(zval *str CLS_DC)
|
||||
#ifndef ZTS
|
||||
static inline int prepare_string_for_scanning(zval *str)
|
||||
#else
|
||||
static inline int prepare_string_for_scanning(zval *str, istrstream **input_stream CLS_DC)
|
||||
#endif
|
||||
{
|
||||
#ifndef ZTS
|
||||
/* enforce two trailing NULLs for flex... */
|
||||
@@ -463,10 +424,10 @@ static inline int prepare_string_for_scanning(zval *str CLS_DC)
|
||||
yyin=NULL;
|
||||
yy_scan_buffer(str->value.str.val, str->value.str.len+2);
|
||||
#else
|
||||
istrstream *input_stream = new istrstream(str->value.str.val, str->value.str.len);
|
||||
*input_stream = new istrstream(str->value.str.val, str->value.str.len);
|
||||
CG(ZFL) = new ZendFlexLexer;
|
||||
|
||||
CG(ZFL)->switch_streams(input_stream, &cout);
|
||||
CG(ZFL)->switch_streams(*input_stream, &cout);
|
||||
#endif
|
||||
zend_set_compiled_filename("Eval code");
|
||||
CG(zend_lineno) = 1;
|
||||
@@ -483,6 +444,9 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
zval tmp;
|
||||
int compiler_result;
|
||||
zend_bool original_in_compilation = CG(in_compilation);
|
||||
#ifdef ZTS
|
||||
istrstream *input_stream;
|
||||
#endif
|
||||
|
||||
if (source_string->value.str.len==0) {
|
||||
efree(op_array);
|
||||
@@ -496,13 +460,16 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
convert_to_string(&tmp);
|
||||
source_string = &tmp;
|
||||
|
||||
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
if (prepare_string_for_scanning(source_string CLS_CC)==FAILURE) {
|
||||
destroy_op_array(op_array);
|
||||
#ifndef ZTS
|
||||
if (prepare_string_for_scanning(source_string)==FAILURE) {
|
||||
#else
|
||||
if (prepare_string_for_scanning(source_string, &input_stream CLS_CC)==FAILURE) {
|
||||
#endif
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
} else {
|
||||
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE CLS_CC);
|
||||
CG(active_op_array) = op_array;
|
||||
#ifndef ZTS
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
@@ -520,10 +487,12 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
do_return(NULL, 0 CLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array);
|
||||
pass_include_eval(op_array);
|
||||
retval = op_array;
|
||||
}
|
||||
}
|
||||
#ifdef ZTS
|
||||
delete input_stream;
|
||||
#endif
|
||||
zval_dtor(&tmp);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
return retval;
|
||||
@@ -531,87 +500,6 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
int require_filename(char *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
file_handle.filename = filename;
|
||||
file_handle.free_filename = 0;
|
||||
if (require_file(&file_handle, unique CLS_CC)==FAILURE) {
|
||||
zend_bailout();
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int use_filename(char *filename, uint filename_length CLS_DC)
|
||||
{
|
||||
zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()");
|
||||
return FAILURE;
|
||||
|
||||
#if 0
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.filename = (char *) emalloc(filename_length + zend_uv.import_use_extension_length);
|
||||
memcpy(file_handle.filename, filename, filename_length);
|
||||
memcpy(file_handle.filename+filename_length, zend_uv.import_use_extension, zend_uv.import_use_extension_length);
|
||||
file_handle.filename[filename_length+zend_uv.import_use_extension_length] = 0;
|
||||
file_handle.free_filename = 1;
|
||||
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
if (require_file(&file_handle, 1 CLS_CC)==FAILURE) {
|
||||
efree(file_handle.filename);
|
||||
zend_bailout();
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
return SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
int compiler_result;
|
||||
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
if (open_file_for_scanning(file_handle CLS_CC)==FAILURE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
|
||||
return FAILURE;
|
||||
}
|
||||
if (file_handle->opened_path) {
|
||||
if (unique) {
|
||||
zend_file_handle *pfh;
|
||||
|
||||
if (zend_hash_add(&CG(used_files), file_handle->opened_path, strlen(file_handle->opened_path)+1, file_handle, sizeof(zend_file_handle), (void **) &pfh)==FAILURE) {
|
||||
zend_close_file_handle(file_handle CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
/* pfh is a copy we only save for get_used_files() */
|
||||
pfh->type = ZEND_HANDLE_FILENAME;
|
||||
if (pfh->filename) {
|
||||
pfh->filename = estrdup(pfh->filename);
|
||||
pfh->free_filename = 1;
|
||||
}
|
||||
if (pfh->opened_path) {
|
||||
pfh->opened_path = strdup(pfh->opened_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
compiler_result = zendparse(CLS_C);
|
||||
zend_close_file_handle(file_handle CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
if (compiler_result==1) {
|
||||
zend_bailout();
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
@@ -628,7 +516,7 @@ int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlight
|
||||
return FAILURE;
|
||||
}
|
||||
zend_highlight(syntax_highlighter_ini);
|
||||
zend_close_file_handle(&file_handle CLS_CC);
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -638,16 +526,26 @@ int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
zval tmp = *str;
|
||||
#ifdef ZTS
|
||||
istrstream *input_stream;
|
||||
#endif
|
||||
CLS_FETCH();
|
||||
|
||||
str = &tmp;
|
||||
zval_copy_ctor(str);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
if (prepare_string_for_scanning(str CLS_CC)==FAILURE) {
|
||||
#ifndef ZTS
|
||||
if (prepare_string_for_scanning(str)==FAILURE) {
|
||||
#else
|
||||
if (prepare_string_for_scanning(str, &input_stream CLS_CC)==FAILURE) {
|
||||
#endif
|
||||
return FAILURE;
|
||||
}
|
||||
zend_highlight(syntax_highlighter_ini);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
#ifdef ZTS
|
||||
delete input_stream;
|
||||
#endif
|
||||
zval_dtor(str);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
+34
-1
@@ -357,7 +357,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
zend_get_ini_entry_p = utility_functions->get_ini_entry;
|
||||
zend_ticks_function = utility_functions->ticks_function;
|
||||
|
||||
zend_v_compile_files = v_compile_files;
|
||||
zend_compile_file = compile_file;
|
||||
zend_execute = execute;
|
||||
|
||||
zend_startup_extensions();
|
||||
@@ -692,3 +692,36 @@ ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ..
|
||||
va_end(args);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_execute_scripts(int type CLS_DC ELS_DC, int file_count, ...)
|
||||
{
|
||||
va_list files;
|
||||
int i;
|
||||
zend_file_handle *file_handle;
|
||||
|
||||
va_start(files, file_count);
|
||||
for (i=0; i<file_count; i++) {
|
||||
file_handle = va_arg(files, zend_file_handle *);
|
||||
if (!file_handle) {
|
||||
continue;
|
||||
}
|
||||
EG(active_op_array) = zend_compile_file(file_handle, ZEND_INCLUDE CLS_CC);
|
||||
zend_destroy_file_handle(file_handle CLS_CC);
|
||||
if (EG(active_op_array)) {
|
||||
zend_execute(EG(active_op_array) ELS_CC);
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
EG(return_value_ptr_ptr) = &EG(global_return_value_ptr);
|
||||
EG(global_return_value_ptr) = NULL;
|
||||
destroy_op_array(EG(active_op_array));
|
||||
efree(EG(active_op_array));
|
||||
} else if (type==ZEND_REQUIRE) {
|
||||
va_end(files);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
va_end(files);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
|
||||
#define ZEND_VERSION "1.0.1"
|
||||
#define ZEND_VERSION "1.0.2"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BEGIN_EXTERN_C() extern "C" {
|
||||
|
||||
+3
-3
@@ -227,7 +227,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define ZVAL_EMPTY_STRING(z) { \
|
||||
(z)->value.str.len = 0; \
|
||||
(z)->value.str.val = empty_string \
|
||||
(z)->value.str.val = empty_string; \
|
||||
(z)->type = IS_STRING; \
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define RETVAL_EMPTY_STRING() { \
|
||||
return_value->value.str.len = 0; \
|
||||
return_value->value.str.val = empty_string \
|
||||
return_value->value.str.val = empty_string; \
|
||||
return_value->type = IS_STRING; \
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define RETURN_EMPTY_STRING() { \
|
||||
return_value->value.str.len = 0; \
|
||||
return_value->value.str.val = empty_string \
|
||||
return_value->value.str.val = empty_string; \
|
||||
return_value->type = IS_STRING; \
|
||||
return; \
|
||||
}
|
||||
|
||||
+18
-5
@@ -57,11 +57,18 @@ ZEND_API zend_alloc_globals alloc_globals;
|
||||
|
||||
#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\
|
||||
if (AG(memory_limit)<AG(allocated_memory)) {\
|
||||
if (!file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit),s); \
|
||||
} else { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", AG(memory_limit), file, lineno, s); \
|
||||
} \
|
||||
if ((AG(memory_limit)+1048576)<AG(allocated_memory)) { \
|
||||
/* failed to handle this gracefully, exit() */ \
|
||||
exit(1); \
|
||||
} \
|
||||
if (!AG(memory_exhausted)) { \
|
||||
if (!file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit),s); \
|
||||
} else { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", AG(memory_limit), file, lineno, s); \
|
||||
} \
|
||||
AG(memory_exhausted)=1; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
# endif
|
||||
@@ -434,6 +441,9 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (long) (total_leak_count));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
AG(allocated_memory) -= t->size;
|
||||
#endif
|
||||
p = t->pNext;
|
||||
REMOVE_POINTER_FROM_LIST(t);
|
||||
@@ -451,6 +461,9 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
}
|
||||
}
|
||||
}
|
||||
#if MEMORY_LIMIT
|
||||
AG(memory_exhausted)=0;
|
||||
#endif
|
||||
|
||||
#if (ZEND_DEBUG)
|
||||
do {
|
||||
|
||||
@@ -47,7 +47,6 @@ static ZEND_FUNCTION(leak);
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
static ZEND_FUNCTION(crash);
|
||||
#endif
|
||||
static ZEND_FUNCTION(get_required_files);
|
||||
static ZEND_FUNCTION(get_included_files);
|
||||
static ZEND_FUNCTION(is_subclass_of);
|
||||
static ZEND_FUNCTION(get_class_vars);
|
||||
@@ -91,8 +90,8 @@ static zend_function_entry builtin_functions[] = {
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
ZEND_FE(crash, NULL)
|
||||
#endif
|
||||
ZEND_FE(get_required_files, NULL)
|
||||
ZEND_FE(get_included_files, NULL)
|
||||
ZEND_FALIAS(get_required_files, get_included_files, NULL)
|
||||
ZEND_FE(is_subclass_of, NULL)
|
||||
ZEND_FE(get_class_vars, NULL)
|
||||
ZEND_FE(get_object_vars, NULL)
|
||||
@@ -713,22 +712,6 @@ static int copy_import_use_file(zend_file_handle *fh, zval *array)
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto array get_required_files(void)
|
||||
Returns an array with the file names that were require_once()'d */
|
||||
ZEND_FUNCTION(get_required_files)
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_apply_with_argument(&CG(used_files), (apply_func_arg_t) copy_import_use_file, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto array get_included_files(void)
|
||||
Returns an array with the file names that were include_once()'d */
|
||||
ZEND_FUNCTION(get_included_files)
|
||||
@@ -914,13 +897,14 @@ ZEND_FUNCTION(create_function)
|
||||
/* }}} */
|
||||
|
||||
|
||||
|
||||
#if ZEND_DEBUG
|
||||
ZEND_FUNCTION(zend_test_func)
|
||||
{
|
||||
zval *arg1, *arg2;
|
||||
|
||||
zend_get_parameters(ht, 2, &arg1, &arg2);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
ZEND_FUNCTION(get_resource_type)
|
||||
|
||||
+41
-46
@@ -26,7 +26,7 @@
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
|
||||
ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
|
||||
ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type CLS_DC);
|
||||
|
||||
|
||||
#ifndef ZTS
|
||||
@@ -43,15 +43,15 @@ static void free_filename(void *p)
|
||||
}
|
||||
|
||||
|
||||
static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline)
|
||||
static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline CLS_DC)
|
||||
{
|
||||
char lineno_buf[32];
|
||||
uint lineno_len;
|
||||
char *filename;
|
||||
|
||||
lineno_len = zend_sprintf(lineno_buf, "%d", opline->lineno);
|
||||
if (opline->filename) {
|
||||
filename = opline->filename;
|
||||
if (CG(active_op_array)->filename) {
|
||||
filename = CG(active_op_array)->filename;
|
||||
} else {
|
||||
filename = "-";
|
||||
}
|
||||
@@ -65,12 +65,6 @@ static void build_runtime_defined_function_key(zval *result, zval *name, zend_op
|
||||
}
|
||||
|
||||
|
||||
static void zend_open_file_dtor_wrapper(zend_file_handle *fh)
|
||||
{
|
||||
zend_open_file_dtor(fh);
|
||||
}
|
||||
|
||||
|
||||
static void init_compiler_declarables(CLS_D ELS_DC)
|
||||
{
|
||||
CG(declarables).ticks.type = IS_LONG;
|
||||
@@ -89,13 +83,12 @@ void init_compiler(CLS_D ELS_DC)
|
||||
CG(active_class_entry) = NULL;
|
||||
zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0);
|
||||
zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0);
|
||||
zend_llist_init(&CG(filenames_list), sizeof(char *), free_filename, 0);
|
||||
zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_filename, 0);
|
||||
CG(handle_op_arrays) = 1;
|
||||
CG(in_compilation) = 0;
|
||||
zend_init_rsrc_list(ELS_C);
|
||||
CG(unclean_shutdown) = 0;
|
||||
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_open_file_dtor, 0);
|
||||
zend_hash_init(&CG(used_files), 5, NULL, (void (*)(void *)) zend_open_file_dtor_wrapper, 0);
|
||||
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_file_handle_dtor, 0);
|
||||
init_compiler_declarables(CLS_C ELS_CC);
|
||||
}
|
||||
|
||||
@@ -108,18 +101,22 @@ void shutdown_compiler(CLS_D)
|
||||
zend_stack_destroy(&CG(foreach_copy_stack));
|
||||
zend_stack_destroy(&CG(object_stack));
|
||||
zend_stack_destroy(&CG(declare_stack));
|
||||
zend_llist_destroy(&CG(filenames_list));
|
||||
zend_hash_destroy(&CG(filenames_table));
|
||||
zend_llist_destroy(&CG(open_files));
|
||||
zend_hash_destroy(&CG(used_files));
|
||||
}
|
||||
|
||||
|
||||
ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename)
|
||||
{
|
||||
char *p = estrdup(new_compiled_filename);
|
||||
char **pp, *p;
|
||||
int length = strlen(new_compiled_filename);
|
||||
CLS_FETCH();
|
||||
|
||||
zend_llist_add_element(&CG(filenames_list), &p);
|
||||
if (zend_hash_find(&CG(filenames_table), new_compiled_filename, length+1, (void **) &pp)==SUCCESS) {
|
||||
return *pp;
|
||||
}
|
||||
p = estrndup(new_compiled_filename, length);
|
||||
zend_hash_update(&CG(filenames_table), new_compiled_filename, length+1, &p, sizeof(char *), (void **) &pp);
|
||||
CG(compiled_filename) = p;
|
||||
return p;
|
||||
}
|
||||
@@ -328,7 +325,8 @@ void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC)
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
*result = opline->result;
|
||||
} else {
|
||||
SET_UNUSED(opline->result);
|
||||
/* SET_UNUSED(opline->result); */
|
||||
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
opline->op1 = *lvar;
|
||||
opline->op2 = *rvar;
|
||||
@@ -717,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, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
|
||||
init_op_array(&op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE CLS_CC);
|
||||
|
||||
op_array.function_name = name;
|
||||
op_array.arg_types = NULL;
|
||||
@@ -730,7 +728,7 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
|
||||
opline->opcode = ZEND_DECLARE_FUNCTION_OR_CLASS;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &function_name->u.constant, opline);
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &function_name->u.constant, opline CLS_CC);
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.value.str.val = estrndup(name, name_len);
|
||||
@@ -1345,10 +1343,22 @@ void do_brk_cont(int op, znode *expr CLS_DC)
|
||||
void do_switch_cond(znode *cond CLS_DC)
|
||||
{
|
||||
zend_switch_entry switch_entry;
|
||||
zend_op *opline;
|
||||
|
||||
/* Initialize the conditional value */
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_BOOL;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
opline->op1.u.constant.type = IS_BOOL;
|
||||
opline->op1.u.constant.value.lval = 0;
|
||||
INIT_PZVAL(&opline->op1.u.constant);
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
switch_entry.cond = *cond;
|
||||
switch_entry.default_case = -1;
|
||||
switch_entry.control_var = -1;
|
||||
switch_entry.control_var = opline->result.u.var;
|
||||
zend_stack_push(&CG(switch_cond_stack), (void *) &switch_entry, sizeof(switch_entry));
|
||||
|
||||
do_begin_loop(CLS_C);
|
||||
@@ -1413,9 +1423,6 @@ void do_case_before_statement(znode *case_list, znode *case_token, znode *case_e
|
||||
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
|
||||
|
||||
opline->opcode = ZEND_CASE;
|
||||
if (switch_entry_ptr->control_var==-1) {
|
||||
switch_entry_ptr->control_var = get_temporary_variable(CG(active_op_array));
|
||||
}
|
||||
opline->result.u.var = switch_entry_ptr->control_var;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->op1 = switch_entry_ptr->cond;
|
||||
@@ -1478,22 +1485,19 @@ void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_BOOL;
|
||||
if (switch_entry_ptr->control_var==-1) {
|
||||
switch_entry_ptr->control_var = get_temporary_variable(CG(active_op_array));
|
||||
}
|
||||
opline->result.u.var = switch_entry_ptr->control_var;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
opline->op1.u.constant.type = IS_LONG;
|
||||
opline->op1.u.constant.type = IS_BOOL;
|
||||
opline->op1.u.constant.value.lval = 1;
|
||||
INIT_PZVAL(&opline->op1.u.constant);
|
||||
SET_UNUSED(opline->op2);
|
||||
switch_entry_ptr->default_case = next_op_number;
|
||||
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
if (case_list->op_type==IS_UNUSED) {
|
||||
return;
|
||||
}
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
|
||||
}
|
||||
|
||||
@@ -1551,7 +1555,7 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
|
||||
opline->opcode = ZEND_DECLARE_FUNCTION_OR_CLASS;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &class_name->u.constant, opline);
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &class_name->u.constant, opline CLS_CC);
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.refcount = 1;
|
||||
@@ -1642,7 +1646,7 @@ void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
|
||||
unsigned char *ptr = NULL;
|
||||
|
||||
opline->opcode = ZEND_NEW;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *class_name;
|
||||
SET_UNUSED(opline->op2);
|
||||
@@ -1958,20 +1962,6 @@ void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
if (filename->op_type==IS_CONST
|
||||
&& filename->u.constant.type==IS_STRING) {
|
||||
require_filename(filename->u.constant.value.str.val, unique CLS_CC);
|
||||
zval_dtor(&filename->u.constant);
|
||||
} else {
|
||||
znode result;
|
||||
|
||||
do_include_or_eval(ZEND_REQUIRE, &result, filename CLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC)
|
||||
{
|
||||
int i;
|
||||
@@ -2022,7 +2012,7 @@ void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token CLS_DC)
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -2032,6 +2022,11 @@ void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_t
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *array;
|
||||
SET_UNUSED(opline->op2);
|
||||
if (variable) {
|
||||
opline->extended_value = 1;
|
||||
} else {
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
*open_brackets_token = opline->result;
|
||||
|
||||
zend_stack_push(&CG(foreach_copy_stack), (void *) &opline->result, sizeof(znode));
|
||||
|
||||
+10
-13
@@ -80,7 +80,6 @@ typedef struct _zend_op {
|
||||
znode op1;
|
||||
znode op2;
|
||||
ulong extended_value;
|
||||
char *filename;
|
||||
uint lineno;
|
||||
} zend_op;
|
||||
|
||||
@@ -121,6 +120,8 @@ struct _zend_op_array {
|
||||
zend_bool return_reference;
|
||||
zend_bool done_pass_two;
|
||||
|
||||
char *filename;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
};
|
||||
|
||||
@@ -211,7 +212,7 @@ BEGIN_EXTERN_C()
|
||||
void init_compiler(CLS_D ELS_DC);
|
||||
void shutdown_compiler(CLS_D);
|
||||
|
||||
extern ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
|
||||
extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type CLS_DC);
|
||||
|
||||
void zend_activate(CLS_D ELS_DC);
|
||||
void zend_deactivate(CLS_D ELS_DC);
|
||||
@@ -339,12 +340,11 @@ void do_new_list_end(CLS_D);
|
||||
|
||||
void do_cast(znode *result, znode *expr, int type CLS_DC);
|
||||
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC);
|
||||
|
||||
void do_unset(znode *variable CLS_DC);
|
||||
void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
|
||||
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token CLS_DC);
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC);
|
||||
void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
|
||||
void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
|
||||
|
||||
@@ -375,18 +375,15 @@ ZEND_API void function_add_ref(zend_function *function);
|
||||
|
||||
|
||||
/* helper functions in zend-scanner.l */
|
||||
ZEND_API int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC);
|
||||
ZEND_API int require_filename(char *filename, zend_bool unique CLS_DC);
|
||||
ZEND_API int use_filename(char *filename, uint filename_length CLS_DC);
|
||||
ZEND_API zend_op_array *zend_compile_files(int type CLS_DC, int file_count, ...);
|
||||
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files);
|
||||
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS_DC);
|
||||
ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
|
||||
ZEND_API zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC);
|
||||
ZEND_API int zend_execute_scripts(int type CLS_DC ELS_DC, int file_count, ...);
|
||||
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
|
||||
ZEND_API void init_op_array(zend_op_array *op_array, int type, int initial_ops_size);
|
||||
ZEND_API void init_op_array(zend_op_array *op_array, int type, int initial_ops_size CLS_DC);
|
||||
ZEND_API void destroy_op_array(zend_op_array *op_array);
|
||||
ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC);
|
||||
ZEND_API void zend_open_file_dtor(zend_file_handle *fh);
|
||||
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle CLS_DC);
|
||||
ZEND_API void zend_file_handle_dtor(zend_file_handle *fh);
|
||||
|
||||
ZEND_API void destroy_zend_function(zend_function *function);
|
||||
ZEND_API void destroy_zend_class(zend_class_entry *ce);
|
||||
@@ -401,7 +398,6 @@ int get_next_op_number(zend_op_array *op_array);
|
||||
int print_class(zend_class_entry *class_entry);
|
||||
void print_op_array(zend_op_array *op_array, int optimizations);
|
||||
int pass_two(zend_op_array *op_array);
|
||||
ZEND_API void pass_include_eval(zend_op_array *op_array);
|
||||
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
|
||||
ZEND_API zend_bool zend_is_compiling(void);
|
||||
|
||||
@@ -572,6 +568,7 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_INCLUDE (1<<1)
|
||||
#define ZEND_INCLUDE_ONCE (1<<2)
|
||||
#define ZEND_REQUIRE (1<<3)
|
||||
#define ZEND_REQUIRE_ONCE (1<<4)
|
||||
|
||||
#define ZEND_ISSET (1<<0)
|
||||
#define ZEND_ISEMPTY (1<<1)
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
| Z
|
||||
eev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@@ -47,6 +48,7 @@ typedef unsigned int uint;
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
#define vsnprintf _vsnprintf
|
||||
#define zend_isinf(a) 0
|
||||
|
||||
#ifdef inline
|
||||
#undef inline
|
||||
@@ -64,6 +66,7 @@ typedef unsigned int uint;
|
||||
#endif
|
||||
|
||||
#define zend_finite(A) _finite(A)
|
||||
#define zend_isnan(A) _isnan(A)
|
||||
|
||||
#ifdef LIBZEND_EXPORTS
|
||||
# define ZEND_API __declspec(dllexport)
|
||||
|
||||
+39
-38
@@ -1412,7 +1412,7 @@ binary_assign_op_addr: {
|
||||
/* constructor call */
|
||||
|
||||
if (opline->op1.op_type == IS_VAR) {
|
||||
PZVAL_LOCK(*Ts[opline->op1.u.var].var.ptr_ptr);
|
||||
SELECTIVE_PZVAL_LOCK(*Ts[opline->op1.u.var].var.ptr_ptr, &opline->op1);
|
||||
}
|
||||
if (opline->op2.op_type==IS_VAR) {
|
||||
PZVAL_LOCK(*Ts[opline->op2.u.var].var.ptr_ptr);
|
||||
@@ -1720,6 +1720,7 @@ send_by_ref:
|
||||
if (opline->op2.u.constant.type==IS_CONSTANT_ARRAY) {
|
||||
zval_copy_ctor(default_value);
|
||||
}
|
||||
default_value->refcount=1;
|
||||
zval_update_constant(&default_value, 0);
|
||||
default_value->refcount=0;
|
||||
default_value->is_ref=0;
|
||||
@@ -1838,9 +1839,11 @@ send_by_ref:
|
||||
if (zend_hash_find(EG(class_table), class_name.value.str.val, class_name.value.str.len+1, (void **) &ce)==FAILURE) {
|
||||
zend_error(E_ERROR, "Cannot instantiate non-existent class: %s", class_name.value.str.val);
|
||||
}
|
||||
object_init_ex(&Ts[opline->result.u.var].tmp_var, ce);
|
||||
Ts[opline->result.u.var].tmp_var.refcount=1;
|
||||
Ts[opline->result.u.var].tmp_var.is_ref=1;
|
||||
Ts[opline->result.u.var].var.ptr_ptr = &Ts[opline->result.u.var].var.ptr;
|
||||
ALLOC_ZVAL(Ts[opline->result.u.var].var.ptr);
|
||||
object_init_ex(Ts[opline->result.u.var].var.ptr, ce);
|
||||
Ts[opline->result.u.var].var.ptr->refcount=1;
|
||||
Ts[opline->result.u.var].var.ptr->is_ref=1;
|
||||
zval_dtor(&class_name);
|
||||
FREE_OP(&opline->op1, EG(free_op1));
|
||||
}
|
||||
@@ -1969,37 +1972,35 @@ send_by_ref:
|
||||
return_value_used = RETURN_VALUE_USED(opline);
|
||||
|
||||
switch (opline->op2.u.constant.value.lval) {
|
||||
case ZEND_INCLUDE_ONCE: {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
char *opened_path;
|
||||
int dummy = 1;
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.handle.fp = zend_fopen(inc_filename->value.str.val, &opened_path);
|
||||
file_handle.type = ZEND_HANDLE_FP;
|
||||
if (opened_path) {
|
||||
file_handle.filename = opened_path;
|
||||
file_handle.free_filename = 0;
|
||||
} else {
|
||||
file_handle.filename = inc_filename->value.str.val;
|
||||
file_handle.free_filename = 0;
|
||||
}
|
||||
|
||||
file_handle.filename = inc_filename->value.str.val;
|
||||
file_handle.opened_path = opened_path;
|
||||
file_handle.free_filename = 0;
|
||||
|
||||
if (file_handle.handle.fp) {
|
||||
if (!opened_path || zend_hash_add(&EG(included_files), opened_path, strlen(opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) {
|
||||
new_op_array = zend_compile_files(ZEND_INCLUDE CLS_CC, 1, &file_handle);
|
||||
if (new_op_array) {
|
||||
pass_include_eval(new_op_array);
|
||||
} else {
|
||||
fclose(file_handle.handle.fp);
|
||||
}
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) CLS_CC);
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
opened_path = NULL; /* zend_destroy_file_handle() already frees it */
|
||||
} else {
|
||||
fclose(file_handle.handle.fp);
|
||||
}
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle.filename);
|
||||
if (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle.filename);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle.filename);
|
||||
}
|
||||
}
|
||||
if (opened_path) {
|
||||
free (opened_path);
|
||||
free(opened_path);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2008,9 +2009,6 @@ send_by_ref:
|
||||
case ZEND_REQUIRE:
|
||||
{
|
||||
new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename CLS_CC ELS_CC);
|
||||
if (new_op_array) {
|
||||
pass_include_eval(new_op_array);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ZEND_EVAL:
|
||||
@@ -2082,8 +2080,6 @@ send_by_ref:
|
||||
if (container) {
|
||||
HashTable *ht;
|
||||
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
|
||||
switch ((*container)->type) {
|
||||
case IS_ARRAY:
|
||||
ht = (*container)->value.ht;
|
||||
@@ -2130,22 +2126,27 @@ send_by_ref:
|
||||
}
|
||||
NEXT_OPCODE();
|
||||
case ZEND_FE_RESET: {
|
||||
zval *array_ptr;
|
||||
zval *array_ptr, **array_ptr_ptr;
|
||||
HashTable *fe_ht;
|
||||
|
||||
array_ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
|
||||
if (EG(free_op1)) { /* IS_TMP_VAR */
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
*tmp = *array_ptr;
|
||||
INIT_PZVAL(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
if (opline->extended_value) {
|
||||
array_ptr_ptr = get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_R);
|
||||
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
|
||||
array_ptr = *array_ptr_ptr;
|
||||
array_ptr->refcount++;
|
||||
}
|
||||
} else {
|
||||
array_ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
if (EG(free_op1)) { /* IS_TMP_VAR */
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
*tmp = *array_ptr;
|
||||
INIT_PZVAL(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
array_ptr->refcount++;
|
||||
}
|
||||
}
|
||||
PZVAL_LOCK(array_ptr);
|
||||
Ts[opline->result.u.var].var.ptr = array_ptr;
|
||||
Ts[opline->result.u.var].var.ptr_ptr = &Ts[opline->result.u.var].var.ptr;
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var
|
||||
(*variable_ptr_ptr)->is_ref = 1;
|
||||
}
|
||||
|
||||
if (result && (result->op_type != IS_UNUSED)) {
|
||||
if (result && !(result->u.EA.type & EXT_TYPE_UNUSED)) {
|
||||
Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result);
|
||||
AI_USE_PTR(Ts[result->u.var].var);
|
||||
|
||||
+5
-14
@@ -115,8 +115,7 @@ void init_executor(CLS_D ELS_DC)
|
||||
original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv);
|
||||
#endif
|
||||
EG(return_value_ptr_ptr) = &EG(global_return_value_ptr);
|
||||
EG(global_return_value_ptr) = &EG(global_return_value);
|
||||
INIT_ZVAL(EG(global_return_value));
|
||||
EG(global_return_value_ptr) = NULL;
|
||||
|
||||
EG(symtable_cache_ptr) = EG(symtable_cache)-1;
|
||||
EG(symtable_cache_limit)=EG(symtable_cache)+SYMTABLE_CACHE_SIZE-1;
|
||||
@@ -129,7 +128,6 @@ void init_executor(CLS_D ELS_DC)
|
||||
|
||||
zend_ptr_stack_init(&EG(argument_stack));
|
||||
|
||||
EG(main_op_array) = NULL;
|
||||
zend_hash_init(&EG(symbol_table), 50, NULL, ZVAL_PTR_DTOR, 0);
|
||||
EG(active_symbol_table) = &EG(symbol_table);
|
||||
|
||||
@@ -155,11 +153,6 @@ void init_executor(CLS_D ELS_DC)
|
||||
|
||||
void shutdown_executor(ELS_D)
|
||||
{
|
||||
if (EG(global_return_value_ptr) == &EG(global_return_value)) {
|
||||
zval_dtor(&EG(global_return_value));
|
||||
} else {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
zend_ptr_stack_destroy(&EG(arg_types_stack));
|
||||
|
||||
while (EG(symtable_cache_ptr)>=EG(symtable_cache)) {
|
||||
@@ -180,10 +173,6 @@ void shutdown_executor(ELS_D)
|
||||
zend_ptr_stack_destroy(&EG(argument_stack));
|
||||
|
||||
/* Destroy all op arrays */
|
||||
if (EG(main_op_array)) {
|
||||
destroy_op_array(EG(main_op_array));
|
||||
efree(EG(main_op_array));
|
||||
}
|
||||
zend_hash_apply(EG(function_table), (int (*)(void *)) is_not_internal_function);
|
||||
zend_hash_apply(EG(class_table), (int (*)(void *)) is_not_internal_class);
|
||||
|
||||
@@ -236,8 +225,8 @@ ZEND_API char *get_active_function_name()
|
||||
|
||||
ZEND_API char *zend_get_executed_filename(ELS_D)
|
||||
{
|
||||
if (EG(opline_ptr)) {
|
||||
return active_opline->filename;
|
||||
if (EG(active_op_array)) {
|
||||
return EG(active_op_array)->filename;
|
||||
} else {
|
||||
return "[no active file]";
|
||||
}
|
||||
@@ -367,7 +356,9 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
|
||||
return FAILURE;
|
||||
}
|
||||
function_name = *tmp_real_function_name;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(tmp_object_ptr);
|
||||
object = *tmp_object_ptr;
|
||||
object->is_ref = 1;
|
||||
}
|
||||
|
||||
if (object) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "zend_compile.h"
|
||||
|
||||
#define ZEND_EXTENSION_API_NO 20000707
|
||||
#define ZEND_EXTENSION_API_NO 20000815
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
|
||||
+1
-5
@@ -91,9 +91,7 @@ struct _zend_compiler_globals {
|
||||
HashTable *function_table; /* function symbol table */
|
||||
HashTable *class_table; /* class table */
|
||||
|
||||
HashTable used_files; /* files already included using 'use' */
|
||||
|
||||
zend_llist filenames_list;
|
||||
HashTable filenames_table;
|
||||
|
||||
zend_bool in_compilation;
|
||||
zend_bool short_tags;
|
||||
@@ -133,7 +131,6 @@ struct _zend_executor_globals {
|
||||
|
||||
/* for global return() support */
|
||||
zval *global_return_value_ptr;
|
||||
zval global_return_value;
|
||||
|
||||
/* symbol table cache */
|
||||
HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
|
||||
@@ -153,7 +150,6 @@ struct _zend_executor_globals {
|
||||
int orig_error_reporting;
|
||||
|
||||
zend_op_array *active_op_array;
|
||||
zend_op_array *main_op_array;
|
||||
|
||||
HashTable *function_table; /* function symbol table */
|
||||
HashTable *class_table; /* class table */
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ extern unsigned char second_arg_allow_ref[];
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#define ZEND_MODULE_API_NO 20000609
|
||||
#define ZEND_MODULE_API_NO 20000809
|
||||
#ifdef ZTS
|
||||
#define USING_ZTS 1
|
||||
#else
|
||||
|
||||
+5
-13
@@ -50,7 +50,7 @@ static void op_array_alloc_ops(zend_op_array *op_array)
|
||||
|
||||
|
||||
|
||||
void init_op_array(zend_op_array *op_array, int type, int initial_ops_size)
|
||||
void init_op_array(zend_op_array *op_array, int type, int initial_ops_size CLS_DC)
|
||||
{
|
||||
op_array->type = type;
|
||||
#if SUPPORT_INTERACTIVE
|
||||
@@ -78,6 +78,7 @@ void init_op_array(zend_op_array *op_array, int type, int initial_ops_size)
|
||||
op_array->T = 0;
|
||||
|
||||
op_array->function_name = NULL;
|
||||
op_array->filename = zend_get_compiled_filename(CLS_C);
|
||||
|
||||
op_array->arg_types = NULL;
|
||||
|
||||
@@ -188,7 +189,6 @@ void init_op(zend_op *op CLS_DC)
|
||||
{
|
||||
memset(&op->result, 0, sizeof(znode));
|
||||
op->lineno = CG(zend_lineno);
|
||||
op->filename = zend_get_compiled_filename(CLS_C);
|
||||
op->result.op_type = IS_UNUSED;
|
||||
op->extended_value = 0;
|
||||
memset(&op->op1, 0, sizeof(znode));
|
||||
@@ -252,7 +252,6 @@ static void zend_update_extended_info(zend_op_array *op_array CLS_DC)
|
||||
continue;
|
||||
}
|
||||
opline->lineno = (opline+1)->lineno;
|
||||
opline->filename = (opline+1)->filename;
|
||||
} else {
|
||||
opline->opcode = ZEND_NOP;
|
||||
}
|
||||
@@ -264,7 +263,6 @@ static void zend_update_extended_info(zend_op_array *op_array CLS_DC)
|
||||
opline->op1.op_type = IS_UNUSED;
|
||||
opline->op2.op_type = IS_UNUSED;
|
||||
if (op_array->last>0) {
|
||||
opline->filename = op_array->opcodes[op_array->last-2].filename;
|
||||
opline->lineno= op_array->opcodes[op_array->last-2].lineno;
|
||||
}
|
||||
}
|
||||
@@ -281,6 +279,7 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a
|
||||
|
||||
int pass_two(zend_op_array *op_array)
|
||||
{
|
||||
zend_op *opline=op_array->opcodes, *end=opline+op_array->last;
|
||||
CLS_FETCH();
|
||||
|
||||
if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) {
|
||||
@@ -292,15 +291,6 @@ int pass_two(zend_op_array *op_array)
|
||||
if (CG(handle_op_arrays)) {
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_handler, op_array);
|
||||
}
|
||||
op_array->done_pass_two = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void pass_include_eval(zend_op_array *op_array)
|
||||
{
|
||||
zend_op *opline=op_array->opcodes, *end=opline+op_array->last;
|
||||
|
||||
while (opline<end) {
|
||||
if (opline->op1.op_type==IS_CONST) {
|
||||
opline->op1.u.constant.is_ref = 1;
|
||||
@@ -312,6 +302,8 @@ ZEND_API void pass_include_eval(zend_op_array *op_array)
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
op_array->done_pass_two = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+16
-22
@@ -1,28 +1,22 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
#
|
||||
# Makefile to generate build tools
|
||||
#
|
||||
|
||||
|
||||
+16
-22
@@ -1,27 +1,21 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# $Id$
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
|
||||
include generated_lists
|
||||
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
#! /bin/sh
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Stig Bakken <ssb@fast.no> |
|
||||
# | Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id: buildcheck.sh,v 1.3 2000-08-20 05:39:37 sas Exp $
|
||||
#
|
||||
|
||||
echo "buildconf: checking installation..."
|
||||
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
all: all-recursive
|
||||
|
||||
include $(builddir)/libs.mk
|
||||
|
||||
+16
-23
@@ -1,29 +1,22 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id: fastgen.sh,v 1.7 2000-06-11 10:33:39 sas Exp $
|
||||
# $Id: fastgen.sh,v 1.8 2000-08-20 05:39:37 sas Exp $
|
||||
#
|
||||
|
||||
srcdir=$1
|
||||
|
||||
+15
-22
@@ -1,26 +1,19 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
|
||||
+15
-22
@@ -1,26 +1,19 @@
|
||||
# Copyright (c) 1999 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# echo top_srcdir top_builddir srcdir CPP [CPP-ARGS] filenames | \
|
||||
# awk -f mkdep.awk > dependencies
|
||||
|
||||
|
||||
{
|
||||
top_srcdir=$1
|
||||
top_builddir=$2
|
||||
srcdir=$3
|
||||
cmd=$4
|
||||
|
||||
for (i = 5; i <= NF; i++) {
|
||||
if (match($i, "^-[A-Z]") == 0)
|
||||
break;
|
||||
cmd=cmd " " $i
|
||||
}
|
||||
|
||||
dif=i-1
|
||||
|
||||
for (; i <= NF; i++)
|
||||
filenames[i-dif]=$i
|
||||
|
||||
no_files=NF-dif
|
||||
|
||||
for(i = 1; i <= no_files; i++) {
|
||||
if (system("test -r " filenames[i]) != 0)
|
||||
continue
|
||||
|
||||
target=filenames[i]
|
||||
sub(srcdir "/", "", target)
|
||||
target2=target
|
||||
sub("\.(c|cpp)$", ".lo", target);
|
||||
sub("\.(c|cpp)$", ".slo", target2);
|
||||
|
||||
for (e in used)
|
||||
delete used[e]
|
||||
|
||||
cmdx=cmd " " filenames[i]
|
||||
done=0
|
||||
while ((cmdx | getline) > 0) {
|
||||
if (match($0, "^# [0-9]* \".*\.h\"") != 0) {
|
||||
if (sub(top_srcdir, "$(top_srcdir)", $3) == 0)
|
||||
sub(top_builddir, "$(top_builddir)", $3)
|
||||
if (substr($3,2,1) != "/" && used[$3] != 1) {
|
||||
if (done == 0)
|
||||
printf(target " " target2 ":")
|
||||
done=1
|
||||
printf(" \\\n\t" substr($3,2,length($3)-2))
|
||||
used[$3] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (done == 1)
|
||||
print "\n"
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Created: Thu Aug 15 11:57:33 1996 too
|
||||
# Last modified: Mon Dec 27 09:23:56 1999 too
|
||||
#
|
||||
# Copyright (c) 1996-1999 Tomi Ollila. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
die "Usage: mkdep CPP-command [CPP options] file1 [file2...]\n"
|
||||
if ($#ARGV < 1);
|
||||
|
||||
$cmdl = shift(@ARGV);
|
||||
|
||||
$cmdl = "$cmdl " . shift (@ARGV) while ($ARGV[0] =~ /^-[A-Z]/);
|
||||
|
||||
while ($file = shift(@ARGV))
|
||||
{
|
||||
$file =~ s/\.o$/.c/;
|
||||
|
||||
open(F, "$cmdl $file|");
|
||||
|
||||
&parseout;
|
||||
|
||||
close(F);
|
||||
}
|
||||
|
||||
|
||||
sub initinit
|
||||
{
|
||||
%used = ();
|
||||
$of = $file;
|
||||
$of =~ s/\.c$/.lo/;
|
||||
$str = "$of:\t$file";
|
||||
$len = length $str;
|
||||
}
|
||||
|
||||
sub initstr
|
||||
{
|
||||
$str = "\t";
|
||||
$len = length $str;
|
||||
}
|
||||
|
||||
sub parseout
|
||||
{
|
||||
&initinit;
|
||||
while (<F>)
|
||||
{
|
||||
next unless (/^# [0-9]* "(.*\.h)"/);
|
||||
|
||||
next if ($1 =~ /^\//);
|
||||
|
||||
next if $used{$1};
|
||||
|
||||
$used{$1} = 1;
|
||||
|
||||
$nlen = length($1) + 1;
|
||||
|
||||
if ($len + $nlen > 72)
|
||||
{
|
||||
print $str, "\\\n";
|
||||
&initstr;
|
||||
$str = $str . $1;
|
||||
}
|
||||
else { $str = $str . " " . $1; }
|
||||
|
||||
$len += $nlen;
|
||||
|
||||
}
|
||||
print $str, "\n";
|
||||
}
|
||||
+15
-22
@@ -1,26 +1,19 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
|
||||
+20
-80
@@ -1,86 +1,23 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
|
||||
COMPILE = $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
|
||||
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(COMPILE) -c $< && touch $@
|
||||
CXX_SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CXX_COMPILE) -c $< && touch $@
|
||||
|
||||
LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@
|
||||
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
CXX_SUFFIX = .cxx
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c $(CXX_SUFFIX) .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
$(CXX_SUFFIX).o:
|
||||
$(CXX_COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
$(CXX_SUFFIX).lo:
|
||||
$(CXX_PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
$(CXX_SUFFIX).slo:
|
||||
$(CXX_SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
include $(top_srcdir)/build/rules_common.mk
|
||||
|
||||
all: all-recursive
|
||||
install: install-recursive
|
||||
@@ -104,7 +41,7 @@ install-p: $(targets) $(install_targets)
|
||||
distclean-p depend-p clean-p:
|
||||
|
||||
depend: depend-recursive
|
||||
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
|
||||
@echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true
|
||||
|
||||
clean: clean-recursive clean-x
|
||||
|
||||
@@ -116,6 +53,9 @@ distclean: distclean-recursive clean-x
|
||||
rm -f config.cache config.log config.status config_vars.mk libtool \
|
||||
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
|
||||
|
||||
test: $(top_builddir)/php
|
||||
@$(top_builddir)/php -f $(top_srcdir)/run-tests.php `pwd`
|
||||
|
||||
include $(builddir)/.deps
|
||||
|
||||
.PHONY: all-recursive clean-recursive install-recursive \
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
|
||||
COMPILE = $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
|
||||
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(COMPILE) -c $< && touch $@
|
||||
CXX_SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CXX_COMPILE) -c $< && touch $@
|
||||
|
||||
LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@
|
||||
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
|
||||
DEFS = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
CXX_SUFFIX = .cpp
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c $(CXX_SUFFIX) .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
$(CXX_SUFFIX).o:
|
||||
$(CXX_COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
$(CXX_SUFFIX).lo:
|
||||
$(CXX_PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
$(CXX_SUFFIX).slo:
|
||||
$(CXX_SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
+17
-63
@@ -1,69 +1,23 @@
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -f -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
include $(top_srcdir)/build/rules_common.mk
|
||||
|
||||
install_targets = install-modules
|
||||
|
||||
@@ -89,7 +43,7 @@ install-p: $(targets) $(install_targets)
|
||||
distclean-p depend-p clean-p:
|
||||
|
||||
depend: depend-recursive
|
||||
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
|
||||
@echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true
|
||||
|
||||
clean: clean-recursive clean-x
|
||||
|
||||
|
||||
@@ -26,4 +26,6 @@ else
|
||||
subdirs=''
|
||||
fi
|
||||
|
||||
rm -f generated_lists
|
||||
|
||||
${MAKE:-make} -s -f build/build.mk AMFLAGS="$automake_flags"
|
||||
+7
-6
@@ -51,7 +51,7 @@ dnl ## All of these are normally in the extension directories.
|
||||
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
|
||||
|
||||
dnl ## This is where the version number is changed from now on!
|
||||
AM_INIT_AUTOMAKE(php, 4.0.2-dev)
|
||||
AM_INIT_AUTOMAKE(php, 4.0.2)
|
||||
|
||||
PHP_VERSION=$VERSION
|
||||
echo "/* automatically generated by configure */" > php_version.h.new
|
||||
@@ -73,6 +73,7 @@ dnl We want this one before the checks, so the checks can modify CFLAGS.
|
||||
test -z "$CFLAGS" && auto_cflags=1
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_AWK
|
||||
AC_PROG_YACC
|
||||
if test "$YACC" != "bison -y"; then
|
||||
AC_MSG_WARN(You will need bison if you want to regenerate the PHP parsers.)
|
||||
@@ -95,7 +96,7 @@ case "$host_alias" in
|
||||
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS";;
|
||||
*dgux*)
|
||||
CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";;
|
||||
*rhapsody*)
|
||||
*darwin*|*rhapsody*)
|
||||
CPPFLAGS="$CPPFLAGS -traditional-cpp";;
|
||||
esac
|
||||
|
||||
@@ -115,6 +116,9 @@ if test "$ac_cv_c_const" = "yes" ; then
|
||||
LEX_CFLAGS="-DYY_USE_CONST"
|
||||
fi
|
||||
|
||||
abs_srcdir=`(cd $srcdir; pwd)`
|
||||
abs_builddir=`pwd`
|
||||
|
||||
sinclude(Zend/acinclude.m4)
|
||||
sinclude(Zend/Zend.m4)
|
||||
sinclude(TSRM/tsrm.m4)
|
||||
@@ -410,9 +414,6 @@ fi
|
||||
divert(4)
|
||||
|
||||
|
||||
|
||||
abs_srcdir=`(cd $srcdir; pwd)`
|
||||
abs_builddir=`pwd`
|
||||
|
||||
PHP_ARG_WITH(config-file-path,whether to use a configuration file,
|
||||
[ --with-config-file-path=PATH
|
||||
@@ -551,7 +552,6 @@ if test "$PHP_PEAR" = "yes"; then
|
||||
fi
|
||||
|
||||
PHP_OUTPUT(pear/pear)
|
||||
PHP_OUTPUT(pear/run-tests)
|
||||
PHP_OUTPUT(pear/phpize)
|
||||
PHP_OUTPUT(pear/php-config)
|
||||
PHP_OUTPUT(pear/PEAR.php)
|
||||
@@ -695,6 +695,7 @@ PHP_SUBST(phplibdir)
|
||||
PHP_SUBST(phptempdir)
|
||||
PHP_SUBST(prefix)
|
||||
|
||||
PHP_SUBST(AWK)
|
||||
PHP_SUBST(CC)
|
||||
PHP_SUBST(CFLAGS)
|
||||
PHP_SUBST(CONFIGURE_COMMAND)
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# 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_CALENDAR" /D "DBNTWIN32" /D ZTS=1 /YX /FD /c
|
||||
# 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 "COMPILE_DL_CALENDAR" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CALENDAR_EXPORTS" /D "COMPILE_DL_CALENDAR" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CALENDAR=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -53,8 +53,8 @@ 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"
|
||||
# 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 /nologo /dll /machine:I386
|
||||
# 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" /libpath:"..\..\Release_TS_Inline"
|
||||
|
||||
!ELSEIF "$(CFG)" == "calendar - Win32 Debug_TS"
|
||||
|
||||
@@ -70,7 +70,7 @@ LINK32=link.exe
|
||||
# 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_CALENDAR" /D "DBNTWIN32" /D ZTS=1 /D MSSQL70=1 /YX /FD /c
|
||||
# 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 "COMPILE_DL_CALENDAR" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CALENDAR_EXPORTS" /D "COMPILE_DL_CALENDAR" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CALENDAR=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -80,7 +80,7 @@ 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 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 /nologo /dll /machine:I386
|
||||
# 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
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# $Id$
|
||||
|
||||
LTLIBRARY_NAME = libccvs.la
|
||||
LTLIBRARY_SOURCES = ccvs.c
|
||||
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
@@ -0,0 +1,7 @@
|
||||
CCVS Module ToDo List
|
||||
08/14/2000
|
||||
Brendan W. McAdams <bmcadams@php.net>
|
||||
-------------------------------------
|
||||
- Return value of the final stats of an authorization should already be split out into a php aware associative
|
||||
array, instead of having to do this at the PHP level. Right now we are splitting stuff out using text_value;
|
||||
I'm evaluating the merits of having a seperate function for the 'finishing' of a sale....
|
||||
+538
@@ -0,0 +1,538 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| 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: Brendan W. McAdams <brendan@plexmedia.com> |
|
||||
| Doug DeJulio <ddj@redhat.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
/*
|
||||
* cvvs.c $Revision$ - PHP4 Interface to the RedHat CCVS API
|
||||
* -------
|
||||
* Interfaces RedHat's CCVS [Credit Card Verification System] <http://www.redhat.com/products/ccvs/>
|
||||
* This code is ported from an original php3 interface written by RedHat's Doug DeJulio <ddj@redhat.com>
|
||||
* The code was subsequently ported to the Zend API by Brendan W. McAdams <brendan@plexmedia.com>
|
||||
* -------
|
||||
*/
|
||||
|
||||
/*
|
||||
* Code started on 2000.07.24@09.04.EST by Brendan W. McAdams <brendan@plexmedia.com>
|
||||
* $Revision$
|
||||
*/
|
||||
|
||||
static char const cvsid[] = "$Id$";
|
||||
|
||||
#include <php.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ccvs.h>
|
||||
|
||||
|
||||
/*
|
||||
* Create the Zend Internal hash construct to track this modules functions
|
||||
*
|
||||
* In case anyone is wondering why we use ccvs_<action> instead of cv_<action>,
|
||||
* it's because we are directly importing functions of the actual CCVS, which uses functions that are
|
||||
* cv_<action>, and we had problems implementing ZEND_NAMED_FE calls (bug in NAMED_FE? investigate
|
||||
* later). We don't want our PHP calls to conflict with the C calls in the CCVS API.
|
||||
*
|
||||
* BWM - 2000.07.27@16.41.EST - Added FALIAS Calls. While I'm of the opinion that naming the
|
||||
* functions in PHP ccvs_<action> is much more readable and clear to anyone reading the code than
|
||||
* cv_<action>, It strikes me that many people coming from php3 -> php4 will need backwards
|
||||
* compatibility. It was kind of careless to simply change the function calls (There were reasons other
|
||||
* than readability behind this; the ZEND_NAMED_FE macro was misbehaving) and not provide for
|
||||
* backwards compatibility - this *IS* an API and should scale with compatibility.
|
||||
*
|
||||
*/
|
||||
|
||||
function_entry ccvs_functions[] = {
|
||||
PHP_FE(ccvs_init,NULL)
|
||||
PHP_FALIAS(cv_init,ccvs_init,NULL)
|
||||
PHP_FE(ccvs_done,NULL)
|
||||
PHP_FALIAS(cv_done,ccvs_done,NULL)
|
||||
PHP_FE(ccvs_new,NULL)
|
||||
PHP_FALIAS(cv_new,ccvs_new,NULL)
|
||||
PHP_FE(ccvs_add,NULL)
|
||||
PHP_FALIAS(cv_add,ccvs_add,NULL)
|
||||
PHP_FE(ccvs_delete,NULL)
|
||||
PHP_FALIAS(cv_delete,ccvs_delete,NULL)
|
||||
PHP_FE(ccvs_auth,NULL)
|
||||
PHP_FALIAS(cv_auth,ccvs_auth,NULL)
|
||||
PHP_FE(ccvs_return,NULL)
|
||||
PHP_FALIAS(cv_return,ccvs_return,NULL)
|
||||
PHP_FE(ccvs_reverse,NULL)
|
||||
PHP_FALIAS(cv_reverse,ccvs_reverse,NULL)
|
||||
PHP_FE(ccvs_sale,NULL)
|
||||
PHP_FALIAS(cv_sale,ccvs_sale,NULL)
|
||||
PHP_FE(ccvs_void,NULL)
|
||||
PHP_FALIAS(cv_void,ccvs_void,NULL)
|
||||
PHP_FE(ccvs_status,NULL)
|
||||
PHP_FALIAS(cv_status,ccvs_status,NULL)
|
||||
PHP_FE(ccvs_count,NULL)
|
||||
PHP_FALIAS(cv_count,ccvs_count,NULL)
|
||||
PHP_FE(ccvs_lookup,NULL)
|
||||
PHP_FALIAS(cv_lookup,ccvs_lookup,NULL)
|
||||
PHP_FE(ccvs_report,NULL)
|
||||
PHP_FALIAS(cv_report,ccvs_report,NULL)
|
||||
PHP_FE(ccvs_command,NULL)
|
||||
PHP_FALIAS(cv_command,ccvs_command,NULL)
|
||||
PHP_FE(ccvs_textvalue,NULL)
|
||||
PHP_FALIAS(cv_textvalue,ccvs_textvalue,NULL)
|
||||
{NULL,NULL}
|
||||
};
|
||||
|
||||
/* End function declarations */
|
||||
|
||||
/* Zend Engine Exports - module information */
|
||||
|
||||
/* Declare our module to the Zend engine */
|
||||
zend_module_entry ccvs_module_entry = {
|
||||
"CCVS",
|
||||
ccvs_functions,
|
||||
NULL,NULL,NULL,NULL,
|
||||
PHP_MINFO(ccvs),
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
|
||||
/* Full Functions (The actual CCVS functions and any internal php hooked functions such as MINFO) */
|
||||
|
||||
PHP_FUNCTION(ccvs_init) /* cv_init() */
|
||||
{
|
||||
zval **name;
|
||||
void *vsess;
|
||||
char *p;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &name) != SUCCESS))
|
||||
/* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(name);
|
||||
|
||||
vsess = cv_init((*name)->value.str.val);
|
||||
|
||||
/*
|
||||
* -- In the case that we don't run error checking on the return value... --
|
||||
* On 32 bit systems a failure of the cv_init call returns 0,0,0,0 ; on 64 bit systems its 0,0,0,0,0,0,0,0
|
||||
* This unconsistent error (not to mention a string of comma seperated zeros in and of itself) is hard to
|
||||
* Trap for in PHP (or any language). However, we can also grab cv_init to return CV_SESS_BAD on
|
||||
* failure at the C API level, and return a set, fixed error code to the user which the user then knows to
|
||||
* trap for... e.g. a NULL Value which PHP can then trap by:
|
||||
* if (!($string = cv_init($config)) { or some such...
|
||||
*/
|
||||
|
||||
if (vsess == CV_SESS_BAD) /* if the cv_init() call failed... */
|
||||
{
|
||||
|
||||
p = ""; /* set p, the value we will return, to NULL */
|
||||
|
||||
}
|
||||
else /* we got a valid session returned, which means it worked */
|
||||
{
|
||||
|
||||
p = hks_ptr_ptrtostring(vsess); /* Convert the (void*) into a string representation. */
|
||||
|
||||
}
|
||||
|
||||
RETVAL_STRING(p, 1);
|
||||
|
||||
free(p);
|
||||
return;
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_done) /* cv_done() */
|
||||
{
|
||||
zval **sess;
|
||||
void *vsess;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &sess) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(sess);
|
||||
|
||||
/* Convert from the string representation back to a (void*) */
|
||||
vsess = hks_ptr_stringtoptr((*sess)->value.str.val);
|
||||
cv_done(vsess);
|
||||
|
||||
RETURN_STRING("OK", 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_new) /* cv_new() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
|
||||
r = cv_new(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_add) /* cv_add() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
zval **pargtype;
|
||||
zval **pargval;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
int argtype;
|
||||
char *argval;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 4) || (zend_get_parameters_ex(4, &psess, &pinvoice, &pargtype, &pargval) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
/* Get meaningful arguments. */
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
convert_to_string_ex(pargtype);
|
||||
convert_to_string_ex(pargval);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
argtype = cv_str2arg((*pargtype)->value.str.val);
|
||||
argval = (*pargval)->value.str.val;
|
||||
|
||||
r = cv_add(sess, invoice, argtype, argval);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* cv_create can't be implemented because of vararg limits in PHP3's C API.
|
||||
* (COMMENT BY DDJ [from original code])
|
||||
*
|
||||
* BWM: I looked into this, checking in on what cv_create was; it is a deprecated function left in for
|
||||
* backwards compatibility according
|
||||
* to the CCVS C API ref. I didn't try to implement it for that reason. If anyone needs it, they can add it in
|
||||
* themselves I'm sure.
|
||||
*/
|
||||
PHP_FUNCTION(ccvs_delete) /* cv_delete() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_delete(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_auth) /* cv_auth() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_auth(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_return) /* cv_return() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_return(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_reverse) /* cv_reverse() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_reverse(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_sale) /* cv_sale() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(ht, 2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_sale(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_void) /* cv_void() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_void(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_status) /* cv_status() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_status(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_stat2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_count) /* cv_count() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **ptype;
|
||||
void *sess;
|
||||
int type;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &ptype) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(ptype);
|
||||
type = cv_str2stat((*ptype)->value.str.val);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_count(sess, type);
|
||||
|
||||
RETURN_LONG(r);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_lookup) /* cv_lookup() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **ptype;
|
||||
zval **pinum;
|
||||
void *sess;
|
||||
int type;
|
||||
long inum;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 3) || (zend_get_parameters_ex(3, &psess, &ptype, &pinum) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
convert_to_string_ex(ptype);
|
||||
type = cv_str2stat((*ptype)->value.str.val);
|
||||
convert_to_long_ex(pinum);
|
||||
inum = (*pinum)->value.lval;
|
||||
|
||||
r = cv_lookup(sess, type, inum);
|
||||
|
||||
RETURN_STRING(cv_textvalue(sess), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_report) /* cv_report() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **ptype;
|
||||
void *sess;
|
||||
int type;
|
||||
long inum;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &ptype) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
convert_to_string_ex(ptype);
|
||||
type = cv_str2rep((*ptype)->value.str.val);
|
||||
|
||||
r = cv_report(sess, type);
|
||||
|
||||
RETURN_STRING(cv_stat2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_command) /* cv_command() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **ptype;
|
||||
zval **pargval;
|
||||
void *sess;
|
||||
int type;
|
||||
register int r;
|
||||
char *argval;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 3) || (zend_get_parameters_ex(3, &psess, &ptype, &pargval) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
convert_to_string_ex(ptype);
|
||||
type = cv_str2cmd((*ptype)->value.str.val);
|
||||
convert_to_string_ex(pargval);
|
||||
argval = (*pargval)->value.str.val;
|
||||
|
||||
r = cv_command(sess, type, argval);
|
||||
|
||||
RETURN_STRING(cv_stat2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_textvalue) /* cv_textvalue() */
|
||||
{
|
||||
zval **psess;
|
||||
void *sess;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &psess) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
RETURN_STRING(cv_textvalue(sess), 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Our Info Function which reports info on this module out to PHP's phpinfo() function
|
||||
* Brendan W. McAdams <brendan@plexmedia.com> on 2000.07.26@16:22.EST
|
||||
*/
|
||||
|
||||
PHP_MINFO_FUNCTION(ccvs)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_header(2, "RedHat CCVS support", "enabled");
|
||||
php_info_print_table_row(2,"CCVS Support by","Brendan W. McAdams <brendan@plexmedia.com><br>& Doug DeJulio <ddj@redhat.com>");
|
||||
php_info_print_table_row(2,"Release ID",cvsid);
|
||||
php_info_print_table_row(2,"This Release Certified For CCVS Versions","3.0 and greater");
|
||||
php_info_print_table_end();
|
||||
|
||||
/* DISPLAY_INI_ENTRIES(); */
|
||||
|
||||
/*
|
||||
* In the future, we will probably have entries in php.ini for runtime config, in which case we will
|
||||
* Uncomment the DISPLAY_INI_ENTRIES call...
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| 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: Brendan W. McAdams <brendan@plexmedia.com> |
|
||||
| Doug DeJulio <ddj@redhat.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include <cv_api.h>
|
||||
|
||||
extern zend_module_entry ccvs_module_entry;
|
||||
|
||||
#define ccvs_module_ptr &ccvs_module_entry
|
||||
#define phpext_ccvs_ptr ccvs_module_ptr
|
||||
|
||||
/* Declare functions not in cv_api.h but in libccvs.a. */
|
||||
char *hks_ptr_ptrtostring(void *vptr);
|
||||
void *hks_ptr_stringtoptr(char *str);
|
||||
|
||||
/* Declare the Functions this Module Makes Available to Zend */
|
||||
|
||||
|
||||
/* Pre-declarations of functions */
|
||||
PHP_FUNCTION(ccvs_init);
|
||||
PHP_FUNCTION(ccvs_done);
|
||||
PHP_FUNCTION(ccvs_new);
|
||||
PHP_FUNCTION(ccvs_add);
|
||||
PHP_FUNCTION(ccvs_delete);
|
||||
PHP_FUNCTION(ccvs_auth);
|
||||
PHP_FUNCTION(ccvs_return);
|
||||
PHP_FUNCTION(ccvs_reverse);
|
||||
PHP_FUNCTION(ccvs_sale);
|
||||
PHP_FUNCTION(ccvs_void);
|
||||
PHP_FUNCTION(ccvs_status);
|
||||
PHP_FUNCTION(ccvs_count);
|
||||
PHP_FUNCTION(ccvs_lookup);
|
||||
PHP_FUNCTION(ccvs_report);
|
||||
PHP_FUNCTION(ccvs_command);
|
||||
PHP_FUNCTION(ccvs_textvalue);
|
||||
PHP_MINFO_FUNCTION(ccvs);
|
||||
|
||||
/* Declare the information we need to dynamically link this module later */
|
||||
#if COMPILE_DL
|
||||
DLEXPORT zend_module_entry *get_module(void) { return &ccvs_module_entry; }
|
||||
#endif
|
||||
|
||||
/* End exports */
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
dnl $Id$
|
||||
dnl config.m4 for PHP4 CCVS Extension
|
||||
|
||||
AC_MSG_CHECKING(CCVS Support)
|
||||
AC_ARG_WITH(ccvs,
|
||||
[ --with-ccvs[=DIR] Compile CCVS support into PHP4.
|
||||
Please specify your CCVS base install directory as DIR.
|
||||
],
|
||||
[
|
||||
if test "$withval" != "no"; then
|
||||
CCVS_DIR="$withval"
|
||||
test -f $withval/include/cv_api.h && CCVS_INCLUDE_DIR="$withval/include"
|
||||
test -f $withval/lib/libccvs.a && CCVS_LIB_DIR="$withval/lib"
|
||||
|
||||
if test -n "$CCVS_DIR"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_EXTENSION(ccvs)
|
||||
LIBS="$LIBS -L$CCVS_LIB_DIR"
|
||||
AC_ADD_LIBRARY_WITH_PATH(ccvs, $CCVS_LIB_DIR)
|
||||
AC_ADD_INCLUDE($CCVS_INCLUDE_DIR)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
@@ -0,0 +1,111 @@
|
||||
# Microsoft Developer Studio Project File - Name="cpdf" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=cpdf - 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 "cpdf.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 "cpdf.mak" CFG="cpdf - Win32 Release_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "cpdf - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "cpdf - 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)" == "cpdf - 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 "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CPDF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CPDF_EXPORTS" /D "COMPILE_DL_CPDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CPDFLIB=1 /D "HAVE_UNISTD_H" /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 cpdfi32.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
|
||||
# ADD LINK32 php4ts.lib zendts.lib user32.lib winspool.lib cpdf.lib php_gd.lib kernel32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_cpdf.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "cpdf - 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 "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CPDF" /D ZTS=1 /D MSSQL70=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CPDF_EXPORTS" /D "COMPILE_DL_CPDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CPDFLIB=1 /D "HAVE_UNISTD_H" /FR /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 cpdfi32.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
|
||||
# ADD LINK32 cpdf.lib php4ts_debug.lib user32.lib winspool.lib mckcrypto.lib kernel32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_cpdf.dll" /libpath:"..\..\Debug_TS"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "cpdf - Win32 Release_TS"
|
||||
# Name "cpdf - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cpdf.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_cpdf.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
+381
-109
@@ -24,8 +24,18 @@
|
||||
#if HAVE_CURL
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef PHP_WIN32
|
||||
#include <winsock.h>
|
||||
#include <sys/types.h>
|
||||
#define fstat(handle, buff) _fstat(handle, buff)
|
||||
#define stat _stat
|
||||
#endif
|
||||
#include <curl/curl.h>
|
||||
#include <curl/easy.h>
|
||||
#include <sys/stat.h>
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "ext/standard/info.h"
|
||||
#include "php_curl.h"
|
||||
|
||||
@@ -35,12 +45,45 @@ int curl_globals_id;
|
||||
php_curl_globals curl_globals;
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
static void win32_cleanup();
|
||||
static void win32_init();
|
||||
|
||||
static void win32_cleanup()
|
||||
{
|
||||
WSACleanup();
|
||||
}
|
||||
|
||||
static CURLcode win32_init()
|
||||
{
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
int err;
|
||||
wVersionRequested = MAKEWORD(1, 1);
|
||||
|
||||
err = WSAStartup(wVersionRequested, &wsaData);
|
||||
|
||||
if (err != 0) return CURLE_FAILED_INIT;
|
||||
|
||||
if ( LOBYTE(wsaData.wVersion) != 1 ||
|
||||
HIBYTE(wsaData.wVersion) != 1 ) {
|
||||
WSACleanup();
|
||||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
return CURLE_OK;
|
||||
}
|
||||
#else
|
||||
static CURLcode win32_init(void) { return CURLE_OK; }
|
||||
#define win32_cleanup()
|
||||
#endif
|
||||
|
||||
|
||||
function_entry curl_functions[] = {
|
||||
PHP_FE (curl_init, NULL)
|
||||
PHP_FE (curl_version, NULL)
|
||||
PHP_FE (curl_setopt, NULL)
|
||||
PHP_FE (curl_exec, NULL)
|
||||
PHP_FE (curl_close, NULL)
|
||||
PHP_FE(curl_init, NULL)
|
||||
PHP_FE(curl_version, NULL)
|
||||
PHP_FE(curl_setopt, NULL)
|
||||
PHP_FE(curl_exec, NULL)
|
||||
PHP_FE(curl_close, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -48,7 +91,7 @@ zend_module_entry curl_module_entry = {
|
||||
"curl",
|
||||
curl_functions,
|
||||
PHP_MINIT(curl),
|
||||
NULL,
|
||||
PHP_MSHUTDOWN(curl),
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(curl),
|
||||
@@ -59,131 +102,190 @@ zend_module_entry curl_module_entry = {
|
||||
ZEND_GET_MODULE (curl)
|
||||
#endif
|
||||
|
||||
static void php_curl_close (CURL *cp);
|
||||
static void php_curl_close (CURL *cp)
|
||||
{
|
||||
curl_easy_cleanup (cp);
|
||||
}
|
||||
static void php_curl_close(php_curl *curl_handle);
|
||||
static int php_curl_error_translator(CURLcode err);
|
||||
|
||||
PHP_MINFO_FUNCTION(curl)
|
||||
{
|
||||
php_info_print_table_start ();
|
||||
php_info_print_table_row (2, "CURL support", "enabled");
|
||||
php_info_print_table_row (2, "CURL Information", curl_version());
|
||||
php_info_print_table_end ();
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "CURL support", "enabled");
|
||||
php_info_print_table_row(2, "CURL Information", curl_version());
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
PHP_MINIT_FUNCTION(curl)
|
||||
{
|
||||
CURLLS_FETCH();
|
||||
CURLG(le_curl) = register_list_destructors(php_curl_close, NULL);
|
||||
|
||||
CURLG(le_curl) = register_list_destructors (php_curl_close, NULL);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_PORT", CURLOPT_PORT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_FILE", CURLOPT_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_INFILE", CURLOPT_INFILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_INFILESIZE", CURLOPT_INFILESIZE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_URL", CURLOPT_URL, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_PROXY", CURLOPT_PROXY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_VERBOSE", CURLOPT_VERBOSE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_HEADER", CURLOPT_HEADER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_NOPROGRESS", CURLOPT_NOPROGRESS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_NOBODY", CURLOPT_NOBODY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_FAILONERROR", CURLOPT_FAILONERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_UPLOAD", CURLOPT_UPLOAD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_POST", CURLOPT_POST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_FTPLISTONLY", CURLOPT_FTPLISTONLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_FTPAPPEND", CURLOPT_FTPAPPEND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_NETRC", CURLOPT_NETRC, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_FOLLOWLOCATION", CURLOPT_FOLLOWLOCATION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_FTPASCII", CURLOPT_FTPASCII, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_PUT", CURLOPT_PUT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_MUTE", CURLOPT_MUTE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_USERPWD", CURLOPT_USERPWD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_PROXYUSERPWD", CURLOPT_PROXYUSERPWD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_RANGE", CURLOPT_RANGE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_TIMEOUT", CURLOPT_TIMEOUT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_POSTFIELDS", CURLOPT_POSTFIELDS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_REFERER", CURLOPT_REFERER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_USERAGENT", CURLOPT_USERAGENT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_FTPPORT", CURLOPT_FTPPORT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_LOW_SPEED_TIME", CURLOPT_LOW_SPEED_TIME, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_RESUME_FROM", CURLOPT_RESUME_FROM, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_COOKIE", CURLOPT_COOKIE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_SSLCERT", CURLOPT_SSLCERT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_SSLCERTPASSWD", CURLOPT_SSLCERTPASSWD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_WRITEHEADER", CURLOPT_WRITEHEADER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_COOKIEFILE", CURLOPT_COOKIEFILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_SSLVERSION", CURLOPT_SSLVERSION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_TIMECONDITION", CURLOPT_TIMECONDITION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_TIMEVALUE", CURLOPT_TIMEVALUE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_CUSTOMREQUEST", CURLOPT_CUSTOMREQUEST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_STDERR", CURLOPT_STDERR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_WRITEINFO", CURLOPT_WRITEINFO, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT ("CURLOPT_TRANSFERTEXT", CURLOPT_TRANSFERTEXT, CONST_CS | CONST_PERSISTENT);
|
||||
/* Constants for curl_setopt() */
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_PORT", CURLOPT_PORT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FILE", CURLOPT_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_INFILE", CURLOPT_INFILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_INFILESIZE", CURLOPT_INFILESIZE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_URL", CURLOPT_URL, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_PROXY", CURLOPT_PROXY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_VERBOSE", CURLOPT_VERBOSE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_HEADER", CURLOPT_HEADER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_NOPROGRESS", CURLOPT_NOPROGRESS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_NOBODY", CURLOPT_NOBODY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FAILONERROR", CURLOPT_FAILONERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_UPLOAD", CURLOPT_UPLOAD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_POST", CURLOPT_POST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FTPLISTONLY", CURLOPT_FTPLISTONLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FTPAPPEND", CURLOPT_FTPAPPEND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_NETRC", CURLOPT_NETRC, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FOLLOWLOCATION", CURLOPT_FOLLOWLOCATION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FTPASCII", CURLOPT_FTPASCII, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_PUT", CURLOPT_PUT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_MUTE", CURLOPT_MUTE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_USERPWD", CURLOPT_USERPWD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_PROXYUSERPWD", CURLOPT_PROXYUSERPWD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_RANGE", CURLOPT_RANGE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_TIMEOUT", CURLOPT_TIMEOUT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_POSTFIELDS", CURLOPT_POSTFIELDS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_REFERER", CURLOPT_REFERER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_USERAGENT", CURLOPT_USERAGENT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FTPPORT", CURLOPT_FTPPORT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_LOW_SPEED_TIME", CURLOPT_LOW_SPEED_TIME, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_RESUME_FROM", CURLOPT_RESUME_FROM, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_COOKIE", CURLOPT_COOKIE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_SSLCERT", CURLOPT_SSLCERT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_SSLCERTPASSWD", CURLOPT_SSLCERTPASSWD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_WRITEHEADER", CURLOPT_WRITEHEADER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_COOKIEFILE", CURLOPT_COOKIEFILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_SSLVERSION", CURLOPT_SSLVERSION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_TIMECONDITION", CURLOPT_TIMECONDITION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_TIMEVALUE", CURLOPT_TIMEVALUE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_CUSTOMREQUEST", CURLOPT_CUSTOMREQUEST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_STDERR", CURLOPT_STDERR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_WRITEINFO", CURLOPT_WRITEINFO, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_TRANSFERTEXT", CURLOPT_TRANSFERTEXT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_RETURNTRANSFER", CURLOPT_RETURNTRANSFER, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
/* Error Constants */
|
||||
REGISTER_LONG_CONSTANT("CURLE_OK", CE_OK, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_UNSUPPORTED_PROTOCOL", CE_UNSUPPORTED_PROTOCOL, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FAILED_INIT", CE_FAILED_INIT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_URL_MALFORMAT", CE_URL_MALFORMAT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_URL_MALFORMAT_USER", CE_URL_MALFORMAT_USER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_COULDNT_RESOLVE_PROXY", CE_COULDNT_RESOLVE_PROXY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_COULDNT_RESOLVE_HOST", CE_COULDNT_RESOLVE_HOST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_COULDNT_CONNECT", CE_COULDNT_CONNECT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_SERVER_REPLY", CE_FTP_WEIRD_SERVER_REPLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_ACCESS_DENIED", CE_FTP_ACCESS_DENIED, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_USER_PASSWORD_INCORRECT", CE_FTP_USER_PASSWORD_INCORRECT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_PASS_REPLY", CE_FTP_WEIRD_PASS_REPLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_USER_REPLY", CE_FTP_WEIRD_USER_REPLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_PASV_REPLY", CE_FTP_WEIRD_PASV_REPLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_227_FORMAT", CE_FTP_WEIRD_227_FORMAT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_CANT_GET_HOST", CE_FTP_CANT_GET_HOST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_CANT_RECONNECT", CE_FTP_CANT_RECONNECT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_SET_BINARY", CE_FTP_COULDNT_SET_BINARY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_PARTIAL_FILE", CE_PARTIAL_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_RETR_FILE", CE_FTP_COULDNT_RETR_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WRITE_ERROR", CE_FTP_WRITE_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_QUOTE_ERROR", CE_FTP_QUOTE_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_HTTP_NOT_FOUND", CE_HTTP_NOT_FOUND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_WRITE_ERROR", CE_WRITE_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_MALFORMAT_USER", CE_MALFORMAT_USER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_STOR_FILE", CE_FTP_COULDNT_STOR_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_READ_ERROR", CE_READ_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_OUT_OF_MEMORY", CE_OUT_OF_MEMORY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_OPERATION_TIMEOUTED", CE_OPERATION_TIMEOUTED, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_SET_ASCII", CE_FTP_COULDNT_SET_ASCII, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_PORT_FAILED", CE_FTP_PORT_FAILED, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_USE_REST", CE_FTP_COULDNT_USE_REST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_GET_SIZE", CE_FTP_COULDNT_GET_SIZE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_HTTP_RANGE_ERROR", CE_HTTP_RANGE_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_HTTP_POST_ERROR", CE_HTTP_POST_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_SSL_CONNECT_ERROR", CE_SSL_CONNECT_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_BAD_DOWNLOAD_RESUME", CE_FTP_BAD_DOWNLOAD_RESUME, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FILE_COULDNT_READ_FILE", CE_FILE_COULDNT_READ_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_LDAP_CANNOT_BIND", CE_LDAP_CANNOT_BIND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_LDAP_SEARCH_FAILED", CE_LDAP_SEARCH_FAILED, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_LIBRARY_NOT_FOUND", CE_LIBRARY_NOT_FOUND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FUNCTION_NOT_FOUND", CE_FUNCTION_NOT_FOUND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_ABORTED_BY_CALLBACK", CE_ABORTED_BY_CALLBACK, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_BAD_FUNCTION_ARGUMENT", CE_BAD_FUNCTION_ARGUMENT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_BAD_CALLING_ORDER", CE_BAD_CALLING_ORDER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURL_LAST", C_LAST, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
win32_init();
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/* {{{ proto string curl_version ()
|
||||
PHP_MSHUTDOWN_FUNCTION(curl)
|
||||
{
|
||||
win32_cleanup();
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto string curl_version (void)
|
||||
Return the CURL version string. */
|
||||
PHP_FUNCTION (curl_version)
|
||||
{
|
||||
RETURN_STRING(curl_version(),1);
|
||||
RETURN_STRING(curl_version(), 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int curl_init ([string url])
|
||||
Initialize a CURL session */
|
||||
PHP_FUNCTION (curl_init)
|
||||
PHP_FUNCTION(curl_init)
|
||||
{
|
||||
zval **uUrl;
|
||||
CURL *cp;
|
||||
int numArgs = ZEND_NUM_ARGS();
|
||||
zval **u_url;
|
||||
php_curl *curl_handle;
|
||||
int argcount = ZEND_NUM_ARGS();
|
||||
CURLLS_FETCH();
|
||||
|
||||
if (numArgs < 0 || numArgs > 1 ||
|
||||
zend_get_parameters_ex (numArgs, &uUrl) == FAILURE) {
|
||||
if (argcount < 0 || argcount > 1 ||
|
||||
zend_get_parameters_ex(argcount, &u_url) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
cp = curl_easy_init ();
|
||||
curl_handle->cp = curl_easy_init();
|
||||
|
||||
if (!cp) {
|
||||
php_error (E_ERROR, "Cannot initialize CURL Handle");
|
||||
if (!curl_handle->cp) {
|
||||
php_error(E_ERROR, "Cannot initialize CURL Handle");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (numArgs > 0) {
|
||||
convert_to_string_ex (uUrl);
|
||||
curl_easy_setopt (cp, CURLOPT_URL, Z_STRVAL_PP (uUrl));
|
||||
if (argcount > 0) {
|
||||
convert_to_string_ex(u_url);
|
||||
curl_easy_setopt(curl_handle->cp, CURLOPT_URL, Z_STRVAL_PP(u_url));
|
||||
}
|
||||
|
||||
curl_easy_setopt(cp, CURLOPT_NOPROGRESS, 1);
|
||||
curl_easy_setopt(cp, CURLOPT_VERBOSE, 0);
|
||||
curl_easy_setopt(curl_handle->cp, CURLOPT_NOPROGRESS, 1);
|
||||
curl_easy_setopt(curl_handle->cp, CURLOPT_VERBOSE, 0);
|
||||
|
||||
ZEND_REGISTER_RESOURCE (return_value, cp, CURLG(le_curl));
|
||||
curl_handle->output_file = 0;
|
||||
curl_handle->php_stdout = 1;
|
||||
|
||||
ZEND_REGISTER_RESOURCE(return_value, curl_handle, CURLG(le_curl));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool curl_setopt (int ch, string option, mixed value)
|
||||
Set an option for a CURL transfer */
|
||||
PHP_FUNCTION (curl_setopt)
|
||||
PHP_FUNCTION(curl_setopt)
|
||||
{
|
||||
zval **uCurlId, **uCurlOption, **uCurlValue;
|
||||
CURL *cp;
|
||||
zval **u_curl_id, **u_curl_option, **u_curl_value;
|
||||
php_curl *curl_handle;
|
||||
CURLcode ret;
|
||||
int option;
|
||||
CURLLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 ||
|
||||
zend_get_parameters_ex (3, &uCurlId, &uCurlOption, &uCurlValue) == FAILURE) {
|
||||
zend_get_parameters_ex(3, &u_curl_id, &u_curl_option, &u_curl_value) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE (cp, CURL *, uCurlId, -1, "CURL Handle", CURLG(le_curl));
|
||||
ZEND_FETCH_RESOURCE(curl_handle, php_curl *, u_curl_id, -1, "CURL Handle", CURLG(le_curl));
|
||||
|
||||
convert_to_long_ex (uCurlOption);
|
||||
option = Z_LVAL_PP (uCurlOption);
|
||||
convert_to_long_ex(u_curl_option);
|
||||
option = Z_LVAL_PP(u_curl_option);
|
||||
|
||||
if (option == CURLOPT_INFILESIZE || option == CURLOPT_VERBOSE ||
|
||||
option == CURLOPT_HEADER || option == CURLOPT_NOPROGRESS ||
|
||||
@@ -197,8 +299,8 @@ PHP_FUNCTION (curl_setopt)
|
||||
option == CURLOPT_SSLVERSION || option == CURLOPT_TIMECONDITION ||
|
||||
option == CURLOPT_TIMEVALUE || option == CURLOPT_TRANSFERTEXT) {
|
||||
|
||||
convert_to_long_ex (uCurlValue);
|
||||
ret = curl_easy_setopt (cp, option, Z_LVAL_PP (uCurlValue));
|
||||
convert_to_long_ex(u_curl_value);
|
||||
ret = curl_easy_setopt(curl_handle->cp, option, Z_LVAL_PP(u_curl_value));
|
||||
|
||||
} else if (option == CURLOPT_URL || option == CURLOPT_PROXY ||
|
||||
option == CURLOPT_USERPWD || option == CURLOPT_PROXYUSERPWD ||
|
||||
@@ -208,47 +310,111 @@ PHP_FUNCTION (curl_setopt)
|
||||
option == CURLOPT_SSLCERTPASSWD || option == CURLOPT_COOKIEFILE ||
|
||||
option == CURLOPT_CUSTOMREQUEST) {
|
||||
|
||||
convert_to_string_ex (uCurlValue);
|
||||
ret = curl_easy_setopt (cp, option, Z_STRVAL_PP (uCurlValue));
|
||||
convert_to_string_ex(u_curl_value);
|
||||
ret = curl_easy_setopt(curl_handle->cp, option, Z_STRVAL_PP(u_curl_value));
|
||||
|
||||
} else if (option == CURLOPT_FILE || option == CURLOPT_INFILE ||
|
||||
option == CURLOPT_WRITEHEADER || option == CURLOPT_STDERR) {
|
||||
|
||||
FILE *fp;
|
||||
ZEND_FETCH_RESOURCE (fp, FILE *, uCurlValue, -1, "File-handle", php_file_le_fopen ());
|
||||
ret = curl_easy_setopt (cp, option, fp);
|
||||
}
|
||||
ZEND_FETCH_RESOURCE(fp, FILE *, u_curl_value, -1, "File-handle", php_file_le_fopen());
|
||||
ret = curl_easy_setopt(curl_handle->cp, option, fp);
|
||||
|
||||
if (option == CURLOPT_FILE) {
|
||||
curl_handle->output_file = Z_LVAL_PP(u_curl_value);
|
||||
curl_handle->php_stdout = 0;
|
||||
}
|
||||
|
||||
} else if (option == CURLOPT_RETURNTRANSFER) {
|
||||
|
||||
if (ret == CURLE_OK) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
convert_to_long_ex(u_curl_value);
|
||||
|
||||
curl_handle->return_transfer = Z_LVAL_PP(u_curl_value);
|
||||
curl_handle->php_stdout = 0;
|
||||
}
|
||||
|
||||
RETURN_LONG(php_curl_error_translator(ret));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool curl_exec (int ch)
|
||||
Perform a CURL session */
|
||||
PHP_FUNCTION (curl_exec)
|
||||
PHP_FUNCTION(curl_exec)
|
||||
{
|
||||
zval **uCurlId;
|
||||
CURL *cp;
|
||||
zval **u_curl_id;
|
||||
php_curl *curl_handle;
|
||||
CURLcode ret;
|
||||
|
||||
FILE *fp;
|
||||
char buf[4096];
|
||||
int b;
|
||||
|
||||
CURLLS_FETCH();
|
||||
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 ||
|
||||
zend_get_parameters_ex (1, &uCurlId) == FAILURE) {
|
||||
zend_get_parameters_ex(1, &u_curl_id) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE (cp, CURL *, uCurlId, -1, "CURL Handle", CURLG(le_curl));
|
||||
ret = curl_easy_perform (cp);
|
||||
ZEND_FETCH_RESOURCE(curl_handle, php_curl *, u_curl_id, -1, "CURL Handle", CURLG(le_curl));
|
||||
|
||||
if ((curl_handle->return_transfer &&
|
||||
!curl_handle->output_file) || curl_handle->php_stdout) {
|
||||
|
||||
if ((fp = tmpfile()) == NULL) {
|
||||
php_error(E_WARNING, "Cannot initialize temporary file to save output from curl_exec()");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl_handle->cp, CURLOPT_FILE, fp);
|
||||
|
||||
} else if (curl_handle->return_transfer &&
|
||||
curl_handle->output_file) {
|
||||
|
||||
zval **id;
|
||||
|
||||
Z_LVAL_PP(id) = curl_handle->output_file;
|
||||
Z_TYPE_PP(id) = IS_RESOURCE;
|
||||
|
||||
ZEND_FETCH_RESOURCE(fp, FILE *, id, -1, "File-Handle", php_file_le_fopen());
|
||||
|
||||
if (ret == CURLE_OK) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ret = curl_easy_perform(curl_handle->cp);
|
||||
|
||||
if ((!curl_handle->return_transfer && !curl_handle->php_stdout) ||
|
||||
(ret != CURLE_OK)) {
|
||||
RETURN_LONG(php_curl_error_translator(ret));
|
||||
}
|
||||
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
|
||||
if (curl_handle->php_stdout) {
|
||||
|
||||
while ((b = fread(buf, 1, sizeof(buf), fp)) > 0) {
|
||||
php_write(buf, b);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
char *ret_data;
|
||||
struct stat stat_sb;
|
||||
|
||||
if (fstat(fileno(fp), &stat_sb)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ret_data = emalloc((stat_sb.st_size+1)*sizeof(char));
|
||||
|
||||
while ((b = fread(buf, 1, sizeof(buf), fp)) > 0) {
|
||||
strcat(ret_data, buf);
|
||||
}
|
||||
|
||||
RETURN_STRINGL(ret_data, stat_sb.st_size, 0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -256,18 +422,124 @@ PHP_FUNCTION (curl_exec)
|
||||
Close a CURL session */
|
||||
PHP_FUNCTION (curl_close)
|
||||
{
|
||||
zval **uCurlId;
|
||||
CURL *cp;
|
||||
zval **u_curl_id;
|
||||
php_curl *curl_handle;
|
||||
CURLLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 ||
|
||||
zend_get_parameters_ex (1, &uCurlId) == FAILURE) {
|
||||
zend_get_parameters_ex(1, &u_curl_id) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE (cp, CURL *, uCurlId, -1, "CURL Handle", CURLG(le_curl));
|
||||
zend_list_delete (Z_LVAL_PP (uCurlId));
|
||||
ZEND_FETCH_RESOURCE(curl_handle, php_curl *, u_curl_id, -1, "CURL Handle", CURLG(le_curl));
|
||||
|
||||
zend_list_delete(Z_LVAL_PP(u_curl_id));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static int php_curl_error_translator(CURLcode err)
|
||||
{
|
||||
switch (err)
|
||||
{
|
||||
case CURLE_OK:
|
||||
return(CE_OK);
|
||||
case CURLE_UNSUPPORTED_PROTOCOL:
|
||||
return(CE_UNSUPPORTED_PROTOCOL);
|
||||
case CURLE_FAILED_INIT:
|
||||
return(CE_FAILED_INIT);
|
||||
case CURLE_URL_MALFORMAT:
|
||||
return(CE_URL_MALFORMAT);
|
||||
case CURLE_URL_MALFORMAT_USER:
|
||||
return(CE_URL_MALFORMAT_USER);
|
||||
case CURLE_COULDNT_RESOLVE_PROXY:
|
||||
return(CE_COULDNT_RESOLVE_PROXY);
|
||||
case CURLE_COULDNT_RESOLVE_HOST:
|
||||
return(CE_COULDNT_RESOLVE_HOST);
|
||||
case CURLE_COULDNT_CONNECT:
|
||||
return(CE_COULDNT_CONNECT);
|
||||
case CURLE_FTP_WEIRD_SERVER_REPLY:
|
||||
return(CE_FTP_WEIRD_SERVER_REPLY);
|
||||
case CURLE_FTP_ACCESS_DENIED:
|
||||
return(CE_FTP_ACCESS_DENIED);
|
||||
case CURLE_FTP_USER_PASSWORD_INCORRECT:
|
||||
return(CE_FTP_USER_PASSWORD_INCORRECT);
|
||||
case CURLE_FTP_WEIRD_PASS_REPLY:
|
||||
return(CE_FTP_WEIRD_PASS_REPLY);
|
||||
case CURLE_FTP_WEIRD_USER_REPLY:
|
||||
return(CE_FTP_WEIRD_USER_REPLY);
|
||||
case CURLE_FTP_WEIRD_PASV_REPLY:
|
||||
return(CE_FTP_WEIRD_PASV_REPLY);
|
||||
case CURLE_FTP_WEIRD_227_FORMAT:
|
||||
return(CE_FTP_WEIRD_227_FORMAT);
|
||||
case CURLE_FTP_CANT_GET_HOST:
|
||||
return(CE_FTP_CANT_GET_HOST);
|
||||
case CURLE_FTP_CANT_RECONNECT:
|
||||
return(CE_FTP_CANT_RECONNECT);
|
||||
case CURLE_FTP_COULDNT_SET_BINARY:
|
||||
return(CE_FTP_COULDNT_SET_BINARY);
|
||||
case CURLE_PARTIAL_FILE:
|
||||
return(CE_PARTIAL_FILE);
|
||||
case CURLE_FTP_COULDNT_RETR_FILE:
|
||||
return(CE_FTP_COULDNT_RETR_FILE);
|
||||
case CURLE_FTP_WRITE_ERROR:
|
||||
return(CE_FTP_WRITE_ERROR);
|
||||
case CURLE_FTP_QUOTE_ERROR:
|
||||
return(CE_FTP_QUOTE_ERROR);
|
||||
case CURLE_HTTP_NOT_FOUND:
|
||||
return(CE_HTTP_NOT_FOUND);
|
||||
case CURLE_WRITE_ERROR:
|
||||
return(CE_WRITE_ERROR);
|
||||
case CURLE_MALFORMAT_USER:
|
||||
return(CE_MALFORMAT_USER);
|
||||
case CURLE_FTP_COULDNT_STOR_FILE:
|
||||
return(CE_FTP_COULDNT_STOR_FILE);
|
||||
case CURLE_READ_ERROR:
|
||||
return(CE_READ_ERROR);
|
||||
case CURLE_OUT_OF_MEMORY:
|
||||
return(CE_OUT_OF_MEMORY);
|
||||
case CURLE_OPERATION_TIMEOUTED:
|
||||
return(CE_OPERATION_TIMEOUTED);
|
||||
case CURLE_FTP_COULDNT_SET_ASCII:
|
||||
return(CE_FTP_COULDNT_SET_ASCII);
|
||||
case CURLE_FTP_PORT_FAILED:
|
||||
return(CE_FTP_PORT_FAILED);
|
||||
case CURLE_FTP_COULDNT_USE_REST:
|
||||
return(CE_FTP_COULDNT_USE_REST);
|
||||
case CURLE_FTP_COULDNT_GET_SIZE:
|
||||
return(CE_FTP_COULDNT_GET_SIZE);
|
||||
case CURLE_HTTP_RANGE_ERROR:
|
||||
return(CE_HTTP_RANGE_ERROR);
|
||||
case CURLE_HTTP_POST_ERROR:
|
||||
return(CE_HTTP_POST_ERROR);
|
||||
case CURLE_SSL_CONNECT_ERROR:
|
||||
return(CE_SSL_CONNECT_ERROR);
|
||||
case CURLE_FTP_BAD_DOWNLOAD_RESUME:
|
||||
return(CE_FTP_BAD_DOWNLOAD_RESUME);
|
||||
case CURLE_FILE_COULDNT_READ_FILE:
|
||||
return(CE_FILE_COULDNT_READ_FILE);
|
||||
case CURLE_LDAP_CANNOT_BIND:
|
||||
return(CE_LDAP_CANNOT_BIND);
|
||||
case CURLE_LDAP_SEARCH_FAILED:
|
||||
return(CE_LDAP_SEARCH_FAILED);
|
||||
case CURLE_LIBRARY_NOT_FOUND:
|
||||
return(CE_LIBRARY_NOT_FOUND);
|
||||
case CURLE_FUNCTION_NOT_FOUND:
|
||||
return(CE_FUNCTION_NOT_FOUND);
|
||||
case CURLE_ABORTED_BY_CALLBACK:
|
||||
return(CE_ABORTED_BY_CALLBACK);
|
||||
case CURLE_BAD_FUNCTION_ARGUMENT:
|
||||
return(CE_BAD_FUNCTION_ARGUMENT);
|
||||
case CURLE_BAD_CALLING_ORDER:
|
||||
return(CE_BAD_CALLING_ORDER);
|
||||
case CURL_LAST:
|
||||
return(C_LAST);
|
||||
}
|
||||
}
|
||||
|
||||
static void php_curl_close(php_curl *curl_handle)
|
||||
{
|
||||
curl_easy_cleanup(curl_handle->cp);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="curl" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=curl - 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 "curl.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 "curl.mak" CFG="curl - Win32 Release_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "curl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "curl - 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)" == "curl - 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 "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /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 /nologo /dll /machine:I386
|
||||
# ADD LINK32 php4ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "curl - 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" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /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 /nologo /dll /machine:I386
|
||||
# ADD LINK32 php4ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "curl - Win32 Release_TS"
|
||||
# Name "curl - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\curl.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_curl.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
|
||||
+65
-8
@@ -28,17 +28,74 @@
|
||||
|
||||
#if HAVE_CURL
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
extern zend_module_entry curl_module_entry;
|
||||
#define curl_module_ptr &curl_module_entry
|
||||
|
||||
PHP_MINIT_FUNCTION (curl);
|
||||
PHP_MINFO_FUNCTION (curl);
|
||||
PHP_FUNCTION (curl_version);
|
||||
PHP_FUNCTION (curl_init);
|
||||
PHP_FUNCTION (curl_setopt);
|
||||
PHP_FUNCTION (curl_exec);
|
||||
PHP_FUNCTION (curl_close);
|
||||
PHP_MINIT_FUNCTION(curl);
|
||||
PHP_MSHUTDOWN_FUNCTION(curl);
|
||||
PHP_MINFO_FUNCTION(curl);
|
||||
PHP_FUNCTION(curl_version);
|
||||
PHP_FUNCTION(curl_init);
|
||||
PHP_FUNCTION(curl_setopt);
|
||||
PHP_FUNCTION(curl_exec);
|
||||
PHP_FUNCTION(curl_close);
|
||||
|
||||
#define CE_OK 0
|
||||
#define CE_UNSUPPORTED_PROTOCOL 1
|
||||
#define CE_FAILED_INIT 2
|
||||
#define CE_URL_MALFORMAT 3
|
||||
#define CE_URL_MALFORMAT_USER 4
|
||||
#define CE_COULDNT_RESOLVE_PROXY 5
|
||||
#define CE_COULDNT_RESOLVE_HOST 6
|
||||
#define CE_COULDNT_CONNECT 7
|
||||
#define CE_FTP_WEIRD_SERVER_REPLY 8
|
||||
#define CE_FTP_ACCESS_DENIED 9
|
||||
#define CE_FTP_USER_PASSWORD_INCORRECT 10
|
||||
#define CE_FTP_WEIRD_PASS_REPLY 11
|
||||
#define CE_FTP_WEIRD_USER_REPLY 12
|
||||
#define CE_FTP_WEIRD_PASV_REPLY 13
|
||||
#define CE_FTP_WEIRD_227_FORMAT 14
|
||||
#define CE_FTP_CANT_GET_HOST 15
|
||||
#define CE_FTP_CANT_RECONNECT 16
|
||||
#define CE_FTP_COULDNT_SET_BINARY 17
|
||||
#define CE_PARTIAL_FILE 18
|
||||
#define CE_FTP_COULDNT_RETR_FILE 19
|
||||
#define CE_FTP_WRITE_ERROR 20
|
||||
#define CE_FTP_QUOTE_ERROR 21
|
||||
#define CE_HTTP_NOT_FOUND 22
|
||||
#define CE_WRITE_ERROR 23
|
||||
#define CE_MALFORMAT_USER 24
|
||||
#define CE_FTP_COULDNT_STOR_FILE 25
|
||||
#define CE_READ_ERROR 26
|
||||
#define CE_OUT_OF_MEMORY 27
|
||||
#define CE_OPERATION_TIMEOUTED 28
|
||||
#define CE_FTP_COULDNT_SET_ASCII 29
|
||||
#define CE_FTP_PORT_FAILED 30
|
||||
#define CE_FTP_COULDNT_USE_REST 31
|
||||
#define CE_FTP_COULDNT_GET_SIZE 32
|
||||
#define CE_HTTP_RANGE_ERROR 33
|
||||
#define CE_HTTP_POST_ERROR 34
|
||||
#define CE_SSL_CONNECT_ERROR 35
|
||||
#define CE_FTP_BAD_DOWNLOAD_RESUME 36
|
||||
#define CE_FILE_COULDNT_READ_FILE 37
|
||||
#define CE_LDAP_CANNOT_BIND 38
|
||||
#define CE_LDAP_SEARCH_FAILED 39
|
||||
#define CE_LIBRARY_NOT_FOUND 40
|
||||
#define CE_FUNCTION_NOT_FOUND 41
|
||||
#define CE_ABORTED_BY_CALLBACK 42
|
||||
#define CE_BAD_FUNCTION_ARGUMENT 43
|
||||
#define CE_BAD_CALLING_ORDER 44
|
||||
#define C_LAST 45
|
||||
#define CURLOPT_RETURNTRANSFER 500
|
||||
|
||||
typedef struct {
|
||||
int return_transfer;
|
||||
int output_file;
|
||||
int php_stdout;
|
||||
CURL *cp;
|
||||
} php_curl;
|
||||
|
||||
typedef struct {
|
||||
int le_curl;
|
||||
@@ -46,7 +103,7 @@ typedef struct {
|
||||
|
||||
#ifdef ZTS
|
||||
#define CURLG(v) (curl_globals->v)
|
||||
#define CURLLS_FETCH() php_curl_globals *curl_globals = ts_resource(gd_curl_id)
|
||||
#define CURLLS_FETCH() php_curl_globals *curl_globals = ts_resource(curl_globals_id)
|
||||
#else
|
||||
#define CURLG(v) (curl_globals.v)
|
||||
#define CURLLS_FETCH()
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
# Microsoft Developer Studio Project File - Name="cybercash" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=cybercash - 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 "cybercash.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 "cybercash.mak" CFG="cybercash - Win32 Release_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "cybercash - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "cybercash - 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)" == "cybercash - 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 "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CYBERCASH_EXPORTS" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MCK=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 cybercashi32.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
|
||||
# ADD LINK32 php4ts.lib user32.lib winspool.lib mckcrypto.lib kernel32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"libcmt.lib" /out:"..\..\Release_TS/php_cybercash.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "cybercash - 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 "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CYBERCASH_EXPORTS" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MCK=1 /FR /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 cybercashi32.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
|
||||
# ADD LINK32 php4ts_debug.lib user32.lib winspool.lib mckcrypto.lib kernel32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"libcmt.lib" /out:"..\..\Debug_TS/php_cybercash.dll" /libpath:"..\..\Debug_TS"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "cybercash - Win32 Release_TS"
|
||||
# Name "cybercash - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cybercash.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cybercash.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
DBM File Creation Test
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
dbmopen("./test.dbm","n");
|
||||
dbmclose("./test.dbm");
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
DBM Insert/Fetch Test
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
dbmopen("./test.dbm","n");
|
||||
dbminsert("./test.dbm","key1","This is a test insert");
|
||||
$a = dbmfetch("./test.dbm","key1");
|
||||
dbmclose("./test.dbm");
|
||||
echo $a
|
||||
?>
|
||||
--EXPECT--
|
||||
This is a test insert
|
||||
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
DBM Insert/Replace/Fetch Test
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
dbmopen("./test.dbm","n");
|
||||
dbminsert("./test.dbm","key1","This is a test insert");
|
||||
dbmreplace("./test.dbm","key1","This is the replacement text");
|
||||
$a = dbmfetch("./test.dbm","key1");
|
||||
dbmclose("./test.dbm");
|
||||
echo $a
|
||||
?>
|
||||
--EXPECT--
|
||||
This is the replacement text
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
DBM Multiple Insert/Fetch Test
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
dbmopen("./test.dbm","n");
|
||||
dbminsert("./test.dbm","key1","Content String 1");
|
||||
dbminsert("./test.dbm","key2","Content String 2");
|
||||
dbminsert("./test.dbm","key3","Third Content String");
|
||||
dbminsert("./test.dbm","key4","Another Content String");
|
||||
dbminsert("./test.dbm","key5","The last content string");
|
||||
$a = dbmfetch("./test.dbm","key4");
|
||||
$b = dbmfetch("./test.dbm","key2");
|
||||
dbmclose("./test.dbm");
|
||||
echo "$a $b";
|
||||
?>
|
||||
--EXPECT--
|
||||
Another Content String Content String 2
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
DBM FirstKey/NextKey Loop Test With 5 Items
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
dbmopen("./test.dbm","n");
|
||||
dbminsert("./test.dbm","key1","Content String 1");
|
||||
dbminsert("./test.dbm","key2","Content String 2");
|
||||
dbminsert("./test.dbm","key3","Third Content String");
|
||||
dbminsert("./test.dbm","key4","Another Content String");
|
||||
dbminsert("./test.dbm","key5","The last content string");
|
||||
$a = dbmfirstkey("./test.dbm");
|
||||
$i=0;
|
||||
while($a) {
|
||||
$a = dbmnextkey("./test.dbm",$a);
|
||||
$i++;
|
||||
}
|
||||
dbmclose("./test.dbm");
|
||||
echo $i
|
||||
?>
|
||||
--EXPECT--
|
||||
5
|
||||
@@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
DBM FirstKey/NextKey with 2 deletes
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
dbmopen("./test.dbm","n");
|
||||
dbminsert("./test.dbm","key1","Content String 1");
|
||||
dbminsert("./test.dbm","key2","Content String 2");
|
||||
dbminsert("./test.dbm","key3","Third Content String");
|
||||
dbminsert("./test.dbm","key4","Another Content String");
|
||||
dbminsert("./test.dbm","key5","The last content string");
|
||||
dbmdelete("./test.dbm","key3");
|
||||
dbmdelete("./test.dbm","key1");
|
||||
$a = dbmfirstkey("./test.dbm");
|
||||
$i=0;
|
||||
while($a) {
|
||||
$a = dbmnextkey("./test.dbm",$a);
|
||||
$i++;
|
||||
}
|
||||
dbmclose("./test.dbm");
|
||||
echo $i
|
||||
?>
|
||||
--EXPECT--
|
||||
3
|
||||
+2
-2
@@ -233,7 +233,7 @@ PHP_FUNCTION(dbase_pack) {
|
||||
/* {{{ proto bool dbase_add_record(int identifier, array data)
|
||||
Adds a record to the database */
|
||||
PHP_FUNCTION(dbase_add_record) {
|
||||
pval *dbh_id, *fields, *field;
|
||||
pval *dbh_id, *fields, **field;
|
||||
dbhead_t *dbh;
|
||||
int dbh_type;
|
||||
|
||||
@@ -281,7 +281,7 @@ PHP_FUNCTION(dbase_add_record) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
tmp = *field;
|
||||
tmp = **field;
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_string(&tmp);
|
||||
sprintf(t_cp, cur_f->db_format, tmp.value.str.val);
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
# Microsoft Developer Studio Project File - Name="dbase" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=dbase - 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 "dbase.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 "dbase.mak" CFG="dbase - Win32 Release_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "dbase - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "dbase - 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)" == "dbase - 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 "COMPILE_DL_DBASE" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "DBASE_EXPORTS" /D "COMPILE_DL_DBASE" /D ZTS=1 /D HAVE_DBASE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D DBASE=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 /nologo /dll /machine:I386
|
||||
# ADD LINK32 php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dbase.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "dbase - 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" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DBASE" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DBASE_EXPORTS" /D "COMPILE_DL_DBASE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBASE=1 /FR /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 /nologo /dll /machine:I386
|
||||
# ADD LINK32 php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_dbase.dll" /libpath:"..\..\Debug_TS"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "dbase - Win32 Release_TS"
|
||||
# Name "dbase - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbase.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbf_head.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbf_misc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbf_ndx.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbf_rec.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbf_head.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbf_misc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbf_ndx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dbf_rec.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_dbase.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,114 @@
|
||||
# Microsoft Developer Studio Project File - Name="domxml" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=domxml - 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 "domxml.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 "domxml.mak" CFG="domxml - Win32 Release_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "domxml - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "domxml - 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)" == "domxml - 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 "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOMXML" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "DOMXML_EXPORTS" /D "COMPILE_DL_DOMXML" /D ZTS=1 /D HAVE_DOMXML=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /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 /nologo /dll /machine:I386
|
||||
# ADD LINK32 libxml.lib wsock32.lib php4ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_domxml.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "domxml - 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 "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOMXML" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOMXML_EXPORTS" /D "COMPILE_DL_DOMXML" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOMXML=1 /FR /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 /nologo /dll /machine:I386
|
||||
# ADD LINK32 libxml.lib php4ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_domxml.dll" /libpath:"..\..\Debug_TS"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "domxml - Win32 Release_TS"
|
||||
# Name "domxml - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_domxml.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_domxml.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
|
||||
@@ -41,7 +41,7 @@ static zend_class_entry *domxmltestnode_class_entry_ptr;
|
||||
static int node_attributes(zval **attributes, xmlNode *nodep);
|
||||
static int node_children(zval **children, xmlNode *nodep);
|
||||
|
||||
static zend_function_entry php_domxml_functions[] = {
|
||||
static zend_function_entry domxml_functions[] = {
|
||||
PHP_FE(xmldoc, NULL)
|
||||
PHP_FE(xmldocfile, NULL)
|
||||
PHP_FE(xmltree, NULL)
|
||||
@@ -103,10 +103,14 @@ static zend_function_entry php_domxmlns_class_functions[] = {
|
||||
void domxmltestnode_class_startup();
|
||||
#endif
|
||||
|
||||
zend_module_entry php_domxml_module_entry = {
|
||||
"domxml", php_domxml_functions, PHP_MINIT(domxml), NULL, NULL, NULL, PHP_MINFO(domxml), STANDARD_MODULE_PROPERTIES
|
||||
zend_module_entry domxml_module_entry = {
|
||||
"domxml", domxml_functions, PHP_MINIT(domxml), NULL, NULL, NULL, PHP_MINFO(domxml), STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#ifdef COMPILE_DL_DOMXML
|
||||
ZEND_GET_MODULE(domxml)
|
||||
#endif
|
||||
|
||||
void _free_node(xmlNode *tmp) {
|
||||
/*fprintf(stderr, "Freeing node: %s\n", tmp->name);*/
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#if HAVE_DOMXML
|
||||
#include <libxml/parser.h>
|
||||
|
||||
extern zend_module_entry php_domxml_module_entry;
|
||||
#define php_domxml_module_ptr &php_domxml_module_entry
|
||||
extern zend_module_entry domxml_module_entry;
|
||||
#define domxml_module_ptr &domxml_module_entry
|
||||
|
||||
/* directory functions */
|
||||
extern PHP_MINIT_FUNCTION(domxml);
|
||||
@@ -56,8 +56,8 @@ PHP_FUNCTION(domxml_attrname);
|
||||
|
||||
PHP_FUNCTION(domxml_test);
|
||||
#else
|
||||
#define php_domxml_module_ptr NULL
|
||||
#define domxml_module_ptr NULL
|
||||
#endif /* HAVE_DOMXML */
|
||||
#define phpext_domxml_ptr php_domxml_module_ptr
|
||||
#define phpext_domxml_ptr domxml_module_ptr
|
||||
|
||||
#endif /* _PHP_DIR_H */
|
||||
@@ -0,0 +1,32 @@
|
||||
Warning
|
||||
=======
|
||||
|
||||
This support is EXPERIMENTAL. In fact, it integrates code that
|
||||
Microsoft labels as pre-beta. Use at your own risk.
|
||||
|
||||
Build instructions
|
||||
==================
|
||||
|
||||
Download and install the .NET Framework SDK Technology Preview from
|
||||
http://msdn.microsoft.com/net/#sdk. Once installed, copy Mscoree.h
|
||||
(typically found in C:\Program Files\NGWSSDK\Include to ext\dotnet).
|
||||
Do not simply add the NGWSSDK\Include directory to the include path
|
||||
as this will cause compilation failures.
|
||||
|
||||
Download and unzip the source to the dm.net COM Moniker from
|
||||
http://staff.develop.com/jasonw/clr/readme.htm. Copy mscorlib.h
|
||||
to ext\dotnet. There is no need to register the clrmonsrv.dll as
|
||||
it is not used.
|
||||
|
||||
At this point, the dotnet project can be built like any other
|
||||
project, from either VisualStudio 6's GUI or from the command line.
|
||||
Example command line invocation:
|
||||
|
||||
msdev dotnet.dsp /MAKE "dotnet - Win32 Debug_TS"
|
||||
|
||||
Execution instructions:
|
||||
=======================
|
||||
|
||||
Add "extension=php_dotnet.dll" into php.ini.
|
||||
|
||||
Sample program can be found at dotnet.php
|
||||
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| 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. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Sam Ruby <rubys@us.ibm.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* This module implements support for Microsoft .Net components.
|
||||
*/
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
|
||||
#include <iostream.h>
|
||||
#include <math.h>
|
||||
#include <comdef.h>
|
||||
|
||||
extern "C" {
|
||||
#include "php.h"
|
||||
#include "php_ini.h"
|
||||
|
||||
pval php_COM_get_property_handler(zend_property_reference *property_reference);
|
||||
|
||||
|
||||
int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value);
|
||||
|
||||
char *php_COM_error_message(HRESULT hr);
|
||||
|
||||
void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
|
||||
|
||||
int php_COM_get_le_idispatch();
|
||||
}
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "Mscoree.h"
|
||||
#include "mscorlib.h"
|
||||
|
||||
using namespace mscorlib;
|
||||
|
||||
static ICorRuntimeHost *pHost;
|
||||
static mscorlib::_AppDomain *pDomain;
|
||||
|
||||
static zend_class_entry dotnet_class_entry;
|
||||
|
||||
static OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen)
|
||||
{
|
||||
OLECHAR *unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR)*(strlen+1));
|
||||
OLECHAR *unicode_ptr = unicode_str;
|
||||
|
||||
while (*C_str) {
|
||||
*unicode_ptr++ = (unsigned short) *C_str++;
|
||||
}
|
||||
*unicode_ptr = 0;
|
||||
|
||||
return unicode_str;
|
||||
}
|
||||
|
||||
HRESULT dotnet_init() {
|
||||
HRESULT hr;
|
||||
|
||||
hr = CoCreateInstance(CLSID_CorRuntimeHost, NULL, CLSCTX_ALL,
|
||||
IID_ICorRuntimeHost, (void **)&pHost);
|
||||
if (FAILED(hr)) return hr;
|
||||
|
||||
hr = pHost->Start();
|
||||
if (FAILED(hr)) return hr;
|
||||
|
||||
IUnknown *uDomain;
|
||||
hr = pHost->GetDefaultDomain(&uDomain);
|
||||
if (FAILED(hr)) return hr;
|
||||
|
||||
hr = uDomain->QueryInterface(__uuidof(_AppDomain), (void**) &pDomain);
|
||||
if (FAILED(hr)) return -1;
|
||||
|
||||
uDomain->Release();
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
HRESULT dotnet_create(OLECHAR *assembly, OLECHAR *datatype, struct IDispatch **object) {
|
||||
HRESULT hr;
|
||||
|
||||
_ObjectHandle *pHandle;
|
||||
hr = pDomain->CreateInstance(_bstr_t(assembly), _bstr_t(datatype), &pHandle);
|
||||
if (FAILED(hr)) return hr;
|
||||
if (!pHandle) return hr;
|
||||
|
||||
_variant_t unwrapped;
|
||||
hr = pHandle->Unwrap(&unwrapped);
|
||||
pHandle->Release();
|
||||
if (FAILED(hr)) return hr;
|
||||
|
||||
*object = unwrapped.pdispVal;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
void dotnet_term() {
|
||||
if (pHost) pHost->Stop();
|
||||
if (pHost) pHost->Release();
|
||||
if (pDomain) pDomain->Release();
|
||||
|
||||
pHost = 0;
|
||||
pDomain = 0;
|
||||
}
|
||||
|
||||
/* {{{ proto int dotnet_load(string module_name)
|
||||
Loads a DOTNET module */
|
||||
PHP_FUNCTION(DOTNET_load)
|
||||
{
|
||||
HRESULT hr;
|
||||
pval *assembly_name, *datatype_name;
|
||||
OLECHAR *assembly, *datatype;
|
||||
IDispatch FAR *i_dispatch = NULL;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 2) WRONG_PARAM_COUNT;
|
||||
|
||||
getParameters(ht, 2, &assembly_name, &datatype_name);
|
||||
convert_to_string(assembly_name);
|
||||
assembly = php_char_to_OLECHAR(assembly_name->value.str.val, assembly_name->value.str.len);
|
||||
|
||||
convert_to_string(datatype_name);
|
||||
datatype = php_char_to_OLECHAR(datatype_name->value.str.val, datatype_name->value.str.len);
|
||||
|
||||
/* obtain IDispatch */
|
||||
hr=dotnet_create(assembly, datatype, &i_dispatch);
|
||||
efree(assembly);
|
||||
efree(datatype);
|
||||
if (FAILED(hr)) {
|
||||
char *error_message;
|
||||
error_message = php_COM_error_message(hr);
|
||||
php_error(E_WARNING,"Error obtaining .Net class for %s in assembly %s: %s",datatype_name->value.str.val,assembly_name->value.str.val,error_message);
|
||||
LocalFree(error_message);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (!i_dispatch) {
|
||||
php_error(E_WARNING,"Unable to locate %s in assembly %s",datatype_name->value.str.val,assembly_name->value.str.val);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
RETURN_LONG(zend_list_insert(i_dispatch,php_COM_get_le_idispatch()));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
|
||||
void php_DOTNET_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
|
||||
{
|
||||
pval *object = property_reference->object;
|
||||
zend_overloaded_element *function_name = (zend_overloaded_element *) property_reference->elements_list->tail->data;
|
||||
|
||||
if (zend_llist_count(property_reference->elements_list)==1
|
||||
&& !strcmp(function_name->element.value.str.val, "dotnet")) { /* constructor */
|
||||
pval *object_handle;
|
||||
|
||||
PHP_FN(DOTNET_load)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
if (!zend_is_true(return_value)) {
|
||||
var_reset(object);
|
||||
return;
|
||||
}
|
||||
ALLOC_ZVAL(object_handle);
|
||||
*object_handle = *return_value;
|
||||
pval_copy_constructor(object_handle);
|
||||
INIT_PZVAL(object_handle);
|
||||
zend_hash_index_update(object->value.obj.properties, 0, &object_handle, sizeof(pval *), NULL);
|
||||
pval_destructor(&function_name->element);
|
||||
} else {
|
||||
php_COM_call_function_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, property_reference);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void php_register_DOTNET_class()
|
||||
{
|
||||
INIT_OVERLOADED_CLASS_ENTRY(dotnet_class_entry, "DOTNET", NULL,
|
||||
php_DOTNET_call_function_handler,
|
||||
php_COM_get_property_handler,
|
||||
php_COM_set_property_handler);
|
||||
|
||||
zend_register_internal_class(&dotnet_class_entry);
|
||||
}
|
||||
|
||||
function_entry DOTNET_functions[] = {
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
static PHP_MINFO_FUNCTION(DOTNET)
|
||||
{
|
||||
DISPLAY_INI_ENTRIES();
|
||||
}
|
||||
|
||||
PHP_INI_BEGIN()
|
||||
PHP_INI_END()
|
||||
|
||||
PHP_MINIT_FUNCTION(DOTNET)
|
||||
{
|
||||
|
||||
HRESULT hr;
|
||||
CoInitialize(0);
|
||||
hr = dotnet_init();
|
||||
if (FAILED(hr)) return hr;
|
||||
|
||||
php_register_DOTNET_class();
|
||||
REGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
PHP_MSHUTDOWN_FUNCTION(DOTNET)
|
||||
{
|
||||
dotnet_term();
|
||||
CoUninitialize();
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
zend_module_entry dotnet_module_entry = {
|
||||
"dotnet", DOTNET_functions, PHP_MINIT(DOTNET), PHP_MSHUTDOWN(DOTNET), NULL, NULL, PHP_MINFO(DOTNET), STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
ZEND_GET_MODULE(dotnet)
|
||||
}
|
||||
|
||||
void php_register_DOTNET_class();
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,171 @@
|
||||
# Microsoft Developer Studio Project File - Name="dotnet" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=dotnet - Win32 Debug_TS
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "dotnet.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 "dotnet.mak" CFG="dotnet - Win32 Debug_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "dotnet - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "dotnet - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "dotnet - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "dotnet - Win32 Release_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)" == "dotnet - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "..\..\Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "..\..\Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /D HAVE_JAVA=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /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 /nologo /dll /machine:I386
|
||||
# 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 /nologo /dll /machine:I386 /out:"..\..\Release/php_dotnet.dll" /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "dotnet - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "..\..\Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /D HAVE_JAVA=1 /FR /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x40d /d "_DEBUG"
|
||||
# ADD RSC /l 0x40d /d "_DEBUG"
|
||||
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 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# 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 /nologo /dll /debug /machine:I386 /out:"..\..\Debug/php_dotnet.dll" /pdbtype:sept /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "dotnet - Win32 Debug_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "..\..\Debug_TS"
|
||||
# PROP BASE Intermediate_Dir "Debug_TS"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "..\..\Debug_TS"
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\Zend" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /D HAVE_JAVA=1 /FR /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x40d /d "_DEBUG"
|
||||
# ADD RSC /l 0x40d /d "_DEBUG"
|
||||
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 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# 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 /debug /machine:I386 /out:"..\..\Debug_TS/php_dotnet.dll" /pdbtype:sept /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Debug_TS"
|
||||
|
||||
!ELSEIF "$(CFG)" == "dotnet - 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 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 /MD /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "$(JAVA_HOME)\include\win32" /I "$(JAVA_HOME)\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "PHP_WIN32" /D "ZEND_WIN32" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_JAVA" /D HAVE_JAVA=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x40d /d "NDEBUG"
|
||||
# ADD RSC /l 0x40d /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 /nologo /dll /machine:I386
|
||||
# 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_dotnet.dll" /libpath:"$(JAVA_HOME)\lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "dotnet - Win32 Release"
|
||||
# Name "dotnet - Win32 Debug"
|
||||
# Name "dotnet - Win32 Debug_TS"
|
||||
# Name "dotnet - Win32 Release_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dotnet.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\..\..\win32\winutil.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_dotnet.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\README
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,8 @@
|
||||
<?
|
||||
$stack = new DOTNET("mscorlib","System.Collections.Stack");
|
||||
|
||||
$stack->Push(".Net");
|
||||
$stack->Push("Hello ");
|
||||
|
||||
echo $stack->Pop() . $stack->Pop();
|
||||
?>
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef PHP_DOTNET_H
|
||||
#define PHP_DOTNET_H
|
||||
|
||||
#if WIN32|WINNT
|
||||
|
||||
extern PHP_MINIT_FUNCTION(DOTNET);
|
||||
extern PHP_MSHUTDOWN_FUNCTION(DOTNET);
|
||||
PHP_FUNCTION(DOTNET_load);
|
||||
|
||||
extern zend_module_entry DOTNET_module_entry;
|
||||
#define DOTNET_module_ptr &DOTNET_module_entry
|
||||
|
||||
#else
|
||||
|
||||
#define DOTNET_module_ptr NULL
|
||||
|
||||
#endif /* Win32|WINNT */
|
||||
|
||||
#define phpext_DOTNET_ptr DOTNET_module_ptr
|
||||
|
||||
#endif /* PHP_DOTNET_H */
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
RegReplace test 1
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="abc123";
|
||||
echo ereg_replace("123","def",$a)?>
|
||||
--EXPECT--
|
||||
abcdef
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
RegReplace test 2
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="abc123";
|
||||
echo ereg_replace("123","",$a)?>
|
||||
--EXPECT--
|
||||
abc
|
||||
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
ereg_replace single-quote test
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="\\'test";
|
||||
echo ereg_replace("\\\\'","'",$a)
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
'test
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
simple ereg test
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="This is a nice and simple string";
|
||||
if (ereg(".*nice and simple.*",$a)) {
|
||||
echo "ok\n";
|
||||
}
|
||||
if (!ereg(".*doesn't exist.*",$a)) {
|
||||
echo "ok\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
ok
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Test Regular expression register support in ereg
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="This is a nice and simple string";
|
||||
echo ereg(".*(is).*(is).*",$a,$registers);
|
||||
echo "\n";
|
||||
echo $registers[0];
|
||||
echo "\n";
|
||||
echo $registers[1];
|
||||
echo "\n";
|
||||
echo $registers[2];
|
||||
echo "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
32
|
||||
This is a nice and simple string
|
||||
is
|
||||
is
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Test ereg_replace of start-of-line
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="This is a nice and simple string";
|
||||
echo ereg_replace("^This","That",$a);
|
||||
?>
|
||||
--EXPECT--
|
||||
That is a nice and simple string
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Test empty result buffer in reg_replace
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
$a="abcd";
|
||||
$b=ereg_replace("abcd","",$a);
|
||||
echo strlen($b);
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Test back-references in regular expressions
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
echo ereg_replace("([a-z]*)([-=+|]*)([0-9]+)","\\3 \\1 \\2\n","abc+-|=123");
|
||||
?>
|
||||
--EXPECT--
|
||||
123 abc +-|=
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Test split()
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
$a=split("[[:space:]]","this is a
|
||||
test");
|
||||
echo count($a) . "\n";
|
||||
for ($i = 0; $i < count($a); $i++) {
|
||||
echo $a[$i] . "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
4
|
||||
this
|
||||
is
|
||||
a
|
||||
test
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
Long back references
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="abc122222222223";
|
||||
echo ereg_replace("1(2*)3","\\1def\\1",$a)?>
|
||||
--EXPECT--
|
||||
abc2222222222def2222222222
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
\0 back reference
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="abc123";
|
||||
echo ereg_replace("123","def\\0ghi",$a)?>
|
||||
--EXPECT--
|
||||
abcdef123ghi
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
nonexisting back reference
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="abc123";
|
||||
echo ereg_replace("123",'def\1ghi',$a)?>
|
||||
--EXPECT--
|
||||
abcdef\1ghi
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
escapes in replace string
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="abc123";
|
||||
echo ereg_replace("123","def\\g\\\\hi\\",$a)?>
|
||||
--EXPECT--
|
||||
abcdef\g\\hi\
|
||||
@@ -0,0 +1,9 @@
|
||||
--TEST--
|
||||
backreferences not replaced recursively
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php $a="a\\2bxc";
|
||||
echo ereg_replace("a(.*)b(.*)c","\\1",$a)?>
|
||||
--EXPECT--
|
||||
\2
|
||||
@@ -0,0 +1,8 @@
|
||||
--TEST--
|
||||
replace empty matches
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php echo ereg_replace("^","z","abc123")?>
|
||||
--EXPECT--
|
||||
zabc123
|
||||
@@ -0,0 +1,8 @@
|
||||
--TEST--
|
||||
test backslash handling in regular expressions
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php echo ereg_replace('\?',"abc","?123?")?>
|
||||
--EXPECT--
|
||||
abc123abc
|
||||
+5
-5
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# 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_EXIF" /D "DBNTWIN32" /D ZTS=1 /YX /FD /c
|
||||
# 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 "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -53,8 +53,8 @@ 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_exif.dll" /libpath:"..\..\Release_TS"
|
||||
# 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 /nologo /dll /machine:I386
|
||||
# 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_exif.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
|
||||
!ELSEIF "$(CFG)" == "exif - Win32 Debug_TS"
|
||||
|
||||
@@ -70,7 +70,7 @@ LINK32=link.exe
|
||||
# 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_EXIF" /D "DBNTWIN32" /D ZTS=1 /D MSSQL70=1 /YX /FD /c
|
||||
# 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 "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -80,7 +80,7 @@ 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 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 /nologo /dll /machine:I386
|
||||
# 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_exif.dll" /libpath:"..\..\Debug_TS"
|
||||
|
||||
!ENDIF
|
||||
|
||||
+159
-16
@@ -27,22 +27,6 @@
|
||||
#undef THREAD_SAFE
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
if((NULL != SG(request_info).content_type) && (0 == strcmp(SG(request_info).content_type, "application/vnd.fdf"))) {
|
||||
pval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
tmp->value.str.len = SG(request_info).post_data_length;
|
||||
tmp->value.str.val = estrndup(SG(request_info).post_data, SG(request_info).post_data_length);
|
||||
tmp->type = IS_STRING;
|
||||
INIT_PZVAL(tmp);
|
||||
zend_hash_add(&EG(symbol_table), "HTTP_FDF_DATA", sizeof("HTTP_FDF_DATA"), &tmp, sizeof(pval *),NULL);
|
||||
|
||||
} else {
|
||||
#endif
|
||||
|
||||
|
||||
#include "php.h"
|
||||
#include "ext/standard/head.h"
|
||||
#include <math.h>
|
||||
@@ -95,6 +79,10 @@ function_entry fdf_functions[] = {
|
||||
PHP_FE(fdf_set_file, NULL)
|
||||
PHP_FE(fdf_get_file, NULL)
|
||||
PHP_FE(fdf_add_template, NULL)
|
||||
PHP_FE(fdf_set_flags, NULL)
|
||||
PHP_FE(fdf_set_opt, NULL)
|
||||
PHP_FE(fdf_set_submit_form_action, NULL)
|
||||
PHP_FE(fdf_set_javascript_action, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -115,6 +103,35 @@ PHP_MINIT_FUNCTION(fdf)
|
||||
{
|
||||
FDFErc err;
|
||||
FDF_GLOBAL(le_fdf) = register_list_destructors(phpi_FDFClose, NULL);
|
||||
|
||||
/* Constants used by fdf_set_opt() */
|
||||
REGISTER_LONG_CONSTANT("FDFValue", FDFValue, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFStatus", FDFStatus, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFFile", FDFFile, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFID", FDFID, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFFf", FDFFf, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFSetFf", FDFSetFf, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFClearFf", FDFClearFf, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFFlags", FDFFlags, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFSetF", FDFSetF, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFClrF", FDFClrF, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFAP", FDFAP, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFAS", FDFAS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFAction", FDFAction, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFAA", FDFAA, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFAPRef", FDFAPRef, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFIF", FDFIF, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
/* Constants used by fdf_set_javascript_action() */
|
||||
REGISTER_LONG_CONSTANT("FDFEnter", FDFEnter, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFExit", FDFExit, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFDown", FDFDown, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFUp", FDFUp, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFFormat", FDFFormat, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFValidate", FDFValidate, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFKeystroke", FDFKeystroke, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("FDFCalculate", FDFCalculate, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
return SUCCESS;
|
||||
#endif
|
||||
@@ -593,6 +610,132 @@ PHP_FUNCTION(fdf_add_template) {
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void fdf_set_flags(int fdfdoc, string fieldname, int whichFlags, int newFlags)
|
||||
modifies a flag for a field in the fdf*/
|
||||
PHP_FUNCTION(fdf_set_flags) {
|
||||
pval **arg1, **arg2, **arg3, **arg4;
|
||||
int id, type;
|
||||
FDFDoc fdf;
|
||||
FDFErc err;
|
||||
FDF_TLS_VARS;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2,&arg3, &arg4) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(arg1);
|
||||
convert_to_string_ex(arg2);
|
||||
convert_to_long_ex(arg3);
|
||||
convert_to_long_ex(arg4);
|
||||
id=(*arg1)->value.lval;
|
||||
fdf = zend_list_find(id,&type);
|
||||
if(!fdf || type!=FDF_GLOBAL(le_fdf)) {
|
||||
php_error(E_WARNING,"Unable to find file identifier %d",id);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
err=FDFSetFlags(fdf,(*arg2)->value.str.val,(*arg3)->value.lval,(*arg4)->value.lval);
|
||||
if(err != FDFErcOK)
|
||||
printf("Error setting FDF flags: %d\n",err);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void fdf_set_opt(int fdfdoc, string fieldname, int element, string value, string name)
|
||||
Sets a value in the opt array for a field in the FDF*/
|
||||
PHP_FUNCTION(fdf_set_opt) {
|
||||
pval **arg1, **arg2, **arg3, **arg4, **arg5;
|
||||
int id, type;
|
||||
FDFDoc fdf;
|
||||
FDFErc err;
|
||||
FDF_TLS_VARS;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &arg1, &arg2,&arg3, &arg4, &arg5) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long_ex(arg1);
|
||||
convert_to_string_ex(arg2);
|
||||
convert_to_long_ex(arg3);
|
||||
convert_to_string_ex(arg4);
|
||||
convert_to_string_ex(arg5);
|
||||
id=(*arg1)->value.lval;
|
||||
fdf = zend_list_find(id,&type);
|
||||
if(!fdf || type!=FDF_GLOBAL(le_fdf)) {
|
||||
php_error(E_WARNING,"Unable to find file identifier %d",id);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
err = FDFSetOpt(fdf,(*arg2)->value.str.val,(*arg3)->value.lval,(*arg4)->value.str.val,(*arg5)->value.str.val);
|
||||
if(err != FDFErcOK)
|
||||
printf("Error setting FDF option: %d",err);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void fdf_set_submit_form_action(int fdfdoc, string fieldname, int whichTrigger, string url, int flags)
|
||||
sets the submit form action for a field in the fdf*/
|
||||
PHP_FUNCTION(fdf_set_submit_form_action) {
|
||||
pval **arg1, **arg2, **arg3, **arg4, **arg5;
|
||||
int id, type;
|
||||
FDFDoc fdf;
|
||||
FDFErc err;
|
||||
FDF_TLS_VARS;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &arg1, &arg2,&arg3, &arg4, &arg5) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(arg1);
|
||||
convert_to_string_ex(arg2);
|
||||
convert_to_long_ex(arg3);
|
||||
convert_to_string_ex(arg4);
|
||||
convert_to_long_ex(arg5);
|
||||
id=(*arg1)->value.lval;
|
||||
fdf = zend_list_find(id,&type);
|
||||
if(!fdf || type!=FDF_GLOBAL(le_fdf)) {
|
||||
php_error(E_WARNING,"Unable to find file identifier %d",id);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
err = FDFSetSubmitFormAction(fdf,(*arg2)->value.str.val,(*arg3)->value.lval,(*arg4)->value.str.val,(*arg5)->value.lval);
|
||||
if(err != FDFErcOK)
|
||||
printf("Error setting FDF submit action: %d",err);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
/* {{{ proto void fdf_set_javascript_action(int fdfdoc, string fieldname, int whichTrigger, string script)
|
||||
sets the javascript action for a field in the fdf*/
|
||||
PHP_FUNCTION(fdf_set_javascript_action) {
|
||||
pval **arg1, **arg2, **arg3, **arg4;
|
||||
int id, type;
|
||||
FDFDoc fdf;
|
||||
FDFErc err;
|
||||
FDF_TLS_VARS;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(4, &arg1, &arg2,&arg3, &arg4) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_long_ex(arg1);
|
||||
convert_to_string_ex(arg2);
|
||||
convert_to_long_ex(arg3);
|
||||
convert_to_string_ex(arg4);
|
||||
id=(*arg1)->value.lval;
|
||||
fdf = zend_list_find(id,&type);
|
||||
if(!fdf || type!=FDF_GLOBAL(le_fdf)) {
|
||||
php_error(E_WARNING,"Unable to find file identifier %d",id);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
err = FDFSetJavaScriptAction(fdf,(*arg2)->value.str.val,(*arg3)->value.lval,(*arg4)->value.str.val);
|
||||
if(err != FDFErcOK)
|
||||
printf("Error setting FDF JavaScript action: %d",err);
|
||||
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
# Microsoft Developer Studio Project File - Name="fdf" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=fdf - 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 "fdf.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 "fdf.mak" CFG="fdf - Win32 Release_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "fdf - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "fdf - 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)" == "fdf - 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 "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FDF_EXPORTS" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=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 /nologo /dll /machine:I386
|
||||
# ADD LINK32 php4ts.lib fdftk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_fdf.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "fdf - 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 "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FDF_EXPORTS" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /FR /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_debug.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 php4ts_debug.lib fdftk.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_fdf.dll" /libpath:"..\..\Debug_TS"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "fdf - Win32 Release_TS"
|
||||
# Name "fdf - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fdf.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_fdf.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
|
||||
@@ -49,6 +49,10 @@ PHP_FUNCTION(fdf_set_status);
|
||||
PHP_FUNCTION(fdf_set_file);
|
||||
PHP_FUNCTION(fdf_get_file);
|
||||
PHP_FUNCTION(fdf_add_template);
|
||||
PHP_FUNCTION(fdf_set_flags);
|
||||
PHP_FUNCTION(fdf_set_opt);
|
||||
PHP_FUNCTION(fdf_set_submit_form_action);
|
||||
PHP_FUNCTION(fdf_set_javascript_action);
|
||||
#else
|
||||
#define fdf_module_ptr NULL
|
||||
#endif
|
||||
|
||||
+14
-11
@@ -790,26 +790,29 @@ ftp_readline(ftpbuf_t *ftp)
|
||||
int
|
||||
ftp_getresp(ftpbuf_t *ftp)
|
||||
{
|
||||
char *buf;
|
||||
char *buf;
|
||||
|
||||
if (ftp == NULL)
|
||||
return 0;
|
||||
if (ftp == NULL) return 0;
|
||||
buf = ftp->inbuf;
|
||||
ftp->resp = 0;
|
||||
|
||||
|
||||
while (1) {
|
||||
if (!ftp_readline(ftp))
|
||||
|
||||
if (!ftp_readline(ftp)) {
|
||||
return 0;
|
||||
if (ftp->inbuf[3] == '-')
|
||||
continue;
|
||||
else if (ftp->inbuf[3] != ' ')
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Break out when the end-tag is found */
|
||||
if (isdigit(ftp->inbuf[0]) &&
|
||||
isdigit(ftp->inbuf[1]) &&
|
||||
isdigit(ftp->inbuf[2]) &&
|
||||
ftp->inbuf[3] == ' ') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* translate the tag */
|
||||
if ( !isdigit(ftp->inbuf[0]) ||
|
||||
if (!isdigit(ftp->inbuf[0]) ||
|
||||
!isdigit(ftp->inbuf[1]) ||
|
||||
!isdigit(ftp->inbuf[2]))
|
||||
{
|
||||
|
||||
+5
-5
@@ -43,7 +43,7 @@ RSC=rc.exe
|
||||
# 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_FTP" /D "DBNTWIN32" /D ZTS=1 /YX /FD /c
|
||||
# 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 "COMPILE_DL_FTP" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTP_EXPORTS" /D "COMPILE_DL_FTP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FTP=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -53,8 +53,8 @@ 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 wsock32.lib php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ftp.dll" /libpath:"..\..\Release_TS"
|
||||
# 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 /nologo /dll /machine:I386
|
||||
# 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 wsock32.lib php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ftp.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug_TS"
|
||||
|
||||
@@ -70,7 +70,7 @@ LINK32=link.exe
|
||||
# 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_FTP" /D "DBNTWIN32" /D ZTS=1 /D MSSQL70=1 /YX /FD /c
|
||||
# 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 "COMPILE_DL_FTP" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTP_EXPORTS" /D "COMPILE_DL_FTP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FTP=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -80,7 +80,7 @@ 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 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 /nologo /dll /machine:I386
|
||||
# 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 wsock32.lib php4ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_ftp.dll" /libpath:"..\..\Debug_TS"
|
||||
|
||||
!ENDIF
|
||||
|
||||
+2
-3
@@ -24,8 +24,7 @@
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: |
|
||||
| Andrew Skalski <askalski@chek.com> |
|
||||
| Authors: Andrew Skalski <askalski@chek.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@@ -130,7 +129,7 @@ PHP_MINIT_FUNCTION(ftp)
|
||||
}
|
||||
|
||||
/* {{{ proto int ftp_connect(string host [, int port])
|
||||
Open a FTP stream */
|
||||
Opens a FTP stream */
|
||||
PHP_FUNCTION(ftp_connect)
|
||||
{
|
||||
pval *arg1, *arg2;
|
||||
|
||||
+6
-6
@@ -70,8 +70,8 @@ AC_ARG_WITH(gd,
|
||||
AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13,1,[ ]) ])
|
||||
AC_CHECK_LIB(gd, gdImagePaletteCopy, [ AC_DEFINE(HAVE_LIBGD15,1,[ ]) ])
|
||||
AC_CHECK_LIB(gd, gdImageColorClosestHWB, [ AC_DEFINE(HAVE_COLORCLOSESTHWB,1,[ ]) ])
|
||||
AC_CHECK_LIB(z,compress, LIBS="$LIBS -lz",,)
|
||||
AC_CHECK_LIB(png,png_info_init, LIBS="$LIBS -lpng",,)
|
||||
AC_CHECK_LIB(z,compress, LIBS="-lz $LIBS",,)
|
||||
AC_CHECK_LIB(png,png_info_init, LIBS="-lpng $LIBS",,)
|
||||
AC_CHECK_LIB(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE,1,[ ])])
|
||||
dnl Some versions of GD support both PNG and GIF. Check for both.
|
||||
AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])])
|
||||
@@ -126,8 +126,8 @@ dnl A whole whack of possible places where this might be
|
||||
LDFLAGS="$LDFLAGS -L$GD_LIB"
|
||||
old_LIBS=$LIBS
|
||||
AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13,1, [ ]) ])
|
||||
AC_CHECK_LIB(z,compress, LIBS="$LIBS -lz",,)
|
||||
AC_CHECK_LIB(png,png_info_init, LIBS="$LIBS -lpng",,)
|
||||
AC_CHECK_LIB(z,compress, LIBS="-lz $LIBS",,)
|
||||
AC_CHECK_LIB(png,png_info_init, LIBS="-lpng $LIBS",,)
|
||||
AC_CHECK_LIB(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE,1,[ ])])
|
||||
AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])])
|
||||
AC_CHECK_LIB(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF, 1, [ ])])
|
||||
@@ -154,8 +154,8 @@ dnl A whole whack of possible places where this might be
|
||||
if test "$ac_cv_lib_gd_gdImageLine" = "yes"; then
|
||||
old_LIBS=$LIBS
|
||||
AC_CHECK_LIB(gd, gdImageString16, [ AC_DEFINE(HAVE_LIBGD13,1, [ ]) ])
|
||||
AC_CHECK_LIB(z,compress, LIBS="$LIBS -lz",,)
|
||||
AC_CHECK_LIB(png,png_info_init, LIBS="$LIBS -lpng",,)
|
||||
AC_CHECK_LIB(z,compress, LIBS="-lz $LIBS",,)
|
||||
AC_CHECK_LIB(png,png_info_init, LIBS="-lpng $LIBS",,)
|
||||
AC_CHECK_LIB(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE,1, [ ])])
|
||||
AC_CHECK_LIB(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])])
|
||||
AC_CHECK_LIB(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF, 1, [ ])])
|
||||
|
||||
+3
-4
@@ -1391,7 +1391,7 @@ PHP_FUNCTION(imagecolorstotal)
|
||||
Define a color as transparent */
|
||||
PHP_FUNCTION(imagecolortransparent)
|
||||
{
|
||||
zval **IM, **COL = NULL;
|
||||
zval **IM, **COL;
|
||||
gdImagePtr im;
|
||||
int col;
|
||||
GDLS_FETCH();
|
||||
@@ -1414,9 +1414,8 @@ PHP_FUNCTION(imagecolortransparent)
|
||||
|
||||
ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", GDG(le_gd));
|
||||
|
||||
if ((*COL) != NULL) {
|
||||
col = (*COL)->value.lval;
|
||||
gdImageColorTransparent(im,col);
|
||||
if (ZEND_NUM_ARGS() > 1) {
|
||||
gdImageColorTransparent(im, Z_LVAL_PP(COL));
|
||||
}
|
||||
col = gdImageGetTransparent(im);
|
||||
RETURN_LONG(col);
|
||||
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
# Microsoft Developer Studio Project File - Name="gd" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=gd - 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 "gd.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 "gd.mak" CFG="gd - Win32 Release_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "gd - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "gd - 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)" == "gd - 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 "COMPILE_DL_GD" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GD_EXPORTS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D HAVE_LIBTTF=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /FR /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 /nologo /dll /machine:I386
|
||||
# ADD LINK32 php4ts.lib freetype.lib gd.lib libjpeg.lib libtiff.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"libcmt.lib" /nodefaultlib:"libc.lib" /out:"..\..\Release_TS/php_gd.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "gd - 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" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_GD" /D "DBNTWIN32" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GD_EXPORTS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GDIMAGECOLORRESOLVE=1 /D HAVE_LIBTTF=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /FR /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_debug.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 php4ts_debug.lib gd.lib libjpeg.lib freetype.lib libtiff.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"..\..\Debug_TS/php_gd.dll" /libpath:"..\..\Debug_TS"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "gd - Win32 Release_TS"
|
||||
# Name "gd - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gd.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gdcache.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gdt1.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gdttf.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gdcache.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gdt1.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gdttf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_gd.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
|
||||
@@ -53,7 +53,7 @@ PHP_MINFO_FUNCTION(gettext)
|
||||
}
|
||||
|
||||
/* {{{ proto string textdomain(string domain)
|
||||
Set the textdomain to "domain". Returns the current domain. */
|
||||
Set the textdomain to "domain". Returns the current domain */
|
||||
PHP_FUNCTION(textdomain)
|
||||
{
|
||||
pval **domain;
|
||||
@@ -79,7 +79,7 @@ PHP_FUNCTION(textdomain)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string gettext(string msgid)
|
||||
Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist. */
|
||||
Return the translation of msgid for the current domain, or msgid unaltered if a translation does not exist */
|
||||
PHP_FUNCTION(gettext)
|
||||
{
|
||||
pval **msgid;
|
||||
@@ -97,7 +97,7 @@ PHP_FUNCTION(gettext)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string dgettext(string domain_name, string msgid)
|
||||
Return the translation of msgid for domain_name, or msgid unaltered if a translation does not exist. */
|
||||
Return the translation of msgid for domain_name, or msgid unaltered if a translation does not exist */
|
||||
PHP_FUNCTION(dgettext)
|
||||
{
|
||||
pval **domain_name, **msgid;
|
||||
@@ -118,7 +118,7 @@ PHP_FUNCTION(dgettext)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string dcgettext(string domain_name, string msgid, long category)
|
||||
Return the translation of msgid for domain_name and category, or msgid unaltered if a translation does not exist. */
|
||||
Return the translation of msgid for domain_name and category, or msgid unaltered if a translation does not exist */
|
||||
PHP_FUNCTION(dcgettext)
|
||||
{
|
||||
pval **domain_name, **msgid, **category;
|
||||
@@ -142,7 +142,7 @@ PHP_FUNCTION(dcgettext)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string bindtextdomain(string domain_name, string dir)
|
||||
Bind to the text domain domain_name, looking for translations in dir. Returns the current domain. */
|
||||
Bind to the text domain domain_name, looking for translations in dir. Returns the current domain */
|
||||
PHP_FUNCTION(bindtextdomain)
|
||||
{
|
||||
pval **domain_name, **dir;
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
# Microsoft Developer Studio Project File - Name="gettext" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=gettext - 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 "gettext.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 "gettext.mak" CFG="gettext - Win32 Release_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "gettext - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "gettext - 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)" == "gettext - 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 "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /D HAVE_LIBINTL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /FR /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 /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# ADD LINK32 php4ts.lib gnu_gettext.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
|
||||
!ELSEIF "$(CFG)" == "gettext - 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" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=1 /FR /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 /nologo /dll /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS"
|
||||
# ADD LINK32 php4ts_debug.lib gnu_gettext.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "gettext - Win32 Release_TS"
|
||||
# Name "gettext - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\gettext.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_gettext.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
|
||||
+1
-1
@@ -3367,7 +3367,7 @@ PHP_FUNCTION(hw_identify) {
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array hw_objrec2array(string objrec)
|
||||
/* {{{ proto array hw_objrec2array(string objrec, [array format])
|
||||
Returns object array of object record */
|
||||
PHP_FUNCTION(hw_objrec2array) {
|
||||
zval **arg1, **arg2;
|
||||
|
||||
+3
-3
@@ -47,7 +47,7 @@
|
||||
#include "php_icap.h"
|
||||
#include "modules.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "ext/standard/php_global.h"
|
||||
#include "ext/standard/basic_functions.h"
|
||||
#ifdef PHP_WIN32
|
||||
#include "winsock.h"
|
||||
#endif
|
||||
@@ -64,7 +64,7 @@ typedef struct php_icap_le_struct {
|
||||
|
||||
typedef struct cal_list
|
||||
{
|
||||
UINT4 uid;
|
||||
php_uint32 uid;
|
||||
struct cal_list *next;
|
||||
} cal_list_t;
|
||||
|
||||
@@ -904,7 +904,7 @@ void cc_searched (unsigned long cal_uid)
|
||||
}
|
||||
|
||||
|
||||
void cc_appended(UINT4 uid)
|
||||
void cc_appended(php_uint32 uid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ BSC32=bscmake.exe
|
||||
# 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 /nologo /dll /machine:I386
|
||||
# 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 wsock32.lib winmm.lib cclient.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_imap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\IMAP\C-Client"
|
||||
# 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 wsock32.lib winmm.lib cclient.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_imap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\IMAP\C-Client"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
#ifndef _INCLUDED_IMAP_H
|
||||
#define _INCLUDED_IMAP_H
|
||||
|
||||
#if COMPILE_DL
|
||||
#undef HAVE_IMAP
|
||||
#define HAVE_IMAP 1
|
||||
#endif
|
||||
|
||||
#if HAVE_IMAP
|
||||
|
||||
#ifndef PHP_WIN32
|
||||
#include "build-defs.h"
|
||||
#endif
|
||||
|
||||
/* Functions accessable to PHP */
|
||||
extern zend_module_entry imap_module_entry;
|
||||
#define imap_module_ptr &imap_module_entry
|
||||
|
||||
extern PHP_MINIT_FUNCTION(imap);
|
||||
extern PHP_RINIT_FUNCTION(imap);
|
||||
extern PHP_RSHUTDOWN_FUNCTION(imap);
|
||||
PHP_MINFO_FUNCTION(imap);
|
||||
PHP_FUNCTION(imap_open);
|
||||
PHP_FUNCTION(imap_popen);
|
||||
PHP_FUNCTION(imap_reopen);
|
||||
PHP_FUNCTION(imap_num_msg);
|
||||
PHP_FUNCTION(imap_num_recent);
|
||||
PHP_FUNCTION(imap_headers);
|
||||
PHP_FUNCTION(imap_headerinfo);
|
||||
PHP_FUNCTION(imap_rfc822_parse_headers);
|
||||
PHP_FUNCTION(imap_body);
|
||||
PHP_FUNCTION(imap_fetchstructure);
|
||||
PHP_FUNCTION(imap_fetchbody);
|
||||
PHP_FUNCTION(imap_expunge);
|
||||
PHP_FUNCTION(imap_delete);
|
||||
PHP_FUNCTION(imap_undelete);
|
||||
PHP_FUNCTION(imap_check);
|
||||
PHP_FUNCTION(imap_close);
|
||||
PHP_FUNCTION(imap_mail_copy);
|
||||
PHP_FUNCTION(imap_mail_move);
|
||||
PHP_FUNCTION(imap_createmailbox);
|
||||
PHP_FUNCTION(imap_renamemailbox);
|
||||
PHP_FUNCTION(imap_deletemailbox);
|
||||
PHP_FUNCTION(imap_listmailbox);
|
||||
PHP_FUNCTION(imap_scanmailbox);
|
||||
PHP_FUNCTION(imap_subscribe);
|
||||
PHP_FUNCTION(imap_unsubscribe);
|
||||
PHP_FUNCTION(imap_append);
|
||||
PHP_FUNCTION(imap_ping);
|
||||
PHP_FUNCTION(imap_base64);
|
||||
PHP_FUNCTION(imap_qprint);
|
||||
PHP_FUNCTION(imap_8bit);
|
||||
PHP_FUNCTION(imap_binary);
|
||||
PHP_FUNCTION(imap_mailboxmsginfo);
|
||||
PHP_FUNCTION(imap_rfc822_write_address);
|
||||
PHP_FUNCTION(imap_rfc822_parse_adrlist);
|
||||
PHP_FUNCTION(imap_setflag_full);
|
||||
PHP_FUNCTION(imap_clearflag_full);
|
||||
PHP_FUNCTION(imap_sort);
|
||||
PHP_FUNCTION(imap_fetchheader);
|
||||
PHP_FUNCTION(imap_fetchtext);
|
||||
PHP_FUNCTION(imap_uid);
|
||||
PHP_FUNCTION(imap_msgno);
|
||||
PHP_FUNCTION(imap_list);
|
||||
PHP_FUNCTION(imap_list_full);
|
||||
PHP_FUNCTION(imap_listscan);
|
||||
PHP_FUNCTION(imap_lsub);
|
||||
PHP_FUNCTION(imap_lsub_full);
|
||||
PHP_FUNCTION(imap_create);
|
||||
PHP_FUNCTION(imap_rename);
|
||||
PHP_FUNCTION(imap_status);
|
||||
PHP_FUNCTION(imap_bodystruct);
|
||||
PHP_FUNCTION(imap_fetch_overview);
|
||||
PHP_FUNCTION(imap_mail_compose);
|
||||
PHP_FUNCTION(imap_alerts);
|
||||
PHP_FUNCTION(imap_errors);
|
||||
PHP_FUNCTION(imap_last_error);
|
||||
PHP_FUNCTION(imap_mail);
|
||||
PHP_FUNCTION(imap_search);
|
||||
PHP_FUNCTION(imap_utf8);
|
||||
PHP_FUNCTION(imap_utf7_decode);
|
||||
PHP_FUNCTION(imap_utf7_encode);
|
||||
PHP_FUNCTION(imap_mime_header_decode);
|
||||
#else
|
||||
#define imap_module_ptr NULL
|
||||
#endif /* HAVE_IMAP */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define phpext_imap_ptr imap_module_ptr
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+11
-4
@@ -137,9 +137,9 @@ function_entry imap_functions[] = {
|
||||
PHP_FE(imap_errors, NULL)
|
||||
PHP_FE(imap_last_error, NULL)
|
||||
#ifndef PHP_WIN32
|
||||
PHP_FALIAS(pdf_open_memory_image, warn_not_available, NULL)
|
||||
#else
|
||||
PHP_FE(imap_mail, NULL)
|
||||
#else
|
||||
PHP_FALIAS(imap_mail, warn_not_available, NULL)
|
||||
#endif
|
||||
PHP_FE(imap_search, NULL)
|
||||
PHP_FE(imap_utf7_decode, NULL)
|
||||
@@ -2664,7 +2664,7 @@ PHP_FUNCTION(imap_fetchheader)
|
||||
RETVAL_STRINGL(tempstring,(hlen+blen+1),1);
|
||||
efree(tempstring);
|
||||
} else {
|
||||
RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, NIL, NIL), 1);
|
||||
RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, NIL, (myargc == 3 ? Z_LVAL_PP(flags) : NIL)), 1);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -3056,6 +3056,10 @@ PHP_FUNCTION(imap_mail_compose)
|
||||
convert_to_string_ex(pvalue);
|
||||
rfc822_parse_adrlist (&env->reply_to, Z_STRVAL_PP(pvalue), "NO HOST");
|
||||
}
|
||||
if (zend_hash_find(Z_ARRVAL_PP(envelope), "subject", sizeof("subject"), (void **) &pvalue)== SUCCESS) {
|
||||
convert_to_string_ex(pvalue);
|
||||
env->subject=cpystr(Z_STRVAL_PP(pvalue));
|
||||
}
|
||||
if (zend_hash_find(Z_ARRVAL_PP(envelope), "to", sizeof("to"), (void **) &pvalue)== SUCCESS) {
|
||||
convert_to_string_ex(pvalue);
|
||||
rfc822_parse_adrlist (&env->to, Z_STRVAL_PP(pvalue), "NO HOST");
|
||||
@@ -3381,6 +3385,7 @@ PHP_FUNCTION(imap_search)
|
||||
int ind, ind_type, args;
|
||||
pils *imap_le_struct;
|
||||
long flags;
|
||||
char *search_criteria;
|
||||
MESSAGELIST *cur;
|
||||
IMAPLS_FETCH();
|
||||
|
||||
@@ -3391,6 +3396,7 @@ PHP_FUNCTION(imap_search)
|
||||
|
||||
convert_to_long_ex(streamind);
|
||||
convert_to_string_ex(criteria);
|
||||
search_criteria = estrndup(Z_STRVAL_PP(criteria), Z_STRLEN_PP(criteria));
|
||||
|
||||
if (args == 2) {
|
||||
flags = SE_FREE;
|
||||
@@ -3407,7 +3413,7 @@ PHP_FUNCTION(imap_search)
|
||||
}
|
||||
|
||||
IMAPG(imap_messages) = NIL;
|
||||
mail_search_full(imap_le_struct->imap_stream, NIL, mail_criteria(Z_STRVAL_PP(criteria)), flags);
|
||||
mail_search_full(imap_le_struct->imap_stream, NIL, mail_criteria(search_criteria), flags);
|
||||
if (IMAPG(imap_messages) == NIL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -3419,6 +3425,7 @@ PHP_FUNCTION(imap_search)
|
||||
cur = cur->next;
|
||||
}
|
||||
mail_free_messagelist(&IMAPG(imap_messages));
|
||||
efree(search_criteria);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
Loaded 100 of 344 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user