Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.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.