From 513b115d5729d1001743baf12d8991cc385b20d9 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 30 May 2023 18:31:24 +0900 Subject: [PATCH] Composer update --- www/admin/class_test.admin.backend.php | 19 +--- www/admin/class_test.array.php | 19 +--- www/admin/class_test.autoloader.php | 5 - www/admin/class_test.byte.php | 19 +--- www/admin/class_test.check.colors.php | 19 +--- www/admin/class_test.config.direct.php | 19 +--- www/admin/class_test.config.link.php | 19 +--- www/admin/class_test.convert.colors.php | 19 +--- www/admin/class_test.create_email.php | 21 +---- www/admin/class_test.datetime.php | 19 +--- www/admin/class_test.db.dbReturn.php | 37 +++----- www/admin/class_test.db.php | 20 +--- www/admin/class_test.db.single.php | 20 +--- www/admin/class_test.debug.php | 52 ++++++++-- www/admin/class_test.email.php | 19 +--- www/admin/class_test.encoding.php | 22 +---- www/admin/class_test.encryption.php | 20 +--- www/admin/class_test.file.php | 19 +--- www/admin/class_test.hash.php | 19 +--- www/admin/class_test.html.php | 19 +--- www/admin/class_test.image.php | 21 +---- www/admin/class_test.json.php | 19 +--- www/admin/class_test.lang.php | 5 - www/admin/class_test.logging.php | 94 +++++++++++++++++++ www/admin/class_test.login.php | 19 +--- www/admin/class_test.math.php | 19 +--- www/admin/class_test.memoryusage.php | 19 +--- www/admin/class_test.mime.php | 18 +--- www/admin/class_test.output.form.php | 19 +--- www/admin/class_test.password.php | 19 +--- www/admin/class_test.phpv.php | 19 +--- www/admin/class_test.randomkey.php | 19 +--- www/admin/class_test.readenvfile.php | 14 +-- www/admin/class_test.runningtime.php | 19 +--- www/admin/class_test.session.php | 19 +--- www/admin/class_test.session.read.php | 19 +--- www/admin/class_test.smarty.php | 21 +---- www/admin/class_test.strings.php | 19 +--- www/admin/class_test.system.php | 19 +--- www/admin/class_test.token.php | 19 +--- www/admin/class_test.uids.php | 19 +--- www/admin/class_test.varistype.php | 19 +--- www/composer.lock | 2 +- www/vendor/composer/installed.json | 2 +- www/vendor/composer/installed.php | 2 +- .../publish/last.published | 2 +- .../Security/CoreLibsSecurityPasswordTest.php | 2 +- 47 files changed, 277 insertions(+), 635 deletions(-) create mode 100644 www/admin/class_test.logging.php diff --git a/www/admin/class_test.admin.backend.php b/www/admin/class_test.admin.backend.php index a37fe5fe..1786b8b8 100644 --- a/www/admin/class_test.admin.backend.php +++ b/www/admin/class_test.admin.backend.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -27,15 +22,10 @@ $SET_SESSION_NAME = EDIT_SESSION_NAME; ob_end_flush(); $session = new CoreLibs\Create\Session($SET_SESSION_NAME); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); // db config with logger $db = new CoreLibs\DB\IO(DB_CONFIG, $log); @@ -72,9 +62,6 @@ $backend->adbMsg('info', 'Message: %1$d', [1]); print "Messaes: " . Support::printAr($backend->messages) . "
"; print "ADBPRINTDATETIME:
" . $backend->adbPrintDateTime(2021, 6, 21, 6, 38, '_test') . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.array.php b/www/admin/class_test.array.php index d6f31290..eef96c21 100644 --- a/www/admin/class_test.array.php +++ b/www/admin/class_test.array.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -27,15 +22,10 @@ use CoreLibs\Combined\ArrayHandler; use CoreLibs\Debug\Support as DgS; use CoreLibs\Convert\SetVarType; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); // $_array = new CoreLibs\Combined\ArrayHandler(); // $array_class = 'CoreLibs\Combination\ArrayHandler'; @@ -246,9 +236,6 @@ $flag = false; $output = \CoreLibs\Combined\ArrayHandler::genAssocArray($db_array, $key, $value, $flag); print "OUTPUT: " . \CoreLibs\Debug\Support::printAr($output) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.autoloader.php b/www/admin/class_test.autoloader.php index 97835ec1..284a7861 100644 --- a/www/admin/class_test.autoloader.php +++ b/www/admin/class_test.autoloader.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); diff --git a/www/admin/class_test.byte.php b/www/admin/class_test.byte.php index 1e5e0340..669070cb 100644 --- a/www/admin/class_test.byte.php +++ b/www/admin/class_test.byte.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -25,15 +20,10 @@ ob_end_flush(); use CoreLibs\Convert\Byte; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $byte_class = 'CoreLibs\Convert\Byte'; @@ -104,9 +94,6 @@ foreach ($bytes as $byte) { print ""; } -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.check.colors.php b/www/admin/class_test.check.colors.php index 69b1195a..130f6af2 100644 --- a/www/admin/class_test.check.colors.php +++ b/www/admin/class_test.check.colors.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -26,15 +21,10 @@ ob_end_flush(); use CoreLibs\Check\Colors; // use CoreLibs\Debug\Support as DgS; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $PAGE_NAME = 'TEST CLASS: CHECK COLORS'; @@ -113,9 +103,6 @@ try { print "ERROR: " . $e->getCode() . ": " . $e->getMessage() . "
"; } -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.config.direct.php b/www/admin/class_test.config.direct.php index 9653d4df..95d85624 100644 --- a/www/admin/class_test.config.direct.php +++ b/www/admin/class_test.config.direct.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -23,15 +18,10 @@ require '../configs/config.php'; $LOG_FILE_ID = 'classTest-config-direct'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $PAGE_NAME = 'TEST CLASS: CONFIG DIRECT'; @@ -49,9 +39,6 @@ echo "Config path prefix: " . ($CONFIG_PATH_PREFIX ?? '') . "
"; print "DB Name: " . DB_CONFIG_NAME . "
"; print "DB Config: " . \CoreLibs\Debug\Support::printAr(DB_CONFIG) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.config.link.php b/www/admin/class_test.config.link.php index a1efad74..cfe812fc 100644 --- a/www/admin/class_test.config.link.php +++ b/www/admin/class_test.config.link.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -23,15 +18,10 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-config-link'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $PAGE_NAME = 'TEST CLASS: CONFIG LINK'; @@ -49,9 +39,6 @@ echo "Config path prefix: " . ($CONFIG_PATH_PREFIX ?? '') . "
"; print "DB Name: " . DB_CONFIG_NAME . "
"; print "DB Config: " . \CoreLibs\Debug\Support::printAr(DB_CONFIG) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.convert.colors.php b/www/admin/class_test.convert.colors.php index e1b88241..223d152e 100644 --- a/www/admin/class_test.convert.colors.php +++ b/www/admin/class_test.convert.colors.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -27,15 +22,10 @@ use CoreLibs\Convert\Colors; use CoreLibs\Debug\Support as DgS; use CoreLibs\Convert\SetVarType; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $color_class = 'CoreLibs\Convert\Colors'; @@ -104,9 +94,6 @@ print "RANDOM hsl->rgb:
" . DgS::printAr(SetVarType::setArray(Colors::hsl2r
 
 // TODO: run compare check input must match output
 
-// error message
-print $log->printErrorMsg();
-
 print "";
 
 // __END__
diff --git a/www/admin/class_test.create_email.php b/www/admin/class_test.create_email.php
index 9ea99671..085cd391 100644
--- a/www/admin/class_test.create_email.php
+++ b/www/admin/class_test.create_email.php
@@ -6,13 +6,6 @@
 
 declare(strict_types=1);
 
-// will be overwritten in config.master.php depending on location
-$DEBUG_ALL_OVERRIDE = true; // set to 1 to debug on live/remote server locations
-$DEBUG_ALL = true;
-$PRINT_ALL = true;
-$ECHO_ALL = true;
-$DB_DEBUG = true;
-
 error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
 
 ob_start();
@@ -30,15 +23,10 @@ $ECHO_ALL = true;
 use CoreLibs\Create\Email;
 use CoreLibs\Convert\Html;
 
-$log = new CoreLibs\Debug\Logging([
+$log = new CoreLibs\Logging\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,
-	'echo_all' => $ECHO_ALL,
-	'print_all' => $PRINT_ALL,
+	'log_file_id' => $LOG_FILE_ID,
+	'log_per_date' => true,
 ]);
 
 // define a list of from to color sets for conversion test
@@ -134,9 +122,6 @@ $status = Email::sendEmail(
 );
 print "SENDING D: " . $status . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.datetime.php b/www/admin/class_test.datetime.php index a723ca52..56c8854d 100644 --- a/www/admin/class_test.datetime.php +++ b/www/admin/class_test.datetime.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -26,15 +21,10 @@ ob_end_flush(); use CoreLibs\Combined\DateTime; use CoreLibs\Debug\Support as DgS; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $datetime_class = 'CoreLibs\Combined\DateTime'; @@ -153,9 +143,6 @@ print "DATE-dow[$date];invalid: " . DateTime::setWeekdayNameFromDate($date) . "< print "DATE-dow[$date],long;invalid: " . DateTime::setWeekdayNameFromDate($date, true) . "
"; print "DOW-date[$date];invalid: " . DateTime::setWeekdayNumberFromDate($date) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.db.dbReturn.php b/www/admin/class_test.db.dbReturn.php index 8ca37fdb..c9d5a219 100644 --- a/www/admin/class_test.db.dbReturn.php +++ b/www/admin/class_test.db.dbReturn.php @@ -15,8 +15,6 @@ ob_start(); define('USE_DATABASE', true); // sample config require 'config.php'; -// override ECHO ALL FALSE -$ECHO_ALL = true; // define log file id $LOG_FILE_ID = 'classTest-db'; ob_end_flush(); @@ -25,15 +23,10 @@ use CoreLibs\Debug\Support; use CoreLibs\Debug\RunningTime; use CoreLibs\Convert\SetVarType; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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 ?? true, - 'echo_all' => $ECHO_ALL, - 'print_all' => $PRINT_ALL ?? true, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); // db connection and attach logger $db = new CoreLibs\DB\IO(DB_CONFIG, $log); @@ -47,8 +40,8 @@ print '
Class Test Master
'; print '
Class Test DB
'; print '

' . $PAGE_NAME . '

'; -print "LOGFILE NAME: " . $db->log->getSetting('log_file_name') . "
"; -print "LOGFILE ID: " . $db->log->getSetting('log_file_id') . "
"; +print "LOGFILE NAME: " . $db->log->getLogFile() . "
"; +print "LOGFILE ID: " . $db->log->getLogFileId() . "
"; print "DBINFO: " . $db->dbInfo() . "
"; // DB client encoding @@ -74,9 +67,9 @@ for ($i = 1; $i <= 6; $i++) { $res = $db->dbReturn($q_db_ret); print $i . ") " . $cache_flag . ": " . "res: " . (is_bool($res) ? - "Bool: " . $db->log->prBl($res) : + "Bool: " . Support::prBl($res) : (is_array($res) ? - "Array: " . $db->log->prBl(is_array($res)) : '{-}') + "Array: " . Support::prBl(is_array($res)) : '{-}') ) . ", " . "cursor_ext:
" . Support::printAr(
 			SetVarType::setArray($db->dbGetCursorExt($q_db_ret))
@@ -93,9 +86,9 @@ for ($i = 1; $i <= 6; $i++) {
 	$res = $db->dbReturn($q_db_ret, $db::USE_CACHE);
 	print $i . ") " . $cache_flag . ": "
 		. "res: " . (is_bool($res) ?
-			"Bool: " . $db->log->prBl($res) :
+			"Bool: " . Support::prBl($res) :
 			(is_array($res) ?
-				"Array: " . $db->log->prBl(is_array($res)) : '{-}')
+				"Array: " . Support::prBl(is_array($res)) : '{-}')
 		) . ", "
 		. "cursor_ext: 
" . Support::printAr(
 			SetVarType::setArray($db->dbGetCursorExt($q_db_ret))
@@ -112,9 +105,9 @@ for ($i = 1; $i <= 6; $i++) {
 	$res = $db->dbReturn($q_db_ret, $db::READ_NEW);
 	print $i . ") " . $cache_flag . ": "
 		. "res: " . (is_bool($res) ?
-			"Bool: " . $db->log->prBl($res) :
+			"Bool: " . Support::prBl($res) :
 			(is_array($res) ?
-				"Array: " . $db->log->prBl(is_array($res)) : '{-}')
+				"Array: " . Support::prBl(is_array($res)) : '{-}')
 		) . ", "
 		. "cursor_ext: 
" . Support::printAr(
 			SetVarType::setArray($db->dbGetCursorExt($q_db_ret))
@@ -131,9 +124,9 @@ for ($i = 1; $i <= 6; $i++) {
 	$res = $db->dbReturn($q_db_ret, $db::CLEAR_CACHE);
 	print $i . ") " . $cache_flag . ": "
 		. "res: " . (is_bool($res) ?
-			"Bool: " . $db->log->prBl($res) :
+			"Bool: " . Support::prBl($res) :
 			(is_array($res) ?
-				"Array: " . $db->log->prBl(is_array($res)) : '{-}')
+				"Array: " . Support::prBl(is_array($res)) : '{-}')
 		) . ", "
 		. "cursor_ext: 
" . Support::printAr(
 			SetVarType::setArray($db->dbGetCursorExt($q_db_ret))
@@ -150,9 +143,9 @@ for ($i = 1; $i <= 6; $i++) {
 	$res = $db->dbReturn($q_db_ret, $db::NO_CACHE);
 	print $i . ") " . $cache_flag . ": "
 		. "res: " . (is_bool($res) ?
-			"Bool: " . $db->log->prBl($res) :
+			"Bool: " . Support::prBl($res) :
 			(is_array($res) ?
-				"Array: " . $db->log->prBl(is_array($res)) : '{-}')
+				"Array: " . Support::prBl(is_array($res)) : '{-}')
 		) . ", "
 		. "cursor_ext: 
" . Support::printAr(
 			SetVarType::setArray($db->dbGetCursorExt($q_db_ret))
diff --git a/www/admin/class_test.db.php b/www/admin/class_test.db.php
index d95689ac..adb6e8b9 100644
--- a/www/admin/class_test.db.php
+++ b/www/admin/class_test.db.php
@@ -15,8 +15,6 @@ ob_start();
 define('USE_DATABASE', true);
 // sample config
 require 'config.php';
-// override ECHO ALL FALSE
-$ECHO_ALL = true;
 // define log file id
 $LOG_FILE_ID = 'classTest-db';
 ob_end_flush();
@@ -26,15 +24,10 @@ use CoreLibs\DB\IO as DbIo;
 use CoreLibs\Debug\Support;
 use CoreLibs\Convert\SetVarType;
 
-$log = new CoreLibs\Debug\Logging([
+$log = new CoreLibs\Logging\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 ?? true,
-	'echo_all' => $ECHO_ALL,
-	'print_all' => $PRINT_ALL ?? true,
+	'log_file_id' => $LOG_FILE_ID,
+	'log_per_date' => true,
 ]);
 // db connection and attach logger
 $db = new CoreLibs\DB\IO(DB_CONFIG, $log);
@@ -48,8 +41,8 @@ print '';
 print '';
 print '

' . $PAGE_NAME . '

'; -print "LOGFILE NAME: " . $db->log->getSetting('log_file_name') . "
"; -print "LOGFILE ID: " . $db->log->getSetting('log_file_id') . "
"; +print "LOGFILE NAME: " . $db->log->getLogFile() . "
"; +print "LOGFILE ID: " . $db->log->getLogFileId() . "
"; print "DBINFO: " . $db->dbInfo() . "
"; echo "DB_CONFIG_SET constant:
" . print_r(DB_CONFIG, true) . "

"; @@ -790,9 +783,6 @@ print "RES: " . DgS::printAr(SetVarType::setArray($res)) . "
"; print "ISSET: " . isset($res['null_varchar']) . "
"; print "EMPTY: " . empty($res['null_varchar']) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.db.single.php b/www/admin/class_test.db.single.php index 778e2730..e288cd7a 100644 --- a/www/admin/class_test.db.single.php +++ b/www/admin/class_test.db.single.php @@ -15,23 +15,16 @@ ob_start(); define('USE_DATABASE', true); // sample config require 'config.php'; -// override ECHO ALL FALSE -$ECHO_ALL = true; // define log file id $LOG_FILE_ID = 'classTest-db-single'; ob_end_flush(); use CoreLibs\Debug\Support; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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 ?? true, - 'echo_all' => $ECHO_ALL, - 'print_all' => $PRINT_ALL ?? true, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); // db connection and attach logger $db = new CoreLibs\DB\IO(DB_CONFIG, $log); @@ -45,8 +38,8 @@ print ''; print ''; print '

' . $PAGE_NAME . '

'; -print "LOGFILE NAME: " . $db->log->getSetting('log_file_name') . "
"; -print "LOGFILE ID: " . $db->log->getSetting('log_file_id') . "
"; +print "LOGFILE NAME: " . $db->log->getLogFile() . "
"; +print "LOGFILE ID: " . $db->log->getLogFileId() . "
"; print "DBINFO: " . $db->dbInfo() . "
"; // DB client encoding print "DB client encoding: " . $db->dbGetEncoding() . "
"; @@ -94,9 +87,6 @@ echo "EOM STRING WITH MORE THAN 10 PARAMETERS: " . "ERROR: " . $db->dbGetLastError(true) . "
"; echo "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.debug.php b/www/admin/class_test.debug.php index 2ab7dd5b..09325d39 100644 --- a/www/admin/class_test.debug.php +++ b/www/admin/class_test.debug.php @@ -7,7 +7,6 @@ declare(strict_types=1); // all the settings are overruled by config -$DEBUG_ALL_OVERRIDE = true; // set to 1 to debug on live/remote server locations $DEBUG_ALL = true; $PRINT_ALL = false; $ECHO_ALL = true; @@ -32,7 +31,7 @@ $ECHO_ALL = true; use CoreLibs\Debug\Support as DebugSupport; use CoreLibs\Debug\FileWriter; -$debug = new CoreLibs\Debug\Logging([ +$debug = new CoreLibs\Debug\LoggingLegacy([ 'log_folder' => BASE . LOG, 'file_id' => $LOG_FILE_ID, 'debug_all' => $DEBUG_ALL, @@ -40,7 +39,7 @@ $debug = new CoreLibs\Debug\Logging([ 'echo_all' => $ECHO_ALL, ]); $debug_support_class = 'CoreLibs\Debug\Support'; -$debug_logging_class = 'CoreLibs\Debug\Logging'; +$debug_logging_class = 'CoreLibs\Debug\LoggingLegacy'; $PAGE_NAME = 'TEST CLASS: DEBUG'; print ""; @@ -72,16 +71,43 @@ function test2(): array print "S::GETCALLERMETHOD: " . DebugSupport::getCallerMethod(0) . "
"; print "S::GETCALLERMETHOD: " . test() . "
"; print "S::GETCALLERMETHODLIST:
" . print_r(test2(), true) . "

"; +// printAr print "S::PRINTAR: " . DebugSupport::printAr(['Foo', 'Bar']) . "
"; print "V-S::PRINTAR: " . $debug_support_class::printAr(['Foo', 'Bar']) . "
"; +// printBool print "S::PRINTBOOL(default): " . DebugSupport::printBool(true) . "
"; print "S::PRINTBOOL(name): " . DebugSupport::printBool(true, 'Name') . "
"; print "S::PRINTBOOL(name, ok): " . DebugSupport::printBool(true, 'Name', 'ok') . "
"; print "S::PRINTBOOL(name, ok, not): " . DebugSupport::printBool(false, 'Name', 'ok', 'not') . "
"; +// debugString +print "S::DEBUSTRING(s): " . DebugSupport::debugString('SET') . "
"; print "S::DEBUSTRING(s): " . DebugSupport::debugString('SET') . "
"; print "S::DEBUSTRING(s>): " . DebugSupport::debugString('') . "
"; print "S::DEBUSTRING(''): " . DebugSupport::debugString('') . "
"; print "S::DEBUSTRING(,s): " . DebugSupport::debugString(null, '{-}') . "
"; +// dumpVar +print "S::DUMPVAR(s): " . DebugSupport::dumpVar('SET') . "
"; +print "S::DUMPVAR(s,true): " . DebugSupport::dumpVar('SET', true) . "
"; +print "S::DUMPVAR(s>): " . DebugSupport::dumpVar('') . "
"; +print "S::DUMPVAR(s>,true): " . DebugSupport::dumpVar('', true) . "
"; +print "S::DUMPVAR(''): " . DebugSupport::dumpVar('') . "
"; +print "S::DUMPVAR(,s): " . DebugSupport::dumpVar(null) . "
"; +print "S::DUMPVAR([a,b]): " . DebugSupport::dumpVar(['a', 'b']) . "
"; +print "S::DUMPVAR([a,b],true): " . DebugSupport::dumpVar(['a', 'b'], true) . "
"; +print "S::DUMPVAR([MIXED]): " . DebugSupport::dumpVar(<<block +and > and < +EOM) . "
"; +// exportVar +// print "S::EXPORTVAR(s): " . DebugSupport::exportVar('SET') . "
"; +// print "S::EXPORTVAR(s>): " . DebugSupport::exportVar('') . "
"; +// print "S::EXPORTVAR(''): " . DebugSupport::exportVar('') . "
"; +// print "S::EXPORTVAR(,s): " . DebugSupport::exportVar(null) . "
"; +// print "S::EXPORTVAR([a,b]): " . DebugSupport::exportVar(['a', 'b']) . "
"; +// print "S::EXPORTVAR([a,b],true): " . DebugSupport::exportVar(['a', 'b']) . "
"; // get test print "LOG FOLDER: " . $debug->getSetting('log_folder') . "
"; @@ -95,7 +121,7 @@ print "C->PRINTERRORMSG:
" . $debug->printErrorMsg() . "
"; echo "OPTIONS DEBUG CALL
"; // new log type with options -$new_log = new CoreLibs\Debug\Logging([ +$new_log = new CoreLibs\Debug\LoggingLegacy([ 'log_folder' => '../log/', 'file_id' => 'DebugTestNewLogger', // add file date @@ -125,11 +151,14 @@ echo "CLASS DEBUG CALL
"; // @codingStandardsIgnoreLine class TestL { - /** @var \CoreLibs\Debug\Logging */ + /** @var \CoreLibs\Debug\LoggingLegacy */ public $log; public function __construct() { - $this->log = new CoreLibs\Debug\Logging(); + $this->log = new CoreLibs\Debug\LoggingLegacy([ + 'log_folder' => '../log/', + 'file_id' => 'DebugTestTestLLogger', + ]); } /** * Undocumented function @@ -183,9 +212,9 @@ print "CLASS EXTEND: PRINTERRORMSG:
" . $tr->log->printErrorMsg() . "
"; // @codingStandardsIgnoreLine class AttachOutside { - /** @var \CoreLibs\Debug\Logging */ + /** @var \CoreLibs\Debug\LoggingLegacy */ public $log; - public function __construct(\CoreLibs\Debug\Logging $logger_class) + public function __construct(\CoreLibs\Debug\LoggingLegacy $logger_class) { $this->log = $logger_class; } @@ -206,6 +235,7 @@ print "AO-CLASS: DEBUG: " . $ao->test() . "
"; print "GETCALLERCLASS(NON CLASS): " . \CoreLibs\Debug\Support::getCallerClass() . "
"; // fdebug +print "S::FSETFILENAME: " . FileWriter::fsetFolder(BASE . LOG) . "
"; print "S::FSETFILENAME: " . FileWriter::fsetFilename('class_test_debug_file.log') . "
"; print "S::FDEBUG: " . FileWriter::fdebug('CLASS TEST DEBUG FILE: ' . date('Y-m-d H:i:s')) . "
"; @@ -218,6 +248,12 @@ $debug->setLogPer('level', false); $ar = ['A', 1, ['B' => 'D']]; $debug->debug('ARRAY', 'Array: ' . $debug->prAr($ar)); $debug->debug('BOOL', 'True: ' . $debug->prBl(true) . ', False: ' . $debug->prBl(false)); +$debug->debug('MIXED', 'ANYTHING: ' . DebugSupport::dumpVar([ + 'foo' => 1, + 'bar' => null, + 'self' => [1, 2, 3], + 'other' => false +])); // error message // future DEPRECATED diff --git a/www/admin/class_test.email.php b/www/admin/class_test.email.php index 40d5c964..3c258ffb 100644 --- a/www/admin/class_test.email.php +++ b/www/admin/class_test.email.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -26,15 +21,10 @@ ob_end_flush(); use CoreLibs\Check\Email; use CoreLibs\Debug\Support as DgS; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $PAGE_NAME = 'TEST CLASS: HTML/ELEMENTS'; @@ -78,9 +68,6 @@ foreach ($email as $s_email) { print "S::CHECKEMAILFULL(true): " . $s_email . ": " . Dgs::printAr(Email::checkEmailFull($s_email, true)) . "
"; } -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.encoding.php b/www/admin/class_test.encoding.php index 56193bbb..d481597b 100644 --- a/www/admin/class_test.encoding.php +++ b/www/admin/class_test.encoding.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -26,16 +21,12 @@ ob_end_flush(); use CoreLibs\Convert\Encoding as ConEnc; use CoreLibs\Check\Encoding as ChkEnc; use CoreLibs\Convert\MimeEncode; +use CoreLibs\Debug\Support; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); // class type $_chk_enc = new CoreLibs\Check\Encoding(); @@ -100,10 +91,7 @@ foreach ($enc_strings as $_string) { // static use $_string = $enc_strings[1]; $string = $chk_enc::checkConvertEncoding($_string, 'UTF-8', 'ISO-2022-JP-MS'); -print "S::ENC CHECK: $_string: " . ($string === false ? '-OK-' : $log->prAr($string)) . "
"; - -// error message -print $log->printErrorMsg(); +print "S::ENC CHECK: $_string: " . ($string === false ? '-OK-' : Support::printAr($string)) . "
"; print ""; diff --git a/www/admin/class_test.encryption.php b/www/admin/class_test.encryption.php index 75185cf4..c03e5515 100644 --- a/www/admin/class_test.encryption.php +++ b/www/admin/class_test.encryption.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -26,18 +21,12 @@ ob_end_flush(); use CoreLibs\Security\SymmetricEncryption; use CoreLibs\Security\CreateKey; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); - // define a list of from to color sets for conversion test $PAGE_NAME = 'TEST CLASS: ENCRYPTION'; @@ -103,9 +92,6 @@ try { print "Error: " . $e->getMessage() . "
"; } -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.file.php b/www/admin/class_test.file.php index fa002b09..23ff1422 100644 --- a/www/admin/class_test.file.php +++ b/www/admin/class_test.file.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -25,15 +20,10 @@ ob_end_flush(); use CoreLibs\Check\File; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $PAGE_NAME = 'TEST CLASS: FILE'; @@ -48,9 +38,6 @@ print "GETFILENAMEENDING: $file: " . File::getFilenameEnding($file) . "
"; $file = getcwd() . DIRECTORY_SEPARATOR . 'class_test.file.php'; print "GETLINESFROMFILE: $file: " . File::getLinesFromFile($file) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.hash.php b/www/admin/class_test.hash.php index 78e47aa9..0c2d6aeb 100644 --- a/www/admin/class_test.hash.php +++ b/www/admin/class_test.hash.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -25,15 +20,10 @@ ob_end_flush(); use CoreLibs\Create\Hash; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $hash_class = 'CoreLibs\Create\Hash'; @@ -67,9 +57,6 @@ print "HASH LONG: " . $to_crc . ": " . Hash::__hashLong($to_crc) . "
"; // print "UNIQU ID SHORT : " . Hash::__uniqId() . "
"; // print "UNIQU ID LONG : " . Hash::__uniqIdLong() . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.html.php b/www/admin/class_test.html.php index 368498f9..21bf9c1d 100644 --- a/www/admin/class_test.html.php +++ b/www/admin/class_test.html.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -26,15 +21,10 @@ ob_end_flush(); use CoreLibs\Convert\Html; use CoreLibs\Output\Form\Elements; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $_html = new CoreLibs\Convert\Html(); $_elements = new CoreLibs\Output\Form\Elements(); @@ -103,9 +93,6 @@ is sucky'; print "LB remove: " . \CoreLibs\Convert\Html::removeLB($text) . "
"; print "LB remove: " . \CoreLibs\Convert\Html::removeLB($text, '##BR##') . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.image.php b/www/admin/class_test.image.php index 43ca790d..a773a5f5 100644 --- a/www/admin/class_test.image.php +++ b/www/admin/class_test.image.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -25,15 +20,10 @@ ob_end_flush(); use CoreLibs\Output\Image; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $_image = new CoreLibs\Output\Image(); $image_class = 'CoreLibs\Output\Image'; @@ -95,7 +85,7 @@ foreach ($images as $image) { $image = BASE . LAYOUT . CONTENT_PATH . IMAGES . $image; list ($height, $width, $img_type) = \CoreLibs\Convert\SetVarType::setArray(getimagesize($image)); echo "
IMAGE INFO: " . $height . "x" . $width . ", TYPE: " - . $log->prAr($img_type) . " [" . $finfo->file($image) . "]
"; + . \CoreLibs\Debug\Support::printArray($img_type) . " [" . $finfo->file($image) . "]"; // rotate image first Image::correctImageOrientation($image); // thumbnail tests @@ -119,9 +109,6 @@ foreach ($images as $image) { echo "
"; } -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.json.php b/www/admin/class_test.json.php index 6b6f46a3..9816abde 100644 --- a/www/admin/class_test.json.php +++ b/www/admin/class_test.json.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -26,15 +21,10 @@ ob_end_flush(); use CoreLibs\Convert\Json; use CoreLibs\Debug\Support as DgS; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $json_class = 'CoreLibs\Convert\Json'; @@ -73,9 +63,6 @@ print "J/S::E-JSON ERROR: " . $json_class::jsonGetLastError() . ": " . $json_cla // print "S::JSON: $json: " . DgS::printAr($output) . "
"; // print "S::JSON ERROR: " . Jason::jsonGetLastError() . ": " . Jason::jsonGetLastError(true) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.lang.php b/www/admin/class_test.lang.php index 622df97d..989bdd02 100644 --- a/www/admin/class_test.lang.php +++ b/www/admin/class_test.lang.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); diff --git a/www/admin/class_test.logging.php b/www/admin/class_test.logging.php new file mode 100644 index 00000000..87f25ac9 --- /dev/null +++ b/www/admin/class_test.logging.php @@ -0,0 +1,94 @@ + BASE . LOG, + 'log_file_id' => $LOG_FILE_ID, + 'log_level' => Level::Debug, + 'log_per_date' => true, +]); + +$PAGE_NAME = 'TEST CLASS: DEBUG LOGGING'; +print ""; +print "" . $PAGE_NAME . ""; +print ""; +print ''; +print '

' . $PAGE_NAME . '

'; + +$log->logger2Debug(); + +print "Level 250: " . Level::fromValue(250)->getName() . "
"; +print "Flag: per_run (from int): " . Flag::fromValue(2)->getName() . "
"; +print "Flag: per_run getName(): " . Flag::per_class->getName() . "
"; +print "Flag: per_run ->name: " . Flag::per_class->name . "
"; +print "Flag: per_run ->value: " . Flag::per_class->value . "
"; + +print "DUMP: " . $log->dV(['something' => 'error']) . "
"; + +$log->debug('LEGACY', 'Some legacy shit here'); +$log->debug('ARRAY', 'Dump some data: ' . $log->dV(['something' => 'error'])); +$log->debug('MIXED', 'Dump mixed: ' . $log->dV(<<block +and > and < +EOM)); +$log->info('Info message', ['info' => 'log']); +$log->error('Cannot process data', ['error' => 'log']); + +print "Log File: " . $log->getLogFile() . "
"; + +// init empty +unset($LOG_FILE_ID); +$ll = new CoreLibs\Logging\Logging([ + 'log_folder' => BASE . LOG, +]); +print "LFI: " . $ll->getLogFileId() . "
"; +try { + $ll->setLoggingLevel('Invalid'); +} catch (\Psr\Log\InvalidArgumentException $e) { + print "Invalid option: " . $e->getMessage() . "
"; +} +/* $ll = new CoreLibs\Logging\Logging([ + 'log_folder' => BASE . LOG, + 'log_file_id' => 'a', + 'log_file_id' => 'a', +]); */ + +print '
' + . '
' + // . '
'
+	. nl2br(htmlentities(file_get_contents($log->getLogFolder() . $log->getLogFile()) ?: ''))
+	// . '
' + . '
'; + +print ""; + +// __END__ diff --git a/www/admin/class_test.login.php b/www/admin/class_test.login.php index 6525561d..4da78948 100644 --- a/www/admin/class_test.login.php +++ b/www/admin/class_test.login.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -24,15 +19,10 @@ $LOG_FILE_ID = 'classTest-login'; $SET_SESSION_NAME = EDIT_SESSION_NAME; // init login & backend class $session = new CoreLibs\Create\Session($SET_SESSION_NAME); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $db = new CoreLibs\DB\IO(DB_CONFIG, $log); $login = new CoreLibs\ACL\Login( @@ -68,7 +58,4 @@ echo "ACL: " . \CoreLibs\Debug\Support::printAr($login->loginGetAcl()) . "
"; echo "ACL (MIN): " . \CoreLibs\Debug\Support::printAr($login->loginGetAcl()['min'] ?? []) . "
"; echo "LOCALE: " . \CoreLibs\Debug\Support::printAr($login->loginGetLocale()) . "
"; -// error message -print $log->printErrorMsg(); - print ""; diff --git a/www/admin/class_test.math.php b/www/admin/class_test.math.php index 7175c596..452af015 100644 --- a/www/admin/class_test.math.php +++ b/www/admin/class_test.math.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -23,15 +18,10 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-math'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $_math = new CoreLibs\Convert\Math(); $math_class = 'CoreLibs\Convert\Math'; @@ -57,9 +47,6 @@ print "S-INITNUMERIC: " . $math_class::initNumeric(123.456) . "
"; print "S-INITNUMERIC: " . $math_class::initNumeric('123') . "
"; print "S-INITNUMERIC: " . $math_class::initNumeric('123.456') . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.memoryusage.php b/www/admin/class_test.memoryusage.php index f178fa11..3c956ee0 100644 --- a/www/admin/class_test.memoryusage.php +++ b/www/admin/class_test.memoryusage.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -26,15 +21,10 @@ ob_end_flush(); use CoreLibs\Debug\MemoryUsage; use CoreLibs\Debug\Support; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $PAGE_NAME = 'TEST CLASS: MEMORY USAGE'; @@ -81,9 +71,6 @@ print "Memory usage 4 array: " . Support::printAr($data) . "
"; print "Memory usage 4 string: " . MemoryUsage::printMemoryUsage($data) . "
"; print "Memory usage 4 string raw: " . MemoryUsage::printMemoryUsage($data, true) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.mime.php b/www/admin/class_test.mime.php index 798ddca7..079728b4 100644 --- a/www/admin/class_test.mime.php +++ b/www/admin/class_test.mime.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -23,15 +18,10 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-mime'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $_mime = new CoreLibs\Convert\MimeAppName(); @@ -60,8 +50,6 @@ print "S::App for mime $mime: " . \CoreLibs\Convert\MimeAppName::mimeGetAppName( $mime = 'application/vnd.ms-excel'; print "S::App for mime $mime: " . \CoreLibs\Convert\MimeAppName::mimeGetAppName($mime) . "
"; -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.output.form.php b/www/admin/class_test.output.form.php index 0a6d5c9d..44d9f8be 100644 --- a/www/admin/class_test.output.form.php +++ b/www/admin/class_test.output.form.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -55,15 +50,10 @@ $table_arrays[\CoreLibs\Get\System::getPageName(1)] = [ ] ]; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $l10n = new CoreLibs\Language\L10n( SITE_LOCALE, @@ -93,9 +83,6 @@ print "MOBILE PHONE: " . $form->mobile_phone . "
"; // sets table array to include print "MY PAGE NAME: " . $form->my_page_name . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.password.php b/www/admin/class_test.password.php index 3ca8e668..1211ed1b 100644 --- a/www/admin/class_test.password.php +++ b/www/admin/class_test.password.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -25,15 +20,10 @@ ob_end_flush(); use CoreLibs\Security\Password as PwdChk; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $_password = new CoreLibs\Security\Password(); $password_class = 'CoreLibs\Security\Password'; @@ -61,9 +51,6 @@ print "PASSWORD REHASH: " . (string)$password_class::passwordRehashCheck($enc_pa // direct static print "S::PASSWORD VERFIY: " . (string)PwdChk::passwordVerify($password, $enc_password) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.phpv.php b/www/admin/class_test.phpv.php index 20014b61..9098325f 100644 --- a/www/admin/class_test.phpv.php +++ b/www/admin/class_test.phpv.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -25,15 +20,10 @@ ob_end_flush(); use CoreLibs\Check\PhpVersion; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $_phpv = new CoreLibs\Check\PhpVersion(); $phpv_class = 'CoreLibs\Check\PhpVersion'; @@ -71,9 +61,6 @@ print "U-S::MIN: $min_version: " . (string)PhpVersion::checkPHPVersion($min_vers print "PHP_VERSION_ID: " . PHP_VERSION_ID . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.randomkey.php b/www/admin/class_test.randomkey.php index 5193374d..b60b6c96 100644 --- a/www/admin/class_test.randomkey.php +++ b/www/admin/class_test.randomkey.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -25,15 +20,10 @@ ob_end_flush(); use CoreLibs\Create\RandomKey; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $array_class = 'CoreLibs\Create\RandomKey'; @@ -56,9 +46,6 @@ print "S::RANDOMKEYGEN($key_lenght_long): " . RandomKey::randomKeyGen($key_lengh $_array = new CoreLibs\Create\RandomKey(); print "C->RANDOMKEYGEN(auto): " . $_array->randomKeyGen() . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.readenvfile.php b/www/admin/class_test.readenvfile.php index 408576b1..28d706c7 100644 --- a/www/admin/class_test.readenvfile.php +++ b/www/admin/class_test.readenvfile.php @@ -18,15 +18,10 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-readEnvFile'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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 ?? true, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL ?? true, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $ref_class = 'CoreLibs\Get\ReadEnvFile'; @@ -44,9 +39,6 @@ $status = \CoreLibs\Get\DotEnv::readEnvFile('.', 'test.env'); print "test.env: STATUS: " . $status . "
"; print "AFTER reading test.env file: " . \CoreLibs\Debug\Support::printAr($_ENV) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.runningtime.php b/www/admin/class_test.runningtime.php index 54220947..13f71ddf 100644 --- a/www/admin/class_test.runningtime.php +++ b/www/admin/class_test.runningtime.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -25,15 +20,10 @@ ob_end_flush(); use CoreLibs\Debug\RunningTime; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $PAGE_NAME = 'TEST CLASS: RUNNING TIME'; @@ -62,9 +52,6 @@ RunningTime::hrRunningTime(); echo "TIMED 2 [hr]: " . RunningTime::hrRunningTime() . "
"; echo "TIMED 2 [hr-end]: " . RunningTime::hrRunningTimeFromStart() . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.session.php b/www/admin/class_test.session.php index 116cc11c..0f685e87 100644 --- a/www/admin/class_test.session.php +++ b/www/admin/class_test.session.php @@ -2,11 +2,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); /** @@ -45,15 +40,10 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-session'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); use CoreLibs\Create\Session; $session = new Session(); @@ -173,9 +163,6 @@ print "[BAD NAME] Current session name: " . $session->getSessionName() . "
"; print "[BAD NAME] Current session active: " . ($session->checkActiveSession() ? 'Yes' : 'No') . "
"; print "[BAD NAME] Current session status: " . getSessionStatusString($session->getSessionStatus()) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.session.read.php b/www/admin/class_test.session.read.php index 6a8700b8..ec40f7c7 100644 --- a/www/admin/class_test.session.read.php +++ b/www/admin/class_test.session.read.php @@ -2,11 +2,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); /** @@ -45,15 +40,10 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-session.read'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); use CoreLibs\Create\Session; $session = new Session(); @@ -100,9 +90,6 @@ print "[READ] Confirm " . $var . " is " . $value . ": " print "[ALL SESSION]: " . \CoreLibs\Debug\Support::printAr($_SESSION) . "
"; -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.smarty.php b/www/admin/class_test.smarty.php index 34f97687..0615f0d6 100644 --- a/www/admin/class_test.smarty.php +++ b/www/admin/class_test.smarty.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -25,15 +20,10 @@ $ECHO_ALL = true; $LOG_FILE_ID = 'classTest-smarty'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $l10n = new \CoreLibs\Language\L10n( SITE_LOCALE, @@ -62,7 +52,7 @@ print ""; print ''; print '

' . $PAGE_NAME . '

'; -$smarty->DATA['JS_DEBUG'] = DEBUG; +$smarty->DATA['JS_DEBUG'] = $log->getJsDebug(); $smarty->MASTER_TEMPLATE_NAME = 'main_body.tpl'; $smarty->TEMPLATE_NAME = 'smarty_test.tpl'; $smarty->CSS_SPECIAL_TEMPLATE_NAME = 'smart_test.css'; @@ -160,9 +150,6 @@ $smarty->setSmartyVarsAdmin( $adm ); -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.strings.php b/www/admin/class_test.strings.php index ae302fa5..af5a949b 100644 --- a/www/admin/class_test.strings.php +++ b/www/admin/class_test.strings.php @@ -2,11 +2,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -19,15 +14,10 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-string'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $byte_class = 'CoreLibs\Convert\Strings'; @@ -76,9 +66,6 @@ foreach ($test_splits as $split) { print "$split with count: " . \CoreLibs\Convert\Strings::countSplitParts($split) . "
"; } -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.system.php b/www/admin/class_test.system.php index fa92d68e..9ba32c1d 100644 --- a/www/admin/class_test.system.php +++ b/www/admin/class_test.system.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -26,15 +21,10 @@ ob_end_flush(); use CoreLibs\Get\System; use CoreLibs\Debug\Support as DgS; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $PAGE_NAME = 'TEST CLASS: SYSTEM'; @@ -61,7 +51,4 @@ print "FILEUPLOADERRORMESSAGE(UPLOAD_ERR_CANT_WRITE): " print "System::checkCLI():
"; print "Are we in an CLI: " . (System::checkCLI() ? 'Yes' : 'No') . "
"; -// error message -print $log->printErrorMsg(); - print ""; diff --git a/www/admin/class_test.token.php b/www/admin/class_test.token.php index 38c5f9da..d6018876 100644 --- a/www/admin/class_test.token.php +++ b/www/admin/class_test.token.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -23,15 +18,10 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-token'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $_token = new CoreLibs\Output\Form\Token(); $token_class = 'CoreLibs\Output\Form\Token'; @@ -59,9 +49,6 @@ $token_id = $basic->setFormToken($token); print "TOKEN: $token: (ID) ".$token_id." => (S) ".$_SESSION[$token]."
"; print "VALIDATE: $token: ".(string)$basic->validateFormToken($token_id, $token)."
"; */ -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.uids.php b/www/admin/class_test.uids.php index 04162765..9aef4bdf 100644 --- a/www/admin/class_test.uids.php +++ b/www/admin/class_test.uids.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -23,15 +18,10 @@ require 'config.php'; $LOG_FILE_ID = 'classTest-uids'; ob_end_flush(); -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $_uids = new CoreLibs\Create\Uids(); use CoreLibs\Create\Uids; @@ -62,9 +52,6 @@ print "UNIQU ID LONG : " . Uids::uniqIdLong() . "
"; /* print "D/UUIDV4: ".$basic->uuidv4()."
"; print "/DUNIQID (d): ".$basic->uniqId()."
"; */ -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/admin/class_test.varistype.php b/www/admin/class_test.varistype.php index 9ea875ff..cff5db49 100644 --- a/www/admin/class_test.varistype.php +++ b/www/admin/class_test.varistype.php @@ -6,11 +6,6 @@ declare(strict_types=1); -$DEBUG_ALL_OVERRIDE = false; // set to 1 to debug on live/remote server locations -$DEBUG_ALL = true; -$PRINT_ALL = true; -$DB_DEBUG = true; - error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR); ob_start(); @@ -27,15 +22,10 @@ use CoreLibs\Convert\SetVarType; use CoreLibs\Convert\SetVarTypeNull; use CoreLibs\Debug\Support; -$log = new CoreLibs\Debug\Logging([ +$log = new CoreLibs\Logging\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, - 'echo_all' => $ECHO_ALL ?? false, - 'print_all' => $PRINT_ALL, + 'log_file_id' => $LOG_FILE_ID, + 'log_per_date' => true, ]); $PAGE_NAME = 'TEST CLASS: CONVERT\VARISTYPE'; @@ -109,9 +99,6 @@ foreach ($checks as $string) { print "
"; } -// error message -print $log->printErrorMsg(); - print ""; // __END__ diff --git a/www/composer.lock b/www/composer.lock index 0c2e8a47..bb4ef81d 100644 --- a/www/composer.lock +++ b/www/composer.lock @@ -12,7 +12,7 @@ "dist": { "type": "path", "url": "/storage/var/www/html/developers/clemens/core_data/composer-packages/CoreLibs-Composer-All", - "reference": "b16ff4c613f6f76e8f518d47b4a04c1b914fee82" + "reference": "f66f8f282e15a15ecd25e21a2767359b5ec875d4" }, "require": { "php": ">=8.1" diff --git a/www/vendor/composer/installed.json b/www/vendor/composer/installed.json index dd91d0b8..060beca2 100644 --- a/www/vendor/composer/installed.json +++ b/www/vendor/composer/installed.json @@ -7,7 +7,7 @@ "dist": { "type": "path", "url": "/storage/var/www/html/developers/clemens/core_data/composer-packages/CoreLibs-Composer-All", - "reference": "b16ff4c613f6f76e8f518d47b4a04c1b914fee82" + "reference": "f66f8f282e15a15ecd25e21a2767359b5ec875d4" }, "require": { "php": ">=8.1" diff --git a/www/vendor/composer/installed.php b/www/vendor/composer/installed.php index 4f5409bd..86c90b52 100644 --- a/www/vendor/composer/installed.php +++ b/www/vendor/composer/installed.php @@ -13,7 +13,7 @@ 'egrajp/corelibs-composer-all' => array( 'pretty_version' => 'dev-development', 'version' => 'dev-development', - 'reference' => 'b16ff4c613f6f76e8f518d47b4a04c1b914fee82', + 'reference' => 'f66f8f282e15a15ecd25e21a2767359b5ec875d4', 'type' => 'library', 'install_path' => __DIR__ . '/../egrajp/corelibs-composer-all', 'aliases' => array(), diff --git a/www/vendor/egrajp/corelibs-composer-all/publish/last.published b/www/vendor/egrajp/corelibs-composer-all/publish/last.published index a2f28f43..6d289079 100644 --- a/www/vendor/egrajp/corelibs-composer-all/publish/last.published +++ b/www/vendor/egrajp/corelibs-composer-all/publish/last.published @@ -1 +1 @@ -8.4.0 +8.5.0 diff --git a/www/vendor/egrajp/corelibs-composer-all/test/phpunit/Security/CoreLibsSecurityPasswordTest.php b/www/vendor/egrajp/corelibs-composer-all/test/phpunit/Security/CoreLibsSecurityPasswordTest.php index b085992e..80adec64 100644 --- a/www/vendor/egrajp/corelibs-composer-all/test/phpunit/Security/CoreLibsSecurityPasswordTest.php +++ b/www/vendor/egrajp/corelibs-composer-all/test/phpunit/Security/CoreLibsSecurityPasswordTest.php @@ -11,7 +11,7 @@ use PHPUnit\Framework\TestCase; * @coversDefaultClass \CoreLibs\Security\Password * @testdox \CoreLibs\Security\Password method tests */ -final class CoreLibsCheckPasswordTest extends TestCase +final class CoreLibsSecurityPasswordTest extends TestCase { public function passwordProvider(): array {