Exemplo n.º 1
0
 /**
  * Get a common file category type out of the mimetype string
  */
 public function getCategory($default = "file")
 {
     $mime = $this->getMimeType();
     $types = explode("/", $mime);
     $output = Sanitize::toSlug(array_pop($types));
     return !empty($output) ? $output : $default;
 }
Exemplo n.º 2
0
 /**
  * Get request header value by name
  */
 public function headers($name = "", $default = "")
 {
     $name = strtolower(Sanitize::toSlug($name));
     if (!empty($name)) {
         foreach (getallheaders() as $k => $value) {
             if (strtolower(Sanitize::toSlug($k)) === $name) {
                 return $value;
             }
         }
     }
     return $default;
 }