Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques statiques | |
static | getRouter ($name=null, array $options=array()) |
Fonctions membres protégées | |
doExecute () | |
getDefaultCommands () | |
populateHttpHost () | |
getDefaultInputDefinition () | |
Fonctions membres protégées hérités de Application | |
configureIO () | |
doExecute () | |
getCommandName (InputInterface $input) | |
getDefaultCommands () | |
getDefaultInputDefinition () | |
getDefaultHelperSet () | |
initialise () | |
doRenderThrowable (\Throwable $throwable, OutputInterface $output) | |
runCommand (AbstractCommand $command, InputInterface $input, OutputInterface $output) | |
Fonctions membres protégées hérités de AbstractApplication | |
dispatchEvent (string $eventName, ?EventInterface $event=null) | |
doExecute () | |
initialise () | |
Attributs protégés | |
$input = null | |
$name = null | |
$language | |
Attributs protégés hérités de AbstractApplication | |
$config | |
Attributs privés | |
$messages = [] | |
$session | |
Membres hérités additionnels | |
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' |
The Joomla! CMS Console Application
__construct | ( | Registry | $config, |
DispatcherInterface | $dispatcher, | ||
Container | $container, | ||
Language | $language, | ||
?InputInterface | $input = null , |
||
?OutputInterface | $output = null |
||
) |
Class constructor.
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. |
DispatcherInterface | $dispatcher | An optional argument to provide dependency injection for the application's event dispatcher. If the argument is a DispatcherInterface object that object will become the application's event dispatcher, if it is null then the default event dispatcher will be created based on the application's loadDispatcher() method. |
Container | $container | Dependency injection container. |
Language | $language | The language object provisioned for the application. |
InputInterface | null | $input | An optional argument to provide dependency injection for the application's input object. If the argument is an InputInterface object that object will become the application's input object, otherwise a default input object is created. |
OutputInterface | null | $output | An optional argument to provide dependency injection for the application's output object. If the argument is an OutputInterface object that object will become the application's output object, otherwise a default output object is created. |
Références $input, $language, $output, Symfony\Contracts\Service\__construct(), language, name, Joomla\DI\setContainer(), et Joomla\Event\setDispatcher().
__get | ( | $name | ) |
Magic method to access properties of the application.
string | $name | The name of the property. |
Références $name, et Joomla\Application\getInput().
|
protected |
enqueueMessage | ( | $msg, | |
$type = self::MSG_INFO |
|||
) |
Enqueue a system message.
string | $msg | The message to enqueue. |
string | $type | The message type. |
Implémente CMSApplicationInterface.
Références $type.
execute | ( | ) |
Execute the application.
Address issues with instantiating WebApplication descendants under CLI.
IMPORTANT! This code must be always be executed before the first use of PluginHelper::importPlugin(). Some plugins will attempt to register an MVCFactory for a component in their service provider. This will in turn try to get the SiteRouter service for the component which tries to get an instance of SiteApplication which will fail with a RuntimeException if the populateHttpHost() method has not already executed.
Implémente ApplicationInterface.
Références PluginHelper\importPlugin().
flushAssets | ( | ) |
Flush the media version to refresh versionable assets
getConfig | ( | ) |
|
protected |
Get the commands which should be registered by default to the application.
Références Joomla\Database\getDatabase().
|
protected |
Builds the default input definition.
Références null, InputArgument\REQUIRED, InputOption\VALUE_NONE, et InputOption\VALUE_OPTIONAL.
getInput | ( | ) |
Method to get the application input object.
Implémente CMSApplicationInterface.
Références $input.
getLanguage | ( | ) |
Method to get the application language object.
Implémente CMSApplicationInterface.
Références $language.
getLongVersion | ( | ) |
getMessageQueue | ( | ) |
Get the system message queue.
Implémente CMSApplicationInterface.
Références $messages.
getName | ( | ) |
Gets the name of the current running application.
Implémente CMSApplicationInterface.
Références $name.
|
static |
Returns the application Router object.
string | $name | The name of the application. |
array | $options | An optional associative array of configuration settings. |
Références $name, $options, Factory\getApplication(), et Router\getInstance().
getSession | ( | ) |
Method to get the application session object.
isCli | ( | ) |
isClient | ( | $identifier | ) |
Check the client interface by name.
string | $identifier | String identifier for the application interface |
Implémente CMSApplicationInterface.
|
protected |
Populates the HTTP_HOST and REQUEST_URI from the URL provided in the –live-site parameter.
If the URL provided is empty or invalid we will use the URL https://joomla.invalid/set/by/console/application just so that the CLI application doesn't crash when a WebApplication descendant is instantiated in it.
This is a practical workaround for using any service depending on a WebApplication descendant under CLI.
Practical example: using a component's MVCFactory which instantiates the SiteRouter service for that component which in turn relies on an instance of SiteApplication.
Try to use the live site URL we were given. If all else fails, fall back to https://joomla.invalid/set/by/console/application.
Yes, this is icky but it is the only way to trick WebApplication into compliance.
Références $input, $uri, et Uri\getInstance().
setName | ( | string | $name | ) |
Set the name of the application.
string | $name | The new application name. |
setSession | ( | SessionInterface | $session | ) |
Sets the session for the application to use, if required.
SessionInterface | $session | A session object. |
Références $this.
|
protected |
|
protected |
|
private |
|
private |