WebResponse

php\webserver\WebResponse

Class WebResponse

Properties


property status

int

property contentType

string

property characterEncoding

string

property bufferSize

int

Methods


__construct($parent)

protected

Parameters:
setHeader($name, $value)
Parameters:
  • $name – string
  • $value – string
getHeader($name)
Parameters:
  • $name – string
Returns:

string

getHeaders($name)
Parameters:
  • $name – string
Returns:

string[]

getHeaderNames()
Returns:string[]
addHeader($name, $value)
Parameters:
  • $name – string
  • $value – string
redirect($location, $httpStatus = 301)
Parameters:
  • $location – string
  • $httpStatus – int
encodeRedirectURL($url)
Parameters:
  • $url – string
writeToBody($content)
Parameters:
  • $content – string
setContentLength($length)
Parameters:
  • $length – int
addCookie($cookie)
Parameters:
  • $cookie – array - [name, value, maxAge, path, domain, httpOnly, secure, comment]
getStatus()

protected

Returns:int
setStatus($status)

protected

Parameters:
  • $status – int
getContentType()

protected

Returns:string
setContentType($contentType)

protected

Parameters:
  • $contentType – string
getCharacterEncoding()

protected

Returns:string
setCharacterEncoding($characterEncoding)

protected

Parameters:
  • $characterEncoding – string
getBufferSize()

protected

Returns:int
setBufferSize($bufferSize)

protected

Parameters:
  • $bufferSize – int
static current
Returns:php\webserver\WebResponse