server/src/app/Libraries/Utils.php
changeset 4 f55970e41793
parent 2 00e2916104fe
child 18 f2a40bbc27f6
equal deleted inserted replaced
3:2b3247d02769 4:f55970e41793
    36                 "css"=>"text/css",
    36                 "css"=>"text/css",
    37                 "jsc"=>"application/javascript",
    37                 "jsc"=>"application/javascript",
    38                 "js"=>"application/javascript",
    38                 "js"=>"application/javascript",
    39                 "php"=>"text/html",
    39                 "php"=>"text/html",
    40                 "htm"=>"text/html",
    40                 "htm"=>"text/html",
    41                 "html"=>"text/html"
    41                 "html"=>"text/html",
       
    42                 "mp4"=>"video/mp4",
       
    43                 "ogg"=>"video/ogg",
       
    44                 "xml"=>"application/xml",
       
    45                 "xhtml"=>"application/xhtml+xml",
    42         );
    46         );
    43 
    47 
    44         $split_ext = explode('.',$file);
    48         $split_ext = explode('.',$file);
    45         $extension = strtolower(end($split_ext));
    49         $extension = strtolower(end($split_ext));
    46 
    50 
    47         return $mime_types[$extension];
    51         return $mime_types[$extension];
    48     }
    52     }
       
    53 
       
    54     public static function process_literal_or_string($val) {
       
    55         if(is_null($val)) {
       
    56             return $val;
       
    57         }
       
    58         if($val instanceof Literal) {
       
    59             return $val->getValue();
       
    60         }
       
    61         else {
       
    62             return (string)$val;
       
    63         }
       
    64     }
    49 }
    65 }