mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-13 20:20:50 +00:00
Compare commits
246
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5e8df44b1 | ||
|
|
50febaf842 | ||
|
|
8c93651a60 | ||
|
|
9d6e343cc5 | ||
|
|
0f41757dfa | ||
|
|
cec89cfd76 | ||
|
|
652c5076f2 | ||
|
|
8ef253d9dc | ||
|
|
d91ac3b7b8 | ||
|
|
08f7cfae71 | ||
|
|
dd734b5a5d | ||
|
|
d8b14bd700 | ||
|
|
4e395f36af | ||
|
|
b9ad07ca0b | ||
|
|
6497cc956c | ||
|
|
ee3e6f12ae | ||
|
|
4f7f46d0b8 | ||
|
|
991ca2274f | ||
|
|
b72ea915ab | ||
|
|
055f1f483e | ||
|
|
a493c51949 | ||
|
|
45cb9dc7b1 | ||
|
|
45f5605f38 | ||
|
|
6c3558c2ac | ||
|
|
0dd36fd9f5 | ||
|
|
d07f529652 | ||
|
|
cb6d34ee25 | ||
|
|
00cc762934 | ||
|
|
409f64d09d | ||
|
|
5367710045 | ||
|
|
e5343487ac | ||
|
|
f0e94729bf | ||
|
|
673dee58ad | ||
|
|
9b16b3d7b8 | ||
|
|
51a711b609 | ||
|
|
022e5db8ec | ||
|
|
a29eb8c1d2 | ||
|
|
c16bb3d7c9 | ||
|
|
aaba243f41 | ||
|
|
41226129d7 | ||
|
|
17384705d3 | ||
|
|
5e489050e1 | ||
|
|
4100b87e38 | ||
|
|
5f6f1ab107 | ||
|
|
de713235ed | ||
|
|
6e2cd3fcfe | ||
|
|
b686c05f3b | ||
|
|
174f00fe03 | ||
|
|
4f1947c729 | ||
|
|
50c811c210 | ||
|
|
614614c89e | ||
|
|
4de8da30d0 | ||
|
|
2e23a75ff4 | ||
|
|
02a5c36cb9 | ||
|
|
f380b6b5da | ||
|
|
641bf4653a | ||
|
|
fd7b8ff912 | ||
|
|
4dd722e870 | ||
|
|
25e38548cb | ||
|
|
d8f5916a72 | ||
|
|
b27ae49ada | ||
|
|
7c9dd72b76 | ||
|
|
95b4b3ea3e | ||
|
|
2615ec3dee | ||
|
|
e4871a4a2c | ||
|
|
0dbe08cba2 | ||
|
|
f81e612976 | ||
|
|
2e828c812c | ||
|
|
3748fb07e8 | ||
|
|
251c2a2383 | ||
|
|
6cf87a7740 | ||
|
|
83638d2232 | ||
|
|
af69bece5b | ||
|
|
58637340e8 | ||
|
|
a3d0b7e43f | ||
|
|
07391c8f28 | ||
|
|
90741703de | ||
|
|
a962c4e340 | ||
|
|
20da71fb75 | ||
|
|
e8295e70af | ||
|
|
8954a0486c | ||
|
|
c36139bd55 | ||
|
|
41335dc90f | ||
|
|
33ccce8047 | ||
|
|
5b71dbb4e2 | ||
|
|
375cf41b62 | ||
|
|
f142b06770 | ||
|
|
e88e587c30 | ||
|
|
15c23426d8 | ||
|
|
bd59a23e0a | ||
|
|
ddc78bc5c0 | ||
|
|
8cd8c85017 | ||
|
|
d88973feba | ||
|
|
5410ce07eb | ||
|
|
4e855de5ae | ||
|
|
9053c5eadd | ||
|
|
016d0be3e0 | ||
|
|
97b8a7cd4d | ||
|
|
37f5e2f175 | ||
|
|
40ebc2a27b | ||
|
|
80f831e167 | ||
|
|
7e85b2bdde | ||
|
|
6cd84e1a15 | ||
|
|
f65be7ff50 | ||
|
|
7095c25d75 | ||
|
|
7df75cd38f | ||
|
|
58613036fb | ||
|
|
27cdd59feb | ||
|
|
9baa62f093 | ||
|
|
e651db5cf1 | ||
|
|
0314da12d0 | ||
|
|
4789b8eb3b | ||
|
|
e549631cee | ||
|
|
5d0ac38b24 | ||
|
|
a50bd94a0e | ||
|
|
fc410b16fc | ||
|
|
e730be9eec | ||
|
|
a55180af39 | ||
|
|
21f011822d | ||
|
|
9e7b94e7c1 | ||
|
|
16eac635ae | ||
|
|
41ffdb4fc4 | ||
|
|
508a9c3ebd | ||
|
|
a840f429e7 | ||
|
|
359a28fc69 | ||
|
|
ebb708b068 | ||
|
|
d6fed23482 | ||
|
|
27c7538eb2 | ||
|
|
9aee6dce1a | ||
|
|
9147eae986 | ||
|
|
be0abad331 | ||
|
|
47fa22b5cf | ||
|
|
b85d1443b7 | ||
|
|
afae8d98c5 | ||
|
|
373784fb86 | ||
|
|
51b63d6b5a | ||
|
|
6003d9ad36 | ||
|
|
120f6a9bf2 | ||
|
|
9ba824a27a | ||
|
|
ccde6eef9c | ||
|
|
93f50df68d | ||
|
|
4cc3aa052d | ||
|
|
b9c7ee9733 | ||
|
|
0b3d1b1e47 | ||
|
|
bd77e7d0f8 | ||
|
|
5d9bc065f5 | ||
|
|
147e4bc66f | ||
|
|
d71fc18027 | ||
|
|
065b04628f | ||
|
|
b2131fd973 | ||
|
|
507b8cd4ba | ||
|
|
3fbd4431f9 | ||
|
|
12cbd70562 | ||
|
|
c69e47414c | ||
|
|
e085d9bccb | ||
|
|
a7047d2243 | ||
|
|
a984c1329f | ||
|
|
db403663f7 | ||
|
|
75a30c7233 | ||
|
|
fdc3a171dc | ||
|
|
f57ac2fa05 | ||
|
|
b2a98beaee | ||
|
|
753450e21e | ||
|
|
c81b7d7156 | ||
|
|
f116d23398 | ||
|
|
0d9704fa7b | ||
|
|
5650d9fdd1 | ||
|
|
da3e324e7f | ||
|
|
7cf0a8601a | ||
|
|
e2e2111b1c | ||
|
|
55320820ba | ||
|
|
9af1962986 | ||
|
|
675d254b15 | ||
|
|
9901a6f0cd | ||
|
|
3a70279b7d | ||
|
|
ae635f837b | ||
|
|
e8fe75a589 | ||
|
|
14dbf42db8 | ||
|
|
5c29f19331 | ||
|
|
c185f97956 | ||
|
|
1652d1f3b4 | ||
|
|
02f9791e19 | ||
|
|
a27d6d90ec | ||
|
|
89d758c378 | ||
|
|
335786915a | ||
|
|
c8ac633540 | ||
|
|
81b7c2abc1 | ||
|
|
a2aed8eff2 | ||
|
|
e931611837 | ||
|
|
898b8673ed | ||
|
|
58d49c3af9 | ||
|
|
dcfe521fce | ||
|
|
434d35cf62 | ||
|
|
6cf9a9015d | ||
|
|
11eb34e8ee | ||
|
|
4eccd8094e | ||
|
|
f3fba1ee12 | ||
|
|
802968443e | ||
|
|
d50bdd0a16 | ||
|
|
80960e148b | ||
|
|
fcbde2dad4 | ||
|
|
9f85f6d66a | ||
|
|
5ed73ea30b | ||
|
|
2cf6676651 | ||
|
|
2e2e65b576 | ||
|
|
ebcfd99797 | ||
|
|
3d4145a7e3 | ||
|
|
fb93430ba6 | ||
|
|
ba122bc645 | ||
|
|
6e8529a62b | ||
|
|
680d2326a6 | ||
|
|
a6673450df | ||
|
|
af51b8fd42 | ||
|
|
4c1ca75177 | ||
|
|
d58428d3bd | ||
|
|
03a87edd97 | ||
|
|
5454f01e04 | ||
|
|
d88510d0b9 | ||
|
|
bfd27eda54 | ||
|
|
fd65c1661b | ||
|
|
bdf7cdd073 | ||
|
|
e0018cc874 | ||
|
|
314c4c6874 | ||
|
|
9ea095c41c | ||
|
|
3da7a2c23e | ||
|
|
f4e68f2504 | ||
|
|
dab83e9889 | ||
|
|
e1b7458984 | ||
|
|
c16d330371 | ||
|
|
8963c524d7 | ||
|
|
77b9675c4b | ||
|
|
bd45fa6a8f | ||
|
|
31ee5eca0d | ||
|
|
c5bcca7bab | ||
|
|
1ec334a99f | ||
|
|
073788340b | ||
|
|
0d90cd59dc | ||
|
|
fd52bf2bd8 | ||
|
|
61463cbc2a | ||
|
|
f902cf4675 | ||
|
|
9f83137631 | ||
|
|
7c811718a7 | ||
|
|
5d51f8ee55 | ||
|
|
fe3200ed07 | ||
|
|
8c16118248 | ||
|
|
b2e297ed27 |
No files matched your search
@@ -1,26 +1,63 @@
|
||||
PHP 4 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
? ? ??? 2002, Version 4.3.0
|
||||
- ATTENTION! "make install" will *by default* install the CLI SAPI binary in
|
||||
{PREFIX}/bin/php. If you don't disable the CGI binary, it will be
|
||||
installed as {PREFIX}/bin/php-cgi.
|
||||
- Removed extensions: (Jan, Jani)
|
||||
17 Feb 2003, Version 4.3.1
|
||||
- Fixed serious security vulnerability in CGI SAPI. (Shane)
|
||||
|
||||
27 Dec 2002, Version 4.3.0
|
||||
- If you don't specify building any other SAPI "make install" will install the
|
||||
CGI SAPI binary in {PREFIX}/bin/php. If you want to install CLI SAPI in that
|
||||
location use "make install-cli" after "make install" or add --disable-cgi
|
||||
to your configure options. In the Windows distribution CLI SAPI is included
|
||||
in the "cli" folder. (Edin)
|
||||
- Removed extensions: (Jan, Jani, Sebastian)
|
||||
. ext/aspell
|
||||
. ext/ccvs
|
||||
. ext/cybercash
|
||||
. ext/icap
|
||||
. sapi/fastcgi
|
||||
. sapi/fhttpd
|
||||
- Moved extensions to PECL (http://pear.php.net/): (James, Derick)
|
||||
. ext/vpopmail
|
||||
. ext/cybermut
|
||||
- Make PHP_AUTH_* variables not available in safe mode under Apache when an
|
||||
external basic auth mechanism is used. (Philip)
|
||||
- Aliased dba_popen() to dba_open() until 4.3.1 when persistent STDIO streams
|
||||
are introduced. (Andrei)
|
||||
- Fixed a security bug in the bundled MySQL library. (Georg, Stefan)
|
||||
- ZLIB extension is now built-in in the Windows distribution.
|
||||
External extension (php_zlib.dll) has been removed. (Edin)
|
||||
- Fixed a bug in ISO-8601 week calculation
|
||||
- Fixed a crash when using invalid color index with imagecolortransparent()
|
||||
(Pierre-Alain Joye).
|
||||
- Fixed bug #20987 (no handling for client certificates). (Ilia)
|
||||
- Fixed bug #21039 (crash when not supplying an IV to mcrypt_generic_init).
|
||||
(Derick)
|
||||
- Fixed bug #20936 (openssl_pkey_get was broken). (jeroen@derks.it, Wez)
|
||||
- Fixed bug #20927 (wordwrap crash). (Ilia)
|
||||
- Fixed bug #20796 (when register_globals is on & arrays with same names are
|
||||
passed via get/post/cookie the data inside $_GET/$_POST/$_COOKIE can would be
|
||||
corrupted). (Ilia)
|
||||
- Fixed bug #20725 (if the upload directory cannot be written to, the POST data
|
||||
after the uploaded file is lost). (Ilia)
|
||||
- Fixed bug #20865 (array_key_exists() fails to find NULL key). (Ilia)
|
||||
- Fixed bug #20812 (ftp_get returned NULL on success, instead of TRUE). (Ilia)
|
||||
- Fixed bug #20785 (crash when using pdf_open_memory_image() to load a
|
||||
true-color image). (Ilia)
|
||||
- Fixed a crash when converting between true-color images (png/jpeg) and
|
||||
gd1/gd2 image formats, png/jpeg -> gd1/gd2 -> png/jpeg conversion now
|
||||
works correctly. (Ilia, (Pierre-Alain Joye).
|
||||
- Fixed a memory leak in the bundled GD library inside
|
||||
gdImageTrueColorToPalette(). (Ilia)
|
||||
- Fixed bug #12776 (array_walk crash). (Moriyoshi)
|
||||
- Fixed bug #20934 (htmlspecialchars returns latin1 from UTF-8). (Moriyoshi)
|
||||
- Fixed bugs #20270, #15702, #18600 (segfaults in ext/java). (Tony J. White)
|
||||
- Made bcmath extension thread safe. (Sander)
|
||||
- Fixed bug #19566 (get_declared_classes() segfaults). (Moriyoshi, Marcus, Andi)
|
||||
- Fixed bug #20381 (array_merge_recursive mangles input arrays). (Moriyoshi)
|
||||
- Added -n command switch to cli and cgi version which allows to skip php.ini
|
||||
parsing at startup. (Marcus, Wez)
|
||||
- Fixed bug #19689 (absolute paths like /test/dir/ not working correctly).
|
||||
(Ilia)
|
||||
- Fixed bug #20424 (stream_get_meta_data crashes on a normal file stream).
|
||||
(Derick, Wez)
|
||||
- Added "neutral" language entry to mbstring spec. (Moriyoshi)
|
||||
- Changed bundled gd library to consider php.ini option memory_limit. (Marcus)
|
||||
- Modified log() to accept multiple bases. (Jason)
|
||||
@@ -75,7 +112,6 @@ PHP 4 NEWS
|
||||
- Added dbx_escape_string() function to dbx module. (Marc)
|
||||
- Added Oracle (oci8) support to dbx module. (Marc)
|
||||
- Updated FDF extension to work with Adode fdftk 5.0. (Hartmut)
|
||||
- Made raw POST data to be available also as "php://input" stream. (Hartmut)
|
||||
- Added mb_strtolower() and mb_strtoupper(). (Moriyoshi)
|
||||
- Fixed an infinite loop in setlocale() when only invalid locale names
|
||||
were passed in the array. (patch by Pal Loberg, pallo@initio.no)
|
||||
@@ -139,28 +175,63 @@ PHP 4 NEWS
|
||||
- Fixed bug #19366 (gdImageFill crashes when x & y are outside of
|
||||
the image's boundries). (Ilia)
|
||||
- Fixed bug #13936 (__FILE__ constant didn't contain full path). (Ilia)
|
||||
- Renamed:
|
||||
socket_set_timeout() -> stream_set_timeout()
|
||||
socket_set_blocking() -> stream_set_blocking()
|
||||
set_file_buffer() -> stream_set_write_buffer()
|
||||
socket_get_status() -> stream_get_meta_data()
|
||||
As these functions can (in theory) work on any type of stream. (Wez)
|
||||
- Added stream_context_create(), stream_context_set_params() and
|
||||
stream_context_set_option and added an optional fourth parameter to
|
||||
fopen() which accepts a stream context. Contexts allow sharing of
|
||||
information between streams (a kind of "session") and setting notification
|
||||
callbacks. (Wez)
|
||||
- Added stream_filter_prepend() and stream_filter_append() which apply
|
||||
a filter to either the top or the bottom of the filter stack for a stream.
|
||||
Implemented "string.rot13" filter as an example; more filters are expected
|
||||
to follow in later releases and other extensions. (Wez)
|
||||
- Added stream_select() which works like socket_select but works on streams
|
||||
returned by fopen(), fsockopen() and pfsockopen() instead. (Wez)
|
||||
- PHP now has a new stream system that allows it to do some clever stuff with
|
||||
fopen() and fsockopen(). As a result:
|
||||
. URL wrappers natively supports https:// URLs if you have compiled
|
||||
OpenSSL support into PHP (shared extension does not support this).
|
||||
. Added support for fopen("ftps://...", ...) which allows to connect to FTP
|
||||
servers via SSL. (Stefan Esser)
|
||||
. fsockopen() adds support for ssl:// and tls:// connections via TCP/IP
|
||||
. copy($srcfilename, $destfilename) can now be used with URL wrappers
|
||||
. zlib wrappers/streams can be used even on systems without fopencookie()
|
||||
. Changed 'zlib:' fopen wrapper to 'compress.zlib://' and deprecate
|
||||
'zlib:' to avoid ambiguities when filenames have ':' characters. (Wez)
|
||||
. Added 'compress.bzip2://' stream and wrapper support.
|
||||
. Added user-space streams - it is now possible to define a class in PHP
|
||||
code and register it as a URL wrapper. (stream_register_wrapper)
|
||||
. Most extensions now support streams when passing files, which means
|
||||
that those extensions will now also support URL wrappers. (Wez)
|
||||
. Added URL-wrapper support to exif. (Marcus)
|
||||
. Added memory stream support. (Marcus)
|
||||
. Renamed:
|
||||
socket_set_timeout() -> stream_set_timeout()
|
||||
socket_set_blocking() -> stream_set_blocking()
|
||||
set_file_buffer() -> stream_set_write_buffer()
|
||||
socket_get_status() -> stream_get_meta_data()
|
||||
As these functions can (in theory) work on any type of stream. (Wez)
|
||||
. Raw POST data is now available as "php://input" stream. (Hartmut)
|
||||
. fopen("php://output", "wb") returns a stream that writes to the output
|
||||
buffer (like echo and print). (Wez)
|
||||
. Added stream_context_create(), stream_context_set_params() and
|
||||
stream_context_set_option and added an optional fourth parameter to
|
||||
fopen() which accepts a stream context. Contexts allow sharing of
|
||||
information between streams (a kind of "session") and setting
|
||||
notification callbacks. (Wez)
|
||||
. Made the "User-Agent" header sent by http:// and https:// wrappers
|
||||
configurable in php.ini or via a stream context. (Sterling)
|
||||
. Added stream_filter_prepend() and stream_filter_append() which apply
|
||||
a filter to either the top or the bottom of a stream filter stack.
|
||||
Implemented "string.rot13" filter as an example; more filters are
|
||||
expected to follow in later releases and other extensions. (Wez)
|
||||
. Added stream_select() which works like socket_select but works on
|
||||
streams returned by fopen(), fsockopen() and pfsockopen() instead. (Wez)
|
||||
. Added STDIN, STDOUT and STDERR constants for CLI sapi reflecting opened
|
||||
streams to their respective standard I/O counterparts. (Edin)
|
||||
. Added php.ini option "auto_detect_line_endings" which enables PHP to
|
||||
detect Macintosh, Unix and Dos end-of-line characters in fgets() and
|
||||
file(). Fixes bugs #16521 and #16708. (Wez)
|
||||
. Fixed include(), require() and GD functions to work with remote files
|
||||
under win32.
|
||||
Fixed bug #18609 (ImageCreateFromJPEG can't fetch from a URL). (Wez)
|
||||
- Fixed bug #18022 (fopen does not work with php://stdin anymore on Solaris).
|
||||
(Wez)
|
||||
- Added php.ini option "default_socket_timeout" to set the timeout limit for
|
||||
PHP network streams. (kalowsky, ilia@prohost.org, Wez)
|
||||
- Added file_get_contents() which returns the contents of a file as a string.
|
||||
This function also supports the URL wrappers. (Wez)
|
||||
- Fixed bug #19595 (Missing functions for GD2 format handling). (Edin)
|
||||
- Fixed bug #19633 (Wrong directories in ext/ldap/config.m4). (Derick)
|
||||
- Fixed bugs #17274 and #19627 (segfault in sem_remove). (Wez)
|
||||
- Fixed bug #18022 (fopen does not work with php://stdin anymore on Solaris).
|
||||
(Wez)
|
||||
- Added mb_convert_case() function to the mbstring extension which can convert
|
||||
strings between upper, lower and title case using Unicode mappings.
|
||||
Fixed bug #19257 (strtolower & strtoupper does not work for UTF-8 strings).
|
||||
@@ -170,13 +241,8 @@ PHP 4 NEWS
|
||||
- Fixed bug #18556 (Scripting Engine, problem with locales like tr_TR). (Ilia)
|
||||
- Changed y2k_compliance to default to 1 now. (Sascha)
|
||||
- Added platform independent socket error constants for better error handling. (Jason)
|
||||
- Fixed include(), require() and GD functions to work with remote files under
|
||||
win32. Fixed bug #18609 (ImageCreateFromJPEG can't fetch from a URL. (Wez)
|
||||
- Update output of phpinfo() to use more CSS to reduce the file size, do
|
||||
proper HTML escaping, and make it XHTML compliant. (Colin)
|
||||
- Added php.ini option "auto_detect_line_endings" which enables PHP to detect
|
||||
Macintosh, Unix and Dos end-of-line characters in fgets() and file().
|
||||
Fixes bugs #16521 and #16708. (Wez)
|
||||
- Fixed compile errors in the FriBidi extension (Bug #16414). (Tal)
|
||||
- Fixed bugs #7472, #12120 and #12989 as well as other potential problems
|
||||
with strip_tags() function. (Ilia)
|
||||
@@ -198,12 +264,6 @@ PHP 4 NEWS
|
||||
flag. (Andrei)
|
||||
- Fixed a build failure with the OCI8 extension on Tru64.
|
||||
(Patch by Michael Mauch, micahel.mauch@gmx.de)
|
||||
- Added support for fopen("ftps://...", ...) which allows to connect to FTP
|
||||
servers via SSL. (Stefan Esser)
|
||||
- Made the "User-Agent" header sent by the fopen wrappers to be configurable
|
||||
in php.ini or via a stream context. (Sterling)
|
||||
- Added support for fopen("php://output", "wb") which returns a stream that
|
||||
writes to the output buffer (like echo and print). (Wez)
|
||||
- Added --disable-all configure option. (Jani)
|
||||
- Backported debug_backtrace() from ZendEngine2. (Thies)
|
||||
- Added html-free phpinfo() output for CLI. (Jan)
|
||||
@@ -255,8 +315,6 @@ PHP 4 NEWS
|
||||
- Fixed a bug in ODBC where closing the module caused a crash in the Windows
|
||||
executable. (kalowsky)
|
||||
- Fixed memory leaks in pack() and unpack(). (Patch by ilia@prohost.org)
|
||||
- Added php.ini option "default_socket_timeout" to set the timeout limit for
|
||||
PHP streams. (kalowsky, ilia@prohost.org, Wez)
|
||||
- Added URLs to error messages which direct to a page describing the error or
|
||||
function in question. (Derick, Wez, Marcus)
|
||||
- Added odbc_data_source() functionality to identify DB ServerName, and a
|
||||
@@ -331,8 +389,6 @@ PHP 4 NEWS
|
||||
- Added preliminary SAX-Input support. It's now possible to build a DomDocument
|
||||
with SAX-Events. (chregu)
|
||||
- Bundled GD library 2.0.1 with php (ext/gd/libgd) (Rasmus, Jani, Markus, Edin)
|
||||
- Fixed bug with Apache which let PHP_AUTH_* variables to be set when
|
||||
external basic auth mechanism was used. (Jani)
|
||||
- Fixed bzopen() crash in thread-safe mode. (Andrei)
|
||||
- Added better error-messages (3rd parameter) and validating of DTDs (2nd
|
||||
parameter) to domxml_open_mem() and domxml_open_file(). (Christian)
|
||||
@@ -350,8 +406,6 @@ PHP 4 NEWS
|
||||
the unix socket location. (e.g. NFS compiles, etc.) (James Cox)
|
||||
- Fixed is_a() to properly work on extension registered classes. (Andrei)
|
||||
- Added new constants: PHP_PREFIX and PHP_SHLIB_SUFFIX. (Stig)
|
||||
- Added STDIN, STDOUT and STDERR constants for CLI sapi reflecting opened
|
||||
streams to their respective I/O counterparts. (Edin)
|
||||
- Added pctnl_alarm() function. (Edin)
|
||||
- If zlib.output_compression is enabled and a page is compressed
|
||||
a "Vary: Accept-Encoding" header is now added. (Stefan)
|
||||
@@ -413,23 +467,6 @@ PHP 4 NEWS
|
||||
available at http://www.jtatesoftware.com/cracklib/. (jtate)
|
||||
- Added mysql_info() function. (Jan)
|
||||
- Added mysql_list_processes() and mysql_stat() functions. (Georg)
|
||||
- Added file_get_contents() which returns the contents of a file as a string.
|
||||
This function also supports the URL wrappers. (Wez)
|
||||
- Changed 'zlib:' fopen wrapper to 'compress.zlib://' to avoid ambiguities
|
||||
when filenames have ':' characters. (Wez)
|
||||
- Added URL-wrapper support to exif. (Marcus)
|
||||
- PHP now has a new stream system that allows it to do some clever stuff with
|
||||
fopen() and fsockopen(). As a result:
|
||||
. URL wrappers natively supports https:// URLs
|
||||
. fsockopen() adds support for ssl:// and tls:// connections via TCP/IP
|
||||
. copy($srcfilename, $destfilename) can now be used with URL wrappers
|
||||
. zlib wrappers/streams can be used even on systems without fopencookie()
|
||||
. Added 'compress.bzip2://' stream and wrapper support.
|
||||
. Added user-space streams - it is now possible to define a class in PHP
|
||||
code and register it as a URL wrapper. (stream_register_wrapper)
|
||||
. Most extensions now support streams when passing files, which means
|
||||
that those extensions will support URL wrappers. (Wez)
|
||||
. Added memory stream support. (Marcus)
|
||||
- Fixed memory allocation problem on systems that have iconv() support in libc.
|
||||
(Yasuo)
|
||||
- Made var_dump() handle recursive structures better. (Yasuo, Derick)
|
||||
|
||||
@@ -58,7 +58,7 @@ typedef unsigned short mode_t;
|
||||
*/
|
||||
#define COPY_WHEN_ABSOLUTE(path) 2
|
||||
#define IS_ABSOLUTE_PATH(path, len) \
|
||||
(len >= 2 && isalpha(path[0]) && path[1] == ':')
|
||||
(len >= 2 && ((isalpha(path[0]) && path[1] == ':') || (IS_SLASH(path[0]) && IS_SLASH(path[1]))))
|
||||
#define IS_UNC_PATH(path, len) \
|
||||
(len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))
|
||||
|
||||
|
||||
+20
-8
@@ -43,8 +43,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
MAJOR_VERSION=4
|
||||
MINOR_VERSION=3
|
||||
RELEASE_VERSION=0
|
||||
EXTRA_VERSION="RC2"
|
||||
RELEASE_VERSION=1
|
||||
EXTRA_VERSION=""
|
||||
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
|
||||
|
||||
dnl Define where extension directories are located in the configure context
|
||||
@@ -159,7 +159,7 @@ if test "$ac_cv_c_const" = "yes" ; then
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([flex version])
|
||||
set `$LEX -V | grep 'version' | cut -d ' ' -f 3 | sed -e 's/\./ /g' | sed -e 's/[^0-9 ]//g'`
|
||||
set `echo "" | $LEX -V -v --version 2>/dev/null | grep 'version' | cut -d ' ' -f 3 | sed -e 's/\./ /g' | sed -e 's/[^0-9 ]//g'`
|
||||
if test "${1}" != "2" -o "${2}" != "5" -o "${3}" -lt "4"; then
|
||||
AC_MSG_WARN(You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers.)
|
||||
fi
|
||||
@@ -242,6 +242,11 @@ if test "$enable_experimental_zts" = "yes"; then
|
||||
PTHREADS_FLAGS
|
||||
fi
|
||||
|
||||
if test "$PHP_ENABLE_FASTCGI" = "yes"; then
|
||||
PHP_CONFIGURE_PART(Running FastCGI checks)
|
||||
sinclude(sapi/cgi/libfcgi/acinclude.m4)
|
||||
sinclude(sapi/cgi/libfcgi/libfcgi.m4)
|
||||
fi
|
||||
|
||||
divert(3)
|
||||
|
||||
@@ -376,7 +381,7 @@ sys/ipc.h \
|
||||
#endif
|
||||
])
|
||||
|
||||
|
||||
PHP_FOPENCOOKIE
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
dnl -------------------------------------------------------------------------
|
||||
@@ -446,6 +451,7 @@ cuserid \
|
||||
crypt \
|
||||
flock \
|
||||
ftok \
|
||||
funopen \
|
||||
gai_strerror \
|
||||
gcvt \
|
||||
getlogin \
|
||||
@@ -958,7 +964,7 @@ PHP_OS=`uname | xargs`
|
||||
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
|
||||
|
||||
if test "$disable_cli" != "1"; then
|
||||
PHP_CLI_TARGET=sapi/cli/php
|
||||
PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
|
||||
PHP_INSTALL_CLI_TARGET="install-cli"
|
||||
PHP_ADD_SOURCES(sapi/cli, php_cli.c getopt.c,, cli)
|
||||
fi
|
||||
@@ -1002,7 +1008,7 @@ PHP_SUBST(CXX_PHP_COMPILE)
|
||||
PHP_SUBST_OLD(DEBUG_CFLAGS)
|
||||
PHP_SUBST(DEFS)
|
||||
PHP_SUBST_OLD(EXTENSION_DIR)
|
||||
PHP_SUBST(EXTRA_LDFLAGS)
|
||||
PHP_SUBST_OLD(EXTRA_LDFLAGS)
|
||||
PHP_SUBST_OLD(EXTRA_LIBS)
|
||||
PHP_SUBST_OLD(ZEND_EXTRA_LIBS)
|
||||
PHP_SUBST_OLD(INCLUDES)
|
||||
@@ -1075,7 +1081,11 @@ INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
|
||||
CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
|
||||
|
||||
all_targets='$(OVERALL_TARGET) $(PHP_MODULES) $(PHP_CLI_TARGET)'
|
||||
install_targets="install-sapi install-modules $PHP_INSTALL_CLI_TARGET $install_pear"
|
||||
install_targets="install-sapi install-modules $install_pear"
|
||||
if test "$PHP_SAPI" != "cgi"; then
|
||||
install_targets="$PHP_INSTALL_CLI_TARGET $install_targets"
|
||||
fi
|
||||
|
||||
PHP_SUBST(all_targets)
|
||||
PHP_SUBST(install_targets)
|
||||
|
||||
@@ -1306,8 +1316,10 @@ cat<<X
|
||||
| avoid using it if possible. |
|
||||
+--------------------------------------------------------------------+
|
||||
|
||||
X
|
||||
PHP_CONFIGURE_PART(Thank you for using PHP.)
|
||||
cat<<X
|
||||
|
||||
Thank you for using PHP.
|
||||
|
||||
X
|
||||
|
||||
|
||||
+3
-3
@@ -278,7 +278,7 @@ PHP_FUNCTION(bcdiv)
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
break;
|
||||
case -1: /* division by zero */
|
||||
php_error(E_WARNING, "%s(): Division by zero", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
|
||||
break;
|
||||
}
|
||||
bc_free_num(&first);
|
||||
@@ -319,7 +319,7 @@ PHP_FUNCTION(bcmod)
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
break;
|
||||
case -1:
|
||||
php_error(E_WARNING, "%s(): Division by zero", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
|
||||
break;
|
||||
}
|
||||
bc_free_num(&first);
|
||||
@@ -405,7 +405,7 @@ PHP_FUNCTION(bcsqrt)
|
||||
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
} else {
|
||||
php_error(E_WARNING, "%s(): Square root of negative number", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Square root of negative number");
|
||||
}
|
||||
bc_free_num(&result);
|
||||
return;
|
||||
|
||||
@@ -38,7 +38,9 @@
|
||||
#include "bcmath.h"
|
||||
#include "private.h"
|
||||
|
||||
#ifdef SANDER_0
|
||||
bc_num _bc_Free_list = NULL;
|
||||
#endif
|
||||
|
||||
/* new_num allocates a number and sets fields to known values. */
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
/* "Private" routines to bcmath. */
|
||||
|
||||
/* variables */
|
||||
bc_num _bc_Free_list;
|
||||
#ifdef SANDER_0
|
||||
extern bc_num _bc_Free_list;
|
||||
#endif
|
||||
|
||||
/* routines */
|
||||
int _bc_do_compare (bc_num n1, bc_num n2, int use_sign, int ignore_last);
|
||||
|
||||
@@ -57,13 +57,17 @@ new_sub_num (length, scale, value)
|
||||
{
|
||||
bc_num temp;
|
||||
|
||||
#ifdef SANDER_0
|
||||
if (_bc_Free_list != NULL) {
|
||||
temp = _bc_Free_list;
|
||||
_bc_Free_list = temp->n_next;
|
||||
} else {
|
||||
#endif
|
||||
temp = (bc_num) emalloc (sizeof(bc_struct));
|
||||
#ifdef SANDER_0
|
||||
if (temp == NULL) bc_out_of_memory ();
|
||||
}
|
||||
#endif
|
||||
temp->n_sign = PLUS;
|
||||
temp->n_len = length;
|
||||
temp->n_scale = scale;
|
||||
|
||||
+18
-10
@@ -381,9 +381,9 @@ PHP_FUNCTION(juliantojd)
|
||||
for example both: year '5' and year '5000' product 'ä'.
|
||||
use the numeric one for calculations.
|
||||
*/
|
||||
static char* heb_number_to_chars(int n)
|
||||
static char* heb_number_to_chars(int n, char **ret)
|
||||
{
|
||||
char *p, *old, *ret;
|
||||
char *p, *old;
|
||||
|
||||
p = emalloc(10);
|
||||
old = p;
|
||||
@@ -392,8 +392,11 @@ static char* heb_number_to_chars(int n)
|
||||
prevents the option breaking the jewish beliefs, and some other
|
||||
critical resources ;)
|
||||
*/
|
||||
if (n > 9999 || n < 1)
|
||||
if (n > 9999 || n < 1) {
|
||||
efree(old);
|
||||
*ret = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* alafim case */
|
||||
if (n / 1000) {
|
||||
@@ -438,9 +441,10 @@ static char* heb_number_to_chars(int n)
|
||||
}
|
||||
|
||||
*p = '\0';
|
||||
ret = emalloc((int) (p - old) + 1);
|
||||
strncpy(ret, old, (int) (p - old) + 1);
|
||||
return ret;
|
||||
*ret = estrndup(old, (p - old) + 1);
|
||||
p = *ret;
|
||||
efree(old);
|
||||
return p;
|
||||
}
|
||||
|
||||
/* {{{ proto string jdtojewish(int juliandaycount)
|
||||
@@ -450,6 +454,7 @@ PHP_FUNCTION(jdtojewish)
|
||||
long julday, fl;
|
||||
int year, month, day;
|
||||
char date[10], hebdate[25];
|
||||
char *dayp, *yearp;
|
||||
|
||||
if (ZEND_NUM_ARGS() == 1) {
|
||||
if (zend_parse_parameters(1 TSRMLS_CC,"l", &julday) != SUCCESS) {
|
||||
@@ -475,11 +480,14 @@ PHP_FUNCTION(jdtojewish)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
sprintf(hebdate, "%s %s %s", \
|
||||
heb_number_to_chars(day), \
|
||||
JewishMonthHebName[month], \
|
||||
heb_number_to_chars(year));
|
||||
sprintf(hebdate, "%s %s %s", heb_number_to_chars(day, &dayp), JewishMonthHebName[month], heb_number_to_chars(year, &yearp));
|
||||
|
||||
if (dayp) {
|
||||
efree(dayp);
|
||||
}
|
||||
if (yearp) {
|
||||
efree(yearp);
|
||||
}
|
||||
RETURN_STRING(hebdate, 1);
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Shane Caraveo <shane@caraveo.com> |
|
||||
| Colin Viebrock <colin@easydns.com> |
|
||||
| Hartmut Holzgraefe <hartmut@six.de> |
|
||||
| Hartmut Holzgraefe <hholzgra@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
/* $Id: */
|
||||
@@ -48,7 +48,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
|
||||
}
|
||||
|
||||
if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */
|
||||
php_error(E_WARNING, "%s(): This function is only valid for years between 1970 and 2037 inclusive", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is only valid for years between 1970 and 2037 inclusive");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -733,6 +733,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_COOKIEJAR:
|
||||
case CURLOPT_SSL_CIPHER_LIST:
|
||||
case CURLOPT_SSLKEY:
|
||||
case CURLOPT_SSLCERT:
|
||||
case CURLOPT_SSLKEYTYPE:
|
||||
case CURLOPT_SSLKEYPASSWD:
|
||||
case CURLOPT_SSLENGINE:
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "php.h"
|
||||
#include "php_memory_streams.h"
|
||||
|
||||
#if HAVE_CURL
|
||||
#if HAVE_CURL && defined(PHP_CURL_URL_WRAPPERS)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
+51
-18
@@ -3,47 +3,80 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(cyrus, for cyrus imap support,
|
||||
[ --with-cyrus Include Cyrus IMAP support])
|
||||
[ --with-cyrus[=dir] Include Cyrus IMAP support])
|
||||
|
||||
if test "$PHP_CYRUS" != "no"; then
|
||||
found_cyrus=no
|
||||
found_sasl=no
|
||||
found_openssl=no
|
||||
|
||||
for i in /usr /usr/local $PHP_CYRUS; do
|
||||
dnl
|
||||
dnl Cyrus
|
||||
dnl
|
||||
for i in $PHP_CYRUS /usr/local /usr; do
|
||||
if test -r $i/include/cyrus/imclient.h && test "$found_cyrus" = "no"; then
|
||||
PHP_ADD_INCLUDE($i/include)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(cyrus, $i/lib, CYRUS_SHARED_LIBADD)
|
||||
found_cyrus=yes
|
||||
fi
|
||||
|
||||
if test -r $i/include/sasl.h && test "$found_sasl" = "no"; then
|
||||
PHP_ADD_INCLUDE($i/include)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(sasl, $i/lib, CYRUS_SHARED_LIBADD)
|
||||
found_sasl=yes
|
||||
elif test -r $i/include/sasl/sasl.h && test "$found_sasl" = "no"; then
|
||||
PHP_ADD_INCLUDE($i/include/sasl)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(sasl, $i/lib, CYRUS_SHARED_LIBADD)
|
||||
found_sasl=yes
|
||||
fi
|
||||
|
||||
if test -r $i/include/openssl/ssl.h && test "$found_openssl" = "no" && test "$PHP_OPENSSL" = "no"; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ssl, $i/lib, CYRUS_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(crypto, $i/lib, CYRUS_SHARED_LIBADD)
|
||||
found_openssl=yes
|
||||
CYRUS_INCPATH=$i/include
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
|
||||
dnl Check that imclient_connect() accepts 4 args
|
||||
old_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS=-I$CYRUS_INCPATH
|
||||
AC_TRY_COMPILE([#include <stdio.h>
|
||||
#include <cyrus/imclient.h>], [imclient_connect(0,0,0,0)], [], [
|
||||
AC_MSG_ERROR(cyrus-imap version 2.0.8 or greater required)
|
||||
])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
|
||||
if test "$found_cyrus" = "no"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
AC_MSG_ERROR(Please Re-install the cyrus distribution)
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl sasl/sasl2
|
||||
dnl
|
||||
for i in $PHP_CYRUS /usr/local /usr; do
|
||||
if test -r $i/include/sasl.h && test "$found_sasl" = "no"; then
|
||||
PHP_ADD_INCLUDE($i/include)
|
||||
found_sasl=yes
|
||||
elif test -r $i/include/sasl/sasl.h && test "$found_sasl" = "no"; then
|
||||
PHP_ADD_INCLUDE($i/include/sasl)
|
||||
found_sasl=yes
|
||||
fi
|
||||
|
||||
if test "$found_sasl" = "yes"; then
|
||||
if test -f $i/lib/libsasl2.a || test -f $i/lib/libsasl2.$SHLIB_SUFFIX_NAME; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(sasl2, $i/lib, CYRUS_SHARED_LIBADD)
|
||||
else
|
||||
PHP_ADD_LIBRARY_WITH_PATH(sasl, $i/lib, CYRUS_SHARED_LIBADD)
|
||||
fi
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$found_sasl" = "no"; then
|
||||
AC_MSG_RESULT(sasl not found)
|
||||
AC_MSG_ERROR(Please Re-install the cyrus distribution)
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl OpenSSL
|
||||
dnl
|
||||
if test "$PHP_OPENSSL" = "no"; then
|
||||
for i in $PHP_CYRUS /usr/local /usr; do
|
||||
if test -r $i/include/openssl/ssl.h; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ssl, $i/lib, CYRUS_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(crypto, $i/lib, CYRUS_SHARED_LIBADD)
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
PHP_NEW_EXTENSION(cyrus, cyrus.c, $ext_shared)
|
||||
PHP_SUBST(CYRUS_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_CYRUS,1,[ ])
|
||||
|
||||
+1
-1
@@ -424,7 +424,7 @@ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC)
|
||||
else ret = -1;
|
||||
#else
|
||||
#if PHP_DEBUG
|
||||
php_error1(NULL TSRMLS_CC, filename, E_WARNING, "errno = %d [%s]\n", errno, strerror(errno));
|
||||
php_error_docref1(NULL TSRMLS_CC, filename, E_WARNING, "errno = %d [%s]\n", errno, strerror(errno));
|
||||
#endif
|
||||
if (errno) ret=errno;
|
||||
else ret = -1;
|
||||
|
||||
+52
-19
@@ -50,7 +50,9 @@
|
||||
*/
|
||||
function_entry dba_functions[] = {
|
||||
PHP_FE(dba_open, NULL)
|
||||
PHP_FE(dba_popen, NULL)
|
||||
PHP_FALIAS(dba_popen, dba_open, NULL)
|
||||
/* Disabled until 4.3.1, when persistent STDIO streams are implemented. */
|
||||
/* PHP_FE(dba_popen, NULL) */
|
||||
PHP_FE(dba_close, NULL)
|
||||
PHP_FE(dba_delete, NULL)
|
||||
PHP_FE(dba_exists, NULL)
|
||||
@@ -211,16 +213,16 @@ static int le_pdb;
|
||||
static void dba_close(dba_info *info TSRMLS_DC)
|
||||
{
|
||||
if (info->hnd) info->hnd->close(info TSRMLS_CC);
|
||||
if (info->path) efree(info->path);
|
||||
if (info->path) pefree(info->path, info->flags&DBA_PERSISTENT);
|
||||
if (info->fp && info->fp!=info->lock.fp) php_stream_close(info->fp);
|
||||
if (info->lock.fd) {
|
||||
php_flock(info->lock.fd, LOCK_UN);
|
||||
close(info->lock.fd);
|
||||
/*close(info->lock.fd);*/
|
||||
info->lock.fd = 0;
|
||||
}
|
||||
if (info->lock.fp) php_stream_close(info->lock.fp);
|
||||
if (info->lock.name) efree(info->lock.name);
|
||||
efree(info);
|
||||
if (info->lock.name) pefree(info->lock.name, info->flags&DBA_PERSISTENT);
|
||||
pefree(info, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -228,7 +230,7 @@ static void dba_close(dba_info *info TSRMLS_DC)
|
||||
*/
|
||||
static void dba_close_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
dba_info *info = (dba_info *)rsrc->ptr;
|
||||
dba_info *info = (dba_info *)rsrc->ptr;
|
||||
|
||||
dba_close(info TSRMLS_CC);
|
||||
}
|
||||
@@ -417,21 +419,36 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
*
|
||||
* d: force lock on database file
|
||||
* l: force lock on lck file
|
||||
* -: ignore locking
|
||||
*
|
||||
* t: test open database, warning if locked
|
||||
*/
|
||||
strlcpy(mode, Z_STRVAL_PP(args[1]), sizeof(mode));
|
||||
pmode = &mode[0];
|
||||
if (pmode[0] && (pmode[1]=='d' || pmode[1]=='l')) { /* force lock on db file or lck file */
|
||||
if (pmode[1]=='d') {
|
||||
if (pmode[0] && (pmode[1]=='d' || pmode[1]=='l' || pmode[1]=='-')) { /* force lock on db file or lck file or disable locking */
|
||||
switch (pmode[1]) {
|
||||
case 'd':
|
||||
lock_dbf = 1;
|
||||
/* no break */
|
||||
case 'l':
|
||||
lock_flag = DBA_LOCK_ALL;
|
||||
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_NOTICE, "Handler %s does locking internally", hptr->name);
|
||||
}
|
||||
lock_dbf = 1;
|
||||
break;
|
||||
default:
|
||||
case '-':
|
||||
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Locking cannot be disabled for handler %s", hptr->name);
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
lock_flag = 0;
|
||||
break;
|
||||
}
|
||||
lock_flag = DBA_LOCK_ALL;
|
||||
} else {
|
||||
lock_flag = (hptr->flags&DBA_LOCK_ALL);
|
||||
lock_dbf = 1;
|
||||
}
|
||||
switch (*pmode++) {
|
||||
case 'r':
|
||||
@@ -459,18 +476,23 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
lock_mode = 0;
|
||||
file_mode = "";
|
||||
}
|
||||
if (*pmode=='d' || *pmode=='l') {
|
||||
if (*pmode=='d' || *pmode=='l' || *pmode=='-') {
|
||||
pmode++; /* done already - skip here */
|
||||
}
|
||||
if (*pmode=='t') {
|
||||
pmode++;
|
||||
if (!lock_flag) {
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)", hptr->name);
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (!lock_mode) {
|
||||
if ((hptr->flags & DBA_LOCK_ALL) == 0) {
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (testing)", hptr->name);
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (test lock)", hptr->name);
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (testing) obsolete", hptr->name);
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (test lock) obsolete", hptr->name);
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -484,13 +506,13 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
info = emalloc(sizeof(dba_info));
|
||||
info = pemalloc(sizeof(dba_info), persistent);
|
||||
memset(info, 0, sizeof(dba_info));
|
||||
info->path = estrdup(Z_STRVAL_PP(args[0]));
|
||||
info->path = pestrdup(Z_STRVAL_PP(args[0]), persistent);
|
||||
info->mode = modenr;
|
||||
info->argc = ac - 3;
|
||||
info->argv = args + 3;
|
||||
info->flags = (hptr->flags & ~DBA_LOCK_ALL) | (lock_flag & DBA_LOCK_ALL);
|
||||
info->flags = (hptr->flags & ~DBA_LOCK_ALL) | (lock_flag & DBA_LOCK_ALL) | (persistent ? DBA_PERSISTENT : 0);
|
||||
info->lock.mode = lock_mode;
|
||||
|
||||
/* if any open call is a locking call:
|
||||
@@ -509,13 +531,24 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
|
||||
if (!error && lock_mode) {
|
||||
if (lock_dbf) {
|
||||
info->lock.name = estrdup(info->path);
|
||||
info->lock.name = pestrdup(info->path, persistent);
|
||||
lock_file_mode = file_mode;
|
||||
} else {
|
||||
spprintf(&info->lock.name, 0, "%s.lck", info->path);
|
||||
lock_file_mode = "a+b";
|
||||
if (!strcmp(file_mode, "r")) {
|
||||
/* when in read only mode try to use existing .lck file first */
|
||||
/* do not log errors for .lck file while in read ony mode on .lck file */
|
||||
lock_file_mode = "rb";
|
||||
info->lock.fp = php_stream_open_wrapper(info->lock.name, lock_file_mode, STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
|
||||
}
|
||||
if (!info->lock.fp) {
|
||||
/* when not in read mode or failed to open .lck file read only. now try again in create(write) mode and log errors */
|
||||
lock_file_mode = "a+b";
|
||||
}
|
||||
}
|
||||
if (!info->lock.fp) {
|
||||
info->lock.fp = php_stream_open_wrapper(info->lock.name, lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
|
||||
}
|
||||
info->lock.fp = php_stream_open_wrapper(info->lock.name, lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
|
||||
if (!info->lock.fp) {
|
||||
dba_close(info TSRMLS_CC);
|
||||
/* stream operation already wrote an error message */
|
||||
|
||||
+2
-2
@@ -98,7 +98,7 @@ DBA_OPEN_FUNC(cdb)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
cdb = emalloc(sizeof(dba_cdb));
|
||||
cdb = pemalloc(sizeof(dba_cdb), info->flags&DBA_PERSISTENT);
|
||||
memset(cdb, 0, sizeof(dba_cdb));
|
||||
|
||||
#if DBA_CDB_BUILTIN
|
||||
@@ -132,7 +132,7 @@ DBA_CLOSE_FUNC(cdb)
|
||||
cdb_free(&cdb->c);
|
||||
close(cdb->file);
|
||||
#endif
|
||||
efree(cdb);
|
||||
pefree(cdb, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
|
||||
#if DBA_CDB_BUILTIN
|
||||
|
||||
+2
-2
@@ -76,7 +76,7 @@ DBA_OPEN_FUNC(db2)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
info->dbf = emalloc(sizeof(dba_db2_data));
|
||||
info->dbf = pemalloc(sizeof(dba_db2_data), info->flags&DBA_PERSISTENT);
|
||||
memset(info->dbf, 0, sizeof(dba_db2_data));
|
||||
((dba_db2_data *) info->dbf)->dbp = dbp;
|
||||
return SUCCESS;
|
||||
@@ -89,7 +89,7 @@ DBA_CLOSE_FUNC(db2)
|
||||
if (dba->cursor)
|
||||
dba->cursor->c_close(dba->cursor);
|
||||
dba->dbp->close(dba->dbp, 0);
|
||||
efree(dba);
|
||||
pefree(dba, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
|
||||
DBA_FETCH_FUNC(db2)
|
||||
|
||||
+3
-3
@@ -80,8 +80,8 @@ DBA_OPEN_FUNC(db3)
|
||||
dbp->open(dbp, info->path, NULL, type, gmode, filemode) == 0) {
|
||||
#endif
|
||||
dba_db3_data *data;
|
||||
|
||||
data = emalloc(sizeof(*data));
|
||||
|
||||
data = pemalloc(sizeof(*data), info->flags&DBA_PERSISTENT);
|
||||
data->dbp = dbp;
|
||||
data->cursor = NULL;
|
||||
info->dbf = data;
|
||||
@@ -100,7 +100,7 @@ DBA_CLOSE_FUNC(db3)
|
||||
|
||||
if (dba->cursor) dba->cursor->c_close(dba->cursor);
|
||||
dba->dbp->close(dba->dbp, 0);
|
||||
efree(dba);
|
||||
pefree(dba, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
|
||||
DBA_FETCH_FUNC(db3)
|
||||
|
||||
+2
-2
@@ -78,14 +78,14 @@ DBA_OPEN_FUNC(dbm)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
info->dbf = emalloc(sizeof(dba_dbm_data));
|
||||
info->dbf = pemalloc(sizeof(dba_dbm_data), info->flags&DBA_PERSISTENT);
|
||||
memset(info->dbf, 0, sizeof(dba_dbm_data));
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
DBA_CLOSE_FUNC(dbm)
|
||||
{
|
||||
efree(info->dbf);
|
||||
pefree(info->dbf, info->flags&DBA_PERSISTENT);
|
||||
dbmclose();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
DBA_OPEN_FUNC(flatfile)
|
||||
{
|
||||
info->dbf = emalloc(sizeof(flatfile));
|
||||
info->dbf = pemalloc(sizeof(flatfile), info->flags&DBA_PERSISTENT);
|
||||
memset(info->dbf, 0, sizeof(flatfile));
|
||||
|
||||
((flatfile*)info->dbf)->fp = info->fp;
|
||||
@@ -55,7 +55,7 @@ DBA_CLOSE_FUNC(flatfile)
|
||||
|
||||
if (dba->nextkey.dptr)
|
||||
efree(dba->nextkey.dptr);
|
||||
efree(dba);
|
||||
pefree(dba, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
|
||||
DBA_FETCH_FUNC(flatfile)
|
||||
|
||||
+2
-2
@@ -59,7 +59,7 @@ DBA_OPEN_FUNC(gdbm)
|
||||
dbf = gdbm_open(info->path, 0, gmode, filemode, NULL);
|
||||
|
||||
if(dbf) {
|
||||
info->dbf = emalloc(sizeof(dba_gdbm_data));
|
||||
info->dbf = pemalloc(sizeof(dba_gdbm_data), info->flags&DBA_PERSISTENT);
|
||||
memset(info->dbf, 0, sizeof(dba_gdbm_data));
|
||||
((dba_gdbm_data *) info->dbf)->dbf = dbf;
|
||||
return SUCCESS;
|
||||
@@ -74,7 +74,7 @@ DBA_CLOSE_FUNC(gdbm)
|
||||
|
||||
if(dba->nextkey.dptr) free(dba->nextkey.dptr);
|
||||
gdbm_close(dba->dbf);
|
||||
efree(dba);
|
||||
pefree(dba, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
|
||||
DBA_FETCH_FUNC(gdbm)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef PHP_DB4_H
|
||||
#define PHP_DB4_H
|
||||
|
||||
#if DBA_DB4
|
||||
|
||||
#include "php_dba.h"
|
||||
|
||||
DBA_FUNCS(db4);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -63,6 +63,7 @@ typedef struct dba_info {
|
||||
#define DBA_LOCK_WCT (DBA_LOCK_WRITER|DBA_LOCK_CREAT|DBA_LOCK_TRUNC)
|
||||
|
||||
#define DBA_STREAM_OPEN (0x0010)
|
||||
#define DBA_PERSISTENT (0x0020)
|
||||
|
||||
extern zend_module_entry dba_module_entry;
|
||||
#define dba_module_ptr &dba_module_entry
|
||||
|
||||
+11
-11
@@ -4,7 +4,7 @@ DBA CDB handler test
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
if (!in_array('cdb', dba_handlers())) die('skip CDB handler not available');
|
||||
die('skip CDB does not support replace or delete');
|
||||
die('info CDB does not support replace or delete');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
@@ -14,17 +14,17 @@ DBA CDB handler test
|
||||
?>
|
||||
--EXPECT--
|
||||
database handler: cdb
|
||||
3NYNYY
|
||||
5YYYYY
|
||||
Content String 2
|
||||
Content 2 replaced
|
||||
Read during write: not allowed
|
||||
Content 2 replaced 2nd time
|
||||
The 6th value
|
||||
array(3) {
|
||||
["key number 6"]=>
|
||||
string(13) "The 6th value"
|
||||
array(5) {
|
||||
["key1"]=>
|
||||
string(16) "Content String 1"
|
||||
["key2"]=>
|
||||
string(27) "Content 2 replaced 2nd time"
|
||||
string(16) "Content String 2"
|
||||
["key3"]=>
|
||||
string(20) "Third Content String"
|
||||
["key4"]=>
|
||||
string(22) "Another Content String"
|
||||
["key5"]=>
|
||||
string(23) "The last content string"
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,15 @@
|
||||
dba_insert("key3", "Third Content String", $db_file);
|
||||
dba_insert("key4", "Another Content String", $db_file);
|
||||
dba_insert("key5", "The last content string", $db_file);
|
||||
dba_delete("key3", $db_file);
|
||||
dba_delete("key1", $db_file);
|
||||
if ($handler != 'cdb') {
|
||||
dba_delete("key3", $db_file);
|
||||
dba_delete("key1", $db_file);
|
||||
} else {
|
||||
dba_close($db_file);
|
||||
if (($db_file = dba_open($db_filename, 'r'.$lock_flag, $handler))===FALSE) {
|
||||
echo "Error reopening database\n";
|
||||
}
|
||||
}
|
||||
$a = dba_firstkey($db_file);
|
||||
$i=0;
|
||||
while($a) {
|
||||
@@ -20,28 +27,32 @@
|
||||
}
|
||||
echo "\n";
|
||||
echo dba_fetch("key2", $db_file)."\n";
|
||||
dba_replace("key2", "Content 2 replaced", $db_file);
|
||||
echo dba_fetch("key2", $db_file)."\n";
|
||||
if ($handler != 'cdb') {
|
||||
dba_replace("key2", "Content 2 replaced", $db_file);
|
||||
echo dba_fetch("key2", $db_file)."\n";
|
||||
}
|
||||
dba_close($db_file);
|
||||
} else {
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
$db_writer = dba_open($db_filename, 'w'.$lock_flag, $handler);
|
||||
if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.($lock_flag ? 't' : ''), $handler))===false) {
|
||||
echo "Read during write: not allowed\n";
|
||||
} else {
|
||||
echo "Read during write: allowed\n";
|
||||
}
|
||||
if ($db_writer!==FALSE) {
|
||||
dba_insert("key number 6", "The 6th value", $db_writer);
|
||||
@dba_insert("key number 6", "The 6th value inserted again would be an error", $db_writer);
|
||||
dba_replace("key2", "Content 2 replaced 2nd time", $db_writer);
|
||||
dba_delete("key4", $db_writer);
|
||||
echo dba_fetch("key2", $db_writer)."\n";
|
||||
echo dba_fetch("key number 6", $db_writer)."\n";
|
||||
dba_close($db_writer); // when the writer is open at least db3 would fail because of buffered io.
|
||||
} else {
|
||||
die("Error reopening database\n");
|
||||
if ($handler != 'cdb') {
|
||||
$db_writer = dba_open($db_filename, 'w'.$lock_flag, $handler);
|
||||
if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.($lock_flag ? 't' : ''), $handler))===false) {
|
||||
echo "Read during write: not allowed\n";
|
||||
} else {
|
||||
echo "Read during write: allowed\n";
|
||||
}
|
||||
if ($db_writer!==FALSE) {
|
||||
dba_insert("key number 6", "The 6th value", $db_writer);
|
||||
@dba_insert("key number 6", "The 6th value inserted again would be an error", $db_writer);
|
||||
dba_replace("key2", "Content 2 replaced 2nd time", $db_writer);
|
||||
dba_delete("key4", $db_writer);
|
||||
echo dba_fetch("key2", $db_writer)."\n";
|
||||
echo dba_fetch("key number 6", $db_writer)."\n";
|
||||
dba_close($db_writer); // when the writer is open at least db3 would fail because of buffered io.
|
||||
} else {
|
||||
die("Error reopening database\n");
|
||||
}
|
||||
}
|
||||
if (($db_file = dba_open($db_filename, 'r'.$lock_flag, $handler))!==FALSE) {
|
||||
$key = dba_firstkey($db_file);
|
||||
@@ -56,7 +67,9 @@
|
||||
} else {
|
||||
echo "Error reading database\n";
|
||||
}
|
||||
if ($dba_reader) {
|
||||
if (!empty($dba_reader)) {
|
||||
dba_close($dba_reader);
|
||||
}
|
||||
if (($db_file = dba_popen($db_filename, 'r'.($handler!='gdbm'?'-':''), $handler))!==FALSE) {
|
||||
}
|
||||
?>
|
||||
@@ -43,13 +43,13 @@ dbhead_t *get_dbf_head(int fd)
|
||||
dbhead.dbh_date[DBH_DATE_DAY]);
|
||||
|
||||
/* malloc enough memory for the maximum number of fields:
|
||||
32 * 254 = 8128 bytes */
|
||||
tdbf = (dbfield_t *)malloc(sizeof(dbfield_t)*254);
|
||||
32 * 1024 = 32K dBase5 (for Win) seems to allow that many */
|
||||
tdbf = (dbfield_t *)malloc(sizeof(dbfield_t)*1024);
|
||||
|
||||
offset = 1;
|
||||
nfields = 0;
|
||||
gf_retval = 0;
|
||||
for (cur_f = tdbf; gf_retval < 2 && nfields < 254; cur_f++) {
|
||||
for (cur_f = tdbf; gf_retval < 2 && nfields < 1024; cur_f++) {
|
||||
gf_retval = get_dbf_field(dbh, cur_f);
|
||||
|
||||
if (gf_retval < 0) {
|
||||
|
||||
@@ -94,7 +94,9 @@ PHP_MINIT_FUNCTION(dio)
|
||||
#ifdef O_SYNC
|
||||
RDIOC(O_SYNC);
|
||||
#endif
|
||||
#ifdef O_ASYNC
|
||||
RDIOC(O_ASYNC);
|
||||
#endif
|
||||
RDIOC(O_NOCTTY);
|
||||
RDIOC(S_IRWXU);
|
||||
RDIOC(S_IRUSR);
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
- started with generating of sax-events from file/string (chregu)
|
||||
- generating sax-events from dom-tree is a more tricky one (see mailinglist of libxml2)
|
||||
12) error reporting for xslt methods
|
||||
13) add possibility to use relative xpath queries
|
||||
13) (DONE long time ago) add possibility to use relative xpath queries
|
||||
14) implement $dom->free() for freeing documents from memory
|
||||
15) implement get_element_by_tagname_ns (and improve namespace support in general)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ RSC=rc.exe
|
||||
# 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 "DOMXML_EXPORTS" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /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 /D HAVE_DOMXSLT=1 /D LIBXML_STATIC=1 /D LIBXSLT_STATIC=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"
|
||||
@@ -54,7 +54,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 php4ts.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 libxml2.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 /out:"..\..\Release_TS/php_domxml.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# ADD LINK32 wsock32.lib php4ts.lib libxml2_a.lib libxslt_a.lib iconv.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 /out:"..\..\Release_TS/php_domxml.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "domxml - Win32 Debug_TS"
|
||||
@@ -72,7 +72,7 @@ LINK32=link.exe
|
||||
# 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 "DOMXML_EXPORTS" /D "COMPILE_DL_DOMXML" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOMXML=1 /FR /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 /D HAVE_DOMXSLT=1 /D LIBXML_STATIC=1 /D LIBXSLT_STATIC=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"
|
||||
@@ -82,7 +82,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 php4ts.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 libxml2.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 /out:"..\..\Debug_TS/php_domxml.dll" /libpath:"..\..\Debug_TS"
|
||||
# ADD LINK32 php4ts_debug.lib libxml2_a.lib libxslt_a.lib iconv.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 /out:"..\..\Debug_TS/php_domxml.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
+12
-93
@@ -693,19 +693,6 @@ static void php_free_xpath_context(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
xmlXPathFreeContext(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
static void php_free_xpath_object(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
xmlXPathObjectPtr obj = (xmlXPathObjectPtr) rsrc->ptr;
|
||||
|
||||
if (obj) {
|
||||
if (obj->user) {
|
||||
zval *wrapper = obj->user;
|
||||
zval_ptr_dtor(&wrapper);
|
||||
}
|
||||
xmlXPathFreeObject(obj);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void php_free_xml_parser(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
@@ -838,79 +825,12 @@ void *php_xpath_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
static void xpath_object_set_data(void *obj, zval *wrapper)
|
||||
{
|
||||
/*
|
||||
char tmp[20];
|
||||
sprintf(tmp, "%08X", obj);
|
||||
fprintf(stderr, "Adding %s to hash\n", tmp);
|
||||
*/
|
||||
((xmlXPathObjectPtr) obj)->user = wrapper;
|
||||
}
|
||||
|
||||
|
||||
static zval *xpath_object_get_data(void *obj)
|
||||
{
|
||||
/*
|
||||
char tmp[20];
|
||||
sprintf(tmp, "%08X", obj);
|
||||
fprintf(stderr, "Trying getting %s from hash ...", tmp);
|
||||
if(((xmlXPathObjectPtr) obj)->user)
|
||||
fprintf(stderr, " found\n");
|
||||
else
|
||||
fprintf(stderr, " not found\n");
|
||||
*/
|
||||
return ((zval *) (((xmlXPathObjectPtr) obj)->user));
|
||||
}
|
||||
|
||||
|
||||
static void php_xpath_set_object(zval *wrapper, void *obj, int rsrc_type)
|
||||
{
|
||||
zval *handle, *addr;
|
||||
|
||||
MAKE_STD_ZVAL(handle);
|
||||
Z_TYPE_P(handle) = IS_LONG;
|
||||
Z_LVAL_P(handle) = zend_list_insert(obj, rsrc_type);
|
||||
|
||||
MAKE_STD_ZVAL(addr);
|
||||
Z_TYPE_P(addr) = IS_LONG;
|
||||
Z_LVAL_P(addr) = (int) obj;
|
||||
|
||||
zend_hash_index_update(Z_OBJPROP_P(wrapper), 0, &handle, sizeof(zval *), NULL);
|
||||
zend_hash_index_update(Z_OBJPROP_P(wrapper), 1, &addr, sizeof(zval *), NULL);
|
||||
zval_add_ref(&wrapper);
|
||||
xpath_object_set_data(obj, wrapper);
|
||||
}
|
||||
|
||||
static zval *php_xpathobject_new(xmlXPathObjectPtr obj, int *found TSRMLS_DC)
|
||||
{
|
||||
zval *wrapper;
|
||||
|
||||
*found = 0;
|
||||
|
||||
if (!obj) {
|
||||
MAKE_STD_ZVAL(wrapper);
|
||||
ZVAL_NULL(wrapper);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
if ((wrapper = (zval *) xpath_object_get_data((void *) obj))) {
|
||||
zval_add_ref(&wrapper);
|
||||
*found = 1;
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(wrapper);
|
||||
object_init_ex(wrapper, xpathobject_class_entry);
|
||||
|
||||
/*
|
||||
rsrc_type = le_xpathobjectp;
|
||||
php_xpath_set_object(wrapper, (void *) obj, rsrc_type);
|
||||
*/
|
||||
|
||||
php_xpath_set_object(wrapper, (void *) obj, le_xpathobjectp);
|
||||
|
||||
return (wrapper);
|
||||
}
|
||||
|
||||
@@ -1389,10 +1309,12 @@ static void domxml_error(void *ctx, const char *msg, ...)
|
||||
{
|
||||
char buf[1024];
|
||||
va_list ap;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
va_start(ap, msg);
|
||||
vsnprintf(buf, 1024, msg, ap);
|
||||
va_end(ap);
|
||||
php_error(E_WARNING, buf);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, buf);
|
||||
}
|
||||
|
||||
static void domxml_error_ext(void *ctx, const char *msg, ...)
|
||||
@@ -1401,6 +1323,7 @@ static void domxml_error_ext(void *ctx, const char *msg, ...)
|
||||
xmlParserInputPtr input = NULL;
|
||||
char buf[1024];
|
||||
va_list ap;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
va_start(ap, msg);
|
||||
vsnprintf(buf, 1024, msg, ap);
|
||||
@@ -1428,7 +1351,7 @@ static void domxml_error_ext(void *ctx, const char *msg, ...)
|
||||
}
|
||||
add_next_index_zval(ctxt->_private,errormessages);
|
||||
}
|
||||
php_error(E_WARNING, buf);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, buf);
|
||||
|
||||
}
|
||||
|
||||
@@ -1436,8 +1359,8 @@ static void domxml_error_validate(void *ctx, const char *msg, ...)
|
||||
{
|
||||
domxml_ErrorCtxt *ctxt ;
|
||||
char buf[1024];
|
||||
|
||||
va_list ap;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
va_start(ap, msg);
|
||||
vsnprintf(buf, 1024, msg, ap);
|
||||
@@ -1467,7 +1390,7 @@ static void domxml_error_validate(void *ctx, const char *msg, ...)
|
||||
|
||||
if (ctxt->valid->node != NULL)
|
||||
{
|
||||
/*php_error(E_WARNING,"nodename %s",(char *) ctxt->valid->name);
|
||||
/*php_error_docref(NULL TSRMLS_CC, E_WARNING,"nodename %s",(char *) ctxt->valid->name);
|
||||
|
||||
node = *ctxt->node;*/
|
||||
}
|
||||
@@ -1475,7 +1398,7 @@ static void domxml_error_validate(void *ctx, const char *msg, ...)
|
||||
add_next_index_zval(ctxt->errors,errormessages);
|
||||
}
|
||||
|
||||
php_error(E_WARNING, buf);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, buf);
|
||||
|
||||
}
|
||||
|
||||
@@ -1570,7 +1493,7 @@ PHP_MINIT_FUNCTION(domxml)
|
||||
|
||||
#if defined(LIBXML_XPATH_ENABLED)
|
||||
le_xpathctxp = zend_register_list_destructors_ex(php_free_xpath_context, NULL, "xpathcontext", module_number);
|
||||
le_xpathobjectp = zend_register_list_destructors_ex(php_free_xpath_object, NULL, "xpathobject", module_number);
|
||||
le_xpathobjectp = zend_register_list_destructors_ex(NULL, NULL, "xpathobject", module_number);
|
||||
#endif
|
||||
|
||||
/* le_domxmlnsp = register_list_destructors(NULL, NULL); */
|
||||
@@ -4849,6 +4772,7 @@ static void php_xpathptr_eval(INTERNAL_FUNCTION_PARAMETERS, int mode, int expr)
|
||||
break;
|
||||
}
|
||||
|
||||
xmlXPathFreeObject(xpathobjp);
|
||||
*return_value = *rv;
|
||||
FREE_ZVAL(rv);
|
||||
}
|
||||
@@ -4881,7 +4805,7 @@ PHP_FUNCTION(xpath_register_ns)
|
||||
|
||||
int prefix_len, uri_len, result;
|
||||
xmlXPathContextPtr ctxp;
|
||||
char *prefix, *uri, *uri_static;
|
||||
char *prefix, *uri;
|
||||
zval *id;
|
||||
|
||||
DOMXML_PARAM_FOUR(ctxp, id, le_xpathctxp, "ss", &prefix, &prefix_len, &uri, &uri_len);
|
||||
@@ -4889,12 +4813,7 @@ PHP_FUNCTION(xpath_register_ns)
|
||||
/* set the context node to NULL - what is a context node anyway? */
|
||||
ctxp->node = NULL;
|
||||
|
||||
/*
|
||||
this is a hack - libxml2 doesn't copy the URI, it simply uses the string
|
||||
given in the parameter - which is normally deallocated after the function
|
||||
*/
|
||||
uri_static = estrndup(uri, uri_len);
|
||||
result = xmlXPathRegisterNs(ctxp, prefix, uri_static);
|
||||
result = xmlXPathRegisterNs(ctxp, prefix, uri);
|
||||
|
||||
if (0 == result) {
|
||||
RETURN_TRUE;
|
||||
|
||||
+5
-26
@@ -128,6 +128,8 @@ static void php_reg_eprint(int err, regex_t *re) {
|
||||
#endif
|
||||
len = regerror(err, re, NULL, 0);
|
||||
if (len) {
|
||||
TSRMLS_FETCH();
|
||||
|
||||
message = (char *)emalloc((buf_len + len + 2) * sizeof(char));
|
||||
if (!message) {
|
||||
return; /* fail silently */
|
||||
@@ -139,7 +141,7 @@ static void php_reg_eprint(int err, regex_t *re) {
|
||||
/* drop the message into place */
|
||||
regerror(err, re, message + buf_len, len);
|
||||
|
||||
php_error(E_WARNING, "%s", message);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", message);
|
||||
}
|
||||
|
||||
STR_FREE(buf);
|
||||
@@ -198,10 +200,6 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
|
||||
/* allocate storage for (sub-)expression-matches */
|
||||
subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1);
|
||||
if (!subs) {
|
||||
php_error(E_WARNING, "Unable to allocate memory in php_ereg");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* actually execute the regular expression */
|
||||
err = regexec(&re, string, re.re_nsub+1, subs, 0);
|
||||
@@ -218,12 +216,6 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
string_len = Z_STRLEN_PP(findin) + 1;
|
||||
|
||||
buf = emalloc(string_len);
|
||||
if (!buf) {
|
||||
php_error(E_WARNING, "Unable to allocate memory in php_ereg");
|
||||
regfree(&re);
|
||||
efree(subs);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
zval_dtor(*array); /* start with clean array */
|
||||
array_init(*array);
|
||||
@@ -300,21 +292,11 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
|
||||
|
||||
/* allocate storage for (sub-)expression-matches */
|
||||
subs = (regmatch_t *)ecalloc(sizeof(regmatch_t),re.re_nsub+1);
|
||||
if (!subs) {
|
||||
php_error(E_WARNING, "Unable to allocate memory in php_ereg_replace");
|
||||
return ((char *) -1);
|
||||
}
|
||||
|
||||
/* start with a buffer that is twice the size of the stringo
|
||||
we're doing replacements in */
|
||||
buf_len = 2 * string_len + 1;
|
||||
buf = emalloc(buf_len * sizeof(char));
|
||||
if (!buf) {
|
||||
php_error(E_WARNING, "Unable to allocate memory in php_ereg_replace");
|
||||
efree(subs);
|
||||
regfree(&re);
|
||||
return ((char *) -1);
|
||||
}
|
||||
|
||||
err = pos = 0;
|
||||
buf[0] = '\0';
|
||||
@@ -535,10 +517,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (array_init(return_value) == FAILURE) {
|
||||
regfree(&re);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
array_init(return_value);
|
||||
|
||||
/* churn through str, generating array entries as we go */
|
||||
while ((count == -1 || count > 1) && !(err = regexec(&re, strp, 1, subs, 0))) {
|
||||
@@ -550,7 +529,7 @@ static void php_split(INTERNAL_FUNCTION_PARAMETERS, int icase)
|
||||
} else if (subs[0].rm_so == 0 && subs[0].rm_eo == 0) {
|
||||
/* No more matches */
|
||||
regfree(&re);
|
||||
php_error(E_WARNING, "Invalid Regular Expression to split()");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid Regular Expression to split()");
|
||||
zend_hash_destroy(Z_ARRVAL_P(return_value));
|
||||
efree(Z_ARRVAL_P(return_value));
|
||||
RETURN_FALSE;
|
||||
|
||||
+75
-56
@@ -58,7 +58,13 @@
|
||||
#include "ext/standard/php_image.h"
|
||||
#include "ext/standard/info.h"
|
||||
|
||||
#ifdef HAVE_MBSTRING
|
||||
#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)
|
||||
#define EXIF_USE_MBSTRING 1
|
||||
#else
|
||||
#define EXIF_USE_MBSTRING 0
|
||||
#endif
|
||||
|
||||
#if EXIF_USE_MBSTRING
|
||||
#include "ext/mbstring/mbstring.h"
|
||||
#endif
|
||||
|
||||
@@ -126,7 +132,7 @@ ZEND_DECLARE_MODULE_GLOBALS(exif)
|
||||
|
||||
ZEND_API ZEND_INI_MH(OnUpdateEncode)
|
||||
{
|
||||
#ifdef HAVE_MBSTRING
|
||||
#if EXIF_USE_MBSTRING
|
||||
if (new_value && strlen(new_value) && !php_mb_check_encoding_list(new_value TSRMLS_CC)) {
|
||||
php_error_docref( NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value);
|
||||
return FAILURE;
|
||||
@@ -137,7 +143,7 @@ ZEND_API ZEND_INI_MH(OnUpdateEncode)
|
||||
|
||||
ZEND_API ZEND_INI_MH(OnUpdateDecode)
|
||||
{
|
||||
#ifdef HAVE_MBSTRING
|
||||
#if EXIF_USE_MBSTRING
|
||||
if (!php_mb_check_encoding_list(new_value TSRMLS_CC)) {
|
||||
php_error_docref( NULL TSRMLS_CC, E_WARNING, "Illegal encoding ignored: '%s'", new_value);
|
||||
return FAILURE;
|
||||
@@ -175,6 +181,7 @@ PHP_MINIT_FUNCTION(exif)
|
||||
{
|
||||
ZEND_INIT_MODULE_GLOBALS(exif, php_exif_init_globals, NULL);
|
||||
REGISTER_INI_ENTRIES();
|
||||
REGISTER_LONG_CONSTANT("EXIF_USE_MBSTRING", EXIF_USE_MBSTRING, CONST_CS | CONST_PERSISTENT);
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -427,7 +434,7 @@ static char *exif_get_tagformat(int format)
|
||||
/* 0x920B - 0x920D */
|
||||
/* 0x9211 - 0x9216 */
|
||||
#define TAG_SUBJECT_AREA 0x9214
|
||||
#define TAG_MARKER_NOTE 0x927C
|
||||
#define TAG_MAKER_NOTE 0x927C
|
||||
#define TAG_USERCOMMENT 0x9286
|
||||
#define TAG_SUB_SEC_TIME 0x9290
|
||||
#define TAG_SUB_SEC_TIME_ORIGINAL 0x9291
|
||||
@@ -765,8 +772,8 @@ static tag_info_array tag_table_GPS = {
|
||||
{ 0x0000, "GPSVersion"},
|
||||
{ 0x0001, "GPSLatitudeRef"},
|
||||
{ 0x0002, "GPSLatitude"},
|
||||
{ 0x0003, "GPSLongitude"},
|
||||
{ 0x0004, "GPSLongitudeRef"},
|
||||
{ 0x0003, "GPSLongitudeRef"},
|
||||
{ 0x0004, "GPSLongitude"},
|
||||
{ 0x0005, "GPSAltitudeRef"},
|
||||
{ 0x0006, "GPSAltitude"},
|
||||
{ 0x0007, "GPSTimeStamp"},
|
||||
@@ -904,7 +911,7 @@ typedef enum mn_byte_order_t {
|
||||
|
||||
typedef enum mn_offset_mode_t {
|
||||
MN_OFFSET_NORMAL,
|
||||
MN_OFFSET_MARKER,
|
||||
MN_OFFSET_MAKER,
|
||||
MN_OFFSET_GUESS
|
||||
} mn_offset_mode_t;
|
||||
|
||||
@@ -917,13 +924,13 @@ typedef struct {
|
||||
int offset;
|
||||
mn_byte_order_t byte_order;
|
||||
mn_offset_mode_t offset_mode;
|
||||
} marker_note_type;
|
||||
} maker_note_type;
|
||||
|
||||
static const marker_note_type marker_note_array[] = {
|
||||
static const maker_note_type maker_note_array[] = {
|
||||
{ tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_INTEL, MN_OFFSET_GUESS},
|
||||
/* { tag_table_VND_CANON, "Canon", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},*/
|
||||
{ tag_table_VND_CASIO, "CASIO", NULL, NULL, 0, 0, MN_ORDER_MOTOROLA, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_FUJI, "FUJIFILM", NULL, "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MARKER},
|
||||
{ tag_table_VND_FUJI, "FUJIFILM", NULL, "FUJIFILM\x0C\x00\x00\x00", 12, 12, MN_ORDER_INTEL, MN_OFFSET_MAKER},
|
||||
{ tag_table_VND_NIKON, "NIKON", NULL, "Nikon\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_NIKON_990, "NIKON", NULL, NULL, 0, 0, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
{ tag_table_VND_OLYMPUS, "OLYMPUS OPTICAL CO.,LTD", NULL, "OLYMP\x00\x01\x00", 8, 8, MN_ORDER_NORMAL, MN_OFFSET_NORMAL},
|
||||
@@ -1129,10 +1136,14 @@ static double exif_convert_any_format(void *value, int format, int motorola_inte
|
||||
|
||||
/* Not sure if this is correct (never seen float used in Exif format) */
|
||||
case TAG_FMT_SINGLE:
|
||||
#ifdef EXIF_DEBUG
|
||||
php_error_docref( NULL TSRMLS_CC, E_NOTICE, "Found value of type single");
|
||||
#endif
|
||||
return (double)*(float *)value;
|
||||
case TAG_FMT_DOUBLE:
|
||||
#ifdef EXIF_DEBUG
|
||||
php_error_docref( NULL TSRMLS_CC, E_NOTICE, "Found value of type double");
|
||||
#endif
|
||||
return *(double *)value;
|
||||
}
|
||||
return 0;
|
||||
@@ -1174,10 +1185,14 @@ static size_t exif_convert_any_to_int(void *value, int format, int motorola_inte
|
||||
|
||||
/* Not sure if this is correct (never seen float used in Exif format) */
|
||||
case TAG_FMT_SINGLE:
|
||||
#ifdef EXIF_DEBUG
|
||||
php_error_docref( NULL TSRMLS_CC, E_NOTICE, "Found value of type single");
|
||||
#endif
|
||||
return (size_t)*(float *)value;
|
||||
case TAG_FMT_DOUBLE:
|
||||
#ifdef EXIF_DEBUG
|
||||
php_error_docref( NULL TSRMLS_CC, E_NOTICE, "Found value of type double");
|
||||
#endif
|
||||
return (size_t)*(double *)value;
|
||||
}
|
||||
return 0;
|
||||
@@ -1245,7 +1260,7 @@ typedef struct {
|
||||
#define SECTION_INTEROP 10
|
||||
#define SECTION_APP12 11
|
||||
#define SECTION_WINXP 12
|
||||
#define SECTION_MARKERNOTE 13
|
||||
#define SECTION_MAKERNOTE 13
|
||||
#define SECTION_COUNT 14
|
||||
|
||||
#define FOUND_FILE (1<<SECTION_FILE)
|
||||
@@ -1261,7 +1276,7 @@ typedef struct {
|
||||
#define FOUND_INTEROP (1<<SECTION_INTEROP)
|
||||
#define FOUND_APP12 (1<<SECTION_APP12)
|
||||
#define FOUND_WINXP (1<<SECTION_WINXP)
|
||||
#define FOUND_MARKERNOTE (1<<SECTION_MARKERNOTE)
|
||||
#define FOUND_MAKERNOTE (1<<SECTION_MAKERNOTE)
|
||||
|
||||
static char *exif_get_sectionname(int section)
|
||||
{
|
||||
@@ -1279,7 +1294,7 @@ static char *exif_get_sectionname(int section)
|
||||
case SECTION_INTEROP: return "INTEROP";
|
||||
case SECTION_APP12: return "APP12";
|
||||
case SECTION_WINXP: return "WINXP";
|
||||
case SECTION_MARKERNOTE:return "MARKERNOTE";
|
||||
case SECTION_MAKERNOTE: return "MAKERNOTE";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@@ -1519,7 +1534,8 @@ static int exif_file_sections_free(image_info_type *ImageInfo)
|
||||
*/
|
||||
static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value, int motorola_intel TSRMLS_DC)
|
||||
{
|
||||
size_t index;
|
||||
size_t idex;
|
||||
void *vptr;
|
||||
image_info_value *info_value;
|
||||
image_info_data *info_data;
|
||||
image_info_data *list;
|
||||
@@ -1555,7 +1571,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
if (!info_value->s) {
|
||||
EXIF_ERRLOG_EALLOC
|
||||
info_data->length = 0;
|
||||
break; /* better return with "" instead of possible casing problems */
|
||||
break; /* better return with "" instead of possible causing problems */
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1604,43 +1620,47 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
} else {
|
||||
info_value = &info_data->value;
|
||||
}
|
||||
for (index=0; index<length; index++) {
|
||||
for (idex=0,vptr=value; idex<length; idex++,vptr=(char *) vptr + php_tiff_bytes_per_format[format]) {
|
||||
if (length>1) {
|
||||
info_value = &info_data->value.list[index];
|
||||
info_value = &info_data->value.list[idex];
|
||||
}
|
||||
switch (format) {
|
||||
case TAG_FMT_USHORT:
|
||||
info_value->u = php_ifd_get16u(value, motorola_intel);
|
||||
info_value->u = php_ifd_get16u(vptr, motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FMT_ULONG:
|
||||
info_value->u = php_ifd_get32u(value, motorola_intel);
|
||||
info_value->u = php_ifd_get32u(vptr, motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FMT_URATIONAL:
|
||||
info_value->ur.num = php_ifd_get32u(value, motorola_intel);
|
||||
info_value->ur.den = php_ifd_get32u(4+(char *)value, motorola_intel);
|
||||
info_value->ur.num = php_ifd_get32u(vptr, motorola_intel);
|
||||
info_value->ur.den = php_ifd_get32u(4+(char *)vptr, motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FMT_SSHORT:
|
||||
info_value->i = php_ifd_get16s(value, motorola_intel);
|
||||
info_value->i = php_ifd_get16s(vptr, motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FMT_SLONG:
|
||||
info_value->i = php_ifd_get32s(value, motorola_intel);
|
||||
info_value->i = php_ifd_get32s(vptr, motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FMT_SRATIONAL:
|
||||
info_value->sr.num = php_ifd_get32u(value, motorola_intel);
|
||||
info_value->sr.den = php_ifd_get32u(4+(char *)value, motorola_intel);
|
||||
info_value->sr.num = php_ifd_get32u(vptr, motorola_intel);
|
||||
info_value->sr.den = php_ifd_get32u(4+(char *)vptr, motorola_intel);
|
||||
break;
|
||||
|
||||
case TAG_FMT_SINGLE:
|
||||
#ifdef EXIF_DEBUG
|
||||
php_error_docref( NULL TSRMLS_CC, E_WARNING, "Found value of type single");
|
||||
#endif
|
||||
info_value->f = *(float *)value;
|
||||
|
||||
case TAG_FMT_DOUBLE:
|
||||
#ifdef EXIF_DEBUG
|
||||
php_error_docref( NULL TSRMLS_CC, E_WARNING, "Found value of type double");
|
||||
#endif
|
||||
info_value->d = *(double *)value;
|
||||
break;
|
||||
}
|
||||
@@ -2494,7 +2514,7 @@ static int exif_process_undefined(char **result, char *value, size_t byte_count
|
||||
|
||||
/* {{{ exif_process_string_raw
|
||||
* Copy a string in Exif header to a character string returns length of allocated buffer if any. */
|
||||
#ifndef HAVE_MBSTRING
|
||||
#if !EXIF_USE_MBSTRING
|
||||
static int exif_process_string_raw(char **result, char *value, size_t byte_count) {
|
||||
/* we cannot use strlcpy - here the problem is that we have to copy NUL
|
||||
* chars up to byte_count, we also have to add a single NUL character to
|
||||
@@ -2540,7 +2560,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
{
|
||||
int a;
|
||||
|
||||
#ifdef HAVE_MBSTRING
|
||||
#if EXIF_USE_MBSTRING
|
||||
size_t len;;
|
||||
#endif
|
||||
|
||||
@@ -2551,7 +2571,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
*pszEncoding = estrdup((const char*)szValuePtr);
|
||||
szValuePtr = szValuePtr+8;
|
||||
ByteCount -= 8;
|
||||
#ifdef HAVE_MBSTRING
|
||||
#if EXIF_USE_MBSTRING
|
||||
if (ImageInfo->motorola_intel) {
|
||||
*pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_be, &len TSRMLS_CC);
|
||||
} else {
|
||||
@@ -2572,7 +2592,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
*pszEncoding = estrdup((const char*)szValuePtr);
|
||||
szValuePtr = szValuePtr+8;
|
||||
ByteCount -= 8;
|
||||
#ifdef HAVE_MBSTRING
|
||||
#if EXIF_USE_MBSTRING
|
||||
if (ImageInfo->motorola_intel) {
|
||||
*pszInfoPtr = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_jis, ImageInfo->decode_jis_be, &len TSRMLS_CC);
|
||||
} else {
|
||||
@@ -2611,7 +2631,7 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
|
||||
xp_field->tag = tag;
|
||||
|
||||
/* Copy the comment */
|
||||
#ifdef HAVE_MBSTRING
|
||||
#if EXIF_USE_MBSTRING
|
||||
/* What if MS supports big-endian with XP? */
|
||||
/* if (ImageInfo->motorola_intel) {
|
||||
xp_field->value = php_mb_convert_encoding(szValuePtr, ByteCount, ImageInfo->encode_unicode, ImageInfo->decode_unicode_be, &xp_field->size TSRMLS_CC);
|
||||
@@ -2627,40 +2647,40 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ exif_process_IFD_in_MARKERNOTE
|
||||
* Process nested IFDs directories in Marker Note. */
|
||||
static int exif_process_IFD_in_MARKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement TSRMLS_DC)
|
||||
/* {{{ exif_process_IFD_in_MAKERNOTE
|
||||
* Process nested IFDs directories in Maker Note. */
|
||||
static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * value_ptr, int value_len, char *offset_base, size_t IFDlength, size_t displacement TSRMLS_DC)
|
||||
{
|
||||
int de, i=0, section_index = SECTION_MARKERNOTE;
|
||||
int de, i=0, section_index = SECTION_MAKERNOTE;
|
||||
int NumDirEntries, old_motorola_intel, offset_diff;
|
||||
const marker_note_type *marker_note;
|
||||
const maker_note_type *maker_note;
|
||||
char *dir_start;
|
||||
|
||||
for (i=0; i<=sizeof(marker_note_array)/sizeof(marker_note_type); i++) {
|
||||
if (i==sizeof(marker_note_array)/sizeof(marker_note_type))
|
||||
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
|
||||
if (i==sizeof(maker_note_array)/sizeof(maker_note_type))
|
||||
return FALSE;
|
||||
marker_note = marker_note_array+i;
|
||||
maker_note = maker_note_array+i;
|
||||
|
||||
/*exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "check (%s,%s)", marker_note->make?marker_note->make:"", marker_note->model?marker_note->model:"");*/
|
||||
if (marker_note->make && (!ImageInfo->make || strcmp(marker_note->make, ImageInfo->make)))
|
||||
/*exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/
|
||||
if (maker_note->make && (!ImageInfo->make || strcmp(maker_note->make, ImageInfo->make)))
|
||||
continue;
|
||||
if (marker_note->model && (!ImageInfo->model || strcmp(marker_note->model, ImageInfo->model)))
|
||||
if (maker_note->model && (!ImageInfo->model || strcmp(maker_note->model, ImageInfo->model)))
|
||||
continue;
|
||||
if (marker_note->id_string && strncmp(marker_note->id_string, value_ptr, marker_note->id_string_len))
|
||||
if (maker_note->id_string && strncmp(maker_note->id_string, value_ptr, maker_note->id_string_len))
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
dir_start = value_ptr + marker_note->offset;
|
||||
dir_start = value_ptr + maker_note->offset;
|
||||
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "process %s @x%04X + 0x%04X=%d: %s", exif_get_sectionname(section_index), (int)dir_start-(int)offset_base+marker_note->offset+displacement, value_len, value_len, exif_char_dump(value_ptr, value_len, (int)dir_start-(int)offset_base+marker_note->offset+displacement));
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "process %s @x%04X + 0x%04X=%d: %s", exif_get_sectionname(section_index), (int)dir_start-(int)offset_base+maker_note->offset+displacement, value_len, value_len, exif_char_dump(value_ptr, value_len, (int)dir_start-(int)offset_base+maker_note->offset+displacement));
|
||||
#endif
|
||||
|
||||
ImageInfo->sections_found |= FOUND_MARKERNOTE;
|
||||
ImageInfo->sections_found |= FOUND_MAKERNOTE;
|
||||
|
||||
old_motorola_intel = ImageInfo->motorola_intel;
|
||||
switch (marker_note->byte_order) {
|
||||
switch (maker_note->byte_order) {
|
||||
case MN_ORDER_INTEL:
|
||||
ImageInfo->motorola_intel = 0;
|
||||
break;
|
||||
@@ -2674,14 +2694,14 @@ static int exif_process_IFD_in_MARKERNOTE(image_info_type *ImageInfo, char * val
|
||||
|
||||
NumDirEntries = php_ifd_get16u(dir_start, ImageInfo->motorola_intel);
|
||||
|
||||
switch (marker_note->offset_mode) {
|
||||
case MN_OFFSET_MARKER:
|
||||
switch (maker_note->offset_mode) {
|
||||
case MN_OFFSET_MAKER:
|
||||
offset_base = value_ptr;
|
||||
break;
|
||||
case MN_OFFSET_GUESS:
|
||||
offset_diff = 2 + NumDirEntries*12 + 4 - php_ifd_get32u(dir_start+10, ImageInfo->motorola_intel);
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "Using automatic offset correction: 0x%04X", ((int)dir_start-(int)offset_base+marker_note->offset+displacement) + offset_diff);
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "Using automatic offset correction: 0x%04X", ((int)dir_start-(int)offset_base+maker_note->offset+displacement) + offset_diff);
|
||||
#endif
|
||||
offset_base = value_ptr + offset_diff;
|
||||
break;
|
||||
@@ -2697,14 +2717,14 @@ static int exif_process_IFD_in_MARKERNOTE(image_info_type *ImageInfo, char * val
|
||||
|
||||
for (de=0;de<NumDirEntries;de++) {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
||||
offset_base, IFDlength, displacement, section_index, 0, marker_note->tag_table TSRMLS_CC)) {
|
||||
offset_base, IFDlength, displacement, section_index, 0, maker_note->tag_table TSRMLS_CC)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
ImageInfo->motorola_intel = old_motorola_intel;
|
||||
/* NextDirOffset (must be NULL) = php_ifd_get32u(dir_start+2+12*de, ImageInfo->motorola_intel);*/
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "subsection %s done", exif_get_sectionname(SECTION_MARKERNOTE));
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "subsection %s done", exif_get_sectionname(SECTION_MAKERNOTE));
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2958,8 +2978,8 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
ImageInfo->model = estrdup(value_ptr);
|
||||
break;
|
||||
|
||||
case TAG_MARKER_NOTE:
|
||||
exif_process_IFD_in_MARKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement TSRMLS_CC);
|
||||
case TAG_MAKER_NOTE:
|
||||
exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement TSRMLS_CC);
|
||||
break;
|
||||
|
||||
case TAG_EXIF_IFD_POINTER:
|
||||
@@ -3425,7 +3445,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
return FALSE;
|
||||
}
|
||||
php_stream_read(ImageInfo->infile, ImageInfo->file.list[sn].data+2, dir_size-2);
|
||||
/*exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "Dump: %s", exif_char_dump(ImageInfo->file.list[sn].data, dir_size, 1));*/
|
||||
/*exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "Dump: %s", exif_char_dump(ImageInfo->file.list[sn].data, dir_size, 0));*/
|
||||
next_offset = php_ifd_get32u(ImageInfo->file.list[sn].data + dir_size - 4, ImageInfo->motorola_intel);
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "read from TIFF done, next offset x%04X", next_offset);
|
||||
@@ -3963,7 +3983,7 @@ PHP_FUNCTION(exif_read_data)
|
||||
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FPIX TSRMLS_CC);
|
||||
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_APP12 TSRMLS_CC);
|
||||
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_WINXP TSRMLS_CC);
|
||||
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MARKERNOTE TSRMLS_CC);
|
||||
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MAKERNOTE TSRMLS_CC);
|
||||
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL TSRMLS_CC, &ImageInfo, E_NOTICE, "discarding info");
|
||||
@@ -4084,4 +4104,3 @@ PHP_FUNCTION(exif_imagetype)
|
||||
* vim600: sw=4 ts=4 tw=78 fdm=marker
|
||||
* vim<600: sw=4 ts=4 tw=78
|
||||
*/
|
||||
|
||||
@@ -13,9 +13,9 @@ zlib.output_compression=0
|
||||
test2.jpg is the same image but contains Exif/Comment information and a
|
||||
copy of test1.jpg as a thumbnail.
|
||||
*/
|
||||
$infile = './ext/exif/tests/test1.jpg';
|
||||
$infile = dirname(__FILE__).'/test1.jpg';
|
||||
echo md5_file($infile).'_'.filesize($infile);
|
||||
$thumb = exif_thumbnail('./ext/exif/tests/test2.jpg');
|
||||
$thumb = exif_thumbnail(dirname(__FILE__).'/test2.jpg');
|
||||
echo " == ";
|
||||
echo md5($thumb).'_'.strlen($thumb);
|
||||
echo "\n";
|
||||
|
||||
@@ -4,6 +4,7 @@ Check for exif_read_data, Unicode user comment
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
|
||||
if (!EXIF_USE_MBSTRING) die ('skip mbstring loaded by dl');
|
||||
?>
|
||||
--INI--
|
||||
output_handler=
|
||||
@@ -18,7 +19,7 @@ exif.encode_unicode=ISO-8859-15
|
||||
copy of test1.jpg as a thumbnail.
|
||||
test3.jpg is the same as test2.jpg but with a UNICODE UserComment: ÄÖ&Üßäöü
|
||||
*/
|
||||
var_dump(exif_read_data('./ext/exif/tests/test3.jpg','',true,false));
|
||||
var_dump(exif_read_data(dirname(__FILE__).'/test3.jpg','',true,false));
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(5) {
|
||||
|
||||
@@ -4,6 +4,7 @@ Check for exif_read_data, Unicode WinXP tags
|
||||
<?php
|
||||
if (!extension_loaded('exif')) die('skip exif extension not available');
|
||||
if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
|
||||
if (!EXIF_USE_MBSTRING) die ('skip mbstring loaded by dl');
|
||||
?>
|
||||
--INI--
|
||||
output_handler=
|
||||
@@ -16,7 +17,7 @@ exif.encode_unicode=ISO-8859-1
|
||||
/*
|
||||
test4.jpg is a 1*1 image that contains Exif tags written by WindowsXP
|
||||
*/
|
||||
$image = exif_read_data('./ext/exif/tests/test4.jpg','',true,false);
|
||||
$image = exif_read_data(dirname(__FILE__).'/test4.jpg','',true,false);
|
||||
echo var_dump($image['WINXP']);
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
@@ -10,7 +10,7 @@ zlib.output_compression=0
|
||||
/* Do not change this test it is a REATME.TESTING example.
|
||||
* test5.jpg is a 1*1 image that contains an Exif section with ifd = 00000009h
|
||||
*/
|
||||
$image = exif_read_data('./ext/exif/tests/test5.jpg','',true,false);
|
||||
$image = exif_read_data(dirname(__FILE__).'/test5.jpg','',true,false);
|
||||
var_dump($image['IFD0']);
|
||||
?>
|
||||
--EXPECT--
|
||||
|
||||
+42
-39
@@ -261,7 +261,7 @@ ZEND_GET_MODULE(fbsql)
|
||||
#define CHECK_LINK(link) { \
|
||||
if (link==-1) { \
|
||||
if (FB_SQL_G(generateWarnings)) \
|
||||
php_error(E_WARNING, "%s(): A link to the server could not be established", get_active_function_name(TSRMLS_C)); \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); \
|
||||
RETURN_FALSE; \
|
||||
} \
|
||||
}
|
||||
@@ -525,14 +525,14 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks)))
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): FrontBase link limit %d exceeded ", get_active_function_name(TSRMLS_C), FB_SQL_G(maxLinks));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase link limit %d exceeded", FB_SQL_G(maxLinks));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if ((FB_SQL_G(maxPersistent) != -1 && FB_SQL_G(persistentCount) == FB_SQL_G(maxPersistent)))
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): FrontBase persistent link limit %d exceeded ", get_active_function_name(TSRMLS_C), FB_SQL_G(maxPersistent));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase persistent link limit %d exceeded", FB_SQL_G(maxPersistent));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks)))
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): FrontBase link limit %d exceeded ", get_active_function_name(TSRMLS_C), FB_SQL_G(maxLinks));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "FrontBase link limit %d exceeded", FB_SQL_G(maxLinks));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -735,7 +735,7 @@ static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC)
|
||||
if (c == NULL)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), fbcdcClassErrorMessage());
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, fbcdcClassErrorMessage());
|
||||
return 0;
|
||||
}
|
||||
md = fbcdcCreateSession(c, "PHP", link->userName, link->userPassword, link->userName);
|
||||
@@ -746,9 +746,9 @@ static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC)
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
{
|
||||
if (emg)
|
||||
php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), emg);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, emg);
|
||||
else
|
||||
php_error(E_WARNING, "%s(): No message", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message");
|
||||
}
|
||||
link->errorText = strdup(emg);
|
||||
link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);;
|
||||
@@ -1063,7 +1063,8 @@ static void php_fbsql_read_lob(INTERNAL_FUNCTION_PARAMETERS, int lob_type)
|
||||
convert_to_string_ex(lob_handle);
|
||||
|
||||
if (Z_STRLEN_PP(lob_handle) != 27 || Z_STRVAL_PP(lob_handle)[0] != '@') {
|
||||
if (FB_SQL_G(generateWarnings)) php_error(E_WARNING, "%s(): The handle is invalid", get_active_function_name(TSRMLS_C));
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The handle is invalid");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1126,7 +1127,8 @@ static void php_fbsql_lob_size(INTERNAL_FUNCTION_PARAMETERS, int lob_type)
|
||||
convert_to_string_ex(lob_handle);
|
||||
|
||||
if (Z_STRLEN_PP(lob_handle) != 27 || Z_STRVAL_PP(lob_handle)[0] != '@') {
|
||||
if (FB_SQL_G(generateWarnings)) php_error(E_WARNING, "%s(): The handle is invalid", get_active_function_name(TSRMLS_C));
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The handle is invalid");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1362,8 +1364,7 @@ PHP_FUNCTION(fbsql_select_db)
|
||||
int port = atoi(name);
|
||||
if (port == 0 || port > 64535) {
|
||||
if (FB_SQL_G(generateWarnings)) {
|
||||
php_error(E_WARNING, "%s(): Cannot connect to FBExec for database '%s'", get_active_function_name(TSRMLS_C), name);
|
||||
php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), fbcehClassErrorMessage());
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot connect to FBExec for database '%s'. (%s)", name, fbcehClassErrorMessage());
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -1478,14 +1479,14 @@ PHP_FUNCTION(fbsql_create_db)
|
||||
else if (status == FBStopping) txt = "stopping";
|
||||
else if (status == FBNoExec ) txt = "no exec";
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Could not create %s@%s, database is %s", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName, txt);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create %s@%s, database is %s", databaseName, phpLink->hostName, txt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (!fbcehCreateDatabaseNamedWithOptions(phpLink->execHandler, databaseName, ""))
|
||||
{
|
||||
char* error = fbechErrorMessage(phpLink->execHandler);
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Could not create %s@%s. %s.", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName, error);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create %s@%s. %s", databaseName, phpLink->hostName, error);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
for (i=0; i < 20; i++)
|
||||
@@ -1501,7 +1502,7 @@ PHP_FUNCTION(fbsql_create_db)
|
||||
if (status != FBRunning)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Database %s@%s created -- status unknown", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database %s@%s created -- status unknown", databaseName, phpLink->hostName);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
@@ -1552,7 +1553,7 @@ PHP_FUNCTION(fbsql_drop_db)
|
||||
else if (status == FBStopping ) txt = "stopping";
|
||||
else if (status == FBNoExec ) txt = "no exec";
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Could not drop %s@%s, database is %s.", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName, txt);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not drop %s@%s, database is %s", databaseName, phpLink->hostName, txt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1560,7 +1561,7 @@ PHP_FUNCTION(fbsql_drop_db)
|
||||
{
|
||||
char* error = fbechErrorMessage(phpLink->execHandler);
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Could not drop %s@%s. %s.", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName, error);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not drop %s@%s. %s", databaseName, phpLink->hostName, error);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
for (i=0; i < 20; i++)
|
||||
@@ -1576,7 +1577,7 @@ PHP_FUNCTION(fbsql_drop_db)
|
||||
if (status != FBUnknownStatus)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Database %s@%s dropped -- status unknown", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database %s@%s dropped -- status unknown", databaseName, phpLink->hostName);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1625,7 +1626,7 @@ PHP_FUNCTION(fbsql_start_db)
|
||||
else if (status == FBStopping) txt = "stopping";
|
||||
else if (status == FBNoExec ) txt = "no exec";
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Could not start %s@%s, as database is %s.", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName, txt);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not start %s@%s, as database is %s", databaseName, phpLink->hostName, txt);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1635,7 +1636,7 @@ PHP_FUNCTION(fbsql_start_db)
|
||||
{
|
||||
char* error = fbechErrorMessage(phpLink->execHandler);
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Could not start %s@%s. %s.", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName, error);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not start %s@%s. %s", databaseName, phpLink->hostName, error);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1653,7 +1654,7 @@ PHP_FUNCTION(fbsql_start_db)
|
||||
if (status != FBRunning)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Database %s@%s started -- status unknown", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Database %s@%s started -- status unknown", databaseName, phpLink->hostName);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
@@ -1701,7 +1702,7 @@ PHP_FUNCTION(fbsql_stop_db)
|
||||
if (!fbcdcStopDatabase(phpLink->connection))
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Cannot stop database %s@%s", get_active_function_name(TSRMLS_C), databaseName, phpLink->hostName);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot stop database %s@%s", databaseName, phpLink->hostName);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1778,7 +1779,8 @@ int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql)
|
||||
{
|
||||
link->errorNo = 1;
|
||||
link->errorText = strdup("Connection to database server was lost");
|
||||
if (FB_SQL_G(generateWarnings)) php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), link->errorText);
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", link->errorText);
|
||||
result = 0;
|
||||
}
|
||||
else if (fbcmdErrorsFound(md))
|
||||
@@ -1788,9 +1790,9 @@ int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql)
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
{
|
||||
if (emg)
|
||||
php_error(E_WARNING, "%s(): Error in statement: '%s' %s", get_active_function_name(TSRMLS_C), sql, emg);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in statement: '%s' %s", sql, emg);
|
||||
else
|
||||
php_error(E_WARNING, "%s(): No message", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message");
|
||||
}
|
||||
link->errorText = strdup(emg);
|
||||
link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);;
|
||||
@@ -2445,7 +2447,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
break;
|
||||
|
||||
default:
|
||||
php_error(E_ERROR, "%s(): Unimplemented type", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unimplemented type (%d)", dtc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2490,13 +2492,13 @@ void phpfbSqlResult(INTERNAL_FUNCTION_PARAMETERS, PHPFBResult* result, int rowIn
|
||||
else if (!phpfbFetchRow(result, rowIndex))
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): No such row %d in result set %d", get_active_function_name(TSRMLS_C), rowIndex, rowIndex);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such row %d in result set %d", rowIndex, rowIndex);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
else if (columnIndex >= result->columnCount)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): No such column %d in result set %d", get_active_function_name(TSRMLS_C), columnIndex, rowIndex);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such column %d in result set %d", columnIndex, rowIndex);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
else
|
||||
@@ -2577,7 +2579,7 @@ PHP_FUNCTION(fbsql_result)
|
||||
if (columnIndex < 0)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Illegal column index - %d", get_active_function_name(TSRMLS_C), columnIndex);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal column index - %d", columnIndex);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -2810,7 +2812,7 @@ static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
|
||||
if (((result_type & FBSQL_NUM) != FBSQL_NUM) && ((result_type & FBSQL_ASSOC) != FBSQL_ASSOC))
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Illegal result type use FBSQL_NUM, FBSQL_ASSOC, or FBSQL_BOTH.", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal result type use FBSQL_NUM, FBSQL_ASSOC, or FBSQL_BOTH");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (array_init(return_value)==FAILURE)
|
||||
@@ -2979,7 +2981,7 @@ PHP_FUNCTION(fbsql_data_seek)
|
||||
if (rowIndex < 0)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Illegal row_index (%i)", get_active_function_name(TSRMLS_C), rowIndex);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal row_index (%d)", rowIndex);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -3056,7 +3058,7 @@ PHP_FUNCTION(fbsql_fetch_field)
|
||||
if (column < 0 || column >= result->columnCount)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): %d no such column in result", get_active_function_name(TSRMLS_C), column);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3113,7 +3115,7 @@ PHP_FUNCTION(fbsql_field_seek)
|
||||
if (column < 0 || column >= result->columnCount)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): %d no such column in result", get_active_function_name(TSRMLS_C), column);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3156,7 +3158,7 @@ PHP_FUNCTION(fbsql_field_name)
|
||||
if (column < 0 || column >= result->columnCount)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): %d no such column in result", get_active_function_name(TSRMLS_C), column);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3205,7 +3207,7 @@ PHP_FUNCTION(fbsql_field_table)
|
||||
if (column < 0 || column >= result->columnCount)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): %d no such column in result", get_active_function_name(TSRMLS_C), column);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3246,7 +3248,7 @@ PHP_FUNCTION(fbsql_field_len)
|
||||
if (column < 0 || column >= result->columnCount)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): %d no such column in result", get_active_function_name(TSRMLS_C), column);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3298,7 +3300,7 @@ PHP_FUNCTION(fbsql_field_type)
|
||||
if (column < 0 || column >= result->columnCount)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): %d no such column in result", get_active_function_name(TSRMLS_C), column);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3352,7 +3354,7 @@ PHP_FUNCTION(fbsql_field_flags)
|
||||
if (column < 0 || column >= result->columnCount)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): %d no such column in result", get_active_function_name(TSRMLS_C), column);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d no such column in result", column);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -3430,7 +3432,7 @@ PHP_FUNCTION(fbsql_table_name)
|
||||
if (index < 0)
|
||||
{
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error(E_WARNING, "%s(): Illegal index (%i)", get_active_function_name(TSRMLS_C), index);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal index (%i)", index);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -3496,7 +3498,8 @@ PHP_FUNCTION(fbsql_get_autostart_info)
|
||||
ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink);
|
||||
|
||||
if (phpLink->execHandler == NULL) {
|
||||
if (FB_SQL_G(generateWarnings)) php_error(E_WARNING, "%s(): No valid Exec handler available for this connection", get_active_function_name(TSRMLS_C));
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No valid Exec handler available for this connection");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
else {
|
||||
|
||||
+2
-1
@@ -1416,7 +1416,8 @@ PHP_FUNCTION(fdf_remove_item) {
|
||||
FDFErc err;
|
||||
|
||||
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsl", &r_fdf,
|
||||
&fieldname, &fieldname_len
|
||||
&fieldname, &fieldname_len,
|
||||
&item
|
||||
)
|
||||
== FAILURE) {
|
||||
return;
|
||||
|
||||
+1
-2
@@ -1,3 +1,2 @@
|
||||
FTP
|
||||
Andrew Skalski
|
||||
Stefan Esser
|
||||
Stefan Esser, Andrew Skalski
|
||||
@@ -624,6 +624,7 @@ PHP_FUNCTION(ftp_get)
|
||||
}
|
||||
|
||||
php_stream_close(outstream);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+22
-20
@@ -12,12 +12,12 @@ PHP_ARG_WITH(gd, for GD support,
|
||||
|
||||
if test -z "$PHP_JPEG_DIR"; then
|
||||
PHP_ARG_WITH(jpeg-dir, for the location of libjpeg,
|
||||
[ --with-jpeg-dir=DIR GD: Set the path to libjpeg install prefix.], no, no)
|
||||
[ --with-jpeg-dir[=DIR] GD: Set the path to libjpeg install prefix.], no, no)
|
||||
fi
|
||||
|
||||
if test -z "$PHP_PNG_DIR"; then
|
||||
PHP_ARG_WITH(png-dir, for the location of libpng,
|
||||
[ --with-png-dir=DIR GD: Set the path to libpng install prefix.], no, no)
|
||||
[ --with-png-dir[=DIR] GD: Set the path to libpng install prefix.], no, no)
|
||||
fi
|
||||
|
||||
if test -z "$PHP_ZLIB_DIR"; then
|
||||
@@ -26,13 +26,13 @@ if test -z "$PHP_ZLIB_DIR"; then
|
||||
fi
|
||||
|
||||
PHP_ARG_WITH(xpm-dir, for the location of libXpm,
|
||||
[ --with-xpm-dir=DIR GD: Set the path to libXpm install prefix.], no, no)
|
||||
[ --with-xpm-dir[=DIR] GD: Set the path to libXpm install prefix.], no, no)
|
||||
|
||||
PHP_ARG_WITH(ttf, for FreeType 1.x support,
|
||||
[ --with-ttf[=DIR] GD: Include FreeType 1.x support], no, no)
|
||||
|
||||
PHP_ARG_WITH(freetype-dir, for FreeType 2,
|
||||
[ --with-freetype-dir=DIR GD: Set the path to FreeType 2 install prefix.], no, no)
|
||||
[ --with-freetype-dir[=DIR] GD: Set the path to FreeType 2 install prefix.], no, no)
|
||||
|
||||
PHP_ARG_WITH(t1lib, for T1lib support,
|
||||
[ --with-t1lib[=DIR] GD: Include T1lib support.], no, no)
|
||||
@@ -242,22 +242,6 @@ AC_DEFUN(PHP_GD_CHECK_VERSION,[
|
||||
PHP_CHECK_LIBRARY(gd, gdImageGifCtx, [AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Check for gd 2.0.4 greater availability
|
||||
dnl
|
||||
|
||||
AC_TRY_COMPILE(
|
||||
[
|
||||
#include <gd.h>
|
||||
#include <stdlib.h>
|
||||
], [
|
||||
gdIOCtx *ctx;
|
||||
ctx = malloc(sizeof(gdIOCtx));
|
||||
ctx->gd_free = 1;
|
||||
], [
|
||||
AC_DEFINE(HAVE_LIBGD204, 1, [ ])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl Main GD configure
|
||||
dnl
|
||||
@@ -363,6 +347,24 @@ dnl Library path
|
||||
fi
|
||||
|
||||
PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE)
|
||||
|
||||
dnl
|
||||
dnl Check for gd 2.0.4 greater availability
|
||||
dnl
|
||||
old_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS=-I$GD_INCLUDE
|
||||
AC_TRY_COMPILE([
|
||||
#include <gd.h>
|
||||
#include <stdlib.h>
|
||||
], [
|
||||
gdIOCtx *ctx;
|
||||
ctx = malloc(sizeof(gdIOCtx));
|
||||
ctx->gd_free = 1;
|
||||
], [
|
||||
AC_DEFINE(HAVE_LIBGD204, 1, [ ])
|
||||
])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
+38
-14
@@ -188,7 +188,7 @@ function_entry gd_functions[] = {
|
||||
#ifdef HAVE_GD_XBM
|
||||
PHP_FE(imagecreatefromxbm, NULL)
|
||||
#endif
|
||||
#ifdef HAVE_GD_XPM
|
||||
#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
|
||||
PHP_FE(imagecreatefromxpm, NULL)
|
||||
#endif
|
||||
PHP_FE(imagecreatefromgd, NULL)
|
||||
@@ -1354,10 +1354,18 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
|
||||
}
|
||||
|
||||
if (!im && fp) {
|
||||
if (image_type == PHP_GDIMG_TYPE_GD2PART) {
|
||||
im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height));
|
||||
} else {
|
||||
im = (*func_p)(fp);
|
||||
switch (image_type) {
|
||||
case PHP_GDIMG_TYPE_GD2PART:
|
||||
im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height));
|
||||
break;
|
||||
#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
|
||||
case PHP_GDIMG_TYPE_XPM:
|
||||
im = gdImageCreateFromXpm(fn);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
im = (*func_p)(fp);
|
||||
break;
|
||||
}
|
||||
|
||||
fflush(fp);
|
||||
@@ -1417,22 +1425,15 @@ PHP_FUNCTION(imagecreatefromxbm)
|
||||
/* }}} */
|
||||
#endif /* HAVE_GD_XBM */
|
||||
|
||||
#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
|
||||
/* {{{ proto int imagecreatefromxpm(string filename)
|
||||
Create a new image from XPM file or URL */
|
||||
PHP_FUNCTION(imagecreatefromxpm)
|
||||
{
|
||||
/*
|
||||
#ifdef HAVE_GD_XPM
|
||||
_php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XPM, "XPM", gdImageCreateFromXpm, NULL);
|
||||
#else
|
||||
*/
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No XPM support in this PHP build");
|
||||
RETURN_FALSE;
|
||||
/*
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GD_WBMP
|
||||
/* {{{ proto int imagecreatefromwbmp(string filename)
|
||||
@@ -1525,6 +1526,14 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
}
|
||||
(*func_p)(im, i, fp);
|
||||
break;
|
||||
#if HAVE_LIBGD20
|
||||
case PHP_GDIMG_TYPE_GD:
|
||||
if(im->trueColor){
|
||||
gdImageTrueColorToPalette(im,1,256);
|
||||
}
|
||||
(*func_p)(im, fp);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
(*func_p)(im, fp);
|
||||
break;
|
||||
@@ -1556,6 +1565,14 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
}
|
||||
(*func_p)(im, q, tmp);
|
||||
break;
|
||||
#if HAVE_LIBGD20
|
||||
case PHP_GDIMG_TYPE_GD:
|
||||
if (im->trueColor) {
|
||||
gdImageTrueColorToPalette(im,1,256);
|
||||
}
|
||||
(*func_p)(im, tmp);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
(*func_p)(im, tmp);
|
||||
break;
|
||||
@@ -3281,6 +3298,13 @@ PHP_FUNCTION(imagepstext)
|
||||
extend = T1_GetExtend(*f_ind);
|
||||
str_path = T1_GetCharOutline(*f_ind, _str[0], Z_LVAL_PP(sz), transform);
|
||||
|
||||
if (!str_path) {
|
||||
if (T1_errno) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "libt1 returned error %d", T1_errno);
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
for (i = 1; i < Z_STRLEN_PP(str); i++) {
|
||||
amount_kern = (int) T1_GetKerning(*f_ind, _str[i-1], _str[i]);
|
||||
amount_kern += _str[i-1] == ' ' ? space : 0;
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
/* header */
|
||||
/*********************************************************/
|
||||
|
||||
#if (!defined _OSD_POSIX) && HAVE_MALLOC_H
|
||||
#if (!defined(_OSD_POSIX) && !defined(__FreeBSD__)) && HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#else
|
||||
#include <stdlib.h> /* BS2000/OSD defines malloc() & friends in stdlib.h */
|
||||
|
||||
+11
-13
@@ -566,21 +566,19 @@ gdImageColorDeallocate (gdImagePtr im, int color)
|
||||
im->open[color] = 1;
|
||||
}
|
||||
|
||||
void
|
||||
gdImageColorTransparent (gdImagePtr im, int color)
|
||||
void gdImageColorTransparent (gdImagePtr im, int color)
|
||||
{
|
||||
if (!im->trueColor)
|
||||
{
|
||||
if (im->transparent != -1)
|
||||
{
|
||||
im->alpha[im->transparent] = gdAlphaOpaque;
|
||||
if (!im->trueColor) {
|
||||
if (im->transparent != -1) {
|
||||
im->alpha[im->transparent] = gdAlphaOpaque;
|
||||
}
|
||||
if (color > -1 && color <= gdMaxColors) {
|
||||
im->alpha[color] = gdAlphaTransparent;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (color != -1)
|
||||
{
|
||||
im->alpha[color] = gdAlphaTransparent;
|
||||
}
|
||||
}
|
||||
im->transparent = color;
|
||||
im->transparent = color;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -223,6 +223,8 @@ gdImagePtr gdImageCreateFromGd2PartCtx(gdIOCtxPtr in, int srcx, int srcy, int w,
|
||||
|
||||
gdImagePtr gdImageCreateFromXbm(FILE *fd);
|
||||
|
||||
gdImagePtr gdImageCreateFromXpm (char *filename);
|
||||
|
||||
void gdImageDestroy(gdImagePtr im);
|
||||
|
||||
/* Replaces or blends with the background depending on the
|
||||
|
||||
+86
-132
@@ -184,7 +184,7 @@ _gd2CreateFromFile (gdIOCtxPtr in, int *sx, int *sy,
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
im = gdImageCreate (*sx, *sy);
|
||||
im = gdImageCreateTrueColor(*sx, *sy);
|
||||
if (im == NULL)
|
||||
{
|
||||
GD2_DBG (printf ("Could not create gdImage\n"));
|
||||
@@ -286,144 +286,98 @@ gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
|
||||
bytesPerPixel = im->trueColor ? 4 : 1;
|
||||
nc = ncx * ncy;
|
||||
|
||||
if (fmt == GD2_FMT_COMPRESSED)
|
||||
{
|
||||
/* Find the maximum compressed chunk size. */
|
||||
compMax = 0;
|
||||
for (i = 0; (i < nc); i++)
|
||||
{
|
||||
if (chunkIdx[i].size > compMax)
|
||||
{
|
||||
compMax = chunkIdx[i].size;
|
||||
};
|
||||
};
|
||||
compMax++;
|
||||
|
||||
/* Allocate buffers */
|
||||
chunkMax = cs * bytesPerPixel * cs;
|
||||
chunkBuf = gdCalloc (chunkMax, 1);
|
||||
compBuf = gdCalloc (compMax, 1);
|
||||
GD2_DBG (printf ("Largest compressed chunk is %d bytes\n", compMax));
|
||||
};
|
||||
|
||||
/* if ( (ncx != sx / cs) || (ncy != sy / cs)) { */
|
||||
/* goto fail2; */
|
||||
/* }; */
|
||||
|
||||
/* Read the data... */
|
||||
for (cy = 0; (cy < ncy); cy++)
|
||||
{
|
||||
for (cx = 0; (cx < ncx); cx++)
|
||||
{
|
||||
|
||||
ylo = cy * cs;
|
||||
yhi = ylo + cs;
|
||||
if (yhi > im->sy)
|
||||
{
|
||||
yhi = im->sy;
|
||||
};
|
||||
|
||||
GD2_DBG (printf ("Processing Chunk %d (%d, %d), y from %d to %d\n", chunkNum, cx, cy, ylo, yhi));
|
||||
|
||||
if (fmt == GD2_FMT_COMPRESSED)
|
||||
{
|
||||
|
||||
chunkLen = chunkMax;
|
||||
|
||||
if (!_gd2ReadChunk (chunkIdx[chunkNum].offset,
|
||||
compBuf,
|
||||
chunkIdx[chunkNum].size,
|
||||
chunkBuf, &chunkLen, in))
|
||||
{
|
||||
GD2_DBG (printf ("Error reading comproessed chunk\n"));
|
||||
goto fail2;
|
||||
};
|
||||
|
||||
chunkPos = 0;
|
||||
};
|
||||
|
||||
for (y = ylo; (y < yhi); y++)
|
||||
{
|
||||
|
||||
xlo = cx * cs;
|
||||
xhi = xlo + cs;
|
||||
if (xhi > im->sx)
|
||||
{
|
||||
xhi = im->sx;
|
||||
};
|
||||
/*GD2_DBG(printf("y=%d: ",y)); */
|
||||
if (fmt == GD2_FMT_RAW)
|
||||
{
|
||||
for (x = xlo; x < xhi; x++)
|
||||
{
|
||||
|
||||
if (im->trueColor)
|
||||
{
|
||||
if (!gdGetInt (&im->tpixels[y][x], in))
|
||||
{
|
||||
/*printf("EOF while reading\n"); */
|
||||
/*gdImageDestroy(im); */
|
||||
/*return 0; */
|
||||
im->tpixels[y][x] = 0;
|
||||
}
|
||||
if (fmt == GD2_FMT_COMPRESSED) {
|
||||
/* Find the maximum compressed chunk size. */
|
||||
compMax = 0;
|
||||
for (i = 0; i < nc; i++) {
|
||||
if (chunkIdx[i].size > compMax) {
|
||||
compMax = chunkIdx[i].size;
|
||||
}
|
||||
else
|
||||
{
|
||||
int ch;
|
||||
if (!gdGetByte (&ch, in))
|
||||
{
|
||||
/*printf("EOF while reading\n"); */
|
||||
/*gdImageDestroy(im); */
|
||||
/*return 0; */
|
||||
ch = 0;
|
||||
}
|
||||
im->pixels[y][x] = ch;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (x = xlo; x < xhi; x++)
|
||||
{
|
||||
if (im->trueColor)
|
||||
{
|
||||
/* 2.0.1: work around a gcc bug by being verbose.
|
||||
TBB */
|
||||
int a = chunkBuf[chunkPos++] << 24;
|
||||
int r = chunkBuf[chunkPos++] << 16;
|
||||
int g = chunkBuf[chunkPos++] << 8;
|
||||
int b = chunkBuf[chunkPos++];
|
||||
im->pixels[y][x] = a + r + g + b;
|
||||
compMax++;
|
||||
|
||||
/* Allocate buffers */
|
||||
chunkMax = cs * bytesPerPixel * cs;
|
||||
chunkBuf = gdCalloc (chunkMax, 1);
|
||||
compBuf = gdCalloc (compMax, 1);
|
||||
GD2_DBG(printf("Largest compressed chunk is %d bytes\n", compMax));
|
||||
}
|
||||
|
||||
/* Read the data... */
|
||||
for (cy = 0; cy < ncy; cy++) {
|
||||
for (cx = 0; cx < ncx; cx++) {
|
||||
ylo = cy * cs;
|
||||
yhi = ylo + cs;
|
||||
if (yhi > im->sy) {
|
||||
yhi = im->sy;
|
||||
}
|
||||
else
|
||||
{
|
||||
im->pixels[y][x] = chunkBuf[chunkPos++];
|
||||
GD2_DBG(printf("Processing Chunk %d (%d, %d), y from %d to %d\n", chunkNum, cx, cy, ylo, yhi));
|
||||
|
||||
if (fmt == GD2_FMT_COMPRESSED) {
|
||||
chunkLen = chunkMax;
|
||||
|
||||
if (!_gd2ReadChunk (chunkIdx[chunkNum].offset, compBuf, chunkIdx[chunkNum].size, chunkBuf, &chunkLen, in)) {
|
||||
GD2_DBG(printf("Error reading comproessed chunk\n"));
|
||||
goto fail2;
|
||||
}
|
||||
chunkPos = 0;
|
||||
}
|
||||
};
|
||||
};
|
||||
/*GD2_DBG(printf("\n")); */
|
||||
};
|
||||
chunkNum++;
|
||||
};
|
||||
};
|
||||
|
||||
GD2_DBG (printf ("Freeing memory\n"));
|
||||
for (y = ylo; y < yhi; y++) {
|
||||
xlo = cx * cs;
|
||||
xhi = xlo + cs;
|
||||
if (xhi > im->sx) {
|
||||
xhi = im->sx;
|
||||
}
|
||||
|
||||
gdFree (chunkBuf);
|
||||
gdFree (compBuf);
|
||||
gdFree (chunkIdx);
|
||||
if (fmt == GD2_FMT_RAW) {
|
||||
for (x = xlo; x < xhi; x++) {
|
||||
if (im->trueColor) {
|
||||
if (!gdGetInt (&im->tpixels[y][x], in)) {
|
||||
im->tpixels[y][x] = 0;
|
||||
}
|
||||
} else {
|
||||
int ch;
|
||||
if (!gdGetByte (&ch, in)) {
|
||||
ch = 0;
|
||||
}
|
||||
im->pixels[y][x] = ch;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (x = xlo; x < xhi; x++) {
|
||||
if (im->trueColor) {
|
||||
int a = chunkBuf[chunkPos++] << 24;
|
||||
int r = chunkBuf[chunkPos++] << 16;
|
||||
int g = chunkBuf[chunkPos++] << 8;
|
||||
int b = chunkBuf[chunkPos++];
|
||||
im->tpixels[y][x] = a + r + g + b;
|
||||
} else {
|
||||
im->pixels[y][x] = chunkBuf[chunkPos++];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
chunkNum++;
|
||||
}
|
||||
}
|
||||
|
||||
GD2_DBG (printf ("Done\n"));
|
||||
GD2_DBG(printf("Freeing memory\n"));
|
||||
|
||||
return im;
|
||||
gdFree (chunkBuf);
|
||||
gdFree (compBuf);
|
||||
gdFree (chunkIdx);
|
||||
|
||||
GD2_DBG(printf("Done\n"));
|
||||
|
||||
return im;
|
||||
|
||||
fail2:
|
||||
gdImageDestroy (im);
|
||||
gdFree (chunkBuf);
|
||||
gdFree (compBuf);
|
||||
gdFree (chunkIdx);
|
||||
return 0;
|
||||
|
||||
gdImageDestroy (im);
|
||||
gdFree (chunkBuf);
|
||||
gdFree (compBuf);
|
||||
gdFree (chunkIdx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
gdImagePtr
|
||||
@@ -818,10 +772,10 @@ _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
|
||||
{
|
||||
for (x = xlo; x < xhi; x++)
|
||||
{
|
||||
int p = im->pixels[y][x];
|
||||
/*GD2_DBG(printf("%d...",x)); */
|
||||
GD2_DBG(printf("%d...",x));
|
||||
if (im->trueColor)
|
||||
{
|
||||
int p = im->tpixels[y][x];
|
||||
chunkData[chunkLen++] = gdTrueColorGetAlpha (p);
|
||||
chunkData[chunkLen++] = gdTrueColorGetRed (p);
|
||||
chunkData[chunkLen++] = gdTrueColorGetGreen (p);
|
||||
@@ -829,7 +783,7 @@ _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt)
|
||||
}
|
||||
else
|
||||
{
|
||||
chunkData[chunkLen++] = p;
|
||||
chunkData[chunkLen++] = im->pixels[y][x];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
+2
-12
@@ -716,20 +716,10 @@ gdImagePngCtx (gdImagePtr im, gdIOCtx * outfile)
|
||||
{
|
||||
png_bytep *row_pointers;
|
||||
row_pointers = gdMalloc (sizeof (png_bytep) * height);
|
||||
if (row_pointers == NULL)
|
||||
{
|
||||
fprintf (stderr, "gd-png error: unable to allocate row_pointers\n");
|
||||
}
|
||||
for (j = 0; j < height; ++j)
|
||||
{
|
||||
if ((row_pointers[j] = (png_bytep) gdMalloc (width)) == NULL)
|
||||
{
|
||||
fprintf (stderr, "gd-png error: unable to allocate rows\n");
|
||||
for (i = 0; i < j; ++i)
|
||||
gdFree (row_pointers[i]);
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < width; ++i)
|
||||
row_pointers[j] = (png_bytep) gdMalloc (width);
|
||||
for (i = 0; i < width; ++i)
|
||||
row_pointers[j][i] = mapping[im->pixels[j][i]];
|
||||
}
|
||||
|
||||
|
||||
+106
-188
@@ -1490,200 +1490,118 @@ zeroHistogram (hist4d histogram)
|
||||
void
|
||||
gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted)
|
||||
{
|
||||
my_cquantize_ptr cquantize = 0;
|
||||
int i;
|
||||
size_t arraysize;
|
||||
if (!im->trueColor || colorsWanted <= 0)
|
||||
{
|
||||
/* Nothing to do! */
|
||||
return;
|
||||
}
|
||||
if (colorsWanted > gdMaxColors)
|
||||
{
|
||||
colorsWanted = gdMaxColors;
|
||||
}
|
||||
im->pixels = gdCalloc (sizeof (unsigned char *), im->sy);
|
||||
if (!im->pixels)
|
||||
{
|
||||
/* No can do */
|
||||
goto outOfMemory;
|
||||
}
|
||||
for (i = 0; (i < im->sy); i++)
|
||||
{
|
||||
im->pixels[i] = gdCalloc (sizeof (unsigned char *), im->sx);
|
||||
if (!im->pixels[i])
|
||||
{
|
||||
goto outOfMemory;
|
||||
my_cquantize_ptr cquantize = 0;
|
||||
int i;
|
||||
size_t arraysize;
|
||||
if (!im->trueColor || colorsWanted <= 0) {
|
||||
/* Nothing to do! */
|
||||
return;
|
||||
}
|
||||
}
|
||||
cquantize = (my_cquantize_ptr) gdCalloc (sizeof (my_cquantizer), 1);
|
||||
if (!cquantize)
|
||||
{
|
||||
/* No can do */
|
||||
goto outOfMemory;
|
||||
}
|
||||
/* Allocate the histogram/inverse colormap storage */
|
||||
cquantize->histogram = (hist4d) gdMalloc (HIST_C0_ELEMS * sizeof (hist3d));
|
||||
for (i = 0; i < HIST_C0_ELEMS; i++)
|
||||
{
|
||||
int j;
|
||||
cquantize->histogram[i] = (hist3d) gdCalloc (HIST_C1_ELEMS,
|
||||
sizeof (hist2d));
|
||||
if (!cquantize->histogram[i])
|
||||
{
|
||||
goto outOfMemory;
|
||||
|
||||
if (colorsWanted > gdMaxColors) {
|
||||
colorsWanted = gdMaxColors;
|
||||
}
|
||||
for (j = 0; (j < HIST_C1_ELEMS); j++)
|
||||
{
|
||||
cquantize->histogram[i][j] = (hist2d) gdCalloc (HIST_C2_ELEMS * HIST_C3_ELEMS,
|
||||
sizeof (histcell));
|
||||
if (!cquantize->histogram[i][j])
|
||||
{
|
||||
goto outOfMemory;
|
||||
}
|
||||
}
|
||||
}
|
||||
cquantize->fserrors = (FSERRPTR) gdMalloc (4 * sizeof (FSERROR));
|
||||
init_error_limit (im, cquantize);
|
||||
arraysize = (size_t) ((im->sx + 2) *
|
||||
(4 * sizeof (FSERROR)));
|
||||
/* Allocate Floyd-Steinberg workspace. */
|
||||
cquantize->fserrors = gdCalloc (arraysize, 1);
|
||||
if (!cquantize->fserrors)
|
||||
{
|
||||
goto outOfMemory;
|
||||
}
|
||||
cquantize->on_odd_row = FALSE;
|
||||
|
||||
/* Do the work! */
|
||||
zeroHistogram (cquantize->histogram);
|
||||
prescan_quantize (im, cquantize);
|
||||
select_colors (im, cquantize, colorsWanted);
|
||||
/* TBB HACK REMOVE */
|
||||
#if 0
|
||||
{
|
||||
FILE *out = fopen ("palettemap.png", "wb");
|
||||
int i;
|
||||
gdImagePtr im2 = gdImageCreateTrueColor (256, 256);
|
||||
for (i = 0; (i < 256); i++)
|
||||
{
|
||||
gdImageFilledRectangle (im2, (i % 16) * 16, (i / 16) * 16,
|
||||
(i % 16) * 16 + 15, (i / 16) * 16 + 15,
|
||||
gdTrueColorAlpha (im->red[i], im->green[i],
|
||||
im->blue[i], im->alpha[i]));
|
||||
}
|
||||
gdImagePng (im2, out);
|
||||
fclose (out);
|
||||
gdImageDestroy (im2);
|
||||
}
|
||||
#endif
|
||||
zeroHistogram (cquantize->histogram);
|
||||
if (dither)
|
||||
{
|
||||
pass2_fs_dither (im, cquantize);
|
||||
}
|
||||
else
|
||||
{
|
||||
pass2_no_dither (im, cquantize);
|
||||
}
|
||||
if (cquantize->transparentIsPresent)
|
||||
{
|
||||
int mt = -1;
|
||||
int mtIndex = -1;
|
||||
for (i = 0; (i < im->colorsTotal); i++)
|
||||
{
|
||||
if (im->alpha[i] > mt)
|
||||
{
|
||||
mtIndex = i;
|
||||
mt = im->alpha[i];
|
||||
}
|
||||
im->pixels = gdCalloc (sizeof (unsigned char *), im->sy);
|
||||
|
||||
for (i = 0; i < im->sy; i++) {
|
||||
im->pixels[i] = gdCalloc (sizeof (unsigned char *), im->sx);
|
||||
}
|
||||
for (i = 0; (i < im->colorsTotal); i++)
|
||||
{
|
||||
if (im->alpha[i] == mt)
|
||||
{
|
||||
im->alpha[i] = gdAlphaTransparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cquantize->opaqueIsPresent)
|
||||
{
|
||||
int mo = 128;
|
||||
int moIndex = -1;
|
||||
for (i = 0; (i < im->colorsTotal); i++)
|
||||
{
|
||||
if (im->alpha[i] < mo)
|
||||
{
|
||||
moIndex = i;
|
||||
mo = im->alpha[i];
|
||||
}
|
||||
}
|
||||
for (i = 0; (i < im->colorsTotal); i++)
|
||||
{
|
||||
if (im->alpha[i] == mo)
|
||||
{
|
||||
im->alpha[i] = gdAlphaOpaque;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Success! Get rid of the truecolor image data. */
|
||||
im->trueColor = 0;
|
||||
/* Junk the truecolor pixels */
|
||||
for (i = 0; i < im->sy; i++)
|
||||
{
|
||||
gdFree (im->tpixels[i]);
|
||||
}
|
||||
gdFree (im->tpixels);
|
||||
im->tpixels = 0;
|
||||
/* Tediously free stuff. */
|
||||
outOfMemory:
|
||||
if (im->trueColor)
|
||||
{
|
||||
/* On failure only */
|
||||
for (i = 0; i < im->sy; i++)
|
||||
{
|
||||
if (im->pixels[i])
|
||||
{
|
||||
gdFree (im->pixels[i]);
|
||||
}
|
||||
}
|
||||
if (im->pixels)
|
||||
{
|
||||
gdFree (im->pixels);
|
||||
}
|
||||
im->pixels = 0;
|
||||
}
|
||||
for (i = 0; i < HIST_C0_ELEMS; i++)
|
||||
{
|
||||
if (cquantize->histogram[i])
|
||||
{
|
||||
int j;
|
||||
for (j = 0; j < HIST_C1_ELEMS; j++)
|
||||
{
|
||||
if (cquantize->histogram[i][j])
|
||||
{
|
||||
gdFree (cquantize->histogram[i][j]);
|
||||
cquantize = (my_cquantize_ptr) gdCalloc (sizeof (my_cquantizer), 1);
|
||||
|
||||
/* Allocate the histogram/inverse colormap storage */
|
||||
cquantize->histogram = (hist4d) gdMalloc (HIST_C0_ELEMS * sizeof (hist3d));
|
||||
for (i = 0; i < HIST_C0_ELEMS; i++) {
|
||||
int j;
|
||||
cquantize->histogram[i] = (hist3d) gdCalloc (HIST_C1_ELEMS, sizeof (hist2d));
|
||||
for (j = 0; j < HIST_C1_ELEMS; j++) {
|
||||
cquantize->histogram[i][j] = (hist2d) gdCalloc (HIST_C2_ELEMS * HIST_C3_ELEMS, sizeof (histcell));
|
||||
}
|
||||
}
|
||||
gdFree (cquantize->histogram[i]);
|
||||
}
|
||||
}
|
||||
if (cquantize->histogram)
|
||||
{
|
||||
gdFree (cquantize->histogram);
|
||||
}
|
||||
if (cquantize->fserrors)
|
||||
{
|
||||
gdFree (cquantize->fserrors);
|
||||
}
|
||||
if (cquantize->error_limiter_storage)
|
||||
{
|
||||
gdFree (cquantize->error_limiter_storage);
|
||||
}
|
||||
if (cquantize)
|
||||
{
|
||||
gdFree (cquantize);
|
||||
}
|
||||
|
||||
cquantize->fserrors = (FSERRPTR) gdMalloc (4 * sizeof (FSERROR));
|
||||
init_error_limit (im, cquantize);
|
||||
arraysize = (size_t) ((im->sx + 2) * (4 * sizeof (FSERROR)));
|
||||
gdFree(cquantize->fserrors);
|
||||
/* Allocate Floyd-Steinberg workspace. */
|
||||
cquantize->fserrors = gdCalloc (arraysize, 1);
|
||||
cquantize->on_odd_row = FALSE;
|
||||
|
||||
/* Do the work! */
|
||||
zeroHistogram (cquantize->histogram);
|
||||
prescan_quantize (im, cquantize);
|
||||
select_colors (im, cquantize, colorsWanted);
|
||||
|
||||
zeroHistogram (cquantize->histogram);
|
||||
if (dither) {
|
||||
pass2_fs_dither (im, cquantize);
|
||||
} else {
|
||||
pass2_no_dither (im, cquantize);
|
||||
}
|
||||
if (cquantize->transparentIsPresent) {
|
||||
int mt = -1;
|
||||
int mtIndex = -1;
|
||||
for (i = 0; i < im->colorsTotal; i++) {
|
||||
if (im->alpha[i] > mt) {
|
||||
mtIndex = i;
|
||||
mt = im->alpha[i];
|
||||
}
|
||||
}
|
||||
for (i = 0; i < im->colorsTotal; i++) {
|
||||
if (im->alpha[i] == mt) {
|
||||
im->alpha[i] = gdAlphaTransparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (cquantize->opaqueIsPresent) {
|
||||
int mo = 128;
|
||||
int moIndex = -1;
|
||||
for (i = 0; i < im->colorsTotal; i++) {
|
||||
if (im->alpha[i] < mo) {
|
||||
moIndex = i;
|
||||
mo = im->alpha[i];
|
||||
}
|
||||
}
|
||||
for (i = 0; i < im->colorsTotal; i++) {
|
||||
if (im->alpha[i] == mo) {
|
||||
im->alpha[i] = gdAlphaOpaque;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Success! Get rid of the truecolor image data. */
|
||||
im->trueColor = 0;
|
||||
/* Junk the truecolor pixels */
|
||||
for (i = 0; i < im->sy; i++) {
|
||||
gdFree(im->tpixels[i]);
|
||||
}
|
||||
gdFree (im->tpixels);
|
||||
im->tpixels = 0;
|
||||
/* Tediously free stuff. */
|
||||
|
||||
for (i = 0; i < HIST_C0_ELEMS; i++) {
|
||||
if (cquantize->histogram[i]) {
|
||||
int j;
|
||||
for (j = 0; j < HIST_C1_ELEMS; j++) {
|
||||
if (cquantize->histogram[i][j]) {
|
||||
gdFree(cquantize->histogram[i][j]);
|
||||
}
|
||||
}
|
||||
gdFree(cquantize->histogram[i]);
|
||||
}
|
||||
}
|
||||
if (cquantize->histogram) {
|
||||
gdFree(cquantize->histogram);
|
||||
}
|
||||
if (cquantize->fserrors) {
|
||||
gdFree(cquantize->fserrors);
|
||||
}
|
||||
if (cquantize->error_limiter_storage) {
|
||||
gdFree(cquantize->error_limiter_storage);
|
||||
}
|
||||
if (cquantize) {
|
||||
gdFree(cquantize);
|
||||
}
|
||||
}
|
||||
|
||||
/* bring the palette colors in im2 to be closer to im1
|
||||
|
||||
+3
-1
@@ -110,12 +110,14 @@ PHP_FUNCTION(imagecreatefromstring);
|
||||
PHP_FUNCTION(imagecreatefromgif);
|
||||
PHP_FUNCTION(imagecreatefromjpeg);
|
||||
PHP_FUNCTION(imagecreatefromxbm);
|
||||
PHP_FUNCTION(imagecreatefromxpm);
|
||||
PHP_FUNCTION(imagecreatefrompng);
|
||||
PHP_FUNCTION(imagecreatefromwbmp);
|
||||
PHP_FUNCTION(imagecreatefromgd);
|
||||
PHP_FUNCTION(imagecreatefromgd2);
|
||||
PHP_FUNCTION(imagecreatefromgd2part);
|
||||
#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
|
||||
PHP_FUNCTION(imagecreatefromxpm);
|
||||
#endif
|
||||
|
||||
PHP_FUNCTION(imagegammacorrect);
|
||||
PHP_FUNCTION(imagedestroy);
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
gif --> gd1/gd2 conversion test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not avaliable.");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die("skip external GD libraries always fail");
|
||||
}
|
||||
if (!function_exists("imagecreatefromgif")) {
|
||||
die("skip gif read support unavailable");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
|
||||
echo "GIF to GD1 conversion: ";
|
||||
echo imagegd(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test.gd1") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "GIF to GD2 conversion: ";
|
||||
echo imagegd2(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test.gd2") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
@unlink($cwd . "/test.gd1");
|
||||
@unlink($cwd . "/test.gd2");
|
||||
?>
|
||||
--EXPECT--
|
||||
GIF to GD1 conversion: ok
|
||||
GIF to GD2 conversion: ok
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
gif --> jpeg conversion test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not avaliable.");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die("skip external GD libraries always fail");
|
||||
}
|
||||
if (!function_exists("imagejpeg")) {
|
||||
die("skip jpeg support unavailable");
|
||||
}
|
||||
if (!function_exists("imagecreatefromgif")) {
|
||||
die("skip gif read support unavailable");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
|
||||
echo "GIF to JPEG conversion: ";
|
||||
echo imagejpeg(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.jpeg") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
@unlink($cwd . "/test_gif.jpeg");
|
||||
?>
|
||||
--EXPECT--
|
||||
GIF to JPEG conversion: ok
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
gif --> png conversion test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not avaliable.");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die("skip external GD libraries always fail");
|
||||
}
|
||||
if (!function_exists("imagepng")) {
|
||||
die("skip png support unavailable");
|
||||
}
|
||||
if (!function_exists("imagecreatefromgif")) {
|
||||
die("skip gif read support unavailable");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
|
||||
echo "GIF to PNG conversion: ";
|
||||
echo imagepng(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.png") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
@unlink($cwd . "/test_gif.png");
|
||||
?>
|
||||
--EXPECT--
|
||||
GIF to PNG conversion: ok
|
||||
@@ -0,0 +1,47 @@
|
||||
--TEST--
|
||||
jpeg <--> png conversion test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not avaliable.");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die("skip external GD libraries always fail");
|
||||
}
|
||||
if (!function_exists("imagecreatefrompng") || !function_exists("imagepng")) {
|
||||
die("skip png support unavailable");
|
||||
}
|
||||
if (!function_exists("imagecreatefromjpeg") || !function_exists("imagejpeg")) {
|
||||
die("skip jpeg support unavailable");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
|
||||
echo "PNG to JPEG conversion: ";
|
||||
echo imagejpeg(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test_jpeg.jpeg") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "Generated JPEG to PNG conversion: ";
|
||||
echo imagepng(imagecreatefromjpeg($cwd . "/test_jpeg.jpeg"), $cwd . "/test_jpng.png") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "JPEG to PNG conversion: ";
|
||||
echo imagepng(imagecreatefromjpeg($cwd . "/conv_test.jpeg"), $cwd . "/test_png.png") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "Generated PNG to JPEG conversion: ";
|
||||
echo imagejpeg(imagecreatefrompng($cwd . "/test_png.png"), $cwd . "/test_pjpeg.jpeg") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
@unlink($cwd . "/test_jpeg.jpeg");
|
||||
@unlink($cwd . "/test_jpng.png");
|
||||
@unlink($cwd . "/test_png.png");
|
||||
@unlink($cwd . "/test_pjpeg.jpeg");
|
||||
?>
|
||||
--EXPECT--
|
||||
PNG to JPEG conversion: ok
|
||||
Generated JPEG to PNG conversion: ok
|
||||
JPEG to PNG conversion: ok
|
||||
Generated PNG to JPEG conversion: ok
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
jpeg <--> gd1/gd2 conversion test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not avaliable.");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die("skip external GD libraries always fail");
|
||||
}
|
||||
if (!function_exists("imagecreatefromjpeg") || !function_exists("imagejpeg")) {
|
||||
die("skip jpeg support unavailable");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
|
||||
echo "JPEG to GD1 conversion: ";
|
||||
echo imagegd(imagecreatefromjpeg($cwd . "/conv_test.jpeg"), $cwd . "/test.gd1") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "JPEG to GD2 conversion: ";
|
||||
echo imagegd2(imagecreatefromjpeg($cwd . "/conv_test.jpeg"), $cwd . "/test.gd2") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "GD1 to JPEG conversion: ";
|
||||
echo imagejpeg(imagecreatefromgd($cwd . "/test.gd1"), $cwd . "/test_gd1.jpeg") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "GD2 to JPEG conversion: ";
|
||||
echo imagejpeg(imagecreatefromgd2($cwd . "/test.gd2"), $cwd . "/test_gd2.jpeg") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
@unlink($cwd . "/test.gd1");
|
||||
@unlink($cwd . "/test.gd2");
|
||||
@unlink($cwd . "/test_gd1.jpeg");
|
||||
@unlink($cwd . "/test_gd2.jpeg");
|
||||
?>
|
||||
--EXPECT--
|
||||
JPEG to GD1 conversion: ok
|
||||
JPEG to GD2 conversion: ok
|
||||
GD1 to JPEG conversion: ok
|
||||
GD2 to JPEG conversion: ok
|
||||
@@ -0,0 +1,44 @@
|
||||
--TEST--
|
||||
png <--> gd1/gd2 conversion test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not avaliable.");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die("skip external GD libraries always fail");
|
||||
}
|
||||
if (!function_exists("imagecreatefrompng") || !function_exists("imagepng")) {
|
||||
die("skip png support unavailable");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
|
||||
echo "PNG to GD1 conversion: ";
|
||||
echo imagegd(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test.gd1") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "PNG to GD2 conversion: ";
|
||||
echo imagegd2(imagecreatefrompng($cwd . "/conv_test.png"), $cwd . "/test.gd2") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "GD1 to PNG conversion: ";
|
||||
echo imagepng(imagecreatefromgd($cwd . "/test.gd1"), $cwd . "/test_gd1.png") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "GD2 to PNG conversion: ";
|
||||
echo imagepng(imagecreatefromgd2($cwd . "/test.gd2"), $cwd . "/test_gd2.png") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
@unlink($cwd . "/test.gd1");
|
||||
@unlink($cwd . "/test.gd2");
|
||||
@unlink($cwd . "/test_gd1.png");
|
||||
@unlink($cwd . "/test_gd2.png");
|
||||
?>
|
||||
--EXPECT--
|
||||
PNG to GD1 conversion: ok
|
||||
PNG to GD2 conversion: ok
|
||||
GD1 to PNG conversion: ok
|
||||
GD2 to PNG conversion: ok
|
||||
@@ -0,0 +1,32 @@
|
||||
--TEST--
|
||||
xpm --> gd1/gd2 conversion test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not avaliable.");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die("skip external GD libraries always fail");
|
||||
}
|
||||
if (!function_exists("imagecreatefromxpm")) {
|
||||
die("skip xpm read support unavailable");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
|
||||
echo "XPM to GD1 conversion: ";
|
||||
echo imagegd(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test.gd1") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
echo "XPM to GD2 conversion: ";
|
||||
echo imagegd2(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test.gd2") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
@unlink($cwd . "/test.gd1");
|
||||
@unlink($cwd . "/test.gd2");
|
||||
?>
|
||||
--EXPECT--
|
||||
XPM to GD1 conversion: ok
|
||||
XPM to GD2 conversion: ok
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
xpm --> jpeg conversion test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not avaliable.");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die("skip external GD libraries always fail");
|
||||
}
|
||||
if (!function_exists("imagejpeg")) {
|
||||
die("skip jpeg support unavailable");
|
||||
}
|
||||
if (!function_exists("imagecreatefromxpm")) {
|
||||
die("skip xpm read support unavailable");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
|
||||
echo "XPM to JPEG conversion: ";
|
||||
echo imagejpeg(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.jpeg") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
@unlink($cwd . "/test_xpm.jpeg");
|
||||
?>
|
||||
--EXPECT--
|
||||
XPM to JPEG conversion: ok
|
||||
@@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
xpm --> png conversion test
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('gd')) {
|
||||
die("skip gd extension not avaliable.");
|
||||
}
|
||||
if (!GD_BUNDLED) {
|
||||
die("skip external GD libraries always fail");
|
||||
}
|
||||
if (!function_exists("imagepng")) {
|
||||
die("skip png support unavailable");
|
||||
}
|
||||
if (!function_exists("imagecreatefromxpm")) {
|
||||
die("skip xpm read support unavailable");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$cwd = dirname(__FILE__);
|
||||
|
||||
echo "XPM to PNG conversion: ";
|
||||
echo imagepng(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.png") ? 'ok' : 'failed';
|
||||
echo "\n";
|
||||
|
||||
@unlink($cwd . "/test_xpm.png");
|
||||
?>
|
||||
--EXPECT--
|
||||
XPM to PNG conversion: ok
|
||||
@@ -1,5 +0,0 @@
|
||||
this extension is experimental,
|
||||
its functions may change their names
|
||||
or move to extension all together
|
||||
so do not rely to much on them
|
||||
you have been warned!
|
||||
+46
-9
@@ -20,7 +20,7 @@
|
||||
| Rasmus Lerdorf <rasmus@php.net> |
|
||||
| Chuck Hagenbuch <chuck@horde.org> |
|
||||
| Andrew Skalski <askalski@chekinc.com> |
|
||||
| Hartmut Holzgraefe <hartmut@six.de> |
|
||||
| Hartmut Holzgraefe <hholzgra@php.net> |
|
||||
| Jani Taskinen <sniper@iki.fi> |
|
||||
| Daniel R. Kalowsky <kalowsky@php.net> |
|
||||
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
|
||||
@@ -3144,10 +3144,25 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
|
||||
char *tempMailTo;
|
||||
char *tsm_errmsg = NULL;
|
||||
ADDRESS *addr;
|
||||
char *bufferTo = NULL, *bufferCc = NULL, *bufferBcc = NULL;
|
||||
int offset;
|
||||
char *bufferTo = NULL, *bufferCc = NULL, *bufferBcc = NULL, *bufferHeader = NULL;
|
||||
int offset, bufferLen = 0;;
|
||||
|
||||
if (headers) {
|
||||
bufferLen += strlen(headers);
|
||||
}
|
||||
if (to) {
|
||||
bufferLen += strlen(to) + 6;
|
||||
}
|
||||
if (cc) {
|
||||
bufferLen += strlen(cc) + 6;
|
||||
}
|
||||
|
||||
bufferHeader = (char *)emalloc(bufferLen);
|
||||
memset(bufferHeader, 0, bufferLen);
|
||||
if (to && *to) {
|
||||
strcat(bufferHeader, "To: ");
|
||||
strcat(bufferHeader, to);
|
||||
strcat(bufferHeader, "\r\n");
|
||||
tempMailTo = estrdup(to);
|
||||
bufferTo = (char *)emalloc(strlen(to));
|
||||
offset = 0;
|
||||
@@ -3162,10 +3177,15 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
|
||||
addr = addr->next;
|
||||
}
|
||||
efree(tempMailTo);
|
||||
bufferTo[offset] = 0;
|
||||
if (offset>0) {
|
||||
bufferTo[offset-1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (cc && *cc) {
|
||||
strcat(bufferHeader, "Cc: ");
|
||||
strcat(bufferHeader, cc);
|
||||
strcat(bufferHeader, "\r\n");
|
||||
tempMailTo = estrdup(cc);
|
||||
bufferCc = (char *)emalloc(strlen(cc));
|
||||
offset = 0;
|
||||
@@ -3180,7 +3200,9 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
|
||||
addr = addr->next;
|
||||
}
|
||||
efree(tempMailTo);
|
||||
bufferCc[offset] = 0;
|
||||
if (offset>0) {
|
||||
bufferCc[offset-1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (bcc && *bcc) {
|
||||
@@ -3198,11 +3220,16 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
|
||||
addr = addr->next;
|
||||
}
|
||||
efree(tempMailTo);
|
||||
bufferBcc[offset] = 0;
|
||||
if (offset>0) {
|
||||
bufferBcc[offset-1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (headers && *headers) {
|
||||
strcat(bufferHeader, headers);
|
||||
}
|
||||
|
||||
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, headers, subject, bufferTo, message, bufferCc, bufferBcc, rpath) != SUCCESS) {
|
||||
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath) != SUCCESS) {
|
||||
if (tsm_errmsg) {
|
||||
php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), tsm_errmsg);
|
||||
efree(tsm_errmsg);
|
||||
@@ -3211,8 +3238,18 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char *
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (bufferCc) efree(bufferCc);
|
||||
if (bufferBcc) efree(bufferBcc);
|
||||
if (bufferTo) {
|
||||
efree(bufferTo);
|
||||
}
|
||||
if (bufferCc) {
|
||||
efree(bufferCc);
|
||||
}
|
||||
if (bufferBcc) {
|
||||
efree(bufferBcc);
|
||||
}
|
||||
if (bufferHeader) {
|
||||
efree(bufferHeader);
|
||||
}
|
||||
#else
|
||||
if (!INI_STR("sendmail_path")) {
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ AC_DEFUN(JAVA_CHECK_LIB, [
|
||||
test -f $i/jni_md.h && JAVA_INCLUDE="$JAVA_INCLUDE -I$i"
|
||||
done
|
||||
|
||||
for i in `find $PHP_JAVA -type d`; do
|
||||
for i in `find $PHP_JAVA/ -type d`; do
|
||||
test -f $i/classes.zip && JAVA_CFLAGS=-DJNI_11
|
||||
test -f $i/rt.jar && JAVA_CFLAGS=-DJNI_12
|
||||
test -f $i/classes.zip && JAVA_CLASSPATH=$i/classes.zip
|
||||
|
||||
+7
-19
@@ -45,7 +45,7 @@
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#include "win32/winutil.h"
|
||||
#define DL_ERROR php_win_err()
|
||||
#define DL_ERROR php_win_err
|
||||
#endif
|
||||
|
||||
|
||||
@@ -87,7 +87,6 @@ static char *libpath = 0;
|
||||
static char *javahome = 0;
|
||||
static char *javalib = 0;
|
||||
|
||||
static int iniUpdated = 0;
|
||||
static void *dl_handle = 0;
|
||||
|
||||
/* {{{ ZEND_BEGIN_MODULE_GLOBALS
|
||||
@@ -113,22 +112,21 @@ static zend_class_entry java_class_entry;
|
||||
static PHP_INI_MH(OnIniUpdate)
|
||||
{
|
||||
if (new_value) *(char**)mh_arg1 = new_value;
|
||||
iniUpdated=1;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/* {{{ PHP_INI_BEGIN
|
||||
*/
|
||||
PHP_INI_BEGIN()
|
||||
PHP_INI_ENTRY1("java.class.path", NULL, PHP_INI_ALL, OnIniUpdate, &classpath)
|
||||
PHP_INI_ENTRY1("java.class.path", NULL, PHP_INI_SYSTEM, OnIniUpdate, &classpath)
|
||||
#ifndef JNI_11
|
||||
PHP_INI_ENTRY1("java.home", NULL, PHP_INI_ALL, OnIniUpdate, &javahome)
|
||||
PHP_INI_ENTRY1("java.library.path", NULL, PHP_INI_ALL, OnIniUpdate, &libpath)
|
||||
PHP_INI_ENTRY1("java.home", NULL, PHP_INI_SYSTEM, OnIniUpdate, &javahome)
|
||||
PHP_INI_ENTRY1("java.library.path", NULL, PHP_INI_SYSTEM,OnIniUpdate, &libpath)
|
||||
#endif
|
||||
#ifdef JAVALIB
|
||||
PHP_INI_ENTRY1("java.library", JAVALIB, PHP_INI_ALL, OnIniUpdate, &javalib)
|
||||
PHP_INI_ENTRY1("java.library", JAVALIB, PHP_INI_SYSTEM, OnIniUpdate, &javalib)
|
||||
#else
|
||||
PHP_INI_ENTRY1("java.library", NULL, PHP_INI_ALL, OnIniUpdate, &javalib)
|
||||
PHP_INI_ENTRY1("java.library", NULL, PHP_INI_SYSTEM, OnIniUpdate, &javalib)
|
||||
#endif
|
||||
PHP_INI_END()
|
||||
/* }}} */
|
||||
@@ -143,14 +141,7 @@ PHP_INI_END()
|
||||
void jvm_destroy(TSRMLS_D)
|
||||
{
|
||||
if (JG(php_reflect)) (*JG(jenv))->DeleteGlobalRef(JG(jenv), JG(php_reflect));
|
||||
if (JG(jvm)) {
|
||||
(*JG(jvm))->DetachCurrentThread(JG(jvm));
|
||||
(*JG(jvm))->DestroyJavaVM(JG(jvm));
|
||||
JG(jvm) = 0;
|
||||
}
|
||||
if (dl_handle) DL_UNLOAD(dl_handle);
|
||||
JG(php_reflect) = 0;
|
||||
JG(jenv) = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -196,14 +187,13 @@ static int jvm_create(TSRMLS_D)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
iniUpdated=0;
|
||||
|
||||
if (javalib) {
|
||||
dl_handle = DL_LOAD(javalib);
|
||||
|
||||
if (!dl_handle) {
|
||||
php_error(E_ERROR, "Unable to load Java Library %s, error: %s",
|
||||
javalib, DL_ERROR);
|
||||
javalib, DL_ERROR());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -452,7 +442,6 @@ void java_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_refe
|
||||
|
||||
getParametersArray(ht, arg_count, arguments);
|
||||
|
||||
if (iniUpdated && JG(jenv)) jvm_destroy(TSRMLS_C);
|
||||
if (!JG(jenv)) jvm_create(TSRMLS_C);
|
||||
if (!JG(jenv)) return;
|
||||
jenv = JG(jenv);
|
||||
@@ -854,7 +843,6 @@ JNIEXPORT void JNICALL Java_net_php_reflect_setEnv
|
||||
{
|
||||
jobject local_php_reflect;
|
||||
|
||||
iniUpdated=0;
|
||||
JG(jenv)=newJenv;
|
||||
|
||||
if (!self) self = (*JG(jenv))->FindClass(JG(jenv), "net/php/reflect");
|
||||
|
||||
+17
-1
@@ -55,6 +55,19 @@ if test "$PHP_LDAP" != "no"; then
|
||||
elif test -f $LDAP_LIBDIR/libldap.so.3; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libssldap50.so -o -f $LDAP_LIBDIR/libssldap50.sl; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
fi
|
||||
PHP_ADD_LIBRARY_WITH_PATH(nspr4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(plc4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(plds4, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ssldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(prldap50, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(ssl3, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_NSLDAP,1,[ ])
|
||||
|
||||
elif test -f $LDAP_LIBDIR/libldapssl41.so -o -f $LDAP_LIBDIR/libldapssl41.sl; then
|
||||
if test -n "$LDAP_PTHREAD"; then
|
||||
PHP_ADD_LIBRARY($LDAP_PTHREAD)
|
||||
@@ -86,7 +99,10 @@ if test "$PHP_LDAP" != "no"; then
|
||||
elif test -f $LDAP_LIBDIR/libclntsh.so; then
|
||||
PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_ORALDAP,1,[ ])
|
||||
fi
|
||||
|
||||
else
|
||||
AC_MSG_ERROR(Cannot find ldap libraries in $LDAP_LIBDIR.)
|
||||
fi
|
||||
|
||||
PHP_ADD_INCLUDE($LDAP_INCDIR)
|
||||
PHP_SUBST(LDAP_SHARED_LIBADD)
|
||||
|
||||
@@ -373,7 +373,7 @@ mbfl_filt_conv_wchar_2022kr(int c, mbfl_convert_filter *filter TSRMLS_DC)
|
||||
int
|
||||
mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter TSRMLS_DC)
|
||||
{
|
||||
int c1, w, flag;
|
||||
int c1, w, flag = 0;
|
||||
|
||||
switch (filter->status) {
|
||||
case 0:
|
||||
@@ -396,6 +396,7 @@ mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter TSRMLS_DC)
|
||||
if ( c1 >= 0x81 && c1 <= 0xa0){
|
||||
w = (c1 - 0x81)*190 + (c - 0x41);
|
||||
if (w >= 0 && w < uhc1_ucs_table_size) {
|
||||
flag = 1;
|
||||
w = uhc1_ucs_table[w];
|
||||
} else {
|
||||
w = 0;
|
||||
@@ -403,6 +404,7 @@ mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter TSRMLS_DC)
|
||||
} else if ( c1 >= 0xa1 && c1 <= 0xc6){
|
||||
w = (c1 - 0xa1)*190 + (c - 0x41);
|
||||
if (w >= 0 && w < uhc2_ucs_table_size) {
|
||||
flag = 2;
|
||||
w = uhc2_ucs_table[w];
|
||||
} else {
|
||||
w = 0;
|
||||
@@ -410,6 +412,7 @@ mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter TSRMLS_DC)
|
||||
} else if ( c1 >= 0xc7 && c1 <= 0xfe){
|
||||
w = (c1 - 0xc7)*94 + (c - 0xa1);
|
||||
if (w >= 0 && w < uhc3_ucs_table_size) {
|
||||
flag = 3;
|
||||
w = uhc3_ucs_table[w];
|
||||
} else {
|
||||
w = 0;
|
||||
|
||||
@@ -5,6 +5,8 @@ mb_split()
|
||||
extension_loaded('mbstring') or die('skip mbstring not available');
|
||||
function_exists('mb_split') or die("skip mb_split() is not available in this build");
|
||||
?>
|
||||
--INI--
|
||||
mbstring.func_overload=0
|
||||
--FILE--
|
||||
<?php
|
||||
mb_regex_set_options( '' );
|
||||
|
||||
+11
-3
@@ -182,6 +182,13 @@ ZEND_GET_MODULE(mcrypt)
|
||||
WRONG_PARAM_COUNT; \
|
||||
}
|
||||
|
||||
#define MCRYPT_CHECK_PARAM_COUNT_EX(a,b) \
|
||||
if (argc < (a) || argc > (b)) { \
|
||||
zend_get_parameters_ex(1, &mcryptind); \
|
||||
zend_list_delete (Z_LVAL_PP(mcryptind)); \
|
||||
WRONG_PARAM_COUNT; \
|
||||
}
|
||||
|
||||
#define MCRYPT_GET_CRYPT_ARGS \
|
||||
switch (argc) { \
|
||||
case 5: \
|
||||
@@ -455,7 +462,7 @@ PHP_FUNCTION(mcrypt_generic_init)
|
||||
int result = 0;
|
||||
|
||||
argc = ZEND_NUM_ARGS();
|
||||
MCRYPT_CHECK_PARAM_COUNT (3,3)
|
||||
MCRYPT_CHECK_PARAM_COUNT_EX (3,3)
|
||||
|
||||
zend_get_parameters_ex(3, &mcryptind, &key, &iv);
|
||||
ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt);
|
||||
@@ -530,7 +537,7 @@ PHP_FUNCTION(mcrypt_generic)
|
||||
int block_size, data_size;
|
||||
|
||||
argc = ZEND_NUM_ARGS();
|
||||
MCRYPT_CHECK_PARAM_COUNT (2,2)
|
||||
MCRYPT_CHECK_PARAM_COUNT_EX (2,2)
|
||||
|
||||
zend_get_parameters_ex(2, &mcryptind, &data);
|
||||
ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt);
|
||||
@@ -571,7 +578,7 @@ PHP_FUNCTION(mdecrypt_generic)
|
||||
int block_size, data_size;
|
||||
|
||||
argc = ZEND_NUM_ARGS();
|
||||
MCRYPT_CHECK_PARAM_COUNT (2,2)
|
||||
MCRYPT_CHECK_PARAM_COUNT_EX (2,2)
|
||||
|
||||
zend_get_parameters_ex(2, &mcryptind, &data);
|
||||
ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt);
|
||||
@@ -1463,6 +1470,7 @@ PHP_FUNCTION(mcrypt_create_iv)
|
||||
n = read_bytes;
|
||||
close(fd);
|
||||
if (n < size) {
|
||||
efree(iv);
|
||||
php_error(E_WARNING, "%s(): Could not gather sufficient random data", get_active_function_name(TSRMLS_C));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,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 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 libmcrypt.lib libltdl.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mcrypt.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mcrypt" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\TSRM\Release_TS_Inline"
|
||||
# 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 libmcrypt.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mcrypt.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mcrypt" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\TSRM\Release_TS_Inline"
|
||||
|
||||
!ELSEIF "$(CFG)" == "mcrypt - Win32 Debug_TS"
|
||||
|
||||
@@ -81,7 +81,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 php4ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS" /libpath:"mssql-70"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib libmcrypt.lib libltdl.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mcrypt.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mcrypt\lib"
|
||||
# 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 libmcrypt.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mcrypt.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mcrypt\lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #21039
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL);
|
||||
$nthash = "00000000000000000";
|
||||
$challenge = "foo";
|
||||
$td = mcrypt_module_open ('des', '', 'cbc', '');
|
||||
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
|
||||
$var = @mcrypt_generic_init ($td, substr($nthash, 0, 8));
|
||||
$res = @mcrypt_generic ($td, $challenge);
|
||||
print "I'm alive!\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
I'm alive!
|
||||
@@ -18,7 +18,8 @@ $supported_hash_al = array(
|
||||
"MHASH_HAVAL160" => "Ƴo‡uWi�¼´ò\"q”{ùË",
|
||||
"MHASH_RIPEMD160" => "lGCZ¡ÓYķƯF4Ÿ\x0C>XX=",
|
||||
"MHASH_GOST" => "\x0A%Rνõ|ñQGòU¶C)5»œ,Çâ�‹-ž",
|
||||
"MHASH_TIGER" => "•:Ãyš\x01¹ýë‘®«— ~g9\\»T0à\x0D",
|
||||
"MHASH_TIGER" => "ý¹šyÃ:•g~ —«®‘ë
|
||||
à0T»\9",
|
||||
"MHASH_CRC32" => "ƒ¸",
|
||||
"MHASH_CRC32B" => "¤·Zß"
|
||||
);
|
||||
|
||||
@@ -17,7 +17,7 @@ $supported_hash_al = array(
|
||||
"MHASH_HAVAL160" => "Öåðï\x07óúÌídní¶6GXìÞmÆû\x06\x1E\x00¤–õη#÷Ž¡5ˆM–‚\"míiÁ\x1D„1\$\x0Eù|X<O)Y;¿=Óʰ¸y.³Ø`\"Ê`\x02ëÐÙ´B™ Ô¯…¾Òµ©k>G¹¸ÊÉ\x19Á\x17~Ä\x0D~",
|
||||
"MHASH_RIPEMD160" => "äÕÛFšòŸxâ¹\x0DÇ5ÉÏ\x02\x0a\x1D[\x19¦gDXgw”ÔÜ¡DÔ&Åb¯ù�ކjŠ’B™ëö°êš7ù‡¡û]é¶GíÃ[\x14G`^\x1B«Ã\x08Kç “\x11\x17ë3C-ABâ%ß\x04K\x03??öK´¡†‚¤ù",
|
||||
"MHASH_GOST" => "ÀDöi½~†C•=wÆ‚ý\x17’BÙß\x15}øs¾M–\x01äd|\x01‚4h“Yç\"\x0A°I*b@Ñ„Äxc@sÞ¨y¾†ýN%d÷×\x09¶ŠFD\x0a\x12\x12Pà\x0FÇÕ}E©À~â:pOôŒ\x0DpwìR{\x19M‡",
|
||||
"MHASH_TIGER" => "Âó!Êåñ¥p+#’Á#�ýžéf6y©ÛÂó!Êåñ¥p+#’Á#�ýžéf6y©ÛÂó!Êåñ¥p+#’Á#�ýžéf6y©ÛÂó!Êåñ¥p+#’Á#�ýžéf6y©ÛÂó!Ê",
|
||||
�
|
||||
"MHASH_CRC32" => "H@Œ&_šYïèoQÅÒÐ1[Fq\"®\x08ÁÌÝfŸéVÈ8\x08ã¥EöîE<�¤�™M¼:Ⱥ…¥r„ðk*±HœÚu±è/}›ßÛh3iW»ñžJ?vu
|
||||
i…¥=ÕW\"�üó",
|
||||
"MHASH_CRC32B" => "µl«e¦>}û*©]¶F×›6\x13ŠbCÍË�. I¯\x0F–jœÎ¥0ÐÛ\x0D\x1F<˜Æ.Qyç–¾¶�tiý°xbØ\$}ƒ\x0Bõ˜È´“ ×ϬȌDÅDK…\x13é1uLðÝ6§¡`÷æÉ��|Ecñ\x04°",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Hartmut Holzgraefe <hartmut@six.de> |
|
||||
| Author: Hartmut Holzgraefe <hholzgra@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
|
||||
$Id$
|
||||
@@ -274,7 +274,7 @@ PHP_MINIT_FUNCTION(mime_magic)
|
||||
PHP_MSHUTDOWN_FUNCTION(mime_magic)
|
||||
{
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
if (mime_global.magic != NULL && (int)mime_global.magic != -1) {
|
||||
if (mime_global.magic != NULL && mime_global.magic != (struct magic *) -1) {
|
||||
struct magic *iter = mime_global.magic;
|
||||
while (iter != NULL) {
|
||||
struct magic *iter_next = iter->next;
|
||||
@@ -312,7 +312,7 @@ PHP_FUNCTION(mime_content_type)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((int) conf->magic == -1) {
|
||||
if (conf->magic == (struct magic *)-1) {
|
||||
php_error(E_ERROR, MODNAME " could not be initialized, magic file %s is not avaliable", conf->magicfile);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -358,7 +358,7 @@ static int apprentice(void)
|
||||
fname = conf->magicfile; /* todo cwd? */
|
||||
f = fopen(fname, "rb");
|
||||
if (f == NULL) {
|
||||
(int) conf->magic = -1;
|
||||
conf->magic = (struct magic *)-1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(mssql,for MSSQL support via FreeTDS,
|
||||
[ --with-mssql[=DIR] Include MSSQL-DB support. DIR is the FreeTDS home
|
||||
directory, defaults to /usr/local/freetds.])
|
||||
|
||||
|
||||
if test "$PHP_MSSQL" != "no"; then
|
||||
if test "$PHP_MSSQL" = "yes"; then
|
||||
MSSQL_INCDIR=/usr/local/freetds/include
|
||||
MSSQL_LIBDIR=/usr/local/freetds/lib
|
||||
else
|
||||
MSSQL_INCDIR=$PHP_MSSQL/include
|
||||
MSSQL_LIBDIR=$PHP_MSSQL/lib
|
||||
fi
|
||||
PHP_ADD_INCLUDE($MSSQL_INCDIR)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(sybdb, $MSSQL_LIBDIR, MSSQL_SHARED_LIBADD)
|
||||
PHP_NEW_EXTENSION(mssql, php_mssql.c, $ext_shared)
|
||||
AC_CHECK_LIB(dnet_stub, dnet_addr,
|
||||
[ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,MSSQL_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ])
|
||||
])
|
||||
AC_DEFINE(HAVE_MSSQL,1,[ ])
|
||||
AC_DEFINE(HAVE_FREETDS,1,[ ])
|
||||
fi
|
||||
+143
-127
@@ -146,7 +146,7 @@ static int php_mssql_error_handler(DBPROCESS *dbproc, int severity, int dberr, i
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (severity >= MS_SQL_G(min_error_severity)) {
|
||||
php_error(E_WARNING,"%s(): %s (severity %d)", get_active_function_name(TSRMLS_C), dberrstr, severity);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (severity %d)", dberrstr, severity);
|
||||
}
|
||||
return INT_CANCEL;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate
|
||||
TSRMLS_FETCH();
|
||||
|
||||
if (severity >= MS_SQL_G(min_message_severity)) {
|
||||
php_error(E_WARNING,"%s(): message: %s (severity %d)", get_active_function_name(TSRMLS_C), msgtext, severity);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "message: %s (severity %d)", msgtext, severity);
|
||||
}
|
||||
if (MS_SQL_G(server_message)) {
|
||||
STR_FREE(MS_SQL_G(server_message));
|
||||
@@ -376,7 +376,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
case 0: /* defaults */
|
||||
host=user=passwd=NULL;
|
||||
hashed_details_length=5+3;
|
||||
hashed_details = (char *) emalloc(hashed_details_length);
|
||||
hashed_details = (char *) emalloc(hashed_details_length+1);
|
||||
strcpy(hashed_details,"mssql___");
|
||||
break;
|
||||
case 1: {
|
||||
@@ -389,7 +389,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
host = Z_STRVAL_PP(yyhost);
|
||||
user=passwd=NULL;
|
||||
hashed_details_length = Z_STRLEN_PP(yyhost)+5+3;
|
||||
hashed_details = (char *) emalloc(hashed_details_length);
|
||||
hashed_details = (char *) emalloc(hashed_details_length+1);
|
||||
sprintf(hashed_details,"mssql_%s__",Z_STRVAL_PP(yyhost));
|
||||
}
|
||||
break;
|
||||
@@ -405,7 +405,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
user = Z_STRVAL_PP(yyuser);
|
||||
passwd=NULL;
|
||||
hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+5+3;
|
||||
hashed_details = (char *) emalloc(hashed_details_length);
|
||||
hashed_details = (char *) emalloc(hashed_details_length+1);
|
||||
sprintf(hashed_details,"mssql_%s_%s_",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser));
|
||||
}
|
||||
break;
|
||||
@@ -422,7 +422,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
user = Z_STRVAL_PP(yyuser);
|
||||
passwd = Z_STRVAL_PP(yypasswd);
|
||||
hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+5+3;
|
||||
hashed_details = (char *) emalloc(hashed_details_length);
|
||||
hashed_details = (char *) emalloc(hashed_details_length+1);
|
||||
sprintf(hashed_details,"mssql_%s_%s_%s",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd)); /* SAFE */
|
||||
}
|
||||
break;
|
||||
@@ -432,34 +432,40 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
}
|
||||
|
||||
if (hashed_details == NULL) {
|
||||
php_error(E_WARNING, "%s(): Out of memory", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* set a DBLOGIN record */
|
||||
if ((mssql.login = dblogin()) == NULL) {
|
||||
php_error(E_WARNING,"%s(): Unable to allocate login record", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate login record");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
dbprocerrhandle(mssql.login, (DBERRHANDLE_PROC) php_mssql_error_handler);
|
||||
dbprocmsghandle(mssql.login, (DBMSGHANDLE_PROC) php_mssql_message_handler);
|
||||
DBERRHANDLE(mssql.login, (EHANDLEFUNC) php_mssql_error_handler);
|
||||
DBMSGHANDLE(mssql.login, (MHANDLEFUNC) php_mssql_message_handler);
|
||||
|
||||
#ifndef HAVE_FREETDS
|
||||
if (MS_SQL_G(secure_connection) == 1){
|
||||
DBSETLSECURE(mssql.login);
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
if (user) {
|
||||
DBSETLUSER(mssql.login,user);
|
||||
}
|
||||
if (passwd) {
|
||||
DBSETLPWD(mssql.login,passwd);
|
||||
}
|
||||
#ifndef HAVE_FREETDS
|
||||
}
|
||||
#endif
|
||||
DBSETLAPP(mssql.login,MS_SQL_G(appname));
|
||||
mssql.valid = 1;
|
||||
|
||||
#ifndef HAVE_FREETDS
|
||||
DBSETLVERSION(mssql.login, DBVER60);
|
||||
#endif
|
||||
/* DBSETLTIME(mssql.login, TIMEOUT_INFINITE); */
|
||||
|
||||
if (!MS_SQL_G(allow_persistent)) {
|
||||
@@ -473,26 +479,26 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
list_entry new_le;
|
||||
|
||||
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
|
||||
php_error(E_WARNING,"%s(): Too many open links (%d)", get_active_function_name(TSRMLS_C), MS_SQL_G(num_links));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", MS_SQL_G(num_links));
|
||||
efree(hashed_details);
|
||||
dbfreelogin(mssql.login);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (MS_SQL_G(max_persistent) != -1 && MS_SQL_G(num_persistent) >= MS_SQL_G(max_persistent)) {
|
||||
php_error(E_WARNING,"%s(): Too many open persistent links (%d)", get_active_function_name(TSRMLS_C), MS_SQL_G(num_persistent));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%d)", MS_SQL_G(num_persistent));
|
||||
efree(hashed_details);
|
||||
dbfreelogin(mssql.login);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* create the link */
|
||||
if ((mssql.link = dbopen(mssql.login, host)) == FAIL) {
|
||||
php_error(E_WARNING,"%s(): Unable to connect to server: %s", get_active_function_name(TSRMLS_C), host);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", host);
|
||||
efree(hashed_details);
|
||||
dbfreelogin(mssql.login);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (dbsetopt(mssql.link, DBBUFFER, "2")==FAIL) {
|
||||
if (DBSETOPT(mssql.link, DBBUFFER, "2")==FAIL) {
|
||||
efree(hashed_details);
|
||||
dbfreelogin(mssql.login);
|
||||
dbclose(mssql.link);
|
||||
@@ -501,7 +507,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
|
||||
if (MS_SQL_G(textlimit) != -1) {
|
||||
sprintf(buffer, "%li", MS_SQL_G(textlimit));
|
||||
if (dbsetopt(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
|
||||
if (DBSETOPT(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
|
||||
efree(hashed_details);
|
||||
dbfreelogin(mssql.login);
|
||||
RETURN_FALSE;
|
||||
@@ -532,7 +538,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
#if BROKEN_MSSQL_PCONNECTS
|
||||
log_error("PHP/MS SQL: Hashed persistent link is not a MS SQL link!",php_rqst->server);
|
||||
#endif
|
||||
php_error(E_WARNING, "%s(): Hashed persistent link is not a MS SQL link!", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Hashed persistent link is not a MS SQL link!");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -546,7 +552,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
#if BROKEN_MSSQL_PCONNECTS
|
||||
log_error("PHP/MS SQL: Unable to reconnect!",php_rqst->server);
|
||||
#endif
|
||||
php_error(E_WARNING, "%s(): Link to server lost, unable to reconnect", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect");
|
||||
zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1);
|
||||
efree(hashed_details);
|
||||
RETURN_FALSE;
|
||||
@@ -554,7 +560,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
#if BROKEN_MSSQL_PCONNECTS
|
||||
log_error("PHP/MS SQL: Reconnect successful!",php_rqst->server);
|
||||
#endif
|
||||
if (dbsetopt(mssql_ptr->link, DBBUFFER, "2")==FAIL) {
|
||||
if (DBSETOPT(mssql_ptr->link, DBBUFFER, "2")==FAIL) {
|
||||
#if BROKEN_MSSQL_PCONNECTS
|
||||
log_error("PHP/MS SQL: Unable to set required options",php_rqst->server);
|
||||
#endif
|
||||
@@ -594,18 +600,18 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
}
|
||||
}
|
||||
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
|
||||
php_error(E_WARNING,"%s(): Too many open links (%d)", get_active_function_name(TSRMLS_C), MS_SQL_G(num_links));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", MS_SQL_G(num_links));
|
||||
efree(hashed_details);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if ((mssql.link=dbopen(mssql.login, host))==NULL) {
|
||||
php_error(E_WARNING,"%s(): Unable to connect to server: %s", get_active_function_name(TSRMLS_C), host);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", host);
|
||||
efree(hashed_details);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (dbsetopt(mssql.link, DBBUFFER,"2")==FAIL) {
|
||||
if (DBSETOPT(mssql.link, DBBUFFER,"2")==FAIL) {
|
||||
efree(hashed_details);
|
||||
dbfreelogin(mssql.login);
|
||||
dbclose(mssql.link);
|
||||
@@ -614,7 +620,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
|
||||
if (MS_SQL_G(textlimit) != -1) {
|
||||
sprintf(buffer, "%li", MS_SQL_G(textlimit));
|
||||
if (dbsetopt(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
|
||||
if (DBSETOPT(mssql.link, DBTEXTLIMIT, buffer)==FAIL) {
|
||||
efree(hashed_details);
|
||||
dbfreelogin(mssql.login);
|
||||
RETURN_FALSE;
|
||||
@@ -740,7 +746,7 @@ PHP_FUNCTION(mssql_select_db)
|
||||
convert_to_string_ex(db);
|
||||
|
||||
if (dbuse(mssql_ptr->link, Z_STRVAL_PP(db))==FAIL) {
|
||||
php_error(E_WARNING, "%s(): Unable to select database: %s", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(db));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to select database: %s", Z_STRVAL_PP(db));
|
||||
RETURN_FALSE;
|
||||
} else {
|
||||
RETURN_TRUE;
|
||||
@@ -796,7 +802,7 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
|
||||
unsigned char *res_buf;
|
||||
int res_length = dbdatlen(mssql_ptr->link, offset);
|
||||
|
||||
res_buf = (unsigned char *) emalloc(res_length);
|
||||
res_buf = (unsigned char *) emalloc(res_length+1);
|
||||
bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset));
|
||||
memcpy(res_buf,bin,res_length);
|
||||
res_buf[res_length] = '\0';
|
||||
@@ -817,13 +823,13 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
|
||||
if (column_type == SQLDATETIM4) res_length += 14;
|
||||
if (column_type == SQLDATETIME) res_length += 10;
|
||||
|
||||
res_buf = (unsigned char *) emalloc(res_length);
|
||||
res_buf = (unsigned char *) emalloc(res_length+1);
|
||||
res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1);
|
||||
} else {
|
||||
dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset));
|
||||
|
||||
res_length = 19;
|
||||
res_buf = (unsigned char *) emalloc(res_length);
|
||||
res_buf = (unsigned char *) emalloc(res_length+1);
|
||||
sprintf(res_buf, "%d-%02d-%02d %02d:%02d:%02d" , dateinfo.year, dateinfo.month, dateinfo.day, dateinfo.hour, dateinfo.minute, dateinfo.second);
|
||||
}
|
||||
|
||||
@@ -831,14 +837,14 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
|
||||
Z_STRLEN_P(result) = res_length;
|
||||
Z_TYPE_P(result) = IS_STRING;
|
||||
} else {
|
||||
php_error(E_WARNING, "%s(): column %d has unknown data type (%d)", get_active_function_name(TSRMLS_C), offset, coltype(offset));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
|
||||
ZVAL_FALSE(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC)
|
||||
static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC)
|
||||
{
|
||||
if (dbdatlen(mssql_ptr->link,offset) == 0) {
|
||||
ZVAL_NULL(result);
|
||||
@@ -852,7 +858,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
|
||||
unsigned char *res_buf;
|
||||
int res_length = dbdatlen(mssql_ptr->link, offset);
|
||||
|
||||
res_buf = (unsigned char *) emalloc(res_length);
|
||||
res_buf = (unsigned char *) emalloc(res_length+1);
|
||||
bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset));
|
||||
memcpy(res_buf, bin, res_length);
|
||||
res_buf[res_length] = '\0';
|
||||
@@ -870,14 +876,14 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
|
||||
if (column_type == SQLDATETIM4) res_length += 14;
|
||||
if (column_type == SQLDATETIME) res_length += 10;
|
||||
|
||||
res_buf = (unsigned char *) emalloc(res_length);
|
||||
res_buf = (unsigned char *) emalloc(res_length+1);
|
||||
res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR, res_buf, -1);
|
||||
|
||||
} else {
|
||||
dbdatecrack(mssql_ptr->link, &dateinfo, (DBDATETIME *) dbdata(mssql_ptr->link,offset));
|
||||
|
||||
res_length = 19;
|
||||
res_buf = (unsigned char *) emalloc(res_length);
|
||||
res_buf = (unsigned char *) emalloc(res_length+1);
|
||||
sprintf(res_buf, "%d-%02d-%02d %02d:%02d:%02d" , dateinfo.year, dateinfo.month, dateinfo.day, dateinfo.hour, dateinfo.minute, dateinfo.second);
|
||||
}
|
||||
|
||||
@@ -885,11 +891,70 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
|
||||
Z_STRLEN_P(result) = res_length;
|
||||
Z_TYPE_P(result) = IS_STRING;
|
||||
} else {
|
||||
php_error(E_WARNING, "%s(): column %d has unknown data type (%d)", get_active_function_name(TSRMLS_C), offset, coltype(offset));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset));
|
||||
ZVAL_FALSE(result);
|
||||
}
|
||||
}
|
||||
|
||||
static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *statement TSRMLS_DC)
|
||||
{
|
||||
int i, num_rets, type;
|
||||
char *parameter;
|
||||
mssql_bind *bind;
|
||||
|
||||
/* Now to fetch RETVAL and OUTPUT values*/
|
||||
num_rets = dbnumrets(mssql_ptr->link);
|
||||
|
||||
if (num_rets!=0) {
|
||||
for (i = 1; i <= num_rets; i++) {
|
||||
parameter = (char*)dbretname(mssql_ptr->link, i);
|
||||
type = dbrettype(mssql_ptr->link, i);
|
||||
|
||||
if (statement->binds!=NULL ) { /* Maybe a non-parameter sp */
|
||||
if (zend_hash_find(statement->binds, parameter, strlen(parameter), (void**)&bind)==SUCCESS) {
|
||||
switch (type) {
|
||||
case SQLBIT:
|
||||
case SQLINT1:
|
||||
case SQLINT2:
|
||||
case SQLINT4:
|
||||
convert_to_long_ex(&bind->zval);
|
||||
Z_LVAL_P(bind->zval) = *((int *)(dbretdata(mssql_ptr->link,i)));
|
||||
break;
|
||||
|
||||
case SQLFLT8:
|
||||
case SQLFLTN:
|
||||
convert_to_double_ex(&bind->zval);
|
||||
Z_DVAL_P(bind->zval) = *((double *)(dbretdata(mssql_ptr->link,i)));
|
||||
break;
|
||||
|
||||
case SQLCHAR:
|
||||
case SQLVARCHAR:
|
||||
case SQLTEXT:
|
||||
convert_to_string_ex(&bind->zval);
|
||||
Z_STRLEN_P(bind->zval) = dbretlen(mssql_ptr->link,i);
|
||||
Z_STRVAL_P(bind->zval) = estrndup(dbretdata(mssql_ptr->link,i),Z_STRLEN_P(bind->zval));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An output parameter variable was not provided");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (statement->binds!=NULL ) { /* Maybe a non-parameter sp */
|
||||
if (zend_hash_find(statement->binds, "RETVAL", 6, (void**)&bind)==SUCCESS) {
|
||||
if (dbhasretstat(mssql_ptr->link)) {
|
||||
convert_to_long_ex(&bind->zval);
|
||||
Z_LVAL_P(bind->zval)=dbretstatus(mssql_ptr->link);
|
||||
}
|
||||
else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure has no return value. Nothing was returned into RETVAL");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue TSRMLS_DC)
|
||||
{
|
||||
int i, j = 0;
|
||||
@@ -1036,11 +1101,11 @@ PHP_FUNCTION(mssql_query)
|
||||
convert_to_string_ex(query);
|
||||
|
||||
if (dbcmd(mssql_ptr->link, Z_STRVAL_PP(query))==FAIL) {
|
||||
php_error(E_WARNING, "%s(): Unable to set query", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set query");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (dbsqlexec(mssql_ptr->link)==FAIL || dbresults(mssql_ptr->link)==FAIL) {
|
||||
php_error(E_WARNING, "%s(): Query failed", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1049,17 +1114,21 @@ PHP_FUNCTION(mssql_query)
|
||||
* 1) Being able to fire up another query without explicitly reading all rows
|
||||
* 2) Having numrows accessible
|
||||
*/
|
||||
retvalue=dbnextrow(mssql_ptr->link);
|
||||
|
||||
#ifdef HAVE_FREETDS
|
||||
if ((num_fields = dbnumcols(mssql_ptr->link)) <= 0) {
|
||||
#else
|
||||
if ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 && !dbdataready(mssql_ptr->link)) {
|
||||
#endif
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
retvalue=dbnextrow(mssql_ptr->link);
|
||||
if (retvalue==FAIL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if ((num_fields = dbnumcols(mssql_ptr->link)) <= 0 && !dbdataready(mssql_ptr->link)) {
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
result = (mssql_result *) emalloc(sizeof(mssql_result));
|
||||
result->statement = NULL;
|
||||
result->num_fields = num_fields;
|
||||
result->blocks_initialized = 1;
|
||||
|
||||
@@ -1073,6 +1142,8 @@ PHP_FUNCTION(mssql_query)
|
||||
result->fields = (mssql_field *) emalloc(sizeof(mssql_field)*result->num_fields);
|
||||
result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
|
||||
}
|
||||
else
|
||||
result->fields = NULL;
|
||||
|
||||
ZEND_REGISTER_RESOURCE(return_value, result, le_result);
|
||||
}
|
||||
@@ -1111,6 +1182,10 @@ PHP_FUNCTION(mssql_free_result)
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(result, mssql_result *, mssql_result_index, -1, "MS SQL-result", le_result);
|
||||
#ifndef HAVE_FREETDS
|
||||
if (dbdataready(result->mssql_ptr->link))
|
||||
dbresults(result->mssql_ptr->link);
|
||||
#endif
|
||||
zend_list_delete(Z_LVAL_PP(mssql_result_index));
|
||||
RETURN_TRUE;
|
||||
}
|
||||
@@ -1318,7 +1393,7 @@ PHP_FUNCTION(mssql_data_seek)
|
||||
|
||||
convert_to_long_ex(offset);
|
||||
if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=result->num_rows) {
|
||||
php_error(E_WARNING, "%s(): Bad row offset", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1414,7 +1489,7 @@ PHP_FUNCTION(mssql_fetch_field)
|
||||
|
||||
if (field_offset<0 || field_offset >= result->num_fields) {
|
||||
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
|
||||
php_error(E_WARNING, "%s(): Bad column offset", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -1467,7 +1542,7 @@ PHP_FUNCTION(mssql_field_length)
|
||||
|
||||
if (field_offset<0 || field_offset >= result->num_fields) {
|
||||
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
|
||||
php_error(E_WARNING, "%s(): Bad column offset", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -1514,7 +1589,7 @@ PHP_FUNCTION(mssql_field_name)
|
||||
|
||||
if (field_offset<0 || field_offset >= result->num_fields) {
|
||||
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
|
||||
php_error(E_WARNING, "%s(): Bad column offset", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -1562,7 +1637,7 @@ PHP_FUNCTION(mssql_field_type)
|
||||
|
||||
if (field_offset<0 || field_offset >= result->num_fields) {
|
||||
if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */
|
||||
php_error(E_WARNING, "%s(): Bad column offset", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -1592,7 +1667,7 @@ PHP_FUNCTION(mssql_field_seek)
|
||||
field_offset = Z_LVAL_PP(offset);
|
||||
|
||||
if (field_offset<0 || field_offset >= result->num_fields) {
|
||||
php_error(E_WARNING, "%s(): Bad column offset", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1618,7 +1693,7 @@ PHP_FUNCTION(mssql_result)
|
||||
|
||||
convert_to_long_ex(row);
|
||||
if (Z_LVAL_PP(row) < 0 || Z_LVAL_PP(row) >= result->num_rows) {
|
||||
php_error(E_WARNING, "%s(): Bad row offset (%d)", get_active_function_name(TSRMLS_C), Z_LVAL_PP(row));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset (%d)", Z_LVAL_PP(row));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1633,7 +1708,7 @@ PHP_FUNCTION(mssql_result)
|
||||
}
|
||||
}
|
||||
if (i>=result->num_fields) { /* no match found */
|
||||
php_error(E_WARNING,"%s(): %s field not found in result", get_active_function_name(TSRMLS_C), Z_STRVAL_PP(field));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s field not found in result", Z_STRVAL_PP(field));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
break;
|
||||
@@ -1642,7 +1717,7 @@ PHP_FUNCTION(mssql_result)
|
||||
convert_to_long_ex(field);
|
||||
field_offset = Z_LVAL_PP(field);
|
||||
if (field_offset<0 || field_offset>=result->num_fields) {
|
||||
php_error(E_WARNING, "%s(): Bad column offset specified", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
break;
|
||||
@@ -1670,7 +1745,13 @@ PHP_FUNCTION(mssql_next_result)
|
||||
|
||||
mssql_ptr = result->mssql_ptr;
|
||||
retvalue = dbresults(mssql_ptr->link);
|
||||
if (retvalue == FAIL || retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS) {
|
||||
if (retvalue == FAIL) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
else if (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS) {
|
||||
if (result->statement) {
|
||||
_mssql_get_sp_result(result->mssql_ptr, result->statement TSRMLS_CC);
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
else {
|
||||
@@ -1753,7 +1834,7 @@ PHP_FUNCTION(mssql_init)
|
||||
convert_to_string_ex(sp_name);
|
||||
|
||||
if (dbrpcinit(mssql_ptr->link, Z_STRVAL_PP(sp_name),0)==FAIL) {
|
||||
php_error(E_WARNING, "%s(): unable to init stored procedure", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to init stored procedure");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1765,7 +1846,7 @@ PHP_FUNCTION(mssql_init)
|
||||
statement->executed=FALSE;
|
||||
}
|
||||
else {
|
||||
php_error(E_WARNING, "%s(): unable to allocate statement", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to allocate statement");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1902,7 +1983,7 @@ PHP_FUNCTION(mssql_bind)
|
||||
break;
|
||||
|
||||
default:
|
||||
php_error(E_WARNING, "%s(): unsupported type", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported type");
|
||||
RETURN_FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -1927,8 +2008,8 @@ PHP_FUNCTION(mssql_bind)
|
||||
|
||||
/* no call to dbrpcparam if RETVAL */
|
||||
if ( strcmp("RETVAL",Z_STRVAL_PP(param_name))!=0 ) {
|
||||
if (dbrpcparam(mssql_ptr->link, Z_STRVAL_PP(param_name), (BYTE)status, type, maxlen, datalen, (LPCBYTE)value)==FAIL) {
|
||||
php_error(E_WARNING, "%s(): Unable to set parameter", get_active_function_name(TSRMLS_C));
|
||||
if (dbrpcparam(mssql_ptr->link, Z_STRVAL_PP(param_name), (BYTE)status, type, maxlen, datalen, (LPBYTE)value)==FAIL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set parameter");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
@@ -1945,14 +2026,11 @@ PHP_FUNCTION(mssql_execute)
|
||||
int retvalue,retval_results;
|
||||
mssql_link *mssql_ptr;
|
||||
mssql_statement *statement;
|
||||
mssql_bind *bind;
|
||||
mssql_result *result;
|
||||
int num_fields,num_rets,type;
|
||||
int num_fields;
|
||||
int blocks_initialized=1;
|
||||
int i;
|
||||
int batchsize;
|
||||
int ac = ZEND_NUM_ARGS();
|
||||
char *parameter;
|
||||
|
||||
batchsize = MS_SQL_G(batchsize);
|
||||
if (ac !=1 || zend_get_parameters_ex(1, &stmt)==FAILURE) {
|
||||
@@ -1964,14 +2042,14 @@ PHP_FUNCTION(mssql_execute)
|
||||
mssql_ptr=statement->link;
|
||||
|
||||
if (dbrpcexec(mssql_ptr->link)==FAIL || dbsqlok(mssql_ptr->link)==FAIL) {
|
||||
php_error(E_WARNING, "%s(): stored procedure execution failed.", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure execution failed");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
retval_results=dbresults(mssql_ptr->link);
|
||||
|
||||
if (retval_results==FAIL) {
|
||||
php_error(E_WARNING, "%s(): could not retrieve results", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not retrieve results");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1989,7 +2067,6 @@ PHP_FUNCTION(mssql_execute)
|
||||
}
|
||||
|
||||
result = (mssql_result *) emalloc(sizeof(mssql_result));
|
||||
|
||||
result->batchsize = batchsize;
|
||||
result->blocks_initialized = 1;
|
||||
result->data = (zval **) emalloc(sizeof(zval *)*MSSQL_ROWS_BLOCK);
|
||||
@@ -1999,74 +2076,13 @@ PHP_FUNCTION(mssql_execute)
|
||||
|
||||
result->fields = (mssql_field *) emalloc(sizeof(mssql_field)*num_fields);
|
||||
result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC);
|
||||
result->statement = statement;
|
||||
}
|
||||
retval_results=dbresults(mssql_ptr->link);
|
||||
}
|
||||
else if (retval_results==NO_MORE_RESULTS) {
|
||||
_mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC);
|
||||
}
|
||||
|
||||
if (retval_results==SUCCEED) {
|
||||
php_error(E_WARNING, "%s(): multiple recordsets from a stored procedure not supported yet! (Skipping...)", get_active_function_name(TSRMLS_C));
|
||||
retval_results=dbresults(mssql_ptr->link);
|
||||
|
||||
while (retval_results==SUCCEED) {
|
||||
retval_results=dbresults(mssql_ptr->link);
|
||||
}
|
||||
}
|
||||
|
||||
if (retval_results==NO_MORE_RESULTS) {
|
||||
/* Now to fetch RETVAL and OUTPUT values*/
|
||||
num_rets = dbnumrets(mssql_ptr->link);
|
||||
|
||||
if (num_rets!=0) {
|
||||
for (i = 1; i <= num_rets; i++) {
|
||||
parameter=(char*)dbretname(mssql_ptr->link, i);
|
||||
type=dbrettype(mssql_ptr->link, i);
|
||||
|
||||
if (statement->binds!=NULL ) { /* Maybe a non-parameter sp */
|
||||
if (zend_hash_find(statement->binds, parameter, strlen(parameter), (void**)&bind)==SUCCESS) {
|
||||
switch (type) {
|
||||
case SQLBIT:
|
||||
case SQLINT1:
|
||||
case SQLINT2:
|
||||
case SQLINT4:
|
||||
convert_to_long_ex(&bind->zval);
|
||||
Z_LVAL_P(bind->zval)=*((int *)(dbretdata(mssql_ptr->link,i)));
|
||||
break;
|
||||
|
||||
case SQLFLT8:
|
||||
case SQLFLTN:
|
||||
convert_to_double_ex(&bind->zval);
|
||||
Z_DVAL_P(bind->zval)=*((double *)(dbretdata(mssql_ptr->link,i)));
|
||||
break;
|
||||
|
||||
case SQLCHAR:
|
||||
case SQLVARCHAR:
|
||||
case SQLTEXT:
|
||||
convert_to_string_ex(&bind->zval);
|
||||
Z_STRLEN_P(bind->zval)=dbretlen(mssql_ptr->link,i);
|
||||
Z_STRVAL_P(bind->zval) = estrndup(dbretdata(mssql_ptr->link,i),Z_STRLEN_P(bind->zval));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
php_error(E_WARNING, "%s(): an output parameter variable was not provided", get_active_function_name(TSRMLS_C));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (statement->binds!=NULL ) { /* Maybe a non-parameter sp */
|
||||
if (zend_hash_find(statement->binds, "RETVAL", 6, (void**)&bind)==SUCCESS) {
|
||||
if (dbhasretstat(mssql_ptr->link)) {
|
||||
convert_to_long_ex(&bind->zval);
|
||||
Z_LVAL_P(bind->zval)=dbretstatus(mssql_ptr->link);
|
||||
}
|
||||
else {
|
||||
php_error(E_WARNING, "%s(): stored procedure has no return value. Nothing was returned into RETVAL", get_active_function_name(TSRMLS_C));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result==NULL) {
|
||||
RETURN_TRUE; /* no recordset returned ...*/
|
||||
}
|
||||
|
||||
+42
-2
@@ -24,6 +24,7 @@
|
||||
|
||||
|
||||
#if HAVE_MSSQL
|
||||
#define MSDBLIB
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_MSSQL_API __declspec(dllexport)
|
||||
#else
|
||||
@@ -35,14 +36,52 @@
|
||||
#include "sqlfront.h"
|
||||
#include "sqldb.h"
|
||||
|
||||
#if HAVE_FREETDS
|
||||
#define SQLTEXT SYBTEXT
|
||||
#define SQLCHAR SYBCHAR
|
||||
#define SQLVARCHAR SYBVARCHAR
|
||||
#define SQLINT1 SYBINT1
|
||||
#define SQLINT2 SYBINT2
|
||||
#define SQLINT4 SYBINT4
|
||||
#define SQLINTN SYBINTN
|
||||
#define SQLBIT SYBBIT
|
||||
#define SQLFLT4 SYBREAL
|
||||
#define SQLFLT8 SYBFLT8
|
||||
#define SQLFLTN SYBFLTN
|
||||
#define SQLDECIMAL SYBDECIMAL
|
||||
#define SQLNUMERIC SYBNUMERIC
|
||||
#define SQLDATETIME SYBDATETIME
|
||||
#define SQLDATETIM4 SYBDATETIME4
|
||||
#define SQLDATETIMN SYBDATETIMN
|
||||
#define SQLMONEY SYBMONEY
|
||||
#define SQLMONEY4 SYBMONEY4
|
||||
#define SQLMONEYN SYBMONEYN
|
||||
#define SQLIMAGE SYBIMAGE
|
||||
#define SQLBINARY SYBBINARY
|
||||
#define SQLVARBINARY SYBVARBINARY
|
||||
#define DBERRHANDLE(a, b) dberrhandle(b)
|
||||
#define DBMSGHANDLE(a, b) dbmsghandle(b)
|
||||
#define DBSETOPT(a, b, c) dbsetopt(a, b, c, -1)
|
||||
#define NO_MORE_RPC_RESULTS 3
|
||||
#define dbfreelogin dbloginfree
|
||||
#define dbrpcexec dbrpcsend
|
||||
typedef unsigned char *LPBYTE;
|
||||
#else
|
||||
#define DBERRHANDLE(a, b) dbprocerrhandle(a, b)
|
||||
#define DBMSGHANDLE(a, b) dbprocmsghandle(a, b)
|
||||
#define EHANDLEFUNC DBERRHANDLE_PROC
|
||||
#define MHANDLEFUNC DBMSGHANDLE_PROC
|
||||
#define DBSETOPT(a, b, c) dbsetopt(a, b, c)
|
||||
#endif
|
||||
|
||||
#define coltype(j) dbcoltype(mssql_ptr->link,j)
|
||||
#define intcol(i) ((int) *(DBINT *) dbdata(mssql_ptr->link,i))
|
||||
#define smallintcol(i) ((int) *(DBSMALLINT *) dbdata(mssql_ptr->link,i))
|
||||
#define tinyintcol(i) ((int) *(DBTINYINT *) dbdata(mssql_ptr->link,i))
|
||||
#define anyintcol(j) (coltype(j)==SQLINT4?intcol(j):(coltype(j)==SQLINT2?smallintcol(j):tinyintcol(j)))
|
||||
#define charcol(i) ((DBCHAR *) dbdata(mssql_ptr->link,i))
|
||||
#define floatcol4(i) ((float) *(DBFLT4 *) dbdata(mssql_ptr->link,i))
|
||||
#define floatcol8(i) ((float) *(DBFLT8 *) dbdata(mssql_ptr->link,i))
|
||||
#define floatcol4(i) (*(DBFLT8 *) dbdata(mssql_ptr->link,i))
|
||||
#define floatcol8(i) (*(DBFLT8 *) dbdata(mssql_ptr->link,i))
|
||||
|
||||
#ifdef ZTS
|
||||
#include "TSRM.h"
|
||||
@@ -137,6 +176,7 @@ typedef struct mssql_result {
|
||||
pval **data;
|
||||
mssql_field *fields;
|
||||
mssql_link *mssql_ptr;
|
||||
mssql_statement * statement;
|
||||
int batchsize;
|
||||
int lastresult;
|
||||
int blocks_initialized;
|
||||
|
||||
@@ -227,7 +227,8 @@ dnl Find type of qsort
|
||||
AC_DEFUN(MYSQL_TYPE_QSORT,
|
||||
[AC_CACHE_CHECK([return type of qsort], mysql_cv_type_qsort,
|
||||
[AC_TRY_COMPILE([#include <stdlib.h>
|
||||
#ifdef __cplusplus extern "C"
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
void qsort(void *base, size_t nel, size_t width,
|
||||
int (*compar) (const void *, const void *));
|
||||
@@ -237,7 +238,8 @@ AC_DEFINE_UNQUOTED(RETQSORTTYPE, $mysql_cv_type_qsort, [ ])
|
||||
if test "$mysql_cv_type_qsort" = "void"
|
||||
then
|
||||
AC_DEFINE_UNQUOTED(QSORT_TYPE_IS_VOID, 1, [ ])
|
||||
fi ])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
#---START: Used in for client configure
|
||||
|
||||
@@ -872,7 +872,7 @@ static MYSQL_DATA *read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
|
||||
uint field,pkt_len;
|
||||
ulong len;
|
||||
uchar *cp;
|
||||
char *to;
|
||||
char *to, *end_to;
|
||||
MYSQL_DATA *result;
|
||||
MYSQL_ROWS **prev_ptr,*cur;
|
||||
NET *net = &mysql->net;
|
||||
@@ -910,6 +910,7 @@ static MYSQL_DATA *read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
|
||||
*prev_ptr=cur;
|
||||
prev_ptr= &cur->next;
|
||||
to= (char*) (cur->data+fields+1);
|
||||
end_to = to + pkt_len - 1;
|
||||
for (field=0 ; field < fields ; field++)
|
||||
{
|
||||
if ((len=(ulong) net_field_length(&cp)) == NULL_LENGTH)
|
||||
@@ -919,6 +920,13 @@ static MYSQL_DATA *read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
|
||||
else
|
||||
{
|
||||
cur->data[field] = to;
|
||||
if (len > end_to - to)
|
||||
{
|
||||
free_rows(result);
|
||||
net->last_errno = CR_UNKNOWN_ERROR;
|
||||
strmov(net->last_error, ER(net->last_errno));
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
memcpy(to,(char*) cp,len); to[len]=0;
|
||||
to+=len+1;
|
||||
cp+=len;
|
||||
@@ -953,7 +961,7 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
|
||||
{
|
||||
uint field;
|
||||
ulong pkt_len,len;
|
||||
uchar *pos,*prev_pos;
|
||||
uchar *pos,*prev_pos,*end_pos;
|
||||
|
||||
if ((pkt_len=(uint) net_safe_read(mysql)) == packet_error)
|
||||
return -1;
|
||||
@@ -961,6 +969,7 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
|
||||
return 1; /* End of data */
|
||||
prev_pos= 0; /* allowed to write at packet[-1] */
|
||||
pos=mysql->net.read_pos;
|
||||
end_pos=pos+pkt_len;
|
||||
for (field=0 ; field < fields ; field++)
|
||||
{
|
||||
if ((len=(ulong) net_field_length(&pos)) == NULL_LENGTH)
|
||||
@@ -970,6 +979,12 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (len > end_pos - pos)
|
||||
{
|
||||
mysql->net.last_errno=CR_UNKNOWN_ERROR;
|
||||
strmov(mysql->net.last_error, ER(mysql->net.last_errno));
|
||||
return -1;
|
||||
}
|
||||
row[field] = (char*) pos;
|
||||
pos+=len;
|
||||
*lengths++=len;
|
||||
|
||||
+10
-14
@@ -663,7 +663,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
/* ensure that the link did not die */
|
||||
#if MYSQL_VERSION_ID > 32230 /* Use mysql_ping to ensure link is alive (and to reconnect if needed) */
|
||||
if (mysql_ping(le->ptr)) {
|
||||
php_error(E_WARNING, "%s: Link to server lost, unable to reconnect", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect");
|
||||
zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1);
|
||||
efree(hashed_details);
|
||||
MYSQL_DO_CONNECT_RETURN_FALSE();
|
||||
@@ -682,7 +682,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
#else
|
||||
if (mysql_connect(le->ptr, host, user, passwd)==NULL) {
|
||||
#endif
|
||||
php_error(E_WARNING, "%s: Link to server lost, unable to reconnect", get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect");
|
||||
zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1);
|
||||
efree(hashed_details);
|
||||
MYSQL_DO_CONNECT_RETURN_FALSE();
|
||||
@@ -889,7 +889,7 @@ PHP_FUNCTION(mysql_get_client_info)
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
RETURN_STRING(mysql_get_client_info(),1);
|
||||
RETURN_STRING((char *)mysql_get_client_info(),1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -919,7 +919,7 @@ PHP_FUNCTION(mysql_get_host_info)
|
||||
|
||||
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink);
|
||||
|
||||
RETURN_STRING(mysql_get_host_info(&mysql->conn),1);
|
||||
RETURN_STRING((char *)mysql_get_host_info(&mysql->conn),1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -979,7 +979,7 @@ PHP_FUNCTION(mysql_get_server_info)
|
||||
|
||||
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink);
|
||||
|
||||
RETURN_STRING(mysql_get_server_info(&mysql->conn),1);
|
||||
RETURN_STRING((char *)mysql_get_server_info(&mysql->conn),1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -988,7 +988,7 @@ PHP_FUNCTION(mysql_get_server_info)
|
||||
PHP_FUNCTION(mysql_info)
|
||||
{
|
||||
zval **mysql_link;
|
||||
int id;
|
||||
int id = -1;
|
||||
char *str;
|
||||
php_mysql_conn *mysql;
|
||||
|
||||
@@ -1003,7 +1003,7 @@ PHP_FUNCTION(mysql_info)
|
||||
|
||||
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink);
|
||||
|
||||
if ((str = mysql_info(&mysql->conn))) {
|
||||
if ((str = (char *)mysql_info(&mysql->conn))) {
|
||||
RETURN_STRING(str,1);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
@@ -1051,7 +1051,7 @@ PHP_FUNCTION(mysql_stat)
|
||||
}
|
||||
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink);
|
||||
|
||||
RETURN_STRING(mysql_stat(&mysql->conn), 1);
|
||||
RETURN_STRING((char *)mysql_stat(&mysql->conn), 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1192,8 +1192,7 @@ static void php_mysql_do_query_general(zval **query, zval **mysql_link, int link
|
||||
mysql_result = (MYSQL_RES *) zend_list_find(mysql->active_result_id, &type);
|
||||
if (mysql_result && type==le_result) {
|
||||
if (!mysql_eof(mysql_result)) {
|
||||
php_error(E_NOTICE, "%s(): Function called without first fetching all rows from a previous unbuffered query",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s(): Function called without first fetching all rows from a previous unbuffered query");
|
||||
while (mysql_fetch_row(mysql_result));
|
||||
}
|
||||
zend_list_delete(mysql->active_result_id);
|
||||
@@ -1543,7 +1542,7 @@ PHP_FUNCTION(mysql_error)
|
||||
|
||||
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, id, "MySQL-Link", le_link, le_plink);
|
||||
|
||||
RETURN_STRING(mysql_error(&mysql->conn), 1);
|
||||
RETURN_STRING((char *)mysql_error(&mysql->conn), 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1858,7 +1857,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
|
||||
MYSQL_ROW mysql_row;
|
||||
MYSQL_FIELD *mysql_field;
|
||||
mysql_row_length_type *mysql_row_lengths;
|
||||
int num_fields;
|
||||
int i;
|
||||
|
||||
if (ZEND_NUM_ARGS() > expected_args) {
|
||||
@@ -1893,8 +1891,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
num_fields = mysql_num_fields(mysql_result);
|
||||
|
||||
if (array_init(return_value)==FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
ncurses
|
||||
Hartmut Holzgraefe
|
||||
Ilia Alshanetsky, Wez Furlong, Hartmut Holzgraefe, Georg Richter
|
||||
+185
-179
@@ -35,10 +35,10 @@ int le_ncurses_panels;
|
||||
|
||||
static void ncurses_destruct_window(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
{
|
||||
WINDOW **pwin = (WINDOW **)rsrc->ptr;
|
||||
WINDOW **pwin = (WINDOW **)rsrc->ptr;
|
||||
|
||||
delwin(*pwin);
|
||||
efree(pwin);
|
||||
delwin(*pwin);
|
||||
efree(pwin);
|
||||
}
|
||||
|
||||
#if HAVE_NCURSES_PANEL
|
||||
@@ -54,16 +54,16 @@ static void ncurses_destruct_panel(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
/* {{{ ncurses_module_entry
|
||||
*/
|
||||
zend_module_entry ncurses_module_entry = {
|
||||
STANDARD_MODULE_HEADER,
|
||||
"ncurses",
|
||||
ncurses_functions,
|
||||
PHP_MINIT(ncurses),
|
||||
PHP_MSHUTDOWN(ncurses),
|
||||
PHP_RINIT(ncurses), /* Replace with NULL if there's nothing to do at request start */
|
||||
PHP_RSHUTDOWN(ncurses), /* Replace with NULL if there's nothing to do at request end */
|
||||
PHP_MINFO(ncurses),
|
||||
NO_VERSION_YET,
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
STANDARD_MODULE_HEADER,
|
||||
"ncurses",
|
||||
ncurses_functions,
|
||||
PHP_MINIT(ncurses),
|
||||
PHP_MSHUTDOWN(ncurses),
|
||||
PHP_RINIT(ncurses), /* Replace with NULL if there's nothing to do at request start */
|
||||
PHP_RSHUTDOWN(ncurses), /* Replace with NULL if there's nothing to do at request end */
|
||||
PHP_MINFO(ncurses),
|
||||
NO_VERSION_YET,
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
/* }}} */
|
||||
|
||||
@@ -75,8 +75,8 @@ ZEND_GET_MODULE(ncurses)
|
||||
*/
|
||||
/* Remove comments and fill if you need to have entries in php.ini
|
||||
PHP_INI_BEGIN()
|
||||
STD_PHP_INI_ENTRY("ncurses.value", "42", PHP_INI_ALL, OnUpdateInt, global_value, zend_ncurses_globals, ncurses_globals)
|
||||
STD_PHP_INI_ENTRY("ncurses.string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_ncurses_globals, ncurses_globals)
|
||||
STD_PHP_INI_ENTRY("ncurses.value", "42", PHP_INI_ALL, OnUpdateInt, global_value, zend_ncurses_globals, ncurses_globals)
|
||||
STD_PHP_INI_ENTRY("ncurses.string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_ncurses_globals, ncurses_globals)
|
||||
PHP_INI_END()
|
||||
*/
|
||||
/* }}} */
|
||||
@@ -84,175 +84,181 @@ PHP_INI_END()
|
||||
#define PHP_NCURSES_CONST(x) REGISTER_LONG_CONSTANT("NCURSES_"#x, x, CONST_CS | CONST_PERSISTENT)
|
||||
#define PHP_NCURSES_FKEY_CONST(x) REGISTER_LONG_CONSTANT("NCURSES_KEY_F"#x, KEY_F0 + x, CONST_CS | CONST_PERSISTENT)
|
||||
|
||||
static void php_ncurses_init_globals(zend_ncurses_globals *ncurses_globals)
|
||||
{
|
||||
memset(ncurses_globals, 0, sizeof(*ncurses_globals));
|
||||
}
|
||||
|
||||
/* {{{ PHP_MINIT_FUNCTION
|
||||
*/
|
||||
PHP_MINIT_FUNCTION(ncurses)
|
||||
{
|
||||
/* color constants */
|
||||
PHP_NCURSES_CONST(COLOR_BLACK);
|
||||
PHP_NCURSES_CONST(COLOR_RED);
|
||||
PHP_NCURSES_CONST(COLOR_GREEN);
|
||||
PHP_NCURSES_CONST(COLOR_YELLOW);
|
||||
PHP_NCURSES_CONST(COLOR_BLUE);
|
||||
PHP_NCURSES_CONST(COLOR_MAGENTA);
|
||||
PHP_NCURSES_CONST(COLOR_CYAN);
|
||||
PHP_NCURSES_CONST(COLOR_WHITE);
|
||||
/* color constants */
|
||||
PHP_NCURSES_CONST(COLOR_BLACK);
|
||||
PHP_NCURSES_CONST(COLOR_RED);
|
||||
PHP_NCURSES_CONST(COLOR_GREEN);
|
||||
PHP_NCURSES_CONST(COLOR_YELLOW);
|
||||
PHP_NCURSES_CONST(COLOR_BLUE);
|
||||
PHP_NCURSES_CONST(COLOR_MAGENTA);
|
||||
PHP_NCURSES_CONST(COLOR_CYAN);
|
||||
PHP_NCURSES_CONST(COLOR_WHITE);
|
||||
|
||||
/* keyboard constants */
|
||||
PHP_NCURSES_CONST(KEY_DOWN);
|
||||
PHP_NCURSES_CONST(KEY_UP);
|
||||
PHP_NCURSES_CONST(KEY_LEFT);
|
||||
PHP_NCURSES_CONST(KEY_RIGHT);
|
||||
PHP_NCURSES_CONST(KEY_BACKSPACE);
|
||||
PHP_NCURSES_CONST(KEY_MOUSE);
|
||||
PHP_NCURSES_CONST(KEY_F0);
|
||||
/* keyboard constants */
|
||||
PHP_NCURSES_CONST(KEY_DOWN);
|
||||
PHP_NCURSES_CONST(KEY_UP);
|
||||
PHP_NCURSES_CONST(KEY_LEFT);
|
||||
PHP_NCURSES_CONST(KEY_RIGHT);
|
||||
PHP_NCURSES_CONST(KEY_BACKSPACE);
|
||||
PHP_NCURSES_CONST(KEY_MOUSE);
|
||||
PHP_NCURSES_CONST(KEY_F0);
|
||||
|
||||
|
||||
/* TODO:this macro sux, we have 65 function key,
|
||||
so we need a little loop */
|
||||
PHP_NCURSES_FKEY_CONST(1);
|
||||
PHP_NCURSES_FKEY_CONST(2);
|
||||
PHP_NCURSES_FKEY_CONST(3);
|
||||
PHP_NCURSES_FKEY_CONST(4);
|
||||
PHP_NCURSES_FKEY_CONST(5);
|
||||
PHP_NCURSES_FKEY_CONST(6);
|
||||
PHP_NCURSES_FKEY_CONST(7);
|
||||
PHP_NCURSES_FKEY_CONST(8);
|
||||
PHP_NCURSES_FKEY_CONST(9);
|
||||
PHP_NCURSES_FKEY_CONST(10);
|
||||
PHP_NCURSES_FKEY_CONST(11);
|
||||
PHP_NCURSES_FKEY_CONST(12);
|
||||
/* TODO:this macro sux, we have 65 function key,
|
||||
so we need a little loop */
|
||||
PHP_NCURSES_FKEY_CONST(1);
|
||||
PHP_NCURSES_FKEY_CONST(2);
|
||||
PHP_NCURSES_FKEY_CONST(3);
|
||||
PHP_NCURSES_FKEY_CONST(4);
|
||||
PHP_NCURSES_FKEY_CONST(5);
|
||||
PHP_NCURSES_FKEY_CONST(6);
|
||||
PHP_NCURSES_FKEY_CONST(7);
|
||||
PHP_NCURSES_FKEY_CONST(8);
|
||||
PHP_NCURSES_FKEY_CONST(9);
|
||||
PHP_NCURSES_FKEY_CONST(10);
|
||||
PHP_NCURSES_FKEY_CONST(11);
|
||||
PHP_NCURSES_FKEY_CONST(12);
|
||||
|
||||
PHP_NCURSES_CONST(KEY_DL);
|
||||
PHP_NCURSES_CONST(KEY_IL);
|
||||
PHP_NCURSES_CONST(KEY_DC);
|
||||
PHP_NCURSES_CONST(KEY_IC);
|
||||
PHP_NCURSES_CONST(KEY_EIC);
|
||||
PHP_NCURSES_CONST(KEY_CLEAR);
|
||||
PHP_NCURSES_CONST(KEY_EOS);
|
||||
PHP_NCURSES_CONST(KEY_EOL);
|
||||
PHP_NCURSES_CONST(KEY_SF);
|
||||
PHP_NCURSES_CONST(KEY_SR);
|
||||
PHP_NCURSES_CONST(KEY_NPAGE);
|
||||
PHP_NCURSES_CONST(KEY_PPAGE);
|
||||
PHP_NCURSES_CONST(KEY_STAB);
|
||||
PHP_NCURSES_CONST(KEY_CTAB);
|
||||
PHP_NCURSES_CONST(KEY_CATAB);
|
||||
PHP_NCURSES_CONST(KEY_ENTER);
|
||||
PHP_NCURSES_CONST(KEY_SRESET);
|
||||
PHP_NCURSES_CONST(KEY_RESET);
|
||||
PHP_NCURSES_CONST(KEY_PRINT);
|
||||
PHP_NCURSES_CONST(KEY_LL);
|
||||
PHP_NCURSES_CONST(KEY_A1);
|
||||
PHP_NCURSES_CONST(KEY_A3);
|
||||
PHP_NCURSES_CONST(KEY_B2);
|
||||
PHP_NCURSES_CONST(KEY_C1);
|
||||
PHP_NCURSES_CONST(KEY_C3);
|
||||
PHP_NCURSES_CONST(KEY_BTAB);
|
||||
PHP_NCURSES_CONST(KEY_BEG);
|
||||
PHP_NCURSES_CONST(KEY_CANCEL);
|
||||
PHP_NCURSES_CONST(KEY_CLOSE);
|
||||
PHP_NCURSES_CONST(KEY_COMMAND);
|
||||
PHP_NCURSES_CONST(KEY_COPY);
|
||||
PHP_NCURSES_CONST(KEY_CREATE);
|
||||
PHP_NCURSES_CONST(KEY_END);
|
||||
PHP_NCURSES_CONST(KEY_EXIT);
|
||||
PHP_NCURSES_CONST(KEY_FIND);
|
||||
PHP_NCURSES_CONST(KEY_HELP);
|
||||
PHP_NCURSES_CONST(KEY_MARK);
|
||||
PHP_NCURSES_CONST(KEY_MESSAGE);
|
||||
PHP_NCURSES_CONST(KEY_MOVE);
|
||||
PHP_NCURSES_CONST(KEY_NEXT);
|
||||
PHP_NCURSES_CONST(KEY_OPEN);
|
||||
PHP_NCURSES_CONST(KEY_OPTIONS);
|
||||
PHP_NCURSES_CONST(KEY_PREVIOUS);
|
||||
PHP_NCURSES_CONST(KEY_REDO);
|
||||
PHP_NCURSES_CONST(KEY_REFERENCE);
|
||||
PHP_NCURSES_CONST(KEY_REFRESH);
|
||||
PHP_NCURSES_CONST(KEY_REPLACE);
|
||||
PHP_NCURSES_CONST(KEY_RESTART);
|
||||
PHP_NCURSES_CONST(KEY_RESUME);
|
||||
PHP_NCURSES_CONST(KEY_SAVE);
|
||||
PHP_NCURSES_CONST(KEY_SBEG);
|
||||
PHP_NCURSES_CONST(KEY_SCANCEL);
|
||||
PHP_NCURSES_CONST(KEY_SCOMMAND);
|
||||
PHP_NCURSES_CONST(KEY_SCOPY);
|
||||
PHP_NCURSES_CONST(KEY_SCREATE);
|
||||
PHP_NCURSES_CONST(KEY_SDC);
|
||||
PHP_NCURSES_CONST(KEY_SDL);
|
||||
PHP_NCURSES_CONST(KEY_SELECT);
|
||||
PHP_NCURSES_CONST(KEY_SEND);
|
||||
PHP_NCURSES_CONST(KEY_SEOL);
|
||||
PHP_NCURSES_CONST(KEY_SEXIT);
|
||||
PHP_NCURSES_CONST(KEY_SFIND);
|
||||
PHP_NCURSES_CONST(KEY_SHELP);
|
||||
PHP_NCURSES_CONST(KEY_SHOME);
|
||||
PHP_NCURSES_CONST(KEY_SIC);
|
||||
PHP_NCURSES_CONST(KEY_SLEFT);
|
||||
PHP_NCURSES_CONST(KEY_SMESSAGE);
|
||||
PHP_NCURSES_CONST(KEY_SMOVE);
|
||||
PHP_NCURSES_CONST(KEY_SNEXT);
|
||||
PHP_NCURSES_CONST(KEY_SOPTIONS);
|
||||
PHP_NCURSES_CONST(KEY_SPREVIOUS);
|
||||
PHP_NCURSES_CONST(KEY_SPRINT);
|
||||
PHP_NCURSES_CONST(KEY_SREDO);
|
||||
PHP_NCURSES_CONST(KEY_SREPLACE);
|
||||
PHP_NCURSES_CONST(KEY_SRIGHT);
|
||||
PHP_NCURSES_CONST(KEY_SRSUME);
|
||||
PHP_NCURSES_CONST(KEY_SSAVE);
|
||||
PHP_NCURSES_CONST(KEY_SSUSPEND);
|
||||
PHP_NCURSES_CONST(KEY_SUNDO);
|
||||
PHP_NCURSES_CONST(KEY_SUSPEND);
|
||||
PHP_NCURSES_CONST(KEY_UNDO);
|
||||
PHP_NCURSES_CONST(KEY_RESIZE);
|
||||
PHP_NCURSES_CONST(KEY_DL);
|
||||
PHP_NCURSES_CONST(KEY_IL);
|
||||
PHP_NCURSES_CONST(KEY_DC);
|
||||
PHP_NCURSES_CONST(KEY_IC);
|
||||
PHP_NCURSES_CONST(KEY_EIC);
|
||||
PHP_NCURSES_CONST(KEY_CLEAR);
|
||||
PHP_NCURSES_CONST(KEY_EOS);
|
||||
PHP_NCURSES_CONST(KEY_EOL);
|
||||
PHP_NCURSES_CONST(KEY_SF);
|
||||
PHP_NCURSES_CONST(KEY_SR);
|
||||
PHP_NCURSES_CONST(KEY_NPAGE);
|
||||
PHP_NCURSES_CONST(KEY_PPAGE);
|
||||
PHP_NCURSES_CONST(KEY_STAB);
|
||||
PHP_NCURSES_CONST(KEY_CTAB);
|
||||
PHP_NCURSES_CONST(KEY_CATAB);
|
||||
PHP_NCURSES_CONST(KEY_ENTER);
|
||||
PHP_NCURSES_CONST(KEY_SRESET);
|
||||
PHP_NCURSES_CONST(KEY_RESET);
|
||||
PHP_NCURSES_CONST(KEY_PRINT);
|
||||
PHP_NCURSES_CONST(KEY_LL);
|
||||
PHP_NCURSES_CONST(KEY_A1);
|
||||
PHP_NCURSES_CONST(KEY_A3);
|
||||
PHP_NCURSES_CONST(KEY_B2);
|
||||
PHP_NCURSES_CONST(KEY_C1);
|
||||
PHP_NCURSES_CONST(KEY_C3);
|
||||
PHP_NCURSES_CONST(KEY_BTAB);
|
||||
PHP_NCURSES_CONST(KEY_BEG);
|
||||
PHP_NCURSES_CONST(KEY_CANCEL);
|
||||
PHP_NCURSES_CONST(KEY_CLOSE);
|
||||
PHP_NCURSES_CONST(KEY_COMMAND);
|
||||
PHP_NCURSES_CONST(KEY_COPY);
|
||||
PHP_NCURSES_CONST(KEY_CREATE);
|
||||
PHP_NCURSES_CONST(KEY_END);
|
||||
PHP_NCURSES_CONST(KEY_EXIT);
|
||||
PHP_NCURSES_CONST(KEY_FIND);
|
||||
PHP_NCURSES_CONST(KEY_HELP);
|
||||
PHP_NCURSES_CONST(KEY_MARK);
|
||||
PHP_NCURSES_CONST(KEY_MESSAGE);
|
||||
PHP_NCURSES_CONST(KEY_MOVE);
|
||||
PHP_NCURSES_CONST(KEY_NEXT);
|
||||
PHP_NCURSES_CONST(KEY_OPEN);
|
||||
PHP_NCURSES_CONST(KEY_OPTIONS);
|
||||
PHP_NCURSES_CONST(KEY_PREVIOUS);
|
||||
PHP_NCURSES_CONST(KEY_REDO);
|
||||
PHP_NCURSES_CONST(KEY_REFERENCE);
|
||||
PHP_NCURSES_CONST(KEY_REFRESH);
|
||||
PHP_NCURSES_CONST(KEY_REPLACE);
|
||||
PHP_NCURSES_CONST(KEY_RESTART);
|
||||
PHP_NCURSES_CONST(KEY_RESUME);
|
||||
PHP_NCURSES_CONST(KEY_SAVE);
|
||||
PHP_NCURSES_CONST(KEY_SBEG);
|
||||
PHP_NCURSES_CONST(KEY_SCANCEL);
|
||||
PHP_NCURSES_CONST(KEY_SCOMMAND);
|
||||
PHP_NCURSES_CONST(KEY_SCOPY);
|
||||
PHP_NCURSES_CONST(KEY_SCREATE);
|
||||
PHP_NCURSES_CONST(KEY_SDC);
|
||||
PHP_NCURSES_CONST(KEY_SDL);
|
||||
PHP_NCURSES_CONST(KEY_SELECT);
|
||||
PHP_NCURSES_CONST(KEY_SEND);
|
||||
PHP_NCURSES_CONST(KEY_SEOL);
|
||||
PHP_NCURSES_CONST(KEY_SEXIT);
|
||||
PHP_NCURSES_CONST(KEY_SFIND);
|
||||
PHP_NCURSES_CONST(KEY_SHELP);
|
||||
PHP_NCURSES_CONST(KEY_SHOME);
|
||||
PHP_NCURSES_CONST(KEY_SIC);
|
||||
PHP_NCURSES_CONST(KEY_SLEFT);
|
||||
PHP_NCURSES_CONST(KEY_SMESSAGE);
|
||||
PHP_NCURSES_CONST(KEY_SMOVE);
|
||||
PHP_NCURSES_CONST(KEY_SNEXT);
|
||||
PHP_NCURSES_CONST(KEY_SOPTIONS);
|
||||
PHP_NCURSES_CONST(KEY_SPREVIOUS);
|
||||
PHP_NCURSES_CONST(KEY_SPRINT);
|
||||
PHP_NCURSES_CONST(KEY_SREDO);
|
||||
PHP_NCURSES_CONST(KEY_SREPLACE);
|
||||
PHP_NCURSES_CONST(KEY_SRIGHT);
|
||||
PHP_NCURSES_CONST(KEY_SRSUME);
|
||||
PHP_NCURSES_CONST(KEY_SSAVE);
|
||||
PHP_NCURSES_CONST(KEY_SSUSPEND);
|
||||
PHP_NCURSES_CONST(KEY_SUNDO);
|
||||
PHP_NCURSES_CONST(KEY_SUSPEND);
|
||||
PHP_NCURSES_CONST(KEY_UNDO);
|
||||
PHP_NCURSES_CONST(KEY_RESIZE);
|
||||
|
||||
/* screen attribute constants */
|
||||
PHP_NCURSES_CONST(A_NORMAL);
|
||||
PHP_NCURSES_CONST(A_STANDOUT);
|
||||
PHP_NCURSES_CONST(A_UNDERLINE);
|
||||
PHP_NCURSES_CONST(A_REVERSE);
|
||||
PHP_NCURSES_CONST(A_BLINK);
|
||||
PHP_NCURSES_CONST(A_DIM);
|
||||
PHP_NCURSES_CONST(A_BOLD);
|
||||
PHP_NCURSES_CONST(A_PROTECT);
|
||||
PHP_NCURSES_CONST(A_INVIS);
|
||||
PHP_NCURSES_CONST(A_ALTCHARSET);
|
||||
PHP_NCURSES_CONST(A_CHARTEXT);
|
||||
/* screen attribute constants */
|
||||
PHP_NCURSES_CONST(A_NORMAL);
|
||||
PHP_NCURSES_CONST(A_STANDOUT);
|
||||
PHP_NCURSES_CONST(A_UNDERLINE);
|
||||
PHP_NCURSES_CONST(A_REVERSE);
|
||||
PHP_NCURSES_CONST(A_BLINK);
|
||||
PHP_NCURSES_CONST(A_DIM);
|
||||
PHP_NCURSES_CONST(A_BOLD);
|
||||
PHP_NCURSES_CONST(A_PROTECT);
|
||||
PHP_NCURSES_CONST(A_INVIS);
|
||||
PHP_NCURSES_CONST(A_ALTCHARSET);
|
||||
PHP_NCURSES_CONST(A_CHARTEXT);
|
||||
|
||||
/* mouse constants */
|
||||
PHP_NCURSES_CONST(BUTTON1_PRESSED);
|
||||
PHP_NCURSES_CONST(BUTTON1_RELEASED);
|
||||
PHP_NCURSES_CONST(BUTTON1_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON1_DOUBLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON1_TRIPLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON2_PRESSED);
|
||||
PHP_NCURSES_CONST(BUTTON2_RELEASED);
|
||||
PHP_NCURSES_CONST(BUTTON2_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON2_DOUBLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON2_TRIPLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON3_PRESSED);
|
||||
PHP_NCURSES_CONST(BUTTON3_RELEASED);
|
||||
PHP_NCURSES_CONST(BUTTON3_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON3_DOUBLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON3_TRIPLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON4_PRESSED);
|
||||
PHP_NCURSES_CONST(BUTTON4_RELEASED);
|
||||
PHP_NCURSES_CONST(BUTTON4_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON4_DOUBLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON4_TRIPLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON_SHIFT);
|
||||
PHP_NCURSES_CONST(BUTTON_CTRL);
|
||||
PHP_NCURSES_CONST(BUTTON_ALT);
|
||||
PHP_NCURSES_CONST(ALL_MOUSE_EVENTS);
|
||||
PHP_NCURSES_CONST(REPORT_MOUSE_POSITION);
|
||||
/* mouse constants */
|
||||
PHP_NCURSES_CONST(BUTTON1_PRESSED);
|
||||
PHP_NCURSES_CONST(BUTTON1_RELEASED);
|
||||
PHP_NCURSES_CONST(BUTTON1_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON1_DOUBLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON1_TRIPLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON2_PRESSED);
|
||||
PHP_NCURSES_CONST(BUTTON2_RELEASED);
|
||||
PHP_NCURSES_CONST(BUTTON2_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON2_DOUBLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON2_TRIPLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON3_PRESSED);
|
||||
PHP_NCURSES_CONST(BUTTON3_RELEASED);
|
||||
PHP_NCURSES_CONST(BUTTON3_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON3_DOUBLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON3_TRIPLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON4_PRESSED);
|
||||
PHP_NCURSES_CONST(BUTTON4_RELEASED);
|
||||
PHP_NCURSES_CONST(BUTTON4_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON4_DOUBLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON4_TRIPLE_CLICKED);
|
||||
PHP_NCURSES_CONST(BUTTON_SHIFT);
|
||||
PHP_NCURSES_CONST(BUTTON_CTRL);
|
||||
PHP_NCURSES_CONST(BUTTON_ALT);
|
||||
PHP_NCURSES_CONST(ALL_MOUSE_EVENTS);
|
||||
PHP_NCURSES_CONST(REPORT_MOUSE_POSITION);
|
||||
|
||||
le_ncurses_windows = zend_register_list_destructors_ex(ncurses_destruct_window, NULL, "ncurses_window", module_number);
|
||||
ZEND_INIT_MODULE_GLOBALS(ncurses, php_ncurses_init_globals, NULL);
|
||||
|
||||
le_ncurses_windows = zend_register_list_destructors_ex(ncurses_destruct_window, NULL, "ncurses_window", module_number);
|
||||
#if HAVE_NCURSES_PANEL
|
||||
le_ncurses_panels = zend_register_list_destructors_ex(ncurses_destruct_panel, NULL, "ncurses_panel", module_number);
|
||||
le_ncurses_panels = zend_register_list_destructors_ex(ncurses_destruct_panel, NULL, "ncurses_panel", module_number);
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -260,7 +266,7 @@ PHP_MINIT_FUNCTION(ncurses)
|
||||
*/
|
||||
PHP_MSHUTDOWN_FUNCTION(ncurses)
|
||||
{
|
||||
return SUCCESS;
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -269,7 +275,7 @@ PHP_MSHUTDOWN_FUNCTION(ncurses)
|
||||
*/
|
||||
PHP_RINIT_FUNCTION(ncurses)
|
||||
{
|
||||
return SUCCESS;
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -278,7 +284,7 @@ PHP_RINIT_FUNCTION(ncurses)
|
||||
*/
|
||||
PHP_RSHUTDOWN_FUNCTION(ncurses)
|
||||
{
|
||||
return SUCCESS;
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -286,19 +292,19 @@ PHP_RSHUTDOWN_FUNCTION(ncurses)
|
||||
*/
|
||||
PHP_MINFO_FUNCTION(ncurses)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_header(2, "ncurses support", "enabled");
|
||||
php_info_print_table_row(2, "ncurses library version", NCURSES_VERSION);
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_header(2, "ncurses support", "enabled");
|
||||
php_info_print_table_row(2, "ncurses library version", NCURSES_VERSION);
|
||||
#ifdef HAVE_NCURSES_COLOR_SET
|
||||
php_info_print_table_row(2, "color support", "yes");
|
||||
#else
|
||||
php_info_print_table_row(2, "color support", "no");
|
||||
#endif
|
||||
php_info_print_table_end();
|
||||
php_info_print_table_end();
|
||||
|
||||
/* Remove comments if you have entries in php.ini
|
||||
DISPLAY_INI_ENTRIES();
|
||||
*/
|
||||
/* Remove comments if you have entries in php.ini
|
||||
DISPLAY_INI_ENTRIES();
|
||||
*/
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
+170
-102
File diff suppressed because it is too large.
Load diff
@@ -1,5 +0,0 @@
|
||||
this extension is experimental,
|
||||
its functions may change their names
|
||||
or move to extension all together
|
||||
so do not rely to much on them
|
||||
you have been warned!
|
||||
+2
-2
@@ -60,8 +60,8 @@ encrypted a passphrase is needed. This can be supplied as second argument.
|
||||
|
||||
resource openssl_get_publickey(mixed cert)
|
||||
|
||||
Extracts the public key from the given certificate and returns a key
|
||||
resource identifier.
|
||||
Extracts the public key from the given certificate or public key and returns
|
||||
a key resource identifier.
|
||||
|
||||
|
||||
void openssl_free_key(resource key)
|
||||
|
||||
+269
-204
File diff suppressed because it is too large.
Load diff
@@ -9,6 +9,15 @@ include('skipif.inc'); ?>
|
||||
<?php
|
||||
echo "Creating private key\n";
|
||||
|
||||
/* stack up some entropy; performance is not critical,
|
||||
* and being slow will most likely even help the test.
|
||||
*/
|
||||
for ($z = "", $i = 0; $i < 1024; $i++) {
|
||||
$z .= $i * $i;
|
||||
if (function_exists("usleep"))
|
||||
usleep($i);
|
||||
}
|
||||
|
||||
$privkey = openssl_pkey_new();
|
||||
|
||||
if ($privkey === false)
|
||||
|
||||
@@ -91,7 +91,9 @@ void php_register_signal_constants(INIT_FUNC_ARGS)
|
||||
REGISTER_LONG_CONSTANT("SIGILL", (long) SIGILL, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SIGTRAP", (long) SIGTRAP, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SIGABRT", (long) SIGABRT, CONST_CS | CONST_PERSISTENT);
|
||||
#ifdef SIGIOT
|
||||
REGISTER_LONG_CONSTANT("SIGIOT", (long) SIGIOT, CONST_CS | CONST_PERSISTENT);
|
||||
#endif
|
||||
REGISTER_LONG_CONSTANT("SIGBUS", (long) SIGBUS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SIGFPE", (long) SIGFPE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("SIGKILL", (long) SIGKILL, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
+20
-8
@@ -276,7 +276,6 @@ static void custom_errorhandler(PDF *p, int type, const char *shortmsg)
|
||||
case PDF_SystemError:
|
||||
case PDF_UnknownError:
|
||||
default:
|
||||
if (p !=NULL) PDF_delete(p); /* clean up PDFlib */
|
||||
php_error(E_ERROR,"PDFlib error: %s", shortmsg);
|
||||
}
|
||||
}
|
||||
@@ -1964,17 +1963,30 @@ PHP_FUNCTION(pdf_open_memory_image)
|
||||
ZEND_FETCH_RESOURCE(im, gdImagePtr, arg2, -1, "Image", le_gd);
|
||||
|
||||
count = 3 * im->sx * im->sy;
|
||||
if(NULL == (buffer = (unsigned char *) emalloc(count))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
buffer = (unsigned char *) emalloc(count);
|
||||
|
||||
ptr = buffer;
|
||||
for(i=0; i<im->sy; i++) {
|
||||
for(j=0; j<im->sx; j++) {
|
||||
color = im->pixels[i][j];
|
||||
*ptr++ = im->red[color];
|
||||
*ptr++ = im->green[color];
|
||||
*ptr++ = im->blue[color];
|
||||
#if HAVE_LIBGD20
|
||||
if(gdImageTrueColor(im)) {
|
||||
if (im->tpixels && gdImageBoundsSafe(im, j, i)) {
|
||||
color = gdImageTrueColorPixel(im, j, i);
|
||||
*ptr++ = (color >> 16) & 0xFF;
|
||||
*ptr++ = (color >> 8) & 0xFF;
|
||||
*ptr++ = color & 0xFF;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
if (im->pixels && gdImageBoundsSafe(im, j, i)) {
|
||||
color = im->pixels[im->sy][im->sx];
|
||||
*ptr++ = im->red[color];
|
||||
*ptr++ = im->green[color];
|
||||
*ptr++ = im->blue[color];
|
||||
}
|
||||
#if HAVE_LIBGD20
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -427,7 +427,8 @@ PHP_MINIT_FUNCTION(pgsql)
|
||||
PHP_MSHUTDOWN_FUNCTION(pgsql)
|
||||
{
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
|
||||
zend_hash_destroy(&PGG(notices));
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -464,10 +465,10 @@ PHP_MINFO_FUNCTION(pgsql)
|
||||
php_info_print_table_header(2, "PostgreSQL Support", "enabled");
|
||||
#if HAVE_PG_CONFIG_H
|
||||
php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION);
|
||||
#ifdef MULTIBYTE
|
||||
php_info_print_table_row(2, "Multibyte charater support", "enabled");
|
||||
#ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT
|
||||
php_info_print_table_row(2, "Multibyte character support", "enabled");
|
||||
#else
|
||||
php_info_print_table_row(2, "Multibyte charater support", "disabled");
|
||||
php_info_print_table_row(2, "Multibyte character support", "disabled");
|
||||
#endif
|
||||
#ifdef USE_SSL
|
||||
php_info_print_table_row(2, "SSL support", "enabled");
|
||||
|
||||
@@ -101,7 +101,7 @@ AC_DEFUN(JAVA_CHECK_LIB, [
|
||||
test -f $i/jni_md.h && JAVA_INCLUDE="$JAVA_INCLUDE -I$i"
|
||||
done
|
||||
|
||||
for i in `find $PHP_JAVA -type d`; do
|
||||
for i in `find $PHP_JAVA/ -type d`; do
|
||||
test -f $i/classes.zip && JAVA_CFLAGS=-DJNI_11
|
||||
test -f $i/rt.jar && JAVA_CFLAGS=-DJNI_12
|
||||
test -f $i/classes.zip && JAVA_CLASSPATH=$i/classes.zip
|
||||
|
||||
+7
-19
@@ -45,7 +45,7 @@
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#include "win32/winutil.h"
|
||||
#define DL_ERROR php_win_err()
|
||||
#define DL_ERROR php_win_err
|
||||
#endif
|
||||
|
||||
|
||||
@@ -87,7 +87,6 @@ static char *libpath = 0;
|
||||
static char *javahome = 0;
|
||||
static char *javalib = 0;
|
||||
|
||||
static int iniUpdated = 0;
|
||||
static void *dl_handle = 0;
|
||||
|
||||
/* {{{ ZEND_BEGIN_MODULE_GLOBALS
|
||||
@@ -113,22 +112,21 @@ static zend_class_entry java_class_entry;
|
||||
static PHP_INI_MH(OnIniUpdate)
|
||||
{
|
||||
if (new_value) *(char**)mh_arg1 = new_value;
|
||||
iniUpdated=1;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/* {{{ PHP_INI_BEGIN
|
||||
*/
|
||||
PHP_INI_BEGIN()
|
||||
PHP_INI_ENTRY1("java.class.path", NULL, PHP_INI_ALL, OnIniUpdate, &classpath)
|
||||
PHP_INI_ENTRY1("java.class.path", NULL, PHP_INI_SYSTEM, OnIniUpdate, &classpath)
|
||||
#ifndef JNI_11
|
||||
PHP_INI_ENTRY1("java.home", NULL, PHP_INI_ALL, OnIniUpdate, &javahome)
|
||||
PHP_INI_ENTRY1("java.library.path", NULL, PHP_INI_ALL, OnIniUpdate, &libpath)
|
||||
PHP_INI_ENTRY1("java.home", NULL, PHP_INI_SYSTEM, OnIniUpdate, &javahome)
|
||||
PHP_INI_ENTRY1("java.library.path", NULL, PHP_INI_SYSTEM,OnIniUpdate, &libpath)
|
||||
#endif
|
||||
#ifdef JAVALIB
|
||||
PHP_INI_ENTRY1("java.library", JAVALIB, PHP_INI_ALL, OnIniUpdate, &javalib)
|
||||
PHP_INI_ENTRY1("java.library", JAVALIB, PHP_INI_SYSTEM, OnIniUpdate, &javalib)
|
||||
#else
|
||||
PHP_INI_ENTRY1("java.library", NULL, PHP_INI_ALL, OnIniUpdate, &javalib)
|
||||
PHP_INI_ENTRY1("java.library", NULL, PHP_INI_SYSTEM, OnIniUpdate, &javalib)
|
||||
#endif
|
||||
PHP_INI_END()
|
||||
/* }}} */
|
||||
@@ -143,14 +141,7 @@ PHP_INI_END()
|
||||
void jvm_destroy(TSRMLS_D)
|
||||
{
|
||||
if (JG(php_reflect)) (*JG(jenv))->DeleteGlobalRef(JG(jenv), JG(php_reflect));
|
||||
if (JG(jvm)) {
|
||||
(*JG(jvm))->DetachCurrentThread(JG(jvm));
|
||||
(*JG(jvm))->DestroyJavaVM(JG(jvm));
|
||||
JG(jvm) = 0;
|
||||
}
|
||||
if (dl_handle) DL_UNLOAD(dl_handle);
|
||||
JG(php_reflect) = 0;
|
||||
JG(jenv) = 0;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -196,14 +187,13 @@ static int jvm_create(TSRMLS_D)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
iniUpdated=0;
|
||||
|
||||
if (javalib) {
|
||||
dl_handle = DL_LOAD(javalib);
|
||||
|
||||
if (!dl_handle) {
|
||||
php_error(E_ERROR, "Unable to load Java Library %s, error: %s",
|
||||
javalib, DL_ERROR);
|
||||
javalib, DL_ERROR());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -452,7 +442,6 @@ void java_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_refe
|
||||
|
||||
getParametersArray(ht, arg_count, arguments);
|
||||
|
||||
if (iniUpdated && JG(jenv)) jvm_destroy(TSRMLS_C);
|
||||
if (!JG(jenv)) jvm_create(TSRMLS_C);
|
||||
if (!JG(jenv)) return;
|
||||
jenv = JG(jenv);
|
||||
@@ -854,7 +843,6 @@ JNIEXPORT void JNICALL Java_net_php_reflect_setEnv
|
||||
{
|
||||
jobject local_php_reflect;
|
||||
|
||||
iniUpdated=0;
|
||||
JG(jenv)=newJenv;
|
||||
|
||||
if (!self) self = (*JG(jenv))->FindClass(JG(jenv), "net/php/reflect");
|
||||
|
||||
@@ -142,7 +142,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
|
||||
ps_files_close(data);
|
||||
|
||||
if (!ps_files_valid_key(key)) {
|
||||
php_error(E_WARNING, "The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9");
|
||||
return;
|
||||
}
|
||||
if (!ps_files_path_create(buf, sizeof(buf), data, key))
|
||||
@@ -157,11 +157,11 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
|
||||
|
||||
#ifdef F_SETFD
|
||||
if (fcntl(data->fd, F_SETFD, 1)) {
|
||||
php_error(E_WARNING, "fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
php_error(E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf,
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf,
|
||||
strerror(errno), errno);
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
|
||||
|
||||
dir = opendir(dirname);
|
||||
if (!dir) {
|
||||
php_error(E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)\n", dirname, strerror(errno), errno);
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)\n", dirname, strerror(errno), errno);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -280,9 +280,9 @@ PS_READ_FUNC(files)
|
||||
|
||||
if (n != sbuf.st_size) {
|
||||
if (n == -1)
|
||||
php_error(E_WARNING, "read failed: %s (%d)", strerror(errno), errno);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "read failed: %s (%d)", strerror(errno), errno);
|
||||
else
|
||||
php_error(E_WARNING, "read returned less bytes than requested");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "read returned less bytes than requested");
|
||||
efree(*val);
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -316,9 +316,9 @@ PS_WRITE_FUNC(files)
|
||||
|
||||
if (n != vallen) {
|
||||
if (n == -1)
|
||||
php_error(E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
|
||||
else
|
||||
php_error(E_WARNING, "write wrote less bytes than requested");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "write wrote less bytes than requested");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,9 @@ static ps_sd *ps_sd_new(ps_mm *data, const char *key)
|
||||
|
||||
sd = mm_malloc(data->mm, sizeof(ps_sd) + keylen);
|
||||
if (!sd) {
|
||||
php_error(E_WARNING, "mm_malloc failed, avail %d, err %s", mm_available(data->mm), mm_error());
|
||||
TSRMLS_FETCH();
|
||||
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "mm_malloc failed, avail %d, err %s", mm_available(data->mm), mm_error());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -359,7 +361,7 @@ PS_WRITE_FUNC(mm)
|
||||
|
||||
if (!sd->data) {
|
||||
ps_sd_destroy(data, sd);
|
||||
php_error(E_WARNING, "cannot allocate new data segment");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot allocate new data segment");
|
||||
sd = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
+18
-18
@@ -86,7 +86,7 @@ static const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC);
|
||||
static PHP_INI_MH(OnUpdateSaveHandler)
|
||||
{
|
||||
if (PS(session_status) == php_session_active) {
|
||||
php_error(E_WARNING, "A session is active. You cannot change the session module's ini settings at this time.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time.");
|
||||
return FAILURE;
|
||||
}
|
||||
PS(mod) = _php_find_ps_module(new_value TSRMLS_CC);
|
||||
@@ -98,7 +98,7 @@ static PHP_INI_MH(OnUpdateSaveHandler)
|
||||
|
||||
#if 0
|
||||
if(!PS(mod)) {
|
||||
php_error(E_ERROR,"Cannot find save handler %s",new_value);
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find save handler %s", new_value);
|
||||
}
|
||||
#endif
|
||||
return SUCCESS;
|
||||
@@ -107,7 +107,7 @@ static PHP_INI_MH(OnUpdateSaveHandler)
|
||||
static PHP_INI_MH(OnUpdateSerializer)
|
||||
{
|
||||
if (PS(session_status) == php_session_active) {
|
||||
php_error(E_WARNING, "A session is active. You cannot change the session module's ini settings at this time.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time.");
|
||||
return FAILURE;
|
||||
}
|
||||
PS(serializer) = _php_find_ps_serializer(new_value TSRMLS_CC);
|
||||
@@ -119,7 +119,7 @@ static PHP_INI_MH(OnUpdateSerializer)
|
||||
|
||||
#if 0
|
||||
if(!PS(serializer)) {
|
||||
php_error(E_ERROR,"Cannot find serialization handler %s",new_value);
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find serialization handler %s", new_value);
|
||||
}
|
||||
#endif
|
||||
return SUCCESS;
|
||||
@@ -531,7 +531,7 @@ static void php_session_decode(const char *val, int vallen TSRMLS_DC)
|
||||
{
|
||||
if (PS(serializer)->decode(val, vallen TSRMLS_CC) == FAILURE) {
|
||||
php_session_destroy(TSRMLS_C);
|
||||
php_error(E_WARNING, "Failed to decode session object. Session has been destroyed.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to decode session object. Session has been destroyed.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,7 +598,7 @@ static void php_session_initialize(TSRMLS_D)
|
||||
|
||||
/* Open session handler first */
|
||||
if (PS(mod)->open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == FAILURE) {
|
||||
php_error(E_ERROR, "Failed to initialize session module");
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize session module");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ static int migrate_global(HashTable *ht, HashPosition *pos TSRMLS_DC)
|
||||
}
|
||||
break;
|
||||
case HASH_KEY_IS_LONG:
|
||||
php_error(E_NOTICE, "The session bug compatibility code will not "
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The session bug compatibility code will not "
|
||||
"try to locate the global variable $%d due to its "
|
||||
"numeric nature.", num_key);
|
||||
break;
|
||||
@@ -671,7 +671,7 @@ static void php_session_save_current_state(TSRMLS_D)
|
||||
}
|
||||
|
||||
if (do_warn && PS(bug_compat_warn)) {
|
||||
php_error(E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -689,7 +689,7 @@ static void php_session_save_current_state(TSRMLS_D)
|
||||
}
|
||||
|
||||
if (ret == FAILURE)
|
||||
php_error(E_WARNING, "Failed to write session data (%s). Please "
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write session data (%s). Please "
|
||||
"verify that the current setting of session.save_path "
|
||||
"is correct (%s)",
|
||||
PS(mod)->name,
|
||||
@@ -808,10 +808,10 @@ static int php_session_cache_limiter(TSRMLS_D)
|
||||
int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
|
||||
|
||||
if (output_start_filename) {
|
||||
php_error(E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)",
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)",
|
||||
output_start_filename, output_start_lineno);
|
||||
} else {
|
||||
php_error(E_WARNING, "Cannot send session cache limiter - headers already sent");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent");
|
||||
}
|
||||
return -2;
|
||||
}
|
||||
@@ -842,10 +842,10 @@ static void php_session_send_cookie(TSRMLS_D)
|
||||
int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
|
||||
|
||||
if (output_start_filename) {
|
||||
php_error(E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)",
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)",
|
||||
output_start_filename, output_start_lineno);
|
||||
} else {
|
||||
php_error(E_WARNING, "Cannot send session cookie - headers already sent");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1051,7 +1051,7 @@ PHPAPI void php_session_start(TSRMLS_D)
|
||||
PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC);
|
||||
#if 0
|
||||
if (nrdels != -1)
|
||||
php_error(E_NOTICE, "purged %d expired session objects\n", nrdels);
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d expired session objects\n", nrdels);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1062,13 +1062,13 @@ static zend_bool php_session_destroy(TSRMLS_D)
|
||||
zend_bool retval = SUCCESS;
|
||||
|
||||
if (PS(session_status) != php_session_active) {
|
||||
php_error(E_WARNING, "Trying to destroy uninitialized session");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to destroy uninitialized session");
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (PS(mod)->destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
|
||||
retval = FAILURE;
|
||||
php_error(E_WARNING, "Session object destruction failed");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed");
|
||||
}
|
||||
|
||||
php_rshutdown_session_globals(TSRMLS_C);
|
||||
@@ -1119,7 +1119,7 @@ PHP_FUNCTION(session_get_cookie_params)
|
||||
}
|
||||
|
||||
if (array_init(return_value) == FAILURE) {
|
||||
php_error(E_ERROR, "Cannot initialize return value from session_get_cookie_parameters");
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot initialize return value from session_get_cookie_parameters");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -1177,7 +1177,7 @@ PHP_FUNCTION(session_module_name)
|
||||
PS(mod_data) = NULL;
|
||||
} else {
|
||||
efree(old);
|
||||
php_error(E_ERROR, "Cannot find named PHP session module (%s)",
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find named PHP session module (%s)",
|
||||
Z_STRVAL_PP(p_name));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
+6
-6
@@ -40,12 +40,12 @@ PHP_FUNCTION(snmp_set_quick_print);
|
||||
PHP_FUNCTION(snmp_set_enum_print);
|
||||
PHP_FUNCTION(snmp_set_oid_numeric_print);
|
||||
PHP_FUNCTION(snmpset);
|
||||
PHP_FUNCTION(snmpv3get);
|
||||
PHP_FUNCTION(snmpv3getnext);
|
||||
PHP_FUNCTION(snmpv3walk);
|
||||
PHP_FUNCTION(snmpv3realwalk);
|
||||
PHP_FUNCTION(snmpv3set);
|
||||
PHP_FUNCTION(snmpv3getbulk);
|
||||
|
||||
PHP_FUNCTION(snmp3_get);
|
||||
PHP_FUNCTION(snmp3_walk);
|
||||
PHP_FUNCTION(snmp3_real_walk);
|
||||
PHP_FUNCTION(snmp3_set);
|
||||
//PHP_FUNCTION(snmp3_getbulk);
|
||||
PHP_MINFO_FUNCTION(snmp);
|
||||
#else
|
||||
|
||||
|
||||
+186
-215
@@ -125,11 +125,11 @@ function_entry snmp_functions[] = {
|
||||
PHP_FE(snmp_set_oid_numeric_print, NULL)
|
||||
#endif
|
||||
PHP_FE(snmpset, NULL)
|
||||
PHP_FE(snmpv3get, NULL)
|
||||
PHP_FE(snmpv3walk, NULL)
|
||||
PHP_FE(snmpv3realwalk, NULL)
|
||||
PHP_FALIAS(snmpv3walkoid, snmpv3realwalk, NULL)
|
||||
PHP_FE(snmpv3set, NULL)
|
||||
|
||||
PHP_FE(snmp3_get, NULL)
|
||||
PHP_FE(snmp3_walk, NULL)
|
||||
PHP_FE(snmp3_real_walk, NULL)
|
||||
PHP_FE(snmp3_set, NULL)
|
||||
{NULL,NULL,NULL}
|
||||
};
|
||||
/* }}} */
|
||||
@@ -221,7 +221,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS,
|
||||
if (read_objid(objid, root, &rootlen)) {
|
||||
gotroot = 1;
|
||||
} else {
|
||||
php_error(E_WARNING,"Invalid object identifier: %s", objid);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid object identifier: %s", objid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,14 +348,14 @@ retry:
|
||||
}
|
||||
}
|
||||
} else if (status == STAT_TIMEOUT) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No Response from %s", session->peername);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No response from %s", session->peername);
|
||||
if (st == 2 || st == 3) {
|
||||
zval_dtor(return_value);
|
||||
}
|
||||
snmp_close(ss);
|
||||
RETURN_FALSE;
|
||||
} else { /* status == STAT_ERROR */
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred, Quitting.");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred, quitting");
|
||||
if (st == 2 || st == 3) {
|
||||
zval_dtor(return_value);
|
||||
}
|
||||
@@ -392,8 +392,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st)
|
||||
long timeout=SNMP_DEFAULT_TIMEOUT;
|
||||
long retries=SNMP_DEFAULT_RETRIES;
|
||||
int myargc = ZEND_NUM_ARGS();
|
||||
char type = (char) 0;
|
||||
char *value = (char *) 0;
|
||||
char type = (char) 0;
|
||||
char *value = (char *) 0;
|
||||
char hostname[MAX_NAME_LEN];
|
||||
int remote_port = 161;
|
||||
char *pptr;
|
||||
@@ -414,7 +414,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st)
|
||||
|
||||
convert_to_string_ex(a4);
|
||||
convert_to_string_ex(a5);
|
||||
|
||||
|
||||
if(myargc > 5) {
|
||||
convert_to_long_ex(a6);
|
||||
timeout = Z_LVAL_PP(a6);
|
||||
@@ -556,9 +556,10 @@ PHP_FUNCTION(snmp_set_oid_numeric_print)
|
||||
return;
|
||||
}
|
||||
if ((int) a1 != 0) {
|
||||
netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
|
||||
NETSNMP_OID_OUTPUT_NUMERIC);
|
||||
}
|
||||
netsnmp_ds_set_int(NETSNMP_DS_LIBRARY_ID,
|
||||
NETSNMP_DS_LIB_OID_OUTPUT_FORMAT,
|
||||
NETSNMP_OID_OUTPUT_NUMERIC);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
@@ -572,163 +573,149 @@ PHP_FUNCTION(snmpset)
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int netsnmp_session_set_sec_name(struct snmp_session *s, char *name)
|
||||
Set the security name in the snmpv3 session */
|
||||
static int
|
||||
netsnmp_session_set_sec_name(struct snmp_session *s, char *name)
|
||||
Set the security name in the snmpv3 session */
|
||||
static int netsnmp_session_set_sec_name(struct snmp_session *s, char *name)
|
||||
{
|
||||
if ((s) && (name)) {
|
||||
s->securityName = strdup(name);
|
||||
s->securityNameLen = strlen(s->securityName);
|
||||
return (0);
|
||||
}
|
||||
return (-1);
|
||||
if ((s) && (name)) {
|
||||
s->securityName = strdup(name);
|
||||
s->securityNameLen = strlen(s->securityName);
|
||||
return (0);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int netsnmp_session_set_sec_level(struct snmp_session *s, char *level)
|
||||
Set the security level in the snmpv3 session */
|
||||
static int
|
||||
netsnmp_session_set_sec_level(struct snmp_session *s, char *level)
|
||||
Set the security level in the snmpv3 session */
|
||||
static int netsnmp_session_set_sec_level(struct snmp_session *s, char *level TSRMLS_DC)
|
||||
{
|
||||
if ((s) && (level)) {
|
||||
if (!strcasecmp(level, "noAuthNoPriv") || !strcasecmp(level, "nanp")) {
|
||||
s->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
|
||||
return (0);
|
||||
} else if (!strcasecmp(level, "authNoPriv") || !strcasecmp(level, "anp")) {
|
||||
s->securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
|
||||
return (0);
|
||||
} else if (!strcasecmp(level, "authPriv") || !strcasecmp(level, "ap")) {
|
||||
s->securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
|
||||
return (0);
|
||||
}
|
||||
fprintf(stderr, "Invalid security level: %s\n",
|
||||
level);
|
||||
}
|
||||
return (-1);
|
||||
if ((s) && (level)) {
|
||||
if (!strcasecmp(level, "noAuthNoPriv") || !strcasecmp(level, "nanp")) {
|
||||
s->securityLevel = SNMP_SEC_LEVEL_NOAUTH;
|
||||
return (0);
|
||||
} else if (!strcasecmp(level, "authNoPriv") || !strcasecmp(level, "anp")) {
|
||||
s->securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
|
||||
return (0);
|
||||
} else if (!strcasecmp(level, "authPriv") || !strcasecmp(level, "ap")) {
|
||||
s->securityLevel = SNMP_SEC_LEVEL_AUTHPRIV;
|
||||
return (0);
|
||||
}
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security level: %s", level);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
|
||||
Set the authentication protocol in the snmpv3 session */
|
||||
static int
|
||||
netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot)
|
||||
Set the authentication protocol in the snmpv3 session */
|
||||
static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot TSRMLS_DC)
|
||||
{
|
||||
if ((s) && (prot)) {
|
||||
if (!strcasecmp(prot, "MD5")) {
|
||||
s->securityAuthProto = usmHMACMD5AuthProtocol;
|
||||
s->securityAuthProtoLen = OIDSIZE(usmHMACMD5AuthProtocol);
|
||||
return (0);
|
||||
} else if (!strcasecmp(prot, "SHA")) {
|
||||
s->securityAuthProto = usmHMACSHA1AuthProtocol;
|
||||
s->securityAuthProtoLen = OIDSIZE(usmHMACSHA1AuthProtocol);
|
||||
return (0);
|
||||
} else if (strlen(prot)) {
|
||||
fprintf(stderr,
|
||||
"Invalid authentication protocol: %s\n",
|
||||
prot);
|
||||
}
|
||||
}
|
||||
return (-1);
|
||||
if ((s) && (prot)) {
|
||||
if (!strcasecmp(prot, "MD5")) {
|
||||
s->securityAuthProto = usmHMACMD5AuthProtocol;
|
||||
s->securityAuthProtoLen = OIDSIZE(usmHMACMD5AuthProtocol);
|
||||
return (0);
|
||||
} else if (!strcasecmp(prot, "SHA")) {
|
||||
s->securityAuthProto = usmHMACSHA1AuthProtocol;
|
||||
s->securityAuthProtoLen = OIDSIZE(usmHMACSHA1AuthProtocol);
|
||||
return (0);
|
||||
} else if (strlen(prot)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid authentication protocol: %s", prot);
|
||||
}
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot)
|
||||
Set the security protocol in the snmpv3 session */
|
||||
static int
|
||||
netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot)
|
||||
Set the security protocol in the snmpv3 session */
|
||||
static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot TSRMLS_DC)
|
||||
{
|
||||
if ((s) && (prot)) {
|
||||
if (!strcasecmp(prot, "DES")) {
|
||||
s->securityPrivProto = usmDESPrivProtocol;
|
||||
s->securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol);
|
||||
return (0);
|
||||
if ((s) && (prot)) {
|
||||
if (!strcasecmp(prot, "DES")) {
|
||||
s->securityPrivProto = usmDESPrivProtocol;
|
||||
s->securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol);
|
||||
return (0);
|
||||
#ifdef HAVE_AES
|
||||
} else if (!strcasecmp(prot, "AES128")) {
|
||||
s->securityPrivProto = usmAES128PrivProtocol;
|
||||
s->securityPrivProtoLen = OIDSIZE(usmAES128PrivProtocol);
|
||||
return (0);
|
||||
} else if (!strcasecmp(prot, "AES192")) {
|
||||
s->securityPrivProto = usmAES192PrivProtocol;
|
||||
s->securityPrivProtoLen = OIDSIZE(usmAES192PrivProtocol);
|
||||
return (0);
|
||||
} else if (!strcasecmp(prot, "AES256")) {
|
||||
s->securityPrivProto = usmAES256PrivProtocol;
|
||||
s->securityPrivProtoLen = OIDSIZE(usmAES256PrivProtocol);
|
||||
return (0);
|
||||
} else if (!strcasecmp(prot, "AES128")) {
|
||||
s->securityPrivProto = usmAES128PrivProtocol;
|
||||
s->securityPrivProtoLen = OIDSIZE(usmAES128PrivProtocol);
|
||||
return (0);
|
||||
} else if (!strcasecmp(prot, "AES192")) {
|
||||
s->securityPrivProto = usmAES192PrivProtocol;
|
||||
s->securityPrivProtoLen = OIDSIZE(usmAES192PrivProtocol);
|
||||
return (0);
|
||||
} else if (!strcasecmp(prot, "AES256")) {
|
||||
s->securityPrivProto = usmAES256PrivProtocol;
|
||||
s->securityPrivProtoLen = OIDSIZE(usmAES256PrivProtocol);
|
||||
return (0);
|
||||
#endif
|
||||
} else if (strlen(prot)) {
|
||||
fprintf(stderr,
|
||||
"Invalid privacy protocol: %s\n",
|
||||
prot);
|
||||
}
|
||||
}
|
||||
return (-1);
|
||||
} else if (strlen(prot)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid privacy protocol: %s", prot);
|
||||
}
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass)
|
||||
make key from pass phrase in the snmpv3 session */
|
||||
static int
|
||||
netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass)
|
||||
Make key from pass phrase in the snmpv3 session */
|
||||
static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass TSRMLS_DC)
|
||||
{
|
||||
/*
|
||||
* make master key from pass phrases
|
||||
*/
|
||||
if ((s) && (pass) && strlen(pass)) {
|
||||
s->securityAuthKeyLen = USM_AUTH_KU_LEN;
|
||||
if (s->securityAuthProto == NULL) {
|
||||
/* get .conf set default */
|
||||
const oid *def = get_default_authtype(&(s->securityAuthProtoLen));
|
||||
s->securityAuthProto = snmp_duplicate_objid(def, s->securityAuthProtoLen);
|
||||
}
|
||||
if (s->securityAuthProto == NULL) {
|
||||
/* assume MD5 */
|
||||
s->securityAuthProto =
|
||||
snmp_duplicate_objid(usmHMACMD5AuthProtocol,
|
||||
OIDSIZE(usmHMACMD5AuthProtocol));
|
||||
s->securityAuthProtoLen = OIDSIZE(usmHMACMD5AuthProtocol);
|
||||
}
|
||||
if (generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
|
||||
(u_char *) pass, strlen(pass),
|
||||
s->securityAuthKey, &(s->securityAuthKeyLen)) != SNMPERR_SUCCESS) {
|
||||
fprintf(stderr,
|
||||
"Error generating a key for authentication pass phrase.\n");
|
||||
return (-2);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
return (-1);
|
||||
/*
|
||||
* make master key from pass phrases
|
||||
*/
|
||||
if ((s) && (pass) && strlen(pass)) {
|
||||
s->securityAuthKeyLen = USM_AUTH_KU_LEN;
|
||||
if (s->securityAuthProto == NULL) {
|
||||
/* get .conf set default */
|
||||
oid *def = get_default_authtype(&(s->securityAuthProtoLen));
|
||||
s->securityAuthProto = snmp_duplicate_objid(def, s->securityAuthProtoLen);
|
||||
}
|
||||
if (s->securityAuthProto == NULL) {
|
||||
/* assume MD5 */
|
||||
s->securityAuthProto =
|
||||
snmp_duplicate_objid(usmHMACMD5AuthProtocol, OIDSIZE(usmHMACMD5AuthProtocol));
|
||||
s->securityAuthProtoLen = OIDSIZE(usmHMACMD5AuthProtocol);
|
||||
}
|
||||
if (generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
|
||||
(u_char *) pass, strlen(pass),
|
||||
s->securityAuthKey, &(s->securityAuthKeyLen)) != SNMPERR_SUCCESS) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for authentication pass phrase");
|
||||
return (-2);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass)
|
||||
make key from pass phrase in the snmpv3 session */
|
||||
static int
|
||||
netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass)
|
||||
Make key from pass phrase in the snmpv3 session */
|
||||
static int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass TSRMLS_DC)
|
||||
{
|
||||
if ((s) && (pass) && strlen(pass)) {
|
||||
s->securityPrivKeyLen = USM_PRIV_KU_LEN;
|
||||
if (s->securityPrivProto == NULL) {
|
||||
/* get .conf set default */
|
||||
const oid *def = get_default_privtype(&(s->securityPrivProtoLen));
|
||||
s->securityPrivProto = snmp_duplicate_objid(def, s->securityPrivProtoLen);
|
||||
}
|
||||
if (s->securityPrivProto == NULL) {
|
||||
/* assume DES */
|
||||
s->securityPrivProto = snmp_duplicate_objid(usmDESPrivProtocol,
|
||||
OIDSIZE(usmDESPrivProtocol));
|
||||
s->securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol);
|
||||
}
|
||||
if (generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
|
||||
pass, strlen(pass),
|
||||
s->securityPrivKey, &(s->securityPrivKeyLen)) != SNMPERR_SUCCESS) {
|
||||
fprintf(stderr,
|
||||
"Error generating a key for privacy pass phrase.\n");
|
||||
return (-2);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
return (-1);
|
||||
if ((s) && (pass) && strlen(pass)) {
|
||||
s->securityPrivKeyLen = USM_PRIV_KU_LEN;
|
||||
if (s->securityPrivProto == NULL) {
|
||||
/* get .conf set default */
|
||||
oid *def = get_default_privtype(&(s->securityPrivProtoLen));
|
||||
s->securityPrivProto = snmp_duplicate_objid(def, s->securityPrivProtoLen);
|
||||
}
|
||||
if (s->securityPrivProto == NULL) {
|
||||
/* assume DES */
|
||||
s->securityPrivProto = snmp_duplicate_objid(usmDESPrivProtocol,
|
||||
OIDSIZE(usmDESPrivProtocol));
|
||||
s->securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol);
|
||||
}
|
||||
if (generate_Ku(s->securityAuthProto, s->securityAuthProtoLen,
|
||||
pass, strlen(pass),
|
||||
s->securityPrivKey, &(s->securityPrivKeyLen)) != SNMPERR_SUCCESS) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error generating a key for privacy pass phrase");
|
||||
return (-2);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -738,12 +725,12 @@ netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass)
|
||||
* Generic SNMPv3 object fetcher
|
||||
* From here is passed on the the common internal object fetcher.
|
||||
*
|
||||
* st=1 snmpv3get() - query an agent and return a single value.
|
||||
* st=2 snmpv3walk() - walk the mib and return a single dimensional array
|
||||
* containing the values.
|
||||
* st=3 snmpv3realwalk() and snmpv3walkoid() - walk the mib and return an
|
||||
* array of oid,value pairs.
|
||||
* st=11 snmpv3set() - query an agent and set a single value
|
||||
* st=1 snmp3_get() - query an agent and return a single value.
|
||||
* st=2 snmp3_walk() - walk the mib and return a single dimensional array
|
||||
* containing the values.
|
||||
* st=3 snmp3_real_walk() - walk the mib and return an
|
||||
* array of oid,value pairs.
|
||||
* st=11 snmp3_set() - query an agent and set a single value
|
||||
*
|
||||
*/
|
||||
void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) {
|
||||
@@ -764,10 +751,10 @@ void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) {
|
||||
}
|
||||
|
||||
snmp_sess_init(&session);
|
||||
/* This is all SNMPv3 */
|
||||
/* This is all SNMPv3 */
|
||||
session.version = SNMP_VERSION_3;
|
||||
|
||||
/* Reading the hostname and its optional non-default port number */
|
||||
/* Reading the hostname and its optional non-default port number */
|
||||
convert_to_string_ex(a1);
|
||||
strcpy(hostname, Z_STRVAL_PP(a1));
|
||||
if ((pptr = strchr (hostname, ':'))) {
|
||||
@@ -777,47 +764,47 @@ void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) {
|
||||
session.peername = hostname;
|
||||
session.remote_port = remote_port;
|
||||
|
||||
/* Setting the security name. */
|
||||
/* Setting the security name. */
|
||||
convert_to_string_ex(a2);
|
||||
if (netsnmp_session_set_sec_name(&session, Z_STRVAL_PP(a2))) {
|
||||
php_error(E_WARNING,"Could net set security name: %s\n", Z_STRVAL_PP(a2));
|
||||
if (netsnmp_session_set_sec_name(&session, Z_STRVAL_PP(a2))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could net set security name: %s", Z_STRVAL_PP(a2));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* Setting the security level. */
|
||||
convert_to_string_ex(a3);
|
||||
if (netsnmp_session_set_sec_level(&session, Z_STRVAL_PP(a3))) {
|
||||
php_error(E_WARNING,"Invalid security level: %s\n", a3);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* Setting the security level. */
|
||||
convert_to_string_ex(a3);
|
||||
if (netsnmp_session_set_sec_level(&session, Z_STRVAL_PP(a3) TSRMLS_CC)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security level: %s", a3);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* Setting the authentication protocol. */
|
||||
convert_to_string_ex(a4);
|
||||
if (netsnmp_session_set_auth_protocol(&session, Z_STRVAL_PP(a4))) {
|
||||
php_error(E_WARNING,"Invalid authentication protocol: %s\n", Z_STRVAL_PP(a4));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* Setting the authentication passphrase. */
|
||||
convert_to_string_ex(a5);
|
||||
if (netsnmp_session_gen_auth_key(&session, Z_STRVAL_PP(a5))) {
|
||||
php_error(E_WARNING,"Could not generate key for authentication pass phrase: %s\n", Z_STRVAL_PP(a4));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* Setting the authentication protocol. */
|
||||
convert_to_string_ex(a4);
|
||||
if (netsnmp_session_set_auth_protocol(&session, Z_STRVAL_PP(a4) TSRMLS_CC)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid authentication protocol: %s", Z_STRVAL_PP(a4));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* Setting the authentication passphrase. */
|
||||
convert_to_string_ex(a5);
|
||||
if (netsnmp_session_gen_auth_key(&session, Z_STRVAL_PP(a5) TSRMLS_CC)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not generate key for authentication pass phrase: %s", Z_STRVAL_PP(a4));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* Setting the security protocol. */
|
||||
convert_to_string_ex(a6);
|
||||
if (netsnmp_session_set_sec_protocol(&session, Z_STRVAL_PP(a6)) &&
|
||||
(0 != strlen(Z_STRVAL_PP(a6)))) {
|
||||
php_error(E_WARNING,"Invalid security protocol: %s\n", Z_STRVAL_PP(a6));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* Setting the security protocol passphrase. */
|
||||
convert_to_string_ex(a7);
|
||||
if (netsnmp_session_gen_sec_key(&session, Z_STRVAL_PP(a7)) &&
|
||||
/* Setting the security protocol. */
|
||||
convert_to_string_ex(a6);
|
||||
if (netsnmp_session_set_sec_protocol(&session, Z_STRVAL_PP(a6) TSRMLS_CC) &&
|
||||
(0 != strlen(Z_STRVAL_PP(a6)))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security protocol: %s", Z_STRVAL_PP(a6));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
/* Setting the security protocol passphrase. */
|
||||
convert_to_string_ex(a7);
|
||||
if (netsnmp_session_gen_sec_key(&session, Z_STRVAL_PP(a7) TSRMLS_CC) &&
|
||||
(0 != strlen(Z_STRVAL_PP(a7)))) {
|
||||
php_error(E_WARNING,"Could not generate key for security pass phrase: %s\n", Z_STRVAL_PP(a7));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not generate key for security pass phrase: %s", Z_STRVAL_PP(a7));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (st == 11) {
|
||||
if (myargc < 10) {
|
||||
@@ -833,8 +820,8 @@ void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) {
|
||||
}
|
||||
convert_to_string_ex(a9);
|
||||
convert_to_string_ex(a10);
|
||||
type = Z_STRVAL_PP(a9)[0];
|
||||
value = Z_STRVAL_PP(a10);
|
||||
type = Z_STRVAL_PP(a9)[0];
|
||||
value = Z_STRVAL_PP(a10);
|
||||
} else {
|
||||
if (myargc > 8) {
|
||||
convert_to_long_ex(a9);
|
||||
@@ -853,52 +840,36 @@ void php_snmpv3(INTERNAL_FUNCTION_PARAMETERS, int st) {
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int snmpv3get(string host,
|
||||
string sec_name, string sec_level,
|
||||
string auth_protocol, string auth_passphrase,
|
||||
string priv_protocol, string priv_passphrase,
|
||||
string object_id [, int timeout [, int retries]])
|
||||
/* {{{ proto int snmp3_get(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])
|
||||
Fetch the value of a SNMP object */
|
||||
PHP_FUNCTION(snmpv3get)
|
||||
PHP_FUNCTION(snmp3_get)
|
||||
{
|
||||
php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU,1);
|
||||
php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto int snmpv3walk(string host,
|
||||
string sec_name, string sec_level,
|
||||
string auth_protocol, string auth_passphrase,
|
||||
string priv_protocol, string priv_passphrase,
|
||||
tring object_id [, int timeout [, int retries]])
|
||||
/* {{{ proto int snmp3_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])
|
||||
Fetch the value of a SNMP object */
|
||||
PHP_FUNCTION(snmpv3walk)
|
||||
PHP_FUNCTION(snmp3_walk)
|
||||
{
|
||||
php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU,2);
|
||||
php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int snmpv3realwalk(string host,
|
||||
string sec_name, string sec_level,
|
||||
string auth_protocol, string auth_passphrase,
|
||||
string priv_protocol, string priv_passphrase,
|
||||
string object_id [, int timeout [, int retries]])
|
||||
/* {{{ proto int snmp3_real_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])
|
||||
Fetch the value of a SNMP object */
|
||||
PHP_FUNCTION(snmpv3realwalk)
|
||||
PHP_FUNCTION(snmp3_real_walk)
|
||||
{
|
||||
php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU,3);
|
||||
php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int snmpv3set(string host,
|
||||
string sec_name, string sec_level,
|
||||
string auth_protocol, string auth_passphrase,
|
||||
string priv_protocol, string priv_passphrase,
|
||||
string object_id, string type, mixed value [, int timeout [, int retries]])
|
||||
/* {{{ proto int snmp3_set(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id, string type, mixed value [, int timeout [, int retries]])
|
||||
Fetch the value of a SNMP object */
|
||||
PHP_FUNCTION(snmpv3set)
|
||||
PHP_FUNCTION(snmp3_set)
|
||||
{
|
||||
php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU,11);
|
||||
php_snmpv3(INTERNAL_FUNCTION_PARAM_PASSTHRU, 11);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ ssize_t readv(SOCKET sock, const struct iovec *iov, int iovcnt) {
|
||||
}
|
||||
|
||||
retval = recv(sock, buffer, bytes, 0);
|
||||
SleepEx(1, TRUE);
|
||||
|
||||
if(retval < 0) {
|
||||
efree(buffer);
|
||||
return retval;
|
||||
@@ -175,4 +175,4 @@ int fcntl(int fd, int cmd, ...) {
|
||||
va_end(va);
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -747,7 +747,7 @@ PHP_FUNCTION(socket_write)
|
||||
|
||||
ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket);
|
||||
|
||||
if (ZEND_NUM_ARGS() < 4) {
|
||||
if (ZEND_NUM_ARGS() < 3) {
|
||||
length = str_len;
|
||||
}
|
||||
|
||||
@@ -766,30 +766,28 @@ PHP_FUNCTION(socket_write)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
typedef int (*read_func)(int, void *, size_t, int);
|
||||
|
||||
/* {{{ proto string socket_read(resource socket, int length [, int type])
|
||||
Reads a maximum of length bytes from socket */
|
||||
PHP_FUNCTION(socket_read)
|
||||
{
|
||||
zval *arg1;
|
||||
php_socket *php_sock;
|
||||
read_func read_function = (read_func) recv;
|
||||
char *tmpbuf;
|
||||
int retval, length, type = PHP_BINARY_READ;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &arg1, &length, &type) == FAILURE)
|
||||
return;
|
||||
|
||||
tmpbuf = emalloc(length + 1);
|
||||
|
||||
ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket);
|
||||
|
||||
if (type == PHP_NORMAL_READ) {
|
||||
read_function = (read_func) php_read;
|
||||
retval = php_read(php_sock->bsd_socket, tmpbuf, length, 0);
|
||||
} else {
|
||||
retval = recv(php_sock->bsd_socket, tmpbuf, length, 0);
|
||||
}
|
||||
|
||||
tmpbuf = emalloc(length + 1);
|
||||
|
||||
retval = (*read_function)(php_sock->bsd_socket, tmpbuf, length, 0);
|
||||
if (retval == -1) {
|
||||
PHP_SOCKET_ERROR(php_sock, "unable to read from socket", errno);
|
||||
efree(tmpbuf);
|
||||
|
||||
Loaded 100 of 209 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user