forked from larastan/larastan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
31 lines (24 loc) · 1016 Bytes
/
bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
declare(strict_types=1);
/*
* This file is part of Larastan.
*
* (c) Nuno Maduro <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use NunoMaduro\Larastan\ApplicationResolver;
define('LARAVEL_START', microtime(true));
if (file_exists($applicationPath = getcwd().'/bootstrap/app.php')) { // Applications and Local Dev
$app = require $applicationPath;
} else { // Packages
$app = ApplicationResolver::resolve();
}
if ($app instanceof \Illuminate\Contracts\Foundation\Application) {
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
} elseif ($app instanceof \Laravel\Lumen\Application) {
$app->boot();
}
$app->make('config')->set('larastan.mixins', require __DIR__.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'mixins.php');
$app->make('config')->set('larastan.statics', require __DIR__.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'statics.php');