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:
@@ -29,8 +29,18 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest';
|
||||
|
||||
// init login & backend class
|
||||
$login = new CoreLibs\ACL\Login(DB_CONFIG);
|
||||
$basic = new CoreLibs\Admin\Backend(DB_CONFIG);
|
||||
$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,
|
||||
]);
|
||||
$login = new CoreLibs\ACL\Login(DB_CONFIG, $log);
|
||||
$basic = new CoreLibs\Admin\Backend(DB_CONFIG, $log);
|
||||
$basic->dbInfo(true);
|
||||
ob_end_flush();
|
||||
|
||||
@@ -103,13 +113,13 @@ foreach (['debug', 'echo', 'print'] as $type) {
|
||||
print strtoupper($type) . ' OUT ALL: ' . $basic->log->getLogLevelAll($type) . '<br>';
|
||||
}
|
||||
|
||||
$basic->log->debug('SOME MARK', 'Some error output');
|
||||
$log->debug('SOME MARK', 'Some error output');
|
||||
|
||||
// INTERNAL SET
|
||||
print "EDIT ACCESS ID: " . $basic->edit_access_id . "<br>";
|
||||
if (is_object($login)) {
|
||||
// print "ACL: <br>".$basic->print_ar($login->acl)."<br>";
|
||||
$basic->log->debug('ACL', "ACL: " . \CoreLibs\Debug\Support::printAr($login->acl));
|
||||
$log->debug('ACL', "ACL: " . \CoreLibs\Debug\Support::printAr($login->acl));
|
||||
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
|
||||
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
|
||||
// $result = array_flip(
|
||||
@@ -140,7 +150,7 @@ print "SERVER HOST: " . $_SERVER['HTTP_HOST'] . "<br>";
|
||||
|
||||
// print error messages
|
||||
// print $login->log->printErrorMsg();
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user