26 private $datalist_cache;
31 private $config_values = [];
36 private $subtype_data = [];
41 private $active_plugins = [];
46 private $plugin_settings = [];
64 FROM {$db->prefix}datalists
65 WHERE `name` NOT IN ('__site_secret__', 'default_site', 'dataroot')
67 $this->datalist_cache =
new InMemory();
69 $this->datalist_cache->put(
$row->name,
$row->value);
75 FROM {$db->prefix}entity_subtypes
78 $this->subtype_data[
$row->id] =
$row;
82 $this->
site = $entities->
get($config->site_guid,
'site');
84 throw new \InstallationException(
"Unable to handle this request. This site is not configured or the database is down.");
90 FROM {$db->prefix}config
91 WHERE site_guid = {$config->site_guid}
94 $this->config_values[
$row->name] = unserialize(
$row->value);
98 $this->active_plugins = $plugins->
find(
'active', $config->site_guid);
101 if (!$this->active_plugins) {
108 }, $this->active_plugins);
111 $limit = isset($config->bootdata_plugin_settings_limit) ? (int) $config->bootdata_plugin_settings_limit : 40;
113 $set = implode(
',',
$guids);
116 FROM {$db->prefix}private_settings
117 WHERE entity_guid IN ($set)
118 AND name NOT LIKE 'plugin:user_setting:%'
119 AND name NOT LIKE 'elgg:internal:%'
121 HAVING COUNT(*) > $limit
123 $unsuitable_guids = $db->
getData($sql,
function (
$row) {
124 return (
int)
$row->entity_guid;
132 $set = implode(
',',
$guids);
134 SELECT entity_guid, `name`, `value`
135 FROM {$db->prefix}private_settings
136 WHERE entity_guid IN ($set)
137 AND name NOT LIKE 'plugin:user_setting:%'
138 AND name NOT LIKE 'elgg:internal:%'
142 $this->plugin_settings = array_fill_keys(
$guids, []);
144 $this->plugin_settings[
$row->entity_guid][
$row->name] =
$row->value;
164 return $this->datalist_cache;
173 return $this->config_values;
182 return $this->subtype_data;
191 return $this->active_plugins;
200 return $this->plugin_settings;
Serializable collection of data used to boot Elgg.
getActivePlugins()
Get active plugins.
getConfigValues()
Get config values to merge into $CONFIG.
getDatalistCache()
Get the datalists cache.
getSite()
Get the site entity.
getSubtypeData()
Get the subtype data.
populate(\stdClass $config, Database $db, EntityTable $entities, Plugins $plugins)
Populate the boot data.
getPluginSettings()
Get the plugin settings (may not include all active plugins)
An in-memory implementation of a cache pool.
get($guid, $type='')
Loads and returns an entity object from a guid.
Persistent, installation-wide key-value storage.
find($status='active', $site_guid=null)
Returns an ordered list of plugins.
getData($query, $callback=null, array $params=[])
Retrieve rows from the database.
$CONFIG site
The current site object.
if(!is_file("$autoload_root/vendor/autoload.php"))