public
|
#
__construct( JInput $input = null, Joomla\Registry\Registry $config = null, JApplicationWebClient $client = null )
Class constructor.
Parameters
- $input
JInput - $input An optional argument to provide dependency injection for the
application's input object. If the argument is a JInput 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
JApplicationWebClient - $client An optional argument to provide dependency injection for the
application's client object. If the argument is a JApplicationWebClient object
that object will become the application's client object, otherwise a default
client object is created.
Since
11.3
Overrides
|
public static
JApplicationWeb
|
#
getInstance( string $name = null )
Returns a reference to the global JApplicationWeb object, only creating it if
it doesn't already exist.
Returns a reference to the global JApplicationWeb object, only creating it if
it doesn't already exist.
This method must be invoked as: $web = JApplicationWeb::getInstance();
Parameters
- $name
string - $name The name (optional) of the JApplicationWeb class to instantiate.
Returns
Since
11.3
|
public
JApplicationWeb
|
#
initialise( mixed $session = null, mixed $document = null, mixed $language = null, mixed $dispatcher = null )
Initialise the application.
Initialise the application.
Deprecated
13.1 (Platform) & 4.0 (CMS)
Parameters
- $session
mixed - $session An optional argument to provide dependency injection for the
application's session object. If the argument is a JSession object that object
will become the application's session object, if it is false then there will be
no session object, and if it is null then the default session object will be
created based on the application's loadSession() method.
- $document
mixed - $document An optional argument to provide dependency injection for the
application's document object. If the argument is a JDocument object that object
will become the application's document object, if it is false then there will be
no document object, and if it is null then the default document object will be
created based on the application's loadDocument() method.
- $language
mixed - $language An optional argument to provide dependency injection for the
application's language object. If the argument is a JLanguage object that object
will become the application's language object, if it is false then there will be
no language object, and if it is null then the default language object will be
created based on the application's loadLanguage() method.
- $dispatcher
mixed - $dispatcher An optional argument to provide dependency injection for the
application's event dispatcher. If the argument is a JEventDispatcher object
that object will become the application's event dispatcher, if it is null then
the default event dispatcher will be created based on the application's
loadDispatcher() method.
Returns
Since
11.3
See
Overrides
|
public
|
#
execute( )
Execute the application.
Since
11.3
Overrides
|
protected
|
#
render( )
Rendering is the process of pushing the document buffers into the template
placeholders, retrieving data from the document and pushing it into the
application response buffer.
Rendering is the process of pushing the document buffers into the template
placeholders, retrieving data from the document and pushing it into the
application response buffer.
Since
11.3
|
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
11.3
|
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
11.3
|
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.
Since
11.3
|
public
JApplicationWeb
|
#
loadConfiguration( mixed $data )
Load an object or array into the application configuration object.
Load an object or array into the application configuration object.
Parameters
- $data
mixed - $data Either an array or object to be loaded into the configuration object.
Returns
Since
11.3
|
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
11.3
|
public
JApplicationWeb
|
#
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
11.3
|
public
JApplicationWeb
|
#
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
11.3
|
public
JApplicationWeb
|
#
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
11.3
|
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
11.3
|
public
JDocument
|
#
getDocument( )
Method to get the application document object.
Method to get the application document object.
Returns
Since
11.3
|
public
JLanguage
|
#
getLanguage( )
Method to get the application language object.
Method to get the application language object.
Returns
Since
11.3
|
public
JSession
|
#
getSession( )
Method to get the application session object.
Method to get the application session object.
Returns
Since
11.3
|
protected
boolean
|
#
checkConnectionAlive( )
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.
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.
Returns
boolean - True if the connection is valid and normal.
Since
11.3
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
11.3
|
protected
mixed
|
#
fetchConfigurationData( string $file = '', string $class = 'JConfig' )
Method to load a PHP configuration class file based on convention and return
the instantiated data object. You will extend this method in child classes to
provide configuration data from whatever data source is relevant for your
specific application.
Method to load a PHP configuration class file based on convention and return
the instantiated data object. You will extend this method in child classes to
provide configuration data from whatever data source is relevant for your
specific application.
Parameters
- $file
string - $file The path and filename of the configuration file. If not provided,
configuration.php in JPATH_CONFIGURATION will be used.
- $class
string - $class The class name to instantiate.
Returns
mixed - Either an array or object to be loaded into the configuration object.
Throws
Since
11.3
|
public
|
#
flushAssets( )
Flush the media version to refresh versionable assets
Flush the media version to refresh versionable assets
Since
3.2
|
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
12.2
|
public
JApplicationWeb
|
#
loadDocument( JDocument $document = null )
Allows the application to load a custom or default document.
Allows the application to load a custom or default document.
The logic and options for creating this object are adequately generic for
default cases but for many applications it will make sense to override this
method and create a document, if required, based on more specific needs.
Parameters
- $document
JDocument - $document An optional document object. If omitted, the factory document is
created.
Returns
Since
11.3
|
public
JApplicationWeb
|
#
loadLanguage( JLanguage $language = null )
Allows the application to load a custom or default language.
Allows the application to load a custom or default language.
The logic and options for creating this object are adequately generic for
default cases but for many applications it will make sense to override this
method and create a language, if required, based on more specific needs.
Parameters
- $language
JLanguage - $language An optional language object. If omitted, the factory language is
created.
Returns
Since
11.3
|
public
JApplicationWeb
|
#
loadSession( JSession $session = null )
Allows the application to load a custom or default session.
Allows the application to load a custom or default session.
The logic and options for creating this object are adequately generic for
default cases but for many applications it will make sense to override this
method and create a session, if required, based on more specific needs.
Parameters
- $session
JSession - $session An optional session object. If omitted, the session is created.
Returns
Since
11.3
|
public
|
#
afterSessionStart( )
After the session has been started we need to populate it with some default
values.
After the session has been started we need to populate it with some default
values.
Since
12.2
|
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
11.3
|