Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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.