public
boolean
|
#
checkExecution( )
Checks if the current script is run inside a valid CMS execution
Checks if the current script is run inside a valid CMS execution
Returns
boolean
|
public
|
#
setErrorHandling( integer $level, string $log_level, array $options = array() )
Set the error Handling, if possible
Set the error Handling, if possible
Parameters
- $level
integer - $level PHP error level (E_ALL)
- $log_level
string - $log_level What to do with the error (ignore, callback)
- $options
array - $options Options for the error handler
|
public
mixed
|
#
raiseError( integer $code, string $message )
Raises an error, using the logic requested by the CMS (PHP Exception or
dedicated class)
Raises an error, using the logic requested by the CMS (PHP Exception or
dedicated class)
Parameters
- $code
integer - $code
- $message
string - $message
Returns
mixed
|
public
integer
|
#
getOrdering( )
Returns the ordering of the platform class. Files with a lower ordering
number will be loaded first.
Returns the ordering of the platform class. Files with a lower ordering
number will be loaded first.
Returns
integer
|
public
object
|
#
getIntegrationObject( string $key )
Returns a platform integration object
Returns a platform integration object
Parameters
- $key
string - $key The key name of the platform integration object, e.g. 'filesystem'
Returns
object
Since
2.1.2
|
public
object
|
#
setIntegrationObject( string $key, object $object )
Forces a platform integration object instance
Forces a platform integration object instance
Parameters
- $key
string - $key The key name of the platform integration object, e.g. 'filesystem'
- $object
object - $object The object to force for this key
Returns
object
Since
2.1.2
|
public
boolean
|
#
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.
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.
Returns
boolean
|
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).
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).
Returns
string
Since
2.1.2
|
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.
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.
Returns
string
Since
2.1.2
|
public
string
|
#
getPlatformHumanName( )
Returns the human readable platform name, e.g. "Joomla!", "Joomla!
Framework", "Something Something Something Framework" etc.
Returns the human readable platform name, e.g. "Joomla!", "Joomla!
Framework", "Something Something Something Framework" etc.
Returns
string
Since
2.1.2
|
public
array
|
#
getPlatformBaseDirs( )
Returns absolute path to directories used by the CMS.
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
Returns
array - A hash array with keys root, public, admin, tmp and log.
|
public
array
|
#
getComponentBaseDirs( string $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).
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.
Parameters
- $component
string - $component The name of the component. For Joomla! this is something like
"com_example"
Returns
array - A hash array with keys main, alt, site and admin.
|
public
array
|
#
getViewTemplatePaths( string $component, string $view, string $layout = 'default', string $tpl = null, boolean $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
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.
Parameters
- $component
string - $component The name of the component. For Joomla! this is something like
"com_example"
- $view
string - $view The name of the view you're looking a template for
- $layout
string - $layout The layout name to load, e.g. 'default'
- $tpl
string - $tpl The sub-template name to load (null by default)
- $strict
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.
Returns
array
|
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.
Get application-specific suffixes to use with template paths. This allows you
to look for view template overrides based on the application version.
Returns
array - A plain array of suffixes to try in template names
|
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.
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.
Parameters
- $component
string - $component The name of the component for which to fetch the overrides
- $absolute
boolean - $absolute Should I return an absolute or relative path?
Returns
string - The path to the template overrides directory
|
public
|
#
loadTranslations( string $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).
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).
Parameters
- $component
string - $component The name of the component. For Joomla! this is something like
"com_example"
|
public
boolean
|
#
authorizeAdmin( string $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 alos 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.
By default FOF will only use the Controller's onBefore* methods to perform
user authorisation. In some cases, like the Joomla! back-end, you alos 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.
Parameters
- $component
string - $component The name of the component.
Returns
boolean - True to allow loading the component, false to halt loading
|
public
mixed
|
#
getUserStateFromRequest( string $key, string $request, FOFInput $input, mixed $default = null, string $type = 'none', boolean $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.
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.
Parameters
- $key
string - $key The user state key for the variable
- $request
string - $request The request variable name for the variable
- $input
FOFInput - $input The FOFInput object with the request (input) data
- $default
mixed - $default The default value. Default: null
- $type
string - $type The filter type for the variable data. Default: none (no filtering)
- $setUserState
boolean - $setUserState Should I set the user state with the fetched value?
Returns
mixed - The value of the variable
|
public
|
#
importPlugin( string $type )
Load plugins of a specific type. Obviously this seems to only be required in
the Joomla! CMS.
Load plugins of a specific type. Obviously this seems to only be required in
the Joomla! CMS.
Parameters
- $type
string - $type The type of the plugins to be loaded
|
public
array
|
#
runPlugins( string $event, array $data )
Execute plugins (system-level triggers) and fetch back an array with their
return values.
Execute plugins (system-level triggers) and fetch back an array with their
return values.
Parameters
- $event
string - $event The event (trigger) name, e.g. onBeforeScratchMyEar
- $data
array - $data A hash array of data sent to the plugins as part of the trigger
Returns
array - A simple array containing the resutls of the plugins triggered
|
public
boolean
|
#
authorise( string $action, string $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.
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.
Parameters
- $action
string - $action The ACL privilege to check, e.g. core.edit
- $assetname
string - $assetname The asset name to check, typically the component's name
Returns
boolean - True if the user is allowed this action
|
public
JUser
|
#
getUser( integer $id = null )
Returns a user object.
Parameters
- $id
integer - $id The user ID to load. Skip or use null to retrieve the object for the
currently logged in user.
Returns
JUser
- The JUser object for the specified user
|
public
JDocument
|
#
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).
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).
Returns
|
public
JDate
|
#
getDate( mixed $time = 'now', null $tzOffest = null, boolean $locale = true )
Returns an object to handle dates
Returns an object to handle dates
Parameters
- $time
mixed - $time The initial time
- $tzOffest
null - $tzOffest The timezone offset
- $locale
boolean - $locale Should I try to load a specific class for current language?
Returns
|
public
|
|
public
FOFDatabaseDriver
|
|
public
boolean
|
#
isBackend( )
Is this the administrative section of the component?
Is this the administrative section of the component?
Returns
boolean
|
public
boolean
|
#
isFrontend( )
Is this the public section of the component?
Is this the public section of the component?
Returns
boolean
|
public
boolean
|
#
isCli( )
Is this a component running in a CLI application?
Is this a component running in a CLI application?
Returns
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.
Is AJAX re-ordering supported? This is 100% Joomla!-CMS specific. All other
platforms should return false and never ask why.
Returns
boolean
|
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
Performs a check between two versions. Use this function instead of PHP
version_compare so we can mock it while testing
Deprecated
Use PHP's version_compare against JVERSION in your code. This method is
scheduled for removal in FOF 3.0
Parameters
- $version1
string - $version1 First version number
- $version2
string - $version2 Second version number
- $operator
string - $operator Operator (see version_compare for valid operators)
Returns
boolean
|
public
boolean
|
#
setCache( string $key, string $content )
Saves something to the cache. This is supposed to be used for system-wide FOF
data, not application data.
Saves something to the cache. This is supposed to be used for system-wide FOF
data, not application data.
Parameters
- $key
string - $key The key of the data to save
- $content
string - $content The actual data to save
Returns
boolean - True on success
|
public
string
|
#
getCache( string $key, string $default = null )
Retrieves data from the cache. This is supposed to be used for system-side
FOF data, not application data.
Retrieves data from the cache. This is supposed to be used for system-side
FOF data, not application data.
Parameters
- $key
string - $key The key of the data to retrieve
- $default
string - $default The default value to return if the key is not found or the cache is not
populated
Returns
string - The cached value
|
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.
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.
Returns
boolean - True on success
|
public
mixed
|
#
getConfig( )
Returns an object that holds the configuration of the current site.
Returns an object that holds the configuration of the current site.
Returns
mixed
|
public
boolean
|
|
public
boolean
|
#
loginUser( array $authInfo )
logs in a user
Parameters
- $authInfo
array - $authInfo authentification information
Returns
boolean - True on success
|
public
boolean
|
#
logoutUser( )
logs out a user
Returns
boolean - True on success
|
public
|
|
public
|
#
logDeprecated( string $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.
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.
Parameters
- $message
string - $message The deprecated practice log message
|
public
|
|
public
string
|
#
URIroot( boolean $pathonly = false, string $path = null )
Returns the root URI for the request.
Returns the root URI for the request.
Parameters
- $pathonly
boolean - $pathonly If false, prepend the scheme, host and port information. Default is
false.
- $path
string - $path The path
Returns
string - The root URI string.
|
public
string
|
#
URIbase( boolean $pathonly = false )
Returns the base URI for the request.
Returns the base URI for the request.
Parameters
- $pathonly
boolean - $pathonly If false, prepend the scheme, host and port information. Default is
false. |
Returns
string - The base URI string
|