1: <?php
2: namespace Sphp\core{
3: class Response {
4: /**
5: * Advance Function, Internal use
6: */
7: public function init(){}
8: /**
9: * Generate Security Policy for Browser
10: * @param string $extrahost host list
11: * @param string $extrawshost Web Socket host list
12: * @return array
13: */
14: public function getSecurityPolicy($extrahost="",$extrawshost="") {}
15: /**
16: * Add Security Policy into Browser
17: * @param array $policy
18: * @param string $policyExtra
19: * @param string $reportURL error reporting url
20: */
21: public function addSecurityHeaders($policy = array(),$policyExtra="",$reportURL="") {}
22: /**
23: * Advance Function, Internal use
24: */
25: public function setContent($data){}
26: /**
27: * Advance Function, Internal use
28: */
29: public function getContent(){}
30: /**
31: * Set Status Code of Server
32: * @param int $code
33: */
34: public function setStatusCode($code){}
35: /**
36: * Read Status Code of Server
37: * @return int
38: */
39: public function getStatusCode(){}
40: /**
41: * Add HTTP Header and send to browser
42: * SphpBase::sphp_response()->addHttpHeader("Cache-control", "public, max-age=864000, must-revalidate");
43: * @param string $key
44: * @param string $val
45: * @param int $statuscode
46: */
47: public function addHttpHeader($key,$val,$statuscode=0) {}
48: /**
49: * Remove HTTP Header from Response
50: * SphpBase::sphp_response()->removeHttpHeader("Cache-control")
51: * @param string $key
52: */
53: public function removeHttpHeader($key) {}
54: /**
55: * Get All Response Headers
56: * @return array
57: */
58: public function getHeader() {}
59: /**
60: * Advance Function, Internal use
61: */
62: public function sendHeaders() {}
63: /**
64: * Write Cookie
65: * @param string $name key
66: * @param string $value
67: * @param int $expire -1 mean calculate expire time
68: * @param string $path
69: * @param string $domain
70: * @param boolean $secure
71: * @param boolean $httponly
72: */
73: public function setCookie($name,$value="",$expire=-1,$path='/',$domain="",$secure=false,$httponly=false) {}
74: /**
75: * Advance Function, Internal use
76: */
77: public function send($sendheader=true) {}
78: }
79: }
80: