Skip to content

Commit

Permalink
Attempt to add language to ia metadata
Browse files Browse the repository at this point in the history
closes #8
  • Loading branch information
hornc authored and notartom committed Apr 19, 2023
1 parent c9e6c00 commit edba95d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions application/controllers/private/Iarchive_upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function upload()

$description = $this->_get_full_description($params, $project);
$params['description'] = trim(preg_replace('/\s+/', ' ', $description)); //trims all newlines before placing in header
$params['language'] = $this->data['language'];

// Close db connection before uploading to avoid hogging connections
$this->db->close();
Expand Down
9 changes: 5 additions & 4 deletions application/libraries/Iarchive_uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ function curl($params)
$headers[] = 'x-archive-meta-title:' . $title;

//additional info
$headers[] = 'x-archive-meta-creator:'.$params['creator'] ;
$headers[] = 'x-archive-meta-creator:'.$params['creator'];
$headers[] = 'x-archive-meta-description:'.$params['description'];
$headers[] = 'x-archive-meta-date:'.$params['date'] ;
$headers[] = 'x-archive-meta-subject:'.$params['subject'] ;
$headers[] = 'x-archive-meta-language:'.$params['language'];
$headers[] = 'x-archive-meta-date:'.$params['date'];
$headers[] = 'x-archive-meta-subject:'.$params['subject'];
$headers[] = 'x-archive-meta-licenseurl:'.$params['licenseurl'];

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
Expand Down

0 comments on commit edba95d

Please sign in to comment.