PHP 클래스 Elgg\Database\Plugins

WARNING: API IN FLUX. DO NOT USE DIRECTLY.
부터: 1.10.0
상속: use trait Elgg\Profilable
파일 보기 프로젝트 열기: elgg/elgg 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Elgg\Cache\Pool $pool, PluginSettingsCache $cache ) 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

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( Elgg\Cache\Pool $pool, PluginSettingsCache $cache )
$pool Elgg\Cache\Pool Cache for referencing plugins by ID
$cache Elgg\Cache\PluginSettingsCache Plugin settings cache

cache() 공개 메소드

Cache a reference to this plugin by its ID
public cache ( ElggPlugin $plugin )
$plugin ElggPlugin

checkProvides() 공개 메소드

Checks if a plugin is currently providing $type and $name, and optionally checking a version.
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()
리턴 array An array in the form array( 'status' => bool Does the provide exist?, 'value' => string The version provided )

exists() 공개 메소드

Returns if a plugin exists in the system.
public exists ( string $id ) : boolean
$id string The plugin ID.
리턴 boolean

find() 공개 메소드

Returns an ordered list of plugins
public find ( string $status = 'active' ) : ElggPlugin[]
$status string The status of the plugins. active, inactive, or all.
리턴 ElggPlugin[]

generateEntities() 공개 메소드

The \ElggPlugin object holds config data, so don't delete.
public generateEntities ( ) : boolean
리턴 boolean

get() 공개 메소드

Returns an \ElggPlugin object with the path $path.
public get ( string $plugin_id ) : ElggPlugin | null
$plugin_id string The id (dir name) of the plugin. NOT the guid.
리턴 ElggPlugin | null

getAllUserSettings() 공개 메소드

Returns an array of all plugin user settings for a user.
또한 보기: ElggPlugin::getAllUserSettings()
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'].
리턴 array

getDependencyStrings() 공개 메소드

'name' => The name of the requirement / conflict 'value' => A string representing the expected value: <1, >=3, !=enabled 'local_value' => The current value, ("Not installed") 'comment' => Free form text to help resovle the problem ("Enable / Search for plugin ") )
public getDependencyStrings ( array $dep ) : array
$dep array An \ElggPluginPackage dependency array
리턴 array

getDirsInDir() 공개 메소드

Returns a list of plugin directory names from a base directory.
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.
리턴 array Array of directory names (not full paths)

getEntitiesFromUserSettings() 공개 메소드

Takes all the options for {@link elgg_get_entities_from_private_settings()} in addition to the ones below.
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
리턴 mixed int If count, int. If not count, array. false on errors.

getMaxPriority() 공개 메소드

Returns the highest priority of the plugins
public getMaxPriority ( ) : integer
리턴 integer

getProvides() 공개 메소드

Array in the form array( 'provide_type' => array( 'provided_name' => array( 'version' => '1.8', 'provided_by' => 'provider_plugin_id' ) ) )
public getProvides ( string $type = null, string $name = null ) : array
$type string The type of provides to return
$name string A specific provided name to return. Requires $provide_type.
리턴 array

getSetting() 공개 메소드

Get setting for a plugin.
또한 보기: ElggPlugin::getSetting()
public getSetting ( string $name, string $plugin_id, mixed $default = null ) : mixed
$name string The name of the setting.
$plugin_id string The plugin ID (Required)
$default mixed The default value to return if none is set
리턴 mixed

getUserSetting() 공개 메소드

Get a user specific setting for a plugin.
또한 보기: ElggPlugin::getUserSetting()
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
리턴 mixed

invalidateIsActiveCache() 공개 메소드

Delete the cache holding whether plugins are active or not
public invalidateIsActiveCache ( ) : void
리턴 void

invalidateProvidesCache() 공개 메소드

Deletes all cached data on plugins being provided.

isActive() 공개 메소드

Returns if a plugin is active for a current site.
public isActive ( string $plugin_id ) : boolean
$plugin_id string The plugin ID
리턴 boolean

load() 공개 메소드

Loads all active plugins in the order specified in the tool admin panel.
public load ( ) : boolean
리턴 boolean

namespacePrivateSetting() 공개 메소드

For user_settings, two namespaces are added: a user setting namespace and the plugin id. For internal (plugin priority), there is a single internal namespace added.
public namespacePrivateSetting ( string $type, string $name, string $id = null ) : string
$type string The type of setting: user_setting or internal.
$name string The name to namespace.
$id string The plugin's ID to namespace with. Required for user_setting.
리턴 string

reindexPriorities() 공개 메소드

Reindexes all plugin priorities starting at 1.
public reindexPriorities ( ) : boolean
리턴 boolean

setBootPlugins() 공개 메소드

Set the list of active plugins according to the boot data cache
public setBootPlugins ( array $plugins ) : void
$plugins array Set of active plugins
리턴 void

setPriorities() 공개 메소드

Plugins not included in this array will be appended to the end.
public setPriorities ( array $order ) : boolean
$order array An array of plugin ids in the order to set them
리턴 boolean

setSetting() 공개 메소드

Set a setting for a plugin.
또한 보기: ElggPlugin::setSetting()
public setSetting ( string $name, mixed $value, string $plugin_id ) : boolean
$name string The name of the setting - note, can't be "title".
$value mixed The value.
$plugin_id string The plugin ID (Required)
리턴 boolean

setUserSetting() 공개 메소드

Set a user specific setting for a plugin.
또한 보기: ElggPlugin::setUserSetting()
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)
리턴 boolean

unsetAllSettings() 공개 메소드

Unsets all plugin settings for a plugin.
또한 보기: ElggPlugin::unsetAllSettings()
public unsetAllSettings ( string $plugin_id ) : boolean
$plugin_id string The plugin ID (Required)
리턴 boolean

unsetSetting() 공개 메소드

Unsets a plugin setting.
또한 보기: ElggPlugin::unsetSetting()
public unsetSetting ( string $name, string $plugin_id ) : boolean
$name string The name of the setting.
$plugin_id string The plugin ID (Required)
리턴 boolean

unsetUserSetting() 공개 메소드

Unsets a user-specific plugin setting
또한 보기: ElggPlugin::unsetUserSetting()
public unsetUserSetting ( string $name, integer $user_guid, string $plugin_id ) : boolean
$name string 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)
리턴 boolean