original_string: public static function extToMime($ext)
      {
          if (empty($ext)) {
              return 'application/octet-stream';
          }
  
          $ext = Horde_String::lower($ext);
          $map = self::_getMimeExtensionMap();
          $pos = 0;
  
          while (!isset($map[$ext])) {
              if (($pos = strpos($ext, '.')) === false) {
                  break;
              }
              $ext = substr($ext, $pos + 1);
          }
  
          return isset($map[$ext])
              ? $map[$ext]
              : 'x-extension/' . $ext;
      }
code: public static function extToMime($ext)
      {
          if (empty($ext)) {
              return 'application/octet-stream';
          }
  
          $ext = Horde_String::lower($ext);
          $map = self::_getMimeExtensionMap();
          $pos = 0;
  
          while (!isset($map[$ext])) {
              if (($pos = strpos($ext, '.')) === false) {
                  break;
              }
              $ext = substr($ext, $pos + 1);
          }
  
          return isset($map[$ext])
              ? $map[$ext]
              : 'x-extension/' . $ext;
      }
code_tokens: public static function extToMime ( $ ext ) { if ( empty ( $ ext ) ) { return 'application/octet-stream' ; } $ ext = Horde_String :: lower ( $ ext ) ; $ map = self :: _getMimeExtensionMap ( ) ; $ pos = 0 ; while ( ! isset ( $ map [ $ ext ] ) ) { if ( ( $ pos = strpos ( $ ext , '.' ) ) === false ) { break ; } $ ext = substr ( $ ext , $ pos + 1 ) ; } return isset ( $ map [ $ ext ] ) ? $ map [ $ ext ] : 'x-extension/' . $ ext ; }
docstring: Attempt to convert a file extension to a MIME type, based
  on the global Horde and application specific config files.
  
  If we cannot map the file extension to a specific type, then
  we fall back to a custom MIME handler 'x-extension/$ext', which
  can be used as a normal MIME type internally throughout Horde.
  
  @param string $ext  The file extension to be mapped to a MIME type.
  
  @return string  The MIME type of the file extension.
docstring_tokens: Attempt to convert a file extension to a MIME type based on the global Horde and application specific config files .