public function setOption($opt, $val = null)
{
// If an array of options is passed.
if (is_array($opt)) {
// Set the cURL options from the array.
curl_setopt_array($this->curl, $opt);
// Set the protected property to the cURL options.
foreach ($opt as $k => $v) {
$this->options[$k] = $v;
}
// Else, set the single option.
} else {
curl_setopt($this->curl, $opt, $val);
$this->options[$opt] = $val;
}
return $this;
}