inital commit
[pharext/pharext.org] / app / bootstrap.php
1 <?php
2
3 namespace app;
4
5 require_once __DIR__."/../vendor/autoload.php";
6
7 use Auryn\Injector;
8 use Auryn\CachingReflector;
9 use Auryn\StandardReflector;
10
11 return function(array $modules) {
12 $reflector = getenv("APP_ENVIRONMENT") == "production"
13 ? new CachingReflector
14 : new StandardReflector
15 ;
16 $injector = new Injector($reflector);
17
18 foreach ($modules as $module) {
19 require_once __DIR__."/bootstrap/$module.php";
20 }
21
22 return $injector;
23 };