(no description)
File Size: | 144 lines (6 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
entries_importer:: (4 methods):
__construct()
get_data_file_content()
get_file_content_from_zip()
extract_zip()
Class: entries_importer - X-Ref
Importer class for importing data and - if needed - files as well from a zip archive.__construct(string $importfilepath, string $importfilename) X-Ref |
Creates an entries_importer object. This object can be used to import data from data files (like csv) and zip archives both including a data file and files to be stored in the course module context. param: string $importfilepath the complete path of the import file including filename param: string $importfilename the import file name as uploaded by the user |
get_data_file_content() X-Ref |
Returns the file content of the data file. Returns the content of the file directly if the entries_importer's file is a data file itself. If the entries_importer's file is a zip archive, the content of the first found data file in the zip archive's root will be returned. return: false|string the data file content as string; false, if file cannot be found/read |
get_file_content_from_zip(string $filename, string $zipsubdir = 'files/') X-Ref |
Returns the file content from a file which has been stored in the zip archive. param: string $filename param: string $zipsubdir return: false|string the file content as string, false if the file could not be found/read |
extract_zip() X-Ref |
Extracts (if not already done and if we have a zip file to deal with) the zip file to a temporary directory. return: void |