| Conditions | 2 |
| Paths | 2 |
| Total Lines | 27 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public static function export(Configuration $config): string |
||
| 32 | { |
||
| 33 | $date = (new DateTimeImmutable('now', new DateTimeZone('UTC')))->format(DATE_ATOM); |
||
| 34 | $file = $config->getConfigurationFile() ?? 'No config file'; |
||
| 35 | |||
| 36 | $phpVersion = PHP_VERSION; |
||
| 37 | $phpExtensions = implode(',', get_loaded_extensions()); |
||
| 38 | $os = function_exists('php_uname') ? PHP_OS.' / '.php_uname('r') : 'Unknown OS'; |
||
| 39 | $command = implode(' ', $GLOBALS['argv']); |
||
| 40 | $boxVersion = get_box_version(); |
||
| 41 | |||
| 42 | $header = <<<EOF |
||
| 43 | // |
||
| 44 | // Processed content of the configuration file "$file" dumped for debugging purposes |
||
| 45 | // |
||
| 46 | // PHP Version: $phpVersion |
||
| 47 | // PHP extensions: $phpExtensions |
||
| 48 | // OS: $os |
||
| 49 | // Command: $command |
||
| 50 | // Box: $boxVersion |
||
| 51 | // Time: $date |
||
| 52 | // |
||
| 53 | |||
| 54 | |||
| 55 | EOF; |
||
| 56 | |||
| 57 | return $header.$config->export(); |
||
| 58 | } |
||
| 60 |