24 public function activate(
string $id,
bool $force =
false): bool {
25 $split = explode(
':',
$id);
46 }
catch (PluginException $e) {
52 foreach ($conflicts as $conflict) {
53 $this->deactivate($conflict,
true);
57 foreach ($requires as $require) {
58 $this->activate($require,
true);
63 }
catch (PluginException $e) {
77 public function deactivate(
string $id,
bool $force =
false): bool {
80 throw new UnexpectedValueException(
elgg_echo(
'PluginException:InvalidID', [
$id]));
90 }
catch (PluginException $e) {
95 $dependents = $this->getDependents(
$id);
96 foreach ($dependents as $dependent) {
97 $this->deactivate($dependent,
true);
102 }
catch (PluginException $e) {
114 protected function getDependents(
string $id): array {
119 foreach ($active_plugins as
$plugin) {
120 $dependencies =
$plugin->getDependencies();
121 if (!array_key_exists(
$id, $dependencies)) {
126 $dependents[] =
$plugin->getID();
140 public function getConflicts(
string $id): array {
144 $conflicts =
$plugin->getConflicts();
146 foreach ($conflicts as
$plugin_id => $plugin_version) {
163 public function getRequires(
string $id): array {
$id
Generic annotation delete action.
$plugin_id
Remove all user and plugin settings from the give plugin ID.
Plugin class containing helper functions for plugin activation/deactivation, dependency checking capa...
Exception thrown if a value does not match with a set of values.
$config
Advanced site settings, debugging section.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_get_plugins(string $status='active')
Returns an ordered list of plugins.
elgg_get_plugin_from_id(string $plugin_id)
Elgg plugins library Contains functions for managing plugins.
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.