Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe CMSApplication
+ Graphe d'héritage de CMSApplication:

Fonctions membres publiques

 __construct (Input $input=null, Registry $config=null, WebClient $client=null, Container $container=null)
 
 checkSession ()
 
 enqueueMessage ($msg, $type=self::MSG_INFO)
 
 getCfg ($varname, $default=null)
 
 getClientId ()
 
 getMenu ($name=null, $options=array())
 
 getMessageQueue ($clear=false)
 
 getName ()
 
 getPathway ()
 
 getTemplate ($params=false)
 
 getUserState ($key, $default=null)
 
 getUserStateFromRequest ($key, $request, $default=null, $type='none')
 
 isHttpsForced ($clientId=null)
 
 isClient ($identifier)
 
 login ($credentials, $options=array())
 
 logout ($userid=null, $options=array())
 
 redirect ($url, $status=303)
 
 setUserState ($key, $value)
 
 toString ($compress=false)
 
 isCli ()
 
 setMenuFactory (MenuFactoryInterface $menuFactory)
 
- Fonctions membres publiques hérités de WebApplication
 __construct (Input $input=null, Registry $config=null, WebClient $client=null, ResponseInterface $response=null)
 
 execute ()
 
 getDocument ()
 
 getLanguage ()
 
 flushAssets ()
 
 loadDocument (Document $document=null)
 
 loadLanguage (Language $language=null)
 
 loadSession (Session $session=null)
 
 afterSessionStart (SessionEvent $event)
 
 getConfig ()
 
- Fonctions membres publiques hérités de AbstractWebApplication
 __construct (Input $input=null, Registry $config=null, Web\WebClient $client=null, ResponseInterface $response=null)
 
 __get ($name)
 
 execute ()
 
 getInput ()
 
 redirect ($url, $status=303)
 
 allowCache ($allow=null)
 
 setHeader ($name, $value, $replace=false)
 
 getHeaders ()
 
 clearHeaders ()
 
 sendHeaders ()
 
 setBody ($content)
 
 prependBody ($content)
 
 appendBody ($content)
 
 getBody ()
 
 getResponse ()
 
 isValidHttpStatus ($code)
 
 setResponse (ResponseInterface $response)
 
 isSslConnection ()
 
- Fonctions membres publiques hérités de AbstractApplication
 __construct (Registry $config=null)
 
 close ($code=0)
 
 execute ()
 
 get ($key, $default=null)
 
 getLogger ()
 
 set ($key, $value=null)
 
 setConfiguration (Registry $config)
 
- Fonctions membres publiques hérités de LoggerAwareInterface
 setLogger (LoggerInterface $logger)
 
- Fonctions membres publiques hérités de DispatcherAwareInterface
 setDispatcher (DispatcherInterface $dispatcher)
 
- Fonctions membres publiques hérités de ContainerAwareInterface
 setContainer (Container $container)
 
- Fonctions membres publiques hérités de CMSWebApplicationInterface
 getDocument ()
 
- Fonctions membres publiques hérités de SessionAwareWebApplicationInterface
 getSession ()
 
 setSession (SessionInterface $session)
 
 checkToken ($method='post')
 
 getFormToken ($forceNew=false)
 
- Fonctions membres publiques hérités de CMSApplicationInterface
 getMessageQueue ()
 
 getIdentity ()
 
 getInput ()
 
 getLanguage ()
 
 loadIdentity (User $identity=null)
 
- Fonctions membres publiques hérités de ExtensionManagerInterface
 bootComponent ($component)
 
 bootModule ($module, $applicationName)
 
 bootPlugin ($plugin, $type)
 
- Fonctions membres publiques hérités de EventAwareInterface
 getDispatcher ()
 
 triggerEvent ($eventName, $args=[])
 

Fonctions membres publiques statiques

static getInstance ($name=null, $prefix='\JApplication', Container $container=null)
 
static getRouter ($name=null, array $options=array())
 
- Fonctions membres publiques statiques hérités de WebApplication
static getInstance ($name=null)
 
- Fonctions membres publiques statiques hérités de AbstractWebApplication
static isAscii ($str)
 

Champs de données

 $scope = null
 
- Champs de données hérités de AbstractWebApplication
 $charSet = 'utf-8'
 
 $mimeType = 'text/html'
 
 $httpVersion = '1.1'
 
 $modifiedDate
 
 $client
 
- Champs de données hérités de CMSApplicationInterface
const MSG_EMERGENCY = 'emergency'
 
const MSG_ALERT = 'alert'
 
const MSG_CRITICAL = 'critical'
 
const MSG_ERROR = 'error'
 
const MSG_WARNING = 'warning'
 
const MSG_NOTICE = 'notice'
 
const MSG_INFO = 'info'
 
const MSG_DEBUG = 'debug'
 

Fonctions membres protégées

 checkUserRequireReset ($option, $view, $layout, $tasks)
 
 initialiseApp ($options=array())
 
 loadLibraryLanguage ()
 
 render ()
 
 route ()
 
 isTwoFactorAuthenticationRequired ()
 
- Fonctions membres protégées hérités de WebApplication
 render ()
 
 loadSystemUris ($requestUri=null)
 
- Fonctions membres protégées hérités de AbstractWebApplication
 compress ()
 
 respond ()
 
 getHttpStatusValue ($value)
 
 checkConnectionAlive ()
 
 checkHeadersSent ()
 
 detectRequestUri ()
 
 header ($string, $replace=true, $code=null)
 
 isRedirectState ($state)
 
 loadSystemUris ($requestUri=null)
 
- Fonctions membres protégées hérités de AbstractApplication
 dispatchEvent (string $eventName, ?EventInterface $event=null)
 
 doExecute ()
 
 initialise ()
 

Attributs protégés

 $docOptions = array()
 
 $clientId = null
 
 $messageQueue = array()
 
 $name = null
 
 $profiler = null
 
 $template = null
 
 $pathway = null
 
 $authenticationPluginType = 'authentication'
 
 $menus = []
 
- Attributs protégés hérités de WebApplication
 $document
 
 $language
 
- Attributs protégés hérités de AbstractWebApplication
 $input
 
 $response
 
- 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
 

Fonctions membres privées

 sanityCheckSystemVariables ()
 
 hasUserConfiguredTwoFactorAuthentication ()
 
 setupLogging ()
 

Attributs privés

 $menuFactory
 

Description détaillée

Joomla! CMS Application class

Depuis
3.2

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( Input  $input = null,
Registry  $config = null,
WebClient  $client = null,
Container  $container = null 
)

Class constructor.

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

Références $client, $config, $container, $input, Symfony\Contracts\Service\__construct(), Profiler\getInstance(), JDEBUG, null, et Joomla\DI\setContainer().

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

Références class, Joomla\DI\getContainer(), Joomla\CMS\Application\getIdentity(), et Joomla\Application\getSession().

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

Références $layout, $name, $option, $task, $url, $user, $view, Text\_(), Route\_(), Factory\getApplication(), et Factory\getUser().

◆ enqueueMessage()

enqueueMessage (   $msg,
  $type = self::MSG_INFO 
)

Enqueue a system message.

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

Implémente CMSApplicationInterface.

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

◆ 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, Log\add(), et Log\WARNING.

◆ getClientId()

getClientId ( )

Gets the client id of the current running application.

Renvoie
integer A client identifier.
Depuis
3.2

Références $clientId.

◆ getInstance()

static getInstance (   $name = null,
  $prefix = '\JApplication',
Container  $container = 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.
string$prefixThe class name prefix of the object.
Container$containerAn optional dependency injection container to inject into the application.
Renvoie
CmsApplication
Depuis
3.2
Exceptions

Références $container, $name, $prefix, elseif, Factory\getContainer(), Factory\getUser(), null, et Text\sprintf().

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

Implémente CMSWebApplicationInterface.

Références AbstractMenu\$instances, $name, $options, $this, class, Joomla\DI\getContainer(), et null.

◆ 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

Références Joomla\Application\getSession().

◆ getName()

getName ( )

Gets the name of the current running application.

Renvoie
string The name of the application.
Depuis
3.2

Implémente CMSApplicationInterface.

Références $name.

◆ getPathway()

getPathway ( )

Returns the application Pathway object.

Renvoie
Pathway
Depuis
3.2

Références Joomla\DI\getContainer(), Symfony\Contracts\Service\has(), et Text\sprintf().

◆ getRouter()

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

Returns the application Router object.

Paramètres
string$nameThe name of the application.
array$optionsAn optional associative array of configuration settings.
Renvoie
Router
Depuis
3.2
Obsolète:
5.0 Inject the router or load it from the dependency injection container

Implémente CMSWebApplicationInterface.

Références $app, $name, $options, Factory\getApplication(), et Router\getInstance().

◆ 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

Implémente CMSWebApplicationInterface.

Références $default, $key, Joomla\Application\getSession(), 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 InputFilter::clean(). Optional.
Renvoie
mixed The request user state.
Depuis
3.2

Implémente CMSWebApplicationInterface.

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

◆ hasUserConfiguredTwoFactorAuthentication()

hasUserConfiguredTwoFactorAuthentication ( )
private

No longer used

Renvoie
boolean
Depuis
4.0.0
Exceptions

◆ 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, Factory\$language, $options, $user, Language\getInstance(), Factory\getUser(), PluginHelper\importPlugin(), PluginHelper\isEnabled(), et Joomla\CMS\Application\triggerEvent().

◆ isCli()

isCli ( )

Flag if the application instance is a CLI or web based application.

Helper function, you should use the native PHP functions to detect if it is a CLI application.

Renvoie
boolean
Depuis
4.0.0
Obsolète:
5.0 Will be removed without replacements

Implémente CMSApplicationInterface.

◆ 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

Implémente CMSApplicationInterface.

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

◆ isTwoFactorAuthenticationRequired()

isTwoFactorAuthenticationRequired ( )
protected

No longer used

Renvoie
boolean
Depuis
4.0.0
Exceptions

◆ loadLibraryLanguage()

loadLibraryLanguage ( )
protected

Load the library language files for the application

Renvoie
void
Depuis
3.6.3

Références JPATH_ADMINISTRATOR.

◆ 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, $user, Text\_(), Factory\getApplication(), Authentication\getInstance(), Joomla\CMS\Application\getLogger(), Factory\getUser(), PluginHelper\importPlugin(), Authentication\STATUS_DENIED, Authentication\STATUS_EXPIRED, Authentication\STATUS_SUCCESS, et Joomla\CMS\Application\triggerEvent().

◆ 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, $user, Factory\getUser(), PluginHelper\importPlugin(), et Joomla\CMS\Application\triggerEvent().

◆ 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

Implémente WebApplicationInterface.

Références $url, et Joomla\Application\getSession().

◆ 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, __DIR__, Factory\getUser(), PluginHelper\importPlugin(), JDEBUG, JPATH_BASE, JPATH_THEMES, null, et Joomla\CMS\Application\triggerEvent().

◆ 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
Obsolète:
5.0 Implement the route functionality in the extending class, this here will be removed without replacement

Références $active, $base, $item, $key, $position, $result, $uri, $value, Uri\base(), Uri\getInstance(), PluginHelper\importPlugin(), null, StringHelper\strtolower(), et Joomla\CMS\Application\triggerEvent().

◆ sanityCheckSystemVariables()

sanityCheckSystemVariables ( )
private

Ensure several core system input variables are not arrays.

Renvoie
void
Depuis
3.9

Références $input, et null.

◆ setMenuFactory()

setMenuFactory ( MenuFactoryInterface  $menuFactory)

Sets the internal menu factory.

Paramètres
MenuFactoryInterface$menuFactoryThe menu factory
Renvoie
void
Depuis
4.2.0

◆ setupLogging()

setupLogging ( )
private

Setup logging functionality.

Renvoie
void
Depuis
4.0.0

Références $mode, Log\addLogger(), Log\ALERT, Log\ALL, Log\CRITICAL, Log\EMERGENCY, et Log\ERROR.

◆ 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|void The previous state, if one existed.
Depuis
3.2

Implémente CMSWebApplicationInterface.

Références $key, $value, Joomla\Application\getSession(), 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

Références Laminas\Diactoros\getBody().

Documentation des champs

◆ $authenticationPluginType

$authenticationPluginType = 'authentication'
protected

◆ $clientId

$clientId = null
protected

◆ $docOptions

$docOptions = array()
protected

◆ $instances

$instances = array()
staticprotected

◆ $menuFactory

$menuFactory
private

◆ $menus

$menus = []
protected

◆ $messageQueue

$messageQueue = array()
protected

◆ $name

$name = null
protected

◆ $pathway

$pathway = null
protected

◆ $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 :