Force a specific platform object to be used. If null, nukes the cache
Find and return the most relevant platform object
Register a path where platform files will be looked for. These take precedence over the built-in platform files.
static void
registerPlatformPath
(string $path)
-
string
$path: The path to add
Unregister a path where platform files will be looked for.
static void
unregisterPlatformPath
(string $path)
-
string
$path: The path to remove
Perform an ACL check.
boolean
authorise
(string $action, string $assetname)
-
string
$action: The ACL privilege to check, e.g. core.edit
-
string
$assetname: The asset name to check, typically the component's name
Implementation of:
- FOFPlatformInterface::authorise()
- 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.
Redefined in descendants as:
Authorise access to the component in the back-end.
boolean
authorizeAdmin
(string $component)
-
string
$component: The name of the component.
Implementation of:
- FOFPlatformInterface::authorizeAdmin()
- By default FOF will only use the Controller's onBefore* methods to
Redefined in descendants as:
Performs a check between two versions. Use this function instead of PHP version_compare so we can mock it while testing
boolean
checkVersion
(string $version1, string $version2, string $operator)
-
string
$version1: First version number
-
string
$version2: Second version number
-
string
$operator: Operator (see version_compare for valid operators)
Implementation of:
- FOFPlatformInterface::checkVersion()
- Performs a check between two versions. Use this function instead of PHP version_compare so we can mock it while testing
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.
boolean
clearCache
()
Implementation of:
- FOFPlatformInterface::clearCache()
- Clears the cache of system-wide FOF data. You are supposed to call this in
Redefined in descendants as:
Retrieves data from the cache. This is supposed to be used for system-side FOF data, not application data.
string
getCache
(string $key, [string $default = null])
-
string
$key: The key of the data to retrieve
-
string
$default: The default value to return if the key is not found or the cache is not populated
Implementation of:
- FOFPlatformInterface::getCache()
- Retrieves data from the cache. This is supposed to be used for system-side FOF data, not application data.
Redefined in descendants as:
Returns the base (root) directories for a given component.
array
getComponentBaseDirs
(string $component)
-
string
$component: The name of the component. For Joomla! this is something like "com_example"
Implementation of:
- FOFPlatformInterface::getComponentBaseDirs()
- 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).
Redefined in descendants as:
Returns the JDocument object which handles this component's response.
Implementation of:
- FOFPlatformInterface::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.
Redefined in descendants as:
Returns the ordering of the platform class.
integer
getOrdering
()
Implementation of:
- FOFPlatformInterface::getOrdering()
- Returns the ordering of the platform class. Files with a lower ordering number will be loaded first.
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.
string
getTemplateOverridePath
(string $component, [boolean $absolute = true])
-
string
$component: The name of the component for which to fetch the overrides
-
boolean
$absolute: Should I return an absolute or relative path?
Implementation of:
- FOFPlatformInterface::getTemplateOverridePath()
- 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.
Redefined in descendants as:
-
FOFPlatformJoomla::getTemplateOverridePath()
: 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.
Get application-specific suffixes to use with template paths. This allows you to look for view template overrides based on the application version.
array
getTemplateSuffixes
()
Implementation of:
- FOFPlatformInterface::getTemplateSuffixes()
- Get application-specific suffixes to use with template paths. This allows you to look for view template overrides based on the application version.
Redefined in descendants as:
Returns the JUser object for the current user
-
integer
$id: The ID of the user to fetch
Implementation of:
- FOFPlatformInterface::getUser()
- Returns a user object.
Redefined in descendants as:
This method will try retrieving a variable from the request (input) data.
mixed
getUserStateFromRequest
(
string $key,
string $request,
FOFInput $input, [
mixed $default =
null], [
string $type =
'none'], [
boolean $setUserState =
true])
-
string
$key: The user state key for the variable
-
string
$request: The request variable name for the variable
-
FOFInput
$input: The FOFInput object with the request (input) data
-
mixed
$default: The default value. Default: null
-
string
$type: The filter type for the variable data. Default: none (no filtering)
-
boolean
$setUserState: Should I set the user state with the fetched value?
Implementation of:
- FOFPlatformInterface::getUserStateFromRequest()
- This method will try retrieving a variable from the request (input) data.
Redefined in descendants as:
Return a list of the view template directories for this component.
array
getViewTemplatePaths
(string $component, string $view, [string $layout = 'default'], [string $tpl = null], [boolean $strict = false])
-
string
$component: The name of the component. For Joomla! this is something like "com_example"
-
string
$view: The name of the view you're looking a template for
-
string
$layout: The layout name to load, e.g. 'default'
-
string
$tpl: The sub-template name to load (null by default)
-
boolean
$strict: If 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.
Implementation of:
- FOFPlatformInterface::getViewTemplatePaths()
- 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
Redefined in descendants as:
Load plugins of a specific type. Obviously this seems to only be required in the Joomla! CMS.
void
importPlugin
(string $type)
-
string
$type: The type of the plugins to be loaded
Implementation of:
- FOFPlatformInterface::importPlugin()
- Load plugins of a specific type. Obviously this seems to only be required in the Joomla! CMS.
Redefined in descendants as:
Is this the administrative section of the component?
boolean
isBackend
()
Implementation of:
- FOFPlatformInterface::isBackend()
- Is this the administrative section of the component?
Redefined in descendants as:
Is this a component running in a CLI application?
boolean
isCli
()
Implementation of:
- FOFPlatformInterface::isCli()
- Is this a component running in a CLI application?
Redefined in descendants as:
Is this platform enabled?
boolean
isEnabled
()
Implementation of:
- FOFPlatformInterface::isEnabled()
- Is this platform enabled? This is used for automatic platform detection.
Redefined in descendants as:
Is this the public section of the component?
boolean
isFrontend
()
Implementation of:
- FOFPlatformInterface::isFrontend()
- Is this the public section of the component?
Redefined in descendants as:
Load the translation files for a given component.
void
loadTranslations
(string $component)
-
string
$component: The name of the component. For Joomla! this is something like "com_example"
Implementation of:
- FOFPlatformInterface::loadTranslations()
- 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).
Redefined in descendants as:
logs in a user
boolean
loginUser
(array $authInfo)
-
array
$authInfo: authentification information
Implementation of:
- FOFPlatformInterface::loginUser()
- logs in a user
Redefined in descendants as:
Execute plugins (system-level triggers) and fetch back an array with their return values.
array
runPlugins
(string $event, array $data)
-
string
$event: The event (trigger) name, e.g. onBeforeScratchMyEar
-
array
$data: A hash array of data sent to the plugins as part of the trigger
Implementation of:
- FOFPlatformInterface::runPlugins()
- Execute plugins (system-level triggers) and fetch back an array with their return values.
Redefined in descendants as:
Saves something to the cache. This is supposed to be used for system-wide FOF data, not application data.
boolean
setCache
(string $key, string $content)
-
string
$key: The key of the data to save
-
string
$content: The actual data to save
Implementation of:
- FOFPlatformInterface::setCache()
- Saves something to the cache. This is supposed to be used for system-wide FOF data, not application data.
Redefined in descendants as:
Set the error Handling, if possible
void
setErrorHandling
(integer $level, string $log_level, [array $options = array()])
-
integer
$level: PHP error level (E_ALL)
-
string
$log_level: What to do with the error (ignore, callback)
-
array
$options: Options for the error handler
Implementation of:
- FOFPlatformInterface::setErrorHandling()
- Set the error Handling, if possible
Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other platforms should return false and never ask why.
boolean
supportsAjaxOrdering
()
Implementation of:
- FOFPlatformInterface::supportsAjaxOrdering()
- Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other platforms should return false and never ask why.
Redefined in descendants as: