Manager ExtensionManager

public class ExtensionManager extends Manager

class.extensionmanager.php #16

The 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(Administration $parent)

The constructor for ExtensionManager overrides the default Manager constructor to prevent $this->_Parent from being set.

Parameters
  • $parent AdministrationThe Administration object that this manager has been created from passed by reference

string __getClassName(string $name)

Given a name, returns the full class name of an Extension. Extension use an 'extension' prefix.

Parameters
  • $name stringThe extension handle

string __getClassPath(string $name)

Finds an Extension by name by searching the EXTENSIONS folder and returns the path to the folder.

Parameters
  • $name stringThe extension folder

string __getDriverPath(string $name)

Given a name, return the path to the driver of the Extension.

Parameters
  • $name stringThe extension folder

See Also
array about(string $name)

Returns information about an extension by it's name by calling it's own about method. This method checks if an extension needs to be updated or not. 'name' => 'Name of Extension', 'version' => '1.8', 'release-date' => 'YYYY-MM-DD', 'author' => array( 'name' => 'Author Name', 'website' => 'Author Website', 'email' => 'Author Email' ), 'description' => 'A description about this extension'

Parameters
  • $name stringThe name of the Extension Class minus the extension prefix.

Returns

An associative array describing this extension

See Also
Extension create(string $name)

Creates an instance of a given class and returns it

Parameters
  • $name stringThe name of the Extension Class minus the extension prefix.

boolean disable(string $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
  • $name stringThe name of the Extension Class minus the extension prefix.

See Also
boolean enable(string $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
  • $name stringThe name of the Extension Class minus the extension prefix.

See Also
integer fetchExtensionID(string $name)

A convenience method that returns an extension ID from it's name.

Parameters
  • $name stringThe name of the Extension Class minus the extension prefix.

string fetchInstalledVersion(string $name)

A convenience method that returns an extension version from it's name.

Parameters
  • $name stringThe name of the Extension Class minus the extension prefix.

integer fetchStatus(string $name)

Returns the status of an Extension by name

Parameters
  • $name stringThe name of the Extension Class minus the extension prefix.

Returns

An extension status, EXTENSION_ENABLED, EXTENSION_DISABLED EXTENSION_NOT_INSTALLED and EXTENSION_REQUIRES_UPDATE. If an extension doesn't exist, null will be returned.

Extension getInstance(string $name)

This function returns an instance of an extension from it's name

Parameters
  • $name stringThe name of the Extension Class minus the extension prefix.

array listAll(string $filter)

Will return an associative array of all extensions and their about information

Parameters
  • $filter stringAllows a regular expression to be passed to return only extensions whose folders match the filter.

Returns

An associative array with the key being the extension folder and the value being the extension's about information

array listInstalledHandles()

Returns an array of all the enabled extensions available

void notifyMembers(string $delegate, string $page, array $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
  • $delegate stringThe delegate name

  • $page stringThe current page namespace that this delegate operates in

  • $context arrayThe $context param is an associative array that at minimum will contain the current Administration class, the current page object and the delegate name. Other context information may be passed to this function when it is called. eg. array( 'parent' =>& $this->Parent, 'page' => $page, 'delegate' => $delegate );

integer registerDelegates(string $name)

This functions registers an extensions delegates in tbl_extensions_delegates.

Parameters
  • $name stringThe name of the Extension Class minus the extension prefix.

Returns

The Extension ID

void removeDelegates(string $name)

This function will remove all delegate subscriptions for an extension given an extension's name. This triggers __cleanupDatabase()

Parameters
  • $name stringThe name of the Extension Class minus the extension prefix.

See Also
integer sortByName(array $a, array $b)

Custom user sorting function to sort extensions by name

See Also
boolean uninstall(string $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.

Parameters
  • $name stringThe name of the Extension Class minus the extension prefix.

See Also

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details