xplo.re Medusa Core Framework 3.2
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
      • Driver
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Fault
      • Formatter
        • Driver
      • Incident
        • Exception
      • Reporter
        • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • Type
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Manager
  • Zone

Class Manager

Central plugin interface that loads plugins, managed zones and invokes callbacks on registered plugins.

Initialisation

A plugin manager should be registered with the central registry using the Core\Registry::DefaultPluginManager key. Afterwards, the application should retrieve a list of active plugin names (e.g. from the configuration) and call Core\Plugin\Manager::load() for each plugin; the plugin is loaded and provides a list of plugin zones for which the plugin is registered.

Plugin Invocation

Once the plugin manager is set up and all plugins are loaded, the application can call the Core\Plugin\Manager::invoke() method, based on a zone and callback name, to invoke the callback of every plugin that has registered itself for the corresponding zone and callback name.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Plugin\Manager
Namespace: Core\Plugin
Package: Core\Plugin
Since: 3.1
Requires: PHP 5.3
Version: 1.0
Located at Plugin/Manager.inc.php

Methods summary

public Core\Plugin|false|null
# load( string $moduleName )

Loads and initialises a plugin. The plugin is identified via the given module name. If a corresponding plugin class is exists after successful module load, an instance is created and the plugin is assigned to each zone from the list of zones that the plugin provides. Zones are initialised as required.

Loads and initialises a plugin. The plugin is identified via the given module name. If a corresponding plugin class is exists after successful module load, an instance is created and the plugin is assigned to each zone from the list of zones that the plugin provides. Zones are initialised as required.

Parameters

$moduleName
Name of plugin module to load and initialise.

Returns

Core\Plugin|false|null

The initialised plugin instance on success, false, if the named module does not exist, otherwise null.

Since

3.1
public mixed
# invoke( string $zoneName, string $callbackName, array $arguments = null, callable $invocationCallback = null )

Invokes a callback on all plugins registered for the given zone and callback name.

Invokes a callback on all plugins registered for the given zone and callback name.

Parameters

$zoneName
Name of zone to invoke callback on.
$callbackName
Name of callback to invoke.
$arguments
Array of arguments passed on to invoked plugin methods.
$invocationCallback

Optional callback to process the result value of each invoked plugin method. See Delegate::invokeWithArguments() for details on the invocation callback.

Returns

mixed

Return value of last invoked plugin callback method or, if given, the invocation callback function outcome. Should generally be a Boolean value. If no plugin has been registered for the given zone, the return value is null.

See

Zone::invoke()

Since

3.1
public Core\Plugin\Zone
# zone( string $zoneName )

Returns a zone instance by name. If the zone does not yet exist, a new zone instance is automatically created and assigned to the manager.

Returns a zone instance by name. If the zone does not yet exist, a new zone instance is automatically created and assigned to the manager.

Parameters

$zoneName
Name of zone to retrieve. Zone names are case sensitive.

Returns

Core\Plugin\Zone
Zone identified by the given name.

Since

3.1

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), __toString(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected Core\Plugin[] $_v_plugins

Associative array of plugin module names and their respective instances.

Associative array of plugin module names and their respective instances.

Remark

If a plugin instance is null, the plugin module has been loaded but the plugin manager failed to determine the corresponding plugin class or class initialisation failed. A value of false indicates that the plugin module does not exist.


Since

3.1
#
protected Core\Plugin\Zone[] $_v_zones

Associative array of zone names and their respective instances.

Associative array of zone names and their respective instances.

Since

3.1
#

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.2 API documentation generated by ApiGen