Moodle  2.2.1
http://www.collinsharper.com
zip_archive Class Reference
Inheritance diagram for zip_archive:
Collaboration diagram for zip_archive:

Public Member Functions

 open ($archivepathname, $mode=file_archive::CREATE, $encoding='utf-8')
 close ()
 get_stream ($index)
 get_info ($index)
 list_files ()
 count ()
 add_file_from_pathname ($localname, $pathname)
 add_file_from_string ($localname, $contents)
 add_directory ($localname)
 current ()
 key ()
 next ()
 rewind ()
 valid ()

Protected Attributes

 $archivepathname = null
 $usedmem = 0
 $pos = 0
 $za

Detailed Description

Definition at line 40 of file zip_archive.php.


Member Function Documentation

add_directory ( localname)

Add empty directory into archive

Parameters:
string$local
Returns:
bool success

Reimplemented from file_archive.

Definition at line 279 of file zip_archive.php.

Here is the call graph for this function:

add_file_from_pathname ( localname,
pathname 
)

Add file into archive

Parameters:
string$localnamename of file in archive
string$pathnamelocation of file
Returns:
bool success

Reimplemented from file_archive.

Definition at line 206 of file zip_archive.php.

Here is the call graph for this function:

add_file_from_string ( localname,
contents 
)

Add content of string into archive

Parameters:
string$localnamename of file in archive
string$contents
Returns:
bool success

this prevents running out of memory when adding many large files using strings

Reimplemented from file_archive.

Definition at line 247 of file zip_archive.php.

Here is the call graph for this function:

close ( )

Close archive

Returns:
bool success

Reimplemented from file_archive.

Definition at line 100 of file zip_archive.php.

Here is the caller graph for this function:

count ( )

Returns number of files in archive

Returns:
int number of files

Reimplemented from file_archive.

Definition at line 192 of file zip_archive.php.

Here is the caller graph for this function:

current ( )

Returns current file info

Returns:
object

Definition at line 298 of file zip_archive.php.

Here is the call graph for this function:

get_info ( index)

Returns file information

Parameters:
int$indexof file
Returns:
info object or false if error

Reimplemented from file_archive.

Definition at line 134 of file zip_archive.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_stream ( index)

Returns file stream for reading of content

Parameters:
int$indexof file
Returns:
resource or false if error

Reimplemented from file_archive.

Definition at line 116 of file zip_archive.php.

key ( )

Returns the index of current file

Returns:
int current file index

Definition at line 310 of file zip_archive.php.

Returns array of info about all files in archive

Returns:
array of file infos

Reimplemented from file_archive.

Definition at line 170 of file zip_archive.php.

Here is the call graph for this function:

next ( )

Moves forward to next file

Returns:
void

Definition at line 318 of file zip_archive.php.

open ( archivepathname,
mode = file_archive::CREATE,
encoding = 'utf-8' 
)

Open or create archive (depending on $mode)

Parameters:
string$archivepathname
int$modeOPEN, CREATE or OVERWRITE constant
string$encodingarchive local paths encoding
Returns:
bool success

Reimplemented from file_archive.

Definition at line 61 of file zip_archive.php.

Here is the call graph for this function:

Here is the caller graph for this function:

rewind ( )

Rewinds back to the first file

Returns:
void

Definition at line 326 of file zip_archive.php.

valid ( )

Did we reach the end?

Returns:
boolean

Definition at line 334 of file zip_archive.php.

Here is the call graph for this function:


Field Documentation

$archivepathname = null [protected]

Pathname of archive

Definition at line 43 of file zip_archive.php.

$pos = 0 [protected]

Iteration position

Definition at line 49 of file zip_archive.php.

$usedmem = 0 [protected]

Used memory tracking

Definition at line 46 of file zip_archive.php.

$za [protected]

TipArchive instance

Definition at line 52 of file zip_archive.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations