forked from open-dxp/opendxp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan-bootstrap.php
More file actions
23 lines (20 loc) · 887 Bytes
/
phpstan-bootstrap.php
File metadata and controls
23 lines (20 loc) · 887 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
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
define('OPENDXP_PROJECT_ROOT', __DIR__);
} elseif (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
define('OPENDXP_PROJECT_ROOT', __DIR__ . '/../../..');
} elseif (getenv('OPENDXP_PROJECT_ROOT')) {
if (file_exists(getenv('OPENDXP_PROJECT_ROOT') . '/vendor/autoload.php')) {
define('OPENDXP_PROJECT_ROOT', getenv('OPENDXP_PROJECT_ROOT'));
} else {
throw new \Exception('Invalid OpenDxp project root "' . getenv('OPENDXP_PROJECT_ROOT') . '"');
}
} else {
throw new \Exception('Unknown configuration! OpenDxp project root not found, please set env variable OPENDXP_PROJECT_ROOT.');
}
include OPENDXP_PROJECT_ROOT . '/vendor/autoload.php';
\OpenDxp\Bootstrap::setProjectRoot();
\OpenDxp\Bootstrap::bootstrap();
if (!defined('OPENDXP_TEST')) {
define('OPENDXP_TEST', true);
}