diff options
author | hubzilla <git@macgirvin.com> | 2016-06-30 09:34:22 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-30 09:34:22 +1000 |
commit | 05aba0b4dd9ce5798e2c8bb57900b03ae96a233e (patch) | |
tree | 0910b2128981452a1c61ba6b6b4683dc51568027 /vendor/sabre/dav/lib/DAV/Server.php | |
parent | f098600c41553bc47267a61fb47a4957046e696e (diff) | |
parent | 3102440d407fe195878b9535aae4fd0da750f437 (diff) | |
download | volse-hubzilla-05aba0b4dd9ce5798e2c8bb57900b03ae96a233e.tar.gz volse-hubzilla-05aba0b4dd9ce5798e2c8bb57900b03ae96a233e.tar.bz2 volse-hubzilla-05aba0b4dd9ce5798e2c8bb57900b03ae96a233e.zip |
Merge pull request #444 from git-marijus/dev
Merge branch sabre32 into dev
Diffstat (limited to 'vendor/sabre/dav/lib/DAV/Server.php')
-rw-r--r-- | vendor/sabre/dav/lib/DAV/Server.php | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/vendor/sabre/dav/lib/DAV/Server.php b/vendor/sabre/dav/lib/DAV/Server.php index b37652812..024b7a557 100644 --- a/vendor/sabre/dav/lib/DAV/Server.php +++ b/vendor/sabre/dav/lib/DAV/Server.php @@ -8,6 +8,10 @@ use Sabre\HTTP\RequestInterface; use Sabre\HTTP\ResponseInterface; use Sabre\HTTP\URLUtil; use Sabre\Uri; +use Psr\Log\LoggerAwareInterface; +use Psr\Log\LoggerAwareTrait; +use Psr\Log\LoggerInterface; +use Psr\Log\NullLogger; /** * Main DAV server class @@ -16,7 +20,9 @@ use Sabre\Uri; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Server extends EventEmitter { +class Server extends EventEmitter implements LoggerAwareInterface { + + use LoggerAwareTrait; /** * Infinity is used for some request supporting the HTTP Depth header and indicates that the operation should traverse the entire tree @@ -431,6 +437,20 @@ class Server extends EventEmitter { } /** + * Returns the PSR-3 logger objcet. + * + * @return LoggerInterface + */ + function getLogger() { + + if (!$this->logger) { + $this->logger = new NullLogger(); + } + return $this->logger; + + } + + /** * Handles a http request, and execute a method based on its name * * @param RequestInterface $request @@ -1177,9 +1197,20 @@ class Server extends EventEmitter { if (!$success) { $result = $mkCol->getResult(); - // generateMkCol needs the href key to exist. - $result['href'] = $uri; - return $result; + + $formattedResult = [ + 'href' => $uri, + ]; + + foreach ($result as $propertyName => $status) { + + if (!isset($formattedResult[$status])) { + $formattedResult[$status] = []; + } + $formattedResult[$status][$propertyName] = null; + + } + return $formattedResult; } $this->tree->markDirty($parentUri); |