Elgg  Version 1.11
start.php
Go to the documentation of this file.
1 <?php
25 $START_MICROTIME = microtime(true);
26 
41 if (!isset($CONFIG)) {
42  $CONFIG = new \stdClass;
43 }
44 $CONFIG->boot_complete = false;
45 
46 $engine_dir = dirname(__FILE__);
47 
48 // No settings means a fresh install
49 if (!is_file("$engine_dir/settings.php")) {
50  header("Location: install.php");
51  exit;
52 }
53 
54 if (!is_readable("$engine_dir/settings.php")) {
55  echo "The Elgg settings file exists but the web server doesn't have read permission to it.";
56  exit;
57 }
58 
59 require_once "$engine_dir/settings.php";
60 
61 // This will be overridden by the DB value but may be needed before the upgrade script can be run.
62 $CONFIG->default_limit = 10;
63 
64 require_once "$engine_dir/load.php";
65 
66 // Connect to database, load language files, load configuration, init session
67 // Plugins can't use this event because they haven't been loaded yet.
68 elgg_trigger_event('boot', 'system');
69 
70 // Load the plugins that are active
72 
73 // @todo move loading plugins into a single boot function that replaces 'boot', 'system' event
74 // and then move this code in there.
75 // This validates the view type - first opportunity to do it is after plugins load.
78  elgg_set_viewtype('default');
79 }
80 
81 // @todo deprecate as plugins can use 'init', 'system' event
82 elgg_trigger_event('plugins_boot', 'system');
83 
84 // Complete the boot process for both engine and plugins
85 elgg_trigger_event('init', 'system');
86 
87 $CONFIG->boot_complete = true;
88 
89 // System loaded and ready
90 elgg_trigger_event('ready', 'system');
elgg_is_registered_viewtype($viewtype)
Checks if $viewtype is registered.
Definition: views.php:138
$engine_dir
Definition: start.php:46
exit
Definition: reorder.php:12
_elgg_load_plugins()
Loads all active plugins in the order specified in the tool admin panel.
Definition: plugins.php:150
elgg_set_viewtype($viewtype="")
Manually set the viewtype.
Definition: views.php:70
elgg_get_viewtype()
Return the current view type.
Definition: views.php:91
elgg echo
Translates a string.
Definition: languages.js:43
global $START_MICROTIME
The time with microseconds when the Elgg engine was started.
Definition: start.php:24
elgg global
Pointer to the global context.
Definition: elgglib.js:12
global $CONFIG
Configuration values.
Definition: start.php:40
clearfix elgg elgg elgg elgg page header
Definition: admin.php:127
elgg_trigger_event($event, $object_type, $object=null)
Definition: elgglib.php:570
$viewtype
Definition: start.php:76