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

Fonctions membres publiques

 __construct (Input $input=null, Registry $config=null, \JApplicationWebClient $client=null)
 
 checkSession ()
 
 enqueueMessage ($msg, $type='message')
 
 execute ()
 
 getCfg ($varname, $default=null)
 
 getClientId ()
 
 getMenu ($name=null, $options=array())
 
 getMessageQueue ($clear=false)
 
 getName ()
 
 getPathway ($name=null, $options=array())
 
 getTemplate ($params=false)
 
 getUserState ($key, $default=null)
 
 getUserStateFromRequest ($key, $request, $default=null, $type='none')
 
 isAdmin ()
 
 isSite ()
 
 isHttpsForced ($clientId=null)
 
 isClient ($identifier)
 
 loadSession (\JSession $session=null)
 
 login ($credentials, $options=array())
 
 logout ($userid=null, $options=array())
 
 redirect ($url, $status=303)
 
 setUserState ($key, $value)
 
 toString ($compress=false)
 
- Fonctions membres publiques hérités de WebApplication
 __construct (Input $input=null, Registry $config=null, \JApplicationWebClient $client=null)
 
 initialise ($session=null, $document=null, $language=null, $dispatcher=null)
 
 execute ()
 
 redirect ($url, $status=303)
 
 loadConfiguration ($data)
 
 allowCache ($allow=null)
 
 setHeader ($name, $value, $replace=false)
 
 getHeaders ()
 
 clearHeaders ()
 
 sendHeaders ()
 
 setBody ($content)
 
 prependBody ($content)
 
 appendBody ($content)
 
 getBody ($asArray=false)
 
 getDocument ()
 
 getLanguage ()
 
 getSession ()
 
 flushAssets ()
 
 isSSLConnection ()
 
 loadDocument (\JDocument $document=null)
 
 loadLanguage (\JLanguage $language=null)
 
 loadSession (\JSession $session=null)
 
 afterSessionStart ()
 
- 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 ($name=null)
 
static getRouter ($name=null, array $options=array())
 
- Fonctions membres publiques statiques hérités de WebApplication
static getInstance ($name=null)
 

Champs de données

 $scope = null
 
- Champs de données hérités de WebApplication
 $charSet = 'utf-8'
 
 $mimeType = 'text/html'
 
 $modifiedDate
 
 $client
 
- Champs de données hérités de AbstractApplication
 $input
 

Fonctions membres protégées

 checkUserRequireReset ($option, $view, $layout, $tasks)
 
 initialiseApp ($options=array())
 
 loadLibraryLanguage ()
 
 render ()
 
 route ()
 
- Fonctions membres protégées hérités de WebApplication
 render ()
 
 compress ()
 
 respond ()
 
 isRedirectState ($state)
 
 getHttpStatusValue ($value)
 
 checkConnectionAlive ()
 
 checkHeadersSent ()
 
 detectRequestUri ()
 
 fetchConfigurationData ($file='', $class='\JConfig')
 
 header ($string, $replace=true, $code=null)
 
 loadSystemUris ($requestUri=null)
 
- 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

 $docOptions = array()
 
 $_clientId = null
 
 $_messageQueue = array()
 
 $_name = null
 
 $profiler = null
 
 $template = null
 
- Attributs protégés hérités de WebApplication
 $document
 
 $language
 
 $session
 
 $response
 
- 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()
 
- Attributs protégés statiques hérités de WebApplication
static $instance
 

Description détaillée

Joomla! CMS Application class

Depuis
3.2

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( Input  $input = null,
Registry  $config = null,
\JApplicationWebClient  $client = null 
)

Class constructor.

Paramètres
Input$inputAn optional argument to provide dependency injection for the application's input object. If the argument is a object that object will become the application's input object, otherwise a default input object is created.
Registry$configAn 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.
\JApplicationWebClient$clientAn optional argument to provide dependency injection for the application's client object. If the argument is a object that object will become the application's client object, otherwise a default client object is created.
Depuis
3.2

Références $client, $config, $input, JDEBUG, et null.

Documentation des fonctions membres

◆ 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
3.2
Exceptions

◆ checkUserRequireReset()

checkUserRequireReset (   $option,
  $view,
  $layout,
  $tasks 
)
protected

Check if the user is required to reset their password.

If the user is required to reset their password will be redirected to the page that manage the password reset.

Paramètres
string$optionThe option that manage the password reset
string$viewThe view that manage the password reset
string$layoutThe layout of the view that manage the password reset
string$tasksPermitted tasks
Renvoie
void

Références $layout, $name, $option, $task, et $view.

◆ 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
3.2

Références $message, $messages, $type, et InputFilter\getInstance().

◆ execute()

execute ( )

Execute the application.

Renvoie
void
Depuis
3.2

Références $input, et null.

◆ getCfg()

getCfg (   $varname,
  $default = null 
)

Gets a configuration value.

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

Références $default.

◆ getClientId()

getClientId ( )

Gets the client id of the current running application.

Renvoie
integer A client identifier.
Depuis
3.2

◆ getInstance()

static getInstance (   $name = null)
static

Returns a reference to the global CMSApplication object, only creating it if it doesn't already exist.

This method must be invoked as: $web = CMSApplication::getInstance();

Paramètres
string$nameThe name (optional) of the CMSApplication class to instantiate.
Renvoie
CMSApplication
Depuis
3.2
Exceptions

Références $name.

Référencé par SitePathway\__construct(), SiteRouter\__construct(), et Factory\getApplication().

◆ getMenu()

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

Returns the application object.

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

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

◆ getMessageQueue()

getMessageQueue (   $clear = false)

Get the system message queue.

Paramètres
boolean$clearClear the messages currently attached to the application object
Renvoie
array The system message queue.
Depuis
3.2

◆ getName()

getName ( )

Gets the name of the current running application.

Renvoie
string The name of the application.
Depuis
3.2

◆ getPathway()

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

Returns the application object.

Paramètres
string$nameThe name of the application.
array$optionsAn optional associative array of configuration settings.
Renvoie
|null
Depuis
3.2

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

◆ getRouter()

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

Returns the application object.

Paramètres
string$nameThe name of the application.
array$optionsAn optional associative array of configuration settings.
Renvoie
|null
Depuis
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
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
3.2

Références $default, $key, et null.

◆ 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.@returnmixedTherequestuserstate.@since3.2

Références $default, $key, $type, et null.

◆ initialiseApp()

initialiseApp (   $options = array())
protected

Initialise the application.

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

Références $editor, $lang, $language, $options, et $user.

◆ isAdmin()

isAdmin ( )

Is admin interface?

Renvoie
boolean True if this application is administrator.
Depuis
3.2
Obsolète:
4.0 Use isClient('administrator') instead.

◆ 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

◆ isHttpsForced()

isHttpsForced (   $clientId = null)

Checks if HTTPS is forced in the client configuration.

Paramètres
integer$clientIdAn optional client id (defaults to current application client).
Renvoie
boolean True if is forced for the client, false otherwise.
Depuis
3.7.3

Références $clientId, et null.

◆ isSite()

isSite ( )

Is site interface?

Renvoie
boolean True if this application is site.
Depuis
3.2
Obsolète:
4.0 Use isClient('site') instead.

◆ loadLibraryLanguage()

loadLibraryLanguage ( )
protected

Load the library language files for the application

Renvoie
void
Depuis
3.6.3

Références JPATH_ADMINISTRATOR.

◆ loadSession()

loadSession ( \JSession  $session = null)

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.

Paramètres
\JSession$sessionAn optional session object. If omitted, the session is created.
Renvoie
CMSApplication This method is chainable.
Depuis
3.2

Références null.

◆ 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| True on success, false if failed or silent handling is configured, or a object on authentication error.
Depuis
3.2

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

◆ 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
3.2

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

◆ redirect()

redirect (   $url,
  $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.

Paramètres
string$urlThe URL to redirect to. Can only be http/https URL
integer$statusThe HTTP 1.1 status code to be provided. 303 is assumed by default.
Renvoie
void
Depuis
3.2

Références $message, $type, et $url.

◆ render()

render ( )
protected

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.

Renvoie
void
Depuis
3.2

Références $data, JDEBUG, JPATH_BASE, JPATH_THEMES, et null.

◆ route()

route ( )
protected

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
3.2

Références $active, $base, $item, $key, $position, $uri, $value, et null.

◆ setUserState()

setUserState (   $key,
  $value 
)

Sets the value of a user state variable.

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

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

◆ toString()

toString (   $compress = false)

Sends all headers prior to returning the string

Paramètres
boolean$compressIf true, compress the data
Renvoie
string
Depuis
3.2

Documentation des champs

◆ $_clientId

$_clientId = null
protected

◆ $_messageQueue

$_messageQueue = array()
protected

◆ $_name

$_name = null
protected

◆ $docOptions

$docOptions = array()
protected

◆ $instances

$instances = array()
staticprotected

◆ $profiler

$profiler = null
protected

◆ $scope

$scope = null

◆ $template

$template = null
protected

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