Back to Joomla project (class list)

Class CMSApplication - list of methods

Joomla! CMS Application class

Extends

Extends

Direct known subclasses

Package: Joomla\CMS\Application
Copyright: (C) 2013 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Application/CMSApplication.php
Project: Joomla

Method Summary

public
(\Joomla\CMS\Input\Input $input = null, \Joomla\Registry\Registry $config = null, \Joomla\Application\Web\WebClient $client = null, \Joomla\DI\Container $container = null)

Class constructor.
Parameters
  • \Joomla\CMS\Input\Input $input An 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.
  • \Joomla\Registry\Registry $config An 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.
  • \Joomla\Application\Web\WebClient $client An 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.
  • \Joomla\DI\Container $container Dependency injection container.
Since
  • 3.2
Show source code of this method: __construct Source Code

public void
()

Checks the user session.
Returns
  • void
Since
  • 3.2
-
  • \RuntimeException
Show source code of this method: checkSession Source Code

public void
(mixed $msg, mixed $type = self::MSG_INFO)

Enqueue a system message.
Parameters
  • string $msg The message to enqueue.
  • string $type The message type. Default is message.
Returns
  • void
Since
  • 3.2
Show source code of this method: enqueueMessage Source Code

private void
()

Ensure several core system input variables are not arrays.
Returns
  • void
Since
  • 3.9
Show source code of this method: sanityCheckSystemVariables Source Code

public void
()

Execute the application.
Returns
  • void
Since
  • 3.2
Show source code of this method: execute Source Code

protected void
(mixed $option, mixed $view, mixed $layout, mixed $tasks)

Check if the user is required to reset their password.
Parameters
  • string $option The option that manage the password reset
  • string $view The view that manage the password reset
  • string $layout The layout of the view that manage the password reset
  • string $tasks Permitted tasks
Returns
  • void
-
  • \Exception
Show source code of this method: checkUserRequireReset Source Code

public mixed
(mixed $varname, mixed $default = null)

Gets a configuration value.
Parameters
  • string $varname The name of the value to get.
  • string $default Default value to return
Returns
  • mixed The user state.
Since
  • 3.2
Deprecated
  • 5.0
Show source code of this method: getCfg Source Code

public int
()

Gets the client id of the current running application.
Returns
  • int A client identifier.
Since
  • 3.2
Show source code of this method: getClientId Source Code

public static \Joomla\CMS\Application\CmsApplication
(mixed $name = null, mixed $prefix = '\\JApplication', \Joomla\DI\Container $container = null)

Returns a reference to the global CmsApplication object, only creating it if it doesn't already exist.
Parameters
  • string $name The name (optional) of the CmsApplication class to instantiate.
  • string $prefix The class name prefix of the object.
  • \Joomla\DI\Container $container An optional dependency injection container to inject into the application.
Returns
  • \Joomla\CMS\Application\CmsApplication
Since
  • 3.2
Deprecated
  • 5.0
-
  • \RuntimeException
Show source code of this method: getInstance Source Code

public \Joomla\CMS\Menu\AbstractMenu
(mixed $name = null, mixed $options = array())

Returns the application \JMenu object.
Parameters
  • string $name The name of the application/client.
  • array $options An optional associative array of configuration settings.
Returns
  • \Joomla\CMS\Menu\AbstractMenu
Since
  • 3.2
Show source code of this method: getMenu Source Code

public array
(mixed $clear = false)

Get the system message queue.
Parameters
  • bool $clear Clear the messages currently attached to the application object
Returns
  • array The system message queue.
Since
  • 3.2
Show source code of this method: getMessageQueue Source Code

public string
()

Gets the name of the current running application.
Returns
  • string The name of the application.
Since
  • 3.2
Show source code of this method: getName Source Code

public \Joomla\CMS\Pathway\Pathway
()

Returns the application Pathway object.
Returns
  • \Joomla\CMS\Pathway\Pathway
Since
  • 3.2
Show source code of this method: getPathway Source Code

public static \Joomla\CMS\Router\Router
(mixed $name = null, array $options = array())

Returns the application Router object.
Parameters
  • string $name The name of the application.
  • array $options An optional associative array of configuration settings.
Returns
  • \Joomla\CMS\Router\Router
Since
  • 3.2
Show source code of this method: getRouter Source Code

public mixed
(mixed $params = false)

Gets the name of the current template.
Parameters
  • bool $params An optional associative array of configuration settings
Returns
  • mixed System is the fallback.
Since
  • 3.2
Show source code of this method: getTemplate Source Code

public mixed
(mixed $key, mixed $default = null)

Gets a user state.
Parameters
  • string $key The path of the state.
  • mixed $default Optional default value, returned if the internal value is null.
Returns
  • mixed The user state or null.
Since
  • 3.2
Show source code of this method: getUserState Source Code

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

Gets the value of a user state variable.
Parameters
  • string $key The key of the user state variable.
  • string $request The name of the variable passed in a request.
  • string $default The default value for the variable if not found. Optional.
  • string $type Filter for the variable, for valid values see {@link InputFilter::clean()}. Optional.
Returns
  • mixed The request user state.
Since
  • 3.2
Show source code of this method: getUserStateFromRequest Source Code

protected void
(mixed $options = array())

Initialise the application.
Parameters
  • array $options An optional associative array of configuration settings.
Returns
  • void
Since
  • 3.2
Show source code of this method: initialiseApp Source Code

public bool
(mixed $clientId = null)

Checks if HTTPS is forced in the client configuration.
Parameters
  • int $clientId An optional client id (defaults to current application client).
Returns
  • bool True if is forced for the client, false otherwise.
Since
  • 3.7.3
Show source code of this method: isHttpsForced Source Code

public bool
(mixed $identifier)

Check the client interface by name.
Parameters
  • string $identifier String identifier for the application interface
Returns
  • bool True if this application is of the given type client interface.
Since
  • 3.7.0
Show source code of this method: isClient Source Code

protected void
()

Load the library language files for the application
Returns
  • void
Since
  • 3.6.3
Show source code of this method: loadLibraryLanguage Source Code

public bool|\Exception
(mixed $credentials, mixed $options = array())

Login authentication function.
Parameters
  • array $credentials Array('username' => string, 'password' => string)
  • array $options Array('remember' => boolean)
Returns
  • bool|\Exception True on success, false if failed or silent handling is configured, or a \Exception object on authentication error.
Since
  • 3.2
Show source code of this method: login Source Code

public bool
(mixed $userid = null, mixed $options = array())

Logout authentication function.
Parameters
  • int $userid The user to load - Can be an integer or string - If string, it is converted to ID automatically
  • array $options Array('clientid' => array of client id's)
Returns
  • bool True on success
Since
  • 3.2
Show source code of this method: logout Source Code

public void
(mixed $url, mixed $status = 303)

Redirect to another URL.
Parameters
  • string $url The URL to redirect to. Can only be http/https URL
  • int $status The HTTP 1.1 status code to be provided. 303 is assumed by default.
Returns
  • void
Since
  • 3.2
Show source code of this method: redirect Source Code

protected void
()

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.
Returns
  • void
Since
  • 3.2
Show source code of this method: render Source Code

protected void
()

Route the application.
Returns
  • void
Since
  • 3.2
Show source code of this method: route Source Code

public mixed|void
(mixed $key, mixed $value)

Sets the value of a user state variable.
Parameters
  • string $key The path of the state.
  • mixed $value The value of the variable.
Returns
  • mixed|void The previous state, if one existed.
Since
  • 3.2
Show source code of this method: setUserState Source Code

public string
(mixed $compress = false)

Sends all headers prior to returning the string
Parameters
  • bool $compress If true, compress the data
Returns
  • string
Since
  • 3.2
Show source code of this method: toString Source Code

public string
(mixed $forceNew = false)

Method to determine a hash for anti-spoofing variable names
Parameters
  • bool $forceNew If true, force a new token to be created
Returns
  • string Hashed var name
Since
  • 4.0.0
Show source code of this method: getFormToken Source Code

public bool
(mixed $method = 'post')

Checks for a form token in the request.
Parameters
  • string $method The request method in which to look for the token key.
Returns
  • bool True if found and valid, false otherwise.
Since
  • 4.0.0
Show source code of this method: checkToken Source Code

public bool
()

Flag if the application instance is a CLI or web based application.
Returns
  • bool
Since
  • 4.0.0
Deprecated
  • 5.0
Show source code of this method: isCli Source Code

protected bool
()

Checks if 2fa needs to be enforced if so returns true, else returns false
Returns
  • bool
Since
  • 4.0.0
-
  • \Exception
Show source code of this method: isTwoFactorAuthenticationRequired Source Code

protected void
()

Redirects user to his Two Factor Authentication setup page
Returns
  • void
Since
  • 4.0.0

private bool
()

Checks if otpKey and otep for the user are not empty if any one is empty returns false, else returns true
Returns
  • bool
Since
  • 4.0.0
-
  • \Exception

private void
()

Setup logging functionality.
Returns
  • void
Since
  • 4.0.0
Show source code of this method: setupLogging Source Code

Properties Summary

protected array
$docOptions
Array of options for the \JDocument object
Since
  • 3.2
protected static \Joomla\CMS\Application\CmsApplication[]
$instances
Application instances container.
Since
  • 3.2
public string
$scope
The scope of the application.
Since
  • 3.2
protected int
$clientId
The client identifier.
Since
  • 4.0.0
protected array
$messageQueue
The application message queue.
Since
  • 4.0.0
protected string
$name
The name of the application.
Since
  • 4.0.0
protected \Joomla\CMS\Profiler\Profiler
$profiler
The profiler instance
Since
  • 3.2
protected object
$template
Currently active template
Since
  • 3.2
protected \Joomla\CMS\Pathway\Pathway
$pathway
The pathway object
Since
  • 4.0.0
protected string
$authenticationPluginType
The authentication plugin type
Since
  • 4.0.0

Tags Summary

Since
3.2