Remove \Basic class from all other Class extensions

If not created Logger class will be auto created in \DB\IO
Recommended to run a CoreLibs\Debug\Logging([...]); and use this class
for all ACL\Login, Admin\Backend, DB\IO, Output\Form\Generate calls.
Last parameter after DB CONFIG is the log parameter

Session create has been moved to a new Create\Session class from the
\Basic class and MUST be started before using ACL\Login. Currently
ACL\Login will fallback and start it if no session is yet started.

See the Readme.md file for which classes use _SESSION data

In future the _SESSION settings should be moved to some wrapper class
for this so we can unit test sessions

Only Output\Form\Generate class call has the new changed with the second
parameter no longer beeing the table width setting but the class
setting.
But as this is a semi retired class and only used for edit_base this is
not 100% breaking.
All other classes can be used as is and have internal fallback to run as
before.
Deprecation messages will be added later.
This commit is contained in:
Clemens Schwaighofer
2022-01-18 10:51:13 +09:00
parent 1bd45d8a8a
commit ad39a5b21f
45 changed files with 991 additions and 284 deletions

View File

@@ -32,7 +32,17 @@ ob_end_flush();
use CoreLibs\Convert\Json;
use CoreLibs\Debug\Support as DgS;
$basic = new CoreLibs\Basic();
$log = new CoreLibs\Debug\Logging([
'log_folder' => BASE . LOG,
'file_id' => $LOG_FILE_ID,
// add file date
'print_file_date' => true,
// set debug and print flags
'debug_all' => $DEBUG_ALL ?? false,
'echo_all' => $ECHO_ALL ?? false,
'print_all' => $PRINT_ALL ?? false,
]);
$basic = new CoreLibs\Basic($log);
$json_class = 'CoreLibs\Convert\Json';
// define a list of from to color sets for conversion test
@@ -74,7 +84,7 @@ print "E-JSON ERROR: ".$basic->jsonGetLastError().": ".$basic->jsonGetLastError(
// print "S::JSON ERROR: " . Jason::jsonGetLastError() . ": " . Jason::jsonGetLastError(true) . "<br>";
// error message
print $basic->log->printErrorMsg();
print $log->printErrorMsg();
print "</body></html>";