Elgg  Version master
BootData.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg;
4 
9 
16 class BootData {
17 
21  private $site = false;
22 
26  private $active_plugins;
27 
31  private $plugin_metadata = [];
32 
43  public function populate(EntityTable $entities, Plugins $plugins, bool $installed) {
44  // get site entity
45  $this->site = $entities->get(1, 'site');
46  if (!$this->site && $installed) {
47  throw new InstallationException('Unable to handle this request. This site is not configured or the database is down.');
48  }
49 
50  $this->active_plugins = $plugins->find('active');
51  if (empty($this->active_plugins)) {
52  return;
53  }
54 
55  _elgg_services()->metadataCache->populateFromEntities($this->active_plugins);
56 
57  foreach ($this->active_plugins as $plugin) {
58  $this->plugin_metadata[$plugin->guid] = _elgg_services()->metadataCache->getEntityMetadata($plugin->guid);
59  }
60  }
61 
67  public function getSite() {
68  return $this->site;
69  }
70 
76  public function getActivePlugins() {
77  return $this->active_plugins;
78  }
79 
85  public function getPluginMetadata() {
86  return $this->plugin_metadata;
87  }
88 }
$plugin
getSite()
Get the site entity.
Definition: BootData.php:67
getPluginMetadata()
Get plugin metadata.
Definition: BootData.php:85
$site
Definition: icons.php:5
Updates the basic settings for the primary site object.
get(int $guid, string $type=null, string $subtype=null)
Loads and returns an entity object from a guid.
populate(EntityTable $entities, Plugins $plugins, bool $installed)
Populate the boot data.
Definition: BootData.php:43
Thrown when there is a major problem with the installation.
getActivePlugins()
Get active plugins.
Definition: BootData.php:76
Serializable collection of data used to boot Elgg.
Definition: BootData.php:16
_elgg_services()
Get the global service provider.
Definition: elgglib.php:351
Persistent, installation-wide key-value storage.
Definition: Plugins.php:28
find(string $status= 'active')
Returns an ordered list of plugins.
Definition: Plugins.php:617
Entity table database service.
Definition: EntityTable.php:25