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 l'interface FOFPlatformInterface
+ Graphe d'héritage de FOFPlatformInterface:

Fonctions membres publiques

 checkExecution ()
 
 setErrorHandling ($level, $log_level, $options=array())
 
 raiseError ($code, $message)
 
 getOrdering ()
 
 getIntegrationObject ($key)
 
 setIntegrationObject ($key, $object)
 
 isEnabled ()
 
 getPlatformName ()
 
 getPlatformVersion ()
 
 getPlatformHumanName ()
 
 getPlatformBaseDirs ()
 
 getComponentBaseDirs ($component)
 
 getViewTemplatePaths ($component, $view, $layout='default', $tpl=null, $strict=false)
 
 getTemplateSuffixes ()
 
 getTemplateOverridePath ($component, $absolute=true)
 
 loadTranslations ($component)
 
 authorizeAdmin ($component)
 
 getUserStateFromRequest ($key, $request, $input, $default=null, $type='none', $setUserState=true)
 
 importPlugin ($type)
 
 runPlugins ($event, $data)
 
 authorise ($action, $assetname)
 
 getUser ($id=null)
 
 getDocument ()
 
 getDate ($time='now', $tzOffest=null, $locale=true)
 
 getLanguage ()
 
 getDbo ()
 
 isBackend ()
 
 isFrontend ()
 
 isCli ()
 
 supportsAjaxOrdering ()
 
 checkVersion ($version1, $version2, $operator)
 
 setCache ($key, $content)
 
 getCache ($key, $default=null)
 
 clearCache ()
 
 getConfig ()
 
 isGlobalFOFCacheEnabled ()
 
 loginUser ($authInfo)
 
 logoutUser ()
 
 logAddLogger ($file)
 
 logDeprecated ($message)
 
 logDebug ($message)
 
 URIroot ($pathonly=false, $path=null)
 
 URIbase ($pathonly=false)
 
 setHeader ($name, $value, $replace=false)
 
 sendHeaders ()
 

Documentation des fonctions membres

◆ authorise()

authorise (   $action,
  $assetname 
)

Perform an ACL check. Please note that FOF uses by default the Joomla! CMS convention for ACL privileges, e.g core.edit for the edit privilege. If your platform uses different conventions you'll have to override the FOF defaults using fof.xml or by specialising the controller.

Paramètres
string$actionThe ACL privilege to check, e.g. core.edit
string$assetnameThe asset name to check, typically the component's name
Renvoie
boolean True if the user is allowed this action

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ authorizeAdmin()

authorizeAdmin (   $component)

By default FOF will only use the Controller's onBefore* methods to perform user authorisation. In some cases, like the Joomla! back-end, you also need to perform component-wide user authorisation in the Dispatcher. This method MUST implement this authorisation check. If you do not need this in your platform, please always return true.

Paramètres
string$componentThe name of the component.
Renvoie
boolean True to allow loading the component, false to halt loading

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ checkExecution()

checkExecution ( )

Checks if the current script is run inside a valid CMS execution

Renvoie
bool

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ checkVersion()

checkVersion (   $version1,
  $version2,
  $operator 
)

Performs a check between two versions. Use this function instead of PHP version_compare so we can mock it while testing

Paramètres
string$version1First version number
string$version2Second version number
string$operatorOperator (see version_compare for valid operators)
Obsolète:
Use PHP's version_compare against JVERSION in your code. This method is scheduled for removal in FOF 3.0
@return  boolean

Implémenté dans FOFPlatform.

◆ clearCache()

clearCache ( )

Clears the cache of system-wide FOF data. You are supposed to call this in your components' installation script post-installation and post-upgrade methods or whenever you are modifying the structure of database tables accessed by FOF. Please note that FOF's cache never expires and is not purged by Joomla!. You MUST use this method to manually purge the cache.

Renvoie
boolean True on success

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ getCache()

getCache (   $key,
  $default = null 
)

Retrieves data from the cache. This is supposed to be used for system-side FOF data, not application data.

Paramètres
string$keyThe key of the data to retrieve
string$defaultThe default value to return if the key is not found or the cache is not populated
Renvoie
string The cached value

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ getComponentBaseDirs()

getComponentBaseDirs (   $component)

Returns the base (root) directories for a given component. The "component" is used in the sense of what we call "component" in Joomla!, "plugin" in WordPress and "module" in Drupal, i.e. an application which is running inside our main application (CMS).

The return is a table with the following keys:

  • main The normal location of component files. For a back-end Joomla! component this is the administrator/components/com_example directory.
  • alt The alternate location of component files. For a back-end Joomla! component this is the front-end directory, e.g. components/com_example
  • site The location of the component files serving the public part of the application.
  • admin The location of the component files serving the administrative part of the application.

All paths MUST be absolute. All four paths MAY be the same if the platform doesn't make a distinction between public and private parts, or when the component does not provide both a public and private part. All of the directories MUST be defined and non-empty.

Paramètres
string$componentThe name of the component. For Joomla! this is something like "com_example"
Renvoie
array A hash array with keys main, alt, site and admin.

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ getConfig()

getConfig ( )

Returns an object that holds the configuration of the current site.

Renvoie
mixed

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ getDate()

getDate (   $time = 'now',
  $tzOffest = null,
  $locale = true 
)

Returns an object to handle dates

Paramètres
mixed$timeThe initial time
null$tzOffestThe timezone offset
bool$localeShould I try to load a specific class for current language?
Renvoie
JDate object

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ getDbo()

getDbo ( )

◆ getDocument()

getDocument ( )

Returns the JDocument object which handles this component's response. You may also return null and FOF will a. try to figure out the output type by examining the "format" input parameter (or fall back to "html") and b. FOF will not attempt to load CSS and Javascript files (as it doesn't make sense if there's no JDocument to handle them).

Renvoie
JDocument

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ getIntegrationObject()

getIntegrationObject (   $key)

Returns a platform integration object

Paramètres
string$keyThe key name of the platform integration object, e.g. 'filesystem'
Renvoie
object
Depuis
2.1.2

Implémenté dans FOFPlatform.

◆ getLanguage()

getLanguage ( )

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ getOrdering()

getOrdering ( )

Returns the ordering of the platform class. Files with a lower ordering number will be loaded first.

Renvoie
integer

Implémenté dans FOFPlatform.

◆ getPlatformBaseDirs()

getPlatformBaseDirs ( )

Returns absolute path to directories used by the CMS.

The return is a table with the following key:

  • root Path to the site root
  • public Path to the public area of the site
  • admin Path to the administrative area of the site
  • tmp Path to the temp directory
  • log Path to the log directory
Renvoie
array A hash array with keys root, public, admin, tmp and log.

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ getPlatformHumanName()

getPlatformHumanName ( )

Returns the human readable platform name, e.g. "Joomla!", "Joomla! Framework", "Something Something Something Framework" etc.

Renvoie
string
Depuis
2.1.2

Implémenté dans FOFPlatform.

◆ getPlatformName()

getPlatformName ( )

Returns the (internal) name of the platform implementation, e.g. "joomla", "foobar123" etc. This MUST be the last part of the platform class name. For example, if you have a plaform implementation class FOFPlatformFoobar you MUST return "foobar" (all lowercase).

Renvoie
string
Depuis
2.1.2

Implémenté dans FOFPlatform.

◆ getPlatformVersion()

getPlatformVersion ( )

Returns the version number string of the platform, e.g. "4.5.6". If implementation integrates with a CMS or a versioned foundation (e.g. a framework) it is advisable to return that version.

Renvoie
string
Depuis
2.1.2

Implémenté dans FOFPlatform.

◆ getTemplateOverridePath()

getTemplateOverridePath (   $component,
  $absolute = true 
)

Return the absolute path to the application's template overrides directory for a specific component. We will use it to look for template files instead of the regular component directorues. If the application does not have such a thing as template overrides return an empty string.

Paramètres
string$componentThe name of the component for which to fetch the overrides
boolean$absoluteShould I return an absolute or relative path?
Renvoie
string The path to the template overrides directory

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ getTemplateSuffixes()

getTemplateSuffixes ( )

Get application-specific suffixes to use with template paths. This allows you to look for view template overrides based on the application version.

Renvoie
array A plain array of suffixes to try in template names

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ getUser()

getUser (   $id = null)

Returns a user object.

Paramètres
integer$idThe user ID to load. Skip or use null to retrieve the object for the currently logged in user.
Renvoie
JUser The JUser object for the specified user

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ getUserStateFromRequest()

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

This method will try retrieving a variable from the request (input) data. If it doesn't exist it will be loaded from the user state, typically stored in the session. If it doesn't exist there either, the $default value will be used. If $setUserState is set to true, the retrieved variable will be stored in the user session.

Paramètres
string$keyThe user state key for the variable
string$requestThe request variable name for the variable
FOFInput$inputThe FOFInput object with the request (input) data
mixed$defaultThe default value. Default: null
string$typeThe filter type for the variable data. Default: none (no filtering)
boolean$setUserStateShould I set the user state with the fetched value?
Renvoie
mixed The value of the variable

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ getViewTemplatePaths()

getViewTemplatePaths (   $component,
  $view,
  $layout = 'default',
  $tpl = null,
  $strict = false 
)

Return a list of the view template paths for this component. The paths are in the format site:/component_name/view_name/layout_name or admin:/component_name/view_name/layout_name

The list of paths returned is a prioritised list. If a file is found in the first path the other paths will not be scanned.

Paramètres
string$componentThe name of the component. For Joomla! this is something like "com_example"
string$viewThe name of the view you're looking a template for
string$layoutThe layout name to load, e.g. 'default'
string$tplThe sub-template name to load (null by default)
boolean$strictIf true, only the specified layout will be searched for. Otherwise we'll fall back to the 'default' layout if the specified layout is not found.
Renvoie
array

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ importPlugin()

importPlugin (   $type)

Load plugins of a specific type. Obviously this seems to only be required in the Joomla! CMS.

Paramètres
string$typeThe type of the plugins to be loaded
Renvoie
void

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ isBackend()

isBackend ( )

Is this the administrative section of the component?

Renvoie
boolean

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ isCli()

isCli ( )

Is this a component running in a CLI application?

Renvoie
boolean

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ isEnabled()

isEnabled ( )

Is this platform enabled? This is used for automatic platform detection. If the environment we're currently running in doesn't seem to be your platform return false. If many classes return true, the one with the lowest order will be picked by FOFPlatform.

Renvoie
boolean

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ isFrontend()

isFrontend ( )

Is this the public section of the component?

Renvoie
boolean

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ isGlobalFOFCacheEnabled()

isGlobalFOFCacheEnabled ( )

Is the global FOF cache enabled?

Renvoie
boolean

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ loadTranslations()

loadTranslations (   $component)

Load the translation files for a given component. The "component" is used in the sense of what we call "component" in Joomla!, "plugin" in WordPress and "module" in Drupal, i.e. an application which is running inside our main application (CMS).

Paramètres
string$componentThe name of the component. For Joomla! this is something like "com_example"
Renvoie
void

Implémenté dans FOFPlatform, et FOFIntegrationJoomlaPlatform.

◆ logAddLogger()

logAddLogger (   $file)

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ logDebug()

logDebug (   $message)

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ logDeprecated()

logDeprecated (   $message)

Logs a deprecated practice. In Joomla! this results in the $message being output in the deprecated log file, found in your site's log directory.

Paramètres
string$messageThe deprecated practice log message
Renvoie
void

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ loginUser()

loginUser (   $authInfo)

logs in a user

Paramètres
array$authInfoauthentication information
Renvoie
boolean True on success

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ logoutUser()

logoutUser ( )

logs out a user

Renvoie
boolean True on success

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ raiseError()

raiseError (   $code,
  $message 
)

Raises an error, using the logic requested by the CMS (PHP Exception or dedicated class)

Paramètres
integer$code
string$message
Renvoie
mixed

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ runPlugins()

runPlugins (   $event,
  $data 
)

Execute plugins (system-level triggers) and fetch back an array with their return values.

Paramètres
string$eventThe event (trigger) name, e.g. onBeforeScratchMyEar
array$dataA hash array of data sent to the plugins as part of the trigger
Renvoie
array A simple array containing the results of the plugins triggered

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ sendHeaders()

sendHeaders ( )

In platforms that perform header caching, send all headers.

Renvoie
void

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ setCache()

setCache (   $key,
  $content 
)

Saves something to the cache. This is supposed to be used for system-wide FOF data, not application data.

Paramètres
string$keyThe key of the data to save
string$contentThe actual data to save
Renvoie
boolean True on success

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ setErrorHandling()

setErrorHandling (   $level,
  $log_level,
  $options = array() 
)

Set the error Handling, if possible

Paramètres
integer$levelPHP error level (E_ALL)
string$log_levelWhat to do with the error (ignore, callback)
array$optionsOptions for the error handler
Renvoie
void

Implémenté dans FOFPlatform.

◆ setHeader()

setHeader (   $name,
  $value,
  $replace = false 
)

Method to set a response header. If the replace flag is set then all headers with the given name will be replaced by the new one (only if the current platform supports header caching)

Paramètres
string$nameThe name of the header to set.
string$valueThe value of the header to set.
boolean$replaceTrue to replace any headers with the same name.
Renvoie
void

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ setIntegrationObject()

setIntegrationObject (   $key,
  $object 
)

Forces a platform integration object instance

Paramètres
string$keyThe key name of the platform integration object, e.g. 'filesystem'
object$objectThe object to force for this key
Renvoie
object
Depuis
2.1.2

Implémenté dans FOFPlatform.

◆ supportsAjaxOrdering()

supportsAjaxOrdering ( )

Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other platforms should return false and never ask why.

Renvoie
boolean

Implémenté dans FOFIntegrationJoomlaPlatform, et FOFPlatform.

◆ URIbase()

URIbase (   $pathonly = false)

Returns the base URI for the request.

Paramètres
boolean$pathonlyIf false, prepend the scheme, host and port information. Default is false. |
Renvoie
string The base URI string

Implémenté dans FOFIntegrationJoomlaPlatform.

◆ URIroot()

URIroot (   $pathonly = false,
  $path = null 
)

Returns the root URI for the request.

Paramètres
boolean$pathonlyIf false, prepend the scheme, host and port information. Default is false.
string$pathThe path
Renvoie
string The root URI string.

Implémenté dans FOFIntegrationJoomlaPlatform.


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