diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-02-07 13:42:18 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-02-07 13:45:59 +0100 |
commit | b537d90e58913be203fd96f31b624559be00abeb (patch) | |
tree | 9af6c432b3b503303f1315f82f602844664f837d /lib/public/irequest.php | |
parent | b35b22977cfc9412278ae70b49c402a95efca19e (diff) | |
parent | b9e724d4ae7635435b3cc7793237c3ab9fe2a1c0 (diff) | |
download | nextcloud-server-b537d90e58913be203fd96f31b624559be00abeb.tar.gz nextcloud-server-b537d90e58913be203fd96f31b624559be00abeb.zip |
use the 'new' server container for appconfig
Diffstat (limited to 'lib/public/irequest.php')
-rw-r--r-- | lib/public/irequest.php | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/lib/public/irequest.php b/lib/public/irequest.php index 9f335b06f2a..ca23e12b7f5 100644 --- a/lib/public/irequest.php +++ b/lib/public/irequest.php @@ -20,8 +20,38 @@ * */ +/** + * Public interface of ownCloud for apps to use. + * Request interface + * + */ + +// use OCP namespace for all classes that are considered public. +// This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; +/** + * This interface provides an immutable object with with accessors to + * request variables and headers. + * + * Access request variables by method and name. + * + * Examples: + * + * $request->post['myvar']; // Only look for POST variables + * $request->myvar; or $request->{'myvar'}; or $request->{$myvar} + * Looks in the combined GET, POST and urlParams array. + * + * If you access e.g. ->post but the current HTTP request method + * is GET a \LogicException will be thrown. + * + * NOTE: + * - When accessing ->put a stream resource is returned and the accessor + * will return false on subsequent access to ->put or ->patch. + * - When accessing ->patch and the Content-Type is either application/json + * or application/x-www-form-urlencoded (most cases) it will act like ->get + * and ->post and return an array. Otherwise the raw data will be returned. + */ interface IRequest { @@ -86,11 +116,8 @@ interface IRequest { /** - * Returns the request body content. - * - * @param Boolean $asResource If true, a resource will be returned - * @return string|resource The request body content or a resource to read the body stream. - * @throws \LogicException + * Checks if the CSRF check was correct + * @return bool true if CSRF check passed */ - function getContent($asResource = false); + public function passesCSRFCheck(); } |