FreeMED. ExternalPlugin

Allows for CLI plugins to extend FreeMED functionality

Summary
Allows for CLI plugins to extend FreeMED functionality
Holds the location of the plugins to be “scanned”.
Fully qualified path to plugin cache.
Internal storage of plugins’ metainformation.
Get associative array of available plugins with metainformation
Produce a picklist for a select widget of the available plugins, derived from the cache.
Resolve plugin from UUID
Perform plugin caching operation if necessary.
Determine if plugin cache is up-to-date
Pass an arbitrary command to a plugin and return its results.
Parse the results of a module INFO query.

Variables

$path

var $path

Holds the location of the plugins to be “scanned”.  Assigned by the ExternalPlugin constructor.

$cache

var $cache

Fully qualified path to plugin cache.  Assigned by the ExternalPlugin constructor.

$plugin_cache

var $plugin_cache

Internal storage of plugins’ metainformation.

Functions

ExternalPlugin

function ExternalPlugin ($path)

GetCatalog

function GetCatalog ( )

Get associative array of available plugins with metainformation

GetPicklist

function GetPicklist ($format =  '##NAME##')

Produce a picklist for a select widget of the available plugins, derived from the cache.

Parameters

$formatFormat of the output picklist, using ##’s to surround the variables.  Defaults to ‘##NAME##’.

Returns

Associative array

UUIDToPlugin

function UUIDToPlugin ($uuid)

Resolve plugin from UUID

Parameters

$uuidUnique ID number from plugin

Returns

Filename of plugin, or boolean false if the plugin is not resolved.

Cache

function Cache ( )

Perform plugin caching operation if necessary.

SeeAlso

IsCached

IsCached

function IsCached ( )

Determine if plugin cache is up-to-date

SeeAlso

Cache

Command

function Command ($plugin,
$command)

Pass an arbitrary command to a plugin and return its results.

Parameters

$pluginName of plugin file (non-qualified)
$commandCommand string to be passed to the plugin

Returns

Full text output of the plugin

ParseInfo

function ParseInfo ($info)

Parse the results of a module INFO query.

var $path
Holds the location of the plugins to be “scanned”.
var $cache
Fully qualified path to plugin cache.
var $plugin_cache
Internal storage of plugins’ metainformation.
function ExternalPlugin ($path)
function GetCatalog ( )
Get associative array of available plugins with metainformation
function GetPicklist ($format =  '##NAME##')
Produce a picklist for a select widget of the available plugins, derived from the cache.
function UUIDToPlugin ($uuid)
Resolve plugin from UUID
function Cache ( )
Perform plugin caching operation if necessary.
function IsCached ( )
Determine if plugin cache is up-to-date
function Command ($plugin,
$command)
Pass an arbitrary command to a plugin and return its results.
function ParseInfo ($info)
Parse the results of a module INFO query.