49 $this->app->loadCore();
51 if (!$this->app->internal_services->db) {
54 $this->app->internal_services->session->start();
55 $this->app->internal_services->translator->bootTranslations();
57 \Elgg\Application\SystemEventHandlers::init();
59 $this->app->setBootStatus(
'full_boot_completed',
true);
64 $this->setEntityClasses();
68 $this->registerEvents();
71 $this->app->internal_services->boot->boot($this->app->internal_services);
74 $this->app->internal_services->translator->bootTranslations();
76 $this->app->setBootStatus(
'service_boot_completed',
true);
85 if ($this->app->getBootStatus(
'plugins_boot_completed') || !$this->app->internal_services->db) {
89 $events = $this->app->internal_services->events;
91 $events->registerHandler(
'plugins_load:before',
'system',
'elgg_views_boot');
92 $events->registerHandler(
'plugins_load:after',
'system',
function() {
93 $this->app->internal_services->session->boot();
96 $events->registerHandler(
'plugins_boot',
'system',
function() {
97 $this->registerRoutes();
99 $events->registerHandler(
'plugins_boot',
'system',
function() {
100 $this->registerActions();
104 $this->app->internal_services->plugins->build();
109 $events->triggerSequence(
'plugins_load',
'system');
113 $events->triggerSequence(
'plugins_boot',
'system');
115 $this->app->setBootStatus(
'plugins_boot_completed',
true);
124 if ($this->app->getBootStatus(
'application_boot_completed') || !$this->app->internal_services->db) {
128 $events = $this->app->internal_services->events;
130 $this->app->allowPathRewrite();
133 $events->triggerSequence(
'init',
'system');
135 $this->app->setBootStatus(
'full_boot_completed',
true);
139 $this->app->internal_services->accessCollections->markInitComplete();
142 $events->triggerSequence(
'ready',
'system');
144 $this->app->setBootStatus(
'application_boot_completed',
true);
173 $events = $this->app->internal_services->events;
175 foreach ($spec as
$name => $types) {
176 foreach ($types as
$type => $callbacks) {
177 foreach ($callbacks as $callback => $event_spec) {
178 if (!is_array($event_spec)) {
182 $unregister = (bool)
elgg_extract(
'unregister', $event_spec,
false);
185 $events->unregisterHandler(
$name,
$type, $callback);
205 foreach ($routes as
$name => $def) {
206 $this->app->internal_services->routes->register(
$name, $def);
222 if (!is_array($action_spec)) {
233 unset($action_spec[
'access']);
234 unset($action_spec[
'controller']);
235 unset($action_spec[
'filename']);
if(! $user||! $user->canDelete()) $name
Handles application boot sequence.
registerActions()
Register core actions.
setEntityClasses()
Set core entity classes.
bootPlugins()
Boot plugins.
bootApplication()
Finish bootstrapping the application.
__construct(protected Application $app)
Constructor.
registerEvents()
Register core events.
__invoke()
Full application boot Boots services, plugins and trigger init/ready events.
bootServices()
Boot core services.
registerRoutes()
Register core routes.
Load, boot, and implement a front controller for an Elgg application.
getBootStatus(string $type)
Retrieve the boot status of the application.
static includeFile($file)
Include a file with as little context as possible.
Find Elgg and project paths.
static elgg()
Get the Elgg codebase path with "/".
elgg()
Bootstrapping and helper procedural code available for use in Elgg core and plugins.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_set_entity_class(string $type, string $subtype, string $class='')
Sets class constructor name for entities with given type and subtype.
elgg_views_boot()
Initialize viewtypes on system boot event This ensures simplecache is cleared during upgrades.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.
if(! $menu instanceof \Elgg\Menu\PreparedMenu) $actions