]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/lib/Sabre/DAV/Exception/MethodNotAllowed.php
Merge remote branch 'friendica/master'
[friendica-addons.git] / dav / SabreDAV / lib / Sabre / DAV / Exception / MethodNotAllowed.php
1 <?php
2
3 /**
4  * MethodNotAllowed
5  *
6  * The 405 is thrown when a client tried to create a directory on an already existing directory
7  *
8  * @package Sabre
9  * @subpackage DAV
10  * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
11  * @author Evert Pot (http://www.rooftopsolutions.nl/) 
12  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
13  */
14 class Sabre_DAV_Exception_MethodNotAllowed extends Sabre_DAV_Exception {
15
16     /**
17      * Returns the HTTP statuscode for this exception
18      *
19      * @return int
20      */
21     public function getHTTPCode() {
22
23         return 405;
24
25     }
26
27     /**
28      * This method allows the exception to return any extra HTTP response headers.
29      *
30      * The headers must be returned as an array.
31      *
32      * @param Sabre_DAV_Server $server
33      * @return array
34      */
35     public function getHTTPHeaders(Sabre_DAV_Server $server) {
36
37         $methods = $server->getAllowedMethods($server->getRequestUri());
38
39         return array(
40             'Allow' => strtoupper(implode(', ',$methods)),
41         );
42
43     }
44
45 }