Elgg  Version master
BootData.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg;
4 
8 
15 class BootData {
16 
20  private $site = false;
21 
25  private $active_plugins;
26 
27  private array $plugin_metadata = [];
28 
39  public function populate(EntityTable $entities, Plugins $plugins, bool $installed) {
40  // get site entity
41  $this->site = $entities->get(1, 'site');
42  if (!$this->site && $installed) {
43  throw new InstallationException('Unable to handle this request. This site is not configured or the database is down.');
44  }
45 
46  $this->active_plugins = $plugins->find('active');
47  if (empty($this->active_plugins)) {
48  return;
49  }
50 
51  $this->plugin_metadata = _elgg_services()->metadataCache->populateFromEntities($this->active_plugins);
52  }
53 
59  public function getSite() {
60  return $this->site;
61  }
62 
68  public function getActivePlugins() {
69  return $this->active_plugins;
70  }
71 
77  public function getPluginMetadata(): array {
78  return $this->plugin_metadata;
79  }
80 }
$site
Definition: icons.php:5
return[ 'admin/delete_admin_notices'=>['access'=> 'admin'], 'admin/menu/save'=>['access'=> 'admin'], 'admin/plugins/activate'=>['access'=> 'admin'], 'admin/plugins/activate_all'=>['access'=> 'admin'], 'admin/plugins/deactivate'=>['access'=> 'admin'], 'admin/plugins/deactivate_all'=>['access'=> 'admin'], 'admin/plugins/set_priority'=>['access'=> 'admin'], 'admin/security/security_txt'=>['access'=> 'admin'], 'admin/security/settings'=>['access'=> 'admin'], 'admin/security/regenerate_site_secret'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['access'=> 'admin'], 'admin/site/flush_cache'=>['access'=> 'admin'], 'admin/site/icons'=>['access'=> 'admin'], 'admin/site/set_maintenance_mode'=>['access'=> 'admin'], 'admin/site/set_robots'=>['access'=> 'admin'], 'admin/site/theme'=>['access'=> 'admin'], 'admin/site/unlock_upgrade'=>['access'=> 'admin'], 'admin/site/settings'=>['access'=> 'admin'], 'admin/upgrade'=>['access'=> 'admin'], 'admin/upgrade/reset'=>['access'=> 'admin'], 'admin/user/ban'=>['access'=> 'admin'], 'admin/user/bulk/ban'=>['access'=> 'admin'], 'admin/user/bulk/delete'=>['access'=> 'admin'], 'admin/user/bulk/unban'=>['access'=> 'admin'], 'admin/user/bulk/validate'=>['access'=> 'admin'], 'admin/user/change_email'=>['access'=> 'admin'], 'admin/user/delete'=>['access'=> 'admin'], 'admin/user/login_as'=>['access'=> 'admin'], 'admin/user/logout_as'=>[], 'admin/user/makeadmin'=>['access'=> 'admin'], 'admin/user/resetpassword'=>['access'=> 'admin'], 'admin/user/removeadmin'=>['access'=> 'admin'], 'admin/user/unban'=>['access'=> 'admin'], 'admin/user/validate'=>['access'=> 'admin'], 'annotation/delete'=>[], 'avatar/upload'=>[], 'comment/save'=>[], 'diagnostics/download'=>['access'=> 'admin'], 'entity/chooserestoredestination'=>[], 'entity/delete'=>[], 'entity/mute'=>[], 'entity/restore'=>[], 'entity/subscribe'=>[], 'entity/trash'=>[], 'entity/unmute'=>[], 'entity/unsubscribe'=>[], 'login'=>['access'=> 'logged_out'], 'logout'=>[], 'notifications/mute'=>['access'=> 'public'], 'plugins/settings/remove'=>['access'=> 'admin'], 'plugins/settings/save'=>['access'=> 'admin'], 'plugins/usersettings/save'=>[], 'register'=>['access'=> 'logged_out', 'middleware'=>[\Elgg\Router\Middleware\RegistrationAllowedGatekeeper::class,],], 'river/delete'=>[], 'settings/notifications'=>[], 'settings/notifications/subscriptions'=>[], 'user/changepassword'=>['access'=> 'public'], 'user/requestnewpassword'=>['access'=> 'public'], 'useradd'=>['access'=> 'admin'], 'usersettings/save'=>[], 'widgets/add'=>[], 'widgets/delete'=>[], 'widgets/move'=>[], 'widgets/save'=>[],]
Definition: actions.php:73
Serializable collection of data used to boot Elgg.
Definition: BootData.php:15
getActivePlugins()
Get active plugins.
Definition: BootData.php:68
getPluginMetadata()
Get plugin metadata.
Definition: BootData.php:77
populate(EntityTable $entities, Plugins $plugins, bool $installed)
Populate the boot data.
Definition: BootData.php:39
getSite()
Get the site entity.
Definition: BootData.php:59
Entity table database service.
Definition: EntityTable.php:24
get(int $guid, ?string $type=null, ?string $subtype=null)
Loads and returns an entity object from a guid.
Persistent, installation-wide key-value storage.
Definition: Plugins.php:28
find(string $status='active')
Returns an ordered list of plugins.
Definition: Plugins.php:602
Thrown when there is a major problem with the installation.
_elgg_services()
Get the global service provider.
Definition: elgglib.php:353