Joomla CMS  3.8.5 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.8.5 et du framework Joomla Platform intégré
Référence de la classe JApplication
+ Graphe d'héritage de JApplication:

Fonctions membres publiques

 __construct ($config=array())
 
 initialise ($options=array())
 
 route ()
 
 dispatch ($component=null)
 
 render ()
 
 redirect ($url, $msg='', $msgType='message', $moved=false)
 
 enqueueMessage ($msg, $type='message')
 
 getMessageQueue ()
 
 getCfg ($varname, $default=null)
 
 getName ()
 
 getUserState ($key, $default=null)
 
 setUserState ($key, $value)
 
 getUserStateFromRequest ($key, $request, $default=null, $type='none')
 
 login ($credentials, $options=array())
 
 logout ($userid=null, $options=array())
 
 getTemplate ($params=false)
 
 getPathway ($name=null, $options=array())
 
 getMenu ($name=null, $options=array())
 
 checkSession ()
 
 afterSessionStart ()
 
 getClientId ()
 
 isAdmin ()
 
 isSite ()
 
 isClient ($identifier)
 
 isSSLConnection ()
 
 __toString ()
 
- Fonctions membres publiques hérités de BaseApplication
 __construct (Input $input=null, Registry $config=null)
 
 getIdentity ()
 
 registerEvent ($event, $handler)
 
 triggerEvent ($event, array $args=null)
 
 loadDispatcher (\JEventDispatcher $dispatcher=null)
 
 loadIdentity (\JUser $identity=null)
 
- Fonctions membres publiques hérités de AbstractApplication
 __construct (Input $input=null, Registry $config=null)
 
 close ($code=0)
 
 execute ()
 
 get ($key, $default=null)
 
 getLogger ()
 
 set ($key, $value=null)
 
 setConfiguration (Registry $config)
 
 setLogger (LoggerInterface $logger)
 

Fonctions membres publiques statiques

static getInstance ($client, $config=array(), $prefix='J')
 
static getRouter ($name=null, array $options=array())
 
static stringURLSafe ($string)
 
static getHash ($seed)
 
static isWinOs ()
 

Champs de données

 $scope = null
 
 $requestTime = null
 
 $startTime = null
 
 $client
 
- Champs de données hérités de AbstractApplication
 $input = null
 

Fonctions membres protégées

 _createConfiguration ($file)
 
 _createSession ($name)
 
- Fonctions membres protégées hérités de BaseApplication
 doExecute ()
 
- Fonctions membres protégées hérités de AbstractApplication
 doExecute ()
 
 initialise ()
 

Attributs protégés

 $_clientId = null
 
 $_messageQueue = array()
 
 $_name = null
 
- Attributs protégés hérités de BaseApplication
 $dispatcher
 
 $identity
 
- Attributs protégés hérités de AbstractApplication
 $config
 

Attributs protégés statiques

static $instances = array()
 

Description détaillée

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.

Depuis
1.5
Obsolète:
3.2 Use CMSApplication instead unless specified otherwise

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $config = array())

Class constructor.

Paramètres
array$configA configuration array including optional elements such as session session_name, clientId and others. This is not exhaustive.
Depuis
1.5
Obsolète:
3.2

Références $config, et JPATH_CONFIGURATION.

Documentation des fonctions membres

◆ __toString()

__toString ( )

Returns the response as a string.

Renvoie
string The response
Depuis
1.6
Obsolète:
3.2

Références JResponse\toString().

◆ _createConfiguration()

_createConfiguration (   $file)
protected

Create the configuration registry.

Paramètres
string$fileThe path to the configuration file
Renvoie
JConfig A JConfig object
Depuis
1.5
Obsolète:
3.2

Références $config, $file, et JLoader\register().

◆ _createSession()

_createSession (   $name)
protected

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ètres
string$nameThe sessions name.
Renvoie
JSession JSession on success. May call exit() on database error.
Depuis
1.5
Obsolète:
3.2

Références $db, $name, $options, et $query.

◆ afterSessionStart()

afterSessionStart ( )

After the session has been started we need to populate it with some default values.

Renvoie
void
Depuis
3.0
Obsolète:
3.2

◆ checkSession()

checkSession ( )

Checks the user session.

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

Renvoie
void
Depuis
1.6
Obsolète:
3.2

Références $db, $query, et $user.

◆ dispatch()

dispatch (   $component = null)

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ètres
string$componentThe component to dispatch.
Renvoie
void
Depuis
1.5
Obsolète:
3.2

Références $component, $document, et getDocument.

◆ enqueueMessage()

enqueueMessage (   $msg,
  $type = 'message' 
)

Enqueue a system message.

Paramètres
string$msgThe message to enqueue.
string$typeThe message type. Default is message.
Renvoie
void
Depuis
1.5
Obsolète:
3.2

◆ getCfg()

getCfg (   $varname,
  $default = null 
)

Gets a configuration value.

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

Paramètres
string$varnameThe name of the value to get.
string$defaultDefault value to return
Renvoie
mixed The user state.
Depuis
1.5
Obsolète:
3.2

◆ getClientId()

getClientId ( )

Gets the client id of the current running application.

Renvoie
integer A client identifier.
Depuis
1.5
Obsolète:
3.2

◆ getHash()

static getHash (   $seed)
static

Provides a secure hash based on a seed

Paramètres
string$seedSeed string.
Renvoie
string A secure hash
Depuis
1.6
Obsolète:
3.2 Use JApplicationHelper::getHash instead

◆ getInstance()

static getInstance (   $client,
  $config = array(),
  $prefix = 'J' 
)
static

Returns the global JApplicationCms object, only creating it if it doesn't already exist.

Paramètres
mixed$clientA client identifier or name.
array$configAn optional associative array of configuration settings.
string$prefixA prefix for class names
Renvoie
JApplicationCms A JApplicationCms object.
Depuis
1.5
Obsolète:
3.2 Use JApplicationCms::getInstance() instead
Note
As of 3.2, this proxies to JApplicationCms::getInstance()

Références $client.

◆ getMenu()

getMenu (   $name = null,
  $options = array() 
)

Returns the application JPathway object.

Paramètres
string$nameThe name of the application/client.
array$optionsAn optional associative array of configuration settings.
Renvoie
JMenu|null JMenu object.
Depuis
1.5
Obsolète:
3.2

Références $menu, $name, et $options.

◆ getMessageQueue()

getMessageQueue ( )

Get the system message queue.

Renvoie
array The system message queue.
Depuis
1.5
Obsolète:
3.2

◆ getName()

getName ( )

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.

Renvoie
string The name of the dispatcher.
Depuis
1.5
Obsolète:
3.2

◆ getPathway()

getPathway (   $name = null,
  $options = array() 
)

Returns the application JPathway object.

Paramètres
string$nameThe name of the application.
array$optionsAn optional associative array of configuration settings.
Renvoie
JPathway|null A JPathway object
Depuis
1.5
Obsolète:
3.2

Références $name, et $options.

◆ getRouter()

static getRouter (   $name = null,
array  $options = array() 
)
static

Returns the application JRouter object.

Paramètres
string$nameThe name of the application.
array$optionsAn optional associative array of configuration settings.
Renvoie
JRouter|null A JRouter object
Depuis
1.5
Obsolète:
3.2

Références $app, $name, et $options.

◆ getTemplate()

getTemplate (   $params = false)

Gets the name of the current template.

Paramètres
boolean$paramsAn optional associative array of configuration settings
Renvoie
mixed System is the fallback.
Depuis
1.5
Obsolète:
3.2

Références $params, et $template.

◆ getUserState()

getUserState (   $key,
  $default = null 
)

Gets a user state.

Paramètres
string$keyThe path of the state.
mixed$defaultOptional default value, returned if the internal value is null.
Renvoie
mixed The user state or null.
Depuis
1.5
Obsolète:
3.2

◆ getUserStateFromRequest()

getUserStateFromRequest (   $key,
  $request,
  $default = null,
  $type = 'none' 
)

Gets the value of a user state variable.

Paramètres
string$keyThe key of the user state variable.
string$requestThe name of the variable passed in a request.
string$defaultThe default value for the variable if not found. Optional.
string$typeFilter for the variable, for valid values see JFilterInput::clean(). Optional.
Renvoie
mixed The request user state.
Depuis
1.5
Obsolète:
3.2

◆ initialise()

initialise (   $options = array())

Initialise the application.

Paramètres
array$optionsAn optional associative array of configuration settings.
Renvoie
void
Depuis
1.5
Obsolète:
3.2

Références $config, $editor, $options, et $user.

◆ isAdmin()

isAdmin ( )

Is admin interface?

Renvoie
boolean True if this application is administrator.
Depuis
1.0.2
Obsolète:
3.2

◆ isClient()

isClient (   $identifier)

Check the client interface by name.

Paramètres
string$identifierString identifier for the application interface
Renvoie
boolean True if this application is of the given type client interface.
Depuis
3.7.0

◆ isSite()

isSite ( )

Is site interface?

Renvoie
boolean True if this application is site.
Depuis
1.5
Obsolète:
3.2

◆ isSSLConnection()

isSSLConnection ( )

Determine if we are using a secure (SSL) connection.

Renvoie
boolean True if using SSL, false if not.
Depuis
3.0
Obsolète:
3.2

◆ isWinOs()

static isWinOs ( )
static

Method to determine if the host OS is Windows

Renvoie
boolean True if Windows OS
Depuis
1.6
Obsolète:
4.0 Use the IS_WIN constant instead.

◆ login()

login (   $credentials,
  $options = array() 
)

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ètres
array$credentialsArray('username' => string, 'password' => string)
array$optionsArray('remember' => boolean)
Renvoie
boolean|JException True on success, false if failed or silent handling is configured, or a JException object on authentication error.
Depuis
1.5
Obsolète:
3.2

◆ logout()

logout (   $userid = null,
  $options = array() 
)

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ètres
integer$useridThe user to load - Can be an integer or string - If string, it is converted to ID automatically
array$optionsArray('clientid' => array of client id's)
Renvoie
boolean True on success
Depuis
1.5
Obsolète:
3.2

Références $options, $parameters, $results, et $user.

◆ redirect()

redirect (   $url,
  $msg = '',
  $msgType = 'message',
  $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.

Paramètres
string$urlThe URL to redirect to. Can only be http/https URL
string$msgAn optional message to display on redirect.
string$msgTypeAn optional message type. Defaults to message.
boolean$movedTrue if the page is 301 Permanently Moved, otherwise 303 See Other is assumed.
Renvoie
void Calls exit().
Depuis
1.5
Obsolète:
3.2
Voir également
JApplication::enqueueMessage()

Références $document, $parts, $path, $prefix, $uri, $url, getDocument, jimport(), text, et utf8_is_ascii().

◆ render()

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.

Renvoie
void
Depuis
1.5
Obsolète:
3.2

Références $document, $params, $template, getDocument, JPATH_THEMES, et JResponse\setBody().

◆ route()

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.

Renvoie
void
Depuis
1.5
Obsolète:
3.2

Références $key, $uri, et $value.

◆ setUserState()

setUserState (   $key,
  $value 
)

Sets the value of a user state variable.

Paramètres
string$keyThe path of the state.
string$valueThe value of the variable.
Renvoie
mixed The previous state, if one existed.
Depuis
1.5
Obsolète:
3.2

◆ stringURLSafe()

static stringURLSafe (   $string)
static

This method transliterates a string into a URL safe string or returns a URL safe UTF-8 string based on the global configuration

Paramètres
string$stringString to process
Renvoie
string Processed string
Depuis
1.6
Obsolète:
3.2 Use JApplicationHelper::stringURLSafe instead

Documentation des champs

◆ $_clientId

$_clientId = null
protected

◆ $_messageQueue

$_messageQueue = array()
protected

◆ $_name

$_name = null
protected

◆ $client

$client

◆ $instances

$instances = array()
staticprotected

◆ $requestTime

$requestTime = null

◆ $scope

$scope = null

◆ $startTime

$startTime = null

La documentation de cette classe a été générée à partir du fichier suivant :