com.caucho.quercus.lib.zip
Class ZipModule

java.lang.Object
  extended by com.caucho.quercus.module.AbstractQuercusModule
      extended by com.caucho.quercus.lib.zip.ZipModule
All Implemented Interfaces:
QuercusModule

public class ZipModule
extends AbstractQuercusModule

PHP Zip


Field Summary
 
Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
 
Constructor Summary
ZipModule()
           
 
Method Summary
 java.lang.String[] getLoadedExtensions()
          Returns the extensions loaded by the module.
 boolean zip_close(ZipDirectory directory)
          Closes the file.
 boolean zip_entry_close(Env env, QuercusZipEntry entry)
          Closes this entry's stream.
 long zip_entry_compressedsize(QuercusZipEntry entry)
          Returns the size of the compressed data.
 java.lang.String zip_entry_compressionmethod(QuercusZipEntry entry)
          Returns the compression method used for this entry.
 Value zip_entry_filesize(QuercusZipEntry entry)
          Returns the file's uncompressed size.
 Value zip_entry_name(Env env, QuercusZipEntry entry)
          Returns the file name.
 boolean zip_entry_open(Env env, ZipDirectory directory, QuercusZipEntry entry, java.lang.String mode)
          Opens entry for decompression.
 StringValue zip_entry_read(Env env, QuercusZipEntry entry, int length)
          Reads and decompresses entry's compressed data.
 ZipDirectory zip_open(Env env, StringValue filename)
          Opens stream to read zip entries.
 QuercusZipEntry zip_read(Env env, ZipDirectory directory)
          Reads an entry's metadata from the zip stream.
 
Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule
addConstant, addConstant, addConstant, getConstMap, getIniDefinitions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipModule

public ZipModule()
Method Detail

getLoadedExtensions

public java.lang.String[] getLoadedExtensions()
Description copied from class: AbstractQuercusModule
Returns the extensions loaded by the module.

Specified by:
getLoadedExtensions in interface QuercusModule
Overrides:
getLoadedExtensions in class AbstractQuercusModule

zip_open

public ZipDirectory zip_open(Env env,
                             StringValue filename)
Opens stream to read zip entries. Since we're only reading, fopen mode is always "rb".


zip_read

public QuercusZipEntry zip_read(Env env,
                                ZipDirectory directory)
Reads an entry's metadata from the zip stream. It appears PHP's zip_read also does a zip_entry_open.


zip_entry_name

public Value zip_entry_name(Env env,
                            QuercusZipEntry entry)
Returns the file name.

Returns:
false if zipEntry is null

zip_entry_filesize

public Value zip_entry_filesize(QuercusZipEntry entry)
Returns the file's uncompressed size.

Returns:
false if zipEntry is null

zip_close

public boolean zip_close(ZipDirectory directory)
Closes the file.


zip_entry_open

public boolean zip_entry_open(Env env,
                              ZipDirectory directory,
                              QuercusZipEntry entry,
                              java.lang.String mode)
Opens entry for decompression.

Returns:
true on success or false on failure

zip_entry_close

public boolean zip_entry_close(Env env,
                               QuercusZipEntry entry)
Closes this entry's stream.

Returns:
true if successful, else false;

zip_entry_read

public StringValue zip_entry_read(Env env,
                                  QuercusZipEntry entry,
                                  int length)
Reads and decompresses entry's compressed data.

Returns:
false or decompressed BinaryValue

zip_entry_compressionmethod

public java.lang.String zip_entry_compressionmethod(QuercusZipEntry entry)
Returns the compression method used for this entry. Only "deflate" and "store" are supported.

Returns:
empty string, stored or deflated

zip_entry_compressedsize

public long zip_entry_compressedsize(QuercusZipEntry entry)
Returns the size of the compressed data.

Returns:
-1, or compressed size