Compare commits

...

1 Commits

Author SHA1 Message Date
odain-cbd
5202adb902 N°9717 - Bring unattended error feedbacks back (#943)
* Enhance unattended CLI to log fatal error just like setup wizardinstead of silent failure

* 💚 change unattended output in case of painless FATAL

* 💚 capture FATALs only

* Update setup/unattended-install/unattended-install.php

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-06-23 17:16:04 +02:00

View File

@@ -3,6 +3,21 @@
require_once(dirname(__FILE__, 3).'/approot.inc.php'); require_once(dirname(__FILE__, 3).'/approot.inc.php');
require_once(__DIR__.'/InstallationFileService.php'); require_once(__DIR__.'/InstallationFileService.php');
function fatalHandler()
{
$error = error_get_last();
if ($error) {
if ($error['type'] & (E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR)) {
// fatal error has occured
echo "PHP Fatal captured: {$error["message"]}";
SetupLog::Error("Fatal error during setup", null, $error);
exit(-1);
}
}
}
register_shutdown_function("fatalHandler");
function PrintUsageAndExit() function PrintUsageAndExit()
{ {
echo <<<EOF echo <<<EOF