24 public function activate(
string $id,
bool $force =
false): bool {
25 $split = explode(
':', $id);
52 foreach ($conflicts as $conflict) {
53 $this->deactivate($conflict,
true);
57 foreach ($requires as $require) {
58 $this->activate($require,
true);
77 public function deactivate(
string $id,
bool $force =
false): bool {
79 if (!
$plugin instanceof \ElggPlugin) {
95 $dependents = $this->getDependents($id);
96 foreach ($dependents as $dependent) {
97 $this->deactivate($dependent,
true);
114 protected function getDependents(
string $id): array {
119 foreach ($active_plugins as
$plugin) {
120 $dependencies = $plugin->getDependencies();
121 if (!array_key_exists($id, $dependencies)) {
125 if (
elgg_extract(
'must_be_active', $dependencies[$id],
true)) {
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 {
elgg_get_plugins(string $status= 'active')
Returns an ordered list of plugins.
Plugin class containing helper functions for plugin activation/deactivation, dependency checking capa...
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.
$plugin_id
Remove all user and plugin settings from the give plugin ID.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
$config
Advanced site settings, debugging section.
Exception thrown if a value does not match with a set of values.
$id
Generic annotation delete action.