Method | Description | |
---|---|---|
__construct ( Elgg\Cache\Pool $pool, |
Constructor | |
cache ( ElggPlugin $plugin ) | Cache a reference to this plugin by its ID | |
checkProvides ( string $type, string $name, string $version = null, string $comparison = 'ge' ) : array | Checks if a plugin is currently providing $type and $name, and optionally checking a version. | |
exists ( string $id ) : boolean | Returns if a plugin exists in the system. | |
find ( string $status = 'active' ) : ElggPlugin[] | Returns an ordered list of plugins | |
generateEntities ( ) : boolean | Discovers plugins in the plugins_path setting and creates \ElggPlugin entities for them if they don't exist. If there are plugins with entities but not actual files, will disable the \ElggPlugin entities and mark as inactive. | |
get ( string $plugin_id ) : ElggPlugin | null | Returns an \ElggPlugin object with the path $path. | |
getAllUserSettings ( integer $user_guid, string $plugin_id, boolean $return_obj = false ) : array | Returns an array of all plugin user settings for a user. | |
getDependencyStrings ( array $dep ) : array | Returns an array of parsed strings for a dependency in the format: array( 'type' => requires, conflicts, or provides. | |
getDirsInDir ( string $dir = null ) : array | Returns a list of plugin directory names from a base directory. | |
getEntitiesFromUserSettings ( array $options = [] ) : mixed | Returns entities based upon plugin user settings. | |
getMaxPriority ( ) : integer | Returns the highest priority of the plugins | |
getProvides ( string $type = null, string $name = null ) : array | Returns an array of all provides from all active plugins. | |
getSetting ( string $name, string $plugin_id, mixed $default = null ) : mixed | Get setting for a plugin. | |
getUserSetting ( string $name, integer $user_guid, string $plugin_id, mixed $default = null ) : mixed | Get a user specific setting for a plugin. | |
invalidateIsActiveCache ( ) : void | Delete the cache holding whether plugins are active or not | |
invalidateProvidesCache ( ) : boolean | Deletes all cached data on plugins being provided. | |
isActive ( string $plugin_id ) : boolean | Returns if a plugin is active for a current site. | |
load ( ) : boolean | Loads all active plugins in the order specified in the tool admin panel. | |
namespacePrivateSetting ( string $type, string $name, string $id = null ) : string | Namespaces a string to be used as a private setting name for a plugin. | |
reindexPriorities ( ) : boolean | Reindexes all plugin priorities starting at 1. | |
setBootPlugins ( array $plugins ) : void | Set the list of active plugins according to the boot data cache | |
setPriorities ( array $order ) : boolean | Reorder plugins to an order specified by the array. | |
setSetting ( string $name, mixed $value, string $plugin_id ) : boolean | Set a setting for a plugin. | |
setUserSetting ( string $name, mixed $value, integer $user_guid, string $plugin_id ) : boolean | Set a user specific setting for a plugin. | |
unsetAllSettings ( string $plugin_id ) : boolean | Unsets all plugin settings for a plugin. | |
unsetSetting ( string $name, string $plugin_id ) : boolean | Unsets a plugin setting. | |
unsetUserSetting ( string $name, integer $user_guid, string $plugin_id ) : boolean | Unsets a user-specific plugin setting |
public __construct ( Elgg\Cache\Pool $pool, |
||
$pool | Elgg\Cache\Pool | Cache for referencing plugins by ID |
$cache | Plugin settings cache |
public cache ( ElggPlugin $plugin ) | ||
$plugin | ElggPlugin |
public checkProvides ( string $type, string $name, string $version = null, string $comparison = 'ge' ) : array | ||
$type | string | The type of the provide |
$name | string | The name of the provide |
$version | string | A version to check against |
$comparison | string | The comparison operator to use in version_compare() |
return | array | An array in the form array( 'status' => bool Does the provide exist?, 'value' => string The version provided ) |
public generateEntities ( ) : boolean | ||
return | boolean |
public getAllUserSettings ( integer $user_guid, string $plugin_id, boolean $return_obj = false ) : array | ||
$user_guid | integer | The user GUID or 0 for the currently logged in user. |
$plugin_id | string | The plugin ID (Required) |
$return_obj | boolean | Return settings as an object? This can be used to in reusable views where the settings are passed as $vars['entity']. |
return | array |
public getDependencyStrings ( array $dep ) : array | ||
$dep | array | An \ElggPluginPackage dependency array |
return | array |
public getDirsInDir ( string $dir = null ) : array | ||
$dir | string | A dir to scan for plugins. Defaults to config's plugins_path. Must have a trailing slash. |
return | array | Array of directory names (not full paths) |
public getEntitiesFromUserSettings ( array $options = [] ) : mixed | ||
$options | array | Array in the format: plugin_id => STR The plugin id. Required. plugin_user_setting_names => null|ARR private setting names plugin_user_setting_values => null|ARR metadata values plugin_user_setting_name_value_pairs => null|ARR ( name => 'name', value => 'value', 'operand' => '=', ) Currently if multiple values are sent via an array (value => array('value1', 'value2') the pair's operand will be forced to "IN". plugin_user_setting_name_value_pairs_operator => null|STR The operator to use for combining (name = value) OPERATOR (name = value); default AND |
return | mixed | int If count, int. If not count, array. false on errors. |
public getMaxPriority ( ) : integer | ||
return | integer |
public getUserSetting ( string $name, integer $user_guid, string $plugin_id, mixed $default = null ) : mixed | ||
$name | string | The name of the setting. |
$user_guid | integer | The user GUID or 0 for the currently logged in user. |
$plugin_id | string | The plugin ID (Required) |
$default | mixed | The default value to return if none is set |
return | mixed |
public invalidateIsActiveCache ( ) : void | ||
return | void |
public invalidateProvidesCache ( ) : boolean | ||
return | boolean |
public reindexPriorities ( ) : boolean | ||
return | boolean |
public setBootPlugins ( array $plugins ) : void | ||
$plugins | array | Set of active plugins |
return | void |
public setPriorities ( array $order ) : boolean | ||
$order | array | An array of plugin ids in the order to set them |
return | boolean |
public setUserSetting ( string $name, mixed $value, integer $user_guid, string $plugin_id ) : boolean | ||
$name | string | The name. Note: cannot be "title". |
$value | mixed | The value. |
$user_guid | integer | The user GUID or 0 for the currently logged in user. |
$plugin_id | string | The plugin ID (Required) |
return | boolean |
public unsetAllSettings ( string $plugin_id ) : boolean | ||
$plugin_id | string | The plugin ID (Required) |
return | boolean |