Class used for creating ZIP archives.
More...
|
static | file_instance (string $filename) |
| Return the file instance.
|
|
static | get_file_writer (string $filepath, string $type) |
| Returns the file writer.
|
|
static | get_stream_writer (string $filename, string $type) |
| Returns the stream writer.
|
|
static | stream_instance (string $filename) |
| Return the stream instance.
|
|
|
const | ZIP_WRITER = 'zip_writer' |
| The zip writer class.
|
|
|
static | get_classname_for_type (string $type) |
| Returns the class name for the type that was provided in get_file_writer().
|
|
Class used for creating ZIP archives.
- Copyright
- 2020 Mark Nelson mdjne.nosp@m.lson.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_files\local\archive_writer\zip_writer::__construct |
( |
ZipStream | $archive | ) |
|
|
protected |
The zip_writer constructor.
- Parameters
-
◆ add_file_from_filepath()
core_files\local\archive_writer\zip_writer::add_file_from_filepath |
( |
string | $name, |
|
|
string | $path ) |
Adds a file from a file path.
- Parameters
-
string | $name | The path of file in archive (including directory). |
string | $path | The path to file on disk (note: paths should be encoded using UNIX-style forward slashes – e.g '/path/to/some/file'). |
Reimplemented from core_files\archive_writer.
◆ add_file_from_stored_file()
core_files\local\archive_writer\zip_writer::add_file_from_stored_file |
( |
string | $name, |
|
|
stored_file | $file ) |
◆ add_file_from_stream()
core_files\local\archive_writer\zip_writer::add_file_from_stream |
( |
string | $name, |
|
|
| $stream ) |
Adds a file from a stream.
- Parameters
-
string | $name | The path of file in archive (including directory). |
resource | $stream | The contents of file as a stream resource |
Reimplemented from core_files\archive_writer.
◆ add_file_from_string()
core_files\local\archive_writer\zip_writer::add_file_from_string |
( |
string | $name, |
|
|
string | $data ) |
Adds a file from a string.
- Parameters
-
string | $name | The path of file in archive (including directory). |
string | $data | The contents of file |
Reimplemented from core_files\archive_writer.
◆ file_instance()
static core_files\local\archive_writer\zip_writer::file_instance |
( |
string | $filename | ) |
|
|
static |
◆ finish()
core_files\local\archive_writer\zip_writer::finish |
( |
| ) |
|
◆ get_classname_for_type()
static core_files\archive_writer::get_classname_for_type |
( |
string | $type | ) |
|
|
staticprotectedinherited |
Returns the class name for the type that was provided in get_file_writer().
- Parameters
-
- Return values
-
◆ get_file_writer()
static core_files\archive_writer::get_file_writer |
( |
string | $filepath, |
|
|
string | $type ) |
|
staticinherited |
Returns the file writer.
- Parameters
-
string | $filepath | |
string | $type | |
- Return values
-
◆ get_path_to_zip()
core_files\local\archive_writer\zip_writer::get_path_to_zip |
( |
| ) |
|
◆ get_stream_writer()
static core_files\archive_writer::get_stream_writer |
( |
string | $filename, |
|
|
string | $type ) |
|
staticinherited |
Returns the stream writer.
- Parameters
-
string | $filename | |
string | $type | |
- Return values
-
◆ sanitise_filepath()
core_files\archive_writer::sanitise_filepath |
( |
string | $filepath | ) |
|
|
inherited |
Sanitise the file path, removing any unsuitable characters.
- Parameters
-
- Return values
-
◆ stream_instance()
static core_files\local\archive_writer\zip_writer::stream_instance |
( |
string | $filename | ) |
|
|
static |
The documentation for this class was generated from the following file:
- files/classes/local/archive_writer/zip_writer.php