Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Abstraction of general file archives.

Copyright: 2020 Mark Nelson <mdjnelson@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 142 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

archive_writer:: (5 methods):
  get_stream_writer()
  get_file_writer()
  sanitise_filepath()
  get_classname_for_type()
  __construct()


Class: archive_writer  - X-Ref

Each file archive type must extend this class.

get_stream_writer(string $filename, string $type)   X-Ref
Returns the stream writer.

param: string $filename
param: string $type
return: stream_writer_interface

get_file_writer(string $filepath, string $type)   X-Ref
Returns the file writer.

param: string $filepath
param: string $type
return: file_writer_interface

sanitise_filepath(string $filepath)   X-Ref
Sanitise the file path, removing any unsuitable characters.

param: string $filepath
return: string

get_classname_for_type(string $type)   X-Ref
Returns the class name for the type that was provided in get_file_writer().

param: string $type
return: string

__construct()   X-Ref
The archive_writer Constructor.