Remove \Basic class from all other Class extensions
If not created Logger class will be auto created in \DB\IO Recommended to run a CoreLibs\Debug\Logging([...]); and use this class for all ACL\Login, Admin\Backend, DB\IO, Output\Form\Generate calls. Last parameter after DB CONFIG is the log parameter Session create has been moved to a new Create\Session class from the \Basic class and MUST be started before using ACL\Login. Currently ACL\Login will fallback and start it if no session is yet started. See the Readme.md file for which classes use _SESSION data In future the _SESSION settings should be moved to some wrapper class for this so we can unit test sessions Only Output\Form\Generate class call has the new changed with the second parameter no longer beeing the table width setting but the class setting. But as this is a semi retired class and only used for edit_base this is not 100% breaking. All other classes can be used as is and have internal fallback to run as before. Deprecation messages will be added later.
This commit is contained in:
@@ -31,8 +31,18 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest-admin';
|
||||
ob_end_flush();
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$backend = new CoreLibs\Admin\Backend(DB_CONFIG);
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$backend = new CoreLibs\Admin\Backend(DB_CONFIG, $log);
|
||||
|
||||
print "<html><head><title>TEST CLASS: ADMIN BACKEND</title><head>";
|
||||
print "<body>";
|
||||
@@ -47,7 +57,7 @@ print "Messaes: " . \CoreLibs\Debug\Support::printAr($this->messages) . "<br>";
|
||||
print "ADBPRINTDATETIME:<br>" . $backend->adbPrintDateTime(2021, 6, 21, 6, 38, '_test') . "<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -32,7 +32,17 @@ ob_end_flush();
|
||||
use CoreLibs\Combined\ArrayHandler;
|
||||
use CoreLibs\Debug\Support as DgS;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
// $_array = new CoreLibs\Combined\ArrayHandler();
|
||||
// $array_class = 'CoreLibs\Combination\ArrayHandler';
|
||||
|
||||
@@ -207,7 +217,7 @@ $output = \CoreLibs\Combined\ArrayHandler::genAssocArray($db_array, $key, $value
|
||||
print "OUTPUT: " . \CoreLibs\Debug\Support::printAr($output) . "<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ ob_end_flush();
|
||||
|
||||
use CoreLibs\Convert\Byte;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$byte_class = 'CoreLibs\Convert\Byte';
|
||||
|
||||
print "<html><head><title>TEST CLASS: BYTE CONVERT</title><head>";
|
||||
@@ -104,7 +114,7 @@ print "BYTE TO: $byte: ".$basic->humanReadableByteFormat($byte)."<br>";
|
||||
print "BYTE FROM: $string: ".$basic->stringByteFormat($string)."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -32,7 +32,17 @@ ob_end_flush();
|
||||
use CoreLibs\Convert\Colors;
|
||||
use CoreLibs\Debug\Support as DgS;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$color_class = 'CoreLibs\Convert\Colors';
|
||||
|
||||
print "<html><head><title>TEST CLASS: COLORS</title><head>";
|
||||
@@ -70,7 +80,7 @@ print "S::COLOR hsb->rgb: $hsb[0], $hsb[1], $hsb[2]: "
|
||||
// TODO: run compare check input must match output
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -32,7 +32,17 @@ ob_end_flush();
|
||||
use CoreLibs\Combined\DateTime;
|
||||
use CoreLibs\Debug\Support as DgS;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$datetime_class = 'CoreLibs\Combined\DateTime';
|
||||
|
||||
print "<html><head><title>TEST CLASS: DATE/TIME</title><head>";
|
||||
@@ -152,7 +162,7 @@ print "CALCDAYSINTERVAL(named): $compare_date[0] = $compare_date[1]: "
|
||||
. DgS::printAr($basic->calcDaysInterval($compare_date[0], $compare_date[1], true))."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -32,8 +32,20 @@ $LOG_FILE_ID = 'classTest-db';
|
||||
ob_end_flush();
|
||||
|
||||
use CoreLibs\Debug\Support as DgS;
|
||||
use CoreLibs\DB\IO as DbIo;
|
||||
|
||||
$db = $basic = new CoreLibs\Admin\Backend(DB_CONFIG);
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$db = new CoreLibs\Admin\Backend(DB_CONFIG, $log);
|
||||
|
||||
// NEXT STEP
|
||||
// $basic = new CoreLibs\Basic();
|
||||
@@ -46,13 +58,15 @@ print "<html><head><title>TEST CLASS: DB</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
print "LOGFILE NAME: " . $db->log->getSetting('log_file_name') . "<br>";
|
||||
print "LOGFILE ID: " . $db->log->getSetting('log_file_id') . "<br>";
|
||||
print "DBINFO: " . $db->dbInfo() . "<br>";
|
||||
echo "DB_CONFIG_SET constant: <pre>" . print_r(DB_CONFIG, true) . "</pre><br>";
|
||||
|
||||
// DB client encoding
|
||||
print "DB Client encoding: " . $db->dbGetEncoding() . "<br>";
|
||||
|
||||
while (is_array($res = $db->dbReturn("SELECT * FROM max_test", 0, true))) {
|
||||
while (is_array($res = $db->dbReturn("SELECT * FROM max_test", DbIo::USE_CACHE, true))) {
|
||||
print "TIME: " . $res['time'] . "<br>";
|
||||
}
|
||||
print "CACHED DATA: <pre>" . print_r($db->cursor_ext, true) . "</pre><br>";
|
||||
@@ -324,7 +338,7 @@ print "ISSET: " . isset($res['null_varchar']) . "<br>";
|
||||
print "EMPTY: " . empty($res['null_varchar']) . "<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -63,6 +63,31 @@ print "C->DEBUG: " . $debug->debug('CLASS-TEST-DEBUG', 'Class Test Debug') . "<b
|
||||
print "C->DEBUG(html): " . $debug->debug('CLASS-TEST-DEBUG', 'HTML TAG<br><b>BOLD</b>') . "<br>";
|
||||
print "C->DEBUG(html,strip): " . $debug->debug('CLASS-TEST-DEBUG', 'HTML TAG<br><b>BOLD</b>', true) . "<br>";
|
||||
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([
|
||||
'log_folder' => '../log/',
|
||||
'file_id' => 'DebugTestNewLogger',
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// split into level (debug code)
|
||||
'per_level' => false,
|
||||
// per class called
|
||||
'per_class' => false,
|
||||
// per page
|
||||
'per_page' => false,
|
||||
// for each page call
|
||||
'per_run' => false,
|
||||
// set debug and print flags
|
||||
'debug_all' => true,
|
||||
'echo_all' => true,
|
||||
'print_all' => true,
|
||||
]);
|
||||
$new_log->debug('OPTIONS TYPE', 'New Type error');
|
||||
print "OPTIONS LOGGER:<br>" . $new_log->printErrorMsg();
|
||||
|
||||
echo "<b>CLASS DEBUG CALL</b><br>";
|
||||
|
||||
// @codingStandardsIgnoreLine
|
||||
|
||||
@@ -32,7 +32,17 @@ ob_end_flush();
|
||||
use CoreLibs\Check\Email;
|
||||
use CoreLibs\Debug\Support as DgS;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
|
||||
print "<html><head><title>TEST CLASS: HTML/ELEMENTS</title><head>";
|
||||
print "<body>";
|
||||
@@ -78,7 +88,7 @@ foreach ($email as $s_email) {
|
||||
} */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ ob_end_flush();
|
||||
|
||||
use CoreLibs\Language\Encoding;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$_encoding = new CoreLibs\Language\Encoding();
|
||||
$encoding_class = 'CoreLibs\Language\Encoding';
|
||||
|
||||
@@ -93,7 +103,7 @@ print "CONV ENCODING: $_string: ".$basic->convertEncoding($_string, 'ISO-2022-JP
|
||||
print "D/__MBMIMEENCODE: ".$basic->__mbMimeEncode('Some Text', 'UTF-8')."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $basic->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ ob_end_flush();
|
||||
|
||||
use CoreLibs\Check\File;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
|
||||
print "<html><head><title>TEST CLASS: FILE</title><head>";
|
||||
print "<body>";
|
||||
@@ -43,7 +53,7 @@ $file = getcwd() . DIRECTORY_SEPARATOR . 'class_test.file.php';
|
||||
print "GETLINESFROMFILE: $file: " . File::getLinesFromFile($file) . "<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ ob_end_flush();
|
||||
|
||||
use CoreLibs\Create\Hash;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$hash_class = 'CoreLibs\Create\Hash';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
@@ -58,7 +68,7 @@ print "D/__SHA1SHORT(off): $to_crc: ".$basic->__sha1short($to_crc)."<br>";
|
||||
print "D/__hash(d): $to_crc: ".$basic->__hash($to_crc)."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -32,7 +32,17 @@ ob_end_flush();
|
||||
use CoreLibs\Convert\Html;
|
||||
use CoreLibs\Output\Form\Elements;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$_html = new CoreLibs\Convert\Html();
|
||||
$_elements = new CoreLibs\Output\Form\Elements();
|
||||
$html_class = 'CoreLibs\Convert\Html';
|
||||
@@ -109,7 +119,7 @@ print "LB remove: " . \CoreLibs\Convert\Html::removeLB($text) . "<br>";
|
||||
print "LB remove: " . \CoreLibs\Convert\Html::removeLB($text, '##BR##') . "<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ ob_end_flush();
|
||||
|
||||
use CoreLibs\Output\Image;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$_image = new CoreLibs\Output\Image();
|
||||
$image_class = 'CoreLibs\Output\Image';
|
||||
|
||||
@@ -112,7 +122,7 @@ echo "<div>S::CREATETHUMBNAILSIMPLE: ".basename($image).": WIDTH: $thumb_width<b
|
||||
. $basic->createThumbnailSimple($image, $thumb_width)."></div>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -32,7 +32,17 @@ ob_end_flush();
|
||||
use CoreLibs\Convert\Json;
|
||||
use CoreLibs\Debug\Support as DgS;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$json_class = 'CoreLibs\Convert\Json';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
@@ -74,7 +84,7 @@ print "E-JSON ERROR: ".$basic->jsonGetLastError().": ".$basic->jsonGetLastError(
|
||||
// print "S::JSON ERROR: " . Jason::jsonGetLastError() . ": " . Jason::jsonGetLastError(true) . "<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -29,7 +29,17 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest-math';
|
||||
ob_end_flush();
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$_math = new CoreLibs\Convert\Math();
|
||||
$math_class = 'CoreLibs\Convert\Math';
|
||||
|
||||
@@ -57,7 +67,7 @@ print "FLOORP: ".$basic->floorp(5123456, -3)."<br>";
|
||||
print "INITNUMERIC: ".$basic->initNumeric('123')."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -29,7 +29,17 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest-mime';
|
||||
ob_end_flush();
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$_mime = new CoreLibs\Convert\MimeAppName();
|
||||
|
||||
print "<html><head><title>TEST CLASS: MIME</title><head>";
|
||||
@@ -61,7 +71,7 @@ $mime = 'fake/mime';
|
||||
$basic->mimeSetAppName($mime, 'This is a fake mime');
|
||||
print "MIME $mime: ".$basic->mimeGetAppName($mime)."<br>"; */
|
||||
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -57,8 +57,18 @@ $table_arrays[\CoreLibs\Get\System::getPageName(1)] = [
|
||||
]
|
||||
];
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$form = new CoreLibs\Output\Form\Generate(DB_CONFIG);
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$form = new CoreLibs\Output\Form\Generate(DB_CONFIG, $log);
|
||||
// $db = new CoreLibs\DB\IO(DB_CONFIG, $basic->log);
|
||||
|
||||
print "<html><head><title>TEST CLASS: FORM GENERATE</title><head>";
|
||||
@@ -70,7 +80,7 @@ print "MOBILE PHONE: " . $form->mobile_phone . "<br>";
|
||||
print "MY PAGE NAME: " . $form->my_page_name . "<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ ob_end_flush();
|
||||
|
||||
use CoreLibs\Check\Password as PwdChk;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$_password = new CoreLibs\Check\Password();
|
||||
$password_class = 'CoreLibs\Check\Password';
|
||||
|
||||
@@ -63,7 +73,7 @@ print "PASSWORD VERIFY: ".(string)$basic->passwordVerify($password, $enc_passwor
|
||||
print "PASSWORD REHASH: ".(string)$basic->passwordRehashCheck($enc_password)."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -29,8 +29,18 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest';
|
||||
|
||||
// init login & backend class
|
||||
$login = new CoreLibs\ACL\Login(DB_CONFIG);
|
||||
$basic = new CoreLibs\Admin\Backend(DB_CONFIG);
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$login = new CoreLibs\ACL\Login(DB_CONFIG, $log);
|
||||
$basic = new CoreLibs\Admin\Backend(DB_CONFIG, $log);
|
||||
$basic->dbInfo(true);
|
||||
ob_end_flush();
|
||||
|
||||
@@ -103,13 +113,13 @@ foreach (['debug', 'echo', 'print'] as $type) {
|
||||
print strtoupper($type) . ' OUT ALL: ' . $basic->log->getLogLevelAll($type) . '<br>';
|
||||
}
|
||||
|
||||
$basic->log->debug('SOME MARK', 'Some error output');
|
||||
$log->debug('SOME MARK', 'Some error output');
|
||||
|
||||
// INTERNAL SET
|
||||
print "EDIT ACCESS ID: " . $basic->edit_access_id . "<br>";
|
||||
if (is_object($login)) {
|
||||
// print "ACL: <br>".$basic->print_ar($login->acl)."<br>";
|
||||
$basic->log->debug('ACL', "ACL: " . \CoreLibs\Debug\Support::printAr($login->acl));
|
||||
$log->debug('ACL', "ACL: " . \CoreLibs\Debug\Support::printAr($login->acl));
|
||||
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
|
||||
// print "DEFAULT ACL: <br>".$basic->print_ar($login->default_acl_list)."<br>";
|
||||
// $result = array_flip(
|
||||
@@ -140,7 +150,7 @@ print "SERVER HOST: " . $_SERVER['HTTP_HOST'] . "<br>";
|
||||
|
||||
// print error messages
|
||||
// print $login->log->printErrorMsg();
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ ob_end_flush();
|
||||
|
||||
use CoreLibs\Check\PhpVersion;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$_phpv = new CoreLibs\Check\PhpVersion();
|
||||
$phpv_class = 'CoreLibs\Check\PhpVersion';
|
||||
|
||||
@@ -63,7 +73,7 @@ print "U-S::MIN: $min_version: " . (string)PhpVersion::checkPHPVersion($min_vers
|
||||
// print "MIN: $min_version: ".(string)$basic->checkPHPVersion($min_version)."<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ ob_end_flush();
|
||||
|
||||
use CoreLibs\Create\RandomKey;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$array_class = 'CoreLibs\Create\RandomKey';
|
||||
|
||||
print "<html><head><title>TEST CLASS: RANDOM KEY</title><head>";
|
||||
@@ -51,7 +61,7 @@ print "C->RANDOMKEYGEN(auto): " . $_array->randomKeyGen() . "<br>";
|
||||
// print "D\RANDOMKEYGEN(auto): ".$basic->randomKeyGen()."<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -31,7 +31,17 @@ ob_end_flush();
|
||||
|
||||
use CoreLibs\Debug\RunningTime;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
|
||||
print "<html><head><title>TEST CLASS: RUNNING IMTE</title><head>";
|
||||
print "<body>";
|
||||
@@ -59,7 +69,7 @@ echo "RANDOM KEY [default]: ".$basic->randomKeyGen()."<br>";
|
||||
echo "TIMED [hr]: ".$basic->hrRunningTime()."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -33,7 +33,17 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest-smarty';
|
||||
ob_end_flush();
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$smarty = new CoreLibs\Template\SmartyExtend();
|
||||
// for testing with or without CMS
|
||||
// $cms = new CoreLibs\Admin\Backend(DB_CONFIG);
|
||||
@@ -90,7 +100,7 @@ $smarty->DATA['loop_start'] = 2;
|
||||
$smarty->setSmartyVarsAdmin();
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -32,7 +32,17 @@ ob_end_flush();
|
||||
use CoreLibs\Get\System;
|
||||
use CoreLibs\Debug\Support as DgS;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
|
||||
print "<html><head><title>TEST CLASS: SYSTEM</title><head>";
|
||||
print "<body>";
|
||||
@@ -49,6 +59,6 @@ print "FILEUPLOADERRORMESSAGE(UPLOAD_ERR_CANT_WRITE): "
|
||||
. System::fileUploadErrorMessage(UPLOAD_ERR_CANT_WRITE) . "<br>";
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
@@ -29,7 +29,17 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest-token';
|
||||
ob_end_flush();
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$_token = new CoreLibs\Output\Form\Token();
|
||||
$token_class = 'CoreLibs\Output\Form\Token';
|
||||
|
||||
@@ -54,7 +64,7 @@ print "TOKEN: $token: (ID) ".$token_id." => (S) ".$_SESSION[$token]."<br>";
|
||||
print "VALIDATE: $token: ".(string)$basic->validateFormToken($token_id, $token)."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
@@ -29,7 +29,17 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest-uids';
|
||||
ob_end_flush();
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$log = new CoreLibs\Debug\Logging([
|
||||
'log_folder' => BASE . LOG,
|
||||
'file_id' => $LOG_FILE_ID,
|
||||
// add file date
|
||||
'print_file_date' => true,
|
||||
// set debug and print flags
|
||||
'debug_all' => $DEBUG_ALL ?? false,
|
||||
'echo_all' => $ECHO_ALL ?? false,
|
||||
'print_all' => $PRINT_ALL ?? false,
|
||||
]);
|
||||
$basic = new CoreLibs\Basic($log);
|
||||
$_uids = new CoreLibs\Create\Uids();
|
||||
$uids_class = 'CoreLibs\Create\Uids';
|
||||
|
||||
@@ -52,7 +62,7 @@ print "S::UNIQID (sha256): " . $uids_class::uniqId('sha256') . "<br>";
|
||||
print "/DUNIQID (d): ".$basic->uniqId()."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->log->printErrorMsg();
|
||||
print $log->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user