-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathbootstrap.php
More file actions
32 lines (23 loc) · 801 Bytes
/
Copy pathbootstrap.php
File metadata and controls
32 lines (23 loc) · 801 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
25
26
27
28
29
30
31
32
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2021-2022 Jankari Tech Pvt. Ltd.
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
use Composer\Autoload\ClassLoader;
define('PHPUNIT_RUN', 1);
$rootDir = __DIR__;
$serverPath = getenv('SERVER_PATH') ?: $rootDir . '/server';
$serverBaseFile = '/lib/base.php';
if (!file_exists($serverPath . $serverBaseFile)) {
$serverPath = $rootDir . '/../..';
}
if (!file_exists($serverPath . $serverBaseFile)) {
throw new RuntimeException('Server files not found.');
}
require_once $rootDir . '/vendor/autoload.php';
require_once $serverPath . $serverBaseFile;
require_once $serverPath . '/tests/autoload.php';
$classLoader = new ClassLoader();
$classLoader->addPsr4("OCA\\OpenProject\\", $rootDir . '/lib', true);
$classLoader->register();