'fdf' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
'flv' => array ('type'=>'video/x-flv', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'),
'f4v' => array ('type'=>'video/mp4', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'),
+
+ 'gallery' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
+ 'galleryitem,' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
+ 'gallerycollection' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
'gif' => array ('type'=>'image/gif', 'icon'=>'gif', 'groups'=>array('image', 'web_image'), 'string'=>'image'),
'gtar' => array ('type'=>'application/x-gtar', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive'),
'tgz' => array ('type'=>'application/g-zip', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive'),
'mpe' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
'mpg' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'),
+ 'nbk' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
+ 'notebook' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
+
'odt' => array ('type'=>'application/vnd.oasis.opendocument.text', 'icon'=>'writer', 'groups'=>array('document')),
'ott' => array ('type'=>'application/vnd.oasis.opendocument.text-template', 'icon'=>'writer', 'groups'=>array('document')),
'oth' => array ('type'=>'application/vnd.oasis.opendocument.text-web', 'icon'=>'oth', 'groups'=>array('document')),
'webm' => array ('type'=>'video/webm', 'icon'=>'video', 'groups'=>array('video'), 'string'=>'video'),
'wmv' => array ('type'=>'video/x-ms-wmv', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'),
'asf' => array ('type'=>'video/x-ms-asf', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'),
+
+ 'xbk' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
'xdp' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
'xfd' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
'xfdf' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
'xml' => array ('type'=>'application/xml', 'icon'=>'markup'),
'xsl' => array ('type'=>'text/xml', 'icon'=>'markup'),
+
'zip' => array ('type'=>'application/zip', 'icon'=>'archive', 'groups'=>array('archive'), 'string'=>'archive')
);
return $mimearray;
}
/**
- * Set curl options
+ * Set curl options.
*
- * @param array $options If array is null, this function will
- * reset the options to default value.
+ * Do not use the curl constants to define the options, pass a string
+ * corresponding to that constant. Ie. to set CURLOPT_MAXREDIRS, pass
+ * array('CURLOPT_MAXREDIRS' => 10) or array('maxredirs' => 10) to this method.
+ *
+ * @param array $options If array is null, this function will reset the options to default value.
+ * @return void
+ * @throws coding_exception If an option uses constant value instead of option name.
*/
public function setopt($options = array()) {
if (is_array($options)) {
- foreach($options as $name => $val){
+ foreach ($options as $name => $val){
+ if (!is_string($name)) {
+ throw new coding_exception('Curl options should be defined using strings, not constant values.');
+ }
if (stripos($name, 'CURLOPT_') === false) {
$name = strtoupper('CURLOPT_'.$name);
}
var_dump($this->header);
}
- // set options
+ // Set options.
foreach($this->options as $name => $val) {
- if (is_string($name)) {
- $name = constant(strtoupper($name));
- }
+ $name = constant(strtoupper($name));
curl_setopt($curl, $name, $val);
}
return $curl;