File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33declare (strict_types=1 );
44
55error_log ('[craft-cloud] Composer autoload file loaded. ' );
6+
7+ $ diagnosticKeys = [
8+ 'AWS_LAMBDA_RUNTIME_API ' ,
9+ 'CRAFT_CLOUD ' ,
10+ 'CRAFT_CLOUD_PROJECT_ID ' ,
11+ 'CRAFT_CLOUD_ENVIRONMENT_ID ' ,
12+ 'LOG_CHANNEL ' ,
13+ 'LOG_STACK ' ,
14+ 'LOG_STDERR_FORMATTER ' ,
15+ ];
16+
17+ $ diagnostics = [];
18+
19+ foreach ($ diagnosticKeys as $ key ) {
20+ $ serverValue = $ _SERVER [$ key ] ?? null ;
21+ $ envValue = $ _ENV [$ key ] ?? null ;
22+ $ getenvValue = getenv ($ key );
23+
24+ $ diagnostics [$ key ] = [
25+ 'server ' => $ serverValue === null ? null : (string ) $ serverValue ,
26+ 'env ' => $ envValue === null ? null : (string ) $ envValue ,
27+ 'getenv ' => $ getenvValue === false ? null : $ getenvValue ,
28+ ];
29+ }
30+
31+ error_log ('[craft-cloud] Runtime diagnostics: ' . json_encode ($ diagnostics ));
You can’t perform that action at this time.
0 commit comments