_SESSION handling cleanup start

Move all session_id and check calls function calls that we have to Session class

In Login class use new false return for session set check
Be sure all session set variables are unset, do extra unset call and
destroy call on close session
Login class does not set GLOBALS anymore (DEBUG_ALL, DB_DEBUG)

Update Logging to check for DEBUG_ALL from SESSION and set DEBUG_ALL on
and PRINT_ALL on.
All logging setting vars are primary via options and only if not set
there fallback to SESSION/GLOBALS and then defaults

DB:IO code for debug flag check has been updated for primary check in
config, then session/globals

Debug update for logging tester for first step to remove Basic class
call.
NOTE: after basic php unit tests are written the clean up for no longer
using Basic class has to start.
Switch to logging class for logging only needs
This commit is contained in:
Clemens Schwaighofer
2022-02-24 10:31:17 +09:00
parent 8267bcd8b8
commit de1cdfdd40
6 changed files with 154 additions and 54 deletions

View File

@@ -390,7 +390,14 @@ class IO
$this->db_type = $db_config['db_type'] ?? '';
$this->db_ssl = !empty($db_config['db_ssl']) ? $db_config['db_ssl'] : 'allow';
// set debug, either via global var, or from config, else set to false
$this->dbSetDebug($GLOBALS['DB_DEBUG'] ?? $db_config['db_debug'] ?? false);
$this->dbSetDebug(
$db_config['db_debug'] ??
// should be handled from outside
$_SESSION['DB_DEBUG'] ??
// globals should be deprecated
$GLOBALS['DB_DEBUG'] ??
false
);
// set the target encoding to the DEFAULT_ENCODING if it is one of them: EUC, Shift_JIS, UTF-8
// @ the moment set only from outside
@@ -2040,10 +2047,13 @@ class IO
}
/**
* if the input is a single char 't' or 'f' it will return the boolean value instead
* @param string|bool $string 't' / 'f' or any string, or bool true/false
* @param boolean $rev do reverse (bool to string)
* @return bool|string correct php boolean true/false or postgresql 't'/'f'
* if the input is a single char 't' or 'f
* it will return the boolean value instead
* also converts smallint 1/0 to true false
* @param string|bool|int $string 't' / 'f' or any string, or bool true/false
* @param boolean $rev do reverse (bool to string)
* @return bool|string correct php boolean true/false
* or postgresql 't'/'f'
*/
public function dbBoolean($string, $rev = false)
{