mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-25 18:05:42 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a400da70d3 |
No files matched your search
+7
-16
@@ -31,11 +31,6 @@ EXTENSION: aolserver
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: activescript
|
||||
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: apache
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
@@ -50,10 +45,6 @@ EXTENSION: cgi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cli
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fhttpd
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
@@ -63,9 +54,8 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: nsapi
|
||||
PRIMARY MAINTAINER: Uwe Schindler <thetaphi@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: phttpd
|
||||
MAINTENANCE: Unknown
|
||||
@@ -136,7 +126,7 @@ STATUS: Experimental
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: interbase
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jouni.ahto@exdec.fi>, Ard Biesheuvel <ard@ard.nu>
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jouni.ahto@exdec.fi>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -176,7 +166,7 @@ MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -187,7 +177,8 @@ STATUS: Working
|
||||
COMMENT: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oracle
|
||||
MAINTENANCE: Orphaned
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Using the new OCI8 driver is encouraged where possible.
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -339,7 +330,7 @@ MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcrypt
|
||||
PRIMARY MAINTAINER: Derick Rethans <derick@derickrethans.nl>
|
||||
PRIMARY MAINTAINER: Derick Rethans <d.rethans@jdimedia.nl>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
+13
-17
@@ -16,15 +16,15 @@ build-modules: $(PHP_MODULES)
|
||||
|
||||
libphp4.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
|
||||
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
|
||||
-@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
|
||||
|
||||
libs/libphp4.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
|
||||
$(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp4.so
|
||||
|
||||
install: $(all_targets) $(install_targets)
|
||||
install: $(install_targets)
|
||||
|
||||
install-sapi: $(OVERALL_TARGET)
|
||||
@echo "Installing PHP SAPI module: $(PHP_SAPI)"
|
||||
install-sapi: libphp4.la
|
||||
@echo "Installing PHP SAPI module"
|
||||
-@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
|
||||
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
|
||||
-@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
|
||||
for i in 0.0.0 0.0 0; do \
|
||||
@@ -38,10 +38,10 @@ install-sapi: $(OVERALL_TARGET)
|
||||
|
||||
install-modules: build-modules
|
||||
@test -d modules && \
|
||||
$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR)
|
||||
@echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/"
|
||||
@rm -f modules/*.la >/dev/null 2>&1
|
||||
@$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR)
|
||||
$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR) && \
|
||||
echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/" && \
|
||||
rm -f modules/*.la && \
|
||||
$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) >/dev/null 2>&1 || true
|
||||
|
||||
install-tester:
|
||||
@echo "Installing regression tester: $(INSTALL_ROOT)$(PEAR_INSTALLDIR)/"
|
||||
@@ -50,15 +50,11 @@ install-tester:
|
||||
|
||||
install-su: install-pear install-tester
|
||||
|
||||
test:
|
||||
-@if test -x $(SAPI_CLI_PATH) && test ! -z $(SAPI_CLI_PATH); then \
|
||||
TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' $(top_srcdir)/run-tests.php $(TESTS); \
|
||||
else \
|
||||
echo "ERROR: Cannot run tests without CLI sapi."; \
|
||||
fi
|
||||
test: $(SAPI_CLI_PATH)
|
||||
@TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
|
||||
TEST_PHP_SRCDIR=$(top_srcdir) \
|
||||
CC="$(CC)" \
|
||||
$(top_builddir)/$(SAPI_CLI_PATH) -d 'open_basedir=' -d 'safe_mode=0' -d 'output_buffering=0' $(top_srcdir)/run-tests.php $(TESTS)
|
||||
|
||||
clean:
|
||||
find . -name \*.lo | xargs rm -f
|
||||
|
||||
@@ -1,388 +1,17 @@
|
||||
PHP 4 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
05 Apr 2004, Version 4.3.6RC2
|
||||
- Fixed a bug that prevented building of the GD extension against external GD
|
||||
lib 1.X. (Ilia, Nick Talbott).
|
||||
- Fixed bug #27849 (configure craps out on trivial syntax error). (Derick)
|
||||
|
||||
01 Apr 2004, Version 4.3.6RC1
|
||||
- Synchronized bundled GD library with GD 2.0.22. (Ilia)
|
||||
- Fixed bug #27822 (is_resource() returns TRUE for closed resources). (Derick)
|
||||
- Fixed bug #27819 (problems returning reference to a reference parameter).
|
||||
(Ilia)
|
||||
- Fixed bug #27809 (ftp_systype returns null on some ftp servers). (Ilia)
|
||||
- Fixed bug #27802 (default number of children to 8 when PHP_FCGI_CHILDREN is
|
||||
not defined). (Ilia)
|
||||
- Fixed bug #27780 (strtotime(+1 xxx) returns a wrong date/time). (Derick)
|
||||
- Fixed bug #27764 (Get return value from a stored procedure not returning any
|
||||
result sets). (Frank)
|
||||
- Fixed bug #27762 (SCO Openserver doesn't have S_ISSOCK). (Wez)
|
||||
- Fixed bug #27743 (Make sure Money types are converted and returned
|
||||
correctly). (Frank)
|
||||
- Fixed bug #27732 (Fixed compilation bug inside php_sab_info.h). (Ilia)
|
||||
- Fixed bug #27731 (error_reporting() inside @ block fails to set
|
||||
error_reporting level). (Ilia)
|
||||
- Fixed bug #27719 (mktime issues on and around DST changeover). (Rasmus)
|
||||
- Fixed bug #27717 (Test Failures when compiled on 64-bit mode). (Ard, Derick)
|
||||
- Fixed bug #27687 (Bug Adding Default Charset to 'text/*' Content-Type
|
||||
Header). (Marcus)
|
||||
- Fixed bug #27664 (--disable-cli doesn't force --without-pear). (Ilia)
|
||||
- Fixed bug #27663 (compile failure with cURL 7.11.1). (Ilia)
|
||||
- Fixed bug #27646 (Cannot serialize/unserialize non-finite numeric values).
|
||||
(Marcus)
|
||||
- Fixed bug #26757 (session.save_path default is bogus for win32). (Wez)
|
||||
- Fixed bug #25547 (error_handler and array index with function call).
|
||||
(cschneid at cschneid dot com)
|
||||
|
||||
26 Mar 2004, Version 4.3.5
|
||||
- Fixed possible crash using an invalid color index with a palette image in
|
||||
imagecolortransparent (Pierre)
|
||||
- Fixed php-cgi to not ignore command-line switches when run in a web context.
|
||||
This fixes our test cases allowing INI with GET sections to work (Rasmus)
|
||||
- Fixed getopt() so it works without $_SERVER (Rasmus, bfrance)
|
||||
- Fixed crash in php_ini_scanned_files() when no additional INI files were
|
||||
actually parsed. (Jon)
|
||||
- Fixed possible crashes inside socket extension, due to missing check inside
|
||||
allocation functions. (Ilia)
|
||||
- Fixed zero bytes memory allocation when no extra ini files are found in the
|
||||
--with-config-file-scan-dir specified directory. (Eric Colinet, Derick)
|
||||
- Changed "allow_url_fopen" php.ini option to be PHP_INI_SYSTEM. (Sara)
|
||||
- Improved the sybase_ct module: (Timm)
|
||||
. Added ability to define a message handler not only globally, but also per
|
||||
connection.
|
||||
. Added "sybct.packet_size" php.ini option.
|
||||
. Changed "sybct.login_timeout" php.ini option changeable at runtime.
|
||||
. Fixed memory leak in sybase_set_message_handler().
|
||||
- Synchronized bundled GD library with GD 2.0.17
|
||||
- Upgraded PCRE library to version 4.5. (Andrei)
|
||||
- Updated bundled PostgreSQL library to version 7.4 in Windows distribution.
|
||||
(Edin)
|
||||
- Added support for --program-prefix and --program-suffix configure options.
|
||||
(Jani)
|
||||
- Added a warning when creating temp stream fails with ftp_(n)list(). (Sara)
|
||||
- Fixed header handler in NSAPI SAPI module (header->replace was ignored,
|
||||
send_default_content_type now sends value from php.ini). (Uwe Schindler)
|
||||
- Fixed bug #27633 (Incorrect EOL translation by ftp_get() in ASCII mode).
|
||||
(Ilia)
|
||||
- Fixed bug #27600 (GCC 3.0.4 does not like __attribute__ directive). (Sascha)
|
||||
- Fixed bug #27590 (crash during shutdown when freeing persistent resources in
|
||||
ZTS mode). (Ilia)
|
||||
- Fixed bug #27582 (possible crashes in imagefilltoborder()). (Pierre)
|
||||
- Fixed bug #27580 (pre-initialization errors in ap2 handler are not being
|
||||
written to vhost error log). (Ilia)
|
||||
- Fixed bug #27559 (Corrected open_basedir resolving logic). (Ilia)
|
||||
- Fixed bug #27530 (broken http auth when safe_mode is on and PCRE is disabled).
|
||||
(Ilia)
|
||||
- Fixed bug #27509 (broken getaddrinfo() causes fsockopen() error). (Sara)
|
||||
- Fixed bug #27505 (htmlentities() does not handle BIG5 correctly). (Ilia,
|
||||
ywliu at hotmail dot com)
|
||||
- Fixed bug #27498 (bogus safe_mode error on nonexistent directories for
|
||||
chdir() and opendir() functions). (Ilia)
|
||||
- Fixed bug #27460 (base64_decode() does not handle extra padding).
|
||||
(Ilia, naish at klanen dot net)
|
||||
- Fixed bug #27443 (defined() returns wrong type). (Derick)
|
||||
- Fixed bug #27437 (wrong freetype include inside GD library). (Ilia)
|
||||
- Fixed bug #27424 (headers missing on flush() in apache 2 SAPIs). (Ilia)
|
||||
- Fixed bug #27421 (mbstring.func_overload should be system ini setting).
|
||||
(Ilia)
|
||||
- Fixed bug #27384 (unpack() misbehaves with 1 char string). (GeorgeS)
|
||||
- Fixed bug #27383 (Potential crash inside fopen_wrapper, while
|
||||
parsing response code). (Ilia)
|
||||
- Fixed bug #27354 (Modulus operator crashes PHP). (Derick)
|
||||
- Fixed bug #27341 (HEAD requests fail to return data). (Ilia)
|
||||
- Fixed bug #27337 (missing sapi_shutdown() in sapi/isapi causes memory leak).
|
||||
(Jani, msisolak at yahoo dot com)
|
||||
- Fixed bug #27328 (ftp extension relies on 32-bit longs). (Sara)
|
||||
- Fixed bug #27300 (Improved regex for pg_convert()).
|
||||
(benjcarson at digitaljunkies dot ca, Ilia)
|
||||
- Fixed bug #27295 (memory leak inside sscanf()). (Ilia)
|
||||
- Fixed bug #27293 (two crashes inside image2wbmp()). (Ilia)
|
||||
- Fixed bug #27291 (get_browser matches browscap.ini patterns incorrectly).
|
||||
(Jay)
|
||||
- Fixed bug #27278 (*printf() functions treat arguments as if passed by
|
||||
reference). (Ilia)
|
||||
- Fixed bug #27238 (iptcparse() function misses some fields). (Pierre)
|
||||
- Fixed bug #27235 (Interbase NUMERIC x.0 field returns empty string on 0).
|
||||
(Ard)
|
||||
- Fixed bug #27196 (Missing content_length initialization in apache 2 sapis).
|
||||
(Ilia, pdoru at kappa dot ro)
|
||||
- Fixed bug #27183 (userland stream wrapper segfaults on stream_write).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #27175 (tzset() is not being called by PHP on startup).
|
||||
(Ilia, sagawa at sohgoh dot net)
|
||||
- Fixed bug #27172 (Possible floating point exception in gmp_powm()).
|
||||
(Ilia)
|
||||
- Fixed bug #27171 (crash inside gmp_hamdist()). (Jani)
|
||||
- Fixed bug #27157 (Compile Failure on Solaris 8). (Timm)
|
||||
- Fixed bug #27149 (broken CLOB support in oci8 extension). (Antony)
|
||||
- Fixed bug #27135 (Possible crash inside mb_strlen()). (Moriyoshi)
|
||||
- Fixed bug #27104 (CLI/CGI SAPI module variable name conflict). (Marcus)
|
||||
- Fixed bug #27058 (crash in sybase_connect() with 2 arguments). (Ilia)
|
||||
- Fixed bug #27056 (ints used instead of longs inside some GD functions).
|
||||
(Ilia)
|
||||
- Fixed bug #27040 (passing an array of form-fields to CURLOPT_POSTFIELDS
|
||||
does not work). (Ilia, Jani)
|
||||
- Fixed bug #27037 (fixed possible crash in apache2handler output code).
|
||||
(Ilia)
|
||||
- Fixed bug #27026 (Added "cgi.nph" php.ini option to allow forcing of the
|
||||
'Status: 200' header that is not normally needed). (Ilia)
|
||||
- Fixed bug #27011 (64bit int/long confusion in preg_match*() functions).
|
||||
(Ilia)
|
||||
- Fixed bug #27007 (missing connection closure when connect fails in pgsql).
|
||||
(Ilia)
|
||||
- Fixed bug #26974 (rename() doesn't check the destination file against
|
||||
safe_mode/open_basedir). (Ilia)
|
||||
- Fixed bug #26973 (*printf() '+' modifier broken). (Jani)
|
||||
- Fixed bug #26969 (--with-openssl=shared build fails). (Jani)
|
||||
- Fixed bug #26968 (Segfault with Interbase module built as shared). (Ard)
|
||||
- Fixed bug #26949 (rand(min,max) always returns min when ZTS enabled). (Jani)
|
||||
- Fixed bug #26937 (Warning in xml.c). (Jani)
|
||||
- Fixed bug #26927 (preg_quote() does not escape \0). (Ilia)
|
||||
- Fixed bug #26923 (ext/imap: pam and crypt libraries missing when build as
|
||||
shared extension). (Jani)
|
||||
- Fixed bug #26909 (crash in imap_mime_header_decode() when no encoding is
|
||||
used). (Ilia)
|
||||
- Fixed bug #26896 (ext/ftp does not work as shared extension). (Jani)
|
||||
- Fixed bug #26892 (ORA-21301 in ocinewcollection() call). (Antony)
|
||||
- Fixed bug #26878 (problem with multiple references to the same variable with
|
||||
different types). (Ilia)
|
||||
- Fixed bug #26864 (pg_(update|delete) ignore PGSQL_DML_EXEC option). (Ilia)
|
||||
- Fixed bug #26862 (ob_flush() followed by output_reset_rewrite_vars() may
|
||||
result in data loss). (Ilia, scottmacvicar at ntlworld dot com)
|
||||
- Fixed bug #26847 (memory leak in mail() when to/subject contain only spaces).
|
||||
(Ilia)
|
||||
- Fixed bug #26814 (When included file has a parse error, terminate script
|
||||
execution). (Ilia)
|
||||
- Fixed bug #26777 (ext/interbase: Let DB handle NULL params). (Ard)
|
||||
- Fixed bug #26772, #26967 (file operations return NULL instead of FALSE).
|
||||
(Wez, Ilia)
|
||||
- Fixed bug #26758 (FastCGI exits immediately with status 255).
|
||||
(Ilia, tcarter at noggin dot com dot au)
|
||||
- Fixed bug #26755 (CLI now overrides php.ini settings and switches off output
|
||||
buffering). (Edin)
|
||||
- Fixed bug #26753 (zend_fetch_list_dtor_id() doesn't check NULL strings).
|
||||
(Jani, Markus dot Lidel at shadowconnect dot com)
|
||||
- Fixed bug #26752 (Silent unterminated loop when length parameter for fgets(),
|
||||
fread() and fgetss() is 0). (Ilia)
|
||||
- Fixed bug #26751 (PHP can't find the MySQL socket on a case sensitive file
|
||||
system). (Derick)
|
||||
- Fixed bug #26703 (Certain characters inside strings incorrectly treated
|
||||
as keywords). (vrana [at] php [dot] net, Ilia)
|
||||
- Fixed bug #26699 (mbstring doesn't identify "binary" as a valid encoding).
|
||||
(nirva-php at ishiboo dot com, Moriyoshi)
|
||||
- Fixed bug #26667 (Added safety checks to ip2long()). (Ilia)
|
||||
- Fixed bug #26653 (open_basedir incorrectly resolved on win32).
|
||||
(Ilia, scottmacvicar at ntlworld dot com)
|
||||
- Fixed bug #26639 (mb_convert_variables() clutters variables beyond the
|
||||
references). (Moriyoshi)
|
||||
- Fixed bug #26635 (fixed look up for fonts in the current directory w/ZTS).
|
||||
(Ilia)
|
||||
- Fixed bug #26625 (pg_convert sets NULL incorrectly for character data types).
|
||||
(Ilia)
|
||||
- Fixed bug #26604 (Apache2 SAPIs implicitly disable Keep-Alive). (Ilia)
|
||||
- Fixed bug #26595 (ext/domxml: XSLT_NAMESPACE undeclared). (Christian)
|
||||
- Fixed bug #26565 (strtotime("this month") resolving to the wrong month).
|
||||
(Jani)
|
||||
- Fixed bug #26564 (ncurses5 has headers in PREFIX/include/ncurses/). (Jani)
|
||||
- Fixed bug #26548 (ext/session: Malformed HTTP dates headers). (Derick)
|
||||
- Fixed bug #26531 (ext/domxml: get_elements_by_tag_name() wildcard fails).
|
||||
(Rob Richards)
|
||||
- Fixed bug #26488 (Missing declaration of CRTSCTS in ext/dio/dio.c). (Jani)
|
||||
- Fixed bug #26467 (flock() does not force the "wouldblock" parameter to be
|
||||
passed by reference). (Wez)
|
||||
- Fixed bug #26463 (Incorrect handling of semicolons after heredoc). (Ilia)
|
||||
- Fixed bug #26462 (phpize + ext/bcmath -> compile error). (Jani)
|
||||
- Fixed bug #26461 (-lssl missing from LIBS). (Jani)
|
||||
- Fixed bug #26458 (var_dump(), var_export(), debug_zval_dump() not binary safe
|
||||
for array keys). (Ilia)
|
||||
- Fixed bug #26447 (--with-openssl=shared causes compile errors). (Jani)
|
||||
- Fixed bug #26446 (domxml_open_file() returns an empty error-Array). (Rob)
|
||||
- Fixed bug #26440 (MFH missing context options). (Ilia)
|
||||
- Fixed bug #26438 (error in thttpd SAPI installation). (Jani)
|
||||
- Fixed bug #26415 (Updated bundled OpenSSL DLLs in the Windows distribution
|
||||
to 0.9.7c). (Edin)
|
||||
- Fixed bug #26407 (Result set fetching broken around transactions). (Timm)
|
||||
- Fixed bug #26391 (parse_url() destroys strings that contain a character in
|
||||
range of \x80-\xff)). (Moriyoshi)
|
||||
- Fixed bug #26384 (crash in domxslt->process()). (Christian)
|
||||
- Fixed bug #26381 (rand() without srand() doesn't work with certain php.ini).
|
||||
(Jani)
|
||||
- Fixed bug #26376 (typo in ext/odbc/config.m4: DBMaker test fails). (Jani)
|
||||
- Fixed bug #26355 (flock() doesn't initialize the wouldblock argument). (Ilia)
|
||||
- Fixed bug #26309 (Fixed argument parsing for imageftbbox()). (Ilia)
|
||||
- Fixed bug #26304 (Unexpected data loss when opening dba file). (Marcus)
|
||||
- Fixed bug #26285 (escapeshellarg() uses wrong quotes on windows). (Ilia)
|
||||
- Fixed bug #26267 (gmp_random() leaks memory and does not produce random
|
||||
numbers). (Jani)
|
||||
- Fixed bug #26253 (ext/tokenizer: build as shared extension fails). (Jani)
|
||||
- Fixed bug #26235 (yp_first/yp_next do not specify correct key length). (Ilia)
|
||||
- Fixed bug #26216 ("getimagesize(): stream does not support seeking" when
|
||||
using remote files). (Marcus)
|
||||
- Fixed bug #26201 (crash in ibase_trans() on invalid link handle). (Ilia)
|
||||
- Fixed bug #26198 (strtotime() handling of M/F Y date format). (Ilia)
|
||||
- Fixed bug #26194 (iconv() not properly defined with libiconv).
|
||||
(Steph, Frank, Moriyoshi)
|
||||
- Fixed bug #26176 (Fixed handling of numeric keys in INI files). (Ilia)
|
||||
- Fixed bug #26168 (shtool availability check in phpize).
|
||||
(robbat2 at gentoo dot org, Ilia)
|
||||
- Fixed bug #26148 (Print the notice before modifying variable on type
|
||||
mismatch). (morten-bugs dot php dot net at afdelingp dot dk, Ilia)
|
||||
- Fixed bug #26128 (mbstring prints out wrong information on phpinfo()).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #26113 (remove leftover local file when ftp_get/ftp_nb_get
|
||||
fails). (Ilia)
|
||||
- Fixed bug #26105 (Compile failure on GCC version 3.0.X). (Ilia)
|
||||
- Fixed bug #26103 (ext/mime_magic causes compile failure in ext/mssql). (Jani)
|
||||
- Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect results).
|
||||
(sprice at wisc dot edu, Ilia)
|
||||
- Fixed bug #26042 (memory leak if mcrypt_generic_deinit() is not called after
|
||||
every mcrypt_generic_init() call). (Ilia)
|
||||
- Fixed bug #26025 (Segfault on glob() without GLOB_NOCHECK or GLOB_NOMAGIC
|
||||
under *BSD platforms). (Moriyoshi)
|
||||
- Fixed bug #26005 (Random "cannot change the session ini settings" errors).
|
||||
(Jani, jsnajdr at kerio dot com)
|
||||
- Fixed bug #26003 (Make fgetcsv() binary safe). (Ilia, Moriyoshi)
|
||||
- Fixed bug #25963 (PostgreSQL error message include \n characters).
|
||||
(Marcus, Ilia)
|
||||
- Fixed bug #25939 (feof() not working correctly for sockets). (Wez)
|
||||
- Fixed bug #25916 (get_browser() -> PHP Fatal error: Nesting level too
|
||||
deep - recursive dependency?). (Uwe Schindler)
|
||||
- Fixed bug #25794 (Cannot open existing hash db3 file with write" ext/dba).
|
||||
(Marcus)
|
||||
- Fixed bug #25753 (php.ini settings "leak" from vhosts/.htaccess files).
|
||||
(Patch by: rover at tob dot ru)
|
||||
- Fixed bug #25694 (round() and number_format() give inconsistent results).
|
||||
(Ilia)
|
||||
- Fixed bug #25664 (calling ITypeInfo::Invoke with bogus params). (Wez)
|
||||
- Fixed bug #25581 (getimagesize () return incorrect values on bitmap (os2)
|
||||
files). (Marcus)
|
||||
- Fixed bug #25329 (sqlite_create_function with method and reference to
|
||||
$this). (Marcus).
|
||||
- Fixed bug #24773 (unsetting string as array causes a crash). (Sara)
|
||||
- Fixed bug #24773 (Unsetting string offsets crashes PHP). (Moriyoshi, Sara)
|
||||
- Fixed bug #24582 (extensions can't be loaded dynamically in Solaris/iPlanet).
|
||||
(Jani)
|
||||
- Fixed bug #23467 (date('T') outputs incorrect Time Zone).
|
||||
(Jani, scottmacvicar at ntlworld dot com)
|
||||
- Fixed bug #22403 (PHP crashes when executing a sql procedure without
|
||||
parameters). (Timm)
|
||||
- Fixed bug #22127 (Invalid response code when force-cgi-redirect safety
|
||||
mechanism is triggered). (Ilia, scottmacvicar at ntlworld dot com)
|
||||
- Fixed bug #21760 (Use of uninitialized pointer inside php_read()).
|
||||
(Ilia, uce at ftc dot gov)
|
||||
- Fixed bug #21513 (shutdown functions not executed if timed out). (Zeev)
|
||||
- Fixed bug #21070 (ftp_genlist/ANSI-tmpfile() fail w/ some platform). (Sara)
|
||||
|
||||
3 Nov 2003, Version 4.3.4
|
||||
- Made MCVE extension available on win32. (Jani)
|
||||
- Upgraded bundled libfcgi and made FastCGI support viable on Win32. (Sascha)
|
||||
- Added apache_get_version() function. (Ilia)
|
||||
- Fixed disk_total_space() and disk_free_space() under FreeBSD. (Jon Parise)
|
||||
- Fixed crash bug when non-existing save/serializer handler was used. (Jani)
|
||||
- Fixed memory leak in gethostbynamel() if an error occurs. (Sara)
|
||||
- Fixed FastCGI being unable to bind to a specific IP. (Sascha)
|
||||
- Fixed multibyte regex engine to properly handle ".*" pattern under
|
||||
POSIX compatible mode. (K.Kosako <kosako at sofnec.co.jp>, Moriyoshi)
|
||||
- Fixed bug #25955 (Compile failure on MacOSX 10.3 Panther). (Marko, Dan)
|
||||
- Fixed bug #25923 (mail() modifies the to & subject arguments). (Ilia)
|
||||
- Fixed bug #25922 (Crash in error handler when 5th argument is modified).
|
||||
(Ilia)
|
||||
- Fixed bug #25918 (Possible crash in mime_content_type()). (Ilia)
|
||||
- Fixed bug #25900 (document->get_elements_by_tag_name with default xmlns).
|
||||
(Rob)
|
||||
- Fixed bug #25895 (Incorrect detection of safe_mode limited ini options).
|
||||
(Ilia)
|
||||
- Fixed bug #25888 (Crash of php.exe when xpath_eval of a namespace). (Rob)
|
||||
- Fixed bug #25836 (last key of multi-dimensional array passed via GPC not
|
||||
being escaped when magic_quotes_gpc is on). (Ilia)
|
||||
- Fixed bug #25825 (tzset() was not called to reset libc environment on
|
||||
request shutdown). (Wez)
|
||||
- Fixed bug #25814 (Make flock() return correct value when 3rd argument is
|
||||
used). (Ilia)
|
||||
- Fixed bug #25800 (parse_url() could not parse urls with empty port). (Ilia)
|
||||
- Fixed bug #25780 (ext/session: invalid "session.cookie_lifetime" makes
|
||||
session_start() to crash in win32). (Jani)
|
||||
- Fixed bug #25777 (Do not rtrim() of text fields fetched from mssql). (Ilia)
|
||||
- Fixed bug #25770 (Segfault with PHP and bison 1.875).
|
||||
(eggert@gnu.org, Marcus)
|
||||
- Fixed bug #25764 (ldap_get_option() crashes with unbound ldap link). (Jani)
|
||||
- Fixed bug #25758 (var_export does not escape ' & \ inside array keys).
|
||||
(Ilia)
|
||||
- Fixed bug #25752 (ext/ncurses: ncurses.h instead of curses.h with BSD).
|
||||
(Jani)
|
||||
- Fixed bug #25746 (Do not bail out when unable to chdir original dir on
|
||||
systems with broken getcwd()). (Ilia)
|
||||
- Fixed bug #25745 (ctype functions fail with non-ascii characters).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #25744 (make ZTS build of ext/sybase compile). (Ilia)
|
||||
- Fixed bug #25738 (alloca() related issues on the Darwin platform).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #25708 (extract($GLOBALS, EXTR_REFS) mangles $GLOBALS).
|
||||
(Moriyoshi)
|
||||
- Fixed bug #25707 (html_entity_decode() over-decodes &lt;). (Moriyoshi)
|
||||
- Fixed bug #25703 (openssl configure check failed). (Jani)
|
||||
- Fixed bug #25701 (On flush() set headers_sent in apache2handler). (Ilia)
|
||||
- Fixed bug #25671 (str_replace() corrupts subarrays). (Sara)
|
||||
- Fixed bug #25669 (eregi() with non-ascii characters). (Moriyoshi)
|
||||
- Fixed bug #25665 (var_dump() hangs on Nan and INF). (Ilia)
|
||||
- Fixed bug #25648 (xslt_set_encoding() not detected correctly). (Jani)
|
||||
- Fixed bug #25636 (SNMP Session not closed on success).
|
||||
(Ilia, patch by: nesslage at mwsc dot edu)
|
||||
- Fixed bug #25635 (Make "make tests" to fail due to invalid include_path).
|
||||
(Ilia)
|
||||
- Fixed bug #25604 (HAVE_SNMP_PARSE_OID undefined with phpize build). (Jani)
|
||||
- Fixed bug #25583 (Incorrect handling of paths starting with "/" on win32
|
||||
inside glob() function). (Ilia)
|
||||
- Fixed bug #25570 (Possible crash in apache2handler when zend_bailout called
|
||||
outside of zend_try {} block). (Ilia)
|
||||
- Fixed bug #25558 (ext/dbase: reverted fix for bug #23463). (Vlad)
|
||||
- Fixed bug #25530 (checkdate() incorrectly handles floats). (Ilia)
|
||||
- Fixed bug #25525 (ldap_explode_dn() crashes when passed invalid dn).
|
||||
(Sara, patch by: mikael dot suvi at trigger dot ee)
|
||||
- Fixed bug #25504 (pcre_match_all() crashes when passed only 2 parameters).
|
||||
(Jani)
|
||||
- Fixed bug #25483 (ext/informix: bogus -469 error from ifx_query()).
|
||||
(Jani, patch by: denisov at kubsu dot ru)
|
||||
- Fixed bug #25463 (ext/cpdf: compile failure with bundled GD)
|
||||
- Fixed bug #25429 (fix copying of stdin using copy() function). (Ilia)
|
||||
- Fixed bug #25424 (ext/informix: lvarchar not supported in win32). (Jani)
|
||||
- Fixed bug #25404 (ext/pgsql: open transactions not closed when script ends).
|
||||
(Marcus)
|
||||
- Fixed bug #25385 (ob_gzhandler(): typo in sapi_add_header_ex() call). (Jani)
|
||||
- Fixed bug #25378 (unserialize() crashes with invalid data). (Jani)
|
||||
- Fixed bug #25372 (sscanf() does not work with %X). (Jani)
|
||||
- Fixed bug #25348 ("make install" fails with --enable-short-tags). (Jani)
|
||||
- Fixed bug #25343 (is_dir() gives warning on FreeBSD). (Jani)
|
||||
- Fixed bug #25333 (Possible body corruption & crash in win32 mail()). (Ilia)
|
||||
- Fixed bug #25316 (Possible infinite loop inside _php_stream_write()). (Ilia)
|
||||
- Fixed bug #25314 (FTP_ASCII mode behaving like binary from Win->Unix).
|
||||
(Sara)
|
||||
- Fixed bug #25308 (php -m crashes when zend extensions are loaded). (Stas)
|
||||
- Fixed bug #25307 (Crash with WDDX serializer). (Sascha, Jani)
|
||||
- Fixed bug #25295 (QNX6: php_ini.c:414: 'alphasort' undeclared). (Jani)
|
||||
- Fixed bug #25294 (ext/ftp: NLST failure leads to crash on exit). (Sara, Rob)
|
||||
- Fixed bug #25293 (Output correct EOL to error_log). (Ilia)
|
||||
- Fixed bug #25239 (ftp_fopen_wrapper not RFC compliant). (Sara)
|
||||
- Fixed bug #25218 ("deflate" compressed pages had a gzip header). (Stefan)
|
||||
- Fixed bug #25211 (image.c compile failure with AIX). (Marcus)
|
||||
- Fixed bug #25166 (WDDX serializer handler missing in win32). (Jani)
|
||||
- Fixed bug #25109 (Possible crash when fetching field names in pgsql). (Ilia)
|
||||
- Fixed bug #25106 (Added more stringent checks on bzopen() mode). (Ilia)
|
||||
- Fixed bug #25070 (unlock session files on win32 before closing them). (Ilia)
|
||||
- Fixed bug #24402 (Compile failure with gettext 0.12.x). (Jani)
|
||||
- Fixed bug #23488 (zlib.output_compression overrides Vary header). (Stefan)
|
||||
- Fixed bug #23326 (ext/domxml: Attributes via append_child not supported).
|
||||
(Melvyn)
|
||||
- Fixed bug #21220 (Wrong Apache version shown in phpinfo() output). (Jani)
|
||||
- Fixed bug #18534 (ifx_close() leaves open session). (nobbie@php.net)
|
||||
- Fixed bug #14049 (realpath() returns invalid results for non-existent
|
||||
paths). (Ilia)
|
||||
|
||||
25 Aug 2003, Version 4.3.3
|
||||
- Upgraded the bundled Expat library to version 1.95.6. (Jani)
|
||||
- Upgraded the bundled PCRE library to version 4.3. (Andrei)
|
||||
- Upgraded the bundled GD library to version GD 2.0.15. (Ilia)
|
||||
19 Jun 2003, Version 4.3.3RC1
|
||||
- Synchronized bundled GD library with GD 2.0.15. (Ilia)
|
||||
- Improved the engine to use POSIX/socket IO where feasible. (Sascha)
|
||||
- Improved the NSAPI SAPI module (Uwe Schindler)
|
||||
. php4_init (magnus.conf): new parameter to set alternate path to php.ini.
|
||||
(php_ini="/path/to/php.ini")
|
||||
. php4_execute (obj.conf): support for additional php.ini values.
|
||||
Allows different settings per virtual server.
|
||||
(See sapi/nsapi/nsapi-readme.txt for more information)
|
||||
. Added support for virtual()
|
||||
. Added "nsapi.read_timeout" php.ini option.
|
||||
. Synced $_SERVER variables to be similar to Apache variables
|
||||
- Improved the IMAP extension (Ilia)
|
||||
. Added imap_timeout() function. (bug #24161)
|
||||
. Added optional 'charset' parameter to imap_search() and imap_sort().
|
||||
@@ -391,120 +20,31 @@ PHP 4 NEWS
|
||||
. Added transaction constants: IBASE_REC_VERSION, IBASE_REC_NO_VERSION,
|
||||
IBASE_WRITE, IBASE_WAIT and IBASE_CONCURRENCY. (bugs #8797, #23887)
|
||||
. Made numeric/decimal datatype handling work on any platform.
|
||||
- Improved the NSAPI SAPI module (Uwe Schindler)
|
||||
. Added possibility to use PHP to generate HTTP error pages (404 Not Found..)
|
||||
. Added possibility to use PHP to generate directory listings for directories
|
||||
without index.html
|
||||
. php4_init (magnus.conf): new parameter to set alternate path to php.ini.
|
||||
(php_ini="/path/to/php.ini")
|
||||
. php4_execute (obj.conf): support for additional php.ini values.
|
||||
Allows different settings per virtual server.
|
||||
(See sapi/nsapi/nsapi-readme.txt for more information)
|
||||
. Added support for virtual().
|
||||
. Added nsapi_request_headers() and nsapi_response_headers() with aliases
|
||||
for apache compatibility.
|
||||
. Added "nsapi.read_timeout" php.ini option.
|
||||
. Synced $_SERVER variables to be similar to Apache variables.
|
||||
- Added DBA handler 'inifile' to support ini files. (Marcus)
|
||||
- Added a "DEBUG" note to 'php -v' output when --enable-debug is used. (Derick)
|
||||
- Added long options into CLI & CGI (e.g. --version). (Marcus)
|
||||
- Added a new parameter to preg_match*() that can be used to specify
|
||||
the starting offset in the subject string to match from. (Andrei)
|
||||
- Fixed possible integer overflows in:
|
||||
. base64_encode(). (Moriyoshi)
|
||||
. bundled GD library. (Ilia)
|
||||
- Fixed "mysql.connect_timeout" php.ini option to be settable with ini_set().
|
||||
(Rasmus)
|
||||
- Fixed FastCGI IIS document root problem. (Shane)
|
||||
- Fixed corruption of multibyte character including 0x5c as second
|
||||
byte in multipart/form-data. (Rui)
|
||||
- Fixed possible crash in imagerotate() when an invalid color index
|
||||
is used for background color. (Pierre-Alain Joye)
|
||||
- Fixed a bug that under certain circumstances could invalidate safe_mode.
|
||||
(Ilia)
|
||||
- Fixed certificate version and allowed setting of the serial number in
|
||||
openssl_csr_sign(). (Stefan Roehrich)
|
||||
- Fixed each() to be binary safe for keys. (Zeev)
|
||||
- Fixed ext/yaz to not log if "yaz.log_file" php.ini option is not set. (Adam)
|
||||
- Fixed a bug in bundled libmysql (mysql bug #564). (Georg)
|
||||
- Fixed ext/exif to honor "magic_quotes_runtime" php.ini option. (Marcus)
|
||||
- Fixed bug #25093 (ext/pgsql: Various leaks due to non-freed queries). (Ilia)
|
||||
- Fixed bug #25084 (ext/session: Fixed session.referer_check to be independent
|
||||
on register_globals). (Ilia)
|
||||
- Fixed bug #25081 (odbc_fetch_array() may mangle numeric fields). (Ilia)
|
||||
- Fixed bug #25044 (header("Location:") changing HTTP status). (Marcus)
|
||||
- Fixed bug #25037 (win32 mail(): Possible infinite loop inside SendText()).
|
||||
(Ilia)
|
||||
- Fixed bug #25007 (rand() & mt_rand() seed RNG every call). (Jani)
|
||||
- Fixed bug #24989 (external libexpat conflicts with bundled libexpat). (Jani)
|
||||
- Fixed bug #24980 (array_reduce() uses first element as default running
|
||||
total). (Ilia)
|
||||
- Fixed bug #24977 (Reverted mysql_select_db() optimization). (Ilia)
|
||||
- Fixed bug #24958 (Apache2 SAPIs: Incorrect handling of 404s). (Ilia, Justin)
|
||||
- Fixed bug #24951 (ob_flush() needlessly destroys output handler). (Ilia)
|
||||
- Fixed bug #24936 (ext/fdf not linked properly as shared extension). (Jani)
|
||||
- Fixed bug #24909 (Bad random numbers with ZTS builds on Solaris). (Ilia)
|
||||
- Fixed bug #24897 (inconsistent behavior of shuffle() & array_multisort()).
|
||||
(Ilia, Jani)
|
||||
- Fixed bug #24883 ("variables_order" and "gpc_order" being ignored). (Ilia)
|
||||
- Fixed bug #24873 (incorrect handling of / inside open_basedir). (Ilia)
|
||||
- Fixed bug #24871 (aggregate(): methods misidentified as constructors). (Ilia)
|
||||
- Fixed bug #24827 (ob_gzhandler overrides Vary header). (Ilia)
|
||||
- Fixed bug #24792 (--enable-zend-multibyte causes random segfaults with ZTS).
|
||||
(Fujimoto)
|
||||
- Fixed bug #24783 (foreach($ar as $key => $val), $key not binary safe). (Zeev)
|
||||
- Fixed bug #24760 (non-default SNMP port number not working). (Jani)
|
||||
- Fixed bug #24752 (Unhandled "uniqueidentifier" field type).
|
||||
(Ilia, s.sonnenberg[at]coolspot.de)
|
||||
- Fixed bug #24710 (Crash when $obj->{0} is used). (Zeev)
|
||||
- Fixed bug #24663 (\n. sequences were not being escaped). (Ilia)
|
||||
- Fixed bug #24640 (var_export() and var_dump() can not output large floats).
|
||||
(Marcus)
|
||||
- Fixed bug #24629 (FreeBSD select() does not like large microseconds values).
|
||||
(Mirco Bauer).
|
||||
- Fixed bug #24609 (ext/domxml: segfault when using replace node across
|
||||
different docs). (Rob Richards)
|
||||
- Fixed bug #24594 (Rewrite of the imagefill() function). (Pierre-Alain Joye)
|
||||
- Fixed bug #24592 (NULL related crash in session extension). (Sascha)
|
||||
- Fixed bug #24573 (debug_backtrace() crashes if $this set to null). (Jani)
|
||||
- Fixed bug #24560 (parse_url() incorrectly handling certain file:// based
|
||||
schemas). (Ilia)
|
||||
- Fixed bug #24557 (make fclose() respect refcount on the resource).
|
||||
(Wez, Ilia)
|
||||
- Fixed bug #24537 (apache2 compile misses some include directories). (Jani)
|
||||
- Fixed bug #24535 (ext/mysql: crash when retrieving data from unbuffered
|
||||
result after the original connection has been changed). (Ilia)
|
||||
- Fixed bug #24519 (aggregate_methods_by_list() does not increment refcount).
|
||||
- Fixed bug #24313 (file_exists() warning on non-existent files when
|
||||
open_basedir is used). (Ilia)
|
||||
- Fixed bug #24312 (base64_decode() does not skip 0xF0-0xFF characters).
|
||||
(gereon.steffens[at]onvista.de, Ilia)
|
||||
- Fixed bug #24284 (Fixed memory leak inside pg_ping()). (Ilia)
|
||||
- Fixed bug #24249 (fdf_add_doc_javascript() not available on Windows). (Edin)
|
||||
- Fixed bug #24224 (ibase_blob_get() overflow). (Ard)
|
||||
- Fixed bug #24223 (missing variable initialization in bundled gd). (Ilia)
|
||||
- Fixed bug #24220 (range() didn't handle numeric strings correctly). (Ilia)
|
||||
- Fixed bug #24210 (not detecting assume_default_colors - typo). (Sara)
|
||||
- Fixed bug #24198 (Invalid recursion detection in array_merge_recurcive()).
|
||||
(Ilia)
|
||||
- Fixed bug #24177 (Apache2 SAPIs: status set incorrectly after flush()).
|
||||
(Ilia)
|
||||
- Fixed bug #24155 (gdImageRotate270 incorrectly use x parameter for y axis).
|
||||
(tom@gksystems.com, Ilia)
|
||||
- Fixed bug #24150 (crash in imap_fetch_overview() &
|
||||
- Fixed bug #24150 (crash in imap_fetch_overview() &
|
||||
imap_rfc822_write_address()). (Ilia)
|
||||
- Fixed bug #24142 (workaround for a gcc bug affecting round()). (Marcus, Ilia)
|
||||
- Fixed bug #24063 (serialize() missing 0 after the . on scientific notation).
|
||||
(Marcus, Ilia)
|
||||
- Fixed bug #24063 (scientific notation broken in *printf()). (Ilia)
|
||||
- Fixed bug #24060 (ncurses_del_panel() causes segfault). (Georg)
|
||||
- Fixed bug #24054 (Integer overflow failure with GCC/x86 for *=). (Sascha)
|
||||
- Fixed bug #24028 (Reading raw post message by php://input failed). (Jani)
|
||||
- Fixed bug #24009 (FastCGI handling of file not found). (Shane)
|
||||
- Fixed bug #24007 (Problem with register_globals & arrays). (Ilia)
|
||||
- Fixed bug #23951 (constants in static initializers clobbered by inheritance).
|
||||
(Wez, Zend Engine)
|
||||
- Fixed bug #23936 (ext/interbase: fail to select and fetch). (Ard)
|
||||
- Fixed bug #23913 (make rename() work across partitions on *nix). (Ilia)
|
||||
- Fixed bug #23912 (Invalid CSS in phpinfo() output). (Ilia)
|
||||
- Fixed bug #23902 (NULL in CGI header output). (Shane)
|
||||
@@ -513,50 +53,15 @@ PHP 4 NEWS
|
||||
- Fixed bug #23897 (Fixed a check for mbfilter_ru.h). (aleks@m2media.ru, Ilia)
|
||||
- Fixed bug #23894 (sprintf() decimal specifiers problem). (Moriyoshi)
|
||||
- Fixed bug #23888 (Missing input validation for flags parameter). (Ilia)
|
||||
- Fixed bug #23808 (broken imagecopymerge()). (Pierre-Alain Joye)
|
||||
- Fixed bug #23798 (Spaces were not being stripped from Bcc header). (Ilia)
|
||||
- Fixed bug #23792 (imagerotate() problems with limited platte, the function
|
||||
will always return true color image from now on). (Pierre-Alain Joye)
|
||||
- Fixed bug #23779 (mysql_connect(): disable local infile option if php.ini
|
||||
option "open_basedir" is set). (Georg)
|
||||
- Fixed bug #23769 (In FreeBSD glob() gives wrong result when pattern not
|
||||
found). (Hartmut)
|
||||
- Fixed bug #23733 (Coredump on startup with Oracle 9+). (Edin)
|
||||
- Fixed bug #23685 (fake values returned when OID value is an empty string).
|
||||
(Jani)
|
||||
- Fixed bug #23664 (FastCGI socket listenting). (Shane)
|
||||
- Fixed bug #23509 (exit code lost when exit() called from
|
||||
register_shutdown_function()). (Ilia)
|
||||
- Fixed bug #23463 (ext/dbase: added Dbase2 version check). (Vlad Krupin)
|
||||
- Fixed bug #23285 (Potential Stack overflow in zendlex). (Wez)
|
||||
- Fixed bug #23104 (hash position of static arrays not being reset). (Ilia)
|
||||
- Fixed bug #23038, #23574 (aggregate() related leaks and crashes). (Andrei)
|
||||
- Fixed bug #22947 (Ack() inside win32/sendmail.c may stall in certain
|
||||
situations). (Ilia)
|
||||
- Fixed bug #22690 (ob_start() did not work with create_function() callbacks).
|
||||
(Marcus)
|
||||
- Fixed bug #22592 (Cascading assignments to strings with curly braces broken).
|
||||
(Stas)
|
||||
- Fixed bug #22245 (References inside $_SESSION not being handled). (Ilia)
|
||||
- Fixed bug #22154 (Possible crash when memory_limit is reached and output
|
||||
buffering in addition to session.use_trans_sid is used). (Ilia)
|
||||
- Fixed bug #22072 (Apache2 sapis do not detect aborted connections). (Ilia)
|
||||
- Fixed bug #21958 (workaround for unusual realpath() on AIX & Tru64). (Ilia)
|
||||
- Fixed bug #21957 (serialize() mangles objects with __sleep). (Ilia)
|
||||
- Fixed bug #21918 (strange behaviour of mixed type in array-keys). (Marcus)
|
||||
- Fixed bug #21855 (Threading issue on HP-UX). (Roshan Naik, Andi, Moriyoshi)
|
||||
- Fixed bug #21611 (version_compare() does not support "p" as suffix).
|
||||
(Stefan Walk)
|
||||
- Fixed bug #21074 (Apache2: "ErrorDocument xxx /error.php" broken). (Jani)
|
||||
- Fixed bug #20896 (-s -w modes with php-cli cause php to hang). (Ilia)
|
||||
- Fixed bug #19613 (putenv("VAR=") does not empty VAR on win32). (Zeev)
|
||||
- Fixed bug #18744 (ibase_blob_add() has max limit of 64k). (Ard)
|
||||
- Fixed bug #18291 (escapeshellcmd() can now handle quoted arguments). (Ilia)
|
||||
- Fixed bug #17414 (pthreads bug workaround). (timo.teras[at]iki.fi)
|
||||
- Fixed bug #13142 (strtotime not handling "M d H:i:s Y" format). (Ilia)
|
||||
- Fixed bug #11924 (ibase_query(), ibase_execute() mangled passed parameters).
|
||||
(Jani)
|
||||
- Fixed bug #7014 (crash in _php_ibase_error() after request shutdown). (Ard)
|
||||
|
||||
29 May 2003, Version 4.3.2
|
||||
- Syncronized bundled GD library with GD 2.0.12. (Ilia)
|
||||
|
||||
@@ -37,7 +37,7 @@ Note though that you might get little response, if your patch is
|
||||
too hard to review.
|
||||
|
||||
If you would like change/add many lines, it is better to ask module
|
||||
maintainer and/or internals@lists.php.net, or pear-dev@lists.php.net if
|
||||
maintainer and/or php-dev@lists.php.net, or pear-dev@lists.php.net if
|
||||
you are patching PEAR. Official module maintainers can be found in
|
||||
EXTENSIONS file in PHP source.
|
||||
|
||||
@@ -79,7 +79,7 @@ Check list for submitting patch
|
||||
|
||||
Where to send your patch?
|
||||
-------------------------
|
||||
If you are patching C source, send the patch to internals@lists.php.net.
|
||||
If you are patching C source, send the patch to php-dev@lists.php.net.
|
||||
If you are patching a module, you should also send the patch to the
|
||||
maintainer. Official module maintainers are listed in EXTENSION file
|
||||
in source.
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
- clean up .cvsignores
|
||||
- purge Makefile.ins and replace PHP_EXTENSION in config.m4s
|
||||
with appropiate calls to PHP_NEW_EXTENSION
|
||||
+1
-12
@@ -157,16 +157,7 @@ TSRM_API void tsrm_shutdown(void)
|
||||
int j;
|
||||
|
||||
next_p = p->next;
|
||||
for (j=0; j<p->count; j++) {
|
||||
/* Disabled - calling dtors in tsrm_shutdown makes
|
||||
modules registering TSRM ids to crash, if they have
|
||||
dtors, since the module is unloaded before tsrm_shutdown
|
||||
is called. Can be re-enabled after tsrm_free_id is
|
||||
implemented.
|
||||
if (resource_types_table && resource_types_table[j].dtor) {
|
||||
resource_types_table[j].dtor(p->storage[j], &p->storage);
|
||||
}
|
||||
*/
|
||||
for (j=0; j<id_count; j++) {
|
||||
free(p->storage[j]);
|
||||
}
|
||||
free(p->storage);
|
||||
@@ -190,7 +181,6 @@ TSRM_API void tsrm_shutdown(void)
|
||||
#if defined(GNUPTH)
|
||||
pth_kill();
|
||||
#elif defined(PTHREADS)
|
||||
pthread_setspecific(tls_key, 0);
|
||||
pthread_key_delete(tls_key);
|
||||
#elif defined(TSRM_WIN32)
|
||||
TlsFree(tls_key);
|
||||
@@ -491,7 +481,6 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
|
||||
if (mutexp) {
|
||||
#ifdef TSRM_WIN32
|
||||
DeleteCriticalSection(mutexp);
|
||||
free(mutexp);
|
||||
#elif defined(NETWARE)
|
||||
NXMutexFree(mutexp);
|
||||
#elif defined(GNUPTH)
|
||||
|
||||
+2
-3
@@ -95,15 +95,14 @@ dnl For the thread implementations, we always use --with-*
|
||||
dnl to maintain consistency
|
||||
|
||||
AC_ARG_WITH(tsrm-pth,
|
||||
[ --with-tsrm-pth[=pth-config]
|
||||
Use GNU Pth.],[
|
||||
[ --with-tsrm-pth[=pth-config] Use GNU Pth.],[
|
||||
TSRM_PTH=$withval
|
||||
],[
|
||||
TSRM_PTH=no
|
||||
])
|
||||
|
||||
AC_ARG_WITH(tsrm-st,
|
||||
[ --with-tsrm-st Use SGI's State Threads],[
|
||||
[ --with-tsrm-st],[
|
||||
TSRM_ST=$withval
|
||||
],[
|
||||
TSRM_ST=no
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#define HAVE_UTIME 1
|
||||
#define HAVE_ALLOCA 1
|
||||
#define HAVE_REALPATH 1
|
||||
|
||||
#include <malloc.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#ifndef __GNUC__
|
||||
# ifndef HAVE_ALLOCA_H
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
#pragma alloca
|
||||
# else
|
||||
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
||||
char *alloca ();
|
||||
|
||||
@@ -486,23 +486,19 @@ CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path
|
||||
CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC)
|
||||
{
|
||||
cwd_state new_state;
|
||||
char *retval;
|
||||
int retval;
|
||||
|
||||
CWD_STATE_COPY(&new_state, &CWDG(cwd));
|
||||
retval = virtual_file_ex(&new_state, path, NULL, 1);
|
||||
|
||||
if (virtual_file_ex(&new_state, path, NULL, 1)==0) {
|
||||
if (!retval) {
|
||||
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
|
||||
|
||||
memcpy(real_path, new_state.cwd, len);
|
||||
real_path[len] = '\0';
|
||||
retval = real_path;
|
||||
} else {
|
||||
retval = NULL;
|
||||
return real_path;
|
||||
}
|
||||
|
||||
CWD_STATE_FREE(&new_state);
|
||||
|
||||
return retval;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC)
|
||||
|
||||
+2
-29
@@ -41,10 +41,6 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__osf__) || defined(_AIX)
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifdef TSRM_WIN32
|
||||
#include "readdir.h"
|
||||
#include <sys/utime.h>
|
||||
@@ -61,10 +57,10 @@ typedef unsigned short mode_t;
|
||||
* to account for volume name that is unique to NetWare absolute paths
|
||||
*/
|
||||
#define COPY_WHEN_ABSOLUTE(path) 2
|
||||
#define IS_ABSOLUTE_PATH(path, len) \
|
||||
(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]))
|
||||
#define IS_ABSOLUTE_PATH(path, len) \
|
||||
(len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len)))
|
||||
|
||||
#elif defined(NETWARE)
|
||||
#ifdef HAVE_DIRENT_H
|
||||
@@ -159,25 +155,6 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC);
|
||||
CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC);
|
||||
#endif
|
||||
|
||||
/* On AIX & Tru64 when a file does not exist realpath() returns
|
||||
* NULL, and sets errno to ENOENT. Unlike in other libc implementations
|
||||
* the destination is not filled and remains undefined. Therefor, we
|
||||
* must populate it manually using strcpy as done on systems with no
|
||||
* realpath() function.
|
||||
*/
|
||||
#if defined(__osf__) || defined(_AIX)
|
||||
static char *php_realpath_hack(char *src, char *dest)
|
||||
{
|
||||
char *ret;
|
||||
|
||||
if ((ret = realpath(src, dest)) == NULL && errno == ENOENT) {
|
||||
return strcpy(dest, src);
|
||||
} else {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAVE_UTIME
|
||||
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC);
|
||||
#endif
|
||||
@@ -255,11 +232,7 @@ typedef struct _virtual_cwd_globals {
|
||||
#define VCWD_ACCESS(pathname, mode) access(pathname, mode)
|
||||
|
||||
#ifdef HAVE_REALPATH
|
||||
#if defined(__osf__) || defined(_AIX)
|
||||
#define VCWD_REALPATH(path, real_path) php_realpath_hack(path, real_path)
|
||||
#else
|
||||
#define VCWD_REALPATH(path, real_path) realpath(path, real_path)
|
||||
#endif
|
||||
#else
|
||||
#define VCWD_REALPATH(path, real_path) strcpy(real_path, path)
|
||||
#endif
|
||||
|
||||
@@ -359,13 +359,4 @@ TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
TSRM_API char *realpath(char *orig_path, char *buffer)
|
||||
{
|
||||
int ret = GetFullPathName(orig_path, _MAX_PATH, buffer, NULL);
|
||||
if(!ret || ret > _MAX_PATH) {
|
||||
return NULL;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
#endif
|
||||
@@ -101,5 +101,4 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags);
|
||||
TSRM_API int shmdt(const void *shmaddr);
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf);
|
||||
|
||||
TSRM_API char *realpath(char *orig_path, char *buffer);
|
||||
#endif
|
||||
+97
-156
@@ -16,9 +16,6 @@ AC_DEFUN([PHP_ADD_MAKEFILE_FRAGMENT],[
|
||||
sed -e "s#\$(srcdir)#$ac_srcdir#g" -e "s#\$(builddir)#$ac_builddir#g" $src >> Makefile.fragments
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_PROG_RE2C,[
|
||||
AC_CHECK_PROG(RE2C, re2c, re2c, [exit 0;])
|
||||
])
|
||||
|
||||
dnl PHP_DEFINE(WHAT[, value])
|
||||
dnl
|
||||
@@ -180,13 +177,73 @@ AC_DEFUN([PHP_REMOVE_USR_LIB],[
|
||||
unset ac_new_flags
|
||||
for i in [$]$1; do
|
||||
case [$]i in
|
||||
-L/usr/lib|-L/usr/lib/[)] ;;
|
||||
*[)] ac_new_flags="[$]ac_new_flags [$]i" ;;
|
||||
-L/usr/lib|-L/usr/lib/) ;;
|
||||
*) ac_new_flags="[$]ac_new_flags [$]i" ;;
|
||||
esac
|
||||
done
|
||||
$1=[$]ac_new_flags
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
if test "$PHP_OPENSSL" = "yes"; then
|
||||
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
|
||||
fi
|
||||
|
||||
for i in $PHP_OPENSSL; do
|
||||
if test -r $i/include/openssl/evp.h; then
|
||||
OPENSSL_INCDIR=$i/include
|
||||
fi
|
||||
if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
|
||||
OPENSSL_LIBDIR=$i/lib
|
||||
fi
|
||||
done
|
||||
|
||||
if test -z "$OPENSSL_INCDIR"; then
|
||||
AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
|
||||
fi
|
||||
|
||||
if test -z "$OPENSSL_LIBDIR"; then
|
||||
AC_MSG_ERROR([Cannot find OpenSSL's libraries])
|
||||
fi
|
||||
|
||||
old_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS=-I$OPENSSL_INCDIR
|
||||
AC_MSG_CHECKING([for OpenSSL version])
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include <openssl/opensslv.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
|
||||
yes
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT([>= 0.9.6])
|
||||
],[
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
|
||||
PHP_ADD_INCLUDE($OPENSSL_INCDIR)
|
||||
PHP_ADD_LIBPATH($OPENSSL_LIBDIR)
|
||||
|
||||
PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
|
||||
PHP_ADD_LIBRARY(crypto)
|
||||
],[
|
||||
AC_MSG_ERROR([libcrypto not found!])
|
||||
],[
|
||||
-L$OPENSSL_LIBDIR
|
||||
])
|
||||
|
||||
PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
|
||||
PHP_ADD_LIBRARY(ssl)
|
||||
],[
|
||||
AC_MSG_ERROR([libssl not found!])
|
||||
],[
|
||||
-L$OPENSSL_LIBDIR
|
||||
])
|
||||
|
||||
OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR
|
||||
AC_SUBST(OPENSSL_INCDIR_OPT)
|
||||
])
|
||||
|
||||
dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD)
|
||||
dnl
|
||||
dnl Use this macro, if you need to add libraries and or library search
|
||||
@@ -196,11 +253,11 @@ dnl
|
||||
AC_DEFUN([PHP_EVAL_LIBLINE],[
|
||||
for ac_i in $1; do
|
||||
case $ac_i in
|
||||
-l*[)]
|
||||
-l*)
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
PHP_ADD_LIBRARY($ac_ii,1,$2)
|
||||
;;
|
||||
-L*[)]
|
||||
-L*)
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
PHP_ADD_LIBPATH($ac_ii,$2)
|
||||
;;
|
||||
@@ -216,7 +273,7 @@ dnl
|
||||
AC_DEFUN([PHP_EVAL_INCLINE],[
|
||||
for ac_i in $1; do
|
||||
case $ac_i in
|
||||
-I*[)]
|
||||
-I*)
|
||||
ac_ii=`echo $ac_i|cut -c 3-`
|
||||
PHP_ADD_INCLUDE($ac_ii)
|
||||
;;
|
||||
@@ -280,10 +337,10 @@ AC_DEFUN([PHP_SHLIB_SUFFIX_NAME],[
|
||||
PHP_SUBST(SHLIB_SUFFIX_NAME)
|
||||
SHLIB_SUFFIX_NAME=so
|
||||
case $host_alias in
|
||||
*hpux*[)]
|
||||
*hpux*)
|
||||
SHLIB_SUFFIX_NAME=sl
|
||||
;;
|
||||
*darwin*[)]
|
||||
*darwin*)
|
||||
SHLIB_SUFFIX_NAME=dylib
|
||||
;;
|
||||
esac
|
||||
@@ -454,17 +511,17 @@ AC_DEFUN([PHP_ARG_ANALYZE_EX],[
|
||||
ext_output="yes, shared"
|
||||
ext_shared=yes
|
||||
case [$]$1 in
|
||||
shared,*[)]
|
||||
shared,*)
|
||||
$1=`echo "[$]$1"|sed 's/^shared,//'`
|
||||
;;
|
||||
shared[)]
|
||||
shared)
|
||||
$1=yes
|
||||
;;
|
||||
no[)]
|
||||
no)
|
||||
ext_output=no
|
||||
ext_shared=no
|
||||
;;
|
||||
*[)]
|
||||
*)
|
||||
ext_output=yes
|
||||
ext_shared=no
|
||||
;;
|
||||
@@ -597,8 +654,8 @@ main() {
|
||||
])
|
||||
])
|
||||
case $ac_cv_time_r_type in
|
||||
hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;;
|
||||
irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;;
|
||||
hpux) AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;;
|
||||
irix) AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;;
|
||||
esac
|
||||
])
|
||||
|
||||
@@ -1067,7 +1124,6 @@ AC_DEFUN([PHP_CHECK_CC_OPTION],[
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
rm -rf conftest*
|
||||
])
|
||||
|
||||
AC_DEFUN([PHP_REGEX],[
|
||||
@@ -1130,9 +1186,7 @@ main() {
|
||||
int res = 0;
|
||||
res = res || (snprintf(buf, 2, "marcus") != 6);
|
||||
res = res || (buf[1] != '\0');
|
||||
/* Implementations may consider this as an encoding error */
|
||||
snprintf(buf, 0, "boerger");
|
||||
/* However, they MUST ignore the pointer */
|
||||
res = res || (snprintf(buf, 0, "boerger") != 7);
|
||||
res = res || (buf[0] != 'm');
|
||||
res = res || (snprintf(NULL, 0, "boerger") != 7);
|
||||
res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8);
|
||||
@@ -1153,21 +1207,20 @@ main() {
|
||||
fi
|
||||
])
|
||||
|
||||
dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx)
|
||||
dnl PHP_SHARED_MODULE(module-name, object-var, build-dir)
|
||||
dnl
|
||||
dnl Basically sets up the link-stage for building module-name
|
||||
dnl from object_var in build-dir.
|
||||
dnl
|
||||
AC_DEFUN([PHP_SHARED_MODULE],[
|
||||
install_modules="install-modules"
|
||||
PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.la"
|
||||
PHP_SUBST($2)
|
||||
cat >>Makefile.objects<<EOF
|
||||
\$(phplibdir)/$1.la: $3/$1.la
|
||||
\$(LIBTOOL) --mode=install cp $3/$1.la \$(phplibdir)
|
||||
|
||||
$3/$1.la: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES)
|
||||
\$(LIBTOOL) --mode=link ifelse($4,,[\$(CC)],[\$(CXX)]) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
|
||||
$3/$1.la: \$($2) \$(translit($1,a-z-,A-Z_)_SHARED_DEPENDENCIES)
|
||||
\$(LIBTOOL) --mode=link \$(CC) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z-,A-Z_)_SHARED_LIBADD)
|
||||
|
||||
EOF
|
||||
])
|
||||
@@ -1183,10 +1236,10 @@ AC_DEFUN([PHP_SELECT_SAPI],[
|
||||
PHP_SAPI=$1
|
||||
|
||||
case "$2" in
|
||||
static[)] PHP_BUILD_STATIC;;
|
||||
shared[)] PHP_BUILD_SHARED;;
|
||||
bundle[)] PHP_BUILD_BUNDLE;;
|
||||
program[)] PHP_BUILD_PROGRAM($5);;
|
||||
static) PHP_BUILD_STATIC;;
|
||||
shared) PHP_BUILD_SHARED;;
|
||||
bundle) PHP_BUILD_BUNDLE;;
|
||||
program) PHP_BUILD_PROGRAM($5);;
|
||||
esac
|
||||
|
||||
ifelse($3,,,[PHP_ADD_SOURCES([sapi/$1],[$3],[$4],[sapi])])
|
||||
@@ -1194,7 +1247,7 @@ AC_DEFUN([PHP_SELECT_SAPI],[
|
||||
|
||||
dnl deprecated
|
||||
AC_DEFUN([PHP_EXTENSION],[
|
||||
sources=`$AWK -f $abs_srcdir/build/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in`
|
||||
sources=`$AWK -f $abs_srcdir/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in`
|
||||
|
||||
PHP_NEW_EXTENSION($1, $sources, $2, $3)
|
||||
|
||||
@@ -1212,7 +1265,7 @@ AC_DEFUN([PHP_GEN_BUILD_DIRS],[
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags[, cxx]]]])
|
||||
dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]])
|
||||
dnl
|
||||
dnl Includes an extension in the build.
|
||||
dnl
|
||||
@@ -1242,7 +1295,7 @@ dnl ---------------------------------------------- Static module
|
||||
if test "$3" = "shared" || test "$3" = "yes"; then
|
||||
dnl ---------------------------------------------- Shared module
|
||||
PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
|
||||
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
|
||||
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir)
|
||||
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module)
|
||||
fi
|
||||
fi
|
||||
@@ -1272,13 +1325,13 @@ AC_DEFUN([PHP_SOLARIS_PIC_WEIRDNESS],[
|
||||
if test -n "$EXT_SHARED"; then
|
||||
os=`uname -sr 2>/dev/null`
|
||||
case $os in
|
||||
"SunOS 5.6"|"SunOS 5.7"[)]
|
||||
"SunOS 5.6"|"SunOS 5.7")
|
||||
case $CC in
|
||||
gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";;
|
||||
*[)] CFLAGS="$CFLAGS -fpic";;
|
||||
*) CFLAGS="$CFLAGS -fpic";;
|
||||
esac
|
||||
AC_MSG_RESULT([yes]);;
|
||||
*[)]
|
||||
*)
|
||||
AC_MSG_RESULT([no]);;
|
||||
esac
|
||||
else
|
||||
@@ -1316,8 +1369,8 @@ AC_DEFUN([PHP_SYS_LFS],
|
||||
ac_shellvars='CPPFLAGS LDFLAGS LIBS'
|
||||
for ac_shellvar in $ac_shellvars; do
|
||||
case $ac_shellvar in
|
||||
CPPFLAGS[)] ac_lfsvar=LFS_CFLAGS ;;
|
||||
*[)] ac_lfsvar=LFS_$ac_shellvar ;;
|
||||
CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
|
||||
*) ac_lfsvar=LFS_$ac_shellvar ;;
|
||||
esac
|
||||
eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
|
||||
(getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
|
||||
@@ -1326,14 +1379,14 @@ AC_DEFUN([PHP_SYS_LFS],
|
||||
eval ac_test_$ac_shellvar=\$ac_getconf
|
||||
done
|
||||
case "$ac_result$ac_getconfs" in
|
||||
yes[)] ac_result=no ;;
|
||||
yes) ac_result=no ;;
|
||||
esac
|
||||
case "$ac_result$ac_set" in
|
||||
yes?*[)] ac_result="yes, but $ac_set is already set, so use its settings"
|
||||
yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
|
||||
esac
|
||||
AC_MSG_RESULT([$ac_result])
|
||||
case $ac_result in
|
||||
yes[)]
|
||||
yes)
|
||||
for ac_shellvar in $ac_shellvars; do
|
||||
eval $ac_shellvar=\$ac_test_$ac_shellvar
|
||||
done ;;
|
||||
@@ -1403,10 +1456,10 @@ AC_DEFUN([PHP_BROKEN_GETCWD],[
|
||||
AC_MSG_CHECKING([for broken getcwd])
|
||||
os=`uname -sr 2>/dev/null`
|
||||
case $os in
|
||||
SunOS*[)]
|
||||
SunOS*)
|
||||
AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd])
|
||||
AC_MSG_RESULT([yes]);;
|
||||
*[)]
|
||||
*)
|
||||
AC_MSG_RESULT([no]);;
|
||||
esac
|
||||
])
|
||||
@@ -1547,18 +1600,12 @@ dnl Wrapper for AC_CHECK_LIB
|
||||
dnl
|
||||
AC_DEFUN([PHP_CHECK_LIBRARY], [
|
||||
save_old_LDFLAGS=$LDFLAGS
|
||||
ac_stuff="$5"
|
||||
|
||||
save_ext_shared=$ext_shared
|
||||
ext_shared=yes
|
||||
PHP_EVAL_LIBLINE([$]ac_stuff, LDFLAGS)
|
||||
LDFLAGS="$5 $LDFLAGS"
|
||||
AC_CHECK_LIB([$1],[$2],[
|
||||
LDFLAGS=$save_old_LDFLAGS
|
||||
ext_shared=$save_ext_shared
|
||||
$3
|
||||
],[
|
||||
LDFLAGS=$save_old_LDFLAGS
|
||||
ext_shared=$save_ext_shared
|
||||
unset ac_cv_func_$1
|
||||
$4
|
||||
])dnl
|
||||
@@ -1584,112 +1631,6 @@ AC_DEFUN([PHP_CHECK_FRAMEWORK], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_SETUP_OPENSSL(shared-add [, action-found [, action-not-found]])
|
||||
dnl
|
||||
dnl Common setup macro for openssl
|
||||
dnl
|
||||
AC_DEFUN([PHP_SETUP_OPENSSL],[
|
||||
found_openssl=no
|
||||
unset OPENSSL_INCDIR
|
||||
unset OPENSSL_LIBDIR
|
||||
|
||||
dnl First try to find pkg-config
|
||||
if test -z "$PKG_CONFIG"; then
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
fi
|
||||
|
||||
dnl If pkg-config is found try using it
|
||||
if test "$PHP_OPENSSL" = "yes" && test -x "$PKG_CONFIG" && $PKG_CONFIG --exists openssl; then
|
||||
if $PKG_CONFIG --atleast-version=0.9.6 openssl; then
|
||||
found_openssl=yes
|
||||
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl`
|
||||
OPENSSL_INCS=`$PKG_CONFIG --cflags-only-I openssl`
|
||||
OPENSSL_INCDIR=`$PKG_CONFIG --variable=includedir openssl`
|
||||
else
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
fi
|
||||
|
||||
if test -n "$OPENSSL_LIBS" && test -n "$OPENSSL_INCS"; then
|
||||
PHP_EVAL_LIBLINE($OPENSSL_LIBS, $1)
|
||||
PHP_EVAL_INCLINE($OPENSSL_INCS)
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
dnl If pkg-config fails for some reason, revert to the old method
|
||||
if test "$PHP_OPENSSL" = "yes"; then
|
||||
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
|
||||
fi
|
||||
|
||||
for i in $PHP_OPENSSL; do
|
||||
if test -r $i/include/openssl/evp.h; then
|
||||
OPENSSL_INCDIR=$i/include
|
||||
fi
|
||||
if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
|
||||
OPENSSL_LIBDIR=$i/lib
|
||||
fi
|
||||
test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
|
||||
done
|
||||
|
||||
if test -z "$OPENSSL_INCDIR"; then
|
||||
AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
|
||||
fi
|
||||
|
||||
if test -z "$OPENSSL_LIBDIR"; then
|
||||
AC_MSG_ERROR([Cannot find OpenSSL's libraries])
|
||||
fi
|
||||
|
||||
old_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS=-I$OPENSSL_INCDIR
|
||||
AC_MSG_CHECKING([for OpenSSL version])
|
||||
AC_EGREP_CPP(yes,[
|
||||
#include <openssl/opensslv.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
|
||||
yes
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT([>= 0.9.6])
|
||||
],[
|
||||
AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
|
||||
])
|
||||
CPPFLAGS=$old_CPPFLAGS
|
||||
|
||||
PHP_ADD_INCLUDE($OPENSSL_INCDIR)
|
||||
|
||||
PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
|
||||
PHP_ADD_LIBRARY(crypto,,$1)
|
||||
],[
|
||||
AC_MSG_ERROR([libcrypto not found!])
|
||||
],[
|
||||
-L$OPENSSL_LIBDIR
|
||||
])
|
||||
|
||||
old_LIBS=$LIBS
|
||||
LIBS="$LIBS -lcrypto"
|
||||
PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
|
||||
found_openssl=yes
|
||||
],[
|
||||
AC_MSG_ERROR([libssl not found!])
|
||||
],[
|
||||
-L$OPENSSL_LIBDIR
|
||||
])
|
||||
LIBS=$old_LIBS
|
||||
PHP_ADD_LIBRARY(ssl,,$1)
|
||||
|
||||
PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
|
||||
fi
|
||||
|
||||
dnl For apache 1.3.x static build
|
||||
OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR
|
||||
AC_SUBST(OPENSSL_INCDIR_OPT)
|
||||
|
||||
if test "$found_openssl" = "yes"; then
|
||||
ifelse([$2],[],:,[$2])
|
||||
ifelse([$3],[],,[else $3])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]])
|
||||
dnl
|
||||
@@ -1824,12 +1765,12 @@ AC_DEFUN([PHP_CHECK_FUNC],[
|
||||
AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
|
||||
|
||||
case $found in
|
||||
yes[)]
|
||||
yes)
|
||||
PHP_DEF_HAVE($1)
|
||||
ac_cv_func_$1=yes
|
||||
;;
|
||||
ifelse($#,1,,[
|
||||
*[)] PHP_CHECK_FUNC_LIB($@) ;;
|
||||
*) PHP_CHECK_FUNC_LIB($@) ;;
|
||||
])
|
||||
esac
|
||||
])
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ snapshot:
|
||||
md5sum $$distname.tar.bz2; \
|
||||
bzip2 -t $$distname.tar.bz2
|
||||
|
||||
cvsclean-work:
|
||||
cvsclean:
|
||||
@for i in `find . -name .cvsignore`; do \
|
||||
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore | grep -v config.nice` *.o *.a .libs || true); \
|
||||
done
|
||||
|
||||
+2
-7
@@ -52,13 +52,8 @@ $(TOUCH_FILES):
|
||||
touch $(TOUCH_FILES)
|
||||
|
||||
aclocal.m4: configure.in acinclude.m4
|
||||
@echo rebuilding $@
|
||||
@libtoolize=`./build/shtool path glibtoolize libtoolize`; \
|
||||
$$libtoolize --copy --automake; \
|
||||
ltpath=`dirname $$libtoolize`; \
|
||||
ltfile=`cd $$ltpath/../share/aclocal; pwd`/libtool.m4; \
|
||||
cat acinclude.m4 $$ltfile > $@
|
||||
|
||||
aclocal 2>&1 | $(SUPPRESS_WARNINGS)
|
||||
|
||||
configure: aclocal.m4 configure.in $(config_m4_files)
|
||||
@echo rebuilding $@
|
||||
@autoconf 2>&1 | $(SUPPRESS_WARNINGS)
|
||||
+35
-15
@@ -16,7 +16,7 @@
|
||||
# | Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id: buildcheck.sh,v 1.21.2.6 2003-09-28 13:37:59 tal Exp $
|
||||
# $Id: buildcheck.sh,v 1.21.2.3 2003-05-19 13:14:06 sniper Exp $
|
||||
#
|
||||
|
||||
echo "buildconf: checking installation..."
|
||||
@@ -24,7 +24,7 @@ echo "buildconf: checking installation..."
|
||||
stamp=$1
|
||||
|
||||
# autoconf 2.13 or newer
|
||||
ac_version=`autoconf --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
ac_version=`autoconf --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
if test -z "$ac_version"; then
|
||||
echo "buildconf: autoconf not found."
|
||||
echo " You need autoconf version 2.13 or newer installed"
|
||||
@@ -50,17 +50,39 @@ if test "$1" = "2" && test "$2" -ge "50"; then
|
||||
stamp=
|
||||
fi
|
||||
|
||||
# libtoolize 1.4.3 or newer
|
||||
# Prefer glibtoolize over libtoolize for Mac OS X compatibility
|
||||
libtoolize=`./build/shtool path glibtoolize libtoolize 2> /dev/null`
|
||||
lt_pversion=`$libtoolize --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//'`
|
||||
|
||||
# automake 1.4 or newer
|
||||
am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
|
||||
am_version_clean=`echo $am_version|sed -e 's/-p[0-9]*$//'`
|
||||
if test "$am_version" = ""; then
|
||||
echo "buildconf: automake not found."
|
||||
echo " You need automake version 1.4 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
fi
|
||||
IFS=.; set $am_version_clean; IFS=' '
|
||||
if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then
|
||||
echo "buildconf: automake version $am_version found."
|
||||
echo " You need automake version 1.4 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
else
|
||||
echo "buildconf: automake version $am_version (ok)"
|
||||
fi
|
||||
|
||||
# libtool 1.4.3 or newer
|
||||
# Prefer glibtool over libtool for Mac OS X compatibility
|
||||
libtool=`./build/shtool path glibtool 2> /dev/null`
|
||||
if test ! -r "$libtool"; then libtool=`./build/shtool path libtool`; fi
|
||||
lt_pversion=`$libtool --version 2>/dev/null|sed -n -e 's/^[^0-9]*//' -e 1's/[- ].*//p'`
|
||||
if test "$lt_pversion" = ""; then
|
||||
echo "buildconf: libtool not found."
|
||||
echo " You need libtool version 1.4.3 or newer installed"
|
||||
echo " to build PHP from CVS."
|
||||
exit 1
|
||||
fi
|
||||
IFS=.; set $lt_pversion; IFS=' '
|
||||
lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
|
||||
IFS=.; set $lt_version; IFS=' '
|
||||
|
||||
if test "$3" = ""; then
|
||||
third=0
|
||||
@@ -78,14 +100,12 @@ echo " to build PHP from CVS."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ltpath=`echo $libtoolize | sed -e 's#/[^/]*/[^/]*$##'`
|
||||
ltfile="$ltpath/share/aclocal/libtool.m4"
|
||||
if test -r "$ltfile"; then
|
||||
:
|
||||
else
|
||||
echo "buildconf: $ltfile does not exist."
|
||||
echo " Please reinstall libtool."
|
||||
exit 1
|
||||
am_prefix=`./build/shtool path automake | sed -e 's#/[^/]*/[^/]*$##'`
|
||||
lt_prefix=`echo $libtool | sed -e 's#/[^/]*/[^/]*$##'`
|
||||
if test "$am_prefix" != "$lt_prefix"; then
|
||||
echo "WARNING: automake and libtool are installed in different"
|
||||
echo " directories. This may cause aclocal to fail."
|
||||
echo " continuing anyway"
|
||||
fi
|
||||
|
||||
test -n "$stamp" && touch $stamp
|
||||
|
||||
@@ -18,6 +18,11 @@ while test $# -gt 0; do
|
||||
automake_flags=--copy
|
||||
fi
|
||||
|
||||
if test "$1" = "--ZendEngine2"; then
|
||||
ZENDDIR=ZendEngine2
|
||||
echo "Using Zend Engine 2 code"
|
||||
fi
|
||||
|
||||
if test "$1" = "--force"; then
|
||||
devok=1
|
||||
echo "Forcing buildconf"
|
||||
@@ -33,28 +38,6 @@ if test "$dev" = "0" -a "$devok" = "0"; then
|
||||
fi
|
||||
|
||||
if test -z "$ZENDDIR"; then
|
||||
if grep "PHP_MAJOR_VERSION 5" main/php_version.h >/dev/null; then
|
||||
v=5
|
||||
else
|
||||
v=4
|
||||
fi
|
||||
|
||||
if test "$v" = "5"; then
|
||||
if test -r "Zend/OBJECTS2_HOWTO"; then
|
||||
:
|
||||
else
|
||||
mv Zend ZendEngine1 2>/dev/null
|
||||
mv ZendEngine2 Zend
|
||||
fi
|
||||
else
|
||||
if test -r "Zend/zend_execute_globals.h"; then
|
||||
:
|
||||
else
|
||||
mv Zend ZendEngine2 2>/dev/null
|
||||
mv ZendEngine1 Zend
|
||||
fi
|
||||
fi
|
||||
|
||||
ZENDDIR=Zend
|
||||
echo "using default Zend directory"
|
||||
fi
|
||||
|
||||
+76
-150
@@ -40,8 +40,8 @@ AC_CONFIG_HEADER(main/php_config.h)
|
||||
|
||||
MAJOR_VERSION=4
|
||||
MINOR_VERSION=3
|
||||
RELEASE_VERSION=6
|
||||
EXTRA_VERSION="RC2"
|
||||
RELEASE_VERSION=3
|
||||
EXTRA_VERSION="RC1"
|
||||
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
|
||||
|
||||
dnl Define where extension directories are located in the configure context
|
||||
@@ -127,7 +127,6 @@ dnl AC_PROG_CXXCPP
|
||||
dnl check for -R, etc. switch
|
||||
PHP_RUNPATH_SWITCH
|
||||
|
||||
PHP_PROG_RE2C
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_AWK
|
||||
@@ -137,8 +136,8 @@ if test "$YACC" != "bison -y"; then
|
||||
else
|
||||
AC_MSG_CHECKING([bison version])
|
||||
set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'|tr -d a-z`
|
||||
if test "${1}" -ne "1" -o "(" "${2}" != "28" -a "${2}" != "35" -a "${2}" != "75" -a "${2}" != "875" ")"; then
|
||||
AC_MSG_WARN(You will need bison 1.28, 1.35, 1.75 or 1.875 if you want to regenerate the Zend parser (found ${1}.${2}).)
|
||||
if test "${1}" = "1" -a "(" "${2}" -lt "75" -a "${2}" -ne "28" -a "${2}" -ne "35" -o "${2}" -ge "875" ")"; then
|
||||
AC_MSG_WARN(You will need bison 1.28, 1.35 or 1.75 if you want to regenerate the Zend parser (found ${1}.${2}).)
|
||||
fi
|
||||
AC_MSG_RESULT(${1}.${2} (ok))
|
||||
fi
|
||||
@@ -189,7 +188,6 @@ case $host_alias in
|
||||
CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";;
|
||||
*darwin*|*rhapsody*)
|
||||
CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
|
||||
AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther])
|
||||
php_multiple_shlib_versions_ok=yes;;
|
||||
*beos*)
|
||||
beos_threads=1
|
||||
@@ -318,14 +316,17 @@ dnl -------------------------------------------------------------------------
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_DIRENT
|
||||
|
||||
dnl In QNX opendir resides in libc but dirent.h is still required
|
||||
if test "`uname -s 2>/dev/null`" != "QNX"; then
|
||||
AC_HEADER_DIRENT
|
||||
else
|
||||
AC_CHECK_HEADERS(dirent.h)
|
||||
fi
|
||||
PHP_MISSING_FCLOSE_DECL
|
||||
dnl QNX requires unix.h to allow functions in libunix to work properly
|
||||
AC_CHECK_HEADERS([ \
|
||||
dirent.h \
|
||||
ApplicationServices/ApplicationServices.h \
|
||||
sys/param.h \
|
||||
sys/types.h \
|
||||
sys/time.h \
|
||||
netinet/in.h \
|
||||
@@ -369,11 +370,7 @@ unix.h \
|
||||
utime.h \
|
||||
sys/utsname.h \
|
||||
sys/ipc.h \
|
||||
dlfcn.h
|
||||
],[],[],[
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
@@ -521,45 +518,10 @@ vsnprintf \
|
||||
)
|
||||
|
||||
dnl Check for getaddrinfo, should be a better way, but...
|
||||
dnl Also check for working getaddrinfo
|
||||
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
|
||||
[AC_TRY_LINK([#include <netdb.h>],
|
||||
[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);],
|
||||
AC_TRY_RUN([
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
int main(void) {
|
||||
struct addrinfo *ai, *pai, hints;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_flags = AI_NUMERICHOST;
|
||||
|
||||
if (getaddrinfo("127.0.0.1", NULL, &hints, &ai) < 0) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (ai == NULL) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
pai = ai;
|
||||
|
||||
while (pai) {
|
||||
if (pai->ai_family != AF_INET) {
|
||||
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
|
||||
exit(1);
|
||||
}
|
||||
if (pai->ai_addr->sa_family != AF_INET) {
|
||||
/* 127.0.0.1/NUMERICHOST should only resolve ONE way */
|
||||
exit(1);
|
||||
}
|
||||
pai = pai->ai_next;
|
||||
}
|
||||
freeaddrinfo(ai);
|
||||
exit(0);
|
||||
}
|
||||
],ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no),
|
||||
ac_cv_func_getaddrinfo=no)])
|
||||
[AC_TRY_COMPILE([#include <netdb.h>],
|
||||
[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);],
|
||||
ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no)])
|
||||
if test "$ac_cv_func_getaddrinfo" = yes; then
|
||||
AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
|
||||
fi
|
||||
@@ -651,6 +613,27 @@ if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then
|
||||
PHP_CONFIG_FILE_SCAN_DIR=""
|
||||
fi
|
||||
|
||||
# compatibility
|
||||
if test -z "$with_pear" && test "$enable_pear" = "no"; then
|
||||
with_pear=no
|
||||
fi
|
||||
|
||||
PHP_ARG_WITH(pear, [whether to install PEAR, and where],
|
||||
[ --with-pear=DIR Install PEAR in DIR (default PREFIX/lib/php)
|
||||
--without-pear Do not install PEAR], DEFAULT, yes)
|
||||
|
||||
if test "$PHP_PEAR" != "no" && test "$disable_cli" != "1"; then
|
||||
install_pear="install-pear"
|
||||
PEAR_INSTALLDIR=$PHP_PEAR
|
||||
fi
|
||||
|
||||
if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
|
||||
case $PHP_LAYOUT in
|
||||
GNU) PEAR_INSTALLDIR=$datadir/pear;;
|
||||
*) PEAR_INSTALLDIR=$libdir/php;;
|
||||
esac
|
||||
fi
|
||||
|
||||
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
|
||||
|
||||
PHP_ARG_ENABLE(safe-mode, whether to enable safe mode by default,
|
||||
@@ -748,19 +731,17 @@ if test "$PHP_IPV6" != "no" && test "$ac_cv_ipv6_support" = yes; then
|
||||
AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether to enable versioning])
|
||||
AC_ARG_ENABLE(versioning,
|
||||
[ --enable-versioning Export only required symbols.
|
||||
See INSTALL for more information], [
|
||||
if test "x$APXS" != "x"; then
|
||||
PHP_VERSIONING=$enableval
|
||||
else
|
||||
PHP_VERSIONING=no
|
||||
fi
|
||||
],[
|
||||
PHP_VERSIONING=no
|
||||
])
|
||||
AC_MSG_RESULT([$PHP_VERSIONING])
|
||||
|
||||
dnl
|
||||
dnl OpenSSL configure
|
||||
dnl
|
||||
PHP_ARG_WITH(openssl,for OpenSSL support,
|
||||
[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6) ])
|
||||
|
||||
if test "$PHP_OPENSSL" != "no"; then
|
||||
ext_openssl_shared=$ext_shared
|
||||
PHP_SETUP_OPENSSL
|
||||
fi
|
||||
|
||||
divert(5)
|
||||
|
||||
@@ -797,9 +778,26 @@ AC_ARG_ENABLE(all,
|
||||
# reading config stubs
|
||||
esyscmd(./build/config-stubs ext)
|
||||
|
||||
dnl Extensions post-config
|
||||
|
||||
dnl Other settings.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
PHP_HELP_SEPARATOR([Other settings:])
|
||||
|
||||
AC_MSG_CHECKING([whether to enable versioning])
|
||||
AC_ARG_ENABLE(versioning,
|
||||
[ --enable-versioning Export only required symbols.
|
||||
See INSTALL for more information], [
|
||||
if test "x$APXS" != "x"; then
|
||||
PHP_VERSIONING=$enableval
|
||||
else
|
||||
PHP_VERSIONING=no
|
||||
fi
|
||||
],[
|
||||
PHP_VERSIONING=no
|
||||
])
|
||||
AC_MSG_RESULT([$PHP_VERSIONING])
|
||||
|
||||
if test "$PHP_VERSIONING" = "yes"; then
|
||||
test -z "$PHP_SYM_FILE" && PHP_SYM_FILE="$abs_srcdir/sapi/$PHP_SAPI/php.sym"
|
||||
if test -f "$PHP_SYM_FILE"; then
|
||||
@@ -825,6 +823,8 @@ shared)
|
||||
;;
|
||||
esac
|
||||
|
||||
PHP_REGEX
|
||||
|
||||
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
|
||||
|
||||
dnl this has to be here to prevent the openssl crypt() from
|
||||
@@ -835,70 +835,10 @@ fi
|
||||
|
||||
unset LIBS LDFLAGS
|
||||
|
||||
dnl PEAR
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
PHP_HELP_SEPARATOR([PEAR:])
|
||||
PHP_CONFIGURE_PART(Configuring PEAR)
|
||||
|
||||
# compatibility
|
||||
if test -z "$with_pear" && test "$enable_pear" = "no"; then
|
||||
with_pear=no
|
||||
fi
|
||||
|
||||
PHP_ARG_WITH(pear, [whether to install PEAR],
|
||||
[ --with-pear=DIR Install PEAR in DIR (default PREFIX/lib/php)
|
||||
--without-pear Do not install PEAR], DEFAULT, yes)
|
||||
|
||||
if test "$PHP_PEAR" != "no"; then
|
||||
|
||||
dnl
|
||||
dnl PEAR dependancies
|
||||
dnl
|
||||
if test "$PHP_SAPI_CLI" = "no"; then
|
||||
pear_error_msg="$pear_error_msg
|
||||
PEAR requires CLI to be enabled. Add --enable-cli to the configure line."
|
||||
fi
|
||||
if test "$PHP_PCRE_REGEX" = "no"; then
|
||||
pear_error_msg="$pear_error_msg
|
||||
PEAR requires PCRE to be enabled. Add --with-pcre-regex to the configure line."
|
||||
fi
|
||||
if test "$PHP_XML" = "no"; then
|
||||
pear_error_msg="$pear_error_msg
|
||||
PEAR requires XML to be enabled. Add --enable-xml to the configure line."
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl ext/xmlrpc is not really there yet to be a requirement..
|
||||
dnl
|
||||
dnl if test "$PHP_XMLRPC" = "no"; then
|
||||
dnl pear_error_msg="$pear_error_msg
|
||||
dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line."
|
||||
dnl fi
|
||||
dnl
|
||||
|
||||
if test "$pear_error_msg"; then
|
||||
AC_MSG_ERROR([$pear_error_msg])
|
||||
fi
|
||||
|
||||
install_pear="install-pear"
|
||||
PEAR_INSTALLDIR=$PHP_PEAR
|
||||
|
||||
if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
|
||||
case $PHP_LAYOUT in
|
||||
GNU) PEAR_INSTALLDIR=$datadir/pear;;
|
||||
*) PEAR_INSTALLDIR=$libdir/php;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
dnl Configuring Zend and TSRM.
|
||||
dnl -------------------------------------------------------------------------
|
||||
|
||||
PHP_HELP_SEPARATOR([Zend:])
|
||||
PHP_CONFIGURE_PART(Configuring Zend)
|
||||
|
||||
LIBZEND_BASIC_CHECKS
|
||||
LIBZEND_DLSYM_CHECK
|
||||
LIBZEND_OTHER_CHECKS
|
||||
@@ -922,21 +862,17 @@ fi
|
||||
ZEND_EXTRA_LIBS="$LIBS"
|
||||
unset LIBS LDFLAGS
|
||||
|
||||
PHP_HELP_SEPARATOR([TSRM:])
|
||||
PHP_CONFIGURE_PART(Configuring TSRM)
|
||||
TSRM_BASIC_CHECKS
|
||||
if test "$PHP_THREAD_SAFETY" = "yes"; then
|
||||
TSRM_THREADS_CHECKS
|
||||
fi
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
|
||||
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
|
||||
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
|
||||
unset LIBS LDFLAGS
|
||||
|
||||
test "$prefix" = "NONE" && prefix=/usr/local
|
||||
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
|
||||
test "$program_prefix" = "NONE" && program_prefix=
|
||||
test "$program_suffix" = "NONE" && program_suffix=
|
||||
|
||||
case $libdir in
|
||||
'${exec_prefix}/lib')
|
||||
@@ -1031,7 +967,6 @@ if test -z "$php_ldflags_add_usr_lib"; then
|
||||
fi
|
||||
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
|
||||
EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
|
||||
|
||||
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
|
||||
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
|
||||
@@ -1044,8 +979,6 @@ if test "$disable_cli" != "1"; then
|
||||
PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
|
||||
PHP_INSTALL_CLI_TARGET="install-cli"
|
||||
PHP_ADD_SOURCES(sapi/cli, php_cli.c getopt.c,, cli)
|
||||
else
|
||||
with_pear=no
|
||||
fi
|
||||
|
||||
PHP_SUBST(PHP_CLI_TARGET)
|
||||
@@ -1064,8 +997,6 @@ PHP_SUBST_OLD(php_abs_top_srcdir)
|
||||
|
||||
PHP_SUBST(bindir)
|
||||
PHP_SUBST(exec_prefix)
|
||||
PHP_SUBST(program_prefix)
|
||||
PHP_SUBST(program_suffix)
|
||||
PHP_SUBST(includedir)
|
||||
PHP_SUBST(libdir)
|
||||
PHP_SUBST(mandir)
|
||||
@@ -1091,7 +1022,6 @@ PHP_SUBST_OLD(DEBUG_CFLAGS)
|
||||
PHP_SUBST(DEFS)
|
||||
PHP_SUBST_OLD(EXTENSION_DIR)
|
||||
PHP_SUBST_OLD(EXTRA_LDFLAGS)
|
||||
PHP_SUBST_OLD(EXTRA_LDFLAGS_PROGRAM)
|
||||
PHP_SUBST_OLD(EXTRA_LIBS)
|
||||
PHP_SUBST_OLD(ZEND_EXTRA_LIBS)
|
||||
PHP_SUBST_OLD(INCLUDES)
|
||||
@@ -1114,7 +1044,6 @@ PHP_SUBST(PHP_RPATHS)
|
||||
PHP_SUBST(PHP_SAPI)
|
||||
PHP_SUBST_OLD(PHP_VERSION)
|
||||
PHP_SUBST(PROG_SENDMAIL)
|
||||
PHP_SUBST(RE2C)
|
||||
PHP_SUBST(SHELL)
|
||||
PHP_SUBST(SHARED_LIBTOOL)
|
||||
PHP_SUBST(TSRM_DIR)
|
||||
@@ -1148,7 +1077,6 @@ dnl
|
||||
dnl Libtool creation
|
||||
dnl
|
||||
|
||||
PHP_HELP_SEPARATOR([Libtool:])
|
||||
PHP_CONFIGURE_PART(Configuring libtool)
|
||||
|
||||
LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"
|
||||
@@ -1175,19 +1103,10 @@ INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
|
||||
CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
|
||||
|
||||
all_targets='$(OVERALL_TARGET) $(PHP_MODULES) $(PHP_CLI_TARGET)'
|
||||
install_targets="$install_modules $install_pear install-build install-headers install-programs"
|
||||
|
||||
case $PHP_SAPI in
|
||||
cgi)
|
||||
install_targets="install-sapi $install_targets"
|
||||
;;
|
||||
cli)
|
||||
install_targets="$PHP_INSTALL_CLI_TARGET $install_targets"
|
||||
;;
|
||||
*)
|
||||
install_targets="install-sapi $PHP_INSTALL_CLI_TARGET $install_targets"
|
||||
;;
|
||||
esac
|
||||
install_targets="install-sapi install-modules $install_pear install-build install-headers install-programs"
|
||||
if test "$PHP_SAPI" != "cgi"; then
|
||||
install_targets="$PHP_INSTALL_CLI_TARGET $install_targets"
|
||||
fi
|
||||
|
||||
PHP_SUBST(all_targets)
|
||||
PHP_SUBST(install_targets)
|
||||
@@ -1256,6 +1175,13 @@ if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test "\$CONFIG_FILES" = " $ALL
|
||||
REDO_ALL=yes
|
||||
fi
|
||||
|
||||
if test ! -f $srcdir/ext/bcmath/number.c; then
|
||||
echo "creating number.c"
|
||||
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.c
|
||||
echo "creating number.h"
|
||||
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h
|
||||
fi
|
||||
|
||||
################################################################
|
||||
# Create configuration headers
|
||||
#
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#! /bin/sh
|
||||
|
||||
${MAKE:-make} -f build/build.mk cvsclean-work
|
||||
${MAKE:-make} -f build/build.mk cvsclean
|
||||
@@ -7,7 +7,7 @@ PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions,
|
||||
|
||||
if test "$PHP_BCMATH" != "no"; then
|
||||
AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath])
|
||||
PHP_NEW_EXTENSION(bcmath, bcmath.c \
|
||||
PHP_NEW_EXTENSION(bcmath, bcmath.c number.c \
|
||||
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \
|
||||
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
|
||||
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
|
||||
|
||||
@@ -52,12 +52,9 @@ typedef struct bc_struct
|
||||
in the case of leading zeros generated. */
|
||||
} bc_struct;
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../config.h"
|
||||
#endif
|
||||
#include <php.h>
|
||||
#include <ext/bcmath/php_bcmath.h>
|
||||
|
||||
#include "php.h"
|
||||
#include "../../php_bcmath.h"
|
||||
|
||||
/* The base used in storing the numbers in n_value above.
|
||||
Currently this MUST be 10. */
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Bzip2
|
||||
Sterling Hughes
|
||||
-542
@@ -1,542 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Sterling Hughes <sterling@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
#include "php_bz2.h"
|
||||
|
||||
#if HAVE_BZ2
|
||||
|
||||
/* PHP Includes */
|
||||
#include "ext/standard/file.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "ext/standard/php_string.h"
|
||||
|
||||
/* for fileno() */
|
||||
#include <stdio.h>
|
||||
|
||||
/* Internal error constants */
|
||||
#define PHP_BZ_ERRNO 0
|
||||
#define PHP_BZ_ERRSTR 1
|
||||
#define PHP_BZ_ERRBOTH 2
|
||||
|
||||
/* Blocksize of the decompression buffer */
|
||||
#define PHP_BZ_DECOMPRESS_SIZE 4096
|
||||
|
||||
function_entry bz2_functions[] = {
|
||||
PHP_FE(bzopen, NULL)
|
||||
PHP_FE(bzread, NULL)
|
||||
PHP_FALIAS(bzwrite, fwrite, NULL)
|
||||
PHP_FALIAS(bzflush, fflush, NULL)
|
||||
PHP_FALIAS(bzclose, fclose, NULL)
|
||||
PHP_FE(bzerrno, NULL)
|
||||
PHP_FE(bzerrstr, NULL)
|
||||
PHP_FE(bzerror, NULL)
|
||||
PHP_FE(bzcompress, NULL)
|
||||
PHP_FE(bzdecompress, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
zend_module_entry bz2_module_entry = {
|
||||
STANDARD_MODULE_HEADER,
|
||||
"bz2",
|
||||
bz2_functions,
|
||||
PHP_MINIT(bz2),
|
||||
PHP_MSHUTDOWN(bz2),
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(bz2),
|
||||
NO_VERSION_YET,
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#ifdef COMPILE_DL_BZ2
|
||||
ZEND_GET_MODULE(bz2)
|
||||
#endif
|
||||
|
||||
struct php_bz2_stream_data_t {
|
||||
BZFILE *bz_file;
|
||||
php_stream *stream;
|
||||
};
|
||||
|
||||
/* {{{ BZip2 stream implementation */
|
||||
|
||||
static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract;
|
||||
size_t ret;
|
||||
|
||||
ret = BZ2_bzread(self->bz_file, buf, count);
|
||||
|
||||
if (ret == 0) {
|
||||
stream->eof = 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract;
|
||||
|
||||
return BZ2_bzwrite(self->bz_file, (char*)buf, count);
|
||||
}
|
||||
|
||||
static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
|
||||
int ret = EOF;
|
||||
|
||||
if (close_handle) {
|
||||
BZ2_bzclose(self->bz_file);
|
||||
}
|
||||
|
||||
if (self->stream) {
|
||||
php_stream_free(self->stream, PHP_STREAM_FREE_CLOSE | (close_handle == 0 ? PHP_STREAM_FREE_PRESERVE_HANDLE : 0));
|
||||
}
|
||||
|
||||
efree(self);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int php_bz2iop_flush(php_stream *stream TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
|
||||
return BZ2_bzflush(self->bz_file);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
php_stream_ops php_stream_bz2io_ops = {
|
||||
php_bz2iop_write, php_bz2iop_read,
|
||||
php_bz2iop_close, php_bz2iop_flush,
|
||||
"BZip2",
|
||||
NULL, /* seek */
|
||||
NULL, /* cast */
|
||||
NULL, /* stat */
|
||||
NULL /* set_option */
|
||||
};
|
||||
|
||||
/* {{{ Bzip2 stream openers */
|
||||
PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz,
|
||||
char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC)
|
||||
{
|
||||
struct php_bz2_stream_data_t *self;
|
||||
|
||||
self = emalloc(sizeof(*self));
|
||||
|
||||
self->stream = innerstream;
|
||||
self->bz_file = bz;
|
||||
|
||||
return php_stream_alloc_rel(&php_stream_bz2io_ops, self, 0, mode);
|
||||
}
|
||||
|
||||
PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
|
||||
char *path,
|
||||
char *mode,
|
||||
int options,
|
||||
char **opened_path,
|
||||
php_stream_context *context STREAMS_DC TSRMLS_DC)
|
||||
{
|
||||
php_stream *retstream = NULL, *stream = NULL;
|
||||
char *path_copy = NULL;
|
||||
BZFILE *bz_file = NULL;
|
||||
|
||||
if (strncasecmp("compress.bzip2://", path, 17) == 0) {
|
||||
path += 17;
|
||||
}
|
||||
if (mode[0] != 'w' && mode[0] != 'r' && mode[1] != '\0') {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef VIRTUAL_DIR
|
||||
virtual_filepath_ex(path, &path_copy, NULL TSRMLS_CC);
|
||||
#else
|
||||
path_copy = path;
|
||||
#endif
|
||||
|
||||
/* try and open it directly first */
|
||||
bz_file = BZ2_bzopen(path_copy, mode);
|
||||
|
||||
if (opened_path && bz_file) {
|
||||
*opened_path = estrdup(path_copy);
|
||||
}
|
||||
path_copy = NULL;
|
||||
|
||||
if (bz_file == NULL) {
|
||||
/* that didn't work, so try and get something from the network/wrapper */
|
||||
stream = php_stream_open_wrapper(path, mode, options, opened_path);
|
||||
|
||||
if (stream) {
|
||||
int fd;
|
||||
if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
|
||||
bz_file = BZ2_bzdopen(fd, mode);
|
||||
}
|
||||
}
|
||||
/* remove the file created by php_stream_open_wrapper(), it is not needed since BZ2 functions
|
||||
* failed.
|
||||
*/
|
||||
if (!bz_file && mode[0] == 'w') {
|
||||
VCWD_UNLINK(*opened_path);
|
||||
}
|
||||
}
|
||||
|
||||
if (bz_file) {
|
||||
retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC);
|
||||
if (retstream) {
|
||||
return retstream;
|
||||
}
|
||||
|
||||
BZ2_bzclose(bz_file);
|
||||
}
|
||||
|
||||
if (stream) {
|
||||
php_stream_close(stream);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
static php_stream_wrapper_ops bzip2_stream_wops = {
|
||||
_php_stream_bz2open,
|
||||
NULL, /* close */
|
||||
NULL, /* fstat */
|
||||
NULL, /* stat */
|
||||
NULL, /* opendir */
|
||||
"BZip2"
|
||||
};
|
||||
|
||||
php_stream_wrapper php_stream_bzip2_wrapper = {
|
||||
&bzip2_stream_wops,
|
||||
NULL,
|
||||
0 /* is_url */
|
||||
};
|
||||
|
||||
static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int);
|
||||
|
||||
PHP_MINIT_FUNCTION(bz2)
|
||||
{
|
||||
php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MSHUTDOWN_FUNCTION(bz2)
|
||||
{
|
||||
php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MINFO_FUNCTION(bz2)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "BZip2 Support", "Enabled");
|
||||
php_info_print_table_row(2, "BZip2 Version", (char *) BZ2_bzlibVersion());
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
/* {{{ proto string bzread(int bz[, int length])
|
||||
Reads up to length bytes from a BZip2 stream, or 1024 bytes if length is not specified */
|
||||
PHP_FUNCTION(bzread)
|
||||
{
|
||||
zval *bz;
|
||||
long len = 1024;
|
||||
php_stream *stream;
|
||||
|
||||
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
php_stream_from_zval(stream, &bz);
|
||||
|
||||
if (len < 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "length may not be negative");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
Z_STRVAL_P(return_value) = emalloc(len + 1);
|
||||
Z_STRLEN_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), len);
|
||||
|
||||
if (Z_STRLEN_P(return_value) < 0) {
|
||||
efree(Z_STRVAL_P(return_value));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0;
|
||||
|
||||
if (PG(magic_quotes_runtime)) {
|
||||
Z_STRVAL_P(return_value) = php_addslashes( Z_STRVAL_P(return_value),
|
||||
Z_STRLEN_P(return_value),
|
||||
&Z_STRLEN_P(return_value), 1 TSRMLS_CC);
|
||||
}
|
||||
|
||||
Z_TYPE_P(return_value) = IS_STRING;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto resource bzopen(string|int file|fp, string mode)
|
||||
Opens a new BZip2 stream */
|
||||
PHP_FUNCTION(bzopen)
|
||||
{
|
||||
zval **file, /* The file to open */
|
||||
**mode; /* The mode to open the stream with */
|
||||
BZFILE *bz; /* The compressed file stream */
|
||||
php_stream *stream = NULL;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &file, &mode) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(mode);
|
||||
|
||||
if (Z_STRVAL_PP(mode)[0] != 'r' && Z_STRVAL_PP(mode)[0] != 'w' && Z_STRVAL_PP(mode)[1] != '\0') {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", Z_STRVAL_PP(mode));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
/* If it's not a resource its a string containing the filename to open */
|
||||
if (Z_TYPE_PP(file) != IS_RESOURCE) {
|
||||
convert_to_string_ex(file);
|
||||
stream = php_stream_bz2open(NULL,
|
||||
Z_STRVAL_PP(file),
|
||||
Z_STRVAL_PP(mode),
|
||||
ENFORCE_SAFE_MODE | REPORT_ERRORS,
|
||||
NULL);
|
||||
} else {
|
||||
/* If it is a resource, than its a stream resource */
|
||||
int fd;
|
||||
|
||||
php_stream_from_zval(stream, file);
|
||||
|
||||
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
bz = BZ2_bzdopen(fd, Z_STRVAL_PP(mode));
|
||||
|
||||
stream = php_stream_bz2open_from_BZFILE(bz, Z_STRVAL_PP(mode), stream);
|
||||
}
|
||||
|
||||
if (stream) {
|
||||
php_stream_to_zval(stream, return_value);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int bzerrno(resource bz)
|
||||
Returns the error number */
|
||||
PHP_FUNCTION(bzerrno)
|
||||
{
|
||||
php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRNO);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string bzerrstr(resource bz)
|
||||
Returns the error string */
|
||||
PHP_FUNCTION(bzerrstr)
|
||||
{
|
||||
php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRSTR);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array bzerror(resource bz)
|
||||
Returns the error number and error string in an associative array */
|
||||
PHP_FUNCTION(bzerror)
|
||||
{
|
||||
php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRBOTH);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string bzcompress(string source [, int blocksize100k [, int workfactor]])
|
||||
Compresses a string into BZip2 encoded data */
|
||||
PHP_FUNCTION(bzcompress)
|
||||
{
|
||||
zval **source, /* Source data to compress */
|
||||
**zblock_size, /* Optional block size to use */
|
||||
**zwork_factor; /* Optional work factor to use */
|
||||
char *dest = NULL; /* Destination to place the compressed data into */
|
||||
int error, /* Error Container */
|
||||
block_size = 4, /* Block size for compression algorithm */
|
||||
work_factor = 0, /* Work factor for compression algorithm */
|
||||
argc; /* Argument count */
|
||||
unsigned int source_len, /* Length of the source data */
|
||||
dest_len; /* Length of the destination buffer */
|
||||
|
||||
argc = ZEND_NUM_ARGS();
|
||||
|
||||
if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &source, &zblock_size, &zwork_factor) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(source);
|
||||
|
||||
/* Assign them to easy to use variables, dest_len is initially the length of the data
|
||||
+ .01 x length of data + 600 which is the largest size the results of the compression
|
||||
could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net
|
||||
for pointing this out). */
|
||||
source_len = Z_STRLEN_PP(source);
|
||||
dest_len = Z_STRLEN_PP(source) + (0.01 * Z_STRLEN_PP(source)) + 600;
|
||||
|
||||
/* Allocate the destination buffer */
|
||||
dest = emalloc(dest_len + 1);
|
||||
|
||||
/* Handle the optional arguments */
|
||||
if (argc > 1) {
|
||||
convert_to_long_ex(zblock_size);
|
||||
block_size = Z_LVAL_PP(zblock_size);
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
convert_to_long_ex(zwork_factor);
|
||||
work_factor = Z_LVAL_PP(zwork_factor);
|
||||
}
|
||||
|
||||
error = BZ2_bzBuffToBuffCompress(dest, &dest_len, Z_STRVAL_PP(source), source_len, block_size, 0, work_factor);
|
||||
if (error != BZ_OK) {
|
||||
efree(dest);
|
||||
RETURN_LONG(error);
|
||||
} else {
|
||||
/* Copy the buffer, we have perhaps allocate alot more than we need,
|
||||
so we erealloc() the buffer to the proper size */
|
||||
dest = erealloc(dest, dest_len + 1);
|
||||
dest[dest_len] = 0;
|
||||
RETURN_STRINGL(dest, dest_len, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string bzdecompress(string source [, int small])
|
||||
Decompresses BZip2 compressed data */
|
||||
PHP_FUNCTION(bzdecompress)
|
||||
{
|
||||
zval **source, /* Source data to decompress */
|
||||
**zsmall; /* (Optional) user specified small */
|
||||
char *dest; /* Destination buffer, initially allocated */
|
||||
int error, /* Error container */
|
||||
iter = 1, /* Iteration count for the compression loop */
|
||||
size, /* Current size to realloc the dest buffer to */
|
||||
dest_len = PHP_BZ_DECOMPRESS_SIZE, /* Size of the destination length */
|
||||
small = 0, /* The actual small */
|
||||
argc = ZEND_NUM_ARGS(); /* Argument count */
|
||||
|
||||
if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &source, &zsmall) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(source);
|
||||
|
||||
/* optional small argument handling */
|
||||
if (argc > 1) {
|
||||
convert_to_long_ex(zsmall);
|
||||
small = Z_LVAL_PP(zsmall);
|
||||
}
|
||||
|
||||
/* Depending on the size of the source buffer, either allocate
|
||||
the length of the source buffer or the a default decompression
|
||||
size */
|
||||
dest = emalloc(PHP_BZ_DECOMPRESS_SIZE > Z_STRLEN_PP(source) ? PHP_BZ_DECOMPRESS_SIZE : Z_STRLEN_PP(source));
|
||||
|
||||
/* (de)Compression Loop */
|
||||
do {
|
||||
/* Handle the (re)allocation of the buffer */
|
||||
size = dest_len * iter;
|
||||
if (iter > 1) {
|
||||
dest = erealloc(dest, size);
|
||||
}
|
||||
++iter;
|
||||
|
||||
/* Perform the decompression */
|
||||
error = BZ2_bzBuffToBuffDecompress(dest, &size, Z_STRVAL_PP(source), Z_STRLEN_PP(source), small, 0);
|
||||
} while (error == BZ_OUTBUFF_FULL);
|
||||
|
||||
if (error != BZ_OK) {
|
||||
efree(dest);
|
||||
RETURN_LONG(error);
|
||||
} else {
|
||||
/* we might have allocated a little to much, so erealloc the buffer
|
||||
down to size, before returning it */
|
||||
dest = erealloc(dest, size + 1);
|
||||
dest[size] = 0;
|
||||
RETURN_STRINGL(dest, size, 0);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ php_bz2_error()
|
||||
The central error handling interface, does the work for bzerrno, bzerrstr and bzerror */
|
||||
static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt)
|
||||
{
|
||||
zval **bzp; /* BZip2 Resource Pointer */
|
||||
php_stream *stream;
|
||||
const char *errstr; /* Error string */
|
||||
int errnum; /* Error number */
|
||||
struct php_bz2_stream_data_t *self;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &bzp) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
php_stream_from_zval(stream, bzp);
|
||||
|
||||
if (!php_stream_is(stream, PHP_STREAM_IS_BZIP2)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
self = (struct php_bz2_stream_data_t *) stream->abstract;
|
||||
|
||||
/* Fetch the error information */
|
||||
errstr = BZ2_bzerror(self->bz_file, &errnum);
|
||||
|
||||
/* Determine what to return */
|
||||
switch (opt) {
|
||||
case PHP_BZ_ERRNO:
|
||||
RETURN_LONG(errnum);
|
||||
break;
|
||||
case PHP_BZ_ERRSTR:
|
||||
RETURN_STRING((char*)errstr, 1);
|
||||
break;
|
||||
case PHP_BZ_ERRBOTH:
|
||||
array_init(return_value);
|
||||
|
||||
add_assoc_long (return_value, "errno", errnum);
|
||||
add_assoc_string(return_value, "errstr", (char*)errstr, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: fdm=marker
|
||||
* vim: noet sw=4 ts=4
|
||||
*/
|
||||
-108
@@ -1,108 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="bz2" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=bz2 - Win32 Debug_TS
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "bz2.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "bz2.mak" CFG="bz2 - Win32 Debug_TS"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "bz2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "bz2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "bz2 - Win32 Release_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release_TS"
|
||||
# PROP BASE Intermediate_Dir "Release_TS"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release_TS"
|
||||
# PROP Intermediate_Dir "Release_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x407 /d "NDEBUG"
|
||||
# ADD RSC /l 0x407 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 libbz2.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 php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_bz2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "bz2 - Win32 Debug_TS"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug_TS"
|
||||
# PROP BASE Intermediate_Dir "Debug_TS"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug_TS"
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x407 /d "_DEBUG"
|
||||
# ADD RSC /l 0x407 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 php4ts_debug.lib libbz2.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 /debug /machine:I386 /out:"..\..\Debug_TS/php_bz2.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "bz2 - Win32 Release_TS"
|
||||
# Name "bz2 - Win32 Debug_TS"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\bz2.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_bz2.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -1,40 +0,0 @@
|
||||
dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(bz2, for BZip2 support,
|
||||
[ --with-bz2[=DIR] Include BZip2 support])
|
||||
|
||||
if test "$PHP_BZ2" != "no"; then
|
||||
if test -r $PHP_BZ2/include/bzlib.h; then
|
||||
BZIP_DIR=$PHP_BZ2
|
||||
else
|
||||
AC_MSG_CHECKING(for BZip2 in default path)
|
||||
for i in /usr/local /usr; do
|
||||
if test -r $i/include/bzlib.h; then
|
||||
BZIP_DIR=$i
|
||||
AC_MSG_RESULT(found in $i)
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$BZIP_DIR"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
AC_MSG_ERROR(Please reinstall the BZip2 distribution)
|
||||
fi
|
||||
|
||||
PHP_CHECK_LIBRARY(bz2, BZ2_bzerror,
|
||||
[
|
||||
PHP_ADD_INCLUDE($BZIP_DIR/include)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/lib, BZ2_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_BZ2,1,[ ])
|
||||
], [
|
||||
AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0)
|
||||
], [
|
||||
-L$BZIP_DIR/lib
|
||||
])
|
||||
|
||||
PHP_NEW_EXTENSION(bz2, bz2.c, $ext_shared)
|
||||
PHP_SUBST(BZ2_SHARED_LIBADD)
|
||||
fi
|
||||
@@ -1,35 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!-- do not use the "Type" attribute here, that one is only for
|
||||
generated package.xml files -->
|
||||
<package>
|
||||
<name>bz2</name>
|
||||
<summary>A Bzip2 management extension</summary>
|
||||
<description>
|
||||
Bz2 is an extension to create and parse bzip2 compressed data.
|
||||
</description>
|
||||
<license>PHP License</license>
|
||||
<maintainers>
|
||||
<maintainer>
|
||||
<user>sterling</user>
|
||||
<name>Sterling Hughes</name>
|
||||
<email>sterling@php.net</email>
|
||||
</maintainer>
|
||||
</maintainers>
|
||||
<release>
|
||||
<version>1.0</version>
|
||||
<date>2003-05-17</date>
|
||||
<state>stable</state>
|
||||
<notes>
|
||||
Initial Release in PECL
|
||||
</notes>
|
||||
</release>
|
||||
<filelist>
|
||||
<dir role="src" name="/">
|
||||
<file role="doc">CREDITS</file>
|
||||
<file role="src">config.m4</file>
|
||||
<file role="doc">php_bz2.h</file>
|
||||
<file role="src">bz2.c</file>
|
||||
<file role="src">bz2.dsp</file>
|
||||
</dir>
|
||||
</filelist>
|
||||
</package>
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Sterling Hughes <sterling@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef PHP_BZ2_H
|
||||
#define PHP_BZ2_H
|
||||
|
||||
#if HAVE_BZ2
|
||||
|
||||
extern zend_module_entry bz2_module_entry;
|
||||
#define phpext_bz2_ptr &bz2_module_entry
|
||||
|
||||
/* Bzip2 includes */
|
||||
#include <bzlib.h>
|
||||
|
||||
PHP_MINIT_FUNCTION(bz2);
|
||||
PHP_MSHUTDOWN_FUNCTION(bz2);
|
||||
PHP_MINFO_FUNCTION(bz2);
|
||||
PHP_FUNCTION(bzopen);
|
||||
PHP_FUNCTION(bzread);
|
||||
PHP_FUNCTION(bzerrno);
|
||||
PHP_FUNCTION(bzerrstr);
|
||||
PHP_FUNCTION(bzerror);
|
||||
PHP_FUNCTION(bzcompress);
|
||||
PHP_FUNCTION(bzdecompress);
|
||||
|
||||
#else
|
||||
#define phpext_bz2_ptr NULL
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
# ifdef PHP_BZ2_EXPORTS
|
||||
# define PHP_BZ2_API __declspec(dllexport)
|
||||
# else
|
||||
# define PHP_BZ2_API __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# define PHP_BZ2_API
|
||||
#endif
|
||||
|
||||
PHP_BZ2_API PHPAPI php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
|
||||
PHP_BZ2_API PHPAPI php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC);
|
||||
|
||||
#define php_stream_bz2open_from_BZFILE(bz, mode, innerstream) _php_stream_bz2open_from_BZFILE((bz), (mode), (innerstream) STREAMS_CC TSRMLS_CC)
|
||||
#define php_stream_bz2open(wrapper, path, mode, options, opened_path) _php_stream_bz2open((wrapper), (path), (mode), (options), (opened_path), NULL STREAMS_CC TSRMLS_CC)
|
||||
|
||||
php_stream_ops php_stream_bz2io_ops;
|
||||
#define PHP_STREAM_IS_BZIP2 &php_stream_bz2io_ops
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
*/
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
BZ2 with files
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("bz2")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php // $Id$
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$filename = "testfile.bz2";
|
||||
$str = "This is a test string.\n";
|
||||
$bz = bzopen($filename, "w");
|
||||
bzwrite($bz, $str);
|
||||
bzclose($bz);
|
||||
|
||||
$bz = bzopen($filename, "r");
|
||||
print bzread($bz, 10);
|
||||
print bzread($bz);
|
||||
bzclose($bz);
|
||||
unlink($filename);
|
||||
|
||||
--EXPECT--
|
||||
This is a test string.
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
BZ2 with strings
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("bz2")) print "skip"; ?>
|
||||
--POST--
|
||||
--GET--
|
||||
--FILE--
|
||||
<?php // $Id$
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
# This FAILS
|
||||
$blaat = <<<HEREDOC
|
||||
This is some random data
|
||||
HEREDOC;
|
||||
|
||||
# This Works: (so, is heredoc related)
|
||||
#$blaat= 'This is some random data';
|
||||
|
||||
$blaat2 = bzdecompress(bzcompress($blaat));
|
||||
|
||||
$tests = <<<TESTS
|
||||
\$blaat === \$blaat2
|
||||
TESTS;
|
||||
include(dirname(__FILE__) . '/../../../tests/quicktester.inc');
|
||||
|
||||
--EXPECT--
|
||||
OK
|
||||
@@ -161,7 +161,7 @@ PHP_FUNCTION(cal_info)
|
||||
}
|
||||
convert_to_long_ex(cal);
|
||||
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %ld", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ PHP_FUNCTION(cal_days_in_month)
|
||||
convert_to_long_ex(year);
|
||||
|
||||
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %ld", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ PHP_FUNCTION(cal_to_jd)
|
||||
convert_to_long_ex(year);
|
||||
|
||||
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %ld", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ PHP_FUNCTION(cal_from_jd)
|
||||
convert_to_long_ex(cal);
|
||||
|
||||
if (Z_LVAL_PP(cal) < 0 || Z_LVAL_PP(cal) >= CAL_NUM_CALS) {
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %ld", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
zend_error(E_WARNING, "%s(): invalid calendar ID %d", get_active_function_name(TSRMLS_C), Z_LVAL_PP(cal));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
calendar = &cal_conversion_table[Z_LVAL_PP(cal)];
|
||||
|
||||
+43
-17
@@ -55,7 +55,7 @@
|
||||
#ifdef PHP_WIN32
|
||||
|
||||
#define _WIN32_DCOM
|
||||
#define COBJMACROS
|
||||
|
||||
#include <iostream.h>
|
||||
#include <math.h>
|
||||
#include <ocidl.h>
|
||||
@@ -122,7 +122,24 @@ PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DIS
|
||||
*ErrString = NULL;
|
||||
/* @todo use DispInvoke here ? */
|
||||
if (C_ISREFD(obj)) {
|
||||
hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, &IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr);
|
||||
if (C_HASTLIB(obj)) {
|
||||
hr = C_TYPEINFO_VT(obj)->Invoke(C_TYPEINFO(obj), C_DISPATCH(obj), dispIdMember, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr);
|
||||
if (FAILED(hr) && (hr != DISP_E_EXCEPTION)) {
|
||||
hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, &IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr);
|
||||
if (SUCCEEDED(hr)) {
|
||||
/*
|
||||
* ITypLib doesn't work
|
||||
* Release ITypeLib and fall back to IDispatch
|
||||
*/
|
||||
|
||||
C_TYPEINFO_VT(obj)->Release(C_TYPEINFO(obj));
|
||||
C_HASTLIB(obj) = FALSE;
|
||||
C_TYPEINFO(obj) = NULL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, &IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr);
|
||||
}
|
||||
|
||||
if (FAILED(hr)) {
|
||||
switch (hr) {
|
||||
@@ -2207,6 +2224,7 @@ static ITypeLib *php_COM_find_typelib(char *search_string, int mode TSRMLS_DC)
|
||||
|
||||
PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
|
||||
{
|
||||
ITypeComp *TypeComp;
|
||||
int i;
|
||||
int interfaces;
|
||||
|
||||
@@ -2214,33 +2232,40 @@ PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
interfaces = ITypeLib_GetTypeInfoCount(TypeLib);
|
||||
interfaces = TypeLib->lpVtbl->GetTypeInfoCount(TypeLib);
|
||||
|
||||
TypeLib->lpVtbl->GetTypeComp(TypeLib, &TypeComp);
|
||||
for (i=0; i<interfaces; i++) {
|
||||
TYPEKIND pTKind;
|
||||
|
||||
ITypeLib_GetTypeInfoType(TypeLib, i, &pTKind);
|
||||
if (pTKind == TKIND_ENUM) {
|
||||
TypeLib->lpVtbl->GetTypeInfoType(TypeLib, i, &pTKind);
|
||||
if (pTKind==TKIND_ENUM) {
|
||||
ITypeInfo *TypeInfo;
|
||||
VARDESC *pVarDesc;
|
||||
UINT NameCount;
|
||||
int j;
|
||||
#if 0
|
||||
BSTR bstr_EnumId;
|
||||
char *EnumId;
|
||||
|
||||
ITypeLib_GetTypeInfo(TypeLib, i, &TypeInfo);
|
||||
TypeLib->lpVtbl->GetDocumentation(TypeLib, i, &bstr_EnumId, NULL, NULL, NULL);
|
||||
EnumId = php_OLECHAR_to_char(bstr_EnumId, NULL, codepage);
|
||||
printf("Enumeration %d - %s:\n", i, EnumId);
|
||||
efree(EnumId);
|
||||
#endif
|
||||
|
||||
for (j = 0; ; j++) {
|
||||
TypeLib->lpVtbl->GetTypeInfo(TypeLib, i, &TypeInfo);
|
||||
|
||||
j=0;
|
||||
while (SUCCEEDED(TypeInfo->lpVtbl->GetVarDesc(TypeInfo, j, &pVarDesc))) {
|
||||
BSTR bstr_ids;
|
||||
zend_constant c;
|
||||
zval exists, results, value;
|
||||
char *const_name;
|
||||
|
||||
if (FAILED(ITypeInfo_GetVarDesc(TypeInfo, j, &pVarDesc))) {
|
||||
break;
|
||||
}
|
||||
|
||||
ITypeInfo_GetNames(TypeInfo, pVarDesc->memid, &bstr_ids, 1, &NameCount);
|
||||
if (NameCount != 1) {
|
||||
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
|
||||
TypeInfo->lpVtbl->GetNames(TypeInfo, pVarDesc->memid, &bstr_ids, 1, &NameCount);
|
||||
if (NameCount!=1) {
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
const_name = php_OLECHAR_to_char(bstr_ids, &c.name_len, codepage TSRMLS_CC);
|
||||
@@ -2257,7 +2282,7 @@ PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
|
||||
php_error(E_WARNING, "%s(): Type library value %s is already defined and has a different value", get_active_function_name(TSRMLS_C), c.name);
|
||||
}
|
||||
free(c.name);
|
||||
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2271,9 +2296,10 @@ PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC)
|
||||
|
||||
zend_register_constant(&c TSRMLS_CC);
|
||||
}
|
||||
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
|
||||
|
||||
j++;
|
||||
}
|
||||
ITypeInfo_Release(TypeInfo);
|
||||
TypeInfo->lpVtbl->Release(TypeInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -52,13 +52,13 @@ AC_ARG_WITH(cpdflib,
|
||||
[
|
||||
PHP_WITH_SHARED
|
||||
if test "$withval" != "no"; then
|
||||
cpdf_withval=$withval
|
||||
PHP_NEW_EXTENSION(cpdf, cpdf.c, $ext_shared,, \\$(GDLIB_CFLAGS))
|
||||
PHP_NEW_EXTENSION(cpdf, cpdf.c, $ext_shared)
|
||||
PHP_SUBST(CPDF_SHARED_LIBADD)
|
||||
|
||||
CPDF_JPEG_TEST
|
||||
CPDF_TIFF_TEST
|
||||
|
||||
for i in $cpdf_withval /usr/local /usr; do
|
||||
for i in $withval /usr /usr/local; do
|
||||
if test -f "$i/include/cpdflib.h"; then
|
||||
CPDFLIB_INCLUDE=$i/include
|
||||
AC_MSG_CHECKING(for cpdflib.h)
|
||||
|
||||
@@ -476,7 +476,6 @@ PHP_FUNCTION(cpdf_open)
|
||||
php_error(E_WARNING, "%s(): Writing to stdout as described in the ClibPDF manual is not possible if php is used as an Apache module. Write to a memory stream and use cpdf_output_buffer() instead.", get_active_function_name(TSRMLS_C));
|
||||
#endif
|
||||
if (php_check_open_basedir(Z_STRVAL_P(arg2) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_P(arg2), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
cpdf_close(cpdf);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
+19
-18
@@ -7,26 +7,27 @@ PHP_ARG_WITH(crack, for CRACKlib support,
|
||||
|
||||
if test "$PHP_CRACK" != "no"; then
|
||||
|
||||
for i in $PHP_CRACK/lib $PHP_CRACK/cracklib /usr/local/lib /usr/lib; do
|
||||
test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i && break
|
||||
done
|
||||
for i in /usr/local/lib /usr/lib $PHP_CRACK/lib $PHP_CRACK/cracklib; do
|
||||
test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i
|
||||
done
|
||||
|
||||
if test -z "$CRACK_LIBDIR"; then
|
||||
AC_MSG_ERROR(Cannot find the cracklib library file)
|
||||
fi
|
||||
|
||||
for i in $PHP_CRACK/include $PHP_CRACK/cracklib /usr/local/include /usr/include; do
|
||||
test -f $i/packer.h && CRACK_INCLUDEDIR=$i && break
|
||||
done
|
||||
for i in /usr/local/include /usr/include $PHP_CRACK/include $PHP_CRACK/cracklib; do
|
||||
test -f $i/packer.h && CRACK_INCLUDEDIR=$i
|
||||
done
|
||||
|
||||
if test -z "$CRACK_INCLUDEDIR"; then
|
||||
AC_MSG_ERROR(Cannot find a cracklib header file)
|
||||
fi
|
||||
if test -z "$CRACK_LIBDIR"; then
|
||||
AC_MSG_ERROR(Cannot find the cracklib library file)
|
||||
fi
|
||||
|
||||
PHP_ADD_INCLUDE($CRACK_INCLUDEDIR)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(crack, $CRACK_LIBDIR, CRACK_SHARED_LIBADD)
|
||||
if test -z "$CRACK_INCLUDEDIR"; then
|
||||
AC_MSG_ERROR(Cannot find a cracklib header file)
|
||||
fi
|
||||
|
||||
PHP_NEW_EXTENSION(crack, crack.c, $ext_shared)
|
||||
PHP_SUBST(CRACK_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_CRACK, 1, [ ])
|
||||
PHP_ADD_INCLUDE($CRACK_INCLUDEDIR)
|
||||
PHP_ADD_LIBRARY_WITH_PATH(crack, $CRACK_LIBDIR, CRACK_SHARED_LIBADD)
|
||||
|
||||
PHP_NEW_EXTENSION(crack, crack.c, $ext_shared)
|
||||
PHP_SUBST(CRACK_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_CRACK, 1, [ ])
|
||||
fi
|
||||
|
||||
+5
-16
@@ -29,9 +29,6 @@
|
||||
|
||||
#include <packer.h>
|
||||
|
||||
extern char * FascistLook(PWDICT *pwp, char *instring);
|
||||
extern int PWClose(PWDICT *pwp);
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(crack)
|
||||
|
||||
/* True global resources - no need for thread safety here */
|
||||
@@ -72,16 +69,11 @@ long _crack_open_dict(char *dictpath TSRMLS_DC)
|
||||
long resource;
|
||||
|
||||
if (CRACKG(current_id) != -1) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not use more than one open dictionary with this implementation of libcrack");
|
||||
zend_error(E_WARNING, "Can not use more than one open dictionary with this implementation of libcrack");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((PG(safe_mode) && (!php_checkuid(dictpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(dictpath TSRMLS_CC)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (NULL == (pwdict = PWOpen(dictpath, "r"))) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open a crack dictionary");
|
||||
zend_error(E_WARNING, "Unable to open a crack dictionary");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -164,7 +156,7 @@ ZEND_FUNCTION(crack_opendict)
|
||||
if (-1 == (resource = _crack_open_dict(Z_STRVAL_PP(dictpath) TSRMLS_CC))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
RETURN_RESOURCE(resource);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -192,10 +184,6 @@ ZEND_FUNCTION(crack_closedict)
|
||||
break;
|
||||
}
|
||||
|
||||
if (id < 1) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(pwdict, PWDICT *, dictionary, id, "cracklib dictionary", le_crack);
|
||||
if (CRACKG(current_id) == id) {
|
||||
CRACKG(current_id) = -1;
|
||||
@@ -230,6 +218,7 @@ ZEND_FUNCTION(crack_check)
|
||||
if (zend_get_parameters_ex(2, &dictionary, &password) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
id = -1;
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -267,7 +256,7 @@ ZEND_FUNCTION(crack_getlastmessage)
|
||||
}
|
||||
|
||||
if (NULL == CRACKG(last_message)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No obscure checks in this session");
|
||||
zend_error(E_WARNING, "No obscure checks in this session");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ PHP_MINFO_FUNCTION(ctype)
|
||||
p=Z_STRVAL_P(c); \
|
||||
len = Z_STRLEN_P(c); \
|
||||
for(n=0;n<len;n++) { \
|
||||
if(!iswhat((int)*(unsigned char *)(p++))) RETURN_FALSE; \
|
||||
if(!iswhat(*p++)) RETURN_FALSE; \
|
||||
} \
|
||||
RETURN_TRUE; \
|
||||
} \
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #25745 (ctype functions fail with non-ascii characters)
|
||||
--FILE--
|
||||
<?php
|
||||
$funcs = array(
|
||||
"ctype_alnum", "ctype_alpha", "ctype_cntrl", "ctype_digit",
|
||||
"ctype_graph", "ctype_lower", "ctype_print", "ctype_punct",
|
||||
"ctype_space", "ctype_upper", "ctype_xdigit"
|
||||
);
|
||||
|
||||
foreach ($funcs as $ctype_func) {
|
||||
for ($i = 0; $i < 256; $i++) {
|
||||
$a = $ctype_func($i);
|
||||
$b = $ctype_func(chr($i));
|
||||
if ($a != $b) {
|
||||
echo "broken... $ctype_func($i) = $a, $ctype_func(chr($i)) = $b\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "ok\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ok
|
||||
+26
-64
@@ -37,11 +37,6 @@
|
||||
#include <curl/curl.h>
|
||||
#include <curl/easy.h>
|
||||
|
||||
/* As of curl 7.11.1 this is no longer defined inside curl.h */
|
||||
#ifndef HttpPost
|
||||
#define HttpPost curl_httppost
|
||||
#endif
|
||||
|
||||
#define SMART_STR_PREALLOC 4096
|
||||
|
||||
#include "ext/standard/php_smart_str.h"
|
||||
@@ -138,9 +133,7 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_PUT);
|
||||
#if CURLOPT_MUTE != 0
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_MUTE);
|
||||
#endif
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_USERPWD);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERPWD);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_RANGE);
|
||||
@@ -198,7 +191,7 @@ PHP_MINIT_FUNCTION(curl)
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_SSLENGINE_DEFAULT);
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_CRLF);
|
||||
#if LIBCURL_VERSION_NUM >= 0x070a00
|
||||
#ifdef CURLOPT_ENCODING
|
||||
REGISTER_CURL_CONSTANT(CURLOPT_ENCODING);
|
||||
#endif
|
||||
|
||||
@@ -356,6 +349,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
zval *argv[2];
|
||||
zval *retval;
|
||||
int error;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
MAKE_STD_ZVAL(argv[0]);
|
||||
MAKE_STD_ZVAL(argv[1]);
|
||||
@@ -375,9 +369,6 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
length = -1;
|
||||
}
|
||||
else {
|
||||
if (Z_TYPE_P(retval) != IS_LONG) {
|
||||
convert_to_long_ex(&retval);
|
||||
}
|
||||
length = Z_LVAL_P(retval);
|
||||
}
|
||||
|
||||
@@ -410,6 +401,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
case PHP_CURL_USER: {
|
||||
zval *argv[3];
|
||||
zval *retval;
|
||||
int length;
|
||||
int error;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
@@ -431,9 +423,11 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
|
||||
if (error == FAILURE) {
|
||||
php_error(E_WARNING, "%s(): Cannot call the CURLOPT_READFUNCTION",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
} else if (Z_TYPE_P(retval) == IS_STRING) {
|
||||
length = MIN(size * nmemb, Z_STRLEN_P(retval));
|
||||
memcpy(data, Z_STRVAL_P(retval), length);
|
||||
length = -1;
|
||||
}
|
||||
else {
|
||||
memcpy(data, Z_STRVAL_P(retval), size * nmemb);
|
||||
length = Z_STRLEN_P(retval);
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&argv[0]);
|
||||
@@ -492,9 +486,6 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
|
||||
length = -1;
|
||||
}
|
||||
else {
|
||||
if (Z_TYPE_P(retval) != IS_LONG) {
|
||||
convert_to_long_ex(&retval);
|
||||
}
|
||||
length = Z_LVAL_P(retval);
|
||||
}
|
||||
zval_ptr_dtor(&argv[0]);
|
||||
@@ -502,18 +493,13 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
|
||||
zval_ptr_dtor(&retval);
|
||||
break;
|
||||
}
|
||||
|
||||
case PHP_CURL_IGNORE:
|
||||
return length;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#if CURLOPT_PASSWDFUNCTION != 0
|
||||
/* {{{ curl_passwd
|
||||
*/
|
||||
static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
|
||||
@@ -523,7 +509,7 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
|
||||
zval *argv[3];
|
||||
zval *retval = NULL;
|
||||
int error;
|
||||
int ret = -1;
|
||||
int ret = 0;
|
||||
TSRMLS_FETCH();
|
||||
|
||||
MAKE_STD_ZVAL(argv[0]);
|
||||
@@ -541,15 +527,17 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
|
||||
retval, 2, argv TSRMLS_CC);
|
||||
if (error == FAILURE) {
|
||||
php_error(E_WARNING, "%s(): Couldn't call the CURLOPT_PASSWDFUNCTION", get_active_function_name(TSRMLS_C));
|
||||
} else if (Z_TYPE_P(retval) == IS_STRING) {
|
||||
ret = -1;
|
||||
}
|
||||
else {
|
||||
if (Z_STRLEN_P(retval) > buflen) {
|
||||
php_error(E_WARNING, "%s(): Returned password is too long for libcurl to handle",
|
||||
get_active_function_name(TSRMLS_C));
|
||||
} else {
|
||||
strlcpy(buf, Z_STRVAL_P(retval), Z_STRLEN_P(retval));
|
||||
ret = -1;
|
||||
}
|
||||
else {
|
||||
strlcpy(buf, Z_STRVAL_P(retval), buflen);
|
||||
}
|
||||
} else {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "User handler '%s' did not return a string.", Z_STRVAL_P(func));
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&argv[0]);
|
||||
@@ -560,7 +548,6 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
|
||||
return ret;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
/* {{{ curl_free_string
|
||||
*/
|
||||
@@ -706,9 +693,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_NETRC:
|
||||
case CURLOPT_FOLLOWLOCATION:
|
||||
case CURLOPT_PUT:
|
||||
#if CURLOPT_MUTE != 0
|
||||
case CURLOPT_MUTE:
|
||||
#endif
|
||||
case CURLOPT_MUTE:
|
||||
case CURLOPT_TIMEOUT:
|
||||
case CURLOPT_FTP_USE_EPSV:
|
||||
case CURLOPT_LOW_SPEED_LIMIT:
|
||||
@@ -744,18 +729,22 @@ PHP_FUNCTION(curl_setopt)
|
||||
case CURLOPT_USERAGENT:
|
||||
case CURLOPT_FTPPORT:
|
||||
case CURLOPT_COOKIE:
|
||||
case CURLOPT_COOKIEFILE:
|
||||
case CURLOPT_REFERER:
|
||||
case CURLOPT_INTERFACE:
|
||||
case CURLOPT_KRB4LEVEL:
|
||||
case CURLOPT_RANDOM_FILE:
|
||||
case CURLOPT_EGDSOCKET:
|
||||
case CURLOPT_CAINFO:
|
||||
case CURLOPT_CAPATH:
|
||||
case CURLOPT_COOKIEJAR:
|
||||
case CURLOPT_SSL_CIPHER_LIST:
|
||||
case CURLOPT_SSLKEY:
|
||||
case CURLOPT_SSLCERT:
|
||||
case CURLOPT_SSLKEYTYPE:
|
||||
case CURLOPT_SSLKEYPASSWD:
|
||||
case CURLOPT_SSLKEYPASSWD:
|
||||
case CURLOPT_SSLENGINE:
|
||||
#if LIBCURL_VERSION_NUM >= 0x070a00
|
||||
#ifdef CURLOPT_ENCODING
|
||||
case CURLOPT_ENCODING:
|
||||
#endif
|
||||
case CURLOPT_SSLENGINE_DEFAULT: {
|
||||
@@ -818,9 +807,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
|
||||
if (Z_LVAL_PP(zvalue)) {
|
||||
ch->handlers->write->method = PHP_CURL_RETURN;
|
||||
} else {
|
||||
ch->handlers->write->method = PHP_CURL_STDOUT;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CURLOPT_BINARYTRANSFER:
|
||||
convert_to_long_ex(zvalue);
|
||||
@@ -853,7 +840,6 @@ PHP_FUNCTION(curl_setopt)
|
||||
ch->handlers->write_header->func = *zvalue;
|
||||
ch->handlers->write_header->method = PHP_CURL_USER;
|
||||
break;
|
||||
#if CURLOPT_PASSWDFUNCTION != 0
|
||||
case CURLOPT_PASSWDFUNCTION:
|
||||
if (ch->handlers->passwd) {
|
||||
zval_ptr_dtor(&ch->handlers->passwd);
|
||||
@@ -863,7 +849,6 @@ PHP_FUNCTION(curl_setopt)
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDFUNCTION, curl_passwd);
|
||||
error = curl_easy_setopt(ch->cp, CURLOPT_PASSWDDATA, (void *) ch);
|
||||
break;
|
||||
#endif
|
||||
case CURLOPT_POSTFIELDS:
|
||||
if (Z_TYPE_PP(zvalue) == IS_ARRAY || Z_TYPE_PP(zvalue) == IS_OBJECT) {
|
||||
zval **current;
|
||||
@@ -906,7 +891,7 @@ PHP_FUNCTION(curl_setopt)
|
||||
error = curl_formadd(&first, &last,
|
||||
CURLFORM_COPYNAME, string_key,
|
||||
CURLFORM_NAMELENGTH, string_key_len - 1,
|
||||
(ZVAL_REFCOUNT(*zvalue) > 1 ? CURLFORM_PTRCONTENTS : CURLFORM_COPYCONTENTS), postval,
|
||||
CURLFORM_PTRCONTENTS, postval,
|
||||
CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current),
|
||||
CURLFORM_END);
|
||||
}
|
||||
@@ -969,28 +954,6 @@ PHP_FUNCTION(curl_setopt)
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, slist);
|
||||
|
||||
break;
|
||||
}
|
||||
/* the following options deal with files, therefor safe_mode & open_basedir checks
|
||||
* are required.
|
||||
*/
|
||||
case CURLOPT_COOKIEJAR:
|
||||
case CURLOPT_SSLCERT:
|
||||
case CURLOPT_RANDOM_FILE:
|
||||
case CURLOPT_COOKIEFILE: {
|
||||
char *copystr = NULL;
|
||||
|
||||
convert_to_string_ex(zvalue);
|
||||
|
||||
if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
|
||||
|
||||
error = curl_easy_setopt(ch->cp, option, copystr);
|
||||
zend_llist_add_element(&ch->to_free.str, ©str);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1040,8 +1003,7 @@ PHP_FUNCTION(curl_exec)
|
||||
|
||||
error = curl_easy_perform(ch->cp);
|
||||
SAVE_CURL_ERROR(ch, error);
|
||||
/* CURLE_PARTIAL_FILE is returned by HEAD requests */
|
||||
if (error != CURLE_OK && error != CURLE_PARTIAL_FILE) {
|
||||
if (error != CURLE_OK) {
|
||||
if (ch->handlers->write->buf.len > 0) {
|
||||
smart_str_free(&ch->handlers->write->buf);
|
||||
}
|
||||
|
||||
+2
-2
@@ -113,7 +113,7 @@ BSC32=bscmake.exe
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 php4ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 php4ts_debug.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
|
||||
# ADD LINK32 php4ts_debug.lib libcurl.lib ssleay32.lib libeay32.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 wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
|
||||
# SUBTRACT LINK32 /pdb:none /nodefaultlib
|
||||
|
||||
!ELSEIF "$(CFG)" == "curl - Win32 Release_TS_SSL"
|
||||
@@ -142,7 +142,7 @@ BSC32=bscmake.exe
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 php4ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 php4ts.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
|
||||
# ADD LINK32 php4ts.lib libcurl.lib ssleay32.lib libeay32.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 wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ dnl $Id$
|
||||
dnl
|
||||
|
||||
PHP_ARG_WITH(cyrus, for cyrus imap support,
|
||||
[ --with-cyrus[=DIR] Include Cyrus IMAP support])
|
||||
[ --with-cyrus[=dir] Include Cyrus IMAP support])
|
||||
|
||||
if test "$PHP_CYRUS" != "no"; then
|
||||
found_cyrus=no
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ AC_DEFUN(AC_PREFERRED_DB_LIB,[
|
||||
|
||||
|
||||
PHP_ARG_WITH(db, for xDBM support,
|
||||
[ --with-db Include old xDBM support (deprecated, use --enable-dba instead)])
|
||||
[ --with-db Include old xDBM support (deprecated use --with-dba)])
|
||||
|
||||
if test "$PHP_DB" != "no"; then
|
||||
|
||||
|
||||
+7
-7
@@ -513,7 +513,7 @@ PHP_FUNCTION(dbminsert)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ PHP_FUNCTION(dbmreplace)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ PHP_FUNCTION(dbmfetch)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ PHP_FUNCTION(dbmexists)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ PHP_FUNCTION(dbmdelete)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -779,7 +779,7 @@ PHP_FUNCTION(dbmfirstkey)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ PHP_FUNCTION(dbmnextkey)
|
||||
|
||||
info = php_find_dbm(id TSRMLS_CC);
|
||||
if (!info) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %d", Z_LVAL_P(id));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
These functions build the foundation for accessing Berkeley DB style
|
||||
databases.
|
||||
|
||||
This is a general abstraction layer for several file-based databases. As
|
||||
such, functionality is limited to a common subset of features supported
|
||||
by modern databases such as Sleepycat Software's DB2. (This is not to be
|
||||
confused with IBM's DB2 software, which is supported through the ODBC
|
||||
functions.)
|
||||
|
||||
This extensions allows to work with the following databases:
|
||||
dbm DBM is the oldest (original) type of Berkeley DB style databases.
|
||||
You should avoid it, if possible. We do not support the
|
||||
compatibility functions built into DB2 and gdbm, because they are
|
||||
only compatible on the source code level, but cannot handle the
|
||||
original dbm format.
|
||||
ndbm NDBM is a newer type and more flexible than dbm. It still has
|
||||
most of the arbitrary limits of dbm (therefore it is deprecated).
|
||||
gdbm GDBM is the GNU database manager.
|
||||
db2 DB2 is Sleepycat Software's DB2. It's described as "a programmatic
|
||||
toolkit that provides high-performance built-in database support
|
||||
for both standalone and client/server applications.
|
||||
db3 DB3 is Sleepycat Software's DB3.
|
||||
db4 DB4 is Sleepycat Software's DB4. This is available since PHP 5.0.
|
||||
cdb CDB is "a fast, reliable, lightweight package for creating and
|
||||
reading constant databases." It is from the author of qmail and
|
||||
can be found at http://cr.yp.to/cdb.html. Since it is constant,
|
||||
we support only reading operations. And since PHP 4.3.0 we support
|
||||
writing (not updating) through the internal cdb library.
|
||||
cdb_make Since PHP 4.3.0 we support creation (not updating) of cdb files
|
||||
when the bundled cdb library is used.
|
||||
flatfile This is available since PHP 4.3.0 for compatibility with the
|
||||
deprecated dbm extension only and should be avoided. However you
|
||||
may use this where files were created in this format. That happens
|
||||
when configure could not find any external library.
|
||||
inifile This is available since PHP 4.3.3 to be able to modify php.ini
|
||||
files from within PHP scripts. When working with ini files you
|
||||
can pass arrays of the form array(0=>group,1=>value_name) or
|
||||
strings of the form "[group]value_name" where group is optional.
|
||||
|
||||
|
||||
After configuring and compiling PHP you must execute the following test
|
||||
from commandline:
|
||||
php run-tests.php ext/dba.
|
||||
This shows whether your combination of handlers works. Most problematic
|
||||
are dbm and ndbm which conflict with many installations. The reason for
|
||||
this is that on several systems these libraries are part of more than one
|
||||
other library. The configuration test only prevents you from configuring
|
||||
malfaunctioning single handlers but not combinations.
|
||||
+3
-3
@@ -198,7 +198,7 @@ AC_ARG_WITH(db4,
|
||||
[ --with-db4[=DIR] DBA: Include Berkeley DB4 support],[
|
||||
if test "$withval" != "no"; then
|
||||
PHP_DBA_STD_BEGIN
|
||||
for i in $withval /usr/local/BerkeleyDB.4.2 /usr/local/BerkeleyDB.4.1 /usr/local/BerkeleyDB.4.0 /usr/local /usr; do
|
||||
for i in $withval /usr/local/BerkeleyDB.4.1 /usr/local/BerkeleyDB.4.0 /usr/local /usr; do
|
||||
if test -f "$i/db4/db.h"; then
|
||||
THIS_PREFIX=$i
|
||||
THIS_INCLUDE=$i/db4/db.h
|
||||
@@ -221,7 +221,7 @@ AC_ARG_WITH(db4,
|
||||
break
|
||||
fi
|
||||
done
|
||||
PHP_DBA_DB_CHECK(4, db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
PHP_DBA_DB_CHECK(4, db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
fi
|
||||
])
|
||||
AC_DBA_STD_RESULT(db4,Berkeley DB4)
|
||||
@@ -258,7 +258,7 @@ AC_ARG_WITH(db3,
|
||||
done
|
||||
PHP_DBA_DB_CHECK(3, db-3.3 db-3.2 db-3.1 db-3.0 db-3 db3 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
|
||||
fi
|
||||
])
|
||||
])
|
||||
AC_DBA_STD_RESULT(db3,Berkeley DB3)
|
||||
|
||||
AC_ARG_WITH(db2,
|
||||
|
||||
+24
-45
@@ -27,6 +27,7 @@
|
||||
|
||||
#if HAVE_DBA
|
||||
|
||||
#include "ext/standard/flock_compat.h"
|
||||
#include "php_ini.h"
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
@@ -37,7 +38,6 @@
|
||||
#include "php_dba.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "ext/standard/php_string.h"
|
||||
#include "ext/standard/flock_compat.h"
|
||||
|
||||
#include "php_gdbm.h"
|
||||
#include "php_ndbm.h"
|
||||
@@ -321,11 +321,7 @@ static void dba_close(dba_info *info TSRMLS_DC)
|
||||
pefree(info->path, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
if (info->fp && info->fp!=info->lock.fp) {
|
||||
if(info->flags&DBA_PERSISTENT) {
|
||||
php_stream_pclose(info->fp);
|
||||
} else {
|
||||
php_stream_close(info->fp);
|
||||
}
|
||||
php_stream_close(info->fp);
|
||||
}
|
||||
if (info->lock.fd) {
|
||||
php_flock(info->lock.fd, LOCK_UN);
|
||||
@@ -333,11 +329,7 @@ static void dba_close(dba_info *info TSRMLS_DC)
|
||||
info->lock.fd = 0;
|
||||
}
|
||||
if (info->lock.fp) {
|
||||
if(info->flags&DBA_PERSISTENT) {
|
||||
php_stream_pclose(info->lock.fp);
|
||||
} else {
|
||||
php_stream_close(info->lock.fp);
|
||||
}
|
||||
php_stream_close(info->lock.fp);
|
||||
}
|
||||
if (info->lock.name) {
|
||||
pefree(info->lock.name, info->flags&DBA_PERSISTENT);
|
||||
@@ -651,36 +643,22 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
case 'c':
|
||||
modenr = DBA_CREAT;
|
||||
lock_mode = (lock_flag & DBA_LOCK_CREAT) ? LOCK_EX : 0;
|
||||
if (lock_mode) {
|
||||
if (lock_dbf) {
|
||||
/* the create/append check will be done on the lock
|
||||
* when the lib opens the file it is already created
|
||||
*/
|
||||
file_mode = "r+b"; /* read & write, seek 0 */
|
||||
lock_file_mode = "a+b"; /* append */
|
||||
} else {
|
||||
file_mode = "a+b"; /* append */
|
||||
lock_file_mode = "w+b"; /* create/truncate */
|
||||
}
|
||||
} else {
|
||||
file_mode = "a+b";
|
||||
if (!lock_mode || !lock_dbf) {
|
||||
break;
|
||||
}
|
||||
/* In case of the 'a+b' append mode, the handler is responsible
|
||||
* to handle any rewind problems (see flatfile handler).
|
||||
/* When we lock the db file it will be created before the handler
|
||||
* even tries to open it, hence we must change to truncate mode.
|
||||
*/
|
||||
break;
|
||||
case 'n':
|
||||
modenr = DBA_TRUNC;
|
||||
lock_mode = (lock_flag & DBA_LOCK_TRUNC) ? LOCK_EX : 0;
|
||||
file_mode = "w+b";
|
||||
break;
|
||||
default:
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Illegal DBA mode");
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (!lock_file_mode) {
|
||||
lock_file_mode = file_mode;
|
||||
modenr = 0;
|
||||
lock_mode = 0;
|
||||
file_mode = "";
|
||||
}
|
||||
if (*pmode=='d' || *pmode=='l' || *pmode=='-') {
|
||||
pmode++; /* done already - skip here */
|
||||
@@ -688,7 +666,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
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)");
|
||||
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;
|
||||
}
|
||||
@@ -706,7 +684,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
lock_mode |= LOCK_NB; /* test =: non blocking */
|
||||
}
|
||||
}
|
||||
if (*pmode) {
|
||||
if (*pmode || !modenr) {
|
||||
php_error_docref2(NULL TSRMLS_CC, Z_STRVAL_PP(args[0]), Z_STRVAL_PP(args[1]), E_WARNING, "Illegal DBA mode");
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
@@ -738,6 +716,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
if (!error && lock_mode) {
|
||||
if (lock_dbf) {
|
||||
info->lock.name = pestrdup(info->path, persistent);
|
||||
lock_file_mode = file_mode;
|
||||
} else {
|
||||
spprintf(&info->lock.name, 0, "%s.lck", info->path);
|
||||
if (!strcmp(file_mode, "r")) {
|
||||
@@ -760,13 +739,13 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (php_stream_cast(info->lock.fp, PHP_STREAM_AS_FD, (void*)&info->lock.fd, 1) == FAILURE) {
|
||||
if (php_stream_cast(info->lock.fp, PHP_STREAM_AS_FD, (void*)&info->lock.fd, 1) == FAILURE) {
|
||||
dba_close(info TSRMLS_CC);
|
||||
/* stream operation already wrote an error message */
|
||||
FREENOW;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (php_flock(info->lock.fd, lock_mode)) {
|
||||
if (php_flock(info->lock.fd, lock_mode)) {
|
||||
error = "Unable to establish lock"; /* force failure exit */
|
||||
}
|
||||
}
|
||||
@@ -842,7 +821,7 @@ PHP_FUNCTION(dba_close)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool dba_exists(string key, resource handle)
|
||||
/* {{{ proto bool dba_exists(string key, int handle)
|
||||
Checks, if the specified key exists */
|
||||
PHP_FUNCTION(dba_exists)
|
||||
{
|
||||
@@ -857,7 +836,7 @@ PHP_FUNCTION(dba_exists)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string dba_fetch(string key, [int skip ,] resource handle)
|
||||
/* {{{ proto string dba_fetch(string key, [int skip ,] int handle)
|
||||
Fetches the data associated with key */
|
||||
PHP_FUNCTION(dba_fetch)
|
||||
{
|
||||
@@ -901,7 +880,7 @@ PHP_FUNCTION(dba_fetch)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string dba_firstkey(resource handle)
|
||||
/* {{{ proto string dba_firstkey(int handle)
|
||||
Resets the internal key pointer and returns the first key */
|
||||
PHP_FUNCTION(dba_firstkey)
|
||||
{
|
||||
@@ -916,7 +895,7 @@ PHP_FUNCTION(dba_firstkey)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string dba_nextkey(resource handle)
|
||||
/* {{{ proto string dba_nextkey(int handle)
|
||||
Returns the next key */
|
||||
PHP_FUNCTION(dba_nextkey)
|
||||
{
|
||||
@@ -931,7 +910,7 @@ PHP_FUNCTION(dba_nextkey)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool dba_delete(string key, resource handle)
|
||||
/* {{{ proto bool dba_delete(string key, int handle)
|
||||
Deletes the entry associated with key
|
||||
If inifile: remove all other key lines */
|
||||
PHP_FUNCTION(dba_delete)
|
||||
@@ -950,7 +929,7 @@ PHP_FUNCTION(dba_delete)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool dba_insert(string key, string value, resource handle)
|
||||
/* {{{ proto bool dba_insert(string key, string value, int handle)
|
||||
If not inifile: Insert value as key, return false, if key exists already
|
||||
If inifile: Add vakue as key (next instance of key) */
|
||||
PHP_FUNCTION(dba_insert)
|
||||
@@ -959,7 +938,7 @@ PHP_FUNCTION(dba_insert)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool dba_replace(string key, string value, resource handle)
|
||||
/* {{{ proto bool dba_replace(string key, string value, int handle)
|
||||
Inserts value as key, replaces key, if key exists already
|
||||
If inifile: remove all other key lines */
|
||||
PHP_FUNCTION(dba_replace)
|
||||
@@ -968,7 +947,7 @@ PHP_FUNCTION(dba_replace)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool dba_optimize(resource handle)
|
||||
/* {{{ proto bool dba_optimize(int handle)
|
||||
Optimizes (e.g. clean up, vacuum) database */
|
||||
PHP_FUNCTION(dba_optimize)
|
||||
{
|
||||
@@ -982,7 +961,7 @@ PHP_FUNCTION(dba_optimize)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool dba_sync(resource handle)
|
||||
/* {{{ proto bool dba_sync(int handle)
|
||||
Synchronizes database */
|
||||
PHP_FUNCTION(dba_sync)
|
||||
{
|
||||
|
||||
+2
-18
@@ -44,7 +44,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_DB3=1 /D DB3_INCLUDE_FILE="db.h" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D DBA_DB3=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D DBA_DB3=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x407 /d "NDEBUG"
|
||||
@@ -71,7 +71,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D "DBA_DB3" /D DB3_INCLUDE_FILE="db.h" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "DBA_DB3" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "DBA_DB3" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x407 /d "_DEBUG"
|
||||
@@ -130,10 +130,6 @@ SOURCE=.\dba_gdbm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dba_inifile.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dba_ndbm.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -142,10 +138,6 @@ SOURCE=.\libflatfile\flatfile.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libinifile\inifile.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libcdb\uint32.c
|
||||
# End Source File
|
||||
# End Group
|
||||
@@ -194,20 +186,12 @@ SOURCE=.\php_gdbm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_inifile.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_ndbm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libcdb\uint32.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libinifile\inifile.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
+11
-38
@@ -41,25 +41,6 @@
|
||||
|
||||
DBA_OPEN_FUNC(flatfile)
|
||||
{
|
||||
int fd;
|
||||
#ifdef F_SETFL
|
||||
int flags;
|
||||
#endif
|
||||
|
||||
if (info->mode != DBA_READER) {
|
||||
if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&fd, 1)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast stream");
|
||||
return FAILURE;
|
||||
}
|
||||
#ifdef F_SETFL
|
||||
/* Needed becasue some systems do not allow to write to the original
|
||||
* file contents with O_APPEND being set.
|
||||
*/
|
||||
flags = fcntl(fd, F_SETFL);
|
||||
fcntl(fd, F_SETFL, flags & ~O_APPEND);
|
||||
#endif
|
||||
}
|
||||
|
||||
info->dbf = pemalloc(sizeof(flatfile), info->flags&DBA_PERSISTENT);
|
||||
memset(info->dbf, 0, sizeof(flatfile));
|
||||
|
||||
@@ -72,9 +53,8 @@ DBA_CLOSE_FUNC(flatfile)
|
||||
{
|
||||
FLATFILE_DATA;
|
||||
|
||||
if (dba->nextkey.dptr) {
|
||||
if (dba->nextkey.dptr)
|
||||
efree(dba->nextkey.dptr);
|
||||
}
|
||||
pefree(dba, info->flags&DBA_PERSISTENT);
|
||||
}
|
||||
|
||||
@@ -87,10 +67,8 @@ DBA_FETCH_FUNC(flatfile)
|
||||
FLATFILE_GKEY;
|
||||
|
||||
gval = flatfile_fetch(dba, gkey TSRMLS_CC);
|
||||
if (gval.dptr) {
|
||||
if (newlen) {
|
||||
*newlen = gval.dsize;
|
||||
}
|
||||
if(gval.dptr) {
|
||||
if(newlen) *newlen = gval.dsize;
|
||||
new = estrndup(gval.dptr, gval.dsize);
|
||||
efree(gval.dptr);
|
||||
}
|
||||
@@ -126,7 +104,7 @@ DBA_EXISTS_FUNC(flatfile)
|
||||
FLATFILE_GKEY;
|
||||
|
||||
gval = flatfile_fetch(dba, gkey TSRMLS_CC);
|
||||
if (gval.dptr) {
|
||||
if(gval.dptr) {
|
||||
efree(gval.dptr);
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -144,14 +122,12 @@ DBA_FIRSTKEY_FUNC(flatfile)
|
||||
{
|
||||
FLATFILE_DATA;
|
||||
|
||||
if (dba->nextkey.dptr) {
|
||||
if (dba->nextkey.dptr)
|
||||
efree(dba->nextkey.dptr);
|
||||
}
|
||||
dba->nextkey = flatfile_firstkey(dba TSRMLS_CC);
|
||||
if (dba->nextkey.dptr) {
|
||||
if (newlen) {
|
||||
if(dba->nextkey.dptr) {
|
||||
if(newlen)
|
||||
*newlen = dba->nextkey.dsize;
|
||||
}
|
||||
return estrndup(dba->nextkey.dptr, dba->nextkey.dsize);
|
||||
}
|
||||
return NULL;
|
||||
@@ -161,18 +137,15 @@ DBA_NEXTKEY_FUNC(flatfile)
|
||||
{
|
||||
FLATFILE_DATA;
|
||||
|
||||
if (!dba->nextkey.dptr) {
|
||||
if(!dba->nextkey.dptr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (dba->nextkey.dptr) {
|
||||
if (dba->nextkey.dptr)
|
||||
efree(dba->nextkey.dptr);
|
||||
}
|
||||
dba->nextkey = flatfile_nextkey(dba TSRMLS_CC);
|
||||
if (dba->nextkey.dptr) {
|
||||
if (newlen) {
|
||||
if(dba->nextkey.dptr) {
|
||||
if(newlen)
|
||||
*newlen = dba->nextkey.dsize;
|
||||
}
|
||||
return estrndup(dba->nextkey.dptr, dba->nextkey.dsize);
|
||||
}
|
||||
return NULL;
|
||||
|
||||
+2
-10
@@ -40,12 +40,7 @@
|
||||
inifile *dba = info->dbf
|
||||
|
||||
#define INIFILE_GKEY \
|
||||
key_type ini_key; \
|
||||
if (!key) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No key specified"); \
|
||||
return 0; \
|
||||
} \
|
||||
ini_key = inifile_key_split((char*)key) /* keylen not needed here */
|
||||
key_type ini_key = inifile_key_split((char*)key) /* keylen not needed here */
|
||||
|
||||
#define INIFILE_DONE \
|
||||
inifile_key_free(&ini_key)
|
||||
@@ -124,12 +119,9 @@ DBA_EXISTS_FUNC(inifile)
|
||||
|
||||
DBA_DELETE_FUNC(inifile)
|
||||
{
|
||||
int res;
|
||||
|
||||
INIFILE_DATA;
|
||||
INIFILE_GKEY;
|
||||
|
||||
res = inifile_delete(dba, &ini_key TSRMLS_CC);
|
||||
int res = inifile_delete(dba, &ini_key TSRMLS_CC);
|
||||
|
||||
INIFILE_DONE;
|
||||
return (res == -1 ? FAILURE : SUCCESS);
|
||||
|
||||
@@ -154,7 +154,7 @@ static char *etrim(const char *str)
|
||||
return NULL;
|
||||
}
|
||||
val = (char*)str;
|
||||
while (*val && strchr(" \t\r\n", *val)) {
|
||||
while (strchr(" \t\r\n", *val)) {
|
||||
val++;
|
||||
}
|
||||
l = strlen(val);
|
||||
@@ -499,7 +499,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
|
||||
ret = FAILURE;
|
||||
} else {
|
||||
php_stream_seek(dba->fp, 0, SEEK_END);
|
||||
if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) {
|
||||
if (pos_grp_next != php_stream_tell(dba->fp)) {
|
||||
php_stream_seek(dba->fp, pos_grp_next, SEEK_SET);
|
||||
if (!php_stream_copy_to_stream(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream");
|
||||
|
||||
@@ -37,9 +37,9 @@ database file created
|
||||
database file created
|
||||
array(3) {
|
||||
[%d]=>
|
||||
string(%d) "%s/dba/tests/test0.dbm"
|
||||
string(%d) "%sext/dba/tests/test0.dbm"
|
||||
[%d]=>
|
||||
string(%d) "%s/dba/tests/test1.dbm"
|
||||
string(%d) "%sext/dba/tests/test1.dbm"
|
||||
[%d]=>
|
||||
string(%d) "%s/dba/tests/test2.dbm"
|
||||
}
|
||||
string(%d) "%sext/dba/tests/test2.dbm"
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
echo "Error creating database\n";
|
||||
}
|
||||
if ($handler != 'cdb') {
|
||||
$db_writer = dba_open($db_filename, 'c'.$lock_flag, $handler);
|
||||
$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 {
|
||||
|
||||
+4
-4
@@ -298,7 +298,7 @@ PHP_FUNCTION(dbase_add_record)
|
||||
tmp = **field;
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_string(&tmp);
|
||||
snprintf(t_cp, cur_f->db_flen+1, cur_f->db_format, Z_STRVAL(tmp));
|
||||
sprintf(t_cp, cur_f->db_format, Z_STRVAL(tmp));
|
||||
zval_dtor(&tmp);
|
||||
t_cp += cur_f->db_flen;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ PHP_FUNCTION(dbase_add_record)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
put_dbf_info(dbh);
|
||||
put_dbf_info(dbh);
|
||||
efree(cp);
|
||||
|
||||
RETURN_TRUE;
|
||||
@@ -369,7 +369,7 @@ PHP_FUNCTION(dbase_replace_record)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_string_ex(field);
|
||||
snprintf(t_cp, cur_f->db_flen+1, cur_f->db_format, Z_STRVAL_PP(field));
|
||||
sprintf(t_cp, cur_f->db_format, Z_STRVAL_PP(field));
|
||||
t_cp += cur_f->db_flen;
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ PHP_FUNCTION(dbase_create)
|
||||
|
||||
/* field type */
|
||||
if (zend_hash_index_find(Z_ARRVAL_PP (field), 1, (void **)&value) == FAILURE) {
|
||||
php_error(E_WARNING, "expected field type as second element of list in field %d", i);
|
||||
php_error(E_WARNING, "expected field type as sececond element of list in field %d", i);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
convert_to_string_ex(value);
|
||||
|
||||
+8
-21
@@ -31,15 +31,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
|
||||
/* e.g. IRIX does not have CRTSCTS */
|
||||
#ifndef CRTSCTS
|
||||
# ifdef CNEW_RTSCTS
|
||||
# define CRTSCTS CNEW_RTSCTS
|
||||
# else
|
||||
# define CRTSCTS 0
|
||||
# endif /* CNEW_RTSCTS */
|
||||
#endif /* !CRTSCTS */
|
||||
|
||||
#define le_fd_name "Direct I/O File Descriptor"
|
||||
static int le_fd;
|
||||
|
||||
@@ -52,7 +43,7 @@ function_entry dio_functions[] = {
|
||||
PHP_FE(dio_read, NULL)
|
||||
PHP_FE(dio_write, NULL)
|
||||
PHP_FE(dio_close, NULL)
|
||||
PHP_FE(dio_tcsetattr, NULL)
|
||||
PHP_FE(dio_tcsetattr, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
@@ -163,10 +154,6 @@ PHP_FUNCTION(dio_open)
|
||||
return;
|
||||
}
|
||||
|
||||
if (php_check_open_basedir(file_name TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(file_name, "wb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (ZEND_NUM_ARGS() == 3) {
|
||||
fd = open(file_name, flags, mode);
|
||||
} else {
|
||||
@@ -174,7 +161,7 @@ PHP_FUNCTION(dio_open)
|
||||
}
|
||||
|
||||
if (fd == -1) {
|
||||
php_error(E_WARNING, "%s(): cannot open file %s with flags %ld and permissions %ld: %s",
|
||||
php_error(E_WARNING, "%s(): cannot open file %s with flags %d and permissions %d: %s",
|
||||
get_active_function_name(TSRMLS_C), file_name, flags, mode, strerror(errno));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -253,7 +240,7 @@ PHP_FUNCTION(dio_truncate)
|
||||
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
|
||||
|
||||
if (ftruncate(f->fd, offset) == -1) {
|
||||
php_error(E_WARNING, "%s(): couldn't truncate %d to %ld bytes: %s",
|
||||
php_error(E_WARNING, "%s(): couldn't truncate %d to %d bytes: %s",
|
||||
get_active_function_name(TSRMLS_C), f->fd, offset, strerror(errno));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -439,13 +426,13 @@ PHP_FUNCTION(dio_tcsetattr)
|
||||
long BAUD,DATABITS,STOPBITS,PARITYON,PARITY;
|
||||
HashTable *fh;
|
||||
zval **element;
|
||||
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &r_fd, &arg) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
|
||||
|
||||
|
||||
|
||||
if (Z_TYPE_P(arg) != IS_ARRAY) {
|
||||
zend_error(E_WARNING,"tcsetattr, third argument should be an associative array");
|
||||
return;
|
||||
@@ -477,8 +464,8 @@ PHP_FUNCTION(dio_tcsetattr)
|
||||
Parity = Z_LVAL_PP(element);
|
||||
}
|
||||
|
||||
/* assign to correct values... */
|
||||
switch (Baud_Rate) {
|
||||
/* assign to correct values... */
|
||||
switch (Baud_Rate) {
|
||||
case 38400:
|
||||
BAUD = B38400;
|
||||
break;
|
||||
@@ -574,7 +561,7 @@ PHP_FUNCTION(dio_tcsetattr)
|
||||
zend_error(E_WARNING, "invalid parity %d", Parity);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
newtio.c_cflag = BAUD | CRTSCTS | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD;
|
||||
newtio.c_iflag = IGNPAR;
|
||||
newtio.c_oflag = 0;
|
||||
|
||||
@@ -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 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 /D "LIBXML_THREAD_ENABLED" /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"
|
||||
@@ -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 "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 /D "LIBXML_THREAD_ENABLED" /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 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 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_domxml.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
|
||||
# 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
|
||||
|
||||
|
||||
+294
-329
File diff suppressed because it is too large.
Load diff
@@ -24,7 +24,6 @@
|
||||
#if HAVE_DOMXML
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#include <libxml/SAX.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/xinclude.h>
|
||||
@@ -246,4 +245,4 @@ typedef struct {
|
||||
#endif /* HAVE_DOMXML */
|
||||
#define phpext_domxml_ptr domxml_module_ptr
|
||||
|
||||
#endif /* _PHP_DOMXML_H */
|
||||
#endif /* _PHP_DIR_H */
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output method="text" encoding="UTF-8"/>
|
||||
|
||||
<xsl:key name="area" match="ROW" use="substring(translate(AREA_NAME, '"', ''), 1, 1)"/>
|
||||
|
||||
<xsl:template match="*">
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AREA_NAME>
|
||||
<ROW>
|
||||
<AREA_CODE>13</AREA_CODE>
|
||||
<AREA_NAME>"Автово" м.</AREA_NAME>
|
||||
<AREA_NAME_ENG>m."Avtovo"</AREA_NAME_ENG>
|
||||
</ROW>
|
||||
</AREA_NAME>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
--TEST--
|
||||
Attributes via append_child not supported (bug #23326)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$document = domxml_new_doc('1.0');
|
||||
$test = $document->create_element('test');
|
||||
$j = 0;
|
||||
for($i=0;$i<10;$i++)
|
||||
{
|
||||
if( $j < 5 )
|
||||
$j = $i;
|
||||
$test->append_child($document->create_attribute("key$j", $i));
|
||||
}
|
||||
$document->append_child($test);
|
||||
echo $document->dump_mem(1);
|
||||
?>
|
||||
--EXPECT--
|
||||
<?xml version="1.0"?>
|
||||
<test key0="0" key1="1" key2="2" key3="3" key4="4" key5="9"/>
|
||||
@@ -1,37 +0,0 @@
|
||||
--TEST--
|
||||
Bug #25900 (DomDocument->get_elements_by_tagname() doesn't work with default ns)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$xml = <<<HERE
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<foo xmlns="http://www.example.com/ns/foo">
|
||||
<bar><test1 /></bar>
|
||||
<bar><test2 /></bar>
|
||||
</foo>
|
||||
HERE;
|
||||
|
||||
function dump($elems) {
|
||||
foreach ($elems as $elem) {
|
||||
var_dump($elem->node_name());
|
||||
if ($elem->node_type() == XML_ELEMENT_NODE) {
|
||||
dump($elem->child_nodes());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dom = xmldoc($xml);
|
||||
$doc = $dom->document_element();
|
||||
dump($dom->get_elements_by_tagname('bar'));
|
||||
dump($doc->get_elements_by_tagname('bar'));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "bar"
|
||||
string(5) "test1"
|
||||
string(3) "bar"
|
||||
string(5) "test2"
|
||||
string(3) "bar"
|
||||
string(5) "test1"
|
||||
string(3) "bar"
|
||||
string(5) "test2"
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #26384 (domxslt->process causes segfault with xsl:key)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc');
|
||||
if (!function_exists("domxml_xslt_stylesheet_file")) { die("skip No XSLT support found");};
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$xml = domxml_open_mem(file_get_contents(dirname(__FILE__)."/area_name.xml"));
|
||||
$xslt = domxml_xslt_stylesheet_file(dirname(__FILE__).'/area_list.xsl');
|
||||
print $xslt->process($xml, Array(), null, null);
|
||||
|
||||
--EXPECT--
|
||||
Object
|
||||
@@ -1,8 +1,8 @@
|
||||
/* character-class table */
|
||||
static struct cclass {
|
||||
unsigned char *name;
|
||||
unsigned char *chars;
|
||||
unsigned char *multis;
|
||||
char *name;
|
||||
char *chars;
|
||||
char *multis;
|
||||
} cclasses[] = {
|
||||
{"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ""},
|
||||
{"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
||||
|
||||
@@ -124,9 +124,9 @@ FILE *d;
|
||||
break;
|
||||
case OCHAR:
|
||||
if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL)
|
||||
fprintf(d, "\\%c", (unsigned char)opnd);
|
||||
fprintf(d, "\\%c", (char)opnd);
|
||||
else
|
||||
fprintf(d, "%s", regchar((unsigned char)opnd));
|
||||
fprintf(d, "%s", regchar((char)opnd));
|
||||
break;
|
||||
case OBOL:
|
||||
fprintf(d, "^");
|
||||
@@ -228,11 +228,11 @@ FILE *d;
|
||||
- regchar - make a character printable
|
||||
== static char *regchar(int ch);
|
||||
*/
|
||||
static unsigned char * /* -> representation */
|
||||
static char * /* -> representation */
|
||||
regchar(ch)
|
||||
int ch;
|
||||
{
|
||||
static unsigned char buf[10];
|
||||
static char buf[10];
|
||||
|
||||
if (isprint(ch) || ch == ' ')
|
||||
sprintf(buf, "%c", ch);
|
||||
|
||||
+63
-63
@@ -33,11 +33,11 @@ struct match {
|
||||
struct re_guts *g;
|
||||
int eflags;
|
||||
regmatch_t *pmatch; /* [nsub+1] (0 element unused) */
|
||||
unsigned char *offp; /* offsets work from here */
|
||||
unsigned char *beginp; /* start of string -- virtual NUL precedes */
|
||||
unsigned char *endp; /* end of string -- virtual NUL here */
|
||||
unsigned char *coldp; /* can be no match starting before here */
|
||||
unsigned char **lastpos; /* [nplus+1] */
|
||||
char *offp; /* offsets work from here */
|
||||
char *beginp; /* start of string -- virtual NUL precedes */
|
||||
char *endp; /* end of string -- virtual NUL here */
|
||||
char *coldp; /* can be no match starting before here */
|
||||
char **lastpos; /* [nplus+1] */
|
||||
STATEVARS;
|
||||
states st; /* current states */
|
||||
states fresh; /* states for a fresh start */
|
||||
@@ -65,20 +65,20 @@ struct match {
|
||||
static int /* 0 success, REG_NOMATCH failure */
|
||||
matcher(g, string, nmatch, pmatch, eflags)
|
||||
register struct re_guts *g;
|
||||
unsigned char *string;
|
||||
char *string;
|
||||
size_t nmatch;
|
||||
regmatch_t pmatch[];
|
||||
int eflags;
|
||||
{
|
||||
register unsigned char *endp;
|
||||
register char *endp;
|
||||
register size_t i;
|
||||
struct match mv;
|
||||
register struct match *m = &mv;
|
||||
register unsigned char *dp;
|
||||
register char *dp;
|
||||
const register sopno gf = g->firststate+1; /* +1 for OEND */
|
||||
const register sopno gl = g->laststate;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
char *start;
|
||||
char *stop;
|
||||
|
||||
/* simplify the situation where possible */
|
||||
if (g->cflags®_NOSUB)
|
||||
@@ -156,10 +156,10 @@ int eflags;
|
||||
dp = dissect(m, m->coldp, endp, gf, gl);
|
||||
} else {
|
||||
if (g->nplus > 0 && m->lastpos == NULL)
|
||||
m->lastpos = (unsigned char **)malloc((g->nplus+1) *
|
||||
sizeof(unsigned char *));
|
||||
m->lastpos = (char **)malloc((g->nplus+1) *
|
||||
sizeof(char *));
|
||||
if (g->nplus > 0 && m->lastpos == NULL) {
|
||||
free((char *)m->pmatch);
|
||||
free(m->pmatch);
|
||||
STATETEARDOWN(m);
|
||||
return(REG_ESPACE);
|
||||
}
|
||||
@@ -225,30 +225,30 @@ int eflags;
|
||||
|
||||
/*
|
||||
- dissect - figure out what matched what, no back references
|
||||
== static unsigned char *dissect(register struct match *m, unsigned char *start, \
|
||||
== unsigned char *stop, sopno startst, sopno stopst);
|
||||
== static char *dissect(register struct match *m, char *start, \
|
||||
== char *stop, sopno startst, sopno stopst);
|
||||
*/
|
||||
static unsigned char * /* == stop (success) always */
|
||||
static char * /* == stop (success) always */
|
||||
dissect(m, start, stop, startst, stopst)
|
||||
register struct match *m;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
char *start;
|
||||
char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
{
|
||||
register int i;
|
||||
register sopno ss; /* start sop of current subRE */
|
||||
register sopno es; /* end sop of current subRE */
|
||||
register unsigned char *sp; /* start of string matched by it */
|
||||
register unsigned char *stp; /* string matched by it cannot pass here */
|
||||
register unsigned char *rest; /* start of rest of string */
|
||||
register unsigned char *tail; /* string unmatched by rest of RE */
|
||||
register char *sp; /* start of string matched by it */
|
||||
register char *stp; /* string matched by it cannot pass here */
|
||||
register char *rest; /* start of rest of string */
|
||||
register char *tail; /* string unmatched by rest of RE */
|
||||
register sopno ssub; /* start sop of subsubRE */
|
||||
register sopno esub; /* end sop of subsubRE */
|
||||
register unsigned char *ssp; /* start of string matched by subsubRE */
|
||||
register unsigned char *sep; /* end of string matched by subsubRE */
|
||||
register unsigned char *oldssp; /* previous ssp */
|
||||
register unsigned char *dp;
|
||||
register char *ssp; /* start of string matched by subsubRE */
|
||||
register char *sep; /* end of string matched by subsubRE */
|
||||
register char *oldssp; /* previous ssp */
|
||||
register char *dp;
|
||||
|
||||
AT("diss", start, stop, startst, stopst);
|
||||
sp = start;
|
||||
@@ -413,25 +413,25 @@ sopno stopst;
|
||||
|
||||
/*
|
||||
- backref - figure out what matched what, figuring in back references
|
||||
== static unsigned char *backref(register struct match *m, unsigned char *start, \
|
||||
== unsigned char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
== static char *backref(register struct match *m, char *start, \
|
||||
== char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
*/
|
||||
static unsigned char * /* == stop (success) or NULL (failure) */
|
||||
static char * /* == stop (success) or NULL (failure) */
|
||||
backref(m, start, stop, startst, stopst, lev)
|
||||
register struct match *m;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
char *start;
|
||||
char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
sopno lev; /* PLUS nesting level */
|
||||
{
|
||||
register int i;
|
||||
register sopno ss; /* start sop of current subRE */
|
||||
register unsigned char *sp; /* start of string matched by it */
|
||||
register char *sp; /* start of string matched by it */
|
||||
register sopno ssub; /* start sop of subsubRE */
|
||||
register sopno esub; /* end sop of subsubRE */
|
||||
register unsigned char *ssp; /* start of string matched by subsubRE */
|
||||
register unsigned char *dp;
|
||||
register char *ssp; /* start of string matched by subsubRE */
|
||||
register char *dp;
|
||||
register size_t len;
|
||||
register int hard;
|
||||
register sop s;
|
||||
@@ -446,7 +446,7 @@ sopno lev; /* PLUS nesting level */
|
||||
for (ss = startst; !hard && ss < stopst; ss++)
|
||||
switch (OP(s = m->g->strip[ss])) {
|
||||
case OCHAR:
|
||||
if (sp == stop || *sp++ != (unsigned char)OPND(s))
|
||||
if (sp == stop || *sp++ != (char)OPND(s))
|
||||
return(NULL);
|
||||
break;
|
||||
case OANY:
|
||||
@@ -613,31 +613,31 @@ sopno lev; /* PLUS nesting level */
|
||||
/* "can't happen" */
|
||||
assert(nope);
|
||||
/* NOTREACHED */
|
||||
return((unsigned char *)NULL); /* dummy */
|
||||
return((char *)NULL); /* dummy */
|
||||
}
|
||||
|
||||
/*
|
||||
- fast - step through the string at top speed
|
||||
== static unsigned char *fast(register struct match *m, unsigned char *start, \
|
||||
== unsigned char *stop, sopno startst, sopno stopst);
|
||||
== static char *fast(register struct match *m, char *start, \
|
||||
== char *stop, sopno startst, sopno stopst);
|
||||
*/
|
||||
static unsigned char * /* where tentative match ended, or NULL */
|
||||
static char * /* where tentative match ended, or NULL */
|
||||
fast(m, start, stop, startst, stopst)
|
||||
register struct match *m;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
char *start;
|
||||
char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
{
|
||||
register states st = m->st;
|
||||
register states fresh = m->fresh;
|
||||
register states tmp = m->tmp;
|
||||
register unsigned char *p = start;
|
||||
register char *p = start;
|
||||
register int c = (start == m->beginp) ? OUT : *(start-1);
|
||||
register int lastc; /* previous c */
|
||||
register int flagch;
|
||||
register int i;
|
||||
register unsigned char *coldp; /* last p after which no match was underway */
|
||||
register char *coldp; /* last p after which no match was underway */
|
||||
|
||||
CLEAR(st);
|
||||
SET1(st, startst);
|
||||
@@ -709,26 +709,26 @@ sopno stopst;
|
||||
|
||||
/*
|
||||
- slow - step through the string more deliberately
|
||||
== static unsigned char *slow(register struct match *m, unsigned char *start, \
|
||||
== unsigned char *stop, sopno startst, sopno stopst);
|
||||
== static char *slow(register struct match *m, char *start, \
|
||||
== char *stop, sopno startst, sopno stopst);
|
||||
*/
|
||||
static unsigned char * /* where it ended */
|
||||
static char * /* where it ended */
|
||||
slow(m, start, stop, startst, stopst)
|
||||
register struct match *m;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
char *start;
|
||||
char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
{
|
||||
register states st = m->st;
|
||||
register states empty = m->empty;
|
||||
register states tmp = m->tmp;
|
||||
register unsigned char *p = start;
|
||||
register char *p = start;
|
||||
register int c = (start == m->beginp) ? OUT : *(start-1);
|
||||
register int lastc; /* previous c */
|
||||
register int flagch;
|
||||
register int i;
|
||||
register unsigned char *matchp; /* last p at which a match ended */
|
||||
register char *matchp; /* last p at which a match ended */
|
||||
|
||||
AT("slow", start, stop, startst, stopst);
|
||||
CLEAR(st);
|
||||
@@ -805,8 +805,8 @@ sopno stopst;
|
||||
== #define BOW (BOL+4)
|
||||
== #define EOW (BOL+5)
|
||||
== #define CODEMAX (BOL+5) // highest code used
|
||||
== #define NONCHAR(c) ((c) > UCHAR_MAX)
|
||||
== #define NNONCHAR (CODEMAX-UCHAR_MAX)
|
||||
== #define NONCHAR(c) ((c) > CHAR_MAX)
|
||||
== #define NNONCHAR (CODEMAX-CHAR_MAX)
|
||||
*/
|
||||
static states
|
||||
step(g, start, stop, bef, ch, aft)
|
||||
@@ -832,8 +832,8 @@ register states aft; /* states already known reachable after */
|
||||
break;
|
||||
case OCHAR:
|
||||
/* only characters can match */
|
||||
assert(!NONCHAR(ch) || ch != (unsigned char)OPND(s));
|
||||
if (ch == (unsigned char)OPND(s))
|
||||
assert(!NONCHAR(ch) || ch != (char)OPND(s));
|
||||
if (ch == (char)OPND(s))
|
||||
FWD(aft, bef, 1);
|
||||
break;
|
||||
case OBOL:
|
||||
@@ -926,14 +926,14 @@ register states aft; /* states already known reachable after */
|
||||
/*
|
||||
- print - print a set of states
|
||||
== #ifdef REDEBUG
|
||||
== static void print(struct match *m, unsigned char *caption, states st, \
|
||||
== static void print(struct match *m, char *caption, states st, \
|
||||
== int ch, FILE *d);
|
||||
== #endif
|
||||
*/
|
||||
static void
|
||||
print(m, caption, st, ch, d)
|
||||
struct match *m;
|
||||
unsigned char *caption;
|
||||
char *caption;
|
||||
states st;
|
||||
int ch;
|
||||
FILE *d;
|
||||
@@ -959,16 +959,16 @@ FILE *d;
|
||||
/*
|
||||
- at - print current situation
|
||||
== #ifdef REDEBUG
|
||||
== static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, \
|
||||
== static void at(struct match *m, char *title, char *start, char *stop, \
|
||||
== sopno startst, sopno stopst);
|
||||
== #endif
|
||||
*/
|
||||
static void
|
||||
at(m, title, start, stop, startst, stopst)
|
||||
struct match *m;
|
||||
unsigned char *title;
|
||||
unsigned char *start;
|
||||
unsigned char *stop;
|
||||
char *title;
|
||||
char *start;
|
||||
char *stop;
|
||||
sopno startst;
|
||||
sopno stopst;
|
||||
{
|
||||
@@ -985,7 +985,7 @@ sopno stopst;
|
||||
/*
|
||||
- pchar - make a character printable
|
||||
== #ifdef REDEBUG
|
||||
== static unsigned char *pchar(int ch);
|
||||
== static char *pchar(int ch);
|
||||
== #endif
|
||||
*
|
||||
* Is this identical to regchar() over in debug.c? Well, yes. But a
|
||||
@@ -993,11 +993,11 @@ sopno stopst;
|
||||
* a matching debug.o, and this is convenient. It all disappears in
|
||||
* the non-debug compilation anyway, so it doesn't matter much.
|
||||
*/
|
||||
static unsigned char * /* -> representation */
|
||||
static char * /* -> representation */
|
||||
pchar(ch)
|
||||
int ch;
|
||||
{
|
||||
static unsigned char pbuf[10];
|
||||
static char pbuf[10];
|
||||
|
||||
if (isprint(ch) || ch == ' ')
|
||||
sprintf(pbuf, "%c", ch);
|
||||
|
||||
+10
-10
@@ -4,11 +4,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* === engine.c === */
|
||||
static int matcher(register struct re_guts *g, unsigned char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
static unsigned char *dissect(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static unsigned char *backref(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
static unsigned char *fast(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static unsigned char *slow(register struct match *m, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static int matcher(register struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
static char *dissect(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static char *backref(register struct match *m, char *start, char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
static char *fast(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static char *slow(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft);
|
||||
#define BOL (OUT+1)
|
||||
#define EOL (BOL+1)
|
||||
@@ -17,16 +17,16 @@ static states step(register struct re_guts *g, sopno start, sopno stop, register
|
||||
#define BOW (BOL+4)
|
||||
#define EOW (BOL+5)
|
||||
#define CODEMAX (BOL+5) /* highest code used */
|
||||
#define NONCHAR(c) ((c) > UCHAR_MAX)
|
||||
#define NNONCHAR (CODEMAX-UCHAR_MAX)
|
||||
#define NONCHAR(c) ((c) > CHAR_MAX)
|
||||
#define NNONCHAR (CODEMAX-CHAR_MAX)
|
||||
#ifdef REDEBUG
|
||||
static void print(struct match *m, unsigned char *caption, states st, int ch, FILE *d);
|
||||
static void print(struct match *m, char *caption, states st, int ch, FILE *d);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static void at(struct match *m, unsigned char *title, unsigned char *start, unsigned char *stop, sopno startst, sopno stopst);
|
||||
static void at(struct match *m, char *title, char *start, char *stop, sopno startst, sopno stopst);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static unsigned char *pchar(int ch);
|
||||
static char *pchar(int ch);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
+45
-45
@@ -19,8 +19,8 @@
|
||||
* other clumsinesses
|
||||
*/
|
||||
struct parse {
|
||||
unsigned char *next; /* next character in RE */
|
||||
unsigned char *end; /* end of string (-> NUL normally) */
|
||||
char *next; /* next character in RE */
|
||||
char *end; /* end of string (-> NUL normally) */
|
||||
int error; /* has an error been seen? */
|
||||
sop *strip; /* malloced strip */
|
||||
sopno ssize; /* malloced strip size (allocated) */
|
||||
@@ -34,7 +34,7 @@ struct parse {
|
||||
|
||||
#include "regcomp.ih"
|
||||
|
||||
static unsigned char nuls[10]; /* place to point scanner in event of error */
|
||||
static char nuls[10]; /* place to point scanner in event of error */
|
||||
|
||||
/*
|
||||
* macros for use with parse structure
|
||||
@@ -127,7 +127,7 @@ int cflags;
|
||||
|
||||
/* set things up */
|
||||
p->g = g;
|
||||
p->next = (unsigned char *)pattern; /* convenience; we do not modify it */
|
||||
p->next = (char *)pattern; /* convenience; we do not modify it */
|
||||
p->end = p->next + len;
|
||||
p->error = 0;
|
||||
p->ncsalloc = 0;
|
||||
@@ -147,7 +147,7 @@ int cflags;
|
||||
g->mlen = 0;
|
||||
g->nsub = 0;
|
||||
g->ncategories = 1; /* category 0 is "everything else" */
|
||||
g->categories = &g->catspace[0];
|
||||
g->categories = &g->catspace[-(CHAR_MIN)];
|
||||
(void) memset((char *)g->catspace, 0, NC*sizeof(cat_t));
|
||||
g->backrefs = 0;
|
||||
|
||||
@@ -193,7 +193,7 @@ p_ere(p, stop)
|
||||
register struct parse *p;
|
||||
int stop; /* character this ERE should end at */
|
||||
{
|
||||
register unsigned char c;
|
||||
register char c;
|
||||
register sopno prevback = 0;
|
||||
register sopno prevfwd = 0;
|
||||
register sopno conc;
|
||||
@@ -238,7 +238,7 @@ static void
|
||||
p_ere_exp(p)
|
||||
register struct parse *p;
|
||||
{
|
||||
register unsigned char c;
|
||||
register char c;
|
||||
register sopno pos;
|
||||
register int count;
|
||||
register int count2;
|
||||
@@ -518,7 +518,7 @@ int starordinary; /* is a leading * an ordinary character? */
|
||||
REQUIRE(starordinary, REG_BADRPT);
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
ordinary(p, (unsigned char)c); /* takes off BACKSL, if any */
|
||||
ordinary(p, (char)c); /* takes off BACKSL, if any */
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -657,8 +657,8 @@ p_b_term(p, cs)
|
||||
register struct parse *p;
|
||||
register cset *cs;
|
||||
{
|
||||
register unsigned char c;
|
||||
register unsigned char start, finish;
|
||||
register char c;
|
||||
register char start, finish;
|
||||
register int i;
|
||||
|
||||
/* classify what we've got */
|
||||
@@ -723,11 +723,11 @@ p_b_cclass(p, cs)
|
||||
register struct parse *p;
|
||||
register cset *cs;
|
||||
{
|
||||
register unsigned char *sp = p->next;
|
||||
register char *sp = p->next;
|
||||
register struct cclass *cp;
|
||||
register size_t len;
|
||||
register unsigned char *u;
|
||||
register unsigned char c;
|
||||
register char *u;
|
||||
register char c;
|
||||
|
||||
while (MORE() && isalpha(PEEK()))
|
||||
NEXT();
|
||||
@@ -759,7 +759,7 @@ p_b_eclass(p, cs)
|
||||
register struct parse *p;
|
||||
register cset *cs;
|
||||
{
|
||||
register unsigned char c;
|
||||
register char c;
|
||||
|
||||
c = p_b_coll_elem(p, '=');
|
||||
CHadd(cs, c);
|
||||
@@ -769,11 +769,11 @@ register cset *cs;
|
||||
- p_b_symbol - parse a character or [..]ed multicharacter collating symbol
|
||||
== static char p_b_symbol(register struct parse *p);
|
||||
*/
|
||||
static unsigned char /* value of symbol */
|
||||
static char /* value of symbol */
|
||||
p_b_symbol(p)
|
||||
register struct parse *p;
|
||||
{
|
||||
register unsigned char value;
|
||||
register char value;
|
||||
|
||||
REQUIRE(MORE(), REG_EBRACK);
|
||||
if (!EATTWO('[', '.'))
|
||||
@@ -789,12 +789,12 @@ register struct parse *p;
|
||||
- p_b_coll_elem - parse a collating-element name and look it up
|
||||
== static char p_b_coll_elem(register struct parse *p, int endc);
|
||||
*/
|
||||
static unsigned char /* value of collating element */
|
||||
static char /* value of collating element */
|
||||
p_b_coll_elem(p, endc)
|
||||
register struct parse *p;
|
||||
int endc; /* name ended by endc,']' */
|
||||
{
|
||||
register unsigned char *sp = p->next;
|
||||
register char *sp = p->next;
|
||||
register struct cname *cp;
|
||||
register int len;
|
||||
|
||||
@@ -818,7 +818,7 @@ int endc; /* name ended by endc,']' */
|
||||
- othercase - return the case counterpart of an alphabetic
|
||||
== static char othercase(int ch);
|
||||
*/
|
||||
static unsigned char /* if no counterpart, return ch */
|
||||
static char /* if no counterpart, return ch */
|
||||
othercase(ch)
|
||||
int ch;
|
||||
{
|
||||
@@ -842,9 +842,9 @@ bothcases(p, ch)
|
||||
register struct parse *p;
|
||||
int ch;
|
||||
{
|
||||
register unsigned char *oldnext = p->next;
|
||||
register unsigned char *oldend = p->end;
|
||||
unsigned char bracket[3];
|
||||
register char *oldnext = p->next;
|
||||
register char *oldend = p->end;
|
||||
char bracket[3];
|
||||
|
||||
assert(othercase(ch) != ch); /* p_bracket() would recurse */
|
||||
p->next = bracket;
|
||||
@@ -888,9 +888,9 @@ static void
|
||||
nonnewline(p)
|
||||
register struct parse *p;
|
||||
{
|
||||
register unsigned char *oldnext = p->next;
|
||||
register unsigned char *oldend = p->end;
|
||||
unsigned char bracket[4];
|
||||
register char *oldnext = p->next;
|
||||
register char *oldend = p->end;
|
||||
char bracket[4];
|
||||
|
||||
p->next = bracket;
|
||||
p->end = bracket+3;
|
||||
@@ -1015,19 +1015,19 @@ register struct parse *p;
|
||||
if (p->g->sets == NULL)
|
||||
p->g->sets = (cset *)malloc(nc * sizeof(cset));
|
||||
else
|
||||
p->g->sets = (cset *)realloc((unsigned char *)p->g->sets,
|
||||
p->g->sets = (cset *)realloc((char *)p->g->sets,
|
||||
nc * sizeof(cset));
|
||||
if (p->g->setbits == NULL)
|
||||
p->g->setbits = (uch *)malloc(nbytes);
|
||||
else {
|
||||
p->g->setbits = (uch *)realloc((unsigned char *)p->g->setbits,
|
||||
p->g->setbits = (uch *)realloc((char *)p->g->setbits,
|
||||
nbytes);
|
||||
/* xxx this isn't right if setbits is now NULL */
|
||||
for (i = 0; i < no; i++)
|
||||
p->g->sets[i].ptr = p->g->setbits + css*(i/CHAR_BIT);
|
||||
}
|
||||
if (p->g->sets != NULL && p->g->setbits != NULL)
|
||||
(void) memset((unsigned char *)p->g->setbits + (nbytes - css),
|
||||
(void) memset((char *)p->g->setbits + (nbytes - css),
|
||||
0, css);
|
||||
else {
|
||||
no = 0;
|
||||
@@ -1120,7 +1120,7 @@ register cset *cs;
|
||||
|
||||
for (i = 0; i < css; i++)
|
||||
if (CHIN(cs, i))
|
||||
return((unsigned char)i);
|
||||
return((char)i);
|
||||
assert(never);
|
||||
return(0); /* arbitrary */
|
||||
}
|
||||
@@ -1153,7 +1153,7 @@ static void
|
||||
mcadd(p, cs, cp)
|
||||
register struct parse *p;
|
||||
register cset *cs;
|
||||
register unsigned char *cp;
|
||||
register char *cp;
|
||||
{
|
||||
register size_t oldend = cs->smultis;
|
||||
|
||||
@@ -1174,14 +1174,14 @@ register unsigned char *cp;
|
||||
#if 0
|
||||
/*
|
||||
- mcsub - subtract a collating element from a cset
|
||||
== static void mcsub(register cset *cs, register unsigned char *cp);
|
||||
== static void mcsub(register cset *cs, register char *cp);
|
||||
*/
|
||||
static void
|
||||
mcsub(cs, cp)
|
||||
register unsigned cset *cs;
|
||||
register unsigned char *cp;
|
||||
register cset *cs;
|
||||
register char *cp;
|
||||
{
|
||||
register unsigned char *fp = mcfind(cs, cp);
|
||||
register char *fp = mcfind(cs, cp);
|
||||
register size_t len = strlen(fp);
|
||||
|
||||
assert(fp != NULL);
|
||||
@@ -1201,12 +1201,12 @@ register unsigned char *cp;
|
||||
|
||||
/*
|
||||
- mcin - is a collating element in a cset?
|
||||
== static int mcin(register cset *cs, register unsigned char *cp);
|
||||
== static int mcin(register cset *cs, register char *cp);
|
||||
*/
|
||||
static int
|
||||
mcin(cs, cp)
|
||||
register cset *cs;
|
||||
register unsigned char *cp;
|
||||
register char *cp;
|
||||
{
|
||||
return(mcfind(cs, cp) != NULL);
|
||||
}
|
||||
@@ -1214,14 +1214,14 @@ register unsigned char *cp;
|
||||
|
||||
/*
|
||||
- mcfind - find a collating element in a cset
|
||||
== static unsigned char *mcfind(register cset *cs, register unsigned char *cp);
|
||||
== static char *mcfind(register cset *cs, register char *cp);
|
||||
*/
|
||||
static unsigned char *
|
||||
static char *
|
||||
mcfind(cs, cp)
|
||||
register cset *cs;
|
||||
register unsigned char *cp;
|
||||
register char *cp;
|
||||
{
|
||||
register unsigned char *p;
|
||||
register char *p;
|
||||
|
||||
if (cs->multis == NULL)
|
||||
return(NULL);
|
||||
@@ -1322,11 +1322,11 @@ register struct re_guts *g;
|
||||
if (p->error != 0)
|
||||
return;
|
||||
|
||||
for (c = 0; c <= UCHAR_MAX; c++)
|
||||
for (c = CHAR_MIN; c <= CHAR_MAX; c++)
|
||||
if (cats[c] == 0 && isinsets(g, c)) {
|
||||
cat = g->ncategories++;
|
||||
cats[c] = cat;
|
||||
for (c2 = c+1; c2 <= UCHAR_MAX; c2++)
|
||||
for (c2 = c+1; c2 <= CHAR_MAX; c2++)
|
||||
if (cats[c2] == 0 && samesets(g, c, c2))
|
||||
cats[c2] = cat;
|
||||
}
|
||||
@@ -1477,7 +1477,7 @@ register struct parse *p;
|
||||
register struct re_guts *g;
|
||||
{
|
||||
g->nstates = p->slen;
|
||||
g->strip = (sop *)realloc((unsigned char *)p->strip, p->slen * sizeof(sop));
|
||||
g->strip = (sop *)realloc((char *)p->strip, p->slen * sizeof(sop));
|
||||
if (g->strip == NULL) {
|
||||
SETERROR(REG_ESPACE);
|
||||
g->strip = p->strip;
|
||||
@@ -1504,7 +1504,7 @@ register struct re_guts *g;
|
||||
register sop *newstart = NULL;
|
||||
register sopno newlen;
|
||||
register sop s;
|
||||
register unsigned char *cp;
|
||||
register char *cp;
|
||||
register sopno i;
|
||||
|
||||
/* avoid making error situations worse */
|
||||
@@ -1565,7 +1565,7 @@ register struct re_guts *g;
|
||||
while (OP(s = *scan++) != OCHAR)
|
||||
continue;
|
||||
assert(cp < g->must + g->mlen);
|
||||
*cp++ = (unsigned char)OPND(s);
|
||||
*cp++ = (char)OPND(s);
|
||||
}
|
||||
assert(cp == g->must + g->mlen);
|
||||
*cp++ = '\0'; /* just on general principles */
|
||||
|
||||
@@ -14,9 +14,9 @@ static void p_bracket(register struct parse *p);
|
||||
static void p_b_term(register struct parse *p, register cset *cs);
|
||||
static void p_b_cclass(register struct parse *p, register cset *cs);
|
||||
static void p_b_eclass(register struct parse *p, register cset *cs);
|
||||
static unsigned char p_b_symbol(register struct parse *p);
|
||||
static unsigned char p_b_coll_elem(register struct parse *p, int endc);
|
||||
static unsigned char othercase(int ch);
|
||||
static char p_b_symbol(register struct parse *p);
|
||||
static char p_b_coll_elem(register struct parse *p, int endc);
|
||||
static char othercase(int ch);
|
||||
static void bothcases(register struct parse *p, int ch);
|
||||
static void ordinary(register struct parse *p, register int ch);
|
||||
static void nonnewline(register struct parse *p);
|
||||
@@ -27,11 +27,11 @@ static void freeset(register struct parse *p, register cset *cs);
|
||||
static int freezeset(register struct parse *p, register cset *cs);
|
||||
static int firstch(register struct parse *p, register cset *cs);
|
||||
static int nch(register struct parse *p, register cset *cs);
|
||||
static void mcadd(register struct parse *p, register cset *cs, register unsigned char *cp);
|
||||
static void mcadd(register struct parse *p, register cset *cs, register char *cp);
|
||||
#if 0
|
||||
static void mcsub(register cset *cs, register unsigned char *cp);
|
||||
static int mcin(register cset *cs, register unsigned char *cp);
|
||||
static unsigned char *mcfind(register cset *cs, register unsigned char *cp);
|
||||
static void mcsub(register cset *cs, register char *cp);
|
||||
static int mcin(register cset *cs, register char *cp);
|
||||
static char *mcfind(register cset *cs, register char *cp);
|
||||
#endif
|
||||
static void mcinvert(register struct parse *p, register cset *cs);
|
||||
static void mccase(register struct parse *p, register cset *cs);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
= typedef struct {
|
||||
= int re_magic;
|
||||
= size_t re_nsub; // number of parenthesized subexpressions
|
||||
= const unsigned char *re_endp; // end pointer for REG_PEND
|
||||
= const char *re_endp; // end pointer for REG_PEND
|
||||
= struct re_guts *re_g; // none of your business :-)
|
||||
= } regex_t;
|
||||
= typedef struct {
|
||||
@@ -90,7 +90,7 @@ typedef struct {
|
||||
uch mask; /* bit within array */
|
||||
uch hash; /* hash code */
|
||||
size_t smultis;
|
||||
unsigned char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */
|
||||
char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */
|
||||
} cset;
|
||||
/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */
|
||||
#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (c))
|
||||
@@ -125,8 +125,8 @@ struct re_guts {
|
||||
int nbol; /* number of ^ used */
|
||||
int neol; /* number of $ used */
|
||||
int ncategories; /* how many character categories */
|
||||
cat_t *categories; /* ->catspace[-UCHAR_MIN] */
|
||||
unsigned char *must; /* match must contain this string */
|
||||
cat_t *categories; /* ->catspace[-CHAR_MIN] */
|
||||
char *must; /* match must contain this string */
|
||||
int mlen; /* length of must */
|
||||
size_t nsub; /* copy of re_nsub */
|
||||
int backrefs; /* does it use back references? */
|
||||
@@ -136,5 +136,5 @@ struct re_guts {
|
||||
};
|
||||
|
||||
/* misc utilities */
|
||||
#define OUT (UCHAR_MAX+1) /* a non-character value */
|
||||
#define OUT (CHAR_MAX+1) /* a non-character value */
|
||||
#define ISWORD(c) (isalnum(c) || (c) == '_')
|
||||
@@ -67,14 +67,14 @@ static int nope = 0; /* for use in asserts; shuts lint up */
|
||||
#undef SNAMES
|
||||
|
||||
/* macros for manipulating states, large version */
|
||||
#define states unsigned char *
|
||||
#define states char *
|
||||
#define CLEAR(v) memset(v, 0, m->g->nstates)
|
||||
#define SET0(v, n) ((v)[n] = 0)
|
||||
#define SET1(v, n) ((v)[n] = 1)
|
||||
#define ISSET(v, n) ((v)[n])
|
||||
#define ASSIGN(d, s) memcpy(d, s, m->g->nstates)
|
||||
#define EQ(a, b) (memcmp(a, b, m->g->nstates) == 0)
|
||||
#define STATEVARS int vn; unsigned char *space
|
||||
#define STATEVARS int vn; char *space
|
||||
#define STATESETUP(m, nv) { (m)->space = malloc((nv)*(m)->g->nstates); \
|
||||
if ((m)->space == NULL) return(REG_ESPACE); \
|
||||
(m)->vn = 0; }
|
||||
@@ -132,7 +132,7 @@ int eflags;
|
||||
eflags = GOODFLAGS(eflags);
|
||||
|
||||
if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags®_LARGE))
|
||||
return(smatcher(g, (unsigned char *)string, nmatch, pmatch, eflags));
|
||||
return(smatcher(g, (char *)string, nmatch, pmatch, eflags));
|
||||
else
|
||||
return(lmatcher(g, (unsigned char *)string, nmatch, pmatch, eflags));
|
||||
return(lmatcher(g, (char *)string, nmatch, pmatch, eflags));
|
||||
}
|
||||
+29
-30
@@ -134,7 +134,7 @@ ZEND_DECLARE_MODULE_GLOBALS(exif)
|
||||
/* {{{ PHP_INI
|
||||
*/
|
||||
|
||||
ZEND_INI_MH(OnUpdateEncode)
|
||||
ZEND_API ZEND_INI_MH(OnUpdateEncode)
|
||||
{
|
||||
#if EXIF_USE_MBSTRING
|
||||
if (new_value && strlen(new_value) && !php_mb_check_encoding_list(new_value TSRMLS_CC)) {
|
||||
@@ -145,7 +145,7 @@ ZEND_INI_MH(OnUpdateEncode)
|
||||
return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
|
||||
}
|
||||
|
||||
ZEND_INI_MH(OnUpdateDecode)
|
||||
ZEND_API ZEND_INI_MH(OnUpdateDecode)
|
||||
{
|
||||
#if EXIF_USE_MBSTRING
|
||||
if (!php_mb_check_encoding_list(new_value TSRMLS_CC)) {
|
||||
@@ -243,10 +243,10 @@ static const char * EXIF_ERROR_CORRUPT = "File structure corrupted";
|
||||
static const char * EXIF_ERROR_THUMBEOF = "Thumbnail goes IFD boundary or end of file reached";
|
||||
static const char * EXIF_ERROR_FSREALLOC = "Illegal reallocating of undefined file section";
|
||||
|
||||
#define EXIF_ERRLOG_FILEEOF php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", EXIF_ERROR_FILEEOF);
|
||||
#define EXIF_ERRLOG_CORRUPT php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", EXIF_ERROR_CORRUPT);
|
||||
#define EXIF_ERRLOG_THUMBEOF php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", EXIF_ERROR_THUMBEOF);
|
||||
#define EXIF_ERRLOG_FSREALLOC php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", EXIF_ERROR_FSREALLOC);
|
||||
#define EXIF_ERRLOG_FILEEOF php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_FILEEOF);
|
||||
#define EXIF_ERRLOG_CORRUPT php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_CORRUPT);
|
||||
#define EXIF_ERRLOG_THUMBEOF php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_THUMBEOF);
|
||||
#define EXIF_ERRLOG_FSREALLOC php_error_docref(NULL TSRMLS_CC, E_WARNING, EXIF_ERROR_FSREALLOC);
|
||||
/* }}} */
|
||||
|
||||
/* {{{ format description defines
|
||||
@@ -1301,7 +1301,7 @@ static char *exif_get_sectionname(int section)
|
||||
return "";
|
||||
}
|
||||
|
||||
static tag_table_type exif_get_tag_table(int section)
|
||||
static const tag_table_type exif_get_tag_table(int section)
|
||||
{
|
||||
switch(section) {
|
||||
case SECTION_FILE: return &tag_table_IFD[0];
|
||||
@@ -1525,7 +1525,7 @@ static int exif_file_sections_free(image_info_type *ImageInfo)
|
||||
/* {{{ exif_iif_add_value
|
||||
Add a value to image_info
|
||||
*/
|
||||
static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, int motorola_intel TSRMLS_DC)
|
||||
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 idex;
|
||||
void *vptr;
|
||||
@@ -1606,7 +1606,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
} else {
|
||||
info_value = &info_data->value;
|
||||
}
|
||||
for (idex=0,vptr=value; idex<(size_t)length; idex++,vptr=(char *) vptr + php_tiff_bytes_per_format[format]) {
|
||||
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[idex];
|
||||
}
|
||||
@@ -1662,7 +1662,7 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
|
||||
*/
|
||||
static void exif_iif_add_tag(image_info_type *image_info, int section_index, char *name, int tag, int format, size_t length, void* value TSRMLS_DC)
|
||||
{
|
||||
exif_iif_add_value(image_info, section_index, name, tag, format, (int)length, value, image_info->motorola_intel TSRMLS_CC);
|
||||
exif_iif_add_value(image_info, section_index, name, tag, format, length, value, image_info->motorola_intel TSRMLS_CC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1819,7 +1819,7 @@ static void exif_iif_free(image_info_type *image_info, int section_index) {
|
||||
static void add_assoc_image_info(pval *value, int sub_array, image_info_type *image_info, int section_index TSRMLS_DC)
|
||||
{
|
||||
char buffer[64], *val, *name, uname[64];
|
||||
int i, ap, l, b, idx=0, unknown=0;
|
||||
int i, ap, l, b, idx=0, done, unknown=0;
|
||||
#ifdef EXIF_DEBUG
|
||||
int info_tag;
|
||||
#endif
|
||||
@@ -1839,6 +1839,7 @@ static void add_assoc_image_info(pval *value, int sub_array, image_info_type *im
|
||||
}
|
||||
|
||||
for(i=0; i<image_info->info_list[section_index].count; i++) {
|
||||
done = 0;
|
||||
info_data = &image_info->info_list[section_index].list[i];
|
||||
#ifdef EXIF_DEBUG
|
||||
info_tag = info_data->tag; /* conversion */
|
||||
@@ -2217,7 +2218,7 @@ static char * exif_get_markername(int marker)
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string exif_tagname(index)
|
||||
/* {{{ proto string|false exif_tagname(index)
|
||||
Get headername for index or false if not defined */
|
||||
PHP_FUNCTION(exif_tagname)
|
||||
{
|
||||
@@ -2712,7 +2713,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
||||
// JPEG does not use absolute pointers instead its pointers are relative to the start
|
||||
// of the TIFF header in APP1 section.
|
||||
*/
|
||||
if (offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) {
|
||||
if (offset_val<0 || offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) {
|
||||
if (value_ptr < dir_entry) {
|
||||
/* we can read this if offset_val > 0 */
|
||||
/* some files have their values in other parts of the file */
|
||||
@@ -3112,7 +3113,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
|
||||
{
|
||||
int section, sn;
|
||||
int marker = 0, last_marker = M_PSEUDO, comment_correction=1;
|
||||
unsigned int ll, lh;
|
||||
int ll, lh;
|
||||
uchar *Data;
|
||||
size_t fpos, size, got, itemlen;
|
||||
jpeg_sof_info sof_info;
|
||||
@@ -3175,7 +3176,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
|
||||
Data[0] = (uchar)lh;
|
||||
Data[1] = (uchar)ll;
|
||||
|
||||
got = php_stream_read(ImageInfo->infile, (char*)(Data+2), itemlen-2); /* Read the whole section. */
|
||||
got = php_stream_read(ImageInfo->infile, Data+2, itemlen-2); /* Read the whole section. */
|
||||
if (got != itemlen-2) {
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_WARNING, "error reading from file: got=x%04X(=%d) != itemlen-2=x%04X(=%d)", got, got, itemlen-2, itemlen-2);
|
||||
return FALSE;
|
||||
@@ -3193,7 +3194,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
|
||||
size = ImageInfo->FileSize - fpos;
|
||||
sn = exif_file_sections_add(ImageInfo, M_PSEUDO, size, NULL);
|
||||
Data = ImageInfo->file.list[sn].data;
|
||||
got = php_stream_read(ImageInfo->infile, (char*)Data, size);
|
||||
got = php_stream_read(ImageInfo->infile, Data, size);
|
||||
if (got != size) {
|
||||
EXIF_ERRLOG_FILEEOF
|
||||
return FALSE;
|
||||
@@ -3264,7 +3265,7 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
|
||||
* scan JPEG in thumbnail (memory) */
|
||||
static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC)
|
||||
{
|
||||
uchar c, *data = (uchar*)ImageInfo->Thumbnail.data;
|
||||
uchar c, *data = ImageInfo->Thumbnail.data;
|
||||
int n, marker;
|
||||
size_t length=2, pos=0;
|
||||
jpeg_sof_info sof_info;
|
||||
@@ -3361,7 +3362,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "read from TIFF: filesize(x%04X), IFD dir(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, 2);
|
||||
#endif
|
||||
php_stream_seek(ImageInfo->infile, dir_offset, SEEK_SET); /* we do not know the order of sections */
|
||||
php_stream_read(ImageInfo->infile, (char*)ImageInfo->file.list[sn].data, 2);
|
||||
php_stream_read(ImageInfo->infile, ImageInfo->file.list[sn].data, 2);
|
||||
num_entries = php_ifd_get16u(ImageInfo->file.list[sn].data, ImageInfo->motorola_intel);
|
||||
dir_size = 2/*num dir entries*/ +12/*length of entry*/*num_entries +4/* offset to next ifd (points to thumbnail or NULL)*/;
|
||||
if (ImageInfo->FileSize >= dir_offset+dir_size) {
|
||||
@@ -3371,8 +3372,8 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
if (exif_file_sections_realloc(ImageInfo, sn, dir_size TSRMLS_CC)) {
|
||||
return FALSE;
|
||||
}
|
||||
php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+2), dir_size-2);
|
||||
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Dump: %s", exif_char_dump(ImageInfo->file.list[sn].data, dir_size, 0));*/
|
||||
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, 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);
|
||||
@@ -3460,7 +3461,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "read from TIFF: filesize(x%04X), IFD(x%04X + x%04X)", ImageInfo->FileSize, dir_offset, ifd_size);
|
||||
#endif
|
||||
php_stream_read(ImageInfo->infile, (char*)(ImageInfo->file.list[sn].data+dir_size), ifd_size-dir_size);
|
||||
php_stream_read(ImageInfo->infile, ImageInfo->file.list[sn].data+dir_size, ifd_size-dir_size);
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "read from TIFF, done");
|
||||
#endif
|
||||
@@ -3523,8 +3524,8 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
|
||||
exif_error_docref(NULL TSRMLS_CC, ImageInfo, E_NOTICE, "next IFD: %s done", exif_get_sectionname(sub_section_index));
|
||||
#endif
|
||||
} else {
|
||||
if (!exif_process_IFD_TAG(ImageInfo, (char*)dir_entry,
|
||||
(char*)(ImageInfo->file.list[sn].data-dir_offset),
|
||||
if (!exif_process_IFD_TAG(ImageInfo, dir_entry,
|
||||
ImageInfo->file.list[sn].data-dir_offset,
|
||||
ifd_size, 0, section_index, 0, tag_table TSRMLS_CC)) {
|
||||
return FALSE;
|
||||
}
|
||||
@@ -3581,7 +3582,7 @@ static int exif_scan_FILE_header(image_info_type *ImageInfo TSRMLS_DC)
|
||||
|
||||
if (ImageInfo->FileSize >= 2) {
|
||||
php_stream_seek(ImageInfo->infile, 0, SEEK_SET);
|
||||
php_stream_read(ImageInfo->infile, (char*)file_header, 2);
|
||||
php_stream_read(ImageInfo->infile, file_header, 2);
|
||||
if ((file_header[0]==0xff) && (file_header[1]==M_SOI)) {
|
||||
ImageInfo->FileType = IMAGE_FILETYPE_JPEG;
|
||||
if (exif_scan_JPEG_header(ImageInfo TSRMLS_CC)) {
|
||||
@@ -3721,7 +3722,7 @@ static int exif_read_file(image_info_type *ImageInfo, char *FileName, int read_t
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto array exif_read_data(string filename [, sections_needed [, sub_arrays[, read_thumbnail]]])
|
||||
/* {{{ proto array|false exif_read_data(string filename [, sections_needed [, sub_arrays[, read_thumbnail]]])
|
||||
Reads header data from the JPEG/TIFF image filename and optionally reads the internal thumbnails */
|
||||
PHP_FUNCTION(exif_read_data)
|
||||
{
|
||||
@@ -3790,17 +3791,15 @@ PHP_FUNCTION(exif_read_data)
|
||||
exif_error_docref(NULL TSRMLS_CC, &ImageInfo, E_NOTICE, "sections found: %s", sections_str[0] ? sections_str : "None");
|
||||
#endif
|
||||
|
||||
ImageInfo.sections_found |= FOUND_COMPUTED|FOUND_FILE;/* do not inform about in debug*/
|
||||
ImageInfo.sections_found |= FOUND_COMPUTED;/* do not inform about in debug*/
|
||||
|
||||
if (ret==FALSE || (sections_needed && !(sections_needed&ImageInfo.sections_found))) {
|
||||
if (ret==FALSE || (sections_needed && !(sections_needed&ImageInfo.sections_found)) || array_init(return_value) == FAILURE) {
|
||||
/* array_init must be checked at last! otherwise the array must be freed if a later test fails. */
|
||||
exif_discard_imageinfo(&ImageInfo);
|
||||
EFREE_IF(sections_str);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
|
||||
#ifdef EXIF_DEBUG
|
||||
exif_error_docref(NULL TSRMLS_CC, &ImageInfo, E_NOTICE, "generate section FILE");
|
||||
#endif
|
||||
@@ -3914,7 +3913,7 @@ PHP_FUNCTION(exif_read_data)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto string exif_thumbnail(string filename [, &width, &height [, &imagetype]])
|
||||
/* {{{ proto string|false exif_thumbnail(string filename [, &width, &height [, &imagetype]])
|
||||
Reads the embedded thumbnail */
|
||||
PHP_FUNCTION(exif_thumbnail)
|
||||
{
|
||||
|
||||
+2
-2
@@ -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 "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /D "LIBZEND_EXPORTS" /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"
|
||||
@@ -71,7 +71,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /D "LIBZEND_EXPORTS" /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"
|
||||
|
||||
+1
-1
@@ -150,7 +150,7 @@ if test "\$PHP_$EXTNAME" != "no"; then
|
||||
dnl # --with-$extname -> add include path
|
||||
dnl PHP_ADD_INCLUDE(\$${EXTNAME}_DIR/include)
|
||||
|
||||
dnl # --with-$extname -> check for lib and symbol presence
|
||||
dnl # --with-$extname -> chech for lib and symbol presence
|
||||
dnl LIBNAME=$extname # you may want to change this
|
||||
dnl LIBSYMBOL=$extname # you most likely want to change this
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ if (php_sapi_name() != "cli") {
|
||||
1) Make sure you have CygWin installed
|
||||
2) Adjust the $cygwin_path to match your installation
|
||||
3) Change the environment cariable PATHEXT to include .PHP
|
||||
4) run ext_skel --extname=...
|
||||
4) run ext_skel --ext_name=...
|
||||
the first time you run this script you will be asked to
|
||||
associate it with a program. chooses the CLI version of php.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ if test "$PHP_FBSQL" != "no"; then
|
||||
FBSQL_INSTALLATION_DIR=""
|
||||
if test "$PHP_FBSQL" = "yes"; then
|
||||
|
||||
for i in /Local/Library /usr/local /usr /opt /Library /usr/lib; do
|
||||
for i in /Local/Library /usr /usr/local /opt /Library /usr/lib; do
|
||||
if test -f $i/FrontBase/include/FBCAccess/FBCAccess.h; then
|
||||
FBSQL_INSTALLATION_DIR=$i/FrontBase
|
||||
break
|
||||
|
||||
+2
-2
@@ -107,7 +107,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib php4ts_debug.lib FBCAccess.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Debug_TS/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"\usr\FrontBase\lib"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php4ts_debug.lib FBCAccess.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Debug_TS/php_fbsql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"\usr\FrontBase\lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "fbsql - Win32 Release_TS"
|
||||
|
||||
@@ -133,7 +133,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib FBCAccess.lib ws2_32.lib /nologo /dll /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Release_TS/php_fbsql.dll" /libpath:"..\..\Release_TS" /libpath:"\usr\FrontBase\lib" /libpath:"..\..\Release_TS_inline"
|
||||
# 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 FBCAccess.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"LIBC" /out:"..\..\Release_TS/php_fbsql.dll" /libpath:"..\..\Release_TS" /libpath:"\usr\FrontBase\lib" /libpath:"..\..\Release_TS_inline"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
+83
-80
@@ -83,28 +83,30 @@ typedef struct PHPFBLink PHPFBLink;
|
||||
required buffereing from of results.
|
||||
|
||||
In the PHP code the 3 above a data structures are referenced by means of integers in the
|
||||
range from 1 to som configurable maximum. You can put a limit to the number of links, databases
|
||||
and results. The integer identifications is implemented by insertion in the list, which is passed
|
||||
range from 1 to som configurable maximum. You can put a limit to the number of links, databases
|
||||
and results. The integer identifications is implemented by insertion in the list, which is passed
|
||||
as an argument to all the functions, please note the list is polymorph.
|
||||
|
||||
Database objects and link objects are all reused, base on the host name user name, host name database name
|
||||
user name. So connecting twice to the same database as the same user will return the same database id.
|
||||
user name. So connecting twice to the same database as the same user will return the same database id.
|
||||
We use the same coding for that as fbsql does, explioiting the underlying implementation of the lists.
|
||||
|
||||
Persistent objects are put in the persistent list as well, but only by name, if you connect to a persistent object
|
||||
and it is not in the list it is simply added and get a new index, and refcounted. Tricky, tricky ...
|
||||
and it is not in the list it is simply added and get a new index, and refcounted. Tricky, tricky ...
|
||||
*/
|
||||
|
||||
/* Some functions which should be exported from FBCAccess */
|
||||
|
||||
void* fbaObjectAtIndex();
|
||||
void fbaRelease();
|
||||
unsigned int fbaCount();
|
||||
void* fbaObjectAtIndex();
|
||||
void fbaRelease();
|
||||
unsigned int fbaCount();
|
||||
|
||||
struct FBCAutoStartInfo {
|
||||
FBArray* infoLines;
|
||||
FBArray* infoLines;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct PHPFBResult
|
||||
{
|
||||
PHPFBLink* link; /* The link for the result, may be NULL if no link */
|
||||
@@ -113,7 +115,7 @@ struct PHPFBResult
|
||||
FBCMetaData* ResultmetaData; /* The metadata describing the result */
|
||||
FBCRowHandler* rowHandler; /* The row handler, the Frontbase structure used for accessing rows in the result */
|
||||
unsigned int batchSize; /* The number of row to fetch when expanding the number of rows in the row handler */
|
||||
unsigned int rowCount; /* The number of rows in the results set. The number of row is not in */
|
||||
unsigned int rowCount; /* The number of rows in the results set. The number of row is not in */
|
||||
/* general known when the select is done, one typically needs to fetch all the row
|
||||
to figure out how many row you got. When the rowCount is unknown the value is
|
||||
0x7ffffffff */
|
||||
@@ -278,10 +280,10 @@ static void phpfbReleaseResult(zend_rsrc_list_entry *rsrc TSRMLS_DC)
|
||||
FBCMetaData *md = fbcdcCancelFetch(result->link->connection, result->fetchHandle);
|
||||
fbcmdRelease(md);
|
||||
}
|
||||
if (result->rowHandler) fbcrhRelease(result->rowHandler);
|
||||
if (result->ResultmetaData) fbcmdRelease(result->ResultmetaData);
|
||||
if (result->list) fbcplRelease(result->list);
|
||||
if (result->array) fbaRelease(result->array);
|
||||
if (result->rowHandler) fbcrhRelease(result->rowHandler);
|
||||
if (result->ResultmetaData) fbcmdRelease(result->ResultmetaData);
|
||||
if (result->list) fbcplRelease(result->list);
|
||||
if (result->array) fbaRelease(result->array);
|
||||
efree(result);
|
||||
}
|
||||
}
|
||||
@@ -356,9 +358,9 @@ static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link)
|
||||
/* {{{ PHP_INI
|
||||
*/
|
||||
PHP_INI_BEGIN()
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allowPersistent, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.generate_warnings", "0", PHP_INI_SYSTEM, OnUpdateBool, generateWarnings, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.autocommit", "1", PHP_INI_SYSTEM, OnUpdateBool, autoCommit, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateInt, allowPersistent, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.generate_warnings", "0", PHP_INI_SYSTEM, OnUpdateInt, generateWarnings, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_BOOLEAN ("fbsql.autocommit", "1", PHP_INI_SYSTEM, OnUpdateInt, autoCommit, zend_fbsql_globals, fbsql_globals)
|
||||
STD_PHP_INI_ENTRY_EX ("fbsql.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateInt, maxPersistent, zend_fbsql_globals, fbsql_globals, display_link_numbers)
|
||||
STD_PHP_INI_ENTRY_EX ("fbsql.max_links", "128", PHP_INI_SYSTEM, OnUpdateInt, maxLinks, zend_fbsql_globals, fbsql_globals, display_link_numbers)
|
||||
STD_PHP_INI_ENTRY_EX ("fbsql.max_connections", "128", PHP_INI_SYSTEM, OnUpdateInt, maxConnections, zend_fbsql_globals, fbsql_globals, display_link_numbers)
|
||||
@@ -387,7 +389,7 @@ static void php_fbsql_init_globals(zend_fbsql_globals *fbsql_globals)
|
||||
fbsql_globals->persistentCount = 0;
|
||||
fbsql_globals->linkCount = 0;
|
||||
}
|
||||
|
||||
|
||||
PHP_MINIT_FUNCTION(fbsql)
|
||||
{
|
||||
ZEND_INIT_MODULE_GLOBALS(fbsql, php_fbsql_init_globals, NULL);
|
||||
@@ -395,7 +397,7 @@ PHP_MINIT_FUNCTION(fbsql)
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
fbcInitialize();
|
||||
fbcehSetMultiThreaded(True);
|
||||
|
||||
le_result = zend_register_list_destructors_ex(phpfbReleaseResult, NULL, "fbsql result", module_number);
|
||||
le_link = zend_register_list_destructors_ex(phpfbReleaseLink, NULL, "fbsql link", module_number);
|
||||
le_plink = zend_register_list_destructors_ex(NULL, phpfbReleasePLink, "fbsql plink", module_number);
|
||||
@@ -495,12 +497,12 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
if (argc >= 2)
|
||||
{
|
||||
convert_to_string_ex(argv[1]);
|
||||
userName = Z_STRVAL_PP(argv[1]);
|
||||
}
|
||||
userName = Z_STRVAL_PP(argv[1]);
|
||||
}
|
||||
if (argc == 3)
|
||||
{
|
||||
convert_to_string_ex(argv[2]);
|
||||
userPassword = Z_STRVAL_PP(argv[2]);
|
||||
userPassword = Z_STRVAL_PP(argv[2]);
|
||||
}
|
||||
|
||||
if (hostName == NULL) hostName = FB_SQL_G(hostName);
|
||||
@@ -541,7 +543,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
phpLink->userPassword = strdup(userPassword);
|
||||
phpLink->databasePassword = strdup(FB_SQL_G(databasePassword));
|
||||
phpLink->databaseName = NULL;
|
||||
phpLink->execHandler = NULL;
|
||||
phpLink->execHandler = fbcehHandlerForHost(hostName, 128);
|
||||
phpLink->affectedRows = 0;
|
||||
phpLink->autoCommit = FB_SQL_G(autoCommit);
|
||||
phpLink->errorNo = 0;
|
||||
@@ -602,7 +604,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
phpLink->userPassword = strdup(userPassword);
|
||||
phpLink->databasePassword = strdup(FB_SQL_G(databasePassword));
|
||||
phpLink->databaseName = NULL;
|
||||
phpLink->execHandler = NULL;
|
||||
phpLink->execHandler = fbcehHandlerForHost(hostName, 128);
|
||||
phpLink->affectedRows = 0;
|
||||
phpLink->autoCommit = FB_SQL_G(autoCommit);
|
||||
phpLink->errorNo = 0;
|
||||
@@ -611,7 +613,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
|
||||
ZEND_REGISTER_RESOURCE(return_value, phpLink, le_link);
|
||||
|
||||
le.ptr = (void *)Z_LVAL_P(return_value);
|
||||
le.ptr = (void *)Z_LVAL_P(return_value);
|
||||
Z_TYPE(le) = le_index_ptr;
|
||||
if (zend_hash_update(&EG(regular_list), name, strlen(name) + 1, &le, sizeof(le), NULL)==FAILURE)
|
||||
{
|
||||
@@ -749,7 +751,7 @@ static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message");
|
||||
}
|
||||
link->errorText = strdup(emg);
|
||||
link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);;
|
||||
link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);;
|
||||
free(emg);
|
||||
fbcemdRelease(emd);
|
||||
fbcmdRelease(md);
|
||||
@@ -784,7 +786,7 @@ static int php_fbsql_select_db(char *databaseName, PHPFBLink *link TSRMLS_DC)
|
||||
|
||||
void phpfbestrdup(const char * s, int* length, char** value)
|
||||
{
|
||||
int l = s?strlen(s):0;
|
||||
int l = s?strlen(s):0;
|
||||
if (value)
|
||||
{
|
||||
char* r = emalloc(l+1);
|
||||
@@ -792,7 +794,7 @@ void phpfbestrdup(const char * s, int* length, char** value)
|
||||
strcpy(r, s);
|
||||
else
|
||||
r[0] = 0;
|
||||
*value = r;
|
||||
*value = r;
|
||||
}
|
||||
*length = l;
|
||||
}
|
||||
@@ -1288,7 +1290,7 @@ PHP_FUNCTION(fbsql_username)
|
||||
/* {{{ proto string fbsql_password(resource link_identifier [, string password])
|
||||
Get or set the user password used with a connection */
|
||||
PHP_FUNCTION(fbsql_password)
|
||||
{
|
||||
{
|
||||
PHPFBLink* phpLink = NULL;
|
||||
zval **fbsql_link_index = NULL, **password = NULL;
|
||||
|
||||
@@ -1357,6 +1359,17 @@ PHP_FUNCTION(fbsql_select_db)
|
||||
}
|
||||
ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink);
|
||||
|
||||
if (phpLink->execHandler == NULL)
|
||||
{
|
||||
int port = atoi(name);
|
||||
if (port == 0 || port > 64535) {
|
||||
if (FB_SQL_G(generateWarnings)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot connect to FBExec for database '%s'. (%s)", name, fbcehClassErrorMessage());
|
||||
}
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!php_fbsql_select_db(name, phpLink TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -1456,7 +1469,6 @@ PHP_FUNCTION(fbsql_create_db)
|
||||
convert_to_string_ex(database_name);
|
||||
databaseName = Z_STRVAL_PP(database_name);
|
||||
|
||||
if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128);
|
||||
status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName);
|
||||
if (status != FBUnknownStatus)
|
||||
{
|
||||
@@ -1530,7 +1542,6 @@ PHP_FUNCTION(fbsql_drop_db)
|
||||
convert_to_string_ex(database_name);
|
||||
databaseName = Z_STRVAL_PP(database_name);
|
||||
|
||||
if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128);
|
||||
status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName);
|
||||
if (status != FBStopped)
|
||||
{
|
||||
@@ -1605,7 +1616,6 @@ PHP_FUNCTION(fbsql_start_db)
|
||||
convert_to_string_ex(database_name);
|
||||
databaseName = Z_STRVAL_PP(database_name);
|
||||
|
||||
if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128);
|
||||
status = fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName);
|
||||
if ((status != FBStopped) && (status != FBRunning) && (status != FBStarting))
|
||||
{
|
||||
@@ -1742,7 +1752,6 @@ PHP_FUNCTION(fbsql_db_status)
|
||||
convert_to_string_ex(database_name);
|
||||
databaseName = Z_STRVAL_PP(database_name);
|
||||
|
||||
if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128);
|
||||
if (phpLink->execHandler) {
|
||||
RETURN_LONG(fbcehStatusForDatabaseNamed(phpLink->execHandler, databaseName));
|
||||
}
|
||||
@@ -1786,7 +1795,7 @@ int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No message");
|
||||
}
|
||||
link->errorText = strdup(emg);
|
||||
link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);;
|
||||
link->errorNo = fbcemdErrorCodeAtIndex(emd, 0);;
|
||||
free(emg);
|
||||
fbcemdRelease(emd);
|
||||
result = 0;
|
||||
@@ -1797,7 +1806,7 @@ int mdOk(PHPFBLink* link, FBCMetaData* md, char* sql)
|
||||
|
||||
static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link)
|
||||
{
|
||||
PHPFBResult* result = NULL;
|
||||
PHPFBResult* result = NULL;
|
||||
FBCMetaData* md, *meta;
|
||||
char* tp;
|
||||
char* fh;
|
||||
@@ -1818,7 +1827,7 @@ static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link)
|
||||
else
|
||||
md = meta;
|
||||
|
||||
tp = fbcmdStatementType(md);
|
||||
tp = fbcmdStatementType(md);
|
||||
|
||||
if ((tp[0] == 'C') || (tp[0] == 'R'))
|
||||
{
|
||||
@@ -1857,7 +1866,7 @@ static void phpfbQuery(INTERNAL_FUNCTION_PARAMETERS, char* sql, PHPFBLink* link)
|
||||
fbcrhConvertToOutputCharSet(fbcdcOutputCharacterSet(link->connection), (unsigned char *)r);
|
||||
if ((result->list = fbcplParse(r)))
|
||||
{
|
||||
result->rowCount = fbcplCount(result->list);
|
||||
result->rowCount = fbcplCount(result->list);
|
||||
result->columnCount = 7;
|
||||
}
|
||||
}
|
||||
@@ -1955,7 +1964,7 @@ PHP_FUNCTION(fbsql_db_query)
|
||||
Retreive a list of all databases on the server */
|
||||
PHP_FUNCTION(fbsql_list_dbs)
|
||||
{
|
||||
PHPFBResult* phpResult;
|
||||
PHPFBResult* phpResult;
|
||||
PHPFBLink* phpLink = NULL;
|
||||
zval **fbsql_link_index = NULL;
|
||||
int id;
|
||||
@@ -1977,7 +1986,6 @@ PHP_FUNCTION(fbsql_list_dbs)
|
||||
}
|
||||
ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink);
|
||||
|
||||
if (phpLink->execHandler == NULL) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128);
|
||||
phpResult = emalloc(sizeof(PHPFBResult));
|
||||
phpResult->link = phpLink;
|
||||
phpResult->fetchHandle = NULL;
|
||||
@@ -2045,10 +2053,10 @@ PHP_FUNCTION(fbsql_list_tables)
|
||||
PHP_FUNCTION(fbsql_list_fields)
|
||||
{
|
||||
PHPFBLink* phpLink = NULL;
|
||||
zval **fbsql_link_index = NULL, **database_name, **table_name;
|
||||
zval **fbsql_link_index = NULL, **database_name, **table_name;
|
||||
int id;
|
||||
char *databaseName, *tableName;
|
||||
char sql[1024];
|
||||
char sql[1024];
|
||||
|
||||
switch (ZEND_NUM_ARGS()) {
|
||||
case 2:
|
||||
@@ -2152,8 +2160,8 @@ PHP_FUNCTION(fbsql_errno)
|
||||
Enable or disable FrontBase warnings */
|
||||
PHP_FUNCTION(fbsql_warnings)
|
||||
{
|
||||
int argc = ARG_COUNT(ht);
|
||||
zval **argv[1];
|
||||
int argc = ARG_COUNT(ht);
|
||||
zval **argv[1];
|
||||
|
||||
if ((argc < 0) || (argc > 1)) WRONG_PARAM_COUNT;
|
||||
if (zend_get_parameters_ex(argc, &argv[0])==FAILURE) RETURN_FALSE;
|
||||
@@ -2257,12 +2265,12 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
phpfbestrdup("True", length, value);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case FB_PrimaryKey:
|
||||
case FB_Integer:
|
||||
{
|
||||
int v = *((int*)data);
|
||||
char b[128];
|
||||
int v = *((int*)data);
|
||||
char b[128];
|
||||
sprintf(b, "%d", v);
|
||||
phpfbestrdup(b, length, value);
|
||||
}
|
||||
@@ -2270,8 +2278,8 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
#ifdef FB_TinyInteger
|
||||
case FB_TinyInteger:
|
||||
{
|
||||
short int v = *((FBTinyInteger*)data);
|
||||
char b[128];
|
||||
short int v = *((short int*)data);
|
||||
char b[128];
|
||||
sprintf(b, "%d", v);
|
||||
phpfbestrdup(b, length, value);
|
||||
}
|
||||
@@ -2281,7 +2289,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
case FB_LongInteger:
|
||||
{
|
||||
FBLongInteger v = *((FBLongInteger*)data);
|
||||
char b[128];
|
||||
char b[128];
|
||||
#ifdef PHP_WIN32
|
||||
sprintf(b, "%I64i", v);
|
||||
#else
|
||||
@@ -2294,7 +2302,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
case FB_SmallInteger:
|
||||
{
|
||||
short v = *((short*)data);
|
||||
char b[128];
|
||||
char b[128];
|
||||
sprintf(b, "%d", v);
|
||||
phpfbestrdup(b, length, value);
|
||||
}
|
||||
@@ -2307,7 +2315,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
case FB_Decimal:
|
||||
{
|
||||
double v = *((double*)data);
|
||||
char b[128];
|
||||
char b[128];
|
||||
sprintf(b, "%f", v);
|
||||
phpfbestrdup(b, length, value);
|
||||
}
|
||||
@@ -2324,13 +2332,13 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
case FB_Bit:
|
||||
case FB_VBit:
|
||||
{
|
||||
const FBCColumnMetaData* clmd = fbcmdColumnMetaDataAtIndex(md, column);
|
||||
const FBCColumnMetaData* clmd = fbcmdColumnMetaDataAtIndex(md, column);
|
||||
struct bitValue
|
||||
{
|
||||
unsigned int nBytes;
|
||||
unsigned int nBytes;
|
||||
unsigned char* bytes;
|
||||
};
|
||||
struct bitValue* ptr = data;
|
||||
struct bitValue* ptr = data;
|
||||
unsigned nBits = ptr->nBytes * 8;
|
||||
|
||||
if (dtc == FB_Bit) nBits = fbcdmdLength(fbccmdDatatype(clmd));
|
||||
@@ -2341,7 +2349,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
*length = l*2+3+1;
|
||||
if (value)
|
||||
{
|
||||
char* r = emalloc(l*2+3+1);
|
||||
char* r = emalloc(l*2+3+1);
|
||||
r[0] = 'X';
|
||||
r[1] = '\'';
|
||||
for (i = 0; i < nBits / 8; i++)
|
||||
@@ -2353,7 +2361,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
}
|
||||
r[i*2+2] = '\'';
|
||||
r[i*2+3] = 0;
|
||||
*value = r;
|
||||
*value = r;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2363,7 +2371,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
*length = l*2+3+1;
|
||||
if (value)
|
||||
{
|
||||
char* r = emalloc(l*2+3+1);
|
||||
char* r = emalloc(l*2+3+1);
|
||||
r[0] = 'B';
|
||||
r[1] = '\'';
|
||||
for (i = 0; i < nBits; i++)
|
||||
@@ -2374,7 +2382,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
}
|
||||
r[i*2+2] = '\'';
|
||||
r[i*2+3] = 0;
|
||||
*value = r;
|
||||
*value = r;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2394,7 +2402,7 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
case FB_YearMonth:
|
||||
{
|
||||
char b[128];
|
||||
int v = *((unsigned int*)data);
|
||||
int v = *((unsigned int*)data);
|
||||
sprintf(b, "%d", v);
|
||||
phpfbestrdup(b, length, value);
|
||||
}
|
||||
@@ -2447,14 +2455,14 @@ void phpfbColumnAsString(PHPFBResult* result, int column, void* data , int* leng
|
||||
|
||||
/* {{{ phpfbSqlResult
|
||||
*/
|
||||
void phpfbSqlResult(INTERNAL_FUNCTION_PARAMETERS, PHPFBResult* result, int rowIndex, int columnIndex)
|
||||
void phpfbSqlResult(INTERNAL_FUNCTION_PARAMETERS, PHPFBResult* result, int rowIndex, int columnIndex)
|
||||
{
|
||||
void** row;
|
||||
if (result->list)
|
||||
{
|
||||
FBCPList* columns = (FBCPList*)fbcplValueForKey(result->list, "COLUMNS");
|
||||
FBCPList* column = (FBCPList*)fbcplValueAtIndex(columns, result->rowIndex);
|
||||
if (columnIndex == 0)
|
||||
if (columnIndex == 0)
|
||||
{ /* Name */
|
||||
FBCPList* name = (FBCPList*)fbcplValueForKey(column, "NAME");
|
||||
RETURN_STRING((char *)fbcplString((FBCPList*)name), 1);
|
||||
@@ -2513,7 +2521,7 @@ void phpfbSqlResult(INTERNAL_FUNCTION_PARAMETERS, PHPFBResult* result, int rowIn
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto mixed fbsql_result(int result [, int row [, mixed field]])
|
||||
??? */
|
||||
PHP_FUNCTION(fbsql_result)
|
||||
@@ -2552,7 +2560,7 @@ PHP_FUNCTION(fbsql_result)
|
||||
rowIndex = Z_LVAL_PP(row);
|
||||
}
|
||||
|
||||
columnIndex = result->columnIndex;
|
||||
columnIndex = result->columnIndex;
|
||||
if (field)
|
||||
{
|
||||
if ((Z_TYPE_PP(field) == IS_STRING) && (result->metaData))
|
||||
@@ -2576,8 +2584,8 @@ PHP_FUNCTION(fbsql_result)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
phpfbSqlResult(INTERNAL_FUNCTION_PARAM_PASSTHRU, result, rowIndex, columnIndex);
|
||||
|
||||
result->columnIndex++;
|
||||
@@ -2608,9 +2616,9 @@ PHP_FUNCTION(fbsql_next_result)
|
||||
}
|
||||
ZEND_FETCH_RESOURCE(result, PHPFBResult *, fbsql_result_index, -1, "FrontBase-Result", le_result);
|
||||
|
||||
result->currentResult++;
|
||||
result->currentResult++;
|
||||
if (result->currentResult < result->selectResults) {
|
||||
if (result->fetchHandle) {
|
||||
if (result->fetchHandle) {
|
||||
FBCMetaData *md = fbcdcCancelFetch(result->link->connection, result->fetchHandle);
|
||||
fbcmdRelease(md);
|
||||
}
|
||||
@@ -2698,7 +2706,7 @@ PHP_FUNCTION(fbsql_num_fields)
|
||||
Fetch a row of data. Returns an indexed array */
|
||||
PHP_FUNCTION(fbsql_fetch_row)
|
||||
{
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_NUM, 1);
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_NUM);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2706,7 +2714,7 @@ PHP_FUNCTION(fbsql_fetch_row)
|
||||
Detch a row of data. Returns an assoc array */
|
||||
PHP_FUNCTION(fbsql_fetch_assoc)
|
||||
{
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 1);
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2714,7 +2722,7 @@ PHP_FUNCTION(fbsql_fetch_assoc)
|
||||
Fetch a row of data. Returns an object */
|
||||
PHP_FUNCTION(fbsql_fetch_object)
|
||||
{
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC, 2);
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_ASSOC);
|
||||
if (Z_TYPE_P(return_value)==IS_ARRAY) {
|
||||
object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value));
|
||||
}
|
||||
@@ -2725,7 +2733,7 @@ PHP_FUNCTION(fbsql_fetch_object)
|
||||
Fetches a result row as an array (associative, numeric or both)*/
|
||||
PHP_FUNCTION(fbsql_fetch_array)
|
||||
{
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_BOTH, 2);
|
||||
php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, FBSQL_BOTH);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -2773,7 +2781,7 @@ static void _parse_list(zval** return_value, FBCPList* list)
|
||||
}
|
||||
}
|
||||
|
||||
static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args)
|
||||
static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
|
||||
{
|
||||
|
||||
PHPFBResult* result = NULL;
|
||||
@@ -2782,10 +2790,6 @@ static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
|
||||
int i;
|
||||
void **row;
|
||||
|
||||
if (ZEND_NUM_ARGS() > expected_args) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
switch (ZEND_NUM_ARGS()) {
|
||||
case 1:
|
||||
if (zend_get_parameters_ex(1, &fbsql_result_index)==FAILURE) {
|
||||
@@ -2919,7 +2923,7 @@ static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
|
||||
{
|
||||
if (row[i])
|
||||
{
|
||||
char* value;
|
||||
char* value;
|
||||
unsigned int length;
|
||||
unsigned int c = 0;
|
||||
phpfbColumnAsString(result, i, row[i], &length, &value TSRMLS_CC);
|
||||
@@ -3015,7 +3019,7 @@ PHP_FUNCTION(fbsql_fetch_lengths)
|
||||
if (array_init(return_value)==FAILURE) RETURN_FALSE;
|
||||
for (i=0; i < result->columnCount; i++)
|
||||
{
|
||||
unsigned length = 0;
|
||||
unsigned length = 0;
|
||||
if (result->row[i]) phpfbColumnAsString(result, i, result->row[i], &length, NULL TSRMLS_CC);
|
||||
add_index_long(return_value, i, length);
|
||||
}
|
||||
@@ -3406,9 +3410,9 @@ PHP_FUNCTION(fbsql_field_flags)
|
||||
PHP_FUNCTION(fbsql_table_name)
|
||||
{
|
||||
PHPFBResult* result = NULL;
|
||||
zval **fbsql_result_index = NULL, **table_index;
|
||||
zval **fbsql_result_index = NULL, **table_index;
|
||||
unsigned index;
|
||||
char* value;
|
||||
char* value;
|
||||
unsigned int length;
|
||||
void** row;
|
||||
|
||||
@@ -3494,7 +3498,6 @@ 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) phpLink->execHandler = fbcehHandlerForHost(phpLink->hostName, 128);
|
||||
if (phpLink->execHandler == NULL) {
|
||||
if (FB_SQL_G(generateWarnings))
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No valid Exec handler available for this connection");
|
||||
|
||||
@@ -101,7 +101,7 @@ PHP_FUNCTION(fbsql_warnings);
|
||||
PHP_FUNCTION(fbsql_get_autostart_info);
|
||||
/* PHP_FUNCTION(fbsql_set_autostart_info); */
|
||||
|
||||
static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, int expected_args);
|
||||
static void php_fbsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type);
|
||||
static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent);
|
||||
|
||||
ZEND_BEGIN_MODULE_GLOBALS(fbsql)
|
||||
|
||||
+7
-7
@@ -8,22 +8,22 @@ PHP_ARG_WITH(fdftk, for FDF support,
|
||||
if test "$PHP_FDFTK" != "no"; then
|
||||
|
||||
case $host_os in
|
||||
aix*[)]
|
||||
aix*)
|
||||
libtype=aix
|
||||
;;
|
||||
solaris*[)]
|
||||
solaris* )
|
||||
libtype=solaris
|
||||
;;
|
||||
linux*[)]
|
||||
linux*)
|
||||
libtype=linux
|
||||
;;
|
||||
*[)]
|
||||
*)
|
||||
AC_MSG_ERROR([The fdf toolkit is not available for $host_os.])
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$PHP_FDFTK" = "yes"; then
|
||||
PHP_FDFTK="/usr/local /usr ../FDFToolkitForUNIX ext/fdf/FDFToolkitForUNIX ../fdftk ext/fdf/fdftk"
|
||||
PHP_FDFTK="/usr /usr/local ../FDFToolkitForUNIX ext/fdf/FDFToolkitForUNIX ../fdftk ext/fdf/fdftk"
|
||||
fi
|
||||
|
||||
for dir in $PHP_FDFTK; do
|
||||
@@ -65,9 +65,9 @@ if test "$PHP_FDFTK" != "no"; then
|
||||
AC_MSG_ERROR(no usable fdf library found)
|
||||
fi
|
||||
|
||||
PHP_ADD_LIBRARY_WITH_PATH($FDFLIBRARY, $FDFTK_LIB_DIR, FDF_SHARED_LIBADD)
|
||||
PHP_ADD_LIBRARY_WITH_PATH($FDFLIBRARY, $FDFTK_LIB_DIR, FDFTK_SHARED_LIBADD)
|
||||
|
||||
PHP_NEW_EXTENSION(fdf, fdf.c, $ext_shared)
|
||||
PHP_SUBST(FDF_SHARED_LIBADD)
|
||||
PHP_SUBST(FDFTK_SHARED_LIBADD)
|
||||
AC_DEFINE(HAVE_FDFLIB,1,[ ])
|
||||
fi
|
||||
+2
-5
@@ -39,10 +39,6 @@
|
||||
#include "php_variables.h"
|
||||
#include "php_fdf.h"
|
||||
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR)
|
||||
#endif
|
||||
|
||||
static int le_fdf;
|
||||
|
||||
SAPI_POST_HANDLER_FUNC(fdf_post_handler);
|
||||
@@ -382,12 +378,13 @@ PHP_FUNCTION(fdf_get_value)
|
||||
}
|
||||
which++;
|
||||
} while (err == FDFErcOK);
|
||||
if(err == FDFErcNoValue) err = FDFErcOK;
|
||||
efree(buffer);
|
||||
buffer = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((err != FDFErcOK) && (err != FDFErcNoValue)) {
|
||||
if(err != FDFErcOK) {
|
||||
if(buffer) efree(buffer);
|
||||
FDF_FAILURE(err);
|
||||
}
|
||||
|
||||
+2
-2
@@ -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 "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /D "HAVE_FDFTK_5" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
@@ -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 "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /D "HAVE_FDFTK_5" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_FDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_FDFLIB=1 /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x406 /d "NDEBUG"
|
||||
|
||||
@@ -2,6 +2,8 @@ dnl
|
||||
dnl $Id$
|
||||
dnl
|
||||
|
||||
AC_ARG_WITH(filepro,[],[enable_filepro=$withval])
|
||||
|
||||
PHP_ARG_ENABLE(filepro,whether to enable the bundled filePro support,
|
||||
[ --enable-filepro Enable the bundled read-only filePro support.])
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ PHP_FUNCTION(filepro_fieldname)
|
||||
}
|
||||
|
||||
php_error(E_WARNING,
|
||||
"%s(): Unable to locate field number %ld.", get_active_function_name(TSRMLS_C),
|
||||
"%s(): Unable to locate field number %d.", get_active_function_name(TSRMLS_C),
|
||||
Z_LVAL_P(fno));
|
||||
|
||||
RETVAL_FALSE;
|
||||
@@ -426,7 +426,7 @@ PHP_FUNCTION(filepro_fieldtype)
|
||||
}
|
||||
}
|
||||
php_error(E_WARNING,
|
||||
"%s(): Unable to locate field number %ld.", get_active_function_name(TSRMLS_C),
|
||||
"%s(): Unable to locate field number %d.", get_active_function_name(TSRMLS_C),
|
||||
Z_LVAL_P(fno));
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
@@ -465,7 +465,7 @@ PHP_FUNCTION(filepro_fieldwidth)
|
||||
}
|
||||
}
|
||||
php_error(E_WARNING,
|
||||
"%s(): Unable to locate field number %ld.", get_active_function_name(TSRMLS_C),
|
||||
"%s(): Unable to locate field number %d.", get_active_function_name(TSRMLS_C),
|
||||
Z_LVAL_P(fno));
|
||||
RETVAL_FALSE;
|
||||
}
|
||||
|
||||
+55
-77
@@ -19,10 +19,6 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
|
||||
#if HAVE_FTP
|
||||
@@ -108,7 +104,7 @@ static char** ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRM
|
||||
|
||||
/* IP and port conversion box */
|
||||
union ipbox {
|
||||
struct in_addr ia[2];
|
||||
unsigned long l[2];
|
||||
unsigned short s[4];
|
||||
unsigned char c[8];
|
||||
};
|
||||
@@ -169,7 +165,7 @@ ftp_close(ftpbuf_t *ftp)
|
||||
if (ftp->data)
|
||||
data_close(ftp, ftp->data);
|
||||
if (ftp->fd != -1) {
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
if (ftp->ssl_active) {
|
||||
SSL_shutdown(ftp->ssl_handle);
|
||||
}
|
||||
@@ -228,13 +224,13 @@ ftp_quit(ftpbuf_t *ftp)
|
||||
int
|
||||
ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC)
|
||||
{
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
SSL_CTX *ctx = NULL;
|
||||
#endif
|
||||
if (ftp == NULL)
|
||||
return 0;
|
||||
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
if (ftp->use_ssl && !ftp->ssl_active) {
|
||||
if (!ftp_putcmd(ftp, "AUTH", "TLS"))
|
||||
return 0;
|
||||
@@ -362,9 +358,6 @@ ftp_syst(ftpbuf_t *ftp)
|
||||
return NULL;
|
||||
|
||||
syst = ftp->inbuf;
|
||||
while (*syst == ' ') {
|
||||
syst++;
|
||||
}
|
||||
if ((end = strchr(syst, ' ')))
|
||||
*end = 0;
|
||||
ftp->syst = estrdup(syst);
|
||||
@@ -428,10 +421,9 @@ ftp_chdir(ftpbuf_t *ftp, const char *dir)
|
||||
{
|
||||
if (ftp == NULL)
|
||||
return 0;
|
||||
if (ftp->pwd) {
|
||||
if (ftp->pwd)
|
||||
efree(ftp->pwd);
|
||||
ftp->pwd = NULL;
|
||||
}
|
||||
ftp->pwd = NULL;
|
||||
|
||||
if (!ftp_putcmd(ftp, "CWD", dir))
|
||||
return 0;
|
||||
@@ -450,10 +442,9 @@ ftp_cdup(ftpbuf_t *ftp)
|
||||
if (ftp == NULL)
|
||||
return 0;
|
||||
|
||||
if (ftp->pwd) {
|
||||
if (ftp->pwd)
|
||||
efree(ftp->pwd);
|
||||
ftp->pwd = NULL;
|
||||
}
|
||||
ftp->pwd = NULL;
|
||||
|
||||
if (!ftp_putcmd(ftp, "CDUP", NULL))
|
||||
return 0;
|
||||
@@ -641,8 +632,9 @@ ftp_pasv(ftpbuf_t *ftp, int pasv)
|
||||
|
||||
sin = (struct sockaddr_in *) sa;
|
||||
sin->sin_family = AF_INET;
|
||||
sin->sin_addr = ipbox.ia[0];
|
||||
sin->sin_addr.s_addr = ipbox.l[0];
|
||||
sin->sin_port = ipbox.s[2];
|
||||
|
||||
ftp->pasv = 2;
|
||||
|
||||
return 1;
|
||||
@@ -655,6 +647,7 @@ int
|
||||
ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos)
|
||||
{
|
||||
databuf_t *data = NULL;
|
||||
char *ptr;
|
||||
int lastch;
|
||||
size_t rcvd;
|
||||
char arg[11];
|
||||
@@ -705,39 +698,12 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
|
||||
}
|
||||
|
||||
if (type == FTPTYPE_ASCII) {
|
||||
char *s;
|
||||
char *ptr = data->buf;
|
||||
char *e = ptr + rcvd;
|
||||
/* logic depends on the OS EOL
|
||||
* Win32 -> \r\n
|
||||
* Everything Else \n
|
||||
*/
|
||||
#ifdef PHP_WIN32
|
||||
while ((s = strpbrk(ptr, "\r\n"))) {
|
||||
if (*s == '\n') {
|
||||
for (ptr = data->buf; rcvd; rcvd--, ptr++) {
|
||||
if (lastch == '\r' && *ptr != '\n')
|
||||
php_stream_putc(outstream, '\r');
|
||||
} else if (*s == '\r' && *(s + 1) == '\n') {
|
||||
s++;
|
||||
}
|
||||
s++;
|
||||
php_stream_write(outstream, ptr, (s - ptr));
|
||||
if (*(s - 1) == '\r') {
|
||||
php_stream_putc(outstream, '\n');
|
||||
}
|
||||
ptr = s;
|
||||
}
|
||||
#else
|
||||
while ((s = memchr(ptr, '\r', (e - ptr)))) {
|
||||
php_stream_write(outstream, ptr, (s - ptr));
|
||||
if (*(s + 1) == '\n') {
|
||||
s++;
|
||||
}
|
||||
php_stream_putc(outstream, '\n');
|
||||
ptr = s + 1;
|
||||
}
|
||||
#endif
|
||||
if (ptr < e) {
|
||||
php_stream_write(outstream, ptr, (e - ptr));
|
||||
if (*ptr != '\r')
|
||||
php_stream_putc(outstream, *ptr);
|
||||
lastch = *ptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -746,7 +712,11 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
|
||||
}
|
||||
}
|
||||
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
if (type == FTPTYPE_ASCII && lastch == '\r')
|
||||
php_stream_putc(outstream, '\r');
|
||||
|
||||
data = data_close(ftp, data);
|
||||
ftp->data = NULL;
|
||||
|
||||
if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) {
|
||||
goto bail;
|
||||
@@ -754,7 +724,8 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
|
||||
|
||||
return 1;
|
||||
bail:
|
||||
ftp->data = data_close(ftp, data);
|
||||
data_close(ftp, data);
|
||||
ftp->data = NULL;
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -827,14 +798,14 @@ ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, i
|
||||
if (size && my_send(ftp, data->fd, data->buf, size) != size)
|
||||
goto bail;
|
||||
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
data = data_close(ftp, data);
|
||||
|
||||
if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250))
|
||||
goto bail;
|
||||
|
||||
return 1;
|
||||
bail:
|
||||
ftp->data = data_close(ftp, data);
|
||||
data_close(ftp, data);
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1118,7 +1089,7 @@ my_send(ftpbuf_t *ftp, int s, void *buf, size_t len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) {
|
||||
sent = SSL_write(ftp->ssl_handle, buf, size);
|
||||
} else
|
||||
@@ -1162,7 +1133,7 @@ my_recv(ftpbuf_t *ftp, int s, void *buf, size_t len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) {
|
||||
nr_bytes = SSL_read(ftp->ssl_handle, buf, len);
|
||||
} else
|
||||
@@ -1353,7 +1324,7 @@ ftp_getdata(ftpbuf_t *ftp TSRMLS_DC)
|
||||
#endif
|
||||
|
||||
/* send the PORT */
|
||||
ipbox.ia[0] = ((struct sockaddr_in*) sa)->sin_addr;
|
||||
ipbox.l[0] = ((struct sockaddr_in*) sa)->sin_addr.s_addr;
|
||||
ipbox.s[2] = ((struct sockaddr_in*) &addr)->sin_port;
|
||||
sprintf(arg, "%u,%u,%u,%u,%u,%u",
|
||||
ipbox.c[0], ipbox.c[1], ipbox.c[2], ipbox.c[3],
|
||||
@@ -1383,7 +1354,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp)
|
||||
php_sockaddr_storage addr;
|
||||
socklen_t size;
|
||||
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
SSL_CTX *ctx;
|
||||
TSRMLS_FETCH();
|
||||
#endif
|
||||
@@ -1402,7 +1373,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp)
|
||||
}
|
||||
|
||||
data_accepted:
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
|
||||
/* now enable ssl if we need to */
|
||||
if (ftp->use_ssl && ftp->use_ssl_for_data) {
|
||||
@@ -1449,7 +1420,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
|
||||
if (data == NULL)
|
||||
return NULL;
|
||||
if (data->listener != -1) {
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
if (data->ssl_active) {
|
||||
SSL_shutdown(data->ssl_handle);
|
||||
data->ssl_active = 0;
|
||||
@@ -1458,7 +1429,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
|
||||
closesocket(data->listener);
|
||||
}
|
||||
if (data->fd != -1) {
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
if (data->ssl_active) {
|
||||
SSL_shutdown(data->ssl_handle);
|
||||
data->ssl_active = 0;
|
||||
@@ -1479,7 +1450,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
|
||||
char**
|
||||
ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
{
|
||||
php_stream *tmpstream = NULL;
|
||||
FILE *tmpfp = NULL;
|
||||
databuf_t *data = NULL;
|
||||
char *ptr;
|
||||
int ch, lastch;
|
||||
@@ -1489,10 +1460,8 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
char **entry;
|
||||
char *text;
|
||||
|
||||
if ((tmpstream = php_stream_fopen_tmpfile()) == NULL) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create temporary file. Check permissions in temporary files directory.");
|
||||
if ((tmpfp = tmpfile()) == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!ftp_type(ftp, FTPTYPE_ASCII))
|
||||
goto bail;
|
||||
@@ -1517,7 +1486,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
if (rcvd == -1)
|
||||
goto bail;
|
||||
|
||||
php_stream_write(tmpstream, data->buf, rcvd);
|
||||
fwrite(data->buf, rcvd, 1, tmpfp);
|
||||
|
||||
size += rcvd;
|
||||
for (ptr = data->buf; rcvd; rcvd--, ptr++) {
|
||||
@@ -1529,9 +1498,14 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
data = data_close(ftp, data);
|
||||
|
||||
php_stream_rewind(tmpstream);
|
||||
if (ferror(tmpfp))
|
||||
goto bail;
|
||||
|
||||
|
||||
|
||||
rewind(tmpfp);
|
||||
|
||||
ret = emalloc((lines + 1) * sizeof(char**) + size * sizeof(char*));
|
||||
|
||||
@@ -1539,7 +1513,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
text = (char*) (ret + lines + 1);
|
||||
*entry = text;
|
||||
lastch = 0;
|
||||
while ((ch = php_stream_getc(tmpstream)) != EOF) {
|
||||
while ((ch = getc(tmpfp)) != EOF) {
|
||||
if (ch == '\n' && lastch == '\r') {
|
||||
*(text - 1) = 0;
|
||||
*++entry = text;
|
||||
@@ -1551,7 +1525,10 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
}
|
||||
*entry = NULL;
|
||||
|
||||
php_stream_close(tmpstream);
|
||||
if (ferror(tmpfp))
|
||||
goto bail;
|
||||
|
||||
fclose(tmpfp);
|
||||
|
||||
if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) {
|
||||
efree(ret);
|
||||
@@ -1560,8 +1537,9 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
|
||||
return ret;
|
||||
bail:
|
||||
ftp->data = data_close(ftp, data);
|
||||
php_stream_close(tmpstream);
|
||||
if (data)
|
||||
data_close(ftp, data);
|
||||
fclose(tmpfp);
|
||||
if (ret)
|
||||
efree(ret);
|
||||
return NULL;
|
||||
@@ -1616,7 +1594,7 @@ ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t typ
|
||||
return (ftp_nb_continue_read(ftp));
|
||||
|
||||
bail:
|
||||
ftp->data = data_close(ftp, data);
|
||||
data_close(ftp, data);
|
||||
return PHP_FTP_FAILED;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1669,7 +1647,7 @@ ftp_nb_continue_read(ftpbuf_t *ftp)
|
||||
if (type == FTPTYPE_ASCII && lastch == '\r')
|
||||
php_stream_putc(ftp->stream, '\r');
|
||||
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
data = data_close(ftp, data);
|
||||
|
||||
if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) {
|
||||
goto bail;
|
||||
@@ -1679,7 +1657,7 @@ ftp_nb_continue_read(ftpbuf_t *ftp)
|
||||
return PHP_FTP_FINISHED;
|
||||
bail:
|
||||
ftp->nb = 0;
|
||||
ftp->data = data_close(ftp, data);
|
||||
data_close(ftp, data);
|
||||
return PHP_FTP_FAILED;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1731,7 +1709,7 @@ ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type
|
||||
return (ftp_nb_continue_write(ftp));
|
||||
|
||||
bail:
|
||||
ftp->data = data_close(ftp, data);
|
||||
data_close(ftp, data);
|
||||
return PHP_FTP_FAILED;
|
||||
|
||||
}
|
||||
@@ -1786,7 +1764,7 @@ ftp_nb_continue_write(ftpbuf_t *ftp)
|
||||
ftp->nb = 0;
|
||||
return PHP_FTP_FINISHED;
|
||||
bail:
|
||||
ftp->data = data_close(ftp, ftp->data);
|
||||
data_close(ftp, ftp->data);
|
||||
ftp->nb = 0;
|
||||
return PHP_FTP_FAILED;
|
||||
}
|
||||
|
||||
+2
-2
@@ -49,7 +49,7 @@ typedef struct databuf
|
||||
int fd; /* data connection */
|
||||
ftptype_t type; /* transfer type */
|
||||
char buf[FTP_BUFSIZE]; /* data buffer */
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
SSL *ssl_handle; /* ssl handle */
|
||||
int ssl_active; /* flag if ssl is active or not */
|
||||
#endif
|
||||
@@ -78,7 +78,7 @@ typedef struct ftpbuf
|
||||
int lastch; /* last char of previous call */
|
||||
int direction; /* recv = 0 / send = 1 */
|
||||
int closestream;/* close or not close stream */
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
int use_ssl; /* enable(1) or disable(0) ssl */
|
||||
int use_ssl_for_data; /* en/disable ssl for the dataconnection */
|
||||
int old_ssl; /* old mode = forced data encryption */
|
||||
|
||||
+23
-25
@@ -48,7 +48,7 @@ static int le_ftpbuf;
|
||||
|
||||
function_entry php_ftp_functions[] = {
|
||||
PHP_FE(ftp_connect, NULL)
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
PHP_FE(ftp_ssl_connect, NULL)
|
||||
#endif
|
||||
PHP_FE(ftp_login, NULL)
|
||||
@@ -139,7 +139,7 @@ PHP_MINFO_FUNCTION(ftp)
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto resource ftp_connect(string host [, int port [, int timeout]])
|
||||
/* {{{ proto resource ftp_connect(string host [, int port [, int timeout)]])
|
||||
Opens a FTP stream */
|
||||
PHP_FUNCTION(ftp_connect)
|
||||
{
|
||||
@@ -166,7 +166,7 @@ PHP_FUNCTION(ftp_connect)
|
||||
|
||||
/* autoseek for resuming */
|
||||
ftp->autoseek = FTP_DEFAULT_AUTOSEEK;
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
/* disable ssl */
|
||||
ftp->use_ssl = 0;
|
||||
#endif
|
||||
@@ -175,8 +175,8 @@ PHP_FUNCTION(ftp_connect)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
/* {{{ proto resource ftp_ssl_connect(string host [, int port [, int timeout]])
|
||||
#if HAVE_OPENSSL_EXT
|
||||
/* {{{ proto resource ftp_ssl_connect(string host [, int port [, int timeout)]])
|
||||
Opens a FTP-SSL stream */
|
||||
PHP_FUNCTION(ftp_ssl_connect)
|
||||
{
|
||||
@@ -603,15 +603,15 @@ PHP_FUNCTION(ftp_get)
|
||||
}
|
||||
|
||||
if (ftp->autoseek && resumepos) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", NULL);
|
||||
outstream = php_stream_fopen(local, "rb+", NULL);
|
||||
if (outstream == NULL) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL);
|
||||
outstream = php_stream_fopen(local, "wb", NULL);
|
||||
}
|
||||
if (outstream != NULL) {
|
||||
/* if autoresume is wanted seek to end */
|
||||
@@ -623,10 +623,10 @@ PHP_FUNCTION(ftp_get)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL);
|
||||
outstream = php_stream_fopen(local, "wb", NULL);
|
||||
}
|
||||
|
||||
if (outstream == NULL) {
|
||||
@@ -636,7 +636,6 @@ PHP_FUNCTION(ftp_get)
|
||||
|
||||
if (!ftp_get(ftp, outstream, remote, xtype, resumepos)) {
|
||||
php_stream_close(outstream);
|
||||
VCWD_UNLINK(local);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -675,15 +674,15 @@ PHP_FUNCTION(ftp_nb_get)
|
||||
}
|
||||
|
||||
if (ftp->autoseek && resumepos) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "rb+", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", NULL);
|
||||
outstream = php_stream_fopen(local, "rb+", NULL);
|
||||
if (outstream == NULL) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL);
|
||||
outstream = php_stream_fopen(local, "wb", NULL);
|
||||
}
|
||||
if (outstream != NULL) {
|
||||
/* if autoresume is wanted seek to end */
|
||||
@@ -695,10 +694,10 @@ PHP_FUNCTION(ftp_nb_get)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "wb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL);
|
||||
outstream = php_stream_fopen(local, "wb", NULL);
|
||||
}
|
||||
|
||||
if (outstream == NULL) {
|
||||
@@ -712,7 +711,6 @@ PHP_FUNCTION(ftp_nb_get)
|
||||
|
||||
if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) {
|
||||
php_stream_close(outstream);
|
||||
VCWD_UNLINK(local);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
|
||||
RETURN_LONG(PHP_FTP_FAILED);
|
||||
}
|
||||
@@ -883,11 +881,11 @@ PHP_FUNCTION(ftp_put)
|
||||
if (php_check_open_basedir(local TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt" : "rb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "rb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
instream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt" : "rb", NULL);
|
||||
instream = php_stream_fopen(local, "rb", NULL);
|
||||
|
||||
if (instream == NULL) {
|
||||
RETURN_FALSE;
|
||||
@@ -945,11 +943,11 @@ PHP_FUNCTION(ftp_nb_put)
|
||||
if (php_check_open_basedir(local TSRMLS_CC)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt" : "rb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
if (PG(safe_mode) && (!php_checkuid(local, "rb", CHECKUID_CHECK_MODE_PARAM))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
instream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt" : "rb", NULL);
|
||||
instream = php_stream_fopen(local, "rb", NULL);
|
||||
|
||||
if (instream == NULL) {
|
||||
RETURN_FALSE;
|
||||
@@ -1163,7 +1161,7 @@ PHP_FUNCTION(ftp_set_option)
|
||||
RETURN_TRUE;
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%d'", option);
|
||||
RETURN_FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -1192,7 +1190,7 @@ PHP_FUNCTION(ftp_get_option)
|
||||
RETURN_BOOL(ftp->autoseek);
|
||||
break;
|
||||
default:
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option);
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%d'", option);
|
||||
RETURN_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ PHP_MINIT_FUNCTION(ftp);
|
||||
PHP_MINFO_FUNCTION(ftp);
|
||||
|
||||
PHP_FUNCTION(ftp_connect);
|
||||
#ifdef HAVE_OPENSSL_EXT
|
||||
#if HAVE_OPENSSL_EXT
|
||||
PHP_FUNCTION(ftp_ssl_connect);
|
||||
#endif
|
||||
PHP_FUNCTION(ftp_login);
|
||||
|
||||
+13
-17
@@ -50,8 +50,8 @@ dnl
|
||||
AC_DEFUN(PHP_GD_JPEG,[
|
||||
if test "$PHP_JPEG_DIR" != "no"; then
|
||||
|
||||
for i in $PHP_JPEG_DIR /usr/local /usr; do
|
||||
test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i && break
|
||||
for i in /usr /usr/local $PHP_JPEG_DIR; do
|
||||
test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i
|
||||
done
|
||||
|
||||
if test -z "$GD_JPEG_DIR"; then
|
||||
@@ -75,8 +75,8 @@ AC_DEFUN(PHP_GD_JPEG,[
|
||||
AC_DEFUN(PHP_GD_PNG,[
|
||||
if test "$PHP_PNG_DIR" != "no"; then
|
||||
|
||||
for i in $PHP_PNG_DIR /usr/local /usr; do
|
||||
test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i && break
|
||||
for i in /usr /usr/local $PHP_PNG_DIR; do
|
||||
test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i
|
||||
done
|
||||
|
||||
if test -z "$GD_PNG_DIR"; then
|
||||
@@ -110,8 +110,8 @@ AC_DEFUN(PHP_GD_PNG,[
|
||||
AC_DEFUN(PHP_GD_XPM,[
|
||||
if test "$PHP_XPM_DIR" != "no"; then
|
||||
|
||||
for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
|
||||
test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i && break
|
||||
for i in /usr /usr/local /usr/X11R6 $PHP_XPM_DIR; do
|
||||
test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i
|
||||
done
|
||||
|
||||
if test -z "$GD_XPM_DIR"; then
|
||||
@@ -144,9 +144,9 @@ AC_DEFUN(PHP_GD_XPM,[
|
||||
AC_DEFUN(PHP_GD_FREETYPE1,[
|
||||
if test "$PHP_TTF" != "no"; then
|
||||
if test "$PHP_FREETYPE_DIR" = "no" -o "$PHP_FREETYPE_DIR" = ""; then
|
||||
if test -n "$PHP_TTF"; then
|
||||
for i in $PHP_TTF /usr/local /usr; do
|
||||
if test -f "$i/include/freetype.h"; then
|
||||
if test -n "$PHP_TTF" ; then
|
||||
for i in /usr /usr/local $PHP_TTF; do
|
||||
if test -f "$i/include/freetype.h" ; then
|
||||
TTF_DIR=$i
|
||||
unset TTF_INC_DIR
|
||||
fi
|
||||
@@ -158,7 +158,6 @@ AC_DEFUN(PHP_GD_FREETYPE1,[
|
||||
TTF_DIR=$i
|
||||
TTF_INC_DIR=$i/include/freetype1/freetype
|
||||
fi
|
||||
test -n "$TTF_DIR" && break
|
||||
done
|
||||
fi
|
||||
if test -n "$TTF_DIR" ; then
|
||||
@@ -178,11 +177,10 @@ AC_DEFUN(PHP_GD_FREETYPE1,[
|
||||
AC_DEFUN(PHP_GD_FREETYPE2,[
|
||||
if test "$PHP_FREETYPE_DIR" != "no"; then
|
||||
|
||||
for i in $PHP_FREETYPE_DIR /usr/local /usr; do
|
||||
for i in /usr /usr/local $PHP_FREETYPE_DIR; do
|
||||
if test -f "$i/include/freetype2/freetype/freetype.h"; then
|
||||
FREETYPE2_DIR=$i
|
||||
FREETYPE2_INC_DIR=$i/include/freetype2
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -203,8 +201,8 @@ AC_DEFUN(PHP_GD_FREETYPE2,[
|
||||
AC_DEFUN(PHP_GD_T1LIB,[
|
||||
if test "$PHP_T1LIB" != "no"; then
|
||||
|
||||
for i in $PHP_T1LIB /usr/local /usr; do
|
||||
test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break
|
||||
for i in /usr /usr/local $PHP_T1LIB; do
|
||||
test -f "$i/include/t1lib.h" && GD_T1_DIR=$i
|
||||
done
|
||||
|
||||
if test -z "$GD_T1_DIR"; then
|
||||
@@ -257,7 +255,6 @@ AC_DEFUN(PHP_GD_CHECK_VERSION,[
|
||||
PHP_CHECK_LIBRARY(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
|
||||
PHP_CHECK_LIBRARY(gd, gdImageGifCtx, [AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
|
||||
PHP_CHECK_LIBRARY(gd, gdCacheCreate, [AC_DEFINE(HAVE_GD_CACHE_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
|
||||
PHP_CHECK_LIBRARY(gd, gdFontCacheShutdown, [AC_DEFINE(HAVE_GD_THREAD_SAFE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -304,8 +301,7 @@ dnl These are always available with bundled library
|
||||
AC_DEFINE(HAVE_GD_PNG, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_XBM, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ])
|
||||
AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])
|
||||
|
||||
dnl Make sure the libgd/ is first in the include path
|
||||
GDLIB_CFLAGS="-DHAVE_LIBPNG"
|
||||
|
||||
+16
-40
@@ -379,18 +379,14 @@ PHP_MINIT_FUNCTION(gd)
|
||||
#if HAVE_LIBGD20 && HAVE_GD_STRINGFT
|
||||
PHP_RSHUTDOWN_FUNCTION(gd)
|
||||
{
|
||||
#if defined(HAVE_GD_THREAD_SAFE) || defined(HAVE_GD_BUNDLED)
|
||||
gdFontCacheShutdown();
|
||||
#else
|
||||
gdFreeFontCache();
|
||||
#endif
|
||||
return SUCCESS;
|
||||
}
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
#if HAVE_GD_BUNDLED
|
||||
#define PHP_GD_VERSION_STRING "bundled (2.0.22 compatible)"
|
||||
#define PHP_GD_VERSION_STRING "bundled (2.0.15 compatible)"
|
||||
#elif HAVE_LIBGD20
|
||||
#define PHP_GD_VERSION_STRING "2.0 or higher"
|
||||
#elif HAVE_GDIMAGECOLORRESOLVE
|
||||
@@ -967,7 +963,7 @@ PHP_FUNCTION(imagelayereffect)
|
||||
PHP_FUNCTION(imagecolorallocatealpha)
|
||||
{
|
||||
zval *IM;
|
||||
long red, green, blue, alpha;
|
||||
int red, green, blue, alpha;
|
||||
gdImagePtr im;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
|
||||
@@ -1616,17 +1612,10 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
}
|
||||
|
||||
switch(image_type) {
|
||||
#ifdef HAVE_GD_WBMP
|
||||
case PHP_GDIMG_CONVERT_WBM:
|
||||
if (q == -1) {
|
||||
q = 0;
|
||||
} else if (q < 0 || q > 255) {
|
||||
if(q<0||q>255) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
|
||||
q = 0;
|
||||
}
|
||||
gdImageWBMP(im, q, fp);
|
||||
break;
|
||||
#endif
|
||||
case PHP_GDIMG_TYPE_JPG:
|
||||
(*func_p)(im, fp, q);
|
||||
break;
|
||||
@@ -1665,17 +1654,10 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
|
||||
}
|
||||
|
||||
switch(image_type) {
|
||||
#ifdef HAVE_GD_WBMP
|
||||
case PHP_GDIMG_CONVERT_WBM:
|
||||
if (q == -1) {
|
||||
q = 0;
|
||||
} else if (q < 0 || q > 255) {
|
||||
if(q<0||q>255) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
|
||||
q = 0;
|
||||
}
|
||||
gdImageWBMP(im, q, tmp);
|
||||
break;
|
||||
#endif
|
||||
case PHP_GDIMG_TYPE_JPG:
|
||||
(*func_p)(im, tmp, q);
|
||||
break;
|
||||
@@ -2978,7 +2960,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
|
||||
char *error = NULL;
|
||||
int argc;
|
||||
#if HAVE_GD_STRINGFTEX
|
||||
gdFTStringExtra strex = {0};
|
||||
gdFTStringExtra strex;
|
||||
#endif
|
||||
|
||||
#if !HAVE_GD_STRINGFTEX
|
||||
@@ -2988,11 +2970,13 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
|
||||
argc = ZEND_NUM_ARGS();
|
||||
|
||||
if (mode == TTFTEXT_BBOX) {
|
||||
if (argc < 4 || argc > 5 || zend_get_parameters_ex(argc, &PTSIZE, &ANGLE, &FONTNAME, &C, &EXT) == FAILURE) {
|
||||
if ((extended && argc != 5) || (!extended && argc != 4) ||
|
||||
zend_get_parameters_ex(argc, &PTSIZE, &ANGLE, &FONTNAME, &C, &EXT) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
} else {
|
||||
if (argc < 8 || argc > 9 || zend_get_parameters_ex(argc, &IM, &PTSIZE, &ANGLE, &X, &Y, &COL, &FONTNAME, &C, &EXT) == FAILURE) {
|
||||
if ((extended && argc != 9) || (!extended && argc != 8) ||
|
||||
zend_get_parameters_ex(argc, &IM, &PTSIZE, &ANGLE, &X, &Y, &COL, &FONTNAME, &C, &EXT) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
|
||||
@@ -3021,15 +3005,15 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
|
||||
HashPosition pos;
|
||||
|
||||
convert_to_array_ex(EXT);
|
||||
memset(&strex, 0, sizeof(strex));
|
||||
|
||||
/* walk the assoc array */
|
||||
zend_hash_internal_pointer_reset_ex(HASH_OF(*EXT), &pos);
|
||||
do {
|
||||
zval ** item;
|
||||
char * key;
|
||||
ulong num_key;
|
||||
|
||||
if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING)
|
||||
if (zend_hash_get_current_key_ex(HASH_OF(*EXT), &key, NULL, NULL, 0, &pos) == FAILURE)
|
||||
continue;
|
||||
|
||||
if (zend_hash_get_current_data_ex(HASH_OF(*EXT), (void**)&item, &pos) == FAILURE)
|
||||
@@ -3053,19 +3037,15 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
|
||||
str = (unsigned char *) Z_STRVAL_PP(C);
|
||||
l = strlen(str);
|
||||
|
||||
/* VCWD_REALPATH(Z_STRVAL_PP(FONTNAME), fontname); */
|
||||
|
||||
#ifdef VIRTUAL_DIR
|
||||
{
|
||||
char tmp_font_path[MAXPATHLEN];
|
||||
if (VCWD_REALPATH(Z_STRVAL_PP(FONTNAME), tmp_font_path)) {
|
||||
fontname = (unsigned char *) Z_STRVAL_PP(FONTNAME);
|
||||
}
|
||||
if(virtual_filepath(Z_STRVAL_PP(FONTNAME), (char**)&fontname TSRMLS_CC)) {
|
||||
fontname = (unsigned char*)Z_STRVAL_PP(FONTNAME);
|
||||
}
|
||||
#else
|
||||
fontname = (unsigned char*)Z_STRVAL_PP(FONTNAME);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_GD_IMGSTRTTF
|
||||
# if HAVE_GD_STRINGFTEX
|
||||
if (extended) {
|
||||
@@ -3185,7 +3165,7 @@ PHP_FUNCTION(imagepscopyfont)
|
||||
of_ind = zend_list_find(Z_LVAL_PP(fnt), &type);
|
||||
|
||||
if (type != le_ps_font) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Type 1 font index", Z_LVAL_PP(fnt));
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Type 1 font index", Z_LVAL_PP(fnt));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
@@ -3320,7 +3300,7 @@ PHP_FUNCTION(imagepstext)
|
||||
{
|
||||
zval *img, *fnt;
|
||||
int i, j;
|
||||
long _fg, _bg, x, y, size, space = 0, aa_steps = 4, width = 0;
|
||||
int _fg, _bg, x, y, size, space = 0, aa_steps = 4, width = 0;
|
||||
int *f_ind;
|
||||
int h_lines, v_lines, c_ind;
|
||||
int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl;
|
||||
@@ -3639,10 +3619,6 @@ static void _php_image_bw_convert( gdImagePtr im_org, gdIOCtx *out, int threshol
|
||||
return;
|
||||
}
|
||||
|
||||
if (im_org->trueColor) {
|
||||
gdImageTrueColorToPalette(im_org, 1, 256);
|
||||
}
|
||||
|
||||
for (y = 0; y < dest_height; y++) {
|
||||
for (x = 0; x < dest_width; x++) {
|
||||
color_org = gdImageGetPixel (im_org, x, y);
|
||||
|
||||
+6
-45
@@ -43,8 +43,8 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -56,7 +56,7 @@ BSC32=bscmake.exe
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 php4ts.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 php4ts.lib freetype2.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\zlib\Release"
|
||||
# ADD LINK32 php4ts.lib freetype2.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
@@ -73,8 +73,8 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "Debug_TS"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
|
||||
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -86,7 +86,7 @@ BSC32=bscmake.exe
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 php4ts_debug.lib libjpeg.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_gd2.dll" /libpath:"..\..\Debug_TS"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 php4ts_debug.lib libpng.lib zlib.lib libjpeg.lib freetype2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\zlib\Debug"
|
||||
# ADD LINK32 php4ts_debug.lib libpng.lib zlib.lib libjpeg.lib freetype2.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_gd2.dll" /libpath:"..\..\Debug_TS"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
@@ -144,7 +144,6 @@ SOURCE=.\libgd\gd.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -160,7 +159,6 @@ SOURCE=.\libgd\gd2copypal.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -176,7 +174,6 @@ SOURCE=.\libgd\gd_arc_f_buggy.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -192,7 +189,6 @@ SOURCE=.\libgd\gd_gd.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -208,7 +204,6 @@ SOURCE=.\libgd\gd_gd2.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -216,18 +211,6 @@ SOURCE=.\libgd\gd_gd2.c
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libgd\gd_gif_in.c
|
||||
|
||||
!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Release_TS_bundled"
|
||||
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -240,7 +223,6 @@ SOURCE=.\libgd\gd_io.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -256,7 +238,6 @@ SOURCE=.\libgd\gd_io_dp.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -272,7 +253,6 @@ SOURCE=.\libgd\gd_io_file.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -288,7 +268,6 @@ SOURCE=.\libgd\gd_io_ss.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -304,7 +283,6 @@ SOURCE=.\libgd\gd_jpeg.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -320,7 +298,6 @@ SOURCE=.\libgd\gd_png.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -336,7 +313,6 @@ SOURCE=.\libgd\gd_ss.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -352,7 +328,6 @@ SOURCE=.\libgd\gd_topal.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -368,7 +343,6 @@ SOURCE=.\libgd\gd_wbmp.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -384,7 +358,6 @@ SOURCE=.\libgd\gdcache.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -400,7 +373,6 @@ SOURCE=.\libgd\gdfontg.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -416,7 +388,6 @@ SOURCE=.\libgd\gdfontl.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -432,7 +403,6 @@ SOURCE=.\libgd\gdfontmb.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -448,7 +418,6 @@ SOURCE=.\libgd\gdfonts.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -464,7 +433,6 @@ SOURCE=.\libgd\gdfontt.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -480,7 +448,6 @@ SOURCE=.\libgd\gdft.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -496,7 +463,6 @@ SOURCE=.\libgd\gdhelpers.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -512,7 +478,6 @@ SOURCE=.\libgd\gdkanji.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -528,7 +493,6 @@ SOURCE=.\libgd\gdtables.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -544,7 +508,6 @@ SOURCE=.\libgd\gdxpm.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -560,7 +523,6 @@ SOURCE=.\libgd\wbmp.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -576,7 +538,6 @@ SOURCE=.\libgd\xbm.c
|
||||
!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
|
||||
|
||||
# PROP Intermediate_Dir "Debug_TS_bundled"
|
||||
# ADD CPP /FR
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
+1
-23
@@ -1,20 +1,3 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 4 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2003 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.0 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_0.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stanislav Malyshev <stas@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
#include "php_gd.h"
|
||||
|
||||
|
||||
@@ -22,13 +5,8 @@
|
||||
|
||||
static void _php_image_output_putc(struct gdIOCtx *ctx, int c)
|
||||
{
|
||||
/* without the following downcast, the write will fail
|
||||
* (i.e., will write a zero byte) for all
|
||||
* big endian architectures:
|
||||
*/
|
||||
unsigned char ch = (unsigned char) c;
|
||||
TSRMLS_FETCH();
|
||||
php_write(&ch, 1 TSRMLS_CC);
|
||||
php_write(&c, 1 TSRMLS_CC);
|
||||
}
|
||||
|
||||
static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l)
|
||||
|
||||
+203
-362
@@ -9,8 +9,8 @@
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# if _MSC_VER >= 1300
|
||||
/* in MSVC.NET these are available but only for __cplusplus and not _MSC_EXTENSIONS */
|
||||
# if !defined(_MSC_EXTENSIONS) && defined(__cplusplus)
|
||||
/* in MSVC.NET the these are available but only for __cplusplus and not _MSC_EXTENSIONS */
|
||||
# ifdef _MSC_EXTENSIONS
|
||||
# define HAVE_FABSF 1
|
||||
extern float fabsf(float x);
|
||||
# define HAVE_FLOORF 1
|
||||
@@ -94,7 +94,7 @@ static int gdFullAlphaBlend(int dst, int src);
|
||||
static int gdLayerOverlay(int dst, int src);
|
||||
static int gdAlphaBlendColor(int b1, int b2, int a1, int a2);
|
||||
static int gdAlphaOverlayColor(int src, int dst, int max);
|
||||
int gdImageGetTrueColorPixel(gdImagePtr im, int x, int y);
|
||||
static int gdImageGetTrueColorPixel(gdImagePtr im, int x, int y);
|
||||
|
||||
void php_gd_error_ex(int type, const char *format, ...)
|
||||
{
|
||||
@@ -255,7 +255,7 @@ int gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a)
|
||||
gd = im->green[i] - g;
|
||||
bd = im->blue[i] - b;
|
||||
/* gd 2.02: whoops, was - b (thanks to David Marwood) */
|
||||
ad = im->alpha[i] - a;
|
||||
ad = im->blue[i] - a;
|
||||
dist = rd * rd + gd * gd + bd * bd + ad * ad;
|
||||
if (first || (dist < mindist)) {
|
||||
mindist = dist;
|
||||
@@ -571,7 +571,7 @@ void gdImageColorTransparent (gdImagePtr im, int color)
|
||||
if (im->transparent != -1) {
|
||||
im->alpha[im->transparent] = gdAlphaOpaque;
|
||||
}
|
||||
if (color > -1 && color<im->colorsTotal && color<=gdMaxColors) {
|
||||
if (color > -1 && color<=gdMaxColors) {
|
||||
im->alpha[color] = gdAlphaTransparent;
|
||||
} else {
|
||||
return;
|
||||
@@ -751,7 +751,7 @@ void gdImageSetPixel (gdImagePtr im, int x, int y, int color)
|
||||
}
|
||||
}
|
||||
|
||||
int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y)
|
||||
static int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y)
|
||||
{
|
||||
int p = gdImageGetPixel(im, x, y);
|
||||
|
||||
@@ -868,36 +868,6 @@ static void gdImageTileApply (gdImagePtr im, int x, int y)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int gdImageTileGet (gdImagePtr im, int x, int y)
|
||||
{
|
||||
int srcx, srcy;
|
||||
int tileColor,p;
|
||||
if (!im->tile) {
|
||||
return -1;
|
||||
}
|
||||
srcx = x % gdImageSX(im->tile);
|
||||
srcy = y % gdImageSY(im->tile);
|
||||
p = gdImageGetPixel(im->tile, srcx, srcy);
|
||||
|
||||
if (im->trueColor) {
|
||||
if (im->tile->trueColor) {
|
||||
tileColor = p;
|
||||
} else {
|
||||
tileColor = gdTrueColorAlpha( gdImageRed(im->tile,p), gdImageGreen(im->tile,p), gdImageBlue (im->tile,p), gdImageAlpha (im->tile,p));
|
||||
}
|
||||
} else {
|
||||
if (im->tile->trueColor) {
|
||||
tileColor = gdImageColorResolveAlpha(im, gdTrueColorGetRed (p), gdTrueColorGetGreen (p), gdTrueColorGetBlue (p), gdTrueColorGetAlpha (p));
|
||||
} else {
|
||||
tileColor = p;
|
||||
tileColor = gdImageColorResolveAlpha(im, gdImageRed (im->tile,p), gdImageGreen (im->tile,p), gdImageBlue (im->tile,p), gdImageAlpha (im->tile,p));
|
||||
}
|
||||
}
|
||||
return tileColor;
|
||||
}
|
||||
|
||||
|
||||
static void gdImageAntiAliasedApply (gdImagePtr im, int px, int py)
|
||||
{
|
||||
float p_dist, p_alpha;
|
||||
@@ -1762,18 +1732,13 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
|
||||
int lastBorder;
|
||||
/* Seek left */
|
||||
int leftLimit = -1, rightLimit;
|
||||
int i, restoreAlphaBleding=0;
|
||||
int i;
|
||||
|
||||
if (border < 0) {
|
||||
/* Refuse to fill to a non-solid border */
|
||||
return;
|
||||
}
|
||||
|
||||
if (im->alphaBlendingFlag) {
|
||||
restoreAlphaBleding = 1;
|
||||
im->alphaBlendingFlag = 0;
|
||||
}
|
||||
|
||||
if (x >= im->sx) {
|
||||
x = im->sx - 1;
|
||||
}
|
||||
@@ -1789,9 +1754,6 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
|
||||
leftLimit = i;
|
||||
}
|
||||
if (leftLimit == -1) {
|
||||
if (restoreAlphaBleding) {
|
||||
im->alphaBlendingFlag = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
/* Seek right */
|
||||
@@ -1823,7 +1785,7 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
|
||||
if (y < ((im->sy) - 1)) {
|
||||
lastBorder = 1;
|
||||
for (i = leftLimit; i <= rightLimit; i++) {
|
||||
int c = gdImageGetTrueColorPixel(im, i, y + 1);
|
||||
int c = gdImageGetPixel(im, i, y + 1);
|
||||
|
||||
if (lastBorder) {
|
||||
if ((c != border) && (c != color)) {
|
||||
@@ -1835,178 +1797,109 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (restoreAlphaBleding) {
|
||||
im->alphaBlendingFlag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* set the pixel at (x,y) and its 4-connected neighbors
|
||||
* with the same pixel value to the new pixel value nc (new color).
|
||||
* A 4-connected neighbor: pixel above, below, left, or right of a pixel.
|
||||
* ideas from comp.graphics discussions.
|
||||
* For tiled fill, the use of a flag buffer is mandatory. As the tile image can
|
||||
* contain the same color as the color to fill. To do not bloat normal filling
|
||||
* code I added a 2nd private function.
|
||||
*/
|
||||
|
||||
/* horizontal segment of scan line y */
|
||||
struct seg {int y, xl, xr, dy;};
|
||||
|
||||
/* max depth of stack */
|
||||
#define FILL_MAX 1200000
|
||||
#define FILL_PUSH(Y, XL, XR, DY) \
|
||||
if (sp<stack+FILL_MAX*10 && Y+(DY)>=0 && Y+(DY)<wy2) \
|
||||
{sp->y = Y; sp->xl = XL; sp->xr = XR; sp->dy = DY; sp++;}
|
||||
|
||||
#define FILL_POP(Y, XL, XR, DY) \
|
||||
{sp--; Y = sp->y+(DY = sp->dy); XL = sp->xl; XR = sp->xr;}
|
||||
|
||||
void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc);
|
||||
|
||||
void gdImageFill(gdImagePtr im, int x, int y, int nc)
|
||||
void gdImageFill (gdImagePtr im, int x, int y, int color)
|
||||
{
|
||||
int l, x1, x2, dy;
|
||||
int oc; /* old pixel value */
|
||||
int wx2,wy2;
|
||||
/* stack of filled segments */
|
||||
//struct seg stack[FILL_MAX],*sp = stack;;
|
||||
struct seg *stack;
|
||||
struct seg *sp;
|
||||
|
||||
if (nc==gdTiled){
|
||||
_gdImageFillTiled(im,x,y,nc);
|
||||
int lastBorder;
|
||||
int old;
|
||||
int leftLimit, rightLimit;
|
||||
int i;
|
||||
|
||||
if (x >= im->sx) {
|
||||
x = im->sx - 1;
|
||||
}
|
||||
|
||||
if (y >= im->sy) {
|
||||
y = im->sy - 1;
|
||||
}
|
||||
|
||||
old = gdImageGetPixel(im, x, y);
|
||||
if (color == gdTiled) {
|
||||
/* Tile fill -- got to watch out! */
|
||||
int p, tileColor;
|
||||
int srcx, srcy;
|
||||
if (!im->tile) {
|
||||
return;
|
||||
}
|
||||
/* Refuse to flood-fill with a transparent pattern I can't do it without allocating another image */
|
||||
if (gdImageGetTransparent(im->tile) != (-1)) {
|
||||
return;
|
||||
}
|
||||
srcx = x % gdImageSX(im->tile);
|
||||
srcy = y % gdImageSY(im->tile);
|
||||
p = gdImageGetPixel(im->tile, srcx, srcy);
|
||||
if (im->trueColor) {
|
||||
tileColor = p;
|
||||
} else {
|
||||
if (im->tile->trueColor) {
|
||||
tileColor = gdImageColorResolveAlpha(im, gdTrueColorGetRed (p), gdTrueColorGetGreen (p), gdTrueColorGetBlue (p), gdTrueColorGetAlpha (p));
|
||||
} else {
|
||||
tileColor = im->tileColorMap[p];
|
||||
}
|
||||
}
|
||||
if (old == tileColor) {
|
||||
/* Nothing to be done */
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (old == color) {
|
||||
/* Nothing to be done */
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* Seek left */
|
||||
leftLimit = (-1);
|
||||
for (i = x; i >= 0; i--) {
|
||||
if (gdImageGetPixel(im, i, y) != old) {
|
||||
break;
|
||||
}
|
||||
gdImageSetPixel(im, i, y, color);
|
||||
leftLimit = i;
|
||||
}
|
||||
if (leftLimit == (-1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
wx2=im->sx;wy2=im->sy;
|
||||
oc = gdImageGetPixel(im, x, y);
|
||||
if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) return;
|
||||
|
||||
stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1);
|
||||
sp = stack;
|
||||
|
||||
/* required! */
|
||||
FILL_PUSH(y,x,x,1);
|
||||
/* seed segment (popped 1st) */
|
||||
FILL_PUSH(y+1, x, x, -1);
|
||||
while (sp>stack) {
|
||||
FILL_POP(y, x1, x2, dy);
|
||||
|
||||
for (x=x1; x>=0 && gdImageGetPixel(im,x, y)==oc; x--) {
|
||||
gdImageSetPixel(im,x, y, nc);
|
||||
/* Seek right */
|
||||
rightLimit = x;
|
||||
for (i = (x + 1); i < im->sx; i++) {
|
||||
if (gdImageGetPixel(im, i, y) != old) {
|
||||
break;
|
||||
}
|
||||
gdImageSetPixel(im, i, y, color);
|
||||
rightLimit = i;
|
||||
}
|
||||
/* Look at lines above and below and start paints */
|
||||
/* Above */
|
||||
if (y > 0) {
|
||||
lastBorder = 1;
|
||||
for (i = leftLimit; i <= rightLimit; i++) {
|
||||
int c;
|
||||
c = gdImageGetPixel(im, i, y - 1);
|
||||
if (lastBorder && c == old) {
|
||||
gdImageFill (im, i, y - 1, color);
|
||||
lastBorder = 0;
|
||||
} else if (c != old) {
|
||||
lastBorder = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Below */
|
||||
if (y < (im->sy - 1)) {
|
||||
lastBorder = 1;
|
||||
for (i = leftLimit; i <= rightLimit; i++) {
|
||||
int c;
|
||||
c = gdImageGetPixel(im, i, y + 1);
|
||||
if (lastBorder && c == old) {
|
||||
gdImageFill(im, i, y + 1, color);
|
||||
lastBorder = 0;
|
||||
} else if (c != old) {
|
||||
lastBorder = 1;
|
||||
}
|
||||
}
|
||||
if (x>=x1) {
|
||||
goto skip;
|
||||
}
|
||||
l = x+1;
|
||||
|
||||
/* leak on left? */
|
||||
if (l<x1) {
|
||||
FILL_PUSH(y, l, x1-1, -dy);
|
||||
}
|
||||
x = x1+1;
|
||||
do {
|
||||
for (; x<=wx2 && gdImageGetPixel(im,x, y)==oc; x++) {
|
||||
gdImageSetPixel(im, x, y, nc);
|
||||
}
|
||||
FILL_PUSH(y, l, x-1, dy);
|
||||
/* leak on right? */
|
||||
if (x>x2+1) {
|
||||
FILL_PUSH(y, x2+1, x-1, -dy);
|
||||
}
|
||||
skip: for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++);
|
||||
|
||||
l = x;
|
||||
} while (x<=x2);
|
||||
}
|
||||
efree(stack);
|
||||
}
|
||||
|
||||
void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc)
|
||||
{
|
||||
int i,l, x1, x2, dy;
|
||||
int oc; /* old pixel value */
|
||||
int tiled;
|
||||
int wx2,wy2;
|
||||
/* stack of filled segments */
|
||||
struct seg *stack;
|
||||
struct seg *sp;
|
||||
|
||||
int **pts;
|
||||
if(!im->tile){
|
||||
return;
|
||||
}
|
||||
|
||||
wx2=im->sx;wy2=im->sy;
|
||||
tiled = nc==gdTiled;
|
||||
|
||||
nc = gdImageTileGet(im,x,y);
|
||||
pts = (int **) ecalloc(sizeof(int *) * im->sy, sizeof(int));
|
||||
|
||||
for (i=0; i<im->sy;i++) {
|
||||
pts[i] = (int *) ecalloc(im->sx, sizeof(int));
|
||||
}
|
||||
|
||||
stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1);
|
||||
sp = stack;
|
||||
|
||||
oc = gdImageGetPixel(im, x, y);
|
||||
|
||||
/* required! */
|
||||
FILL_PUSH(y,x,x,1);
|
||||
/* seed segment (popped 1st) */
|
||||
FILL_PUSH(y+1, x, x, -1);
|
||||
while (sp>stack) {
|
||||
FILL_POP(y, x1, x2, dy);
|
||||
for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); x--) {
|
||||
if (pts[y][x]){
|
||||
/* we should never be here */
|
||||
break;
|
||||
}
|
||||
nc = gdImageTileGet(im,x,y);
|
||||
pts[y][x]=1;
|
||||
gdImageSetPixel(im,x, y, nc);
|
||||
}
|
||||
if (x>=x1) {
|
||||
goto skip;
|
||||
}
|
||||
l = x+1;
|
||||
|
||||
/* leak on left? */
|
||||
if (l<x1) {
|
||||
FILL_PUSH(y, l, x1-1, -dy);
|
||||
}
|
||||
x = x1+1;
|
||||
do {
|
||||
for (; x<=wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc) ; x++) {
|
||||
if (pts[y][x]){
|
||||
/* we should never be here */
|
||||
break;
|
||||
}
|
||||
nc = gdImageTileGet(im,x,y);
|
||||
pts[y][x]=1;
|
||||
gdImageSetPixel(im, x, y, nc);
|
||||
}
|
||||
FILL_PUSH(y, l, x-1, dy);
|
||||
/* leak on right? */
|
||||
if (x>x2+1) {
|
||||
FILL_PUSH(y, x2+1, x-1, -dy);
|
||||
}
|
||||
skip: for (x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, y)!=oc); x++);
|
||||
l = x;
|
||||
} while (x<=x2);
|
||||
}
|
||||
for (i=0; i<im->sy;i++) {
|
||||
efree(pts[i]);
|
||||
}
|
||||
efree(pts);
|
||||
efree(stack);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
|
||||
{
|
||||
int x1h = x1, x1v = x1, y1h = y1, y1v = y1, x2h = x2, x2v = x2, y2h = y2, y2v = y2;
|
||||
@@ -2182,9 +2075,9 @@ void gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int s
|
||||
} else {
|
||||
dc = gdImageGetPixel(dst, tox, toy);
|
||||
|
||||
ncR = (int)(gdImageRed (src, c) * (pct / 100.0) + gdImageRed (dst, dc) * ((100 - pct) / 100.0));
|
||||
ncG = (int)(gdImageGreen (src, c) * (pct / 100.0) + gdImageGreen (dst, dc) * ((100 - pct) / 100.0));
|
||||
ncB = (int)(gdImageBlue (src, c) * (pct / 100.0) + gdImageBlue (dst, dc) * ((100 - pct) / 100.0));
|
||||
ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f));
|
||||
ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f));
|
||||
ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + ((100 - pct) / 100.0f));
|
||||
|
||||
/* Find a reasonable color */
|
||||
nc = gdImageColorResolve (dst, ncR, ncG, ncB);
|
||||
@@ -2266,12 +2159,20 @@ void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
|
||||
sty = (int *) safe_emalloc(sizeof(int), srcH, 0);
|
||||
accum = 0;
|
||||
|
||||
/* Fixed by Mao Morimoto 2.0.16 */
|
||||
for (i = 0; (i < srcW); i++) {
|
||||
stx[i] = dstW * (i+1) / srcW - dstW * i / srcW ;
|
||||
int got;
|
||||
accum += (double) dstW / (double) srcW;
|
||||
got = (int) floor (accum);
|
||||
stx[i] = got;
|
||||
accum -= got;
|
||||
}
|
||||
accum = 0;
|
||||
for (i = 0; (i < srcH); i++) {
|
||||
sty[i] = dstH * (i+1) / srcH - dstH * i / srcH ;
|
||||
int got;
|
||||
accum += (double) dstH / (double) srcH;
|
||||
got = (int) floor (accum);
|
||||
sty[i] = got;
|
||||
accum -= got;
|
||||
}
|
||||
for (i = 0; (i < gdMaxColors); i++) {
|
||||
colorMap[i] = (-1);
|
||||
@@ -2292,8 +2193,7 @@ void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
|
||||
int tmp = gdImageGetPixel (src, x, y);
|
||||
mapTo = gdImageGetTrueColorPixel (src, x, y);
|
||||
if (gdImageGetTransparent (src) == tmp) {
|
||||
/* 2.0.21, TK: not tox++ */
|
||||
tox += stx[x - srcX];
|
||||
tox++;
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
@@ -2301,8 +2201,7 @@ void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
|
||||
mapTo = gdImageGetTrueColorPixel (src, x, y);
|
||||
/* Added 7/24/95: support transparent copies */
|
||||
if (gdImageGetTransparent (src) == mapTo) {
|
||||
/* 2.0.21, TK: not tox++ */
|
||||
tox += stx[x - srcX];
|
||||
tox++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -2358,24 +2257,22 @@ void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int
|
||||
void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
|
||||
{
|
||||
int x, y;
|
||||
double sy1, sy2, sx1, sx2;
|
||||
if (!dst->trueColor) {
|
||||
gdImageCopyResized (dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH);
|
||||
return;
|
||||
}
|
||||
for (y = dstY; (y < dstY + dstH); y++) {
|
||||
sy1 = ((double) y - (double) dstY) * (double) srcH / (double) dstH;
|
||||
sy2 = ((double) (y + 1) - (double) dstY) * (double) srcH / (double) dstH;
|
||||
for (x = dstX; (x < dstX + dstW); x++) {
|
||||
double sx, sy;
|
||||
double spixels = 0;
|
||||
double red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0;
|
||||
double alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0;
|
||||
sx1 = ((double) x - (double) dstX) * (double) srcW / dstW;
|
||||
sx2 = ((double) (x + 1) - (double) dstX) * (double) srcW / dstW;
|
||||
float sy1, sy2, sx1, sx2;
|
||||
float sx, sy;
|
||||
float spixels = 0.0f;
|
||||
float red = 0.0f, green = 0.0f, blue = 0.0f, alpha = 0.0f;
|
||||
float alpha_factor, alpha_sum = 0.0f, contrib_sum = 0.0f;
|
||||
sy1 = ((float)(y - dstY)) * (float)srcH / (float)dstH;
|
||||
sy2 = ((float)(y + 1 - dstY)) * (float) srcH / (float) dstH;
|
||||
sy = sy1;
|
||||
do {
|
||||
double yportion;
|
||||
float yportion;
|
||||
if (floor_cast(sy) == floor_cast(sy1)) {
|
||||
yportion = 1.0f - (sy - floor_cast(sy));
|
||||
if (yportion > sy2 - sy1) {
|
||||
@@ -2387,10 +2284,12 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
|
||||
} else {
|
||||
yportion = 1.0f;
|
||||
}
|
||||
sx1 = ((float)(x - dstX)) * (float) srcW / dstW;
|
||||
sx2 = ((float)(x + 1 - dstX)) * (float) srcW / dstW;
|
||||
sx = sx1;
|
||||
do {
|
||||
double xportion;
|
||||
double pcontribution;
|
||||
float xportion;
|
||||
float pcontribution;
|
||||
int p;
|
||||
if (floorf(sx) == floor_cast(sx1)) {
|
||||
xportion = 1.0f - (sx - floor_cast(sx));
|
||||
@@ -2469,22 +2368,14 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i
|
||||
void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double dWeight, int clrBack)
|
||||
{
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
int i, r, g, b, a, clrBackR, clrBackG, clrBackB, clrBackA;
|
||||
int i, r, g, b, a;
|
||||
FuncPtr f;
|
||||
|
||||
int pxlOldLeft, pxlLeft=0, pxlSrc;
|
||||
|
||||
/* Keep clrBack as color index if required */
|
||||
if (src->trueColor) {
|
||||
pxlOldLeft = clrBack;
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
pxlOldLeft = clrBack;
|
||||
clrBackR = gdImageRed(src, clrBack);
|
||||
clrBackG = gdImageGreen(src, clrBack);
|
||||
clrBackB = gdImageBlue(src, clrBack);
|
||||
clrBackA = gdImageAlpha(src, clrBack);
|
||||
clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
|
||||
@@ -2496,6 +2387,8 @@ void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double
|
||||
gdImageSetPixel (dst, i, uRow, clrBack);
|
||||
}
|
||||
|
||||
pxlOldLeft = clrBack;
|
||||
|
||||
for (i = 0; i < src->sx; i++) {
|
||||
pxlSrc = f (src,i,uRow);
|
||||
|
||||
@@ -2505,30 +2398,30 @@ void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double
|
||||
a = (int)(gdImageAlpha(src,pxlSrc) * dWeight);
|
||||
|
||||
pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a);
|
||||
|
||||
|
||||
if (pxlLeft == -1) {
|
||||
pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a);
|
||||
}
|
||||
|
||||
|
||||
r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft));
|
||||
g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft));
|
||||
b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft));
|
||||
a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft));
|
||||
|
||||
if (r>255) {
|
||||
r = 255;
|
||||
}
|
||||
|
||||
if (r>255) {
|
||||
r = 255;
|
||||
}
|
||||
|
||||
if (g>255) {
|
||||
g = 255;
|
||||
}
|
||||
|
||||
if (b>255) {
|
||||
b = 255;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(b>255) {
|
||||
b = 255;
|
||||
}
|
||||
|
||||
if (a>127) {
|
||||
a = 127;
|
||||
b = 127;
|
||||
}
|
||||
|
||||
pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
|
||||
@@ -2545,7 +2438,7 @@ void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double
|
||||
}
|
||||
|
||||
i += iOffset;
|
||||
|
||||
|
||||
if (i < dst->sx) {
|
||||
gdImageSetPixel (dst, i, uRow, pxlLeft);
|
||||
}
|
||||
@@ -2572,50 +2465,46 @@ void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
|
||||
for (i = 0; i<=iOffset; i++) {
|
||||
for (i = 0; i<iOffset; i++) {
|
||||
gdImageSetPixel (dst, uCol, i, clrBack);
|
||||
}
|
||||
r = (int)((double)gdImageRed(src,clrBack) * dWeight);
|
||||
g = (int)((double)gdImageGreen(src,clrBack) * dWeight);
|
||||
b = (int)((double)gdImageBlue(src,clrBack) * dWeight);
|
||||
a = (int)((double)gdImageAlpha(src,clrBack) * dWeight);
|
||||
|
||||
pxlOldLeft = gdImageColorAllocateAlpha(dst, r, g, b, a);
|
||||
pxlOldLeft = clrBack;
|
||||
|
||||
for (i = 0; i < src->sy; i++) {
|
||||
pxlSrc = f (src, uCol, i);
|
||||
iYPos = i + iOffset;
|
||||
|
||||
r = (int)((double)gdImageRed(src,pxlSrc) * dWeight);
|
||||
g = (int)((double)gdImageGreen(src,pxlSrc) * dWeight);
|
||||
b = (int)((double)gdImageBlue(src,pxlSrc) * dWeight);
|
||||
a = (int)((double)gdImageAlpha(src,pxlSrc) * dWeight);
|
||||
|
||||
r = (int)(gdImageRed(src,pxlSrc) * dWeight);
|
||||
g = (int)(gdImageGreen(src,pxlSrc) * dWeight);
|
||||
b = (int)(gdImageBlue(src,pxlSrc) * dWeight);
|
||||
a = (int)(gdImageAlpha(src,pxlSrc) * dWeight);
|
||||
|
||||
pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a);
|
||||
|
||||
|
||||
if (pxlLeft == -1) {
|
||||
pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a);
|
||||
}
|
||||
|
||||
r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft));
|
||||
r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft));
|
||||
g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft));
|
||||
b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft));
|
||||
a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft));
|
||||
|
||||
|
||||
if (r>255) {
|
||||
r = 255;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (g>255) {
|
||||
g = 255;
|
||||
}
|
||||
|
||||
if (b>255) {
|
||||
b = 255;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(b>255) {
|
||||
b = 255;
|
||||
}
|
||||
|
||||
if (a>127) {
|
||||
a = 127;
|
||||
b = 127;
|
||||
}
|
||||
|
||||
pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a);
|
||||
@@ -2627,7 +2516,7 @@ void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double
|
||||
if ((iYPos >= 0) && (iYPos < dst->sy)) {
|
||||
gdImageSetPixel (dst, uCol, iYPos, pxlSrc);
|
||||
}
|
||||
|
||||
|
||||
pxlOldLeft = pxlLeft;
|
||||
}
|
||||
|
||||
@@ -2646,36 +2535,30 @@ void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double
|
||||
gdImagePtr gdImageRotate90 (gdImagePtr src)
|
||||
{
|
||||
int uY, uX;
|
||||
int c, r,g,b,a;
|
||||
int c;
|
||||
gdImagePtr dst;
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
FuncPtr f;
|
||||
|
||||
if (src->trueColor) {
|
||||
dst = gdImageCreateTrueColor(src->sy, src->sx);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst = gdImageCreate (src->sy, src->sx);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst = gdImageCreateTrueColor(src->sy, src->sx);
|
||||
|
||||
if (dst != NULL) {
|
||||
gdImagePaletteCopy (dst, src);
|
||||
|
||||
|
||||
for (uY = 0; uY<src->sy; uY++) {
|
||||
for (uX = 0; uX<src->sx; uX++) {
|
||||
c = f (src, uX, uY);
|
||||
if (!src->trueColor) {
|
||||
r = gdImageRed(src,c);
|
||||
g = gdImageGreen(src,c);
|
||||
b = gdImageBlue(src,c);
|
||||
a = gdImageAlpha(src,c);
|
||||
c = gdTrueColorAlpha(r, g, b, a);
|
||||
}
|
||||
gdImageSetPixel(dst, uY, (dst->sy - uX - 1), c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
@@ -2683,31 +2566,25 @@ gdImagePtr gdImageRotate90 (gdImagePtr src)
|
||||
gdImagePtr gdImageRotate180 (gdImagePtr src)
|
||||
{
|
||||
int uY, uX;
|
||||
int c,r,g,b,a;
|
||||
int c;
|
||||
gdImagePtr dst;
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
FuncPtr f;
|
||||
|
||||
if (src->trueColor) {
|
||||
dst = gdImageCreateTrueColor ( src->sx,src->sy);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst = gdImageCreate (src->sx, src->sy);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst = gdImageCreateTrueColor(src->sx, src->sy);
|
||||
|
||||
if (dst != NULL) {
|
||||
gdImagePaletteCopy (dst, src);
|
||||
|
||||
|
||||
for (uY = 0; uY<src->sy; uY++) {
|
||||
for (uX = 0; uX<src->sx; uX++) {
|
||||
c = f (src, uX, uY);
|
||||
if (!src->trueColor) {
|
||||
r = gdImageRed(src,c);
|
||||
g = gdImageGreen(src,c);
|
||||
b = gdImageBlue(src,c);
|
||||
a = gdImageAlpha(src,c);
|
||||
c = gdTrueColorAlpha(r, g, b, a);
|
||||
}
|
||||
gdImageSetPixel(dst, (dst->sx - uX - 1), (dst->sy - uY - 1), c);
|
||||
}
|
||||
}
|
||||
@@ -2720,36 +2597,30 @@ gdImagePtr gdImageRotate180 (gdImagePtr src)
|
||||
gdImagePtr gdImageRotate270 ( gdImagePtr src )
|
||||
{
|
||||
int uY, uX;
|
||||
int c,r,g,b,a;
|
||||
int c;
|
||||
gdImagePtr dst;
|
||||
typedef int (*FuncPtr)(gdImagePtr, int, int);
|
||||
FuncPtr f;
|
||||
|
||||
if (src->trueColor) {
|
||||
dst = gdImageCreateTrueColor (src->sy, src->sx);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst = gdImageCreate (src->sy, src->sx);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst = gdImageCreateTrueColor(src->sy, src->sx);
|
||||
|
||||
if (dst != NULL) {
|
||||
gdImagePaletteCopy (dst, src);
|
||||
|
||||
|
||||
for (uY = 0; uY<src->sy; uY++) {
|
||||
for (uX = 0; uX<src->sx; uX++) {
|
||||
c = f (src, uX, uY);
|
||||
if (!src->trueColor) {
|
||||
r = gdImageRed(src,c);
|
||||
g = gdImageGreen(src,c);
|
||||
b = gdImageBlue(src,c);
|
||||
a = gdImageAlpha(src,c);
|
||||
c = gdTrueColorAlpha(r, g, b, a);
|
||||
}
|
||||
gdImageSetPixel(dst, (dst->sx - uY - 1), uX, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
@@ -2761,7 +2632,6 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
double dRadAngle, dSinE, dTan, dShear;
|
||||
double dOffset; /* Variable skew offset */
|
||||
int u, iShear, newx, newy;
|
||||
int clrBackR, clrBackG, clrBackB, clrBackA;
|
||||
|
||||
/* See GEMS I for the algorithm details */
|
||||
dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
|
||||
@@ -2773,26 +2643,25 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
|
||||
/* 1st shear */
|
||||
if (src->trueColor) {
|
||||
dst1 = gdImageCreateTrueColor (newx, newy);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst1 = gdImageCreate (newx, newy);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst1 = gdImageCreateTrueColor(newx, newy);
|
||||
|
||||
/******* Perform 1st shear (horizontal) ******/
|
||||
if (dst1 == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
dst1->alphaBlendingFlag = gdEffectReplace;
|
||||
|
||||
if (dAngle == 0.0) {
|
||||
/* Returns copy of src */
|
||||
gdImageCopy (dst1, src,0,0,0,0,src->sx,src->sy);
|
||||
return dst1;
|
||||
}
|
||||
|
||||
|
||||
gdImagePaletteCopy (dst1, src);
|
||||
|
||||
dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */
|
||||
dSinE = sin (dRadAngle);
|
||||
dTan = tan (dRadAngle / 2.0);
|
||||
@@ -2805,46 +2674,37 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
}
|
||||
|
||||
iShear = (int)floor(dShear);
|
||||
|
||||
gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack);
|
||||
}
|
||||
|
||||
/*
|
||||
The 1st shear may use the original clrBack as color index
|
||||
Convert it once here
|
||||
*/
|
||||
if(!src->trueColor) {
|
||||
clrBackR = gdImageRed(src, clrBack);
|
||||
clrBackG = gdImageGreen(src, clrBack);
|
||||
clrBackB = gdImageBlue(src, clrBack);
|
||||
clrBackA = gdImageAlpha(src, clrBack);
|
||||
clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA);
|
||||
}
|
||||
/* 2nd shear */
|
||||
newx = dst1->sx;
|
||||
|
||||
|
||||
if (dSinE > 0.0) {
|
||||
dOffset = (src->sx-1) * dSinE;
|
||||
dOffset = (src->sx ) * dSinE;
|
||||
} else {
|
||||
dOffset = -dSinE * (src->sx - newx);
|
||||
}
|
||||
|
||||
newy = (int) ((double) src->sx * fabs( dSinE ) + (double) src->sy * cos (dRadAngle))+1;
|
||||
newy = (int) ((double) src->sx * fabs( dSinE ) + (double) src->sy * cos (dRadAngle));
|
||||
|
||||
if (src->trueColor) {
|
||||
dst2 = gdImageCreateTrueColor (newx, newy);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst2 = gdImageCreate (newx, newy);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst2 = gdImageCreateTrueColor(newx, newy);
|
||||
|
||||
if (dst2 == NULL) {
|
||||
gdImageDestroy(dst1);
|
||||
return NULL;
|
||||
}
|
||||
dst2->alphaBlendingFlag = gdEffectReplace;
|
||||
|
||||
|
||||
for (u = 0; u < dst2->sx; u++, dOffset -= dSinE) {
|
||||
iShear = (int)floor (dOffset);
|
||||
gdImageSkewY(dst2, dst1, u, iShear, (dOffset - (double)iShear), clrBack);
|
||||
gdImageSkewY(dst2, dst1, u, iShear, (dOffset - iShear), clrBack);
|
||||
}
|
||||
|
||||
/* 3rd shear */
|
||||
@@ -2852,13 +2712,15 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
|
||||
newx = (int) ((double)src->sy * fabs (dSinE) + (double)src->sx * cos (dRadAngle)) + 1;
|
||||
newy = dst2->sy;
|
||||
|
||||
|
||||
if (src->trueColor) {
|
||||
dst3 = gdImageCreateTrueColor (newx, newy);
|
||||
f = gdImageGetTrueColorPixel;
|
||||
} else {
|
||||
dst3 = gdImageCreate (newx, newy);
|
||||
f = gdImageGetPixel;
|
||||
}
|
||||
dst3 = gdImageCreateTrueColor(newx, newy);
|
||||
|
||||
if (dst3 == NULL) {
|
||||
gdImageDestroy(dst2);
|
||||
return NULL;
|
||||
@@ -2875,7 +2737,7 @@ gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack)
|
||||
}
|
||||
|
||||
gdImageDestroy(dst2);
|
||||
|
||||
|
||||
return dst3;
|
||||
}
|
||||
|
||||
@@ -2883,12 +2745,8 @@ gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack)
|
||||
{
|
||||
gdImagePtr pMidImg;
|
||||
gdImagePtr rotatedImg;
|
||||
int r,g,b,a;
|
||||
if (src == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!gdImageTrueColor(src) && clrBack>=gdImageColorsTotal(src)) {
|
||||
if (src == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -2899,7 +2757,7 @@ gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack)
|
||||
while (dAngle < 0) {
|
||||
dAngle += 360.0;
|
||||
}
|
||||
|
||||
|
||||
if (dAngle == 90.00) {
|
||||
return gdImageRotate90(src);
|
||||
}
|
||||
@@ -2922,22 +2780,14 @@ gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack)
|
||||
} else {
|
||||
return gdImageRotate45 (src, dAngle, clrBack);
|
||||
}
|
||||
|
||||
|
||||
if (pMidImg == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(!src->trueColor) {
|
||||
r = gdImageRed(src, clrBack);
|
||||
g = gdImageGreen(src, clrBack);
|
||||
b = gdImageBlue(src, clrBack);
|
||||
a = gdImageAlpha(src, clrBack);
|
||||
clrBack = gdTrueColorAlpha(r,g,b,a);
|
||||
}
|
||||
|
||||
|
||||
rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack);
|
||||
gdImageDestroy(pMidImg);
|
||||
|
||||
|
||||
return rotatedImg;
|
||||
}
|
||||
/* End Rotate function */
|
||||
@@ -3032,15 +2882,6 @@ void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c)
|
||||
maxy = p[i].y;
|
||||
}
|
||||
}
|
||||
|
||||
/* 2.0.16: Optimization by Ilia Chipitsine -- don't waste time offscreen */
|
||||
if (miny < 0) {
|
||||
miny = 0;
|
||||
}
|
||||
if (maxy >= gdImageSY(im)) {
|
||||
maxy = gdImageSY(im) - 1;
|
||||
}
|
||||
|
||||
/* Fix in 1.3: count a vertex only once */
|
||||
for (y = miny; y <= maxy; y++) {
|
||||
/*1.4 int interLast = 0; */
|
||||
|
||||
+2
-11
@@ -294,16 +294,8 @@ void gdImageStringUp(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s,
|
||||
void gdImageString16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color);
|
||||
void gdImageStringUp16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color);
|
||||
|
||||
/* 2.0.16: for thread-safe use of gdImageStringFT and friends,
|
||||
* call this before allowing any thread to call gdImageStringFT.
|
||||
* Otherwise it is invoked by the first thread to invoke
|
||||
* gdImageStringFT, with a very small but real risk of a race condition.
|
||||
* Return 0 on success, nonzero on failure to initialize freetype.
|
||||
*/
|
||||
int gdFontCacheSetup(void);
|
||||
|
||||
/* Optional: clean up after application is done using fonts in gdImageStringFT(). */
|
||||
void gdFontCacheShutdown(void);
|
||||
/* clean up after using fonts in gdImageStringFT() */
|
||||
void gdFreeFontCache();
|
||||
|
||||
/* Calls gdImageStringFT. Provided for backwards compatibility only. */
|
||||
char *gdImageStringTTF(gdImage *im, int *brect, int fg, char *fontlist,
|
||||
@@ -578,7 +570,6 @@ void gdImageSaveAlpha(gdImagePtr im, int saveAlphaArg);
|
||||
|
||||
gdIOCtx* gdNewFileCtx(FILE*);
|
||||
gdIOCtx* gdNewDynamicCtx(int, void*);
|
||||
gdIOCtx *gdNewDynamicCtxEx(int size, void *data, int freeFlag);
|
||||
gdIOCtx* gdNewSSCtx(gdSourcePtr in, gdSinkPtr out);
|
||||
void* gdDPExtractData(struct gdIOCtx* ctx, int *size);
|
||||
|
||||
|
||||
@@ -147,16 +147,6 @@ gdImagePtr gdImageCreateFromGd (FILE * inFile)
|
||||
return im;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageCreateFromGdPtr (int size, void *data)
|
||||
{
|
||||
gdImagePtr im;
|
||||
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
|
||||
im = gdImageCreateFromGdCtx(in);
|
||||
in->gd_free(in);
|
||||
|
||||
return im;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageCreateFromGdCtx (gdIOCtxPtr in)
|
||||
{
|
||||
int sx, sy;
|
||||
|
||||
+1
-21
@@ -237,16 +237,6 @@ gdImagePtr gdImageCreateFromGd2 (FILE * inFile)
|
||||
return im;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageCreateFromGd2Ptr (int size, void *data)
|
||||
{
|
||||
gdImagePtr im;
|
||||
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
|
||||
im = gdImageCreateFromGd2Ctx(in);
|
||||
in->gd_free(in);
|
||||
|
||||
return im;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
|
||||
{
|
||||
int sx, sy;
|
||||
@@ -388,16 +378,6 @@ fail2:
|
||||
return 0;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy, int w, int h)
|
||||
{
|
||||
gdImagePtr im;
|
||||
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
|
||||
im = gdImageCreateFromGd2PartCtx(in, srcx, srcy, w, h);
|
||||
in->gd_free(in);
|
||||
|
||||
return im;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageCreateFromGd2Part (FILE * inFile, int srcx, int srcy, int w, int h)
|
||||
{
|
||||
gdImagePtr im;
|
||||
@@ -560,7 +540,7 @@ gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w,
|
||||
}
|
||||
} else {
|
||||
ch = gdGetC(in);
|
||||
if ((int)ch == EOF) {
|
||||
if (ch == EOF) {
|
||||
ch = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* io.c
|
||||
*
|
||||
* Implements the simple I/O 'helper' routines.
|
||||
* Implements the imple I/O 'helper' routines.
|
||||
*
|
||||
* Not really essential, but these routines were used extensively in GD,
|
||||
* so they were moved here. They also make IOCtx calls look better...
|
||||
|
||||
+6
-24
@@ -33,7 +33,6 @@ typedef struct dpStruct
|
||||
int realSize;
|
||||
int dataGood;
|
||||
int pos;
|
||||
int freeOK;
|
||||
}
|
||||
dynamicPtr;
|
||||
|
||||
@@ -53,7 +52,7 @@ static int appendDynamic (dynamicPtr * dp, const void *src, int size);
|
||||
static int gdReallocDynamic (dynamicPtr * dp, int required);
|
||||
static int trimDynamic (dynamicPtr * dp);
|
||||
static void gdFreeDynamicCtx (struct gdIOCtx *ctx);
|
||||
static dynamicPtr *newDynamic (int initialSize, void *data, int freeOKFlag);
|
||||
static dynamicPtr *newDynamic (int initialSize, void *data);
|
||||
|
||||
static int dynamicPutbuf (struct gdIOCtx *, const void *, int);
|
||||
static void dynamicPutchar (struct gdIOCtx *, int a);
|
||||
@@ -67,11 +66,6 @@ static long dynamicTell (struct gdIOCtx *);
|
||||
/* return data as a dynamic pointer */
|
||||
gdIOCtx *
|
||||
gdNewDynamicCtx (int initialSize, void *data)
|
||||
{
|
||||
return gdNewDynamicCtxEx(initialSize, data, 1);
|
||||
}
|
||||
|
||||
gdIOCtx * gdNewDynamicCtxEx (int initialSize, void *data, int freeOKFlag)
|
||||
{
|
||||
dpIOCtx *ctx;
|
||||
dynamicPtr *dp;
|
||||
@@ -82,7 +76,7 @@ gdIOCtx * gdNewDynamicCtxEx (int initialSize, void *data, int freeOKFlag)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dp = newDynamic (initialSize, data, freeOKFlag);
|
||||
dp = newDynamic (initialSize, data);
|
||||
if (!dp)
|
||||
{
|
||||
gdFree (ctx);
|
||||
@@ -126,7 +120,7 @@ gdDPExtractData (struct gdIOCtx *ctx, int *size)
|
||||
{
|
||||
*size = 0;
|
||||
data = NULL;
|
||||
if (dp->data != NULL && dp->freeOK)
|
||||
if (dp->data != NULL)
|
||||
{
|
||||
gdFree (dp->data);
|
||||
}
|
||||
@@ -183,10 +177,6 @@ dynamicSeek (struct gdIOCtx *ctx, const int pos)
|
||||
bytesNeeded = pos;
|
||||
if (bytesNeeded > dp->realSize)
|
||||
{
|
||||
/* 2.0.21 */
|
||||
if (!dp->freeOK) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!gdReallocDynamic (dp, dp->realSize * 2))
|
||||
{
|
||||
dp->dataGood = FALSE;
|
||||
@@ -209,7 +199,8 @@ dynamicSeek (struct gdIOCtx *ctx, const int pos)
|
||||
}
|
||||
|
||||
/* return data as a dynamic pointer */
|
||||
static dynamicPtr * newDynamic (int initialSize, void *data, int freeOKFlag)
|
||||
static dynamicPtr *
|
||||
newDynamic (int initialSize, void *data)
|
||||
{
|
||||
dynamicPtr *dp;
|
||||
dp = (dynamicPtr *) gdMalloc (sizeof (dynamicPtr));
|
||||
@@ -222,7 +213,6 @@ static dynamicPtr * newDynamic (int initialSize, void *data, int freeOKFlag)
|
||||
return NULL;
|
||||
|
||||
dp->pos = 0;
|
||||
dp->freeOK = freeOKFlag;
|
||||
|
||||
return dp;
|
||||
}
|
||||
@@ -358,10 +348,6 @@ appendDynamic (dynamicPtr * dp, const void *src, int size)
|
||||
|
||||
if (bytesNeeded > dp->realSize)
|
||||
{
|
||||
/* 2.0.21 */
|
||||
if (!dp->freeOK) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!gdReallocDynamic (dp, bytesNeeded * 2))
|
||||
{
|
||||
dp->dataGood = FALSE;
|
||||
@@ -421,9 +407,5 @@ gdReallocDynamic (dynamicPtr * dp, int required)
|
||||
static int
|
||||
trimDynamic (dynamicPtr * dp)
|
||||
{
|
||||
/* 2.0.21: we don't reallocate memory we don't own */
|
||||
if (!dp->freeOK) {
|
||||
return FALSE;
|
||||
}
|
||||
return gdReallocDynamic (dp, dp->logicalSize);
|
||||
return gdReallocDynamic (dp, dp->logicalSize);
|
||||
}
|
||||
@@ -35,6 +35,8 @@ typedef struct fileIOCtx
|
||||
}
|
||||
fileIOCtx;
|
||||
|
||||
struct fileIOCtx *fileIOCtxPtr;
|
||||
|
||||
gdIOCtx *newFileCtx (FILE * f);
|
||||
|
||||
static int fileGetbuf (gdIOCtx *, void *, int);
|
||||
|
||||
+17
-92
@@ -221,20 +221,8 @@ gdImagePtr gdImageCreateFromJpeg (FILE * inFile)
|
||||
return im;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageCreateFromJpegPtr (int size, void *data)
|
||||
{
|
||||
gdImagePtr im;
|
||||
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
|
||||
im = gdImageCreateFromJpegCtx(in);
|
||||
in->gd_free(in);
|
||||
|
||||
return im;
|
||||
}
|
||||
|
||||
void jpeg_gdIOCtx_src (j_decompress_ptr cinfo, gdIOCtx * infile);
|
||||
|
||||
static int CMYKToRGB(int c, int m, int y, int k, int inverted);
|
||||
|
||||
/*
|
||||
* Create a gd-format image from the JPEG-format INFILE. Returns the
|
||||
* image, or NULL upon error.
|
||||
@@ -251,8 +239,6 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
|
||||
unsigned int i, j;
|
||||
int retval;
|
||||
JDIMENSION nrows;
|
||||
int channels = 3;
|
||||
int inverted = 0;
|
||||
|
||||
memset (&cinfo, 0, sizeof (cinfo));
|
||||
memset (&jerr, 0, sizeof (jerr));
|
||||
@@ -276,9 +262,6 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
|
||||
|
||||
jpeg_gdIOCtx_src (&cinfo, infile);
|
||||
|
||||
/* 2.0.22: save the APP14 marker to check for Adobe Photoshop CMYK files with inverted components. */
|
||||
jpeg_save_markers(&cinfo, JPEG_APP0 + 14, 256);
|
||||
|
||||
retval = jpeg_read_header (&cinfo, TRUE);
|
||||
if (retval != JPEG_HEADER_OK) {
|
||||
php_gd_error_ex(E_WARNING, "gd-jpeg: warning: jpeg_read_header returned %d, expected %d", retval, JPEG_HEADER_OK);
|
||||
@@ -298,14 +281,8 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* 2.0.22: very basic support for reading CMYK colorspace files. Nice for
|
||||
* thumbnails but there's no support for fussy adjustment of the
|
||||
* assumed properties of inks and paper. */
|
||||
if ((cinfo.jpeg_color_space == JCS_CMYK) || (cinfo.jpeg_color_space == JCS_YCCK)) {
|
||||
cinfo.out_color_space = JCS_CMYK;
|
||||
} else {
|
||||
cinfo.out_color_space = JCS_RGB;
|
||||
}
|
||||
/* Force the image into RGB colorspace, but don't reduce the number of colors anymore (GD 2.0) */
|
||||
cinfo.out_color_space = JCS_RGB;
|
||||
|
||||
if (jpeg_start_decompress (&cinfo) != TRUE) {
|
||||
php_gd_error("gd-jpeg: warning: jpeg_start_decompress reports suspended data source");
|
||||
@@ -324,29 +301,8 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
|
||||
gdImageInterlace (im, cinfo.progressive_mode != 0);
|
||||
#endif
|
||||
|
||||
if (cinfo.out_color_space == JCS_RGB) {
|
||||
if (cinfo.output_components != 3) {
|
||||
php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 3 for RGB)", cinfo.output_components);
|
||||
goto error;
|
||||
}
|
||||
channels = 3;
|
||||
} else if (cinfo.out_color_space == JCS_CMYK) {
|
||||
jpeg_saved_marker_ptr marker;
|
||||
if (cinfo.output_components != 4) {
|
||||
php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 4 for CMYK)", cinfo.output_components);
|
||||
goto error;
|
||||
}
|
||||
channels = 4;
|
||||
marker = cinfo.marker_list;
|
||||
while (marker) {
|
||||
if ((marker->marker == (JPEG_APP0 + 14)) && (marker->data_length >= 12) && (!strncmp((const char *) marker->data, "Adobe", 5))) {
|
||||
inverted = 1;
|
||||
break;
|
||||
}
|
||||
marker = marker->next;
|
||||
}
|
||||
} else {
|
||||
php_gd_error_ex(E_WARNING, "gd-jpeg: error: unexpected colorspace.");
|
||||
if (cinfo.output_components != 3) {
|
||||
php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 3)", cinfo.output_components);
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -355,47 +311,27 @@ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile)
|
||||
goto error;
|
||||
#endif /* BITS_IN_JSAMPLE == 12 */
|
||||
|
||||
row = safe_emalloc(cinfo.output_width * channels, sizeof(JSAMPLE), 0);
|
||||
memset(row, 0, cinfo.output_width * channels * sizeof(JSAMPLE));
|
||||
row = safe_emalloc(cinfo.output_width * 3, sizeof(JSAMPLE), 0);
|
||||
memset(row, 0, cinfo.output_width * 3 * sizeof(JSAMPLE));
|
||||
rowptr[0] = row;
|
||||
|
||||
if (cinfo.out_color_space == JCS_CMYK) {
|
||||
for (i = 0; i < cinfo.output_height; i++) {
|
||||
register JSAMPROW currow = row;
|
||||
register int *tpix = im->tpixels[i];
|
||||
nrows = jpeg_read_scanlines (&cinfo, rowptr, 1);
|
||||
if (nrows != 1) {
|
||||
php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows);
|
||||
goto error;
|
||||
}
|
||||
for (j = 0; j < cinfo.output_width; j++, currow += 4, tpix++) {
|
||||
*tpix = CMYKToRGB (currow[0], currow[1], currow[2], currow[3], inverted);
|
||||
}
|
||||
for (i = 0; i < cinfo.output_height; i++) {
|
||||
register JSAMPROW currow = row;
|
||||
register int *tpix = im->tpixels[i];
|
||||
nrows = jpeg_read_scanlines (&cinfo, rowptr, 1);
|
||||
if (nrows != 1) {
|
||||
php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows);
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < cinfo.output_height; i++) {
|
||||
register JSAMPROW currow = row;
|
||||
register int *tpix = im->tpixels[i];
|
||||
nrows = jpeg_read_scanlines (&cinfo, rowptr, 1);
|
||||
if (nrows != 1) {
|
||||
php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows);
|
||||
goto error;
|
||||
}
|
||||
for (j = 0; j < cinfo.output_width; j++, currow += 3, tpix++) {
|
||||
*tpix = gdTrueColor (currow[0], currow[1], currow[2]);
|
||||
}
|
||||
for (j = 0; j < cinfo.output_width; j++, currow += 3, tpix++) {
|
||||
*tpix = gdTrueColor (currow[0], currow[1], currow[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (jpeg_finish_decompress (&cinfo) != TRUE) {
|
||||
php_gd_error("gd-jpeg: warning: jpeg_finish_decompress reports suspended data source");
|
||||
}
|
||||
|
||||
/* Thanks to Truxton Fulton */
|
||||
if (cinfo.err->num_warnings > 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
jpeg_destroy_decompress (&cinfo);
|
||||
gdFree (row);
|
||||
|
||||
@@ -412,19 +348,8 @@ error:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* A very basic conversion approach, TBB */
|
||||
static int CMYKToRGB(int c, int m, int y, int k, int inverted)
|
||||
{
|
||||
if (inverted) {
|
||||
c = 255 - c;
|
||||
m = 255 - m;
|
||||
y = 255 - y;
|
||||
k = 255 - k;
|
||||
}
|
||||
return gdTrueColor((255 - c) * (255 - k) / 255, (255 - m) * (255 - k) / 255, (255 - y) * (255 - k) / 255);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
* gdIOCtx JPEG data sources and sinks, T. Boutell
|
||||
* almost a simple global replace from T. Lane's stdio versions.
|
||||
*
|
||||
|
||||
+9
-28
@@ -93,14 +93,6 @@ gdImagePtr gdImageCreateFromPng (FILE * inFile)
|
||||
return im;
|
||||
}
|
||||
|
||||
gdImagePtr gdImageCreateFromPngPtr (int size, void *data)
|
||||
{
|
||||
gdImagePtr im;
|
||||
gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
|
||||
im = gdImageCreateFromPngCtx(in);
|
||||
in->gd_free(in);
|
||||
return im;
|
||||
}
|
||||
|
||||
/* This routine is based in part on the Chapter 13 demo code in "PNG: The
|
||||
* Definitive Guide" (http://www.cdrom.com/pub/png/pngbook.html).
|
||||
@@ -630,39 +622,28 @@ void gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level)
|
||||
*/
|
||||
|
||||
if (im->trueColor) {
|
||||
/* performance optimizations by Phong Tran */
|
||||
int channels = im->saveAlphaFlag ? 4 : 3;
|
||||
/* Our little 7-bit alpha channel trick costs us a bit here. */
|
||||
png_bytep *row_pointers;
|
||||
unsigned char* pOutputRow;
|
||||
int **ptpixels = im->tpixels;
|
||||
int *pThisRow;
|
||||
unsigned char a;
|
||||
int thisPixel;
|
||||
png_bytep *prow_pointers;
|
||||
int saveAlphaFlag = im->saveAlphaFlag;
|
||||
|
||||
row_pointers = safe_emalloc(sizeof(png_bytep), height, 0);
|
||||
prow_pointers = row_pointers;
|
||||
for (j = 0; j < height; ++j) {
|
||||
*prow_pointers = (png_bytep) safe_emalloc(width, channels, 0);
|
||||
pOutputRow = *prow_pointers++;
|
||||
pThisRow = *ptpixels++;
|
||||
int bo = 0;
|
||||
row_pointers[j] = (png_bytep) safe_emalloc(width, channels, 0);
|
||||
for (i = 0; i < width; ++i) {
|
||||
thisPixel = *pThisRow++;
|
||||
*pOutputRow++ = gdTrueColorGetRed(thisPixel);
|
||||
*pOutputRow++ = gdTrueColorGetGreen(thisPixel);
|
||||
*pOutputRow++ = gdTrueColorGetBlue(thisPixel);
|
||||
if (saveAlphaFlag) {
|
||||
unsigned char a;
|
||||
row_pointers[j][bo++] = gdTrueColorGetRed(im->tpixels[j][i]);
|
||||
row_pointers[j][bo++] = gdTrueColorGetGreen(im->tpixels[j][i]);
|
||||
row_pointers[j][bo++] = gdTrueColorGetBlue(im->tpixels[j][i]);
|
||||
if (im->saveAlphaFlag) {
|
||||
/* convert the 7-bit alpha channel to an 8-bit alpha channel.
|
||||
* We do a little bit-flipping magic, repeating the MSB
|
||||
* as the LSB, to ensure that 0 maps to 0 and
|
||||
* 127 maps to 255. We also have to invert to match
|
||||
* PNG's convention in which 255 is opaque.
|
||||
*/
|
||||
a = gdTrueColorGetAlpha(thisPixel);
|
||||
a = gdTrueColorGetAlpha(im->tpixels[j][i]);
|
||||
/* Andrew Hull: >> 6, not >> 7! (gd 2.0.5) */
|
||||
*pOutputRow++ = 255 - ((a << 1) + (a >> 6));
|
||||
row_pointers[j][bo++] = 255 - ((a << 1) + (a >> 6));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loaded 100 of 880 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user