OpenDocumentPHP
[ class tree: OpenDocumentPHP ] [ index: OpenDocumentPHP ] [ all elements ]

Class: OpenDocumentArchive

Source Location: /OpenDocumentArchive.php

Class Overview

ZipArchive
   |
   --OpenDocumentArchive

OpenDocumentArchive class.


Author(s):

  • Norman Markgraf (nmarkgraf(at)user.sourceforge.net)

Version:

  • $Revision: 182 $

Copyright:

  • Copyright in 2006, 2007 by The OpenDocumentPHP Team

Constants

Methods


Child classes:

OpenDocumentAbstract
OpenDocumentAbstract class.

Inherited Constants

Class: ZipArchive (Internal Class)

CHECKCONS = 4
CM_DEFAULT = -1
CM_DEFLATE = 8
CM_DEFLATE64 = 9
CM_IMPLODE = 6
CM_PKWARE_IMPLODE = 10
CM_REDUCE_1 = 2
CM_REDUCE_2 = 3
CM_REDUCE_3 = 4
CM_REDUCE_4 = 5
CM_SHRINK = 1
CM_STORE = 0
CREATE = 1
ER_CHANGED = 15
ER_CLOSE = 3
ER_COMPNOTSUPP = 16
ER_CRC = 7
ER_DELETED = 23
ER_EOF = 17
ER_EXISTS = 10
ER_INCONS = 21
ER_INTERNAL = 20
ER_INVAL = 18
ER_MEMORY = 14
ER_MULTIDISK = 1
ER_NOENT = 9
ER_NOZIP = 19
ER_OK = 0
ER_OPEN = 11
ER_READ = 5
ER_REMOVE = 22
ER_RENAME = 2
ER_SEEK = 4
ER_TMPOPEN = 12
ER_WRITE = 6
ER_ZIPCLOSED = 8
ER_ZLIB = 13
EXCL = 2
FL_COMPRESSED = 4
FL_NOCASE = 1
FL_NODIR = 2
FL_UNCHANGED = 8
OVERWRITE = 8

Inherited Methods

Class: ZipArchive (Internal Class)

addEmptyDir ( )
addFile ( )
addFromString ( )
close ( )
deleteIndex ( )
deleteName ( )
extractTo ( )
getArchiveComment ( )
getCommentIndex ( )
getCommentName ( )
getFromIndex ( )
getFromName ( )
getNameIndex ( )
getStream ( )
locateName ( )
open ( )
renameIndex ( )
renameName ( )
setArchiveComment ( )
setCommentIndex ( )
setCommentName ( )
statIndex ( )
statName ( )
unchangeAll ( )
unchangeArchive ( )
unchangeIndex ( )
unchangeName ( )

Class Details

[line 49]
OpenDocumentArchive class.

This is a extension of the class ZipArchive to handle OpenDocumentArchives. That is a file that, like jar archives in java, have meta informations. Unlike in jar files, this meta informations are stored in a XML file named 'manifest.xml' in the 'META-INF' directory of the ZIP archive.

This class will handle everything needed.

YOU NEED AT LEAST PHP 5.2.0 !!!

$Id: OpenDocumentArchive.php 182 2007-06-11 13:32:34Z nmarkgraf $




Tags:

author:  Norman Markgraf (nmarkgraf(at)user.sourceforge.net)
version:  $Revision: 182 $
copyright:  Copyright in 2006, 2007 by The OpenDocumentPHP Team
since:  0.5.0
license:  GNU Public License 2.0 or above.


[ Top ]


Class Methods


method addFile [line 83]

void addFile( string $filename, [string $localname = ''], [string $mimetype = 'text/text'])

Adds a file to a ZIP archive from the given path.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::addFile ( ) (parent method not documented)

Parameters:

string   $filename   localname The name of the entry to create.
string   $localname   filename The path to the file to add.
string   $mimetype   mimetype Mime type of the file.

[ Top ]

method addFromString [line 106]

void addFromString( string $localname, string $contents, [string $mimetype = 'text/text'])

Add a file to a ZIP archive using its contents.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::addFromString ( ) (parent method not documented)

Parameters:

string   $localname   localname The name of the entry to create.
string   $contents   contents The contents to use to create the entry. It is used in a binary safe mode.
string   $mimetype   mimetype Mime type of the file.

[ Top ]

method close [line 340]

void close( )

Close opened or created archive and save changes. This method is automatically called at the end of the script.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Overridden in child classes as:

OpenDocumentAbstract::close()

Overrides ZipArchive::close ( ) (parent method not documented)

[ Top ]

method deleteIndex [line 203]

void deleteIndex( int $index)

Delete an entry in the archive using its index.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::deleteIndex ( ) (parent method not documented)

Parameters:

int   $index   index Index of the entry to delete.

[ Top ]

method deleteName [line 187]

void deleteName( string $name)

Delete an entry in the archive using its name.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::deleteName ( ) (parent method not documented)

Parameters:

string   $name   name Name of the entry to delete.

[ Top ]

method getDOMFromName [line 286]

void getDOMFromName( $filename)



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Parameters:

   $filename  

[ Top ]

method getFilelist [line 278]

void getFilelist( )



Tags:

since:  0.5.0 - 08.02.2007
access:  public


[ Top ]

method getManifest [line 296]

void getManifest( )



Tags:

since:  0.5.0 - 08.02.2007
access:  public


[ Top ]

method getMimeType [line 122]

string getMimeType( )

Retrieve mime type of the OpenDocument archive.



Tags:

return:  Current mime type of the OpenDocument archive.
since:  0.5.0 - 08.02.2007
access:  public


[ Top ]

constructor __construct [line 71]

OpenDocumentArchive __construct( [string $mimetype = ''])

Constructor method.



Tags:

since:  0.5.0 - 08.02.2007


Overridden in child classes as:

OpenDocumentText::__construct()
Constructor method.
OpenDocumentSpreadsheet::__construct()
Constructor method.

Parameters:

string   $mimetype   mimetype Mime type of the achrive

[ Top ]

method open [line 157]

mixed open( string $filename, [int $flags = 0], [ $mimetype = ''])

Opens a new zip archive for reading, writing or modifying.

If we create a new archive, we add to files. First the manifest document stored in the ManifestDocument and second the file 'mimetype' which only include the




Tags:

since:  0.5.0 - 08.02.2007
access:  public


Overridden in child classes as:

OpenDocumentAbstract::open()
Open an OpenDocument and read the meta.xml and settings data.

Overrides ZipArchive::open ( ) (parent method not documented)

Parameters:

string   $filename   filename The file name of the ZIP archive to open.
int   $flags   flags The mode to use to open the archive.
   $mimetype  

[ Top ]

method renameIndex [line 220]

void renameIndex( int $index, string $newname)

Renames an entry defined by its index.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::renameIndex ( ) (parent method not documented)

Parameters:

int   $index   index Index of the entry to rename.
string   $newname   newname New name.

[ Top ]

method renameName [line 237]

void renameName( string $name, string $newname)

Renames an entry defined by its name.



Tags:

since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::renameName ( ) (parent method not documented)

Parameters:

string   $name   name Name of the entry to rename.
string   $newname   newname New name.

[ Top ]

method setMimeType [line 135]

void setMimeType( string $mimetype)

Set mime type of the OpenDocument archive.

Therefor we delete the file 'mimetype' in the current OpenDocument archive and add a new file 'mimetype' with the new mime type given as parameter $mimetype.




Tags:

since:  0.5.0 - 08.02.2007
access:  public


Parameters:

string   $mimetype   New mime type of the OpenDocument archive.

[ Top ]

method statName [line 255]

mixed statName( string $name, [int $flags = 0])

Get the details of an entry defined by its name.

The function obtains information about the entry defined by its name.




Tags:

return:  Returns an array containing the entry details or FALSE on failure.
since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::statName ( ) (parent method not documented)

Parameters:

string   $name   name Name of the entry.
int   $flags   flags The flags argument specifies how the name lookup should be done. Also, ZIPARCHIVE::FL_UNCHANGED may be ORed to it to request information about the original file in the archive, ignoring any changes made.

[ Top ]

method unchangeAll [line 330]

boolean unchangeAll( )

Undo all changes done in the archive. Always returns false!



Tags:

return:  Returns true if success, false if not.
since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::unchangeAll ( ) (parent method not documented)

[ Top ]

method unchangeIndex [line 320]

boolean unchangeIndex( int $index)

Revert all changes done to an entry at the given index.

Always returns false!




Tags:

return:  Returns true if success, false if not.
since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::unchangeIndex ( ) (parent method not documented)

Parameters:

int   $index   index Index of the entry.

[ Top ]

method unchangeName [line 308]

boolean unchangeName( string $index)

Revert all changes done to an entry with the given name.

Always returns false!




Tags:

return:  Returns true if success, false if not.
since:  0.5.0 - 08.02.2007
access:  public


Overrides ZipArchive::unchangeName ( ) (parent method not documented)

Parameters:

string   $index   Name of the entry.

[ Top ]


Class Constants

NOMANIFEST =  1024

[line 57]

No Manifest was found in Archive that where opened.


[ Top ]

PathToManifestXml =  'META-INF/manifest.xml'

[line 53]

Full path to manifest xml in the OpenDocument archive.


[ Top ]



Documentation generated on Tue, 12 Jun 2007 10:00:27 +0200 by phpDocumentor 1.3.2