- Symphony 2.5.2
-
› assets
14 -
› boot
13 -
› core
23 -
› cryptography
4 -
› data-sources
0 -
› email-gateways
3 -
› events
3 -
› global
44 -
› interface
8 -
› toolkit
71 - Delegates91
- Deprecated14
Versions
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.3
- 2.7.2
- 2.7.10
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.11
- 2.6.10
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2
Options
public class ExtensionManager
class.extensionmanager.php #16The ExtensionManager class is responsible for managing all extensions
in Symphony. Extensions are stored on the file system in the EXTENSIONS
folder. They are autodiscovered where the Extension class name is the same
as it's folder name (excluding the extension prefix).
Methods
void __construct()
The constructor will populate the $_subscriptions
variable from
the tbl_extension
and tbl_extensions_delegates
tables.
static string __getClassName(
$name)
Given a name, returns the full class name of an Extension. Extension use an 'extension' prefix.
Parameters
static string __getClassPath(
$name)
Finds an Extension by name by searching the EXTENSIONS
folder and
returns the path to the folder.
Parameters
static string __getDriverPath(
$name)
Given a name, return the path to the driver of the Extension.
Parameters
See Also
static void __getHandleFromFilename(
$filename)
static array about(
$name, $rawXML)
This function will load an extension's meta information given the extension
$name
. Since Symphony 2.3, this function will look for an extension.meta.xml
file inside the extension's folder. If this is not found, it will initialise
the extension and invoke the about()
function. By default this extension will
return an associative array display the basic meta data about the given extension.
If the $rawXML
parameter is passed true, and the extension has a extension.meta.xml
file, this function will return DOMDocument
of the file.
Parameters
Returns
An associative array describing this extension
static void cleanupDatabase()
A utility function that is used by the ExtensionManager to ensure
stray delegates are not in tbl_extensions_delegates
. It is called when
a new Delegate is added or removed.
static Extension create(
$name)
Creates an instance of a given class and returns it
Parameters
static boolean disable(
$name)
Disabling an extension will prevent it from executing but retain all it's
settings in the relevant tables. Symphony checks that an extension can
be disabled using the canUninstallorDisable()
before removing
all delegate subscriptions from the database and calling the extension's
disable()
function.
Parameters
See Also
static boolean enable(
$name)
Enabling an extension will re-register all it's delegates with Symphony. It will also install or update the extension if needs be by calling the extensions respective install and update methods. The enable method is of the extension object is finally called.
Parameters
See Also
static array fetch(
$select, $where, $order_by)
This function will return an associative array of Extension information. The
information returned is defined by the $select
parameter, which will allow
a developer to restrict what information is returned about the Extension.
Optionally, $where
(not implemented) and $order_by
parameters allow a developer to
further refine their query.
Parameters
Returns
An associative array of Extension information, formatted in the same way as the listAll() method.
static integer fetchExtensionID(
$name)
A convenience method that returns an extension ID from it's name.
Parameters
static string fetchInstalledVersion(
$name)
A convenience method that returns an extension version from it's name.
Parameters
static array fetchStatus(
$about)
Returns the status of an Extension given an associative array containing
the Extension handle
and version
where the version
is the file
version, not the installed version. This function returns an array
which may include a maximum of two statuses.
Parameters
Returns
An array of extension statuses, with the possible values being EXTENSION_ENABLED
, EXTENSION_DISABLED
, EXTENSION_REQUIRES_UPDATE
or EXTENSION_NOT_INSTALLED
. If an extension doesn't exist, EXTENSION_NOT_INSTALLED
will be returned.
static Cacheable getCacheProvider(
$key, $reuse)
This function will return the Cacheable
object with the appropriate
caching layer for the given $key
. This $key
should be stored in
the Symphony configuration in the caching group with a reference
to the class of the caching object. If the key is not found, this
will return a default Cacheable
object created with the MySQL driver.
Parameters
static Extension getInstance(
$name)
This function returns an instance of an extension from it's name
Parameters
static array getProvidersOf(
$type)
Return an array all the Provider objects supplied by extensions,
optionally filtered by a given $type
.
Parameters
Returns
An array of objects
static array listAll(
$filter)
Will return an associative array of all extensions and their about information
Parameters
Returns
An associative array with the key being the extension folder and the value being the extension's about information
static array listInstalledHandles()
Returns an array of all the enabled extensions available
static null|void notifyMembers(
$delegate, $page, $context)
Given a delegate name, notify all extensions that have registered to that
delegate to executing their callbacks with a $context
array parameter
that contains information about the current Symphony state.
Parameters
static integer registerDelegates(
$name)
This functions registers an extensions delegates in tbl_extensions_delegates
.
Parameters
Returns
The Extension ID
static boolean removeDelegates(
$name)
This function will remove all delegate subscriptions for an extension
given an extension's name. This triggers cleanupDatabase()
Parameters
See Also
static boolean uninstall(
$name)
Uninstalling an extension will unregister all delegate subscriptions and
remove all extension settings. Symphony checks that an extension can
be uninstalled using the canUninstallorDisable()
before calling
the extension's uninstall()
function. Alternatively, if this function
is called because the extension described by $name
cannot be found
it's delegates and extension meta information will just be removed from the
database.