1 | <?php |
||
2 | use hiqdev\composer\config\Builder; |
||
3 | use yii\helpers\Yii; |
||
4 | use Yiisoft\Di\Container; |
||
5 | |||
6 | // ensure we get report on all possible php errors |
||
7 | error_reporting(E_ALL); |
||
8 | |||
9 | $_SERVER['SCRIPT_NAME'] = '/' . __DIR__; |
||
10 | $_SERVER['SCRIPT_FILENAME'] = __FILE__; |
||
11 | |||
12 | (function () { |
||
13 | $composerAutoload = __DIR__ . '/../vendor/autoload.php'; |
||
14 | if (!is_file($composerAutoload)) { |
||
15 | die('You need to set up the project dependencies using Composer'); |
||
0 ignored issues
–
show
|
|||
16 | } |
||
17 | |||
18 | require_once $composerAutoload; |
||
19 | |||
20 | $container = new Container(require Builder::path('tests')); |
||
21 | |||
22 | Yii::setContainer($container); |
||
23 | })(); |
||
24 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.