PHP Класс FOF30\Platform\Base\Platform

Наследование: implements FOF30\Platform\PlatformInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$container The component container

Открытые методы

Метод Описание
__construct ( Container $c ) Public constructor.
authorise ( string $action, string $assetname ) : boolean Perform an ACL check.
authorizeAdmin ( string $component ) : boolean Authorise access to the component in the back-end.
clearCache ( ) : boolean Clears the cache of system-wide F0F 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 F0F. Please note that F0F's cache never expires and is not purged by Joomla!. You MUST use this method to manually purge the cache.
getCache ( string $key, string $default = null ) : string Retrieves data from the cache. This is supposed to be used for system-side F0F data, not application data.
getComponentBaseDirs ( string $component ) : array Returns the base (root) directories for a given component.
getDocument ( ) : JDocument Returns the JDocument object which handles this component's response.
getPlatformVersion ( ) : string 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.
getTemplate ( boolean | array $params = false ) : string Returns the application's template name
getTemplateOverridePath ( string $component, boolean $absolute = true ) : string 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 directories. If the application does not have such a thing as template overrides return an empty string.
getTemplateSuffixes ( ) : array Get application-specific suffixes to use with template paths. This allows you to look for view template overrides based on the application version.
getUser ( integer $id = null ) : JDocument Returns the JUser object for the current user
getUserStateFromRequest ( string $key, string $request, Input $input, mixed $default = null, string $type = 'none', boolean $setUserState = true ) : mixed This method will try retrieving a variable from the request (input) data.
importPlugin ( string $type ) : void Load plugins of a specific type. Obviously this seems to only be required in the Joomla! CMS.
isBackend ( ) : boolean Is this the administrative section of the component?
isCli ( ) : boolean Is this a component running in a CLI application?
isFrontend ( ) : boolean Is this the public section of the component?
isGlobalFOFCacheEnabled ( ) : boolean Is the global F0F cache enabled?
loadTranslations ( string $component ) : void Load the translation files for a given component.
logDeprecated ( string $message ) : void 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.
loginUser ( array $authInfo ) : boolean logs in a user
logoutUser ( ) : boolean logs out a user
runPlugins ( string $event, array $data ) : array Execute plugins (system-level triggers) and fetch back an array with their return values.
setCache ( string $key, string $content ) : boolean Saves something to the cache. This is supposed to be used for system-wide F0F data, not application data.
supportsAjaxOrdering ( ) : boolean Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other platforms should return false and never ask why.

Описание методов

__construct() публичный Метод

Public constructor.
public __construct ( Container $c )
$c FOF30\Container\Container The component container

authorise() публичный Метод

Perform an ACL check.
См. также: F0FPlatformInterface::authorise()
public authorise ( string $action, string $assetname ) : boolean
$action string The ACL privilege to check, e.g. core.edit
$assetname string The asset name to check, typically the component's name
Результат boolean True if the user is allowed this action

authorizeAdmin() публичный Метод

Authorise access to the component in the back-end.
См. также: F0FPlatformInterface::authorizeAdmin()
public authorizeAdmin ( string $component ) : boolean
$component string The name of the component.
Результат boolean True to allow loading the component, false to halt loading

clearCache() публичный Метод

Clears the cache of system-wide F0F 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 F0F. Please note that F0F's cache never expires and is not purged by Joomla!. You MUST use this method to manually purge the cache.
public clearCache ( ) : boolean
Результат boolean True on success

getCache() публичный Метод

Retrieves data from the cache. This is supposed to be used for system-side F0F data, not application data.
public getCache ( string $key, string $default = null ) : string
$key string The key of the data to retrieve
$default string The default value to return if the key is not found or the cache is not populated
Результат string The cached value

getComponentBaseDirs() публичный Метод

Returns the base (root) directories for a given component.
См. также: F0FPlatformInterface::getComponentBaseDirs()
public getComponentBaseDirs ( string $component ) : array
$component string The name of the component. For Joomla! this is something like "com_example"
Результат array A hash array with keys main, alt, site and admin.

getDocument() публичный Метод

Returns the JDocument object which handles this component's response.
См. также: F0FPlatformInterface::getDocument()
public getDocument ( ) : JDocument
Результат JDocument

getPlatformVersion() публичный Метод

a framework) it is advisable to return that version.
С версии: 2.1.2
public getPlatformVersion ( ) : string
Результат string

getTemplate() публичный Метод

Returns the application's template name
public getTemplate ( boolean | array $params = false ) : string
$params boolean | array An optional associative array of configuration settings
Результат string The template name. System is the fallback.

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 directories. If the application does not have such a thing as template overrides return an empty string.
public getTemplateOverridePath ( string $component, boolean $absolute = true ) : string
$component string The name of the component for which to fetch the overrides
$absolute boolean Should I return an absolute or relative path?
Результат string The path to the template overrides directory

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 getTemplateSuffixes ( ) : array
Результат array A plain array of suffixes to try in template names

getUser() публичный Метод

Returns the JUser object for the current user
См. также: F0FPlatformInterface::getUser()
public getUser ( integer $id = null ) : JDocument
$id integer The ID of the user to fetch
Результат JDocument

getUserStateFromRequest() публичный Метод

This method will try retrieving a variable from the request (input) data.
См. также: F0FPlatformInterface::getUserStateFromRequest()
public getUserStateFromRequest ( string $key, string $request, Input $input, mixed $default = null, string $type = 'none', boolean $setUserState = true ) : mixed
$key string The user state key for the variable
$request string The request variable name for the variable
$input FOF30\Input\Input The Input object with the request (input) data
$default mixed The default value. Default: null
$type string The filter type for the variable data. Default: none (no filtering)
$setUserState boolean Should I set the user state with the fetched value?
Результат mixed The value of the variable

importPlugin() публичный Метод

Load plugins of a specific type. Obviously this seems to only be required in the Joomla! CMS.
См. также: F0FPlatformInterface::importPlugin()
public importPlugin ( string $type ) : void
$type string The type of the plugins to be loaded
Результат void

isBackend() публичный Метод

Is this the administrative section of the component?
См. также: F0FPlatformInterface::isBackend()
public isBackend ( ) : boolean
Результат boolean

isCli() публичный Метод

Is this a component running in a CLI application?
См. также: F0FPlatformInterface::isCli()
public isCli ( ) : boolean
Результат boolean

isFrontend() публичный Метод

Is this the public section of the component?
См. также: F0FPlatformInterface::isFrontend()
public isFrontend ( ) : boolean
Результат boolean

isGlobalFOFCacheEnabled() публичный Метод

Is the global F0F cache enabled?
public isGlobalFOFCacheEnabled ( ) : boolean
Результат boolean

loadTranslations() публичный Метод

Load the translation files for a given component.
См. также: F0FPlatformInterface::loadTranslations()
public loadTranslations ( string $component ) : void
$component string The name of the component. For Joomla! this is something like "com_example"
Результат void

logDeprecated() публичный Метод

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 logDeprecated ( string $message ) : void
$message string The deprecated practice log message
Результат void

loginUser() публичный Метод

logs in a user
public loginUser ( array $authInfo ) : boolean
$authInfo array authentification information
Результат boolean True on success

logoutUser() публичный Метод

logs out a user
public logoutUser ( ) : boolean
Результат boolean True on success

runPlugins() публичный Метод

Execute plugins (system-level triggers) and fetch back an array with their return values.
См. также: F0FPlatformInterface::runPlugins()
public runPlugins ( string $event, array $data ) : array
$event string The event (trigger) name, e.g. onBeforeScratchMyEar
$data array A hash array of data sent to the plugins as part of the trigger
Результат array A simple array containing the results of the plugins triggered

setCache() публичный Метод

Saves something to the cache. This is supposed to be used for system-wide F0F data, not application data.
public setCache ( string $key, string $content ) : boolean
$key string The key of the data to save
$content string The actual data to save
Результат boolean True on success

supportsAjaxOrdering() публичный Метод

Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other platforms should return false and never ask why.
См. также: F0FPlatformInterface::supportsAjaxOrdering()
public supportsAjaxOrdering ( ) : boolean
Результат boolean

Описание свойств

$container защищенное свойство

The component container
protected $container