Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

collection_download_process_csv_metadata_file()

Parameters

ColumnTypeDefaultDescription
$result array
$id
$collection
$collection_download_tar
$use_zip_extension
&$zip
&$path
&$deletion_array array

Location

include/collections_functions.php lines 3488 to 3513

Definition

 
function collection_download_process_csv_metadata_file(array $result$id$collection$collection_download_tar$use_zip_extension, &$zip, &$path, array &$deletion_array)
    {
    
// Include the CSV file with the metadata of the resources found in this collection
    
$csv_file    get_temp_dir(false$id) . '/Col-' $collection '-metadata-export.csv';
    
$csv_fh      fopen($csv_file'w') OR die("can't open file");
    
$csv_content generateResourcesMetadataCSV($result);
    
fwrite($csv_fh$csv_content);
    
fclose($csv_fh);

    
// Add link to file for use by tar to prevent full paths being included.
    
if($collection_download_tar)
        {
        global 
$p$usertempdir$filename;
        
debug("collection_download adding symlink: " $p " - " $usertempdir DIRECTORY_SEPARATOR $filename);
        @
symlink($csv_file$usertempdir DIRECTORY_SEPARATOR 'Col-' $collection '-metadata-export.csv');
        }
    elseif(
$use_zip_extension)
        {
        
$zip->addFile($csv_file'Col-' $collection '-metadata-export.csv');
        }
    else
        {
        
$path .= $csv_file "\r\n";
        }
    
$deletion_array[] = $csv_file;
    }

This article was last updated 5th July 2020 03:35 Europe/London time based on the source file dated 3rd July 2020 14:33 Europe/London time.