aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/http/lib/RequestDecorator.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
committerredmatrix <git@macgirvin.com>2016-05-10 17:26:44 -0700
commit0b02a6d123b2014705998c94ddf3d460948d3eac (patch)
tree78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/http/lib/RequestDecorator.php
parent40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff)
downloadvolse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2
volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'vendor/sabre/http/lib/RequestDecorator.php')
-rw-r--r--vendor/sabre/http/lib/RequestDecorator.php231
1 files changed, 231 insertions, 0 deletions
diff --git a/vendor/sabre/http/lib/RequestDecorator.php b/vendor/sabre/http/lib/RequestDecorator.php
new file mode 100644
index 000000000..7ee3f6fc8
--- /dev/null
+++ b/vendor/sabre/http/lib/RequestDecorator.php
@@ -0,0 +1,231 @@
+<?php
+
+namespace Sabre\HTTP;
+
+/**
+ * Request Decorator
+ *
+ * This helper class allows you to easily create decorators for the Request
+ * object.
+ *
+ * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
+ * @author Evert Pot (http://evertpot.com/)
+ * @license http://sabre.io/license/ Modified BSD License
+ */
+class RequestDecorator implements RequestInterface {
+
+ use MessageDecoratorTrait;
+
+ /**
+ * Constructor.
+ *
+ * @param RequestInterface $inner
+ */
+ function __construct(RequestInterface $inner) {
+
+ $this->inner = $inner;
+
+ }
+
+ /**
+ * Returns the current HTTP method
+ *
+ * @return string
+ */
+ function getMethod() {
+
+ return $this->inner->getMethod();
+
+ }
+
+ /**
+ * Sets the HTTP method
+ *
+ * @param string $method
+ * @return void
+ */
+ function setMethod($method) {
+
+ $this->inner->setMethod($method);
+
+ }
+
+ /**
+ * Returns the request url.
+ *
+ * @return string
+ */
+ function getUrl() {
+
+ return $this->inner->getUrl();
+
+ }
+
+ /**
+ * Sets the request url.
+ *
+ * @param string $url
+ * @return void
+ */
+ function setUrl($url) {
+
+ $this->inner->setUrl($url);
+
+ }
+
+ /**
+ * Returns the absolute url.
+ *
+ * @return string
+ */
+ function getAbsoluteUrl() {
+
+ return $this->inner->getAbsoluteUrl();
+
+ }
+
+ /**
+ * Sets the absolute url.
+ *
+ * @param string $url
+ * @return void
+ */
+ function setAbsoluteUrl($url) {
+
+ $this->inner->setAbsoluteUrl($url);
+
+ }
+
+ /**
+ * Returns the current base url.
+ *
+ * @return string
+ */
+ function getBaseUrl() {
+
+ return $this->inner->getBaseUrl();
+
+ }
+
+ /**
+ * Sets a base url.
+ *
+ * This url is used for relative path calculations.
+ *
+ * The base url should default to /
+ *
+ * @param string $url
+ * @return void
+ */
+ function setBaseUrl($url) {
+
+ $this->inner->setBaseUrl($url);
+
+ }
+
+ /**
+ * Returns the relative path.
+ *
+ * This is being calculated using the base url. This path will not start
+ * with a slash, so it will always return something like
+ * 'example/path.html'.
+ *
+ * If the full path is equal to the base url, this method will return an
+ * empty string.
+ *
+ * This method will also urldecode the path, and if the url was incoded as
+ * ISO-8859-1, it will convert it to UTF-8.
+ *
+ * If the path is outside of the base url, a LogicException will be thrown.
+ *
+ * @return string
+ */
+ function getPath() {
+
+ return $this->inner->getPath();
+
+ }
+
+ /**
+ * Returns the list of query parameters.
+ *
+ * This is equivalent to PHP's $_GET superglobal.
+ *
+ * @return array
+ */
+ function getQueryParameters() {
+
+ return $this->inner->getQueryParameters();
+
+ }
+
+ /**
+ * Returns the POST data.
+ *
+ * This is equivalent to PHP's $_POST superglobal.
+ *
+ * @return array
+ */
+ function getPostData() {
+
+ return $this->inner->getPostData();
+
+ }
+
+ /**
+ * Sets the post data.
+ *
+ * This is equivalent to PHP's $_POST superglobal.
+ *
+ * This would not have been needed, if POST data was accessible as
+ * php://input, but unfortunately we need to special case it.
+ *
+ * @param array $postData
+ * @return void
+ */
+ function setPostData(array $postData) {
+
+ $this->inner->setPostData($postData);
+
+ }
+
+
+ /**
+ * Returns an item from the _SERVER array.
+ *
+ * If the value does not exist in the array, null is returned.
+ *
+ * @param string $valueName
+ * @return string|null
+ */
+ function getRawServerValue($valueName) {
+
+ return $this->inner->getRawServerValue($valueName);
+
+ }
+
+ /**
+ * Sets the _SERVER array.
+ *
+ * @param array $data
+ * @return void
+ */
+ function setRawServerData(array $data) {
+
+ $this->inner->setRawServerData($data);
+
+ }
+
+ /**
+ * Serializes the request object as a string.
+ *
+ * This is useful for debugging purposes.
+ *
+ * @return string
+ */
+ function __toString() {
+
+ return $this->inner->__toString();
+
+ }
+}