- removed deprecated files
- updated exceptions.php
- updated 'core' framework
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 LFDB2 Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
*
* This program is free software: you can redistribute it and/or modify
* @license GNU GPL 3.0 or any newer version
*
* This program is free software: you can redistribute it and/or modify
// Init variable
$backTrace = '';
// Init variable
$backTrace = '';
+ // Generate exception code
+ $exceptionCode = ($exceptionInstance instanceof FrameworkException ? $exceptionInstance->getHexCode() : '0x' . bin2hex($exceptionInstance->getCode()));
+
// Get all call levels from backtrace
foreach ($exceptionInstance->getTrace() as $idx => $traceArray) {
// Init argument string
$argsString = '';
// Get all call levels from backtrace
foreach ($exceptionInstance->getTrace() as $idx => $traceArray) {
// Init argument string
$argsString = '';
- // Convert arguments type into human-readable
- foreach ($traceArray['args'] as $arg) {
- $argsString .= ', ' . gettype($arg);
+ // Arguments given?
+ if (isset($traceArray['args'])) {
+ // Convert arguments type into human-readable
+ foreach ($traceArray['args'] as $arg) {
+ $argsString .= ', ' . gettype($arg);
+ }
+ $argsString = substr($argsString, 2);
- $argsString = substr($argsString, 2);
// Set missing file/line
if (!isset($traceArray['file'])) $traceArray['file'] = 'unknown';
// Set missing file/line
if (!isset($traceArray['file'])) $traceArray['file'] = 'unknown';
--------------------------------------------------------------------------------\n",
trim(html_entity_decode(strip_tags(get_class($exceptionInstance)))),
trim(html_entity_decode(strip_tags($exceptionInstance->getMessage()))),
--------------------------------------------------------------------------------\n",
trim(html_entity_decode(strip_tags(get_class($exceptionInstance)))),
trim(html_entity_decode(strip_tags($exceptionInstance->getMessage()))),
- ($exceptionInstance instanceof FrameworkException ? $exceptionInstance->getHexCode() : '0x' . bin2hex($exceptionInstance->getCode())),
$exceptionInstance->getFile(),
$exceptionInstance->getLine(),
trim($backTrace)
$exceptionInstance->getFile(),
$exceptionInstance->getLine(),
trim($backTrace)
// Output the message
print($message);
// Output the message
print($message);
+
+ // Exit with code
+ exit(hexdec($exceptionCode));
} elseif (is_object($exceptionInstance)) {
// Output more details
printf('exceptionInstance=%s', print_r($exceptionInstance, true));
} elseif (is_object($exceptionInstance)) {
// Output more details
printf('exceptionInstance=%s', print_r($exceptionInstance, true));
} else {
/*
* Invalid exception instance detected! Do *only* throw exceptions that
* extends our own exception 'FrameworkException' to get such nice
* outputs like above.
*/
} else {
/*
* Invalid exception instance detected! Do *only* throw exceptions that
* extends our own exception 'FrameworkException' to get such nice
* outputs like above.
*/
- printf('exceptionInstance[]=%s is invalid! Please inform the core developer team.' . PHP_EOL, gettype($exceptionInstance));
+ printf('exceptionInstance[]=%s is invalid! Please inform the LFDB2 developer team.' . PHP_EOL, gettype($exceptionInstance));
+ exit(255);
-function lfdb2_error_handler ($errno, $errstr, $errfile, $errline, array $errcontext) {
+function lfdb2_error_handler (int $errno, string $errstr, string $errfile, int $errline, array $errcontext) {
- $message = sprintf('File: %s, Line: %s, Code: %s, Message: %s',
+ $message = sprintf('File: %s, Line: %d, Code: %d, Message: %s',
basename($errfile),
$errline,
$errno,
basename($errfile),
$errline,
$errno,
-function lfdb2_assert_handler (string $file, int $line, $code) {
+function lfdb2_assert_handler (string $file, int $line, int $code) {
$code = '<em>Unknown</em>';
}
$code = '<em>Unknown</em>';
}
// Init assert handling
assert_options(ASSERT_ACTIVE , true);
// Init assert handling
assert_options(ASSERT_ACTIVE , true);
-assert_options(ASSERT_WARNING , false);
+assert_options(ASSERT_WARNING , true);
assert_options(ASSERT_BAIL , true);
assert_options(ASSERT_QUIET_EVAL, false);
assert_options(ASSERT_CALLBACK , 'lfdb2_assert_handler');
assert_options(ASSERT_BAIL , true);
assert_options(ASSERT_QUIET_EVAL, false);
assert_options(ASSERT_CALLBACK , 'lfdb2_assert_handler');
-Subproject commit cef490aa082a79da16d3dd2b1951dd993c9eda08
+Subproject commit 6e12381ce34de3edb56d18830949362491ddb61a