Each file archive type must extend this class.  
 More...
|  | 
| static | get_file_writer (string $filepath, string $type) | 
|  | Returns the file writer. 
 | 
|  | 
| static | get_stream_writer (string $filename, string $type) | 
|  | Returns the stream writer. 
 | 
|  | 
|  | 
| const | ZIP_WRITER = 'zip_writer' | 
|  | The zip writer class. 
 | 
|  | 
|  | 
|  | __construct () | 
|  | The archive_writer Constructor. 
 | 
|  | 
|  | 
| static | get_classname_for_type (string $type) | 
|  | Returns the class name for the type that was provided in get_file_writer(). 
 | 
|  | 
Each file archive type must extend this class. 
- 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 
◆ add_file_from_filepath()
  
  | 
        
          | core_files\archive_writer::add_file_from_filepath | ( | string | $name, |  
          |  |  | string | $path ) |  | abstract | 
 
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 in core_files\local\archive_writer\zip_writer.
 
 
◆ add_file_from_stored_file()
  
  | 
        
          | core_files\archive_writer::add_file_from_stored_file | ( | string | $name, |  
          |  |  | stored_file | $file ) |  | abstract | 
 
 
◆ add_file_from_stream()
  
  | 
        
          | core_files\archive_writer::add_file_from_stream | ( | string | $name, |  
          |  |  |  | $stream ) |  | abstract | 
 
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 in core_files\local\archive_writer\zip_writer.
 
 
◆ add_file_from_string()
  
  | 
        
          | core_files\archive_writer::add_file_from_string | ( | string | $name, |  
          |  |  | string | $data ) |  | abstract | 
 
 
◆ finish()
  
  | 
        
          | core_files\archive_writer::finish | ( |  | ) |  |  | abstract | 
 
 
◆ get_classname_for_type()
  
  | 
        
          | static core_files\archive_writer::get_classname_for_type | ( | string | $type | ) |  |  | staticprotected | 
 
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 ) |  | static | 
 
Returns the file writer. 
- Parameters
- 
  
    | string | $filepath |  |  | string | $type |  |  
 
- Return values
- 
  
  
 
 
◆ get_stream_writer()
  
  | 
        
          | static core_files\archive_writer::get_stream_writer | ( | string | $filename, |  
          |  |  | string | $type ) |  | static | 
 
Returns the stream writer. 
- Parameters
- 
  
    | string | $filename |  |  | string | $type |  |  
 
- Return values
- 
  
  
 
 
◆ sanitise_filepath()
      
        
          | core_files\archive_writer::sanitise_filepath | ( | string | $filepath | ) |  | 
      
 
Sanitise the file path, removing any unsuitable characters. 
- Parameters
- 
  
  
- Return values
- 
  
  
 
 
The documentation for this class was generated from the following file:
- files/classes/archive_writer.php