-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoload_runtime.template
40 lines (28 loc) · 1.06 KB
/
autoload_runtime.template
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
33
34
35
36
37
38
39
40
<?php
// autoload_runtime.php @generated by Symfony Runtime
if (true === (require_once __DIR__.'/autoload.php') || empty($_SERVER['SCRIPT_FILENAME'])) {
return;
}
$scriptFilename = "bin/console";
$pharPath = Phar::running();
$test = $pharPath . DIRECTORY_SEPARATOR . $scriptFilename;
if (strlen($pharPath) > 0 && !str_starts_with($scriptFilename, 'phar://')) {
$scriptFilename = $pharPath . DIRECTORY_SEPARATOR . $scriptFilename;
} else {
$scriptFilename = $_SERVER['SCRIPT_FILENAME'];
}
$app = require $scriptFilename;
if (!is_object($app)) {
throw new TypeError(sprintf('Invalid return value: callable object expected, "%s" returned from "%s".', get_debug_type($app), $_SERVER['SCRIPT_FILENAME']));
}
$runtime = $_SERVER['APP_RUNTIME'] ?? $_ENV['APP_RUNTIME'] ?? %runtime_class%;
$runtime = new $runtime(($_SERVER['APP_RUNTIME_OPTIONS'] ?? $_ENV['APP_RUNTIME_OPTIONS'] ?? []) + %runtime_options%);
[$app, $args] = $runtime
->getResolver($app)
->resolve();
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);