Elgg  Version 1.12
load.php
Go to the documentation of this file.
1 <?php
9 $lib_dir = __DIR__ . "/lib";
10 
11 $autoloader_setup = (require_once "$lib_dir/autoloader.php");
12 
13 $autoload_path = dirname(__DIR__) . '/vendor/autoload.php';
15 if (!$autoload_available) {
16  die("Couldn't include '$autoload_path'. Did you run `composer install`?");
17 }
18 
19 // set up autoloading and DIC
21 
22 // load the rest of the library files from engine/lib/
23 // All on separate lines to make diffs easy to read + make it apparent how much
24 // we're actually loading on every page (Hint: it's too much).
25 $lib_files = array(
26  // Needs to be loaded first to correctly bootstrap
27  'elgglib.php',
28 
29  // The order of these doesn't matter, so keep them alphabetical
30  'access.php',
31  'actions.php',
32  'admin.php',
33  'annotations.php',
34  'cache.php',
35  'comments.php',
36  'configuration.php',
37  'cron.php',
38  'database.php',
39  'entities.php',
40  'extender.php',
41  'filestore.php',
42  'friends.php',
43  'group.php',
44  'input.php',
45  'languages.php',
46  'mb_wrapper.php',
47  'memcache.php',
48  'metadata.php',
49  'metastrings.php',
50  'navigation.php',
51  'notification.php',
52  'objects.php',
53  'output.php',
54  'pagehandler.php',
55  'pageowner.php',
56  'pam.php',
57  'plugins.php',
58  'private_settings.php',
59  'relationships.php',
60  'river.php',
61  'sessions.php',
62  'sites.php',
63  'statistics.php',
64  'system_log.php',
65  'tags.php',
66  'user_settings.php',
67  'users.php',
68  'upgrade.php',
69  'views.php',
70  'widgets.php',
71 
72  // backward compatibility
73  'deprecated-1.7.php',
74  'deprecated-1.8.php',
75  'deprecated-1.9.php',
76  'deprecated-1.10.php',
77  'deprecated-1.11.php',
78  'deprecated-1.12.php',
79 );
80 
81 // isolate global scope
82 call_user_func(function () use ($lib_dir, $lib_files, $autoloader_setup) {
83 
84  $setups = array();
85 
86  // include library files, capturing setup functions
87  foreach ($lib_files as $file) {
88  $setup = (require_once "$lib_dir/$file");
89 
90  if ($setup instanceof Closure) {
91  $setups[$file] = $setup;
92  }
93  }
94 
95  $events = _elgg_services()->events;
96  $hooks = _elgg_services()->hooks;
97 
98  // run setups
99  $autoloader_setup($events, $hooks);
100  foreach ($setups as $func) {
101  $func($events, $hooks);
102  }
103 });
$lib_dir
This file is used to make all of Elgg&#39;s code available without going through the boot process...
Definition: load.php:9
$autoloader_setup
Definition: load.php:11
$lib_files
Definition: load.php:25
_elgg_services()
Definition: autoloader.php:14
$autoload_path
Definition: load.php:13
$autoload_available
Definition: load.php:14