public
|
#
__construct( Joomla\Input\Input $input = null, Joomla\Registry\Registry $config = null, Joomla\Application\Web\WebClient $client = null )
Class constructor.
Parameters
- $input
Joomla\Input\Input - $input An optional argument to provide dependency injection for the
application's input object. If the argument is an Input object that object will
become the application's input object, otherwise a default input object is
created.
- $config
Joomla\Registry\Registry - $config An optional argument to provide dependency injection for the
application's config object. If the argument is a Registry object that object
will become the application's config object, otherwise a default config object
is created.
- $client
Joomla\Application\Web\WebClient - $client An optional argument to provide dependency injection for the
application's client object. If the argument is a Web\WebClient object that
object will become the application's client object, otherwise a default client
object is created.
Since
1.0
Overrides
|
public
|
#
execute( )
Execute the application.
Since
1.0
Overrides
|
protected
|
#
compress( )
Checks the accept encoding of the browser and compresses the data before
sending it to the client if possible.
Checks the accept encoding of the browser and compresses the data before
sending it to the client if possible.
Since
1.0
|
protected
|
#
respond( )
Method to send the application response to the client. All headers will be
sent prior to the main application output data.
Method to send the application response to the client. All headers will be
sent prior to the main application output data.
Since
1.0
|
public
|
#
redirect( string $url, integer $status = 303 )
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.
Parameters
- $url
string - $url The URL to redirect to. Can only be http/https URL
- $status
integer - $status The HTTP 1.1 status code to be provided. 303 is assumed by default.
Throws
Since
1.0
|
public
boolean
|
#
allowCache( boolean $allow = null )
Set/get cachable state for the response. If $allow is set, sets the cachable
state of the response. Always returns the current state.
Set/get cachable state for the response. If $allow is set, sets the cachable
state of the response. Always returns the current state.
Parameters
- $allow
boolean - $allow True to allow browser caching.
Returns
boolean
Since
1.0
|
public
Joomla\Application\AbstractWebApplication
|
#
setBody( string $content )
Set body content. If body content already defined, this will replace it.
Set body content. If body content already defined, this will replace it.
Parameters
- $content
string - $content The content to set as the response body.
Returns
Since
1.0
|
public
Joomla\Application\AbstractWebApplication
|
#
prependBody( string $content )
Prepend content to the body content
Prepend content to the body content
Parameters
- $content
string - $content The content to prepend to the response body.
Returns
Since
1.0
|
public
Joomla\Application\AbstractWebApplication
|
#
appendBody( string $content )
Append content to the body content
Append content to the body content
Parameters
- $content
string - $content The content to append to the response body.
Returns
Since
1.0
|
public
mixed
|
#
getBody( boolean $asArray = false )
Return the body content
Parameters
- $asArray
boolean - $asArray True to return the body as an array of strings.
Returns
mixed - The response body either as an array or concatenated string.
Since
1.0
|
public
Joomla\Session\Session
|
#
getSession( )
Method to get the application session object.
Method to get the application session object.
Returns
Since
1.0
|
protected
boolean
|
#
checkConnectionAlive( )
Method to check the current client connnection status to ensure that it is
alive. We are wrapping this to isolate the connection_status() function from our
code base for testing reasons.
Method to check the current client connnection status to ensure that it is
alive. We are wrapping this to isolate the connection_status() function from our
code base for testing reasons.
Returns
boolean - True if the connection is valid and normal.
Since
1.0
See
connection_status()
CodeCoverageIgnore
|
protected
string
|
#
detectRequestUri( )
Method to detect the requested URI from server environment variables.
Method to detect the requested URI from server environment variables.
Returns
string - The requested URI
Since
1.0
|
public
boolean
|
#
isSslConnection( )
Determine if we are using a secure (SSL) connection.
Determine if we are using a secure (SSL) connection.
Returns
boolean - True if using SSL, false if not.
Since
1.0
|
public
Joomla\Application\AbstractWebApplication
|
#
setSession( Joomla\Session\Session $session )
Sets the session for the application to use, if required.
Sets the session for the application to use, if required.
Parameters
Returns
Since
1.0
|
protected
|
#
loadSystemUris( string $requestUri = null )
Method to load the system URI strings for the application.
Method to load the system URI strings for the application.
Parameters
- $requestUri
string - $requestUri An optional request URI to use instead of detecting one from the
server environment variables.
Since
1.0
|
public
boolean
|
#
checkToken( string $method = 'post' )
Checks for a form token in the request.
Checks for a form token in the request.
Use in conjunction with getFormToken.
Parameters
- $method
string - $method The request method in which to look for the token key.
Returns
boolean - True if found and valid, false otherwise.
Since
1.0
|
public
string
|
#
getFormToken( boolean $forceNew = false )
Method to determine a hash for anti-spoofing variable names
Method to determine a hash for anti-spoofing variable names
Parameters
- $forceNew
boolean - $forceNew If true, force a new token to be created
Returns
string - Hashed var name
Since
1.0
|
public static
boolean
|
#
isAscii( string $str )
Tests whether a string contains only 7bit ASCII bytes.
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.;
Parameters
- $str
string - $str The string to test.
Returns
boolean - True if the string is all ASCII
Since
1.4.0
|