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 }
getSite()
Get the site entity.
Definition: BootData.php:59
getPluginMetadata()
Get plugin metadata.
Definition: BootData.php:77
$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:39
Thrown when there is a major problem with the installation.
getActivePlugins()
Get active plugins.
Definition: BootData.php:68
Serializable collection of data used to boot Elgg.
Definition: BootData.php:15
_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:602
Entity table database service.
Definition: EntityTable.php:24