server/src/app/Libraries/Utils.php
changeset 4 f55970e41793
parent 2 00e2916104fe
child 18 f2a40bbc27f6
--- a/server/src/app/Libraries/Utils.php	Wed Jun 24 01:36:46 2015 +0200
+++ b/server/src/app/Libraries/Utils.php	Mon Oct 05 17:02:10 2015 +0200
@@ -38,7 +38,11 @@
                 "js"=>"application/javascript",
                 "php"=>"text/html",
                 "htm"=>"text/html",
-                "html"=>"text/html"
+                "html"=>"text/html",
+                "mp4"=>"video/mp4",
+                "ogg"=>"video/ogg",
+                "xml"=>"application/xml",
+                "xhtml"=>"application/xhtml+xml",
         );
 
         $split_ext = explode('.',$file);
@@ -46,4 +50,16 @@
 
         return $mime_types[$extension];
     }
+
+    public static function process_literal_or_string($val) {
+        if(is_null($val)) {
+            return $val;
+        }
+        if($val instanceof Literal) {
+            return $val->getValue();
+        }
+        else {
+            return (string)$val;
+        }
+    }
 }