PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/phalcon/devtools/ide/1.3.1/Phalcon/Http/Request.php

https://gitlab.com/habracoder/advertising
PHP | 489 lines | 57 code | 103 blank | 329 comment | 0 complexity | 0cf18937fab04bb107a00e4cbaac03a5 MD5 | raw file
  1. <?php
  2. namespace Phalcon\Http {
  3. /**
  4. * Phalcon\Http\Request
  5. *
  6. * <p>Encapsulates request information for easy and secure access from application controllers.</p>
  7. *
  8. * <p>The request object is a simple value object that is passed between the dispatcher and controller classes.
  9. * It packages the HTTP request environment.</p>
  10. *
  11. *<code>
  12. * $request = new Phalcon\Http\Request();
  13. * if ($request->isPost() == true) {
  14. * if ($request->isAjax() == true) {
  15. * echo 'Request was made using POST and AJAX';
  16. * }
  17. * }
  18. *</code>
  19. *
  20. */
  21. class Request implements \Phalcon\Http\RequestInterface, \Phalcon\DI\InjectionAwareInterface {
  22. protected $_dependencyInjector;
  23. protected $_filter;
  24. protected $_rawBody;
  25. protected $_put;
  26. /**
  27. * Sets the dependency injector
  28. *
  29. * @param \Phalcon\DiInterface $dependencyInjector
  30. */
  31. public function setDI($dependencyInjector){ }
  32. /**
  33. * Returns the internal dependency injector
  34. *
  35. * @return \Phalcon\DiInterface
  36. */
  37. public function getDI(){ }
  38. /**
  39. * Gets a variable from the $_REQUEST superglobal applying filters if needed.
  40. * If no parameters are given the $_REQUEST superglobal is returned
  41. *
  42. *<code>
  43. * //Returns value from $_REQUEST["user_email"] without sanitizing
  44. * $userEmail = $request->get("user_email");
  45. *
  46. * //Returns value from $_REQUEST["user_email"] with sanitizing
  47. * $userEmail = $request->get("user_email", "email");
  48. *</code>
  49. *
  50. * @param string $name
  51. * @param string|array $filters
  52. * @param mixed $defaultValue
  53. * @param boolean $notAllowEmpty
  54. * @param boolean $noRecursive
  55. * @return mixed
  56. */
  57. public function get($name=null, $filters=null, $defaultValue=null){ }
  58. /**
  59. * Gets a variable from the $_POST superglobal applying filters if needed
  60. * If no parameters are given the $_POST superglobal is returned
  61. *
  62. *<code>
  63. * //Returns value from $_POST["user_email"] without sanitizing
  64. * $userEmail = $request->getPost("user_email");
  65. *
  66. * //Returns value from $_POST["user_email"] with sanitizing
  67. * $userEmail = $request->getPost("user_email", "email");
  68. *</code>
  69. *
  70. * @param string $name
  71. * @param string|array $filters
  72. * @param mixed $defaultValue
  73. * @param boolean $notAllowEmpty
  74. * @param boolean $noRecursive
  75. * @return mixed
  76. */
  77. public function getPost($name=null, $filters=null, $defaultValue=null){ }
  78. /**
  79. * Gets a variable from put request
  80. *
  81. *<code>
  82. * $userEmail = $request->getPut("user_email");
  83. *
  84. * $userEmail = $request->getPut("user_email", "email");
  85. *</code>
  86. *
  87. * @param string $name
  88. * @param string|array $filters
  89. * @param mixed $defaultValue
  90. * @param boolean $notAllowEmpty
  91. * @param boolean $noRecursive
  92. * @return mixed
  93. */
  94. public function getPut($name=null, $filters=null, $defaultValue=null){ }
  95. /**
  96. * Gets variable from $_GET superglobal applying filters if needed
  97. * If no parameters are given the $_GET superglobal is returned
  98. *
  99. *<code>
  100. * //Returns value from $_GET["id"] without sanitizing
  101. * $id = $request->getQuery("id");
  102. *
  103. * //Returns value from $_GET["id"] with sanitizing
  104. * $id = $request->getQuery("id", "int");
  105. *
  106. * //Returns value from $_GET["id"] with a default value
  107. * $id = $request->getQuery("id", null, 150);
  108. *</code>
  109. *
  110. * @param string $name
  111. * @param string|array $filters
  112. * @param mixed $defaultValue
  113. * @param boolean $notAllowEmpty
  114. * @param boolean $noRecursive
  115. * @return mixed
  116. */
  117. public function getQuery($name=null, $filters=null, $defaultValue=null){ }
  118. /**
  119. * Gets variable from $_SERVER superglobal
  120. *
  121. * @param string $name
  122. * @return mixed
  123. */
  124. public function getServer($name){ }
  125. /**
  126. * Checks whether $_REQUEST superglobal has certain index
  127. *
  128. * @param string $name
  129. * @return boolean
  130. */
  131. public function has($name){ }
  132. /**
  133. * Checks whether $_POST superglobal has certain index
  134. *
  135. * @param string $name
  136. * @return boolean
  137. */
  138. public function hasPost($name){ }
  139. /**
  140. * Checks whether put has certain index
  141. *
  142. * @param string $name
  143. * @return boolean
  144. */
  145. public function hasPut($name){ }
  146. /**
  147. * Checks whether $_GET superglobal has certain index
  148. *
  149. * @param string $name
  150. * @return boolean
  151. */
  152. public function hasQuery($name){ }
  153. /**
  154. * Checks whether $_SERVER superglobal has certain index
  155. *
  156. * @param string $name
  157. * @return mixed
  158. */
  159. public function hasServer($name){ }
  160. /**
  161. * Gets HTTP header from request data
  162. *
  163. * @param string $header
  164. * @return string
  165. */
  166. public function getHeader($header){ }
  167. /**
  168. * Gets HTTP schema (http/https)
  169. *
  170. * @return string
  171. */
  172. public function getScheme(){ }
  173. /**
  174. * Checks whether request has been made using ajax. Checks if $_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest'
  175. *
  176. * @return boolean
  177. */
  178. public function isAjax(){ }
  179. /**
  180. * Checks whether request has been made using SOAP
  181. *
  182. * @return boolean
  183. */
  184. public function isSoapRequested(){ }
  185. /**
  186. * Checks whether request has been made using any secure layer
  187. *
  188. * @return boolean
  189. */
  190. public function isSecureRequest(){ }
  191. /**
  192. * Gets HTTP raw request body
  193. *
  194. * @return string
  195. */
  196. public function getRawBody(){ }
  197. /**
  198. * Gets decoded JSON HTTP raw request body
  199. *
  200. * @param bool $assoc
  201. * @return string
  202. */
  203. public function getJsonRawBody(){ }
  204. /**
  205. * Gets active server address IP
  206. *
  207. * @return string
  208. */
  209. public function getServerAddress(){ }
  210. /**
  211. * Gets active server name
  212. *
  213. * @return string
  214. */
  215. public function getServerName(){ }
  216. /**
  217. * Gets information about schema, host and port used by the request
  218. *
  219. * @return string
  220. */
  221. public function getHttpHost(){ }
  222. /**
  223. * Gets most possible client IPv4 Address. This method search in $_SERVER['REMOTE_ADDR'] and optionally in $_SERVER['HTTP_X_FORWARDED_FOR']
  224. *
  225. * @param boolean $trustForwardedHeader
  226. * @return string
  227. */
  228. public function getClientAddress($trustForwardedHeader=null){ }
  229. /**
  230. * Gets HTTP method which request has been made
  231. *
  232. * @return string
  233. */
  234. public function getMethod(){ }
  235. /**
  236. * Gets HTTP URI which request has been made
  237. *
  238. * @return string
  239. */
  240. public function getURI(){ }
  241. /**
  242. * Gets HTTP user agent used to made the request
  243. *
  244. * @return string
  245. */
  246. public function getUserAgent(){ }
  247. /**
  248. * Check if HTTP method match any of the passed methods
  249. *
  250. * @param string|array $methods
  251. * @return boolean
  252. */
  253. public function isMethod($methods){ }
  254. /**
  255. * Checks whether HTTP method is POST. if $_SERVER['REQUEST_METHOD']=='POST'
  256. *
  257. * @return boolean
  258. */
  259. public function isPost(){ }
  260. /**
  261. * Checks whether HTTP method is GET. if $_SERVER['REQUEST_METHOD']=='GET'
  262. *
  263. * @return boolean
  264. */
  265. public function isGet(){ }
  266. /**
  267. * Checks whether HTTP method is PUT. if $_SERVER['REQUEST_METHOD']=='PUT'
  268. *
  269. * @return boolean
  270. */
  271. public function isPut(){ }
  272. /**
  273. * Checks whether HTTP method is PATCH. if $_SERVER['REQUEST_METHOD']=='PATCH'
  274. *
  275. * @return boolean
  276. */
  277. public function isPatch(){ }
  278. /**
  279. * Checks whether HTTP method is HEAD. if $_SERVER['REQUEST_METHOD']=='HEAD'
  280. *
  281. * @return boolean
  282. */
  283. public function isHead(){ }
  284. /**
  285. * Checks whether HTTP method is DELETE. if $_SERVER['REQUEST_METHOD']=='DELETE'
  286. *
  287. * @return boolean
  288. */
  289. public function isDelete(){ }
  290. /**
  291. * Checks whether HTTP method is OPTIONS. if $_SERVER['REQUEST_METHOD']=='OPTIONS'
  292. *
  293. * @return boolean
  294. */
  295. public function isOptions(){ }
  296. /**
  297. * Checks whether request includes attached files
  298. *
  299. * @return boolean
  300. */
  301. public function hasFiles($notErrored=null){ }
  302. /**
  303. * Gets attached files as \Phalcon\Http\Request\File instances
  304. *
  305. * @param boolean $notErrored
  306. * @return \Phalcon\Http\Request\File[]
  307. */
  308. public function getUploadedFiles($notErrored=null){ }
  309. /**
  310. * Returns the available headers in the request
  311. *
  312. * @return array
  313. */
  314. public function getHeaders(){ }
  315. /**
  316. * Gets web page that refers active request. ie: http://www.google.com
  317. *
  318. * @return string
  319. */
  320. public function getHTTPReferer(){ }
  321. /**
  322. * Process a request header and return an array of values with their qualities
  323. *
  324. * @param string $serverIndex
  325. * @param string $name
  326. * @return array
  327. */
  328. protected function _getQualityHeader(){ }
  329. /**
  330. * Process a request header and return the one with best quality
  331. *
  332. * @param array $qualityParts
  333. * @param string $name
  334. * @return string
  335. */
  336. protected function _getBestQuality(){ }
  337. /**
  338. * Gets array with mime/types and their quality accepted by the browser/client from $_SERVER['HTTP_ACCEPT']
  339. *
  340. * @return array
  341. */
  342. public function getAcceptableContent(){ }
  343. /**
  344. * Gets best mime/type accepted by the browser/client from $_SERVER['HTTP_ACCEPT']
  345. *
  346. * @return array
  347. */
  348. public function getBestAccept(){ }
  349. /**
  350. * Gets charsets array and their quality accepted by the browser/client from $_SERVER['HTTP_ACCEPT_CHARSET']
  351. *
  352. * @return array
  353. */
  354. public function getClientCharsets(){ }
  355. /**
  356. * Gets best charset accepted by the browser/client from $_SERVER['HTTP_ACCEPT_CHARSET']
  357. *
  358. * @return string
  359. */
  360. public function getBestCharset(){ }
  361. /**
  362. * Gets languages array and their quality accepted by the browser/client from $_SERVER['HTTP_ACCEPT_LANGUAGE']
  363. *
  364. * @return array
  365. */
  366. public function getLanguages(){ }
  367. /**
  368. * Gets best language accepted by the browser/client from $_SERVER['HTTP_ACCEPT_LANGUAGE']
  369. *
  370. * @return string
  371. */
  372. public function getBestLanguage(){ }
  373. /**
  374. * Gets auth info accepted by the browser/client from $_SERVER['PHP_AUTH_USER']
  375. *
  376. * @return array
  377. */
  378. public function getBasicAuth(){ }
  379. /**
  380. * Gets auth info accepted by the browser/client from $_SERVER['PHP_AUTH_DIGEST']
  381. *
  382. * @return array
  383. */
  384. public function getDigestAuth(){ }
  385. }
  386. }