Bluz\Proxy\Request
Proxy to Request
Example of usage
<code>
use Bluz\Proxy\Request;
Request::getParam('foo');
</code>
- Author: Anton Shevchuk
Synopsis
- // constants
- const TYPE_ANY = '*/*';
- const TYPE_HTML = 'text/html';
- const TYPE_JSON = 'application/json';
- // members
- private static array|null $accept;
- // methods
- private static void initInstance()
- public static string getQuery()
- public static string getPost()
- public static string getServer()
- public static string getCookie()
- public static string getEnv()
- public static string getHeader()
- public static string|null getParam()
- public static array getParams()
- public static UploadedFile getFile()
- public static string getClientIp()
- public static string getModule()
- public static string getController()
- public static string getMethod()
- public static array getAccept()
- public static void resetAccept()
- public static string|false checkAccept()
- public static bool isCli()
- public static bool isHttp()
- public static bool isGet()
- public static bool isPost()
- public static bool isPut()
- public static bool isDelete()
- public static bool isXmlHttpRequest()
- // Inherited methods from ProxyTrait
- public static void setInstance()
- public static mixed __callStatic()
- // Inherited methods from Singleton
- public static Request getInstance()
- public static void resetInstance()
Hierarchy
Tasks
Line | Task |
---|---|
39+ | Proxy class should be clean |
Constants
Name | Value |
---|---|
TYPE_ANY | '*/*' |
TYPE_HTML | 'text/html' |
TYPE_JSON | 'application/json' |
Members
Methods
private
- initInstance() — Init instance
public
- checkAccept() — Check Accept header
- getAccept() — Get Accept MIME Type
- getClientIp() — Get the client's IP address
- getController() — Get controller
- getCookie() — Retrieve a member of the $_COOKIE super global
- getEnv() — Retrieve a member of the $_ENV super global
- getFile() — Get uploaded file
- getHeader() — Search for a header value
- getMethod() — Get method
- getModule() — Get module
- getParam() — Access values contained in the superglobals as public members Order of precedence: 1. GET, 2. POST
- getParams() — Get all params from GET and POST or PUT
- getPost() — Retrieve a member of the $_POST super global
- getQuery() — Retrieve a member of the $_GET super global
- getServer() — Retrieve a member of the $_SERVER super global
- isCli() — Check CLI
- isDelete() — Is this a DELETE method request?
- isGet() — Is this a GET method request?
- isHttp() — Check HTTP
- isPost() — Is this a POST method request?
- isPut() — Is this a PUT method request?
- isXmlHttpRequest() — Is the request a Javascript XMLHttpRequest?
- resetAccept() — Reset accept for tests
Inherited from Bluz\Proxy\ProxyTrait
public
- __callStatic() — Handle dynamic, static calls to the object.
- setInstance() — Set or replace instance
Inherited from Bluz\Common\Singleton
public
- getInstance() — Get instance
- resetInstance() — Reset instance
History
-
2017-08-30T14:59:17+00:00 (commit #034de77)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small codestyle fixes
-
2017-07-06T15:23:00+00:00 (commit #73e7e96)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed codestyle
-
2017-07-06T15:08:00+00:00 (commit #8bfc97b)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Controller refactoring
-
2017-06-30T11:02:27+00:00 (commit #347a99b)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Changed all Proxy classes, mark all of them as `final`
-
2017-06-30T08:36:40+00:00 (commit #2259ecf)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed comments style
-
2017-04-27T15:07:29+00:00 (commit #c44f673)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Simplify `Request::getParam()`
-
2017-04-27T15:02:43+00:00 (commit #d44eae1)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Simplify `Request::getParam()`
-
2017-04-27T14:48:45+00:00 (commit #400a185)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Rename `Proxy\Request::getAccept()` to `Proxy\Request::checkAccept()`
-
2017-04-25T10:06:38+00:00 (commit #a83c398)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added `array_add()` function Small refactoring of `Proxy\Request`
-
2017-04-21T13:24:35+00:00 (commit #3b25a3d)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small update for codestyle
-
2017-04-12T09:45:17+00:00 (commit #e8463fb)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed controller cache issue
-
2017-04-07T12:39:57+00:00 (commit #408cd7d)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated Proxy\Request
-
2017-03-29T10:51:42+00:00 (commit #c9de5d6)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added @todo
-
2017-02-15T16:09:44+00:00 (commit #0fc0c8b)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated coveralls config
-
2017-02-13T10:14:18+00:00 (commit #43dbf55)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Rollback to `getCount()` method
-
2017-01-30T13:15:49+00:00 (commit #fd5d943)
Author: Anton (AntonShevchuk@gmail.com) / Commiter: GitHub (AntonShevchuk@gmail.com)
Merge pull request #395 from AntonShevchuk/master Added `AttachmentResponse`