[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/application/src/ -> AbstractWebApplication.php (summary)

Part of the Joomla Framework Application Package

Copyright: Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
License: GNU General Public License version 2 or later; see LICENSE
File Size: 1057 lines (29 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 28 functions

  __construct()
  __get()
  execute()
  compress()
  respond()
  getInput()
  redirect()
  allowCache()
  setHeader()
  getHeaders()
  clearHeaders()
  sendHeaders()
  setBody()
  prependBody()
  appendBody()
  getBody()
  getResponse()
  getHttpStatusValue()
  isValidHttpStatus()
  checkConnectionAlive()
  checkHeadersSent()
  detectRequestUri()
  header()
  setResponse()
  isRedirectState()
  isSslConnection()
  loadSystemUris()
  isAscii()

Functions
Functions that are not part of a class:

__construct(Input $input = null, Registry $config = null, Web\WebClient $client = null, ResponseInterface $response = null)   X-Ref
Class constructor.

param: Input              $input     An optional argument to provide dependency injection for the application's
param: Registry           $config    An optional argument to provide dependency injection for the application's
param: Web\WebClient      $client    An optional argument to provide dependency injection for the application's
param: ResponseInterface  $response  An optional argument to provide dependency injection for the application's

__get($name)   X-Ref
Magic method to access properties of the application.

param: string  $name  The name of the property.
return: mixed   A value if the property name is valid, null otherwise.

execute()   X-Ref
Execute the application.

return: void

compress()   X-Ref
Checks the accept encoding of the browser and compresses the data before sending it to the client if possible.

return: void

respond()   X-Ref
Method to send the application response to the client.  All headers will be sent prior to the main application output data.

return: void

getInput()   X-Ref
Method to get the application input object.

return: Input

redirect($url, $status = 303)   X-Ref
Redirect to another URL.

If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" or "303 See Other" code in the header
pointing to the new location. If the headers have already been sent this will be accomplished using a JavaScript statement.

param: string           $url     The URL to redirect to. Can only be http/https URL
param: integer|boolean  $status  The HTTP status code to be provided. 303 is assumed by default.
return: void

allowCache($allow = null)   X-Ref
Set/get cachable state for the response.

If $allow is set, sets the cachable state of the response.  Always returns the current state.

param: boolean  $allow  True to allow browser caching.
return: boolean

setHeader($name, $value, $replace = false)   X-Ref
Method to set a response header.

If the replace flag is set then all headers with the given name will be replaced by the new one.
The headers are stored in an internal array to be sent when the site is sent to the browser.

param: string   $name     The name of the header to set.
param: string   $value    The value of the header to set.
param: boolean  $replace  True to replace any headers with the same name.
return: $this

getHeaders()   X-Ref
Method to get the array of response headers to be sent when the response is sent to the client.

return: array

clearHeaders()   X-Ref
Method to clear any set response headers.

return: $this

sendHeaders()   X-Ref
Send the response headers.

return: $this

setBody($content)   X-Ref
Set body content.  If body content already defined, this will replace it.

param: string  $content  The content to set as the response body.
return: $this

prependBody($content)   X-Ref
Prepend content to the body content

param: string  $content  The content to prepend to the response body.
return: $this

appendBody($content)   X-Ref
Append content to the body content

param: string  $content  The content to append to the response body.
return: $this

getBody()   X-Ref
Return the body content

return: string  The response body as a string.

getResponse()   X-Ref
Get the PSR-7 Response Object.

return: ResponseInterface

getHttpStatusValue($value)   X-Ref
Check if a given value can be successfully mapped to a valid http status value

param: string|int  $value  The given status as int or string
return: string

isValidHttpStatus($code)   X-Ref
Check if the value is a valid HTTP status code

param: integer  $code  The potential status code
return: boolean

checkConnectionAlive()   X-Ref
Method to check the current client connection status to ensure that it is alive.  We are
wrapping this to isolate the connection_status() function from our code base for testing reasons.

return: boolean  True if the connection is valid and normal.

checkHeadersSent()   X-Ref
Method to check to see if headers have already been sent.

return: boolean  True if the headers have already been sent.

detectRequestUri()   X-Ref
Method to detect the requested URI from server environment variables.

return: string  The requested URI

header($string, $replace = true, $code = null)   X-Ref
Method to send a header to the client.

param: string   $string   The header string.
param: boolean  $replace  The optional replace parameter indicates whether the header should replace a previous similar header, or add
param: integer  $code     Forces the HTTP response code to the specified value. Note that this parameter only has an effect if the string
return: void

setResponse(ResponseInterface $response)   X-Ref
Set the PSR-7 Response Object.

param: ResponseInterface  $response  The response object
return: void

isRedirectState($state)   X-Ref
Checks if a state is a redirect state

param: integer  $state  The HTTP status code.
return: boolean

isSslConnection()   X-Ref
Determine if we are using a secure (SSL) connection.

return: boolean  True if using SSL, false if not.

loadSystemUris($requestUri = null)   X-Ref
Method to load the system URI strings for the application.

param: string  $requestUri  An optional request URI to use instead of detecting one from the server environment variables.
return: void

isAscii($str)   X-Ref
Tests whether a string contains only 7bit ASCII bytes.

You might use this to conditionally check whether a string
needs handling as UTF-8 or not, potentially offering performance
benefits by using the native PHP equivalent if it's just ASCII e.g.;

param: string  $str  The string to test.
return: boolean  True if the string is all ASCII



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer