diff options
Diffstat (limited to 'ext/zlib')
26 files changed, 0 insertions, 2607 deletions
diff --git a/ext/zlib/CREDITS b/ext/zlib/CREDITS deleted file mode 100644 index c0a47dd293..0000000000 --- a/ext/zlib/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -Zlib -Rasmus Lerdorf, Stefan Roehrich, Zeev Suraski, Jade Nicoletti diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32 deleted file mode 100644 index 3639276c8c..0000000000 --- a/ext/zlib/config.w32 +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ -// vim:ft=javascript - -ARG_ENABLE("zlib", "ZLIB support", "yes"); - -if (PHP_ZLIB == "yes") { - EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D ZLIB_EXPORTS"); - AC_DEFINE("HAVE_ZLIB", 1, "ZLIB support"); - CHECK_LIB("zlib.lib", "zlib", PHP_ZLIB); - CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects); - if (!PHP_ZLIB_SHARED) { - ADD_DEF_FILE("ext\\zlib\\php_zlib.def"); - } - -} - - diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4 deleted file mode 100644 index 62e05fbd02..0000000000 --- a/ext/zlib/config0.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl -dnl $Id$ -dnl - -PHP_ARG_WITH(zlib,for ZLIB support, -[ --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.0.9)]) - -PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined, -[ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no) - -if test "$PHP_ZLIB" != "no" || test "$PHP_ZLIB_DIR" != "no"; then - PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared) - PHP_SUBST(ZLIB_SHARED_LIBADD) - - if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then - if test -f $PHP_ZLIB/include/zlib/zlib.h; then - ZLIB_DIR=$PHP_ZLIB - ZLIB_INCDIR=$ZLIB_DIR/include/zlib - elif test -f $PHP_ZLIB/include/zlib.h; then - ZLIB_DIR=$PHP_ZLIB - ZLIB_INCDIR=$ZLIB_DIR/include - fi - else - for i in /usr/local /usr $PHP_ZLIB_DIR; do - if test -f $i/include/zlib/zlib.h; then - ZLIB_DIR=$i - ZLIB_INCDIR=$i/include/zlib - elif test -f $i/include/zlib.h; then - ZLIB_DIR=$i - ZLIB_INCDIR=$i/include - fi - done - fi - - if test -z "$ZLIB_DIR"; then - AC_MSG_ERROR(Cannot find libz) - fi - - case $ZLIB_DIR in - /usr) ac_extra= ;; - *) ac_extra=-L$ZLIB_DIR/$PHP_LIBDIR ;; - esac - - PHP_CHECK_LIBRARY(z, gzgets, [ - AC_DEFINE(HAVE_ZLIB,1,[ ]) - ],[ - AC_MSG_ERROR(ZLIB extension requires zlib >= 1.0.9) - ],[ - $ac_extra - ]) - - PHP_ADD_LIBPATH($ZLIB_DIR/$PHP_LIBDIR, ZLIB_SHARED_LIBADD) - - PHP_ZLIB_DIR=$ZLIB_DIR - PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD) - PHP_ADD_INCLUDE($ZLIB_INCDIR) - -fi diff --git a/ext/zlib/package.xml b/ext/zlib/package.xml deleted file mode 100644 index 197357b89f..0000000000 --- a/ext/zlib/package.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<!DOCTYPE package SYSTEM "../pear/package.dtd"> -<package> - <name>zlib</name> - <summary>zlib compression management</summary> - <maintainers> - <maintainer> - <user>sr</user> - <name>Stefan Roehrich</name> - <email>sr@linux.de</email> - <role>lead</role> - </maintainer> - <maintainer> - <user>rasmus</user> - <name>Rasmus Lerdorf</name> - <email>rasmus@php.net</email> - <role>developer</role> - </maintainer> - <maintainer> - <user>zeev</user> - <name>Zeev Suraski</name> - <email>zeev@php.net</email> - <role>developer</role> - </maintainer> - <maintainer> - <user>???</user> - <name>Jade Nicoletti</name> - <email>???@php.net</email> - <role>developer</role> - </maintainer> - </maintainers> - <description> -This module enables you to transparently read and write -gzip (.gz) compressed files, through versions of most of -the filesystem functions which work with gzip-compressed -files (and uncompressed files, too, but not with sockets). - </description> - <license>PHP</license> - <release> - <state>beta</state> - <version>5.0.0rc1</version> - <date>2004-03-19</date> - <notes> -package.xml added to support intallation using pear installer - </notes> - <filelist> - <file role="doc" name="CREDITS"/> - <file role="doc" name="zlib_win32_howto.txt"/> - <file role="src" name="config0.m4"/> - <file role="src" name="config.w32"/> - <file role="src" name="php_zlib.h"/> - <file role="src" name="zlib.c"/> - <file role="src" name="zlib.dsp"/> - <file role="src" name="zlib_fopen_wrapper.c"/> - <file role="src" name="php_zlib.def"/> - <file role="test" name="tests/001.phpt"/> - <file role="test" name="tests/002.phpt"/> - <file role="test" name="tests/003.phpt"/> - <file role="test" name="tests/gzreadgzwrite.phpt"/> - <file role="test" name="tests/gzreadgzwriteplain.phpt"/> - <file role="test" name="tests/gzfilegzreadfile.phpt"/> - </filelist> - <deps> - <dep type="php" rel="ge" version="5" /> - </deps> - </release> -</package> -<!-- -vim:et:ts=1:sw=1 ---> diff --git a/ext/zlib/php_zlib.def b/ext/zlib/php_zlib.def deleted file mode 100644 index c0ff0dae51..0000000000 --- a/ext/zlib/php_zlib.def +++ /dev/null @@ -1,18 +0,0 @@ -EXPORTS - compress - compress2 - deflate - deflateEnd - deflateInit_ - deflateInit2_ - uncompress - inflateInit_ - inflateInit2_ - inflate - inflateEnd - crc32 - inflateReset - deflateReset - zlibVersion - zError -
\ No newline at end of file diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h deleted file mode 100644 index 44610dc979..0000000000 --- a/ext/zlib/php_zlib.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 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_01.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: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | - | Stefan Röhrich <sr@linux.de> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef PHP_ZLIB_H -#define PHP_ZLIB_H - -#include <zlib.h> - -ZEND_BEGIN_MODULE_GLOBALS(zlib) - /* variables for transparent gzip encoding */ - int compression_coding; - z_stream stream; - uLong crc; - int ob_gzhandler_status; - long output_compression; - long output_compression_level; - char *output_handler; -ZEND_END_MODULE_GLOBALS(zlib) - -extern php_stream_filter_factory php_zlib_filter_factory; -extern zend_module_entry php_zlib_module_entry; -#define zlib_module_ptr &php_zlib_module_entry - -int php_ob_gzhandler_check(TSRMLS_D); - -php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); -extern php_stream_wrapper php_stream_gzip_wrapper; - -#ifdef ZTS -#define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v) -#else -#define ZLIBG(v) (zlib_globals.v) -#endif - -#define phpext_zlib_ptr zlib_module_ptr - -#define CODING_GZIP 1 -#define CODING_DEFLATE 2 - -#endif /* PHP_ZLIB_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/zlib/tests/001.phpt b/ext/zlib/tests/001.phpt deleted file mode 100644 index 4850a65a5a..0000000000 --- a/ext/zlib/tests/001.phpt +++ /dev/null @@ -1,32 +0,0 @@ ---TEST-- -gzdeflate()/gzinflate() ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php /* $Id$ */ -$original = str_repeat("hallo php",4096); -$packed=gzdeflate($original); -echo strlen($packed)." ".strlen($original)."\n"; -$unpacked=gzinflate($packed); -if (strcmp($original,$unpacked)==0) echo "Strings are equal\n"; - -/* with explicit compression level, length */ -$original = str_repeat("hallo php",4096); -$packed=gzdeflate($original, 9); -echo strlen($packed)." ".strlen($original)."\n"; -$unpacked=gzinflate($packed, 40000); -if (strcmp($original,$unpacked)==0) echo "Strings are equal\n"; - -$original = 'aaaaaaaaaaaaaaa'; -$packed=gzdeflate($original); -echo strlen($packed)." ".strlen($original)."\n"; -$unpacked=gzinflate($packed); -if (strcmp($original,$unpacked)==0) echo "Strings are equal"; -?> ---EXPECT-- -100 36864 -Strings are equal -100 36864 -Strings are equal -5 15 -Strings are equal
\ No newline at end of file diff --git a/ext/zlib/tests/002.phpt b/ext/zlib/tests/002.phpt deleted file mode 100644 index 9844a1b93d..0000000000 --- a/ext/zlib/tests/002.phpt +++ /dev/null @@ -1,24 +0,0 @@ ---TEST-- -gzcompress()/gzuncompress() ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php /* $Id$ */ -$original = str_repeat("hallo php",4096); -$packed=gzcompress($original); -echo strlen($packed)." ".strlen($original)."\n"; -$unpacked=gzuncompress($packed); -if (strcmp($original,$unpacked)==0) echo "Strings are equal\n"; - -/* with explicit compression level, length */ -$original = str_repeat("hallo php",4096); -$packed=gzcompress($original, 9); -echo strlen($packed)." ".strlen($original)."\n"; -$unpacked=gzuncompress($packed, 40000); -if (strcmp($original,$unpacked)==0) echo "Strings are equal\n"; -?> ---EXPECT-- -106 36864 -Strings are equal -106 36864 -Strings are equal diff --git a/ext/zlib/tests/003.phpt b/ext/zlib/tests/003.phpt deleted file mode 100644 index 2732d4cea6..0000000000 --- a/ext/zlib/tests/003.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -gzencode()/base64_encode() ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php -$original = str_repeat("hallo php",4096); -$packed=gzencode($original); -echo strlen($packed)." ".strlen($original)."\n"; -if (strcmp(base64_encode($packed),"H4sIAAAAAAAAA+3GoQ0AQAgEsFV+NdwJEthf/R6kVU11z9tsRERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERETu5gPlQAe9AJAAAA==")==0) echo "Strings are equal"; -?> ---EXPECT-- -118 36864 -Strings are equal diff --git a/ext/zlib/tests/004.phpt b/ext/zlib/tests/004.phpt deleted file mode 100644 index a758b8c7b3..0000000000 --- a/ext/zlib/tests/004.phpt +++ /dev/null @@ -1,89 +0,0 @@ ---TEST-- -gzfile() with various invalid params ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php - -var_dump(gzfile()); -var_dump(gzfile("nonexistent_file_gzfile",1)); -var_dump(gzfile(1,1,1)); - -var_dump(gzfile(dirname(__FILE__)."/004.txt.gz")); -var_dump(gzfile(dirname(__FILE__)."/004.txt.gz", 1)); - -ini_set("magic_quotes_runtime", 1); -var_dump(gzfile(dirname(__FILE__)."/004.txt.gz", -1)); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzfile(nonexistent_file_gzfile): failed to open stream: No such file or directory in %s on line %d -bool(false) - -Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d -NULL -array(6) { - [0]=> - string(36) "When you're taught through feelings -" - [1]=> - string(26) "Destiny flying high above -" - [2]=> - string(38) "all I know is that you can realize it -" - [3]=> - string(18) "Destiny who cares -" - [4]=> - string(19) "as it turns around -" - [5]=> - string(39) "and I know that it descends down on me -" -} -array(6) { - [0]=> - string(36) "When you're taught through feelings -" - [1]=> - string(26) "Destiny flying high above -" - [2]=> - string(38) "all I know is that you can realize it -" - [3]=> - string(18) "Destiny who cares -" - [4]=> - string(19) "as it turns around -" - [5]=> - string(39) "and I know that it descends down on me -" -} -array(6) { - [0]=> - string(37) "When you\'re taught through feelings -" - [1]=> - string(26) "Destiny flying high above -" - [2]=> - string(38) "all I know is that you can realize it -" - [3]=> - string(18) "Destiny who cares -" - [4]=> - string(19) "as it turns around -" - [5]=> - string(39) "and I know that it descends down on me -" -} -Done diff --git a/ext/zlib/tests/004.txt.gz b/ext/zlib/tests/004.txt.gz Binary files differdeleted file mode 100644 index 07805db755..0000000000 --- a/ext/zlib/tests/004.txt.gz +++ /dev/null diff --git a/ext/zlib/tests/005.phpt b/ext/zlib/tests/005.phpt deleted file mode 100644 index 79834b2d34..0000000000 --- a/ext/zlib/tests/005.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -gzcompress()/gzuncompress() and invalid params ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php - -var_dump(gzcompress()); -var_dump(gzcompress("", 1000)); -var_dump(gzcompress("", -1)); - -var_dump(gzcompress("")); -var_dump(gzcompress("", 9)); - -$string = "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony"; - -var_dump($data1 = gzcompress($string)); -var_dump($data2 = gzcompress($string, 9)); - -var_dump(gzuncompress()); -var_dump(gzuncompress("", 1000)); -var_dump(gzuncompress("", -1)); - -var_dump(gzuncompress("")); -var_dump(gzuncompress("", 9)); - -var_dump(gzuncompress($data1)); -var_dump(gzuncompress($data2)); -$data2{4} = 0; -var_dump(gzuncompress($data2)); - -echo "Done\n"; -?> ---EXPECTF-- - -Warning: gzcompress() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzcompress(): compression level (1000) must be within -1..9 in %s on line %d -bool(false) -string(%d) "%s" -string(%d) "%s" -string(%d) "%s" -string(%d) "%s" -string(%d) "%s" - -Warning: gzuncompress() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzuncompress(): %s error in %s on line %d -bool(false) - -Warning: gzuncompress(): length (-1) must be greater or equal zero in %s on line %d -bool(false) - -Warning: gzuncompress(): %s error in %s on line %d -bool(false) - -Warning: gzuncompress(): %s error in %s on line %d -bool(false) -string(94) "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony" -string(94) "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony" - -Warning: gzuncompress(): %s error in %s on line %d -bool(false) -Done diff --git a/ext/zlib/tests/006.phpt b/ext/zlib/tests/006.phpt deleted file mode 100644 index 1ddb563784..0000000000 --- a/ext/zlib/tests/006.phpt +++ /dev/null @@ -1,73 +0,0 @@ ---TEST-- -gzdeflate()/gzinflate() and invalid params ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php - -var_dump(gzdeflate()); -var_dump(gzdeflate("", 1000)); -var_dump(gzdeflate("", -1)); - -var_dump(gzdeflate("")); -var_dump(gzdeflate("", 9)); - -$string = "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony"; - -var_dump($data1 = gzdeflate($string)); -var_dump($data2 = gzdeflate($string, 9)); - -var_dump(gzinflate()); -var_dump(gzinflate("")); -var_dump(gzinflate("asfwe", 1000)); -var_dump(gzinflate("asdf", -1)); - -var_dump(gzinflate("asdf")); -var_dump(gzinflate("asdf", 9)); - -var_dump(gzinflate($data1)); -var_dump(gzinflate($data2)); -$data2{4} = 0; -var_dump(gzinflate($data2)); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: gzdeflate() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzdeflate(): compression level (1000) must be within -1..9 in %s on line %d -bool(false) -string(%d) "%s" -string(%d) "%s" -string(%d) "%s" -string(%d) "%s" -string(%d) "%s" - -Warning: gzinflate() expects at least 1 parameter, 0 given in %s on line %d -NULL -bool(false) - -Warning: gzinflate(): data error in %s on line %d -bool(false) - -Warning: gzinflate(): length (-1) must be greater or equal zero in %s on line %d -bool(false) - -Warning: gzinflate(): data error in %s on line %d -bool(false) - -Warning: gzinflate(): data error in %s on line %d -bool(false) -string(94) "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony" -string(94) "Answer me, it can't be so hard -Cry to relieve what's in your heart -Desolation, grief and agony" - -Warning: gzinflate(): data error in %s on line %d -bool(false) -Done diff --git a/ext/zlib/tests/007.phpt b/ext/zlib/tests/007.phpt deleted file mode 100644 index ec37b99de6..0000000000 --- a/ext/zlib/tests/007.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -gzencode() and invalid params ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php - -var_dump(gzencode()); -var_dump(gzencode(1,1,1,1)); -var_dump(gzencode("", -10)); -var_dump(gzencode("", 100)); -var_dump(gzencode("", 1, 100)); - -var_dump(gzencode("", -1, 1)); -var_dump(gzencode("", 9, 2)); - -$string = "Light of my sun -Light in this temple -Light in my truth -Lies in the darkness"; - -var_dump(gzencode($string, 9, 3)); - -var_dump(gzencode($string, -1, 1)); -var_dump(gzencode($string, 9, 2)); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: gzencode() expects at least 1 parameter, 0 given in %s on line %d -NULL - -Warning: gzencode() expects at most 3 parameters, 4 given in %s on line %d -NULL - -Warning: gzencode(): compression level(-10) must be within -1..9 in %s on line %d -bool(false) - -Warning: gzencode(): compression level(100) must be within -1..9 in %s on line %d -bool(false) - -Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d -bool(false) -string(%d) "%s" -string(%d) "%s" - -Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d -bool(false) -string(%d) "%s" -string(%d) "%s" -Done diff --git a/ext/zlib/tests/bug_34821.phpt b/ext/zlib/tests/bug_34821.phpt deleted file mode 100644 index ff845c6df7..0000000000 --- a/ext/zlib/tests/bug_34821.phpt +++ /dev/null @@ -1,41 +0,0 @@ ---TEST-- -bug 34821 ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php - -// test 50 bytes to 500k -$b = array( - 50, - 500, - 5000, - 500000, -// 1000000, // works, but test would take too long -); - -srand(time()); - -foreach ($b as $size) { - $s = ''; - for ($i = 0; $i <= $size; ++$i) { - $s .= chr(rand(0,255)); - } - var_dump($s == gzinflate(gzdeflate($s))); - var_dump($s == gzuncompress(gzcompress($s))); - var_dump($s == gzinflate(substr(gzencode($s), 10, -8))); -} -?> ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) diff --git a/ext/zlib/tests/compress_zlib_wrapper.phpt b/ext/zlib/tests/compress_zlib_wrapper.phpt deleted file mode 100644 index fe8774f3a1..0000000000 --- a/ext/zlib/tests/compress_zlib_wrapper.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -compress.zlib:// wrapper ---SKIPIF-- -<?php if (!extension_loaded("zlib")) die("skip"); ?> ---FILE-- -<?php - -$pfx = str_repeat('../', substr_count($_SERVER['PHP_SELF'], '../')); - -// Relative path -$fp = fopen("compress.zlib://{$pfx}ext/xsl/tests/xslt.xsl.gz", "rb"); -fclose($fp); - -// Absolute path -$fp = fopen("compress.zlib://". dirname(__FILE__). "/../../../ext/xsl/tests/xslt.xsl.gz", "rb"); -fclose($fp); - -echo "ok\n"; -?> ---EXPECT-- -ok diff --git a/ext/zlib/tests/gzfilegzreadfile.phpt b/ext/zlib/tests/gzfilegzreadfile.phpt deleted file mode 100644 index 2d6843ddd4..0000000000 --- a/ext/zlib/tests/gzfilegzreadfile.phpt +++ /dev/null @@ -1,82 +0,0 @@ ---TEST-- -gzfile(), gzreadfile() ---SKIPIF-- -<?php /* $Id$ */ -if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php -$original = <<<EOD -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah - -EOD; - -$filename = tempnam("/tmp", "phpt"); - -$fp = gzopen($filename, "wb"); -gzwrite($fp, $original); -var_dump(strlen($original)); -fclose($fp); - -readgzfile($filename); - -echo "\n"; - -$lines = gzfile($filename); - -unlink($filename); - -foreach ($lines as $line) { - echo $line; -} - -?> ---EXPECT-- -int(560) -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah - -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah -blah blah blah blah blah blah blah diff --git a/ext/zlib/tests/gzreadgzwrite.phpt b/ext/zlib/tests/gzreadgzwrite.phpt deleted file mode 100644 index 6d6729a72f..0000000000 --- a/ext/zlib/tests/gzreadgzwrite.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -gzopen(), gzread(), gzwrite() ---SKIPIF-- -<?php # vim600:syn=php: -if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php -$original = str_repeat("hallo php",4096); -$filename = tempnam("/tmp", "phpt"); - -$fp = gzopen($filename, "wb"); -gzwrite($fp, $original); -var_dump(strlen($original)); -var_dump(gztell($fp)); -fclose($fp); - -$fp = gzopen($filename, "rb"); -$data = gzread($fp, strlen($original)); -if ($data == $original) { - echo "Strings are equal\n"; -} else { - echo "Strings are not equal\n"; - var_dump($data); -} -gzclose($fp); -unlink($filename); -?> ---EXPECT-- -int(36864) -int(36864) -Strings are equal diff --git a/ext/zlib/tests/gzreadgzwriteplain.phpt b/ext/zlib/tests/gzreadgzwriteplain.phpt deleted file mode 100644 index 7bb567d889..0000000000 --- a/ext/zlib/tests/gzreadgzwriteplain.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -gzopen(), gzread(), gzwrite() for non-compressed data ---SKIPIF-- -<?php # vim600:syn=php: -if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php -$original = str_repeat("hallo php",4096); -$filename = tempnam("/tmp", "phpt"); - -$fp = fopen($filename, "wb"); -fwrite($fp, $original); -var_dump(strlen($original)); -var_dump(ftell($fp)); -fclose($fp); - -$fp = gzopen($filename, "rb"); -$data = gzread($fp, strlen($original)); -if ($data == $original) { - echo "Strings are equal\n"; -} else { - echo "Strings are not equal\n"; - var_dump($data); -} - -gzseek($fp, strlen($original) / 2); -$data = gzread($fp, strlen($original)); - -var_dump(strlen($data)); -if ($data == substr($original, strlen($original) / 2)) { - echo "Strings are equal\n"; -} else { - echo "Strings are not equal\n"; - var_dump($data); -} - -gzclose($fp); -unlink($filename); -?> ---EXPECT-- -int(36864) -int(36864) -Strings are equal -int(18432) -Strings are equal diff --git a/ext/zlib/tests/zlib_filter_deflate.phpt b/ext/zlib/tests/zlib_filter_deflate.phpt deleted file mode 100644 index 1811779f04..0000000000 --- a/ext/zlib/tests/zlib_filter_deflate.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -zlib.deflate (with convert.base64-encode) ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php /* $Id$ */ -$text = 'I am the very model of a modern major general, I\'ve information vegetable, animal, and mineral.'; - -$fp = fopen('php://stdout', 'w'); -stream_filter_append($fp, 'zlib.deflate', STREAM_FILTER_WRITE); -stream_filter_append($fp, 'convert.base64-encode', STREAM_FILTER_WRITE); -fwrite($fp, $text); -fclose($fp); - -?> ---EXPECT-- -HctBDoAgDETRq8zOjfEeHKOGATG0TRpC4u1Vdn/xX4IoxkVMxgP1zA4vkJVhULk9UGkM6TvSNolmxUNlNLePVQ45O3eINf0fsQxtCxwv diff --git a/ext/zlib/tests/zlib_filter_inflate.phpt b/ext/zlib/tests/zlib_filter_inflate.phpt deleted file mode 100644 index 026f192a6e..0000000000 --- a/ext/zlib/tests/zlib_filter_inflate.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -zlib.inflate (with convert.base64-decode) ---SKIPIF-- -<?php if (!extension_loaded("zlib")) print "skip"; ?> ---FILE-- -<?php /* $Id$ */ -$text = 'HctBDoAgDETRq8zOjfEeHKOGATG0TRpC4u1Vdn/xX4IoxkVMxgP1zA4vkJVhULk9UGkM6TvSNolmxUNlNLePVQ45O3eINf0fsQxtCxwv'; - -$fp = fopen('php://stdout', 'w'); -stream_filter_append($fp, 'convert.base64-decode', STREAM_FILTER_WRITE); -stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_WRITE); -fwrite($fp, $text); -fclose($fp); - -?> ---EXPECT-- -I am the very model of a modern major general, I've information vegetable, animal, and mineral. diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c deleted file mode 100644 index 21d9034192..0000000000 --- a/ext/zlib/zlib.c +++ /dev/null @@ -1,1021 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 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_01.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: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | - | Stefan Röhrich <sr@linux.de> | - | Zeev Suraski <zeev@zend.com> | - | Jade Nicoletti <nicoletti@nns.ch> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "SAPI.h" -#include "php_ini.h" - -#include <stdlib.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#ifdef PHP_WIN32 -#define O_RDONLY _O_RDONLY -#include "win32/param.h" -#else -#include <sys/param.h> -/* #include <sys/uio.h> */ -#endif -#include "ext/standard/head.h" -#include "safe_mode.h" -#include "ext/standard/php_standard.h" -#include "ext/standard/info.h" -#include "php_zlib.h" -#include "fopen_wrappers.h" -#if HAVE_PWD_H -#ifdef PHP_WIN32 -#include "win32/pwd.h" -#else -#include <pwd.h> -#endif -#endif -#if defined(HAVE_UNISTD_H) && defined(PHP_WIN32) -#undef HAVE_UNISTD_H -#endif - -#ifdef COMPILE_DL_ZLIB -#ifndef PUTS -#define PUTS(a) php_printf("%s",a) -#endif -#ifndef PUTC -#define PUTC(a) PUTS(a) -#endif -#ifndef PHPWRITE -#define PHPWRITE(a,n) php_write((a),(n) TSRMLS_CC) -#endif -#endif - -/* Win32 needs some more memory */ -#ifdef PHP_WIN32 -#define PHP_ZLIB_MODIFIER 100 -#else -#define PHP_ZLIB_MODIFIER 1000 -#endif - -#define OS_CODE 0x03 /* FIXME */ -#define GZIP_HEADER_LENGTH 10 -#define GZIP_FOOTER_LENGTH 8 - -/* True globals, no need for thread safety */ -static const int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - -static int php_enable_output_compression(int buffer_size TSRMLS_DC); - -static PHP_MINIT_FUNCTION(zlib); -static PHP_MSHUTDOWN_FUNCTION(zlib); -static PHP_RINIT_FUNCTION(zlib); -static PHP_MINFO_FUNCTION(zlib); -static PHP_FUNCTION(gzopen); -static PHP_FUNCTION(readgzfile); -static PHP_FUNCTION(gzfile); -static PHP_FUNCTION(gzcompress); -static PHP_FUNCTION(gzuncompress); -static PHP_FUNCTION(gzdeflate); -static PHP_FUNCTION(gzinflate); -static PHP_FUNCTION(gzencode); -static PHP_FUNCTION(ob_gzhandler); -static PHP_FUNCTION(zlib_get_coding_type); - -/* {{{ php_zlib_functions[] - */ -static zend_function_entry php_zlib_functions[] = { - PHP_FE(readgzfile, NULL) - PHP_FALIAS(gzrewind, rewind, NULL) - PHP_FALIAS(gzclose, fclose, NULL) - PHP_FALIAS(gzeof, feof, NULL) - PHP_FALIAS(gzgetc, fgetc, NULL) - PHP_FALIAS(gzgets, fgets, NULL) - PHP_FALIAS(gzgetss, fgetss, NULL) - PHP_FALIAS(gzread, fread, NULL) - PHP_FE(gzopen, NULL) - PHP_FALIAS(gzpassthru, fpassthru, NULL) - PHP_FALIAS(gzseek, fseek, NULL) - PHP_FALIAS(gztell, ftell, NULL) - PHP_FALIAS(gzwrite, fwrite, NULL) - PHP_FALIAS(gzputs, fwrite, NULL) - PHP_FE(gzfile, NULL) - PHP_FE(gzcompress, NULL) - PHP_FE(gzuncompress, NULL) - PHP_FE(gzdeflate, NULL) - PHP_FE(gzinflate, NULL) - PHP_FE(gzencode, NULL) - PHP_FE(ob_gzhandler, NULL) - PHP_FE(zlib_get_coding_type, NULL) - {NULL, NULL, NULL} -}; -/* }}} */ - -ZEND_DECLARE_MODULE_GLOBALS(zlib) - -/* {{{ php_zlib_module_entry - */ -zend_module_entry php_zlib_module_entry = { - STANDARD_MODULE_HEADER, - "zlib", - php_zlib_functions, - PHP_MINIT(zlib), - PHP_MSHUTDOWN(zlib), - PHP_RINIT(zlib), - NULL, - PHP_MINFO(zlib), - "1.1", - PHP_MODULE_GLOBALS(zlib), - NULL, - NULL, - NULL, - STANDARD_MODULE_PROPERTIES_EX -}; -/* }}} */ - -#ifdef COMPILE_DL_ZLIB -ZEND_GET_MODULE(php_zlib) -#endif - -/* {{{ OnUpdate_zlib_output_compression */ -static PHP_INI_MH(OnUpdate_zlib_output_compression) -{ - char *ini_value; - - if (new_value == NULL) { - return FAILURE; - } - - if (!strncasecmp(new_value, "off", sizeof("off"))) { - new_value = "0"; - new_value_length = sizeof("0"); - } else if (!strncasecmp(new_value, "on", sizeof("on"))) { - new_value = "1"; - new_value_length = sizeof("1"); - } - - ini_value = zend_ini_string("output_handler", sizeof("output_handler"), 0); - if (ini_value != NULL && strlen(ini_value) != 0 && zend_atoi(new_value, new_value_length) != 0) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!"); - return FAILURE; - } - - if (stage == PHP_INI_STAGE_RUNTIME && SG(headers_sent) && !SG(request_info).no_headers) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent"); - return FAILURE; - } - - OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ OnUpdate_zlib_output_compression_level */ -static PHP_INI_MH(OnUpdate_zlib_output_compression_level) -{ - OnUpdateLong(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ OnUpdate_zlib_output_handler */ -static PHP_INI_MH(OnUpdate_zlib_output_handler) -{ - if (stage == PHP_INI_STAGE_RUNTIME && SG(headers_sent) && !SG(request_info).no_headers) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_handler - headers already sent"); - return FAILURE; - } - - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - - -PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals) - STD_PHP_INI_ENTRY("zlib.output_compression_level", "-1", PHP_INI_ALL, OnUpdate_zlib_output_compression_level, output_compression_level, zend_zlib_globals, zlib_globals) - STD_PHP_INI_ENTRY("zlib.output_handler", "", PHP_INI_ALL, OnUpdate_zlib_output_handler, output_handler, zend_zlib_globals, zlib_globals) -PHP_INI_END() - -/* {{{ PHP_MINIT_FUNCTION - */ -static PHP_MINIT_FUNCTION(zlib) -{ - php_register_url_stream_wrapper("compress.zlib", &php_stream_gzip_wrapper TSRMLS_CC); - php_stream_filter_register_factory("zlib.*", &php_zlib_filter_factory TSRMLS_CC); - - REGISTER_LONG_CONSTANT("FORCE_GZIP", CODING_GZIP, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("FORCE_DEFLATE", CODING_DEFLATE, CONST_CS | CONST_PERSISTENT); - - REGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RINIT_FUNCTION - */ -static PHP_RINIT_FUNCTION(zlib) -{ - uint chunk_size = ZLIBG(output_compression); - - ZLIBG(ob_gzhandler_status) = 0; - ZLIBG(compression_coding) = 0; - if (chunk_size) { - if (chunk_size == 1) { - chunk_size = 4096; /* use the default size */ - ZLIBG(output_compression) = chunk_size; - } - php_enable_output_compression(chunk_size TSRMLS_CC); - } - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -static PHP_MSHUTDOWN_FUNCTION(zlib) -{ - php_unregister_url_stream_wrapper("zlib" TSRMLS_CC); - php_stream_filter_unregister_factory("zlib.*" TSRMLS_CC); - - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -static PHP_MINFO_FUNCTION(zlib) -{ - php_info_print_table_start(); - php_info_print_table_row(2, "ZLib Support", "enabled"); - php_info_print_table_row(2, "Stream Wrapper support", "compress.zlib://"); - php_info_print_table_row(2, "Stream Filter support", "zlib.inflate, zlib.deflate"); - php_info_print_table_row(2, "Compiled Version", ZLIB_VERSION); - php_info_print_table_row(2, "Linked Version", (char *) zlibVersion()); - php_info_print_table_end(); - - DISPLAY_INI_ENTRIES(); -} -/* }}} */ - -/* {{{ proto array gzfile(string filename [, int use_include_path]) - Read und uncompress entire .gz-file into an array */ -static PHP_FUNCTION(gzfile) -{ - char *filename; - int filename_len; - long flags = 0; - char *slashed, buf[8192]; - register int i = 0; - int use_include_path = 0; - php_stream *stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) { - return; - } - - use_include_path = flags ? USE_PATH : 0; - - /* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */ - stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC); - if (stream == NULL) { - /* Error reporting is already done by stream code */ - RETURN_FALSE; - } - - /* Initialize return array */ - array_init(return_value); - - /* Now loop through the file and do the magic quotes thing if needed */ - memset(buf,0,sizeof(buf)); - - while (php_stream_gets(stream, buf, sizeof(buf) - 1) != NULL) { - if (PG(magic_quotes_runtime)) { - int len; - - slashed = php_addslashes(buf, 0, &len, 0 TSRMLS_CC); /* 0 = don't free source string */ - add_index_stringl(return_value, i++, slashed, len, 0); - } else { - add_index_string(return_value, i++, buf, 1); - } - } - php_stream_close(stream); -} -/* }}} */ - -/* {{{ proto resource gzopen(string filename, string mode [, int use_include_path]) - Open a .gz-file and return a .gz-file pointer */ -static PHP_FUNCTION(gzopen) -{ - char *filename, *mode; - int filename_len, mode_len; - long flags = 0; - php_stream *stream; - int use_include_path = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &filename, &filename_len, &mode, &mode_len, &flags) == FAILURE) { - return; - } - - use_include_path = flags ? USE_PATH : 0; - - stream = php_stream_gzopen(NULL, filename, mode, use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC); - - if (!stream) { - RETURN_FALSE; - } - php_stream_to_zval(stream, return_value); -} -/* }}} */ - -/* - * Read a file and write the ouput to stdout - */ -/* {{{ proto int readgzfile(string filename [, int use_include_path]) - Output a .gz-file */ -static PHP_FUNCTION(readgzfile) -{ - char *filename; - int filename_len; - long flags = 0; - php_stream *stream; - int size; - int use_include_path = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &filename, &filename_len, &flags) == FAILURE) { - return; - } - - use_include_path = flags ? USE_PATH : 0; - - stream = php_stream_gzopen(NULL, filename, "rb", use_include_path | ENFORCE_SAFE_MODE, NULL, NULL STREAMS_CC TSRMLS_CC); - if (!stream) { - RETURN_FALSE; - } - size = php_stream_passthru(stream); - php_stream_close(stream); - RETURN_LONG(size); -} -/* }}} */ - -/* {{{ proto string gzcompress(string data [, int level]) - Gzip-compress a string */ -static PHP_FUNCTION(gzcompress) -{ - int data_len, status; - long level = Z_DEFAULT_COMPRESSION; - unsigned long l2; - char *data, *s2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &level) == FAILURE) { - return; - } - - if ((level < -1) || (level > 9)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%ld) must be within -1..9", level); - RETURN_FALSE; - } - - l2 = data_len + (data_len / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */ - s2 = (char *) emalloc(l2); - if (!s2) { - RETURN_FALSE; - } - - if (level >= 0) { - status = compress2(s2, &l2, data, data_len, level); - } else { - status = compress(s2, &l2, data, data_len); - } - - if (status == Z_OK) { - s2 = erealloc(s2, l2 + 1); - s2[l2] = '\0'; - RETURN_STRINGL(s2, l2, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string gzuncompress(string data [, int length]) - Unzip a gzip-compressed string */ -static PHP_FUNCTION(gzuncompress) -{ - int data_len, status; - unsigned int factor=1, maxfactor=16; - long limit = 0; - unsigned long plength=0, length; - char *data, *s1=NULL, *s2=NULL; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &limit) == FAILURE) { - return; - } - - if (limit < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%ld) must be greater or equal zero", limit); - RETURN_FALSE; - } - plength = limit; - - /* - zlib::uncompress() wants to know the output data length - if none was given as a parameter - we try from input length * 2 up to input length * 2^15 - doubling it whenever it wasn't big enough - that should be eneugh for all real life cases - */ - do { - length = plength ? plength : (unsigned long)data_len * (1 << factor++); - s2 = (char *) erealloc(s1, length); - status = uncompress(s2, &length, data, data_len); - s1 = s2; - } while ((status == Z_BUF_ERROR) && (!plength) && (factor < maxfactor)); - - if (status == Z_OK) { - s2 = erealloc(s2, length + 1); /* space for \0 */ - s2[ length ] = '\0'; - RETURN_STRINGL(s2, length, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string gzdeflate(string data [, int level]) - Gzip-compress a string */ -static PHP_FUNCTION(gzdeflate) -{ - int data_len,status; - long level = Z_DEFAULT_COMPRESSION; - z_stream stream; - char *data, *s2; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &level) == FAILURE) { - return; - } - - if ((level < -1) || (level > 9)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level (%ld) must be within -1..9", level); - RETURN_FALSE; - } - - stream.data_type = Z_ASCII; - stream.zalloc = (alloc_func) Z_NULL; - stream.zfree = (free_func) Z_NULL; - stream.opaque = (voidpf) Z_NULL; - - stream.next_in = (Bytef *) data; - stream.avail_in = data_len; - - stream.avail_out = stream.avail_in + (stream.avail_in / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */ - - s2 = (char *) emalloc(stream.avail_out); - if (!s2) { - RETURN_FALSE; - } - - stream.next_out = s2; - - /* init with -MAX_WBITS disables the zlib internal headers */ - status = deflateInit2(&stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, 0); - if (status == Z_OK) { - status = deflate(&stream, Z_FINISH); - if (status != Z_STREAM_END) { - deflateEnd(&stream); - if (status == Z_OK) { - status = Z_BUF_ERROR; - } - } else { - status = deflateEnd(&stream); - } - } - - if (status == Z_OK) { - s2 = erealloc(s2,stream.total_out + 1); /* resize to buffer to the "right" size */ - s2[ stream.total_out ] = '\0'; - RETURN_STRINGL(s2, stream.total_out, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string gzinflate(string data [, int length]) - Unzip a gzip-compressed string */ -static PHP_FUNCTION(gzinflate) -{ - int data_len, status; - unsigned int factor=1, maxfactor=16; - long limit = 0; - unsigned long plength=0, length; - char *data, *s1=NULL, *s2=NULL; - z_stream stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &data, &data_len, &limit) == FAILURE) { - return; - } - - if (!data_len) { - RETURN_FALSE; - } - - if (limit < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "length (%ld) must be greater or equal zero", limit); - RETURN_FALSE; - } - plength = limit; - - /* - stream.avail_out wants to know the output data length - if none was given as a parameter - we try from input length * 2 up to input length * 2^15 - doubling it whenever it wasn't big enough - that should be enaugh for all real life cases - */ - - stream.zalloc = (alloc_func) Z_NULL; - stream.zfree = (free_func) Z_NULL; - - do { - length = plength ? plength : (unsigned long)data_len * (1 << factor++); - s2 = (char *) erealloc(s1, length); - - if (!s2 && s1) { - efree(s1); - RETURN_FALSE; - } - - stream.next_in = (Bytef *) data; - stream.avail_in = (uInt) data_len + 1; /* there is room for \0 */ - - stream.next_out = s2; - stream.avail_out = (uInt) length; - - /* init with -MAX_WBITS disables the zlib internal headers */ - status = inflateInit2(&stream, -MAX_WBITS); - if (status == Z_OK) { - status = inflate(&stream, Z_FINISH); - if (status != Z_STREAM_END) { - inflateEnd(&stream); - if (status == Z_OK) { - status = Z_BUF_ERROR; - } - } else { - status = inflateEnd(&stream); - } - } - s1 = s2; - - } while ((status == Z_BUF_ERROR) && (!plength) && (factor < maxfactor)); - - if (status == Z_OK) { - s2 = erealloc(s2, stream.total_out + 1); /* room for \0 */ - s2[ stream.total_out ] = '\0'; - RETURN_STRINGL(s2, stream.total_out, 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto string zlib_get_coding_type(void) - Returns the coding type used for output compression */ -static PHP_FUNCTION(zlib_get_coding_type) -{ - switch (ZLIBG(compression_coding)) { - case CODING_GZIP: - RETURN_STRINGL("gzip", sizeof("gzip") - 1, 1); - - case CODING_DEFLATE: - RETURN_STRINGL("deflate", sizeof("deflate") - 1, 1); - } - - RETURN_FALSE; -} - -/* {{{ php_do_deflate - */ -static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buffer_len, zend_bool do_start, zend_bool do_end TSRMLS_DC) -{ - Bytef *buffer; - uInt prev_outlen, outlen; - int err; - int start_offset = ((do_start && ZLIBG(compression_coding) == CODING_GZIP) ? 10 : 0); - int end_offset = (do_end ? 8 : 0); - - outlen = (uint) (str_length + (str_length / PHP_ZLIB_MODIFIER) + 12 + 1); /* leave some room for a trailing \0 */ - if ((outlen + start_offset + end_offset) > *p_buffer_len) { - buffer = (Bytef *) emalloc(outlen + start_offset + end_offset); - } else { - buffer = *p_buffer; - } - - ZLIBG(stream).next_out = buffer + start_offset; - ZLIBG(stream).avail_out = outlen; - - err = deflate(&ZLIBG(stream), Z_SYNC_FLUSH); - while (err == Z_OK && !ZLIBG(stream).avail_out) { - prev_outlen = outlen; - outlen *= 3; - if ((outlen + start_offset + end_offset) > *p_buffer_len) { - buffer = erealloc(buffer, outlen + start_offset + end_offset); - } - - ZLIBG(stream).next_out = buffer + start_offset + prev_outlen; - ZLIBG(stream).avail_out = prev_outlen * 2; - - err = deflate(&ZLIBG(stream), Z_SYNC_FLUSH); - } - - if (do_end) { - err = deflate(&ZLIBG(stream), Z_FINISH); - buffer[outlen + start_offset - ZLIBG(stream).avail_out] = '\0'; - } - - *p_buffer = buffer; - *p_buffer_len = outlen - ZLIBG(stream).avail_out; - - return err; -} -/* }}} */ - -/* {{{ php_deflate_string - */ -static int php_deflate_string(const char *str, uint str_length, char **newstr, uint *new_length, zend_bool do_start, zend_bool do_end TSRMLS_DC) -{ - int err; - - if (do_start) { - ZLIBG(stream).zalloc = Z_NULL; - ZLIBG(stream).zfree = Z_NULL; - ZLIBG(stream).opaque = Z_NULL; - - switch (ZLIBG(compression_coding)) { - case CODING_GZIP: - /* windowBits is passed < 0 to suppress zlib header & trailer */ - if (deflateInit2(&ZLIBG(stream), ZLIBG(output_compression_level), Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) { - /* TODO: print out error */ - return FAILURE; - } - - ZLIBG(crc) = crc32(0L, Z_NULL, 0); - break; - - case CODING_DEFLATE: - if (deflateInit(&ZLIBG(stream), ZLIBG(output_compression_level)) != Z_OK) { - /* TODO: print out error */ - return FAILURE; - } - break; - } - } - - ZLIBG(stream).next_in = (Bytef *) str; - ZLIBG(stream).avail_in = (uInt) str_length; - - if (ZLIBG(compression_coding) == CODING_GZIP) { - ZLIBG(crc) = crc32(ZLIBG(crc), (const Bytef *) str, str_length); - } - - err = php_do_deflate(str_length, (Bytef **) newstr, new_length, do_start, do_end TSRMLS_CC); - /* TODO: error handling (err may be Z_STREAM_ERROR, Z_BUF_ERROR, ?) */ - - if (do_start && ZLIBG(compression_coding) == CODING_GZIP) { - /* Write a very simple .gz header: */ - (*newstr)[0] = gz_magic[0]; - (*newstr)[1] = gz_magic[1]; - (*newstr)[2] = Z_DEFLATED; - (*newstr)[3] = (*newstr)[4] = (*newstr)[5] = (*newstr)[6] = (*newstr)[7] = (*newstr)[8] = 0; - (*newstr)[9] = OS_CODE; - *new_length += 10; - } - if (do_end) { - if (ZLIBG(compression_coding) == CODING_GZIP) { - char *trailer = (*newstr) + (*new_length); - - /* write crc & stream.total_in in LSB order */ - trailer[0] = (char) ZLIBG(crc) & 0xFF; - trailer[1] = (char) (ZLIBG(crc) >> 8) & 0xFF; - trailer[2] = (char) (ZLIBG(crc) >> 16) & 0xFF; - trailer[3] = (char) (ZLIBG(crc) >> 24) & 0xFF; - trailer[4] = (char) ZLIBG(stream).total_in & 0xFF; - trailer[5] = (char) (ZLIBG(stream).total_in >> 8) & 0xFF; - trailer[6] = (char) (ZLIBG(stream).total_in >> 16) & 0xFF; - trailer[7] = (char) (ZLIBG(stream).total_in >> 24) & 0xFF; - trailer[8] = '\0'; - *new_length += 8; - } - deflateEnd(&ZLIBG(stream)); - } - - return SUCCESS; -} -/* }}} */ - -/* {{{ proto string gzencode(string data [, int level [, int encoding_mode]]) - GZ encode a string */ -static PHP_FUNCTION(gzencode) -{ - char *data, *s2; - int data_len; - long level = Z_DEFAULT_COMPRESSION, coding = CODING_GZIP; - int status; - z_stream stream; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &data, &data_len, &level, &coding) == FAILURE) { - return; - } - - if ((level < -1) || (level > 9)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "compression level(%ld) must be within -1..9", level); - RETURN_FALSE; - } - - if ((coding != CODING_GZIP) && (coding != CODING_DEFLATE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "encoding mode must be FORCE_GZIP or FORCE_DEFLATE"); - RETURN_FALSE; - } - - stream.zalloc = Z_NULL; - stream.zfree = Z_NULL; - stream.opaque = Z_NULL; - - stream.next_in = (Bytef *) data; - stream.avail_in = data_len; - - stream.avail_out = stream.avail_in + (stream.avail_in / PHP_ZLIB_MODIFIER) + 15 + 1; /* room for \0 */ - s2 = (char *) emalloc(stream.avail_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0)); - - /* add gzip file header */ - s2[0] = gz_magic[0]; - s2[1] = gz_magic[1]; - s2[2] = Z_DEFLATED; - s2[3] = s2[4] = s2[5] = s2[6] = s2[7] = s2[8] = 0; /* time set to 0 */ - s2[9] = OS_CODE; - - stream.next_out = &(s2[GZIP_HEADER_LENGTH]); - - switch (coding) { - case CODING_GZIP: - /* windowBits is passed < 0 to suppress zlib header & trailer */ - if ((status = deflateInit2(&stream, level, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY)) != Z_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } - - break; - case CODING_DEFLATE: - if ((status = deflateInit(&stream, level)) != Z_OK) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } - break; - } - - status = deflate(&stream, Z_FINISH); - if (status != Z_STREAM_END) { - deflateEnd(&stream); - if (status == Z_OK) { - status = Z_BUF_ERROR; - } - } else { - status = deflateEnd(&stream); - } - - if (status == Z_OK) { - /* resize to buffer to the "right" size */ - s2 = erealloc(s2, stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0) + 1); - - if (coding == CODING_GZIP) { - char *trailer = s2 + (stream.total_out + GZIP_HEADER_LENGTH); - uLong crc = crc32(0L, Z_NULL, 0); - - crc = crc32(crc, (const Bytef *) data, data_len); - - /* write crc & stream.total_in in LSB order */ - trailer[0] = (char) crc & 0xFF; - trailer[1] = (char) (crc >> 8) & 0xFF; - trailer[2] = (char) (crc >> 16) & 0xFF; - trailer[3] = (char) (crc >> 24) & 0xFF; - trailer[4] = (char) stream.total_in & 0xFF; - trailer[5] = (char) (stream.total_in >> 8) & 0xFF; - trailer[6] = (char) (stream.total_in >> 16) & 0xFF; - trailer[7] = (char) (stream.total_in >> 24) & 0xFF; - trailer[8] = '\0'; - } else { - s2[stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0)] = '\0'; - } - RETURN_STRINGL(s2, stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0), 0); - } else { - efree(s2); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", zError(status)); - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ php_ob_gzhandler_check - */ -int php_ob_gzhandler_check(TSRMLS_D) -{ - /* check for wrong usages */ - if (OG(ob_nesting_level > 0)) { - if (php_ob_handler_used("ob_gzhandler" TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used twice"); - return FAILURE; - } - if (php_ob_handler_used("mb_output_handler" TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used after 'mb_output_handler'"); - return FAILURE; - } - if (php_ob_handler_used("URL-Rewriter" TSRMLS_CC)) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "output handler 'ob_gzhandler' cannot be used after 'URL-Rewriter'"); - return FAILURE; - } - if (php_ob_init_conflict("ob_gzhandler", "zlib output compression" TSRMLS_CC)) { - return FAILURE; - } - } - - return SUCCESS; -} - -/* }}} */ - -/* {{{ proto string ob_gzhandler(string str, int mode) - Encode str based on accept-encoding setting - designed to be called from ob_start() */ -static PHP_FUNCTION(ob_gzhandler) -{ - char *string; - int string_len; - long mode; - zval **a_encoding; - zend_bool return_original = 0; - zend_bool do_start, do_end; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &string, &string_len, &mode) == FAILURE) { - return; - } - - if(ZLIBG(ob_gzhandler_status) == -1) - RETURN_FALSE; - - zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - - if (!PG(http_globals)[TRACK_VARS_SERVER] - || zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void **) &a_encoding) == FAILURE - ) { - ZLIBG(ob_gzhandler_status) = -1; - RETURN_FALSE; - } - - convert_to_string_ex(a_encoding); - if (php_memnstr(Z_STRVAL_PP(a_encoding), "gzip", 4, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_GZIP; - } else if (php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_DEFLATE; - } else { - ZLIBG(ob_gzhandler_status) = -1; - RETURN_FALSE; - } - - do_start = ((mode & PHP_OUTPUT_HANDLER_START) ? 1 : 0); - do_end = ((mode & PHP_OUTPUT_HANDLER_END) ? 1 : 0); - Z_STRVAL_P(return_value) = NULL; - Z_STRLEN_P(return_value) = 0; - - if (php_deflate_string(string, string_len, &Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value), do_start, do_end TSRMLS_CC) == SUCCESS) { - Z_TYPE_P(return_value) = IS_STRING; - if (do_start) { - switch (ZLIBG(compression_coding)) { - case CODING_GZIP: - if (sapi_add_header("Content-Encoding: gzip", sizeof("Content-Encoding: gzip") - 1, 1) == FAILURE) { - return_original = 1; - } - if (sapi_add_header_ex("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1, 0 TSRMLS_CC)==FAILURE) { - return_original = 1; - } - break; - case CODING_DEFLATE: - if (sapi_add_header("Content-Encoding: deflate", sizeof("Content-Encoding: deflate") - 1, 1) == FAILURE) { - return_original = 1; - } - if (sapi_add_header_ex("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding") - 1, 1, 0 TSRMLS_CC)==FAILURE) { - return_original = 1; - } - break; - default: - return_original = 1; - break; - } - } - - if (return_original) { - zval_dtor(return_value); - } - - } else { - return_original = 1; - } - - if (return_original) { - /* return the original string */ - RETURN_STRINGL(string, string_len, 1); - } -} -/* }}} */ - -/* {{{ php_gzip_output_handler - */ -static void php_gzip_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) -{ - zend_bool do_start, do_end; - - if (!ZLIBG(output_compression)) { - *handled_output = NULL; - } else { - do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0); - do_end = (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0); - if (php_deflate_string(output, output_len, handled_output, handled_output_len, do_start, do_end TSRMLS_CC) != SUCCESS) { - zend_error(E_ERROR, "Compression failed"); - } - } -} -/* }}} */ - -/* {{{ php_enable_output_compression - */ -static int php_enable_output_compression(int buffer_size TSRMLS_DC) -{ - zval **a_encoding; - - zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC); - - if (!PG(http_globals)[TRACK_VARS_SERVER] - || zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void **) &a_encoding) == FAILURE - ) { - return FAILURE; - } - - convert_to_string_ex(a_encoding); - - if (php_memnstr(Z_STRVAL_PP(a_encoding), "gzip", 4, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_GZIP; - } else if (php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) + Z_STRLEN_PP(a_encoding))) { - ZLIBG(compression_coding) = CODING_DEFLATE; - } else { - return FAILURE; - } - - php_ob_set_internal_handler(php_gzip_output_handler, (uint)buffer_size, "zlib output compression", 0 TSRMLS_CC); - - if (ZLIBG(output_handler) && strlen(ZLIBG(output_handler))) { - php_start_ob_buffer_named(ZLIBG(output_handler), 0, 1 TSRMLS_CC); - } - return SUCCESS; -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/zlib/zlib.dsp b/ext/zlib/zlib.dsp deleted file mode 100644 index 8986bc6f05..0000000000 --- a/ext/zlib/zlib.dsp +++ /dev/null @@ -1,121 +0,0 @@ -# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=zlib - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "zlib.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 "zlib.mak" CFG="zlib - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "zlib - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "zlib - 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)" == "zlib - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.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 php5ts.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_zlib.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\zlib\Release" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "zlib - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.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 php5ts_debug.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_zlib.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\zlib\Debug" - -!ENDIF - -# Begin Target - -# Name "zlib - Win32 Release_TS" -# Name "zlib - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\zlib.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_filter.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_zlib.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c deleted file mode 100644 index ad13ea7410..0000000000 --- a/ext/zlib/zlib_filter.c +++ /dev/null @@ -1,421 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 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_01.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: Sara Golemon (pollita@php.net) | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "php.h" -#include "php_zlib.h" - -/* {{{ data structure */ - -/* Passed as opaque in malloc callbacks */ -typedef struct _php_zlib_filter_data { - int persistent; - z_stream strm; - char *inbuf; - size_t inbuf_len; - char *outbuf; - size_t outbuf_len; -} php_zlib_filter_data; - -/* }}} */ - -/* {{{ Memory management wrappers */ - -static voidpf php_zlib_alloc(voidpf opaque, uInt items, uInt size) -{ - return (voidpf)safe_pemalloc(items, size, 0, ((php_zlib_filter_data*)opaque)->persistent); -} - -static void php_zlib_free(voidpf opaque, voidpf address) -{ - pefree((void*)address, ((php_zlib_filter_data*)opaque)->persistent); -} -/* }}} */ - -/* {{{ zlib.inflate filter implementation */ - -static php_stream_filter_status_t php_zlib_inflate_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_zlib_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0, original_out, original_in; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - z_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_zlib_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - original_in = data->strm.total_in; - original_out = data->strm.total_out; - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); - while (bin < bucket->buflen) { - desired = bucket->buflen - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf + bin, desired); - data->strm.avail_in = desired; - - status = inflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FINISH : Z_SYNC_FLUSH); - if (status != Z_OK && status != Z_STREAM_END) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - consumed += desired; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - /* Spit it out! */ - status = Z_OK; - while (status == Z_OK) { - status = inflate(&(data->strm), Z_FINISH); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - - return exit_status; -} - -static void php_zlib_inflate_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_zlib_filter_data *data = thisfilter->abstract; - inflateEnd(&(data->strm)); - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_zlib_inflate_ops = { - php_zlib_inflate_filter, - php_zlib_inflate_dtor, - "zlib.inflate" -}; -/* }}} */ - -/* {{{ zlib.inflate filter implementation */ - -static php_stream_filter_status_t php_zlib_deflate_filter( - php_stream *stream, - php_stream_filter *thisfilter, - php_stream_bucket_brigade *buckets_in, - php_stream_bucket_brigade *buckets_out, - size_t *bytes_consumed, - int flags - TSRMLS_DC) -{ - php_zlib_filter_data *data; - php_stream_bucket *bucket; - size_t consumed = 0, original_out, original_in; - int status; - php_stream_filter_status_t exit_status = PSFS_FEED_ME; - z_stream *streamp; - - if (!thisfilter || !thisfilter->abstract) { - /* Should never happen */ - return PSFS_ERR_FATAL; - } - - data = (php_zlib_filter_data *)(thisfilter->abstract); - streamp = &(data->strm); - original_in = data->strm.total_in; - original_out = data->strm.total_out; - - while (buckets_in->head) { - size_t bin = 0, desired; - - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); - - while (bin < bucket->buflen) { - desired = bucket->buflen - bin; - if (desired > data->inbuf_len) { - desired = data->inbuf_len; - } - memcpy(data->strm.next_in, bucket->buf + bin, desired); - data->strm.avail_in = desired; - - status = deflate(&(data->strm), flags & PSFS_FLAG_FLUSH_CLOSE ? Z_FULL_FLUSH : (flags & PSFS_FLAG_FLUSH_INC ? Z_SYNC_FLUSH : Z_NO_FLUSH)); - if (status != Z_OK) { - /* Something bad happened */ - php_stream_bucket_delref(bucket TSRMLS_CC); - return PSFS_ERR_FATAL; - } - desired -= data->strm.avail_in; /* desired becomes what we consumed this round through */ - data->strm.next_in = data->inbuf; - data->strm.avail_in = 0; - consumed += desired; - bin += desired; - - if (data->strm.avail_out < data->outbuf_len) { - php_stream_bucket *out_bucket; - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - out_bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, out_bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - php_stream_bucket_delref(bucket TSRMLS_CC); - } - - if (flags & PSFS_FLAG_FLUSH_CLOSE) { - /* Spit it out! */ - status = Z_OK; - while (status == Z_OK) { - status = deflate(&(data->strm), Z_FINISH); - if (data->strm.avail_out < data->outbuf_len) { - size_t bucketlen = data->outbuf_len - data->strm.avail_out; - - bucket = php_stream_bucket_new(stream, estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC); - php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); - data->strm.avail_out = data->outbuf_len; - data->strm.next_out = data->outbuf; - exit_status = PSFS_PASS_ON; - } - } - } - - if (bytes_consumed) { - *bytes_consumed = consumed; - } - return exit_status; -} - -static void php_zlib_deflate_dtor(php_stream_filter *thisfilter TSRMLS_DC) -{ - if (thisfilter && thisfilter->abstract) { - php_zlib_filter_data *data = thisfilter->abstract; - deflateEnd(&(data->strm)); - pefree(data->inbuf, data->persistent); - pefree(data->outbuf, data->persistent); - pefree(data, data->persistent); - } -} - -static php_stream_filter_ops php_zlib_deflate_ops = { - php_zlib_deflate_filter, - php_zlib_deflate_dtor, - "zlib.deflate" -}; - -/* }}} */ - -/* {{{ zlib.* common factory */ - -static php_stream_filter *php_zlib_filter_create(const char *filtername, zval *filterparams, int persistent TSRMLS_DC) -{ - php_stream_filter_ops *fops = NULL; - php_zlib_filter_data *data; - int status; - - /* Create this filter */ - data = pecalloc(1, sizeof(php_zlib_filter_data), persistent); - if (!data) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %ld bytes.", sizeof(php_zlib_filter_data)); - return NULL; - } - - /* Circular reference */ - data->strm.opaque = (voidpf) data; - - data->strm.zalloc = (alloc_func) php_zlib_alloc; - data->strm.zfree = (free_func) php_zlib_free; - data->strm.avail_out = data->outbuf_len = data->inbuf_len = 2048; - data->strm.next_in = data->inbuf = (Bytef *) pemalloc(data->inbuf_len, persistent); - if (!data->inbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %ld bytes.", data->inbuf_len); - pefree(data, persistent); - return NULL; - } - data->strm.avail_in = 0; - data->strm.next_out = data->outbuf = (Bytef *) pemalloc(data->outbuf_len, persistent); - if (!data->outbuf) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed allocating %ld bytes.", data->outbuf_len); - pefree(data->inbuf, persistent); - pefree(data, persistent); - return NULL; - } - - data->strm.data_type = Z_ASCII; - - if (strcasecmp(filtername, "zlib.inflate") == 0) { - int windowBits = -MAX_WBITS; - - if (filterparams) { - zval **tmpzval; - - if ((Z_TYPE_P(filterparams) == IS_ARRAY || Z_TYPE_P(filterparams) == IS_OBJECT) && - zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void **) &tmpzval) == SUCCESS) { - /* log-2 base of history window (9 - 15) */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - windowBits = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - } - - /* RFC 1951 Inflate */ - status = inflateInit2(&(data->strm), windowBits); - fops = &php_zlib_inflate_ops; - } else if (strcasecmp(filtername, "zlib.deflate") == 0) { - /* RFC 1951 Deflate */ - int level = Z_DEFAULT_COMPRESSION; - int windowBits = -MAX_WBITS; - int memLevel = MAX_MEM_LEVEL; - - - if (filterparams) { - zval **tmpzval; - - /* filterparams can either be a scalar value to indicate compression level (shortcut method) - Or can be a hash containing one or more of 'window', 'memory', and/or 'level' members. */ - - switch (Z_TYPE_P(filterparams)) { - case IS_ARRAY: - case IS_OBJECT: - if (zend_hash_find(HASH_OF(filterparams), "memory", sizeof("memory"), (void**) &tmpzval) == SUCCESS) { - /* Memory Level (1 - 9) */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < 1 || Z_LVAL_PP(tmpzval) > MAX_MEM_LEVEL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for memory level. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - memLevel = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - - if (zend_hash_find(HASH_OF(filterparams), "window", sizeof("window"), (void**) &tmpzval) == SUCCESS) { - /* log-2 base of history window (9 - 15) */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < -MAX_WBITS || Z_LVAL_PP(tmpzval) > MAX_WBITS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - windowBits = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - } - - if (zend_hash_find(HASH_OF(filterparams), "level", sizeof("level"), (void**) &tmpzval) == SUCCESS) { - /* Psuedo pass through to catch level validating code */ - goto factory_setlevel; - } - break; - case IS_STRING: - case IS_DOUBLE: - case IS_LONG: - tmpzval = &filterparams; -factory_setlevel: - /* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */ - SEPARATE_ZVAL(tmpzval); - convert_to_long_ex(tmpzval); - if (Z_LVAL_PP(tmpzval) < -1 || Z_LVAL_PP(tmpzval) > 9) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid compression level specified. (%ld)", Z_LVAL_PP(tmpzval)); - } else { - level = Z_LVAL_PP(tmpzval); - } - zval_ptr_dtor(tmpzval); - break; - default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filter parameter, ignored."); - } - } - status = deflateInit2(&(data->strm), level, Z_DEFLATED, windowBits, memLevel, 0); - fops = &php_zlib_deflate_ops; - } else { - status = Z_DATA_ERROR; - } - - if (status != Z_OK) { - /* Unspecified (probably strm) error, let stream-filter error do its own whining */ - pefree(data->strm.next_in, persistent); - pefree(data->strm.next_out, persistent); - pefree(data, persistent); - return NULL; - } - - return php_stream_filter_alloc(fops, data, persistent); -} - -php_stream_filter_factory php_zlib_filter_factory = { - php_zlib_filter_create -}; -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 fdm=marker - * vim<600: sw=4 ts=4 - */ diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c deleted file mode 100644 index 631db81819..0000000000 --- a/ext/zlib/zlib_fopen_wrapper.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 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_01.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: Wez Furlong <wez@thebrainroom.com>, based on work by: | - | Hartmut Holzgraefe <hholzgra@php.net> | - +----------------------------------------------------------------------+ - */ - -/* $Id$ */ - -#define _GNU_SOURCE - -#include "php.h" -#include "php_zlib.h" -#include "fopen_wrappers.h" - -struct php_gz_stream_data_t { - gzFile gz_file; - php_stream *stream; -}; - -static size_t php_gziop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - int read; - - read = gzread(self->gz_file, buf, count); - - if (gzeof(self->gz_file)) { - stream->eof = 1; - } - - return (read < 0) ? 0 : read; -} - -static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - int wrote; - - wrote = gzwrite(self->gz_file, (char *) buf, count); - - return (wrote < 0) ? 0 : wrote; -} - -static int php_gziop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - - assert(self != NULL); - - *newoffs = gzseek(self->gz_file, offset, whence); - - return (*newoffs < 0) ? -1 : 0; -} - -static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - int ret = EOF; - - if (close_handle) { - if (self->gz_file) { - ret = gzclose(self->gz_file); - self->gz_file = NULL; - } - if (self->stream) { - php_stream_close(self->stream); - self->stream = NULL; - } - } - efree(self); - - return ret; -} - -static int php_gziop_flush(php_stream *stream TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *) stream->abstract; - - return gzflush(self->gz_file, Z_SYNC_FLUSH); -} - -static php_stream_ops php_stream_gzio_ops = { - php_gziop_write, php_gziop_read, - php_gziop_close, php_gziop_flush, - "ZLIB", - php_gziop_seek, - NULL, /* cast */ - NULL, /* stat */ - NULL /* set_option */ -}; - -php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char *mode, int options, - char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) -{ - struct php_gz_stream_data_t *self = {0}; - php_stream *stream = NULL, *innerstream = NULL; - - /* sanity check the stream: it can be either read-only or write-only */ - if (strchr(mode, '+')) { - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open a zlib stream for reading and writing at the same time!"); - } - return NULL; - } - - self = emalloc(sizeof(*self)); - - if (strncasecmp("compress.zlib://", path, 16) == 0) { - path += 16; - } else if (strncasecmp("zlib:", path, 5) == 0) { - path += 5; - } - - innerstream = php_stream_open_wrapper(path, mode, STREAM_MUST_SEEK | options | STREAM_WILL_CAST, opened_path); - - if (innerstream) { - int fd; - - if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) { - self->gz_file = gzdopen(fd, mode); - self->stream = innerstream; - if (self->gz_file) { - stream = php_stream_alloc_rel(&php_stream_gzio_ops, self, 0, mode); - if (stream) { - stream->flags |= PHP_STREAM_FLAG_NO_BUFFER; - return stream; - } - gzclose(self->gz_file); - } - if (options & REPORT_ERRORS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzopen failed"); - } - } else if (innerstream) { - php_stream_close(innerstream); - } - } - - if (stream) { - php_stream_close(stream); - } - - if (self) { - efree(self); - } - - return NULL; -} - -static php_stream_wrapper_ops gzip_stream_wops = { - php_stream_gzopen, - NULL, /* close */ - NULL, /* stat */ - NULL, /* stat_url */ - NULL, /* opendir */ - "ZLIB", - NULL, /* unlink */ - NULL, /* rename */ - NULL, /* mkdir */ - NULL /* rmdir */ -}; - -php_stream_wrapper php_stream_gzip_wrapper = { - &gzip_stream_wops, - NULL, - 0, /* is_url */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/zlib/zlib_win32_howto.txt b/ext/zlib/zlib_win32_howto.txt deleted file mode 100644 index a4e01a4845..0000000000 --- a/ext/zlib/zlib_win32_howto.txt +++ /dev/null @@ -1,16 +0,0 @@ -Rules for building ZLIB ------------------------ - -The zlib project requires the folowing files: - -php_build\zlib\include\zlib.h -php_build\zlib\include\zconf.h -php_build\zlib\lib\zlibstat.lib - -php_build is a directory at the same level as php5. - -Start Visual Studio, load php_modules.dsw, select the ZLIB projects, and build -it. - - -
\ No newline at end of file |