PHP 인터페이스 FOF30\Platform\PlatformInterface

파일 보기 프로젝트 열기: akeeba/fof

공개 메소드들

메소드 설명
URIbase ( boolean $pathonly = false ) : string Returns the base URI for the request.
URIroot ( boolean $pathonly = false, string $path = null ) : string Returns the root URI for the request.
__construct ( Container $c ) Public constructor.
authorise ( string $action, string $assetname ) : boolean 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.
authorizeAdmin ( string $component ) : boolean 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.
checkExecution ( ) : boolean Checks if the current script is run inside a valid CMS execution
clearCache ( ) : boolean 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 F0F. Please note that FOF's cache never expires and is not purged by Joomla!. You MUST use this method to manually purge the cache.
closeApplication ( integer $code ) : void Immediately terminate the containing application's execution
getCache ( string $key, string $default = null ) : string Retrieves data from the cache. This is supposed to be used for system-side FOF data, not application data.
getComponentBaseDirs ( string $component ) : array Returns the base (root) directories for a given component, i.e the application which is running inside our main application (CMS, web app).
getConfig ( ) : JRegistry Returns an object that holds the configuration of the current site.
getDate ( mixed $time = 'now', null $tzOffest = null, boolean $locale = true ) : JDate Returns an object to handle dates
getDbo ( ) : JDatabaseDriver Returns the database driver object of the CMS/application
getDocument ( ) : JDocument 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.
getLanguage ( ) : JLanguage Return the \JLanguage instance of the CMS/application
getPlatformBaseDirs ( ) : array Returns absolute path to directories used by the containing CMS/application.
getPlatformVersion ( ) : string Returns the version number string of the CMS/application we're running in
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 ) : JUser Returns a user object.
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 itself.
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 FOF cache enabled?
loadTranslations ( string $component ) : void Load the translation files for a given component.
logAddLogger ( string $file ) : void Add a log file for FOF
logDebug ( string $message ) : void Adds a message to the application's debug log
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
raiseError ( integer $code, string $message ) : mixed Raises an error, using the logic requested by the CMS (PHP Exception or dedicated class)
runPlugins ( string $event, array $data ) : array Execute plugins (system-level triggers) and fetch back an array with their return values.
sendHeaders ( ) : void In platforms that perform header caching, send all headers.
setCache ( string $key, string $content ) : boolean Saves something to the cache. This is supposed to be used for system-wide FOF data, not application data.
setHeader ( string $name, string $value, boolean $replace = false ) : void 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)
supportsAjaxOrdering ( ) : boolean Is AJAX re-ordering supported? This is 100% Joomla! CMS (version 3+) specific.

메소드 상세

URIbase() 공개 메소드

Returns the base URI for the request.
public URIbase ( boolean $pathonly = false ) : string
$pathonly boolean If false, prepend the scheme, host and port information. Default is false. |
리턴 string The base URI string

URIroot() 공개 메소드

Returns the root URI for the request.
public URIroot ( boolean $pathonly = false, string $path = null ) : string
$pathonly boolean If false, prepend the scheme, host and port information. Default is false.
$path string The path
리턴 string The root URI string.

__construct() 공개 메소드

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

authorise() 공개 메소드

If your platform uses different conventions you'll have to override the F0F defaults using fof.xml or by specialising the controller.
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() 공개 메소드

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.
public authorizeAdmin ( string $component ) : boolean
$component string The name of the component.
리턴 boolean True to allow loading the component, false to halt loading

checkExecution() 공개 메소드

Checks if the current script is run inside a valid CMS execution
public checkExecution ( ) : boolean
리턴 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 F0F. 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 clearCache ( ) : boolean
리턴 boolean True on success

closeApplication() 공개 메소드

Immediately terminate the containing application's execution
public closeApplication ( integer $code ) : void
$code integer The result code which should be returned by the application
리턴 void

getCache() 공개 메소드

Retrieves data from the cache. This is supposed to be used for system-side FOF 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() 공개 메소드

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.
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.

getConfig() 공개 메소드

Returns an object that holds the configuration of the current site.
public getConfig ( ) : JRegistry
리턴 JRegistry

getDate() 공개 메소드

Returns an object to handle dates
public getDate ( mixed $time = 'now', null $tzOffest = null, boolean $locale = true ) : JDate
$time mixed The initial time
$tzOffest null The timezone offset
$locale boolean Should I try to load a specific class for current language?
리턴 JDate object

getDbo() 공개 메소드

Returns the database driver object of the CMS/application
public getDbo ( ) : JDatabaseDriver
리턴 JDatabaseDriver

getDocument() 공개 메소드

FOF will not attempt to load CSS and Javascript files (as it doesn't make sense if there's no \JDocument to handle them).
public getDocument ( ) : JDocument
리턴 JDocument

getLanguage() 공개 메소드

Return the \JLanguage instance of the CMS/application
public getLanguage ( ) : JLanguage
리턴 JLanguage

getPlatformBaseDirs() 공개 메소드

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
public getPlatformBaseDirs ( ) : array
리턴 array A hash array with keys root, public, admin, tmp and log.

getPlatformVersion() 공개 메소드

Returns the version number string of the CMS/application we're running in
부터: 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 a user object.
public getUser ( integer $id = null ) : JUser
$id integer The user ID to load. Skip or use null to retrieve the object for the currently logged in user.
리턴 JUser The \JUser object for the specified user

getUserStateFromRequest() 공개 메소드

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.
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 itself.
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?
public isBackend ( ) : boolean
리턴 boolean

isCli() 공개 메소드

Is this a component running in a CLI application?
public isCli ( ) : boolean
리턴 boolean

isFrontend() 공개 메소드

Is this the public section of the component?
public isFrontend ( ) : boolean
리턴 boolean

isGlobalFOFCacheEnabled() 공개 메소드

Is the global FOF cache enabled?

loadTranslations() 공개 메소드

Load the translation files for a given component.
public loadTranslations ( string $component ) : void
$component string The name of the component. For Joomla! this is something like "com_example"
리턴 void

logAddLogger() 공개 메소드

Add a log file for FOF
public logAddLogger ( string $file ) : void
$file string
리턴 void

logDebug() 공개 메소드

Adds a message to the application's debug log
public logDebug ( string $message ) : void
$message string
리턴 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

raiseError() 공개 메소드

Raises an error, using the logic requested by the CMS (PHP Exception or dedicated class)
public raiseError ( integer $code, string $message ) : mixed
$code integer
$message string
리턴 mixed

runPlugins() 공개 메소드

Execute plugins (system-level triggers) and fetch back an array with their return values.
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

sendHeaders() 공개 메소드

In platforms that perform header caching, send all headers.
public sendHeaders ( ) : void
리턴 void

setCache() 공개 메소드

Saves something to the cache. This is supposed to be used for system-wide FOF 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

setHeader() 공개 메소드

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)
public setHeader ( string $name, string $value, boolean $replace = false ) : void
$name string The name of the header to set.
$value string The value of the header to set.
$replace boolean True to replace any headers with the same name.
리턴 void

supportsAjaxOrdering() 공개 메소드

Is AJAX re-ordering supported? This is 100% Joomla! CMS (version 3+) specific.
public supportsAjaxOrdering ( ) : boolean
리턴 boolean