commit vendor

This commit is contained in:
2025-11-11 14:49:30 +01:00
parent f33121a308
commit 6d03080c00
2436 changed files with 483781 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* BadRequest.
*
* The BadRequest is thrown when the user submitted an invalid HTTP request
* BadRequest
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class BadRequest extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 400;
}
}

View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* Conflict.
*
* A 409 Conflict is thrown when a user tried to make a directory over an existing
* file or in a parent directory that doesn't exist.
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class Conflict extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 409;
}
}

View File

@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* ConflictingLock.
*
* Similar to the Locked exception, this exception thrown when a LOCK request
* was made, on a resource which was already locked
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class ConflictingLock extends Locked
{
/**
* This method allows the exception to include additional information into the WebDAV error response.
*/
public function serialize(DAV\Server $server, \DOMElement $errorNode)
{
if ($this->lock) {
$error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:no-conflicting-lock');
$errorNode->appendChild($error);
$error->appendChild($errorNode->ownerDocument->createElementNS('DAV:', 'd:href', $this->lock->uri));
}
}
}

View File

@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* Forbidden.
*
* This exception is thrown whenever a user tries to do an operation he's not allowed to
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class Forbidden extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 403;
}
}

View File

@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* InsufficientStorage.
*
* This Exception can be thrown, when for example a harddisk is full or a quota is exceeded
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class InsufficientStorage extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 507;
}
}

View File

@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
/**
* InvalidResourceType.
*
* This exception is thrown when the user tried to create a new collection, with
* a special resourcetype value that was not recognized by the server.
*
* See RFC5689 section 3.3
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class InvalidResourceType extends Forbidden
{
/**
* This method allows the exception to include additional information into the WebDAV error response.
*/
public function serialize(\Sabre\DAV\Server $server, \DOMElement $errorNode)
{
$error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:valid-resourcetype');
$errorNode->appendChild($error);
}
}

View File

@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* InvalidSyncToken.
*
* This exception is emited for the {DAV:}valid-sync-token pre-condition, as
* defined in rfc6578, section 3.2.
*
* http://tools.ietf.org/html/rfc6578#section-3.2
*
* This is emitted in cases where the the sync-token, supplied by a client is
* either completely unknown, or has expired.
*
* @author Evert Pot (http://evertpot.com/)
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class InvalidSyncToken extends Forbidden
{
/**
* This method allows the exception to include additional information into the WebDAV error response.
*/
public function serialize(DAV\Server $server, \DOMElement $errorNode)
{
$error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:valid-sync-token');
$errorNode->appendChild($error);
}
}

View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* LengthRequired.
*
* This exception is thrown when a request was made that required a
* Content-Length header, but did not contain one.
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class LengthRequired extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 411;
}
}

View File

@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* LockTokenMatchesRequestUri.
*
* This exception is thrown by UNLOCK if a supplied lock-token is invalid
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class LockTokenMatchesRequestUri extends Conflict
{
/**
* Creates the exception.
*/
public function __construct()
{
parent::__construct('The locktoken supplied does not match any locks on this entity');
}
/**
* This method allows the exception to include additional information into the WebDAV error response.
*/
public function serialize(DAV\Server $server, \DOMElement $errorNode)
{
$error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:lock-token-matches-request-uri');
$errorNode->appendChild($error);
}
}

View File

@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* Locked.
*
* The 423 is thrown when a client tried to access a resource that was locked, without supplying a valid lock token
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class Locked extends DAV\Exception
{
/**
* Lock information.
*
* @var \Sabre\DAV\Locks\LockInfo
*/
protected $lock;
/**
* Creates the exception.
*
* A LockInfo object should be passed if the user should be informed
* which lock actually has the file locked.
*
* @param DAV\Locks\LockInfo $lock
*/
public function __construct(DAV\Locks\LockInfo $lock = null)
{
parent::__construct();
$this->lock = $lock;
}
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 423;
}
/**
* This method allows the exception to include additional information into the WebDAV error response.
*/
public function serialize(DAV\Server $server, \DOMElement $errorNode)
{
if ($this->lock) {
$error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:lock-token-submitted');
$errorNode->appendChild($error);
$href = $errorNode->ownerDocument->createElementNS('DAV:', 'd:href');
$href->appendChild($errorNode->ownerDocument->createTextNode($this->lock->uri));
$error->appendChild(
$href
);
}
}
}

View File

@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* MethodNotAllowed.
*
* The 405 is thrown when a client tried to create a directory on an already existing directory
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class MethodNotAllowed extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 405;
}
/**
* This method allows the exception to return any extra HTTP response headers.
*
* The headers must be returned as an array.
*
* @return array
*/
public function getHTTPHeaders(\Sabre\DAV\Server $server)
{
$methods = $server->getAllowedMethods($server->getRequestUri());
return [
'Allow' => strtoupper(implode(', ', $methods)),
];
}
}

View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* NotAuthenticated.
*
* This exception is thrown when the client did not provide valid
* authentication credentials.
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class NotAuthenticated extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 401;
}
}

View File

@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* NotFound.
*
* This Exception is thrown when a Node couldn't be found. It returns HTTP error code 404
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class NotFound extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 404;
}
}

View File

@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* NotImplemented.
*
* This exception is thrown when the client tried to call an unsupported HTTP method or other feature
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class NotImplemented extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 501;
}
}

View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* Payment Required.
*
* The PaymentRequired exception may be thrown in a case where a user must pay
* to access a certain resource or operation.
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class PaymentRequired extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 402;
}
}

View File

@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* PreconditionFailed.
*
* This exception is normally thrown when a client submitted a conditional request,
* like for example an If, If-None-Match or If-Match header, which caused the HTTP
* request to not execute (the condition of the header failed)
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class PreconditionFailed extends DAV\Exception
{
/**
* When this exception is thrown, the header-name might be set.
*
* This allows the exception-catching code to determine which HTTP header
* caused the exception.
*
* @var string
*/
public $header = null;
/**
* Create the exception.
*
* @param string $message
* @param string $header
*/
public function __construct($message, $header = null)
{
parent::__construct($message);
$this->header = $header;
}
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 412;
}
/**
* This method allows the exception to include additional information into the WebDAV error response.
*/
public function serialize(DAV\Server $server, \DOMElement $errorNode)
{
if ($this->header) {
$prop = $errorNode->ownerDocument->createElement('s:header');
$prop->nodeValue = $this->header;
$errorNode->appendChild($prop);
}
}
}

View File

@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* ReportNotSupported.
*
* This exception is thrown when the client requested an unknown report through the REPORT method
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class ReportNotSupported extends UnsupportedMediaType
{
/**
* This method allows the exception to include additional information into the WebDAV error response.
*/
public function serialize(DAV\Server $server, \DOMElement $errorNode)
{
$error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:supported-report');
$errorNode->appendChild($error);
}
}

View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* RequestedRangeNotSatisfiable.
*
* This exception is normally thrown when the user
* request a range that is out of the entity bounds.
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class RequestedRangeNotSatisfiable extends DAV\Exception
{
/**
* returns the http statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 416;
}
}

View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* ServiceUnavailable.
*
* This exception is thrown in case the service
* is currently not available (e.g. down for maintenance).
*
* @author Thomas Müller <thomas.mueller@tmit.eu>
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class ServiceUnavailable extends DAV\Exception
{
/**
* Returns the HTTP statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 503;
}
}

View File

@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* TooManyMatches.
*
* This exception is emited for the {DAV:}number-of-matches-within-limits
* post-condition, as defined in rfc6578, section 3.2.
*
* http://tools.ietf.org/html/rfc6578#section-3.2
*
* This is emitted in cases where the response to a {DAV:}sync-collection would
* generate more results than the implementation is willing to send back.
*
* @author Evert Pot (http://evertpot.com/)
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class TooManyMatches extends Forbidden
{
/**
* This method allows the exception to include additional information into the WebDAV error response.
*/
public function serialize(DAV\Server $server, \DOMElement $errorNode)
{
$error = $errorNode->ownerDocument->createElementNS('DAV:', 'd:number-of-matches-within-limits');
$errorNode->appendChild($error);
}
}

View File

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Sabre\DAV\Exception;
use Sabre\DAV;
/**
* UnSupportedMediaType.
*
* The 415 Unsupported Media Type status code is generally sent back when the client
* tried to call an HTTP method, with a body the server didn't understand
*
* @copyright Copyright (C) fruux GmbH (https://fruux.com/)
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
class UnsupportedMediaType extends DAV\Exception
{
/**
* returns the http statuscode for this exception.
*
* @return int
*/
public function getHTTPCode()
{
return 415;
}
}