Class Sabre_DAV_Browser_GuessContentType

Description

GuessContentType plugin

A lot of the built-in File objects just return application/octet-stream as a content-type by default. This is a problem for some clients, because they expect a correct contenttype.

There's really no accurate, fast and portable way to determine the contenttype so this extension does what the rest of the world does, and guesses it based on the file extension.

  • author: Evert Pot (http://www.rooftopsolutions.nl/)
  • copyright: Copyright (C) 2007-2010 Rooftop Solutions. All rights reserved.
  • license: Modified BSD License

Located in /sources_custom/Sabre/DAV/Browser/GuessContentType.php (line 20)

Sabre_DAV_ServerPlugin
   |
   --Sabre_DAV_Browser_GuessContentType
Variable Summary
Method Summary
void afterGetProperties (string $path,  &$properties, array $properties)
string getContentType (string $fileName)
void initialize (Sabre_DAV_Server $server)
Variables
array $extensionMap = array(

// images
'jpg' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',

// groupware
'ics' => 'text/calendar',
'vcf' => 'text/x-vcard',

// text
'txt' => 'text/plain',

)
(line 29)

List of recognized file extensions

Feel free to add more

  • access: public
Methods
afterGetProperties (line 66)

Handler for teh afterGetProperties event

  • access: public
void afterGetProperties (string $path,  &$properties, array $properties)
  • string $path
  • array $properties
  • &$properties
getContentType (line 88)

Simple method to return the contenttype

  • access: protected
string getContentType (string $fileName)
  • string $fileName
initialize (line 51)

Initializes the plugin

  • access: public
void initialize (Sabre_DAV_Server $server)

Redefinition of:
Sabre_DAV_ServerPlugin::initialize()
This initializes the plugin.

Inherited Methods

Inherited From Sabre_DAV_ServerPlugin

Sabre_DAV_ServerPlugin::getFeatures()
Sabre_DAV_ServerPlugin::getHTTPMethods()
Sabre_DAV_ServerPlugin::initialize()

Documentation generated on Sun, 02 Jan 2011 23:15:47 +0000 by phpDocumentor 1.4.3