Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save prateeksachan/6004036 to your computer and use it in GitHub Desktop.
Save prateeksachan/6004036 to your computer and use it in GitHub Desktop.
<?php
$url = search_curl_url(); // returns SOLR_SERVER_HOSTNAME . ':' . SOLR_SERVER_PORT . '/solr/update/extract?'
$url .= 'literal.id=' . 'forum_file_' . $id . '&literal.module=forum&literal.type=3&literal.courseid=' . $post->course;
$params = array();
$params[$id] = $file; // adds the $file stdClass object into $params array
$curl->post($url, $params); // sets CURLOPT_POST = 1
// sets CURLOPT_POSTFIELDS = array ($id => '@' . $filepath) via add_to_curl_request
// finally posts this curl request
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment