Class FOFPlatform
Part of the FOF Platform Abstraction Layer. It implements everything that depends on the platform FOF is running under, e.g. the Joomla! CMS front-end, the Joomla! CMS back-end, a CLI Joomla! Platform app, a bespoke Joomla! Platform / Framework web application and so on.
This is the abstract class implementing some basic housekeeping functionality and provides the static interface to get the appropriate Platform object for use in the rest of the framework.
- FOFPlatform implements FOFPlatformInterface
Direct known subclasses
Package: FrameworkOnFramework\platform
Copyright: Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
License: General Public License version 2 or later; see LICENSE.txt
Since: 2.1
Located at fof/platform/platform.php
Methods summary
public static
|
#
registerPlatformPath( string $path )
Register a path where platform files will be looked for. These take precedence over the built-in platform files. |
public static
|
|
public static
|
#
forceInstance(
Force a specific platform object to be used. If null, nukes the cache |
public static
|
|
public
integer
|
|
public
boolean
|
|
public
object
|
|
public
object
|
|
public
|
#
setErrorHandling( integer $level, string $log_level, array $options = array() )
Set the error Handling, if possible |
public
array
|
#
getComponentBaseDirs( string $component )
Returns the base (root) directories for a given component. |
public
array
|
#
getViewTemplatePaths( string $component, string $view, string $layout = 'default', string $tpl = null, boolean $strict = false )
Return a list of the view template directories for this component. |
public
array
|
#
getTemplateSuffixes( )
Get application-specific suffixes to use with template paths. This allows you to look for view template overrides based on the application version. |
public
string
|
#
getTemplateOverridePath( string $component, boolean $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. |
public
|
|
public
boolean
|
|
public
|
|
public
|
|
public
mixed
|
#
getUserStateFromRequest( string $key, string $request,
This method will try retrieving a variable from the request (input) data. |
public
|
#
importPlugin( string $type )
Load plugins of a specific type. Obviously this seems to only be required in the Joomla! CMS. |
public
array
|
#
runPlugins( string $event, array $data )
Execute plugins (system-level triggers) and fetch back an array with their return values. |
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
#
supportsAjaxOrdering( )
Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other platforms should return false and never ask why. |
public
boolean
|
#
checkVersion( string $version1, string $version2, string $operator )
Performs a check between two versions. Use this function instead of PHP version_compare so we can mock it while testing |
public
boolean
|
|
public
string
|
|
public
boolean
|
|
public
boolean
|
#
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. |
public
boolean
|
|
public
boolean
|
|
public
|
#
logDeprecated( mixed $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. |
public
string
|
#
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). |
public
string
|
#
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. |
public
string
|
#
getPlatformHumanName( )
Returns the human readable platform name, e.g. "Joomla!", "Joomla! Framework", "Something Something Something Framework" etc. |
Methods inherited from FOFPlatformInterface
URIbase()
,
URIroot()
,
checkExecution()
,
getConfig()
,
getDate()
,
getDbo()
,
getLanguage()
,
getPlatformBaseDirs()
,
logAddLogger()
,
logDebug()
,
raiseError()
,
sendHeaders()
,
setHeader()
Magic methods summary
Properties summary
public
integer
|
$ordering |
#
The ordering for this platform class. The lower this number is, the more important this class becomes. Most important enabled class ends up being used. |
public
string
|
$name |
#
The internal name of this platform implementation. It must match the last part of the platform class name and be in all lowercase letters, e.g. "foobar" for FOFPlatformFoobar |
public
string
|
$humanReadableName |
#
The human readable platform name |
public
string
|
$version |
#
The platform version string |
protected
boolean
|
$isEnabled |
#
Caches the enabled status of this platform class. |
protected
object
|
$objectCache |
#
Filesystem integration objects cache |
protected static
array
|
$paths |
#
The list of paths where platform class files will be looked for |
protected static
|
$instance |
#
The platform class instance which will be returned by getInstance |