Logging class major change, Debug\Support update

old Debug\Logging is in Debug\LoggingLegacy and Debug\Logging extends
Logging\Logging

Logging\Logging is a new class with most of the functionality except
there is no more print/outout to screen, but we use the default log
levels (RFC5424)
The plan is to be a frontend between the old type class and
Monolog\Monolog

Updated all other classes to use new class interface
This commit is contained in:
Clemens Schwaighofer
2023-05-30 18:12:24 +09:00
parent 7b5ad92e66
commit b0a8783276
75 changed files with 4292 additions and 2019 deletions

View File

@@ -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) . "<br>";
print "ADBPRINTDATETIME:<br>" . $backend->adbPrintDateTime(2021, 6, 21, 6, 38, '_test') . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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();

View File

@@ -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 "</div>";
}
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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() . "<br>";
}
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 ?? '') . "<br>";
print "DB Name: " . DB_CONFIG_NAME . "<br>";
print "DB Config: " . \CoreLibs\Debug\Support::printAr(DB_CONFIG) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 ?? '') . "<br>";
print "DB Name: " . DB_CONFIG_NAME . "<br>";
print "DB Config: " . \CoreLibs\Debug\Support::printAr(DB_CONFIG) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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: <pre>" . DgS::printAr(SetVarType::setArray(Colors::hsl2r
// TODO: run compare check input must match output
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
print "DOW-date[$date];invalid: " . DateTime::setWeekdayNumberFromDate($date) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 '<div><a href="class_test.php">Class Test Master</a></div>';
print '<div><a href="class_test.db.php">Class Test DB</a></div>';
print '<div><h1>' . $PAGE_NAME . '</h1></div>';
print "LOGFILE NAME: " . $db->log->getSetting('log_file_name') . "<br>";
print "LOGFILE ID: " . $db->log->getSetting('log_file_id') . "<br>";
print "LOGFILE NAME: " . $db->log->getLogFile() . "<br>";
print "LOGFILE ID: " . $db->log->getLogFileId() . "<br>";
print "DBINFO: " . $db->dbInfo() . "<br>";
// 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) ?
"<b>Bool:</b> " . $db->log->prBl($res) :
"<b>Bool:</b> " . Support::prBl($res) :
(is_array($res) ?
"Array: " . $db->log->prBl(is_array($res)) : '{-}')
"Array: " . Support::prBl(is_array($res)) : '{-}')
) . ", "
. "cursor_ext: <pre>" . 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) ?
"<b>Bool:</b> " . $db->log->prBl($res) :
"<b>Bool:</b> " . Support::prBl($res) :
(is_array($res) ?
"Array: " . $db->log->prBl(is_array($res)) : '{-}')
"Array: " . Support::prBl(is_array($res)) : '{-}')
) . ", "
. "cursor_ext: <pre>" . 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) ?
"<b>Bool:</b> " . $db->log->prBl($res) :
"<b>Bool:</b> " . Support::prBl($res) :
(is_array($res) ?
"Array: " . $db->log->prBl(is_array($res)) : '{-}')
"Array: " . Support::prBl(is_array($res)) : '{-}')
) . ", "
. "cursor_ext: <pre>" . 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) ?
"<b>Bool:</b> " . $db->log->prBl($res) :
"<b>Bool:</b> " . Support::prBl($res) :
(is_array($res) ?
"Array: " . $db->log->prBl(is_array($res)) : '{-}')
"Array: " . Support::prBl(is_array($res)) : '{-}')
) . ", "
. "cursor_ext: <pre>" . 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) ?
"<b>Bool:</b> " . $db->log->prBl($res) :
"<b>Bool:</b> " . Support::prBl($res) :
(is_array($res) ?
"Array: " . $db->log->prBl(is_array($res)) : '{-}')
"Array: " . Support::prBl(is_array($res)) : '{-}')
) . ", "
. "cursor_ext: <pre>" . Support::printAr(
SetVarType::setArray($db->dbGetCursorExt($q_db_ret))

View File

@@ -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 '<div><a href="class_test.php">Class Test Master</a></div>';
print '<div><a href="class_test.db.dbReturn.php">Class Test DB dbReturn</a></div>';
print '<div><h1>' . $PAGE_NAME . '</h1></div>';
print "LOGFILE NAME: " . $db->log->getSetting('log_file_name') . "<br>";
print "LOGFILE ID: " . $db->log->getSetting('log_file_id') . "<br>";
print "LOGFILE NAME: " . $db->log->getLogFile() . "<br>";
print "LOGFILE ID: " . $db->log->getLogFileId() . "<br>";
print "DBINFO: " . $db->dbInfo() . "<br>";
echo "DB_CONFIG_SET constant: <pre>" . print_r(DB_CONFIG, true) . "</pre><br>";
@@ -790,9 +783,6 @@ print "RES: " . DgS::printAr(SetVarType::setArray($res)) . "<br>";
print "ISSET: " . isset($res['null_varchar']) . "<br>";
print "EMPTY: " . empty($res['null_varchar']) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 '<div><a href="class_test.php">Class Test Master</a></div>';
print '<div><a href="class_test.db.dbReturn.php">Class Test DB dbReturn</a></div>';
print '<div><h1>' . $PAGE_NAME . '</h1></div>';
print "LOGFILE NAME: " . $db->log->getSetting('log_file_name') . "<br>";
print "LOGFILE ID: " . $db->log->getSetting('log_file_id') . "<br>";
print "LOGFILE NAME: " . $db->log->getLogFile() . "<br>";
print "LOGFILE ID: " . $db->log->getLogFileId() . "<br>";
print "DBINFO: " . $db->dbInfo() . "<br>";
// DB client encoding
print "DB client encoding: " . $db->dbGetEncoding() . "<br>";
@@ -94,9 +87,6 @@ echo "EOM STRING WITH MORE THAN 10 PARAMETERS: "
. "ERROR: " . $db->dbGetLastError(true) . "<br>";
echo "<hr>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 "<!DOCTYPE html>";
@@ -72,16 +71,43 @@ function test2(): array
print "S::GETCALLERMETHOD: " . DebugSupport::getCallerMethod(0) . "<br>";
print "S::GETCALLERMETHOD: " . test() . "<br>";
print "S::GETCALLERMETHODLIST: <pre>" . print_r(test2(), true) . "</pre><br>";
// printAr
print "S::PRINTAR: " . DebugSupport::printAr(['Foo', 'Bar']) . "<br>";
print "V-S::PRINTAR: " . $debug_support_class::printAr(['Foo', 'Bar']) . "<br>";
// printBool
print "S::PRINTBOOL(default): " . DebugSupport::printBool(true) . "<br>";
print "S::PRINTBOOL(name): " . DebugSupport::printBool(true, 'Name') . "<br>";
print "S::PRINTBOOL(name, ok): " . DebugSupport::printBool(true, 'Name', 'ok') . "<br>";
print "S::PRINTBOOL(name, ok, not): " . DebugSupport::printBool(false, 'Name', 'ok', 'not') . "<br>";
// debugString
print "S::DEBUSTRING(s): " . DebugSupport::debugString('SET') . "<br>";
print "S::DEBUSTRING(s): " . DebugSupport::debugString('SET') . "<br>";
print "S::DEBUSTRING(s&gt;): " . DebugSupport::debugString('<SET>') . "<br>";
print "S::DEBUSTRING(''): " . DebugSupport::debugString('') . "<br>";
print "S::DEBUSTRING(,s): " . DebugSupport::debugString(null, '{-}') . "<br>";
// dumpVar
print "S::DUMPVAR(s): " . DebugSupport::dumpVar('SET') . "<br>";
print "S::DUMPVAR(s,true): " . DebugSupport::dumpVar('SET', true) . "<br>";
print "S::DUMPVAR(s&gt;): " . DebugSupport::dumpVar('<SET>') . "<br>";
print "S::DUMPVAR(s&gt;,true): " . DebugSupport::dumpVar('<SET>', true) . "<br>";
print "S::DUMPVAR(''): " . DebugSupport::dumpVar('') . "<br>";
print "S::DUMPVAR(,s): " . DebugSupport::dumpVar(null) . "<br>";
print "S::DUMPVAR([a,b]): " . DebugSupport::dumpVar(['a', 'b']) . "<br>";
print "S::DUMPVAR([a,b],true): " . DebugSupport::dumpVar(['a', 'b'], true) . "<br>";
print "S::DUMPVAR([MIXED]): " . DebugSupport::dumpVar(<<<EOM
Line is
break
with
<html>block</html>
and > and <
EOM) . "<br>";
// exportVar
// print "S::EXPORTVAR(s): " . DebugSupport::exportVar('SET') . "<br>";
// print "S::EXPORTVAR(s&gt;): " . DebugSupport::exportVar('<SET>') . "<br>";
// print "S::EXPORTVAR(''): " . DebugSupport::exportVar('') . "<br>";
// print "S::EXPORTVAR(,s): " . DebugSupport::exportVar(null) . "<br>";
// print "S::EXPORTVAR([a,b]): " . DebugSupport::exportVar(['a', 'b']) . "<br>";
// print "S::EXPORTVAR([a,b],true): " . DebugSupport::exportVar(['a', 'b']) . "<br>";
// get test
print "LOG FOLDER: " . $debug->getSetting('log_folder') . "<br>";
@@ -95,7 +121,7 @@ print "C->PRINTERRORMSG: <br>" . $debug->printErrorMsg() . "<br>";
echo "<b>OPTIONS DEBUG CALL</b><br>";
// 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,11 @@ echo "<b>CLASS DEBUG CALL</b><br>";
// @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',
]);
@@ -186,9 +212,9 @@ print "CLASS EXTEND: PRINTERRORMSG: <br>" . $tr->log->printErrorMsg() . "<br>";
// @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;
}
@@ -222,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

View File

@@ -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)) . "<br>";
}
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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)) . "<br>";
// error message
print $log->printErrorMsg();
print "S::ENC CHECK: $_string: " . ($string === false ? '-OK-' : Support::printAr($string)) . "<br>";
print "</body></html>";

View File

@@ -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() . "<br>";
}
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
$file = getcwd() . DIRECTORY_SEPARATOR . 'class_test.file.php';
print "GETLINESFROMFILE: $file: " . File::getLinesFromFile($file) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
// print "UNIQU ID SHORT : " . Hash::__uniqId() . "<br>";
// print "UNIQU ID LONG : " . Hash::__uniqIdLong() . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
print "LB remove: " . \CoreLibs\Convert\Html::removeLB($text, '##BR##') . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 "<div><b>IMAGE INFO</b>: " . $height . "x" . $width . ", TYPE: "
. $log->prAr($img_type) . " [" . $finfo->file($image) . "]</div>";
. \CoreLibs\Debug\Support::printArray($img_type) . " [" . $finfo->file($image) . "]</div>";
// rotate image first
Image::correctImageOrientation($image);
// thumbnail tests
@@ -119,9 +109,6 @@ foreach ($images as $image) {
echo "<hr>";
}
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
// print "S::JSON ERROR: " . Jason::jsonGetLastError() . ": " . Jason::jsonGetLastError(true) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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();

View File

@@ -0,0 +1,94 @@
<?php // phpcs:ignore warning
/**
* @phan-file-suppress PhanTypeSuspiciousStringExpression
*/
declare(strict_types=1);
error_reporting(E_ALL | E_STRICT | E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR);
ob_start();
// basic class test file
define('USE_DATABASE', false);
// sample config
require 'config.php';
// set session name
$GLOBALS['SET_SESSION_NAME'] = EDIT_SESSION_NAME;
// define log file id
$LOG_FILE_ID = 'classTest-logging';
ob_end_flush();
// override ECHO ALL FALSE
$ECHO_ALL = true;
// use CoreLibs\Debug\Support;
use CoreLibs\Logging\Logger\Level;
use CoreLibs\Logging\Logger\Flag;
// use CoreLibs\Debug\Support;
$log = new CoreLibs\Logging\Logging([
'log_folder' => BASE . LOG,
'log_file_id' => $LOG_FILE_ID,
'log_level' => Level::Debug,
'log_per_date' => true,
]);
$PAGE_NAME = 'TEST CLASS: DEBUG LOGGING';
print "<!DOCTYPE html>";
print "<html><head><title>" . $PAGE_NAME . "</title><head>";
print "<body>";
print '<div><a href="class_test.php">Class Test Master</a></div>';
print '<div><h1>' . $PAGE_NAME . '</h1></div>';
$log->logger2Debug();
print "Level 250: " . Level::fromValue(250)->getName() . "<br>";
print "Flag: per_run (from int): " . Flag::fromValue(2)->getName() . "<br>";
print "Flag: per_run getName(): " . Flag::per_class->getName() . "<br>";
print "Flag: per_run ->name: " . Flag::per_class->name . "<br>";
print "Flag: per_run ->value: " . Flag::per_class->value . "<br>";
print "DUMP: " . $log->dV(['something' => 'error']) . "<br>";
$log->debug('LEGACY', 'Some legacy shit here');
$log->debug('ARRAY', 'Dump some data: ' . $log->dV(['something' => 'error']));
$log->debug('MIXED', 'Dump mixed: ' . $log->dV(<<<EOM
Line is
break
with
<html>block</html>
and > and <
EOM));
$log->info('Info message', ['info' => 'log']);
$log->error('Cannot process data', ['error' => 'log']);
print "Log File: " . $log->getLogFile() . "<br>";
// init empty
unset($LOG_FILE_ID);
$ll = new CoreLibs\Logging\Logging([
'log_folder' => BASE . LOG,
]);
print "LFI: " . $ll->getLogFileId() . "<br>";
try {
$ll->setLoggingLevel('Invalid');
} catch (\Psr\Log\InvalidArgumentException $e) {
print "Invalid option: " . $e->getMessage() . "<br>";
}
/* $ll = new CoreLibs\Logging\Logging([
'log_folder' => BASE . LOG,
'log_file_id' => 'a',
'log_file_id' => 'a',
]); */
print '<hr>'
. '<div style="width:100%; font-family: monospace;">'
// . '<pre>'
. nl2br(htmlentities(file_get_contents($log->getLogFolder() . $log->getLogFile()) ?: ''))
// . '</pre>'
. '</div>';
print "</body></html>";
// __END__

View File

@@ -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()) . "<br>";
echo "ACL (MIN): " . \CoreLibs\Debug\Support::printAr($login->loginGetAcl()['min'] ?? []) . "<br>";
echo "LOCALE: " . \CoreLibs\Debug\Support::printAr($login->loginGetLocale()) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";

View File

@@ -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) . "<br>";
print "S-INITNUMERIC: " . $math_class::initNumeric('123') . "<br>";
print "S-INITNUMERIC: " . $math_class::initNumeric('123.456') . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
print "Memory usage 4 string: " . MemoryUsage::printMemoryUsage($data) . "<br>";
print "Memory usage 4 string raw: " . MemoryUsage::printMemoryUsage($data, true) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 . "<br>";
// sets table array to include
print "MY PAGE NAME: " . $form->my_page_name . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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,17 +18,16 @@ require 'config.php';
$LOG_FILE_ID = 'classTest';
$SET_SESSION_NAME = EDIT_SESSION_NAME;
use CoreLibs\Logging;
use CoreLibs\Debug\Support;
// init login & backend class
$session = new CoreLibs\Create\Session($SET_SESSION_NAME);
$log = new CoreLibs\Debug\Logging([
$log = new Logging\Logging([
'log_folder' => BASE . LOG,
'file_id' => $LOG_FILE_ID,
'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_per_date' => true,
]);
$db = new CoreLibs\DB\IO(DB_CONFIG, $log);
$login = new CoreLibs\ACL\Login(
@@ -102,6 +96,7 @@ print '<div><a href="class_test.readenvfile.php">Class Test: READ ENV FILE</a></
print '<div><a href="class_test.runningtime.php">Class Test: RUNNING TIME</a></div>';
print '<div><a href="class_test.memoryusage.php">Class Test: MEMORY USAGE</a></div>';
print '<div><a href="class_test.debug.php">Class Test: DEBUG</a></div>';
print '<div><a href="class_test.logging.php">Class Test: LOGGING</a></div>';
print '<div><a href="class_test.output.form.php">Class Test: OUTPUT FORM</a></div>';
print '<div><a href="class_test.admin.backend.php">Class Test: BACKEND ADMIN CLASS</a></div>';
print '<div><a href="class_test.lang.php">Class Test: LANG/L10n</a></div>';
@@ -116,10 +111,10 @@ print '<div><a href="class_test.config.direct.php">Class Test: CONFIG DIRECT</a>
print '<div><a href="subfolder/class_test.config.direct.php">Class Test: CONFIG DIRECT SUB</a></div>';
print "<hr>";
print "L: " . CoreLibs\Debug\Support::printAr($locale) . "<br>";
print "L: " . Support::dumpVar($locale) . "<br>";
// print all _ENV vars set
print "<div>READ _ENV ARRAY:</div>";
print CoreLibs\Debug\Support::printAr(array_map('htmlentities', $_ENV));
print Support::dumpVar(array_map('htmlentities', $_ENV));
// set + check edit access id
$edit_access_id = 3;
if (is_object($login) && isset($login->loginGetAcl()['unit'])) {
@@ -134,7 +129,7 @@ if (is_object($login) && isset($login->loginGetAcl()['unit'])) {
print "Something went wrong with the login<br>";
}
// $backend->log->debug('SESSION', \CoreLibs\Debug\Support::printAr($_SESSION));
// $backend->log->debug('SESSION', \CoreLibs\Debug\Support::dumpVar($_SESSION));
print '<form method="post" name="loginlogout">';
print '<a href="javascript:document.loginlogout.login_logout.value=\'Logou\';'
@@ -142,18 +137,23 @@ print '<a href="javascript:document.loginlogout.login_logout.value=\'Logou\';'
print '<input type="hidden" name="login_logout" value="">';
print '</form>';
// print the debug core vars
foreach (['on', 'off'] as $flag) {
foreach (['debug', 'echo', 'print'] as $type) {
$prefix = $flag == 'off' ? 'NOT ' : '';
print $prefix . strtoupper($type) . ' OUT: '
. \CoreLibs\Debug\Support::printAr(\CoreLibs\Convert\SetVarType::setArray(
$backend->log->getLogLevel($type, $flag)
)) . '<br>';
}
}
foreach (['debug', 'echo', 'print'] as $type) {
print strtoupper($type) . ' OUT ALL: ' . $backend->log->getLogLevelAll($type) . '<br>';
print "Log Level: " . $backend->log->getLoggingLevel()->getName() . "<br>";
print "Log ID: " . $backend->log->getLogFileId() . "<br>";
print "Log Date: " . $backend->log->getLogDate() . "<br>";
print "Log Max File Size: " . $backend->log->getLogMaxFileSize() . " bytes<br>";
print "Log Flags: " . $backend->log->getLogFlags() . "<br>";
foreach (
[
Logging\Logger\Flag::per_run,
Logging\Logger\Flag::per_date,
Logging\Logger\Flag::per_group,
Logging\Logger\Flag::per_page,
Logging\Logger\Flag::per_class,
Logging\Logger\Flag::per_level
] as $flag
) {
print "Log Flag: " . $flag->name . ": "
. CoreLibs\Debug\Support::printBool($backend->log->getLogFlag($flag)) . "<br>";
}
$log->debug('SOME MARK', 'Some error output');
@@ -162,7 +162,7 @@ $log->debug('SOME MARK', 'Some error output');
print "EDIT ACCESS ID: " . $backend->edit_access_id . "<br>";
if (is_object($login)) {
// print "ACL: <br>".$backend->print_ar($login->loginGetAcl())."<br>";
$log->debug('ACL', "ACL: " . \CoreLibs\Debug\Support::printAr($login->loginGetAcl()));
$log->debug('ACL', "ACL: " . \CoreLibs\Debug\Support::dumpVar($login->loginGetAcl()));
// print "DEFAULT ACL: <br>".$backend->print_ar($login->default_acl_list)."<br>";
// print "DEFAULT ACL: <br>".$backend->print_ar($login->default_acl_list)."<br>";
// $result = array_flip(
@@ -184,15 +184,11 @@ print "THIS HOST: " . HOST_NAME . ", with PROTOCOL: " . HOST_PROTOCOL . " is run
print "DIR: " . DIR . "<br>";
print "BASE: " . BASE . "<br>";
print "ROOT: " . ROOT . "<br>";
print "HOST: " . HOST_NAME . " => DB HOST: " . DB_CONFIG_NAME . " => " . print_r(DB_CONFIG, true) . "<br>";
print "HOST: " . HOST_NAME . " => DB HOST: " . DB_CONFIG_NAME . " => " . Support::dumpVar(DB_CONFIG) . "<br>";
print "DS is: " . DIRECTORY_SEPARATOR . "<br>";
print "SERVER HOST: " . $_SERVER['HTTP_HOST'] . "<br>";
// print error messages
// print $login->log->printErrorMsg();
print $log->printErrorMsg();
print "</body></html>";
# __END__

View File

@@ -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 . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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() . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 . "<br>";
print "AFTER reading test.env file: " . \CoreLibs\Debug\Support::printAr($_ENV) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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() . "<br>";
echo "TIMED 2 [hr-end]: " . RunningTime::hrRunningTimeFromStart() . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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() . "<br>";
print "[BAD NAME] Current session active: " . ($session->checkActiveSession() ? 'Yes' : 'No') . "<br>";
print "[BAD NAME] Current session status: " . getSessionStatusString($session->getSessionStatus()) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 "<body>";
print '<div><a href="class_test.php">Class Test Master</a></div>';
print '<div><h1>' . $PAGE_NAME . '</h1></div>';
$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 "</body></html>";
// __END__

View File

@@ -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) . "<br>";
}
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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():<br>";
print "Are we in an CLI: " . (System::checkCLI() ? 'Yes' : 'No') . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";

View File

@@ -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]."<br>";
print "VALIDATE: $token: ".(string)$basic->validateFormToken($token_id, $token)."<br>"; */
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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() . "<br>";
/* print "D/UUIDV4: ".$basic->uuidv4()."<br>";
print "/DUNIQID (d): ".$basic->uniqId()."<br>"; */
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -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 "<hr>";
}
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -2,12 +2,9 @@
declare(strict_types=1);
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
$DEBUG_ALL = 1;
$PRINT_ALL = 1;
$DB_DEBUG = 1;
$DEBUG_LEVEL = \CoreLibs\Logging\Logger\Level::Debug;
if ($DEBUG_ALL) {
if ($DEBUG_LEVEL->name == 'Debug') {
error_reporting(E_ALL);
}

View File

@@ -6,11 +6,6 @@
declare(strict_types=1);
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
$DEBUG_ALL = 1;
$PRINT_ALL = 1;
$DB_DEBUG = 1;
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 SUB';
@@ -49,9 +39,6 @@ echo "Config path prefix: " . ($CONFIG_PATH_PREFIX ?? '') . "<br>";
print "DB Name: " . DB_CONFIG_NAME . "<br>";
print "DB Config: " . \CoreLibs\Debug\Support::printAr(DB_CONFIG) . "<br>";
// error message
print $log->printErrorMsg();
print "</body></html>";
// __END__

View File

@@ -4,11 +4,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 @@ $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(