-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
26 lines (19 loc) · 881 Bytes
/
Copy pathbootstrap.php
File metadata and controls
26 lines (19 loc) · 881 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
<?php
declare(strict_types=1);
use Modufolio\Appkit\Core\Env;
const BASE_DIR = __DIR__;
// Load composer autoloader
require __DIR__.'/vendor/autoload.php';
// Publish the environment before anything reads configuration. Once frozen it
// is immutable and reachable anywhere through env() / Env::instance().
(new Env())->fromFile(__DIR__.'/.env')->freeze();
// ParaTest runs each worker in its own process and exports TEST_TOKEN. Give
// that worker a private writable directory so sessions and Doctrine proxies
// never collide with a sibling worker. Mirrors AppFactory::varDir().
$testToken = getenv('TEST_TOKEN');
if (false !== $testToken && '' !== $testToken) {
$workerVarDir = __DIR__.'/var/test/'.preg_replace('/[^A-Za-z0-9_-]/', '', (string) $testToken);
if (!is_dir($workerVarDir.'/sessions')) {
mkdir($workerVarDir.'/sessions', 0o777, true);
}
}