Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Interface for callback from tgz_extractor::extract. More...
Public Member Functions | |
tgz_directory ($archivepath, $mtime) | |
Called when a directory entry is found in the archive. More... | |
tgz_end_file ($archivepath, $realpath) | |
Called when the system has finished extracting a file. More... | |
tgz_start_file ($archivepath) | |
Called when the system begins to extract a file. More... | |
Interface for callback from tgz_extractor::extract.
The file functions will be called (in pairs tgz_start_file, tgz_end_file) for each file in the archive. (There is only one exception, the special .ARCHIVE_INDEX file which is not reported to the handler.)
The directory function is called whenever the archive contains a directory entry.
tgz_extractor_handler::tgz_directory | ( | $archivepath, | |
$mtime | |||
) |
Called when a directory entry is found in the archive.
The handler can create a corresponding directory if required.
string | $archivepath | Path and name of directory within archive |
int | $mtime | Modified time of directory |
bool | True if directory was created, false if skipped |
Implemented in tgz_packer_extract_to_storage, and tgz_packer_extract_to_pathname.
tgz_extractor_handler::tgz_end_file | ( | $archivepath, | |
$realpath | |||
) |
Called when the system has finished extracting a file.
The handler can now process the extracted file if required.
string | $archivepath | Path and name of file within archive |
string | $realpath | Path in filesystem (from tgz_start_file return) |
bool | True to continue processing, false to abort archive extract |
Implemented in tgz_packer_extract_to_storage, and tgz_packer_extract_to_pathname.
tgz_extractor_handler::tgz_start_file | ( | $archivepath | ) |
Called when the system begins to extract a file.
At this point, the handler must decide where on disk the extracted file should be located. This can be a temporary location or final target, as preferred.
The handler can request for files to be skipped, in which case no data will be written and tgz_end_file will not be called.
string | $archivepath | Path and name of file within archive |
string | Location for output file in filesystem, or null to skip file |
Implemented in tgz_packer_extract_to_storage, and tgz_packer_extract_to_pathname.