[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/libraries/joomla/application/ -> application.php (summary)

(no description)

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

Defines 1 class

JApplication:: (33 methods):
  __construct()
  getInstance()
  initialise()
  route()
  dispatch()
  render()
  close()
  redirect()
  enqueueMessage()
  getMessageQueue()
  getCfg()
  getName()
  getUserState()
  setUserState()
  getUserStateFromRequest()
  registerEvent()
  triggerEvent()
  login()
  logout()
  getTemplate()
  getRouter()
  stringURLSafe()
  getPathway()
  getMenu()
  getHash()
  _createConfiguration()
  _createSession()
  checkSession()
  getClientId()
  isAdmin()
  isSite()
  isWinOS()
  __toString()


Class: JApplication  - X-Ref

Base class for a Joomla! application.

Acts as a Factory class for application specific objects and provides many
supporting API functions. Derived clases should supply the route(), dispatch()
and render() functions.

__construct($config = array()   X-Ref
Class constructor.

param: array  $config  A configuration array including optional elements such as session

getInstance($client, $config = array()   X-Ref
Returns the global JApplication object, only creating it if it
doesn't already exist.

param: mixed   $client  A client identifier or name.
param: array   $config  An optional associative array of configuration settings.
param: string  $prefix  A prefix for class names
return: JApplication A JApplication object.

initialise($options = array()   X-Ref
Initialise the application.

param: array  $options  An optional associative array of configuration settings.
return: void

route()   X-Ref
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.

return: void

dispatch($component = null)   X-Ref
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.

param: string  $component  The component to dispatch.
return: void

render()   X-Ref
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.

return: void

close($code = 0)   X-Ref
Exit the application.

param: integer  $code  Exit code
return: void     Exits the application.

redirect($url, $msg = '', $msgType = 'message', $moved = false)   X-Ref
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.

param: string   $url      The URL to redirect to. Can only be http/https URL
param: string   $msg      An optional message to display on redirect.
param: string   $msgType  An optional message type. Defaults to message.
param: boolean  $moved    True if the page is 301 Permanently Moved, otherwise 303 See Other is assumed.
return: void  Calls exit().

enqueueMessage($msg, $type = 'message')   X-Ref
Enqueue a system message.

param: string  $msg   The message to enqueue.
param: string  $type  The message type. Default is message.
return: void

getMessageQueue()   X-Ref
Get the system message queue.

return: array  The system message queue.

getCfg($varname, $default = null)   X-Ref
Gets a configuration value.

An example is in application/japplication-getcfg.php Getting a configuration

param: string  $varname  The name of the value to get.
param: string  $default  Default value to return
return: mixed  The user state.

getName()   X-Ref
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.

return: string  The name of the dispatcher.

getUserState($key, $default = null)   X-Ref
Gets a user state.

param: string  $key      The path of the state.
param: mixed   $default  Optional default value, returned if the internal value is null.
return: mixed  The user state or null.

setUserState($key, $value)   X-Ref
Sets the value of a user state variable.

param: string  $key    The path of the state.
param: string  $value  The value of the variable.
return: mixed  The previous state, if one existed.

getUserStateFromRequest($key, $request, $default = null, $type = 'none')   X-Ref
Gets the value of a user state variable.

param: string  $key      The key of the user state variable.
param: string  $request  The name of the variable passed in a request.
param: string  $default  The default value for the variable if not found. Optional.
param: string  $type     Filter for the variable, for valid values see {@link JFilterInput::clean()}. Optional.
return: The request user state.

registerEvent($event, $handler)   X-Ref
Registers a handler to a particular event group.

param: string  $event    The event name.
param: mixed   $handler  The handler, a function or an instance of a event object.
return: void

triggerEvent($event, $args = null)   X-Ref
Calls all handlers associated with an event group.

param: string  $event  The event name.
param: array   $args   An array of arguments.
return: array  An array of results from each function call.

login($credentials, $options = array()   X-Ref
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.

param: array  $credentials  Array('username' => string, 'password' => string)
param: array  $options      Array('remember' => boolean)
return: boolean  True on success.

logout($userid = null, $options = array()   X-Ref
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.

param: integer  $userid   The user to load - Can be an integer or string - If string, it is converted to ID automatically
param: array    $options  Array('clientid' => array of client id's)
return: boolean  True on success

getTemplate($params = false)   X-Ref
Gets the name of the current template.

param: array  $params  An optional associative array of configuration settings
return: string  System is the fallback.

getRouter($name = null, array $options = array()   X-Ref
Returns the application JRouter object.

param: string  $name     The name of the application.
param: array   $options  An optional associative array of configuration settings.
return: JRouter  A JRouter object

stringURLSafe($string)   X-Ref
This method transliterates a string into an URL
safe string or returns a URL safe UTF-8 string
based on the global configuration

param: string  $string  String to process
return: string  Processed string

getPathway($name = null, $options = array()   X-Ref
Returns the application JPathway object.

param: string  $name     The name of the application.
param: array   $options  An optional associative array of configuration settings.
return: JPathway  A JPathway object

getMenu($name = null, $options = array()   X-Ref
Returns the application JPathway object.

param: string  $name     The name of the application/client.
param: array   $options  An optional associative array of configuration settings.
return: JMenu  JMenu object.

getHash($seed)   X-Ref
Provides a secure hash based on a seed

param: string  $seed  Seed string.
return: string  A secure hash

_createConfiguration($file)   X-Ref
Create the configuration registry.

param: string  $file  The path to the configuration file
return: object  A JConfig object

_createSession($name)   X-Ref
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.

param: string  $name  The sessions name.
return: JSession  JSession on success. May call exit() on database error.

checkSession()   X-Ref
Checks the user session.

If the session record doesn't exist, initialise it.
If session is new, create session variables

return: void

getClientId()   X-Ref
Gets the client id of the current running application.

return: integer  A client identifier.

isAdmin()   X-Ref
Is admin interface?

return: boolean  True if this application is administrator.

isSite()   X-Ref
Is site interface?

return: boolean  True if this application is site.

isWinOS()   X-Ref
Method to determine if the host OS is  Windows

return: boolean  True if Windows OS

__toString()   X-Ref
Returns the response as a string.

return: string  The response



Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1