Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/standard/basic_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@
* @cvalue IMAGE_FILETYPE_JB2
*/
const IMAGETYPE_JB2 = UNKNOWN;
#if (defined(HAVE_ZLIB) && !defined(COMPILE_DL_ZLIB))
#ifdef PHP_HAVE_ZLIB_LIBRARY
/**
* @var int
* @cvalue IMAGE_FILETYPE_SWC
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/basic_functions_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ AS_VAR_IF([php_cv_func_getifaddrs], [yes],
[AC_DEFINE([HAVE_GETIFADDRS], [1],
[Define to 1 if you have the 'getifaddrs' function.])])

dnl Optionally check for zlib (needed for SWC files support in PHP).
PHP_SETUP_ZLIB([], [AC_DEFINE([PHP_HAVE_ZLIB_LIBRARY], [1],
[Define to 1 if the system has the zlib library.])],
[:])

dnl
dnl Setup extension sources
dnl
Expand Down
7 changes: 7 additions & 0 deletions ext/standard/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ AC_DEFINE("PHP_USE_PHP_CRYPT_R", 1, "Define to 1 if PHP uses its own crypt_r, an

CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_STANDARD", "ext/date/lib");

// Optionally check for zlib (needed for SWC files support in PHP).
if (SETUP_ZLIB_LIB(null, PHP_ZLIB) &&
CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS_STANDARD", "..\\zlib;" + php_usual_include_suspects)
) {
AC_DEFINE("PHP_HAVE_ZLIB_LIBRARY", 1, "ZLIB support");
}

ADD_FLAG("LIBS_STANDARD", "iphlpapi.lib");

EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
Expand Down
8 changes: 4 additions & 4 deletions ext/standard/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#endif
#include "php_image.h"

#if defined(HAVE_ZLIB) && !defined(COMPILE_DL_ZLIB)
#ifdef PHP_HAVE_ZLIB_LIBRARY
#include "zlib.h"
#endif

Expand Down Expand Up @@ -154,7 +154,7 @@ static unsigned long int php_swf_get_bits (unsigned char* buffer, unsigned int p
}
/* }}} */

#if defined(HAVE_ZLIB) && !defined(COMPILE_DL_ZLIB)
#ifdef PHP_HAVE_ZLIB_LIBRARY
/* {{{ php_handle_swc */
static struct php_gfxinfo *php_handle_swc(php_stream * stream)
{
Expand Down Expand Up @@ -1503,10 +1503,10 @@ static void php_getimagesize_from_stream(php_stream *stream, char *input, zval *
break;
case IMAGE_FILETYPE_SWC:
/* TODO: with the new php_image_register_handler() APIs, this restriction could be solved */
#if defined(HAVE_ZLIB) && !defined(COMPILE_DL_ZLIB)
#ifdef PHP_HAVE_ZLIB_LIBRARY
result = php_handle_swc(stream);
#else
php_error_docref(NULL, E_NOTICE, "The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled");
php_error_docref(NULL, E_NOTICE, "The image is a compressed SWF file, but PHP was compiled without zlib support");
#endif
break;
case IMAGE_FILETYPE_PSD:
Expand Down
2 changes: 0 additions & 2 deletions ext/standard/tests/image/getimagesize_swc.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
--TEST--
GetImageSize() for compressed swf files
--EXTENSIONS--
zlib
--SKIPIF--
<?php
if (!defined("IMAGETYPE_SWC")) {
Expand Down
2 changes: 0 additions & 2 deletions ext/standard/tests/image/getimagesize_variation4.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
--TEST--
Test getimagesize() function : variation - For shockwave-flash format
--EXTENSIONS--
zlib
--SKIPIF--
<?php
if (!defined("IMAGETYPE_SWC")) {
Expand Down
2 changes: 0 additions & 2 deletions ext/standard/tests/image/getimagesize_variation_005.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
--TEST--
Test getimagesize() function : basic functionality for shockwave-flash
--EXTENSIONS--
zlib
--SKIPIF--
<?php
if (!defined("IMAGETYPE_SWC")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
--TEST--
Test image_type_to_mime_type() function : usage variations - Passing IMAGETYPE_ICO and IMAGETYPE_SWC
--EXTENSIONS--
zlib
--SKIPIF--
<?php
if (!defined("IMAGETYPE_SWC")) {
Expand Down
Loading