forked from pimcore/studio-backend-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan-bootstrap.php
More file actions
24 lines (20 loc) · 760 Bytes
/
Copy pathphpstan-bootstrap.php
File metadata and controls
24 lines (20 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
use Pimcore\Bootstrap;
use Pimcore\Model\Exception\NotFoundException;
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
define('PIMCORE_PROJECT_ROOT', __DIR__);
} elseif (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
define('PIMCORE_PROJECT_ROOT', __DIR__ . '/../../..');
} elseif (getenv('PIMCORE_PROJECT_ROOT')) {
define('PIMCORE_PROJECT_ROOT', getenv('PIMCORE_PROJECT_ROOT'));
} else {
throw new NotFoundException(
'Unknown configuration! Pimcore project root not found, please set env variable PIMCORE_PROJECT_ROOT.'
);
}
include_once PIMCORE_PROJECT_ROOT . '/vendor/autoload.php';
Bootstrap::setProjectRoot();
Bootstrap::bootstrap();
if (!defined('PIMCORE_TEST')) {
define('PIMCORE_TEST', true);
}