-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.php
More file actions
31 lines (24 loc) · 811 Bytes
/
Copy pathbootstrap.php
File metadata and controls
31 lines (24 loc) · 811 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
<?php
declare(strict_types=1);
$autoloadCandidates = [
// Repository clone:
// php-websockets/vendor/autoload.php
__DIR__ . '/../vendor/autoload.php',
// Composer package install:
// project/vendor/micilini/php-websockets/examples/../../../autoload.php
__DIR__ . '/../../../autoload.php',
// Fallback when executed from the consumer project root:
// project/vendor/autoload.php
getcwd() . '/vendor/autoload.php',
];
foreach ($autoloadCandidates as $autoload) {
if (is_file($autoload)) {
require_once $autoload;
return;
}
}
throw new RuntimeException(
'Composer autoload file was not found. '
. 'Run "composer install" in the repository root, '
. 'or install micilini/php-websockets through Composer before running the examples.'
);