public
|
#
__construct( array $config = array() )
Class constructor.
Parameters
- $config
array - $config A configuration array including optional elements such as session
session_name, clientId and others. This is not exhaustive.
Since
1.5
Overrides
|
public static
JApplicationCms
|
#
getInstance( mixed $client, array $config = array(), string $prefix = 'J' )
Returns the global JApplicationCms object, only creating it if it doesn't
already exist.
Returns the global JApplicationCms object, only creating it if it doesn't
already exist.
Parameters
- $client
mixed - $client A client identifier or name.
- $config
array - $config An optional associative array of configuration settings.
- $prefix
string - $prefix A prefix for class names
Returns
Since
1.5
Note
As of 3.2, this proxies to JApplicationCms::getInstance()
|
public
|
#
initialise( array $options = array() )
Initialise the application.
Initialise the application.
Parameters
- $options
array - $options An optional associative array of configuration settings.
Since
1.5
Overrides
|
public
|
#
route( )
Route the application.
Routing is the process of examining the request environment to determine
which component should receive the request. The component optional parameters
are then set in the request object to be processed when the application is being
dispatched.
Since
1.5
|
public
|
#
dispatch( string $component = null )
Dispatch the application.
Dispatch the application.
Dispatching is the process of pulling the option from the request object and
mapping them to a component. If the component does not exist, it handles
determining a default component to dispatch.
Parameters
- $component
string - $component The component to dispatch.
Since
1.5
|
public
|
#
render( )
Render the application.
Rendering is the process of pushing the document buffers into the template
placeholders, retrieving data from the document and pushing it into the
JResponse buffer.
Since
1.5
|
public
|
#
redirect( string $url, string $msg = '', string $msgType = 'message', boolean $moved = false )
Redirect to another URL.
Optionally enqueues a message in the system message queue (which will be
displayed the next time a page is loaded) using the enqueueMessage method. If
the headers have not been sent the redirect will be accomplished using a "301
Moved Permanently" 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
- $msg
string - $msg An optional message to display on redirect.
- $msgType
string - $msgType An optional message type. Defaults to message.
- $moved
boolean - $moved True if the page is 301 Permanently Moved, otherwise 303 See Other is
assumed.
Returns
- Calls exit().
Since
1.5
See
|
public
|
#
enqueueMessage( string $msg, string $type = 'message' )
Enqueue a system message.
Enqueue a system message.
Parameters
- $msg
string - $msg The message to enqueue.
- $type
string - $type The message type. Default is message.
Since
1.5
|
public
array
|
#
getMessageQueue( )
Get the system message queue.
Get the system message queue.
Returns
array - The system message queue.
Since
1.5
|
public
mixed
|
#
getCfg( string $varname, string $default = null )
Gets a configuration value.
Gets a configuration value.
An example is in application/japplication-getcfg.php Getting a
configuration
Parameters
- $varname
string - $varname The name of the value to get.
- $default
string - $default Default value to return
Returns
mixed - The user state.
Since
1.5
|
public
string
|
#
getName( )
Method to get the application name.
Method to get the application name.
The dispatcher name is by default parsed using the classname, or it can be
set by passing a $config['name'] in the class constructor.
Returns
string - The name of the dispatcher.
Since
1.5
|
public
mixed
|
#
getUserState( string $key, mixed $default = null )
Gets a user state.
Parameters
- $key
string - $key The path of the state.
- $default
mixed - $default Optional default value, returned if the internal value is null.
Returns
mixed - The user state or null.
Since
1.5
|
public
mixed
|
#
setUserState( string $key, string $value )
Sets the value of a user state variable.
Sets the value of a user state variable.
Parameters
- $key
string - $key The path of the state.
- $value
string - $value The value of the variable.
Returns
mixed - The previous state, if one existed.
Since
1.5
|
public
The
|
#
getUserStateFromRequest( string $key, string $request, string $default = null, string $type = 'none' )
Gets the value of a user state variable.
Gets the value of a user state variable.
Parameters
- $key
string - $key The key of the user state variable.
- $request
string - $request The name of the variable passed in a request.
- $default
string - $default The default value for the variable if not found. Optional.
- $type
string - $type Filter for the variable, for valid values see JFilterInput::clean() . Optional.
Returns
The - request user state.
Since
1.5
|
public
boolean|JException
|
#
login( array $credentials, array $options = array() )
Login authentication function.
Login authentication function.
Username and encoded password are passed the onUserLogin event which is
responsible for the user validation. A successful validation updates the current
session record with the user's details.
Username and encoded password are sent as credentials (along with other
possibilities) to each observer (authentication plugin) for user validation.
Successful validation will update the current session with the user details.
Parameters
- $credentials
array - $credentials Array('username' => string, 'password' => string)
- $options
array - $options Array('remember' => boolean)
Returns
boolean|JException - True on success, false if failed or silent handling is configured, or a
JException object on authentication error.
Since
1.5
|
public
boolean
|
#
logout( integer $userid = null, array $options = array() )
Logout authentication function.
Logout authentication function.
Passed the current user information to the onUserLogout event and reverts the
current session record back to 'anonymous' parameters. If any of the
authentication plugins did not successfully complete the logout routine then the
whole method fails. Any errors raised should be done in the plugin as this
provides the ability to give much more information about why the routine may
have failed.
Parameters
- $userid
integer - $userid The user to load - Can be an integer or string - If string, it is
converted to ID automatically
- $options
array - $options Array('clientid' => array of client id's)
Returns
boolean - True on success
Since
1.5
|
public
mixed
|
#
getTemplate( boolean $params = false )
Gets the name of the current template.
Gets the name of the current template.
Parameters
- $params
boolean - $params An optional associative array of configuration settings
Returns
mixed - System is the fallback.
Since
1.5
|
public static
JRouter |null
|
#
getRouter( string $name = null, array $options = array() )
Returns the application JRouter object.
Returns the application JRouter object.
Parameters
- $name
string - $name The name of the application.
- $options
array - $options An optional associative array of configuration settings.
Returns
Since
1.5
|
public static
string
|
#
stringURLSafe( string $string )
This method transliterates a string into a URL safe string or returns a URL
safe UTF-8 string based on the global configuration
This method transliterates a string into a URL safe string or returns a URL
safe UTF-8 string based on the global configuration
Parameters
- $string
string - $string String to process
Returns
string - Processed string
Since
1.6
|
public
JPathway |null
|
#
getPathway( string $name = null, array $options = array() )
Returns the application JPathway object.
Returns the application JPathway object.
Parameters
- $name
string - $name The name of the application.
- $options
array - $options An optional associative array of configuration settings.
Returns
Since
1.5
|
public static
string
|
#
getHash( string $seed )
Provides a secure hash based on a seed
Provides a secure hash based on a seed
Parameters
- $seed
string - $seed Seed string.
Returns
string - A secure hash
Since
1.6
|
protected
JConfig
|
#
_createConfiguration( string $file )
Create the configuration registry.
Create the configuration registry.
Parameters
- $file
string - $file The path to the configuration file
Returns
JConfig - A JConfig object
Since
1.5
|
protected
JSession
|
#
_createSession( string $name )
Create the user session.
Old sessions are flushed based on the configuration value for the cookie
lifetime. If an existing session, then the last access time is updated. If a new
session, a session id is generated and a record is created in the #__sessions
table.
Parameters
- $name
string - $name The sessions name.
Returns
JSession
- JSession on success. May call exit() on database error.
Since
1.5
|
public
|
#
checkSession( )
Checks the user session.
If the session record doesn't exist, initialise it. If session is new, create
session variables
Since
1.6
|
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
3.0
|
public
integer
|
#
getClientId( )
Gets the client id of the current running application.
Gets the client id of the current running application.
Returns
integer - A client identifier.
Since
1.5
|
public
boolean
|
#
isAdmin( )
Is admin interface?
Returns
boolean - True if this application is administrator.
Since
1.0.2
|
public
boolean
|
#
isSite( )
Is site interface?
Returns
boolean - True if this application is site.
Since
1.5
|
public
boolean
|
#
isClient( string $identifier )
Check the client interface by name.
Check the client interface by name.
Parameters
- $identifier
string - $identifier String identifier for the application interface
Returns
boolean - True if this application is of the given type client interface.
Since
3.7.0
|
public static
boolean
|
#
isWinOs( )
Method to determine if the host OS is Windows
Method to determine if the host OS is Windows
Returns
boolean - True if Windows OS
Since
1.6
|
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
3.0
|
public
string
|
#
__toString( )
Returns the response as a string.
Returns the response as a string.
Returns
string - The response
Since
1.6
|