|
Moodle
2.2.1
http://www.collinsharper.com
|

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) | |
Data Fields | |
| const | OPEN = 1 |
| const | CREATE = 2 |
| const | OVERWRITE = 4 |
Protected Member Functions | |
| mangle_pathname ($localname) | |
| unmangle_pathname ($localname) | |
Protected Attributes | |
| $encoding = 'utf-8' | |
Definition at line 38 of file file_archive.php.
| add_directory | ( | $ | localname | ) | [abstract] |
Add empty directory into archive
| string | $local |
Reimplemented in zip_archive.

| add_file_from_pathname | ( | $ | localname, |
| $ | pathname | ||
| ) | [abstract] |
Add file into archive
| string | $localname | name of file in archive |
| string | $pathname | location of file |
Reimplemented in zip_archive.

| add_file_from_string | ( | $ | localname, |
| $ | contents | ||
| ) | [abstract] |
Add content of string into archive
| string | $localname | name of file in archive |
| string | $contents |
Reimplemented in zip_archive.
| close | ( | ) | [abstract] |
| count | ( | ) | [abstract] |
| get_info | ( | $ | index | ) | [abstract] |
Returns file information
| int | $index | of file |
Reimplemented in zip_archive.
| get_stream | ( | $ | index | ) | [abstract] |
Returns file stream for reading of content
| int | $index | of file |
Reimplemented in zip_archive.
| list_files | ( | ) | [abstract] |
Returns array of info about all files in archive
Reimplemented in zip_archive.
| mangle_pathname | ( | $ | localname | ) | [protected] |
Tries to convert $localname into another encoding, please note that it may fail really badly.
| string | $localname | in utf-8 encoding |
Definition at line 122 of file file_archive.php.


| open | ( | $ | archivepathname, |
| $ | mode = file_archive::CREATE, |
||
| $ | encoding = 'utf-8' |
||
| ) | [abstract] |
Open or create archive (depending on $mode)
| string | $archivepathname | |
| int | $mode | OPEN, CREATE or OVERWRITE constant |
| string | $encoding | archive local paths encoding |
Reimplemented in zip_archive.
| unmangle_pathname | ( | $ | localname | ) | [protected] |
Tries to convert $localname into utf-8 please note that it may fail really badly. The resulting file name is cleaned.
| string | $localname | in $this->encoding |
Definition at line 167 of file file_archive.php.


$encoding = 'utf-8' [protected] |
Encoding of file names - windows usually expects DOS single-byte charset
Definition at line 50 of file file_archive.php.
| const CREATE = 2 |
Open archive if exists, create if does not.
Definition at line 44 of file file_archive.php.
| const OPEN = 1 |
Open archive if exists, fail if does not exist.
Definition at line 41 of file file_archive.php.
| const OVERWRITE = 4 |
Always create new archive
Definition at line 47 of file file_archive.php.