nyroFwk  0.2
Public Member Functions | Protected Member Functions | Protected Attributes
response_http Class Reference
Inheritance diagram for response_http:
response_abstract object response_http_html response_http_xul

Public Member Functions

 getStatus ($name=false)
 
 setStatus ($status)
 
 getCompress ()
 
 setCompress ($compress)
 
 getLayout ()
 
 setlayout ($layout)
 
 getAjaxLayout ()
 
 setAjaxlayout ($ajaxLayout)
 
 addHeader ($name, $value, $replace=true)
 
 setContentType ($value, $replace=true)
 
 neverExpire ()
 
 getHeader ($name=null)
 
 hasHeader ($name)
 
 clearHeaders ()
 
 sendHeaders ()
 
 addBeforeOut ($callback)
 
 send ($headerOnly=false)
 
 canGlobalCache ()
 
 getVarsForGlobalCache ()
 
 setVarsFromGlobalCache ($vars)
 
 sendText ($text)
 
 sendFile ($file, $name=null, $delete=false)
 
 sendFileAsString ($file, $name)
 
 showFile ($file)
 
 comment ($comment)
 
 redirect ($url, $status=301)
 
 error ($url=null, $number=404)
 
 getProxy ()
 
 getContent ()
 
 setContent ($content)
 
 send ()
 
 __call ($func, $prm)
 
 __toString ()
 
 getAttr ($name)
 
 setAttr ($name, $value)
 
 getCfg ()
 

Protected Member Functions

 afterInit ()
 
 beforeOut ()
 
 mediaDownload ($file, $forceDownload=false, $fileName=null, $delete=false)
 
 beforeInit ()
 

Protected Attributes

 $headers
 
 $beforeOut = array()
 
 $content
 
 $proxy = null
 
 $cfg
 

Detailed Description

HTTP response

Definition at line 10 of file http.class.php.

Member Function Documentation

◆ __call()

__call (   $func,
  $prm 
)
inherited

Here to avoid wrong call to the response object

Definition at line 104 of file response/abstract.class.php.

◆ __toString()

__toString ( )
inherited

Definition at line 106 of file response/abstract.class.php.

◆ addBeforeOut()

addBeforeOut (   $callback)

Add a callback before the out

Parameters
callback$callback

Definition at line 204 of file http.class.php.

◆ addHeader()

addHeader (   $name,
  $value,
  $replace = true 
)

Add a http header to the response

Parameters
string$nameHeader name
mixed$valueHeader value
bool$replaceTrue if replacement forced
Returns
bool True if header added

Definition at line 119 of file http.class.php.

◆ afterInit()

afterInit ( )
protected

Definition at line 26 of file http.class.php.

◆ beforeInit()

beforeInit ( )
protectedinherited

Call just before the configuration initialisation

Definition at line 35 of file object.class.php.

◆ beforeOut()

beforeOut ( )
protected

Execute the before out callbacks

Definition at line 211 of file http.class.php.

◆ canGlobalCache()

canGlobalCache ( )

Definition at line 251 of file http.class.php.

◆ clearHeaders()

clearHeaders ( )

Clear the header by reaffecting the default values, provided in the config

Definition at line 183 of file http.class.php.

◆ comment()

comment (   $comment)

Return the content commented regarding the request type

Parameters
string$comment
Returns
string

Definition at line 472 of file http.class.php.

◆ error()

error (   $url = null,
  $number = 404 
)

Redirect with an error the user

Parameters
string$urlThe url where to redirect
int$numberThe HTTP error number

Definition at line 509 of file http.class.php.

◆ getAjaxLayout()

getAjaxLayout ( )

Get the ajax layout will be used

Returns
string

Definition at line 98 of file http.class.php.

◆ getAttr()

getAttr (   $name)
inherited

Get an attribute

Parameters
string$nameAttribute name
Returns
mixed|null The attribute or null if not set

Definition at line 48 of file object.class.php.

◆ getCfg()

getCfg ( )
inherited

Get the configuration object

Returns
config

Definition at line 67 of file object.class.php.

◆ getCompress()

getCompress ( )

Check if the compress mode is activate

Returns
bool

Definition at line 62 of file http.class.php.

◆ getContent()

getContent ( )
inherited

Get the response content

Returns
mixed

Definition at line 40 of file response/abstract.class.php.

◆ getHeader()

getHeader (   $name = null)

Get a header value

Parameters
string | null$nameHeader name or null to get all of them
Returns
mixed|null The header value or null if not set

Definition at line 162 of file http.class.php.

◆ getLayout()

getLayout ( )

Get the layout will be used

Returns
string

Definition at line 80 of file http.class.php.

◆ getProxy()

getProxy ( )
inherited

Get the response proxy (used in the templates)

Returns
response_proxy

Definition at line 31 of file response/abstract.class.php.

◆ getStatus()

getStatus (   $name = false)

Get the response status

Parameters
bool$nameTrue if the return should be the name instead of the code status
Returns
int|string

Definition at line 36 of file http.class.php.

◆ getVarsForGlobalCache()

getVarsForGlobalCache ( )

Definition at line 255 of file http.class.php.

◆ hasHeader()

hasHeader (   $name)

Check if a header is set

Parameters
string$nameHeader name
Returns
bool

Definition at line 176 of file http.class.php.

◆ mediaDownload()

mediaDownload (   $file,
  $forceDownload = false,
  $fileName = null,
  $delete = false 
)
protected

Send a media to download, using HTTP range or not, is possible

Parameters
string$fileFile Path
bool$forceDownloadTrue if the media should be forced to download
string$fileNameFilename to send to the browser. If null, basename will be used
bool$deleteIndicate if the file should be deleted after download

Definition at line 355 of file http.class.php.

◆ neverExpire()

neverExpire ( )

Make the response to expire in 32 days

Definition at line 152 of file http.class.php.

◆ redirect()

redirect (   $url,
  $status = 301 
)

Redirect the user with a header content

Parameters
string$url
int$status

Definition at line 494 of file http.class.php.

◆ send() [1/2]

send ( )
abstractinherited

Send The response

◆ send() [2/2]

send (   $headerOnly = false)

Send The response

Parameters
bool$headerOnlySend only the header and exit

Definition at line 224 of file http.class.php.

◆ sendFile()

sendFile (   $file,
  $name = null,
  $delete = false 
)

Send a file for download

Parameters
string$fileFile Path
null | string$nameFile name. If not provided, the real filname will be used
bool$deleteIndicate if the file should be deleted after download

Definition at line 298 of file http.class.php.

◆ sendFileAsString()

sendFileAsString (   $file,
  $name 
)

Send a file for download using a string

Parameters
string$fileFile contents
string$nameFile name.

Definition at line 312 of file http.class.php.

◆ sendHeaders()

sendHeaders ( )

Send HTTP headers and cookies.

Definition at line 190 of file http.class.php.

◆ sendText()

sendText (   $text)

Send a text response (exit the programm)

Parameters
string$text

Definition at line 283 of file http.class.php.

◆ setAjaxlayout()

setAjaxlayout (   $ajaxLayout)

Set a new ajax layout to use

Parameters
string$ajaxLayout

Definition at line 107 of file http.class.php.

◆ setAttr()

setAttr (   $name,
  $value 
)
inherited

Set an attribute

Parameters
string$nameAttribute name
mixed$valueAttribute value

Definition at line 58 of file object.class.php.

◆ setCompress()

setCompress (   $compress)

Activate or desactivate the compress mode

Parameters
bool$compress

Definition at line 71 of file http.class.php.

◆ setContent()

setContent (   $content)
inherited

set the response content

Parameters
mixed$content

Definition at line 49 of file response/abstract.class.php.

◆ setContentType()

setContentType (   $value,
  $replace = true 
)

Set the content type Header of the response

Parameters
string$valueThe content type wanted (ie: html, js) (if not know in contentTypeCfg, it will be text/$value)
bool$replaceIndicate if the content-type could overwrite the current one
Returns
bool True if the content-type was set
See also
setHeader

Definition at line 137 of file http.class.php.

◆ setlayout()

setlayout (   $layout)

Set a new layout to use

Parameters
string$layout

Definition at line 89 of file http.class.php.

◆ setStatus()

setStatus (   $status)

Set the reponse status by code

Parameters
int$status
Returns
bool True if succesful

Definition at line 49 of file http.class.php.

◆ setVarsFromGlobalCache()

setVarsFromGlobalCache (   $vars)

Definition at line 262 of file http.class.php.

◆ showFile()

showFile (   $file)

Show a file to the client

Parameters
string$fileFile Path

Definition at line 329 of file http.class.php.

Field Documentation

◆ $beforeOut

$beforeOut = array()
protected

Definition at line 24 of file http.class.php.

◆ $cfg

$cfg
protectedinherited

Definition at line 17 of file object.class.php.

◆ $content

$content
protectedinherited

Definition at line 17 of file response/abstract.class.php.

◆ $headers

$headers
protected

Definition at line 17 of file http.class.php.

◆ $proxy

$proxy = null
protectedinherited

Definition at line 24 of file response/abstract.class.php.


The documentation for this class was generated from the following file:
Generated on Sun Oct 15 2017 22:25:21 for nyroFwk by doxygen 1.8.13