public class ZlibModule extends AbstractQuercusModule
Modifier and Type | Field and Description |
---|---|
static int |
FORCE_DEFLATE |
static int |
FORCE_GZIP |
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
Constructor and Description |
---|
ZlibModule() |
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getLoadedExtensions()
Returns the extensions loaded by the module.
|
boolean |
gzclose(BinaryStream os)
Closes the stream.
|
Value |
gzcompress(Env env,
java.io.InputStream data,
int level)
compresses data using zlib
|
Value |
gzdeflate(Env env,
java.io.InputStream data,
int level) |
Value |
gzencode(Env env,
java.io.InputStream is,
int level,
int encodingMode)
Compresses data using the Deflate algorithm, output is
compatible with gzwrite's output
|
boolean |
gzeof(BinaryStream binaryStream)
Returns true if the GZip stream is ended.
|
static ArrayValue |
gzfile(Env env,
StringValue fileName,
boolean useIncludePath) |
static Value |
gzgetc(Env env,
BinaryInput is)
Reads a character from the stream.
|
static Value |
gzgets(Env env,
BinaryInput is,
int length)
Reads a line from the input stream.
|
static Value |
gzgetss(Env env,
BinaryInput is,
int length,
Value allowedTags)
Reads a line from the zip stream, stripping tags.
|
Value |
gzinflate(Env env,
java.io.InputStream data,
int length) |
static BinaryStream |
gzopen(Env env,
StringValue fileName,
java.lang.String mode,
boolean useIncludePath) |
Value |
gzpassthru(Env env,
BinaryInput is)
Prints out the remaining data in the stream to stdout
|
int |
gzputs(Env env,
BinaryOutput os,
java.io.InputStream is,
int length) |
Value |
gzread(BinaryInput is,
int length)
Reads a chunk of data from the gzip stream.
|
boolean |
gzrewind(BinaryStream binaryStream)
Rewinds the stream to the very beginning
|
int |
gzseek(BinaryStream binaryStream,
long offset,
int whence)
Set stream position to the offset
|
Value |
gztell(BinaryStream binaryStream)
Gets the current position in the stream
|
Value |
gzuncompress(Env env,
java.io.InputStream is,
long length) |
static int |
gzwrite(BinaryOutput os,
java.io.InputStream is,
int length)
Writes a string to the gzip stream.
|
static Value |
ob_gzhandler(Env env,
StringValue buffer,
int state) |
static Value |
readgzfile(Env env,
StringValue fileName,
boolean useIncludePath)
outputs uncompressed bytes directly to browser, writes a warning message
if an error has occured
Note: PHP5 is supposed to print an error message but it doesn't do it
|
Value |
zlib_get_coding_type(Env env)
Returns the encoding type both allowed by the server
and supported by the user's browser.
|
addConstant, addConstant, addConstant, getConstMap, getIniDefinitions
public static final int FORCE_GZIP
public static final int FORCE_DEFLATE
public java.lang.String[] getLoadedExtensions()
AbstractQuercusModule
getLoadedExtensions
in interface QuercusModule
getLoadedExtensions
in class AbstractQuercusModule
public static BinaryStream gzopen(Env env, StringValue fileName, java.lang.String mode, boolean useIncludePath)
env
- fileName
- mode
- useIncludePath
- always onpublic static ArrayValue gzfile(Env env, StringValue fileName, boolean useIncludePath)
env
- fileName
- useIncludePath
- public static Value ob_gzhandler(Env env, StringValue buffer, int state)
public static Value readgzfile(Env env, StringValue fileName, boolean useIncludePath)
env
- fileName
- useIncludePath
- public static int gzwrite(BinaryOutput os, java.io.InputStream is, int length)
public int gzputs(Env env, BinaryOutput os, java.io.InputStream is, int length)
env
- zp
- s
- length
- public boolean gzclose(BinaryStream os)
public boolean gzeof(BinaryStream binaryStream)
public static Value gzgetc(Env env, BinaryInput is)
public Value gzread(BinaryInput is, int length)
public static Value gzgets(Env env, BinaryInput is, int length)
public static Value gzgetss(Env env, BinaryInput is, int length, Value allowedTags)
public boolean gzrewind(BinaryStream binaryStream)
public int gzseek(BinaryStream binaryStream, long offset, int whence)
offset
- absolute position to set stream towhence
- if set, changes the interpretation of offset like fseekpublic Value gztell(BinaryStream binaryStream)
public Value gzpassthru(Env env, BinaryInput is)
public Value zlib_get_coding_type(Env env)
public Value gzcompress(Env env, java.io.InputStream data, int level)
data
- level
- (default is Deflater.DEFAULT_COMPRESSION)public Value gzuncompress(Env env, java.io.InputStream is, long length)
data
- length
- (maximum length of string returned)public Value gzdeflate(Env env, java.io.InputStream data, int level)
level
- public Value gzinflate(Env env, java.io.InputStream data, int length)
data
- compressed using Deflate algorithmlength
- of data to decompresspublic Value gzencode(Env env, java.io.InputStream is, int level, int encodingMode)
data
- compressed with the Deflate algorithmlevel
- Deflate compresion level [0-9]encodingMode
- CRC32 trailer is not written if encoding mode
is FORCE_DEFLATE, default is to write CRC32