Class: Sabre_DAV_Browser_GuessContentType

Source Location: /includes/classes/SabreDAV/lib/Sabre/DAV/Browser/GuessContentType.php

Class Overview [line 20]

Sabre_DAV_ServerPlugin
   |
   --Sabre_DAV_Browser_GuessContentType

GuessContentType plugin

Author(s):

  • Evert Pot (http://www.rooftopsolutions.nl/)

Version:

Copyright:

  • Copyright (C) 2007-2010 Rooftop Solutions. All rights reserved.

Variables

Constants

Methods


Inherited Variables

Inherited Constants

Inherited Methods

Class: Sabre_DAV_ServerPlugin

Sabre_DAV_ServerPlugin::getFeatures()
This method should return a list of server-features.
Sabre_DAV_ServerPlugin::getHTTPMethods()
Use this method to tell the server this plugin defines additional HTTP methods.
Sabre_DAV_ServerPlugin::initialize()
This initializes the plugin.


Class Details

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.

Tags:

[ Top ]


Class Variables

$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

Tags:

  • access - public

Type: array

Overrides:

[ Top ]


Class Methods

afterGetProperties

void afterGetProperties( string $path, &$properties, array $properties)

[line 66]

Handler for teh afterGetProperties event

Tags:

  • access - public

Parameters:

  • string $path -
  • array $properties -
  • &$properties -

[ Top ]

getContentType

string getContentType( string $fileName)

[line 88]

Simple method to return the contenttype

Tags:

  • access - protected

Parameters:

  • string $fileName -

[ Top ]

initialize

void initialize( Sabre_DAV_Server $server)

[line 51]

Initializes the plugin

Tags:

  • access - public

Overrides Sabre_DAV_ServerPlugin::initialize() (This initializes the plugin.)

Parameters:

[ Top ]


Class Constants


Documentation generated on Mon, 31 May 2010 12:53:25 -0400 by phpDocumentor 1.4.3