forked from webforge-labs/webforge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
23 lines (18 loc) · 706 Bytes
/
bootstrap.php
File metadata and controls
23 lines (18 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/**
* Bootstrap and Autoload whole application
*
* you can use this file to bootstrap for tests or bootstrap for scripts / others
*/
$ds = DIRECTORY_SEPARATOR;
// autoload project dependencies and self autoloading for the library
$vendor = __DIR__.$ds.'vendor'.$ds;
// are we loaded as dependency?
if (!file_exists($vendor.'autoload.php')) {
$vendor = __DIR__ . '/../../';
}
$composerAutoLoader = require $vendor.'autoload.php';
$GLOBALS['env']['root'] = $root = new \Webforge\Common\System\Dir(__DIR__.DIRECTORY_SEPARATOR);
$GLOBALS['env']['container'] = $container = new Webforge\Setup\BootContainer($GLOBALS['env']['root']);
$container->setAutoLoader($composerAutoLoader);
return $root;