Further split out Class.Basic
- Email/File/Hash class update - add random key, running time - get system calls - Debug classes for logging, running time, etc
This commit is contained in:
@@ -23,16 +23,14 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||
}
|
||||
// define log file id
|
||||
$LOG_FILE_ID = 'classTest-datetime';
|
||||
$LOG_FILE_ID = 'classTest-array';
|
||||
ob_end_flush();
|
||||
|
||||
use CoreLibs\Combined\ArrayHandler;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$_array= new CoreLibs\Combined\ArrayHandler();
|
||||
$array_class = 'CoreLibs\Combination\ArrayHandler';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
// $_array= new CoreLibs\Combined\ArrayHandler();
|
||||
// $array_class = 'CoreLibs\Combination\ArrayHandler';
|
||||
|
||||
print "<html><head><title>TEST CLASS: ARRAY HANDLER</title><head>";
|
||||
print "<body>";
|
||||
|
||||
@@ -29,11 +29,8 @@ ob_end_flush();
|
||||
use CoreLibs\Convert\Byte;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$_byte = new CoreLibs\Convert\Byte();
|
||||
$byte_class = 'CoreLibs\Convert\Byte';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
|
||||
print "<html><head><title>TEST CLASS: BYTE CONVERT</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
@@ -41,8 +38,6 @@ print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
// class
|
||||
$byte = 254779258;
|
||||
$string = '242.98 MB';
|
||||
print "BYTE TO: $byte: ".$_byte->humanReadableByteFormat($byte)."<br>";
|
||||
print "BYTE FROM: $string: ".$_byte->stringByteFormat($string)."<br>";
|
||||
// static
|
||||
print "S::BYTE TO: $byte: ".$byte_class::humanReadableByteFormat($byte)."<br>";
|
||||
print "S::BYTE FROM: $string: ".$byte_class::stringByteFormat($string)."<br>";
|
||||
|
||||
@@ -26,16 +26,17 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest-colors';
|
||||
ob_end_flush();
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$color = new CoreLibs\Convert\Colors();
|
||||
$color_class = 'CoreLibs\Convert\Colors';
|
||||
use CoreLibs\Convert\Colors;
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
$basic = new CoreLibs\Basic();
|
||||
$color_class = 'CoreLibs\Convert\Colors';
|
||||
|
||||
print "<html><head><title>TEST CLASS: COLORS</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
|
||||
// A(out of bounds)
|
||||
print "C::S/COLOR invalid rgb->hex (gray 125): -1, -1, -1: ".CoreLibs\Convert\Colors::rgb2hex(-1, -1, -1)."<br>";
|
||||
print "\$C::S/COLOR invalid rgb->hex (gary 125): -1, -1, -1: ".$color_class::rgb2hex(-1, -1, -1)."<br>";
|
||||
@@ -44,15 +45,15 @@ $rgb = [10, 20, 30];
|
||||
$hex = '#0a141e';
|
||||
$hsb = [210, 67, 12];
|
||||
$hsl = [210, 50, 7.8];
|
||||
print "C/COLOR rgb->hex: $rgb[0], $rgb[1], $rgb[2]: ".$color->rgb2hex($rgb[0], $rgb[1], $rgb[2])."<br>";
|
||||
print "C/COLOR hex->rgb: $hex: ".$basic->printAr($color->hex2rgb($hex))."<br>";
|
||||
print "S::COLOR rgb->hex: $rgb[0], $rgb[1], $rgb[2]: ".Colors::rgb2hex($rgb[0], $rgb[1], $rgb[2])."<br>";
|
||||
print "S::COLOR hex->rgb: $hex: ".$basic->printAr(Colors::hex2rgb($hex))."<br>";
|
||||
print "C::S/COLOR rgb->hext: $hex: ".$basic->printAr(CoreLibs\Convert\Colors::hex2rgb($hex))."<br>";
|
||||
// C(to hsb/hsl)
|
||||
print "C/COLOR rgb->hsb: $rgb[0], $rgb[1], $rgb[2]: ".$basic->printAr($color->rgb2hsb($rgb[0], $rgb[1], $rgb[2]))."<br>";
|
||||
print "C/COLOR rgb->hsl: $rgb[0], $rgb[1], $rgb[2]: ".$basic->printAr($color->rgb2hsl($rgb[0], $rgb[1], $rgb[2]))."<br>";
|
||||
print "S::COLOR rgb->hsb: $rgb[0], $rgb[1], $rgb[2]: ".$basic->printAr(Colors::rgb2hsb($rgb[0], $rgb[1], $rgb[2]))."<br>";
|
||||
print "S::COLOR rgb->hsl: $rgb[0], $rgb[1], $rgb[2]: ".$basic->printAr(Colors::rgb2hsl($rgb[0], $rgb[1], $rgb[2]))."<br>";
|
||||
// D(from hsb/hsl) Note that param 2 + 3 is always 0-100 divided
|
||||
print "C/COLOR hsb->rgb: $hsb[0], $hsb[1], $hsb[2]: ".$basic->printAr($color->hsb2rgb($hsb[0], $hsb[1], $hsb[2]))."<br>";
|
||||
print "C/COLOR hsl->rgb: $hsl[0], $hsl[1], $hsl[2]: ".$basic->printAr($color->hsl2rgb($hsl[0], $hsl[1], $hsl[2]))."<br>";
|
||||
print "S::COLOR hsb->rgb: $hsb[0], $hsb[1], $hsb[2]: ".$basic->printAr(Colors::hsb2rgb($hsb[0], $hsb[1], $hsb[2]))."<br>";
|
||||
print "S::COLOR hsl->rgb: $hsl[0], $hsl[1], $hsl[2]: ".$basic->printAr(Colors::hsl2rgb($hsl[0], $hsl[1], $hsl[2]))."<br>";
|
||||
|
||||
// TODO: run compare check input must match output
|
||||
|
||||
|
||||
@@ -29,18 +29,14 @@ ob_end_flush();
|
||||
use CoreLibs\Combined\DateTime;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$_datetime = new CoreLibs\Combined\DateTime();
|
||||
$datetime_class = 'CoreLibs\Combination\DateTime';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
|
||||
print "<html><head><title>TEST CLASS: DATE/TIME</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
// class
|
||||
$timestamp = 1622788315.123456;
|
||||
print "C->DATESTRINGFORMAT(sm:0): $timestamp: ".$_datetime->dateStringFormat($timestamp)."<br>";
|
||||
// static
|
||||
print "S::DATESTRINGFORMAT(sm:0): $timestamp: ".$datetime_class::dateStringFormat($timestamp)."<br>";
|
||||
|
||||
|
||||
@@ -28,8 +28,6 @@ ob_end_flush();
|
||||
|
||||
$basic = new CoreLibs\Admin\Backend(DB_CONFIG);
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
|
||||
print "<html><head><title>TEST CLASS: DB</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
87
www/admin/class_test.debug.php
Normal file
87
www/admin/class_test.debug.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* @phan-file-suppress PhanTypeSuspiciousStringExpression
|
||||
*/
|
||||
|
||||
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$DEBUG_ALL = 1;
|
||||
$PRINT_ALL = 0;
|
||||
$ECHO_ALL = true;
|
||||
$DB_DEBUG = 1;
|
||||
|
||||
if ($DEBUG_ALL) {
|
||||
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
|
||||
if (!defined('SET_SESSION_NAME')) {
|
||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||
}
|
||||
// define log file id
|
||||
$LOG_FILE_ID = 'classTest-debug';
|
||||
ob_end_flush();
|
||||
|
||||
$ECHO_ALL = true;
|
||||
|
||||
use CoreLibs\Debug\Support as DebugSupport;
|
||||
use CoreLibs\Debug\Logging;
|
||||
use CoreLibs\Debug\FileWriter;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$debug = new CoreLibs\Debug\Logging();
|
||||
$debug_support_class = 'CoreLibs\Debug\Support';
|
||||
$debug_logging_class = 'CoreLibs\Debug\Logging';
|
||||
|
||||
print "<html><head><title>TEST CLASS: DEBUG</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
function test()
|
||||
{
|
||||
return DebugSupport::getCallerMethod(1);
|
||||
}
|
||||
|
||||
print "S::GETCALLERMETHOD: ".DebugSupport::getCallerMethod(0)."<br>";
|
||||
print "S::GETCALLERMETHOD: ".test()."<br>";
|
||||
print "S::PRINTAR: ".DebugSupport::printAr(['Foo', 'Bar'])."<br>";
|
||||
print "V-S::PRINTAR: ".$debug_support_class::printAr(['Foo', 'Bar'])."<br>";
|
||||
|
||||
// debug
|
||||
print "C->DEBUG: ".$debug->debug('CLASS-TEST-DEBUG', 'Class Test Debug')."<br>";
|
||||
print "C->PRINTERRORMSG: <br>".$debug->printErrorMsg()."<br>";
|
||||
|
||||
class TestL
|
||||
{
|
||||
public $log;
|
||||
public function __construct()
|
||||
{
|
||||
$this->log = new CoreLibs\Debug\Logging();
|
||||
}
|
||||
public function test()
|
||||
{
|
||||
$this->log->debug('TESTL', 'Logging in class testL');
|
||||
print "IN TestL->test: <br>".$this->log->printErrorMsg()."<br>";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
$tl = new TestL();
|
||||
print "CLASS SUB: DEBUG: ".$tl->test()."<br>";
|
||||
|
||||
// fdebug
|
||||
print "S::FSETFILENAME: ".FileWriter::fsetFilename('class_test_debug_file.log')."<br>";
|
||||
print "S::FDEBUG: ".FileWriter::fdebug('CLASS TEST DEBUG FILE: '.date('Y-m-d H:i:s'))."<br>";
|
||||
|
||||
// error message
|
||||
// future DEPRECATED
|
||||
$basic->debug('BASIC CLASS', 'Debug test');
|
||||
print "BASIC:<br>".$basic->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
// __END__
|
||||
@@ -26,27 +26,28 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest-email';
|
||||
ob_end_flush();
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$_email = new CoreLibs\Check\Email();
|
||||
$email_class = 'CoreLibs\Check\Email';
|
||||
use CoreLibs\Check\Email;
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
$basic = new CoreLibs\Basic();
|
||||
|
||||
print "<html><head><title>TEST CLASS: HTML/ELEMENTS</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
// regex get
|
||||
print "S::GETEMAILREGEX(0): ".Email::getEmailRegex(0)."<br>";
|
||||
print "S::GETEMAILREGEX(2): ".Email::getEmailRegex(2)."<br>";
|
||||
print "S::GETEMAILREGEX(7): ".Email::getEmailRegex(7)."<br>";
|
||||
print "S::GETEMAILREGEX(8 invalid): ".Email::getEmailRegex(8)."<br>";
|
||||
print "S::GETEMAILREGEXCHECK: ".$basic->printAr(Email::getEmailRegexCheck())."<br>";
|
||||
|
||||
$email = [
|
||||
'foo@bar.org',
|
||||
'foo@i.softbank.ne.jp'
|
||||
];
|
||||
foreach ($email as $s_email) {
|
||||
print "EMAIL: $s_email: ".$_email->getEmailType($s_email)."<br>";
|
||||
print "EMAIL SHORT: $s_email: ".$_email->getEmailType($s_email, true)."<br>";
|
||||
}
|
||||
foreach ($email as $s_email) {
|
||||
print "S-EMAIL: $s_email: ".$email_class::getEmailType($s_email)."<br>";
|
||||
print "S-EMAIL SHORT: $s_email: ".$email_class::getEmailType($s_email, true)."<br>";
|
||||
print "S::EMAIL: $s_email: ".Email::getEmailType($s_email)."<br>";
|
||||
print "S::EMAIL SHORT: $s_email: ".Email::getEmailType($s_email, true)."<br>";
|
||||
}
|
||||
// DEPRECATED
|
||||
/* foreach ($email as $s_email) {
|
||||
|
||||
@@ -32,8 +32,6 @@ $basic = new CoreLibs\Basic();
|
||||
$_encoding = new CoreLibs\Language\Encoding();
|
||||
$encoding_class = 'CoreLibs\Language\Encoding';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
|
||||
print "<html><head><title>TEST CLASS: ENCODING</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
@@ -29,10 +29,6 @@ ob_end_flush();
|
||||
use CoreLibs\Check\File;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$_array= new CoreLibs\Check\File();
|
||||
$array_class = 'CoreLibs\Check\File';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
|
||||
print "<html><head><title>TEST CLASS: FILE</title><head>";
|
||||
print "<body>";
|
||||
|
||||
@@ -29,7 +29,6 @@ ob_end_flush();
|
||||
use CoreLibs\Create\Hash;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$_hash = new CoreLibs\Create\Hash();
|
||||
$hash_class = 'CoreLibs\Create\Hash';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
@@ -39,14 +38,6 @@ print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
$to_crc = 'Some text block';
|
||||
// class
|
||||
print "__CRC32B: $to_crc: ".$_hash->__crc32b($to_crc)."<br>";
|
||||
print "__SHA1SHORT(off): $to_crc: ".$_hash->__sha1short($to_crc)."<br>";
|
||||
print "__SHA1SHORT(on): $to_crc: ".$_hash->__sha1short($to_crc, true)."<br>";
|
||||
print "__hash(d): $to_crc: ".$_hash->__hash($to_crc)."<br>";
|
||||
foreach (['adler32', 'fnv132', 'fnv1a32', 'joaat'] as $__hash_c) {
|
||||
print "__hash($__hash_c): $to_crc: ".$_hash->__hash($to_crc, $__hash_c)."<br>";
|
||||
}
|
||||
// static
|
||||
print "S::__CRC32B: $to_crc: ".$hash_class::__crc32b($to_crc)."<br>";
|
||||
print "S::__SHA1SHORT(off): $to_crc: ".$hash_class::__sha1short($to_crc)."<br>";
|
||||
|
||||
@@ -26,8 +26,9 @@ if (!defined('SET_SESSION_NAME')) {
|
||||
$LOG_FILE_ID = 'classTest-json';
|
||||
ob_end_flush();
|
||||
|
||||
use CoreLibs\Check\Jason;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$_json = new CoreLibs\Check\Jason();
|
||||
$json_class = 'CoreLibs\Check\Jason';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
@@ -37,25 +38,25 @@ print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
$json = '{"foo": "bar"}';
|
||||
$output = $_json->jsonConvertToArray($json);
|
||||
print "JSON: $json: ".$basic->printAr($output)."<br>";
|
||||
print "JSON ERROR: ".$_json->jsonGetLastError().": ".$_json->jsonGetLastError(true)."<br>";
|
||||
$output = Jason::jsonConvertToArray($json);
|
||||
print "S::JSON: $json: ".$basic->printAr($output)."<br>";
|
||||
print "S::JSON ERROR: ".Jason::jsonGetLastError().": ".Jason::jsonGetLastError(true)."<br>";
|
||||
|
||||
$json = '["f: {b"""ar}]';
|
||||
$output = $_json->jsonConvertToArray($json);
|
||||
print "E-JSON: $json: ".$basic->printAr($output)."<br>";
|
||||
print "E-JSON ERROR: ".$_json->jsonGetLastError().": ".$_json->jsonGetLastError(true)."<br>";
|
||||
$output = Jason::jsonConvertToArray($json);
|
||||
print "S::E-JSON: $json: ".$basic->printAr($output)."<br>";
|
||||
print "S::E-JSON ERROR: ".Jason::jsonGetLastError().": ".Jason::jsonGetLastError(true)."<br>";
|
||||
|
||||
// direct
|
||||
$json = '{"direct": "static function call"}';
|
||||
$output = $json_class::jsonConvertToArray($json);
|
||||
print "S::JSON: $json: ".$basic->printAr($output)."<br>";
|
||||
print "S::JSON ERROR: ".$json_class::jsonGetLastError().": ".$json_class::jsonGetLastError(true)."<br>";
|
||||
print "J/S::JSON: $json: ".$basic->printAr($output)."<br>";
|
||||
print "J/S::JSON ERROR: ".$json_class::jsonGetLastError().": ".$json_class::jsonGetLastError(true)."<br>";
|
||||
|
||||
$json = '["f: {b"""ar}]';
|
||||
$output = $json_class::jsonConvertToArray($json);
|
||||
print "S::E-JSON: $json: ".$basic->printAr($output)."<br>";
|
||||
print "S::E-JSON ERROR: ".$json_class::jsonGetLastError().": ".$json_class::jsonGetLastError(true)."<br>";
|
||||
print "J/S::E-JSON: $json: ".$basic->printAr($output)."<br>";
|
||||
print "J/S::E-JSON ERROR: ".$json_class::jsonGetLastError().": ".$json_class::jsonGetLastError(true)."<br>";
|
||||
|
||||
// DEPRECATE TEST
|
||||
/* $json = '["f: {b"""ar}]';
|
||||
|
||||
@@ -29,7 +29,6 @@ ob_end_flush();
|
||||
$basic = new CoreLibs\Basic();
|
||||
$_mime = new CoreLibs\Convert\MimeAppName();
|
||||
|
||||
|
||||
print "<html><head><title>TEST CLASS: MIME</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
@@ -52,16 +52,10 @@ print '<div><a href="class_test.byte.php">Class Test: BYTE CONVERT</a></div>';
|
||||
print '<div><a href="class_test.datetime.php">Class Test: DATE/TIME</a></div>';
|
||||
print '<div><a href="class_test.array.php">Class Test: ARRAY HANDLER</a></div>';
|
||||
print '<div><a href="class_test.file.php">Class Test: FILE</a></div>';
|
||||
|
||||
$basic->hrRunningTime();
|
||||
$basic->runningTime();
|
||||
echo "RANDOM KEY [50]: ".$basic->randomKeyGen(50)."<br>";
|
||||
echo "TIMED [hr]: ".$basic->hrRunningTime()."<br>";
|
||||
echo "TIMED [def]: ".$basic->runningTime()."<br>";
|
||||
echo "TIMED [string]: ".$basic->runningtime_string."<br>";
|
||||
$basic->hrRunningTime();
|
||||
echo "RANDOM KEY [default]: ".$basic->randomKeyGen()."<br>";
|
||||
echo "TIMED [hr]: ".$basic->hrRunningTime()."<br>";
|
||||
print '<div><a href="class_test.randomkey.php">Class Test: RANDOM KEY</a></div>';
|
||||
print '<div><a href="class_test.system.php">Class Test: SYSTEM</a></div>';
|
||||
print '<div><a href="class_test.runningtime.php">Class Test: RUNNING TIME</a></div>';
|
||||
print '<div><a href="class_test.debug.php">Class Test: DEBUG</a></div>';
|
||||
|
||||
// set + check edit access id
|
||||
$edit_access_id = 3;
|
||||
@@ -95,7 +89,6 @@ print "DEBUG OUT ALL: ".$basic->debug_output_all."<br>";
|
||||
print "ECHO OUT ALL: ".$basic->echo_output_all."<br>";
|
||||
print "PRINT OUT ALL: ".$basic->print_output_all."<br>";
|
||||
|
||||
print "CALLER BACKTRACE: ".$basic->getCallerMethod()."<br>";
|
||||
$basic->debug('SOME MARK', 'Some error output');
|
||||
|
||||
print "EDIT ACCESS ID: ".$basic->edit_access_id."<br>";
|
||||
|
||||
55
www/admin/class_test.randomkey.php
Normal file
55
www/admin/class_test.randomkey.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* @phan-file-suppress PhanTypeSuspiciousStringExpression
|
||||
*/
|
||||
|
||||
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$DEBUG_ALL = 1;
|
||||
$PRINT_ALL = 1;
|
||||
$DB_DEBUG = 1;
|
||||
|
||||
if ($DEBUG_ALL) {
|
||||
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
|
||||
if (!defined('SET_SESSION_NAME')) {
|
||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||
}
|
||||
// define log file id
|
||||
$LOG_FILE_ID = 'classTest-randomkey';
|
||||
ob_end_flush();
|
||||
|
||||
use CoreLibs\Create\RandomKey;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
$array_class = 'CoreLibs\Create\RandomKey';
|
||||
|
||||
print "<html><head><title>TEST CLASS: RANDOM KEY</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
$key_length = 10;
|
||||
$key_length_b = 5;
|
||||
print "S::RANDOMKEYGEN(auto): ".RandomKey::randomKeyGen()."<br>";
|
||||
print "S::SETRANDOMKEYLENGTH($key_length): ".RandomKey::setRandomKeyLength($key_length)."<br>";
|
||||
print "S::RANDOMKEYGEN($key_length): ".RandomKey::randomKeyGen()."<br>";
|
||||
print "S::RANDOMKEYGEN($key_length_b): ".RandomKey::randomKeyGen($key_length_b)."<br>";
|
||||
print "S::RANDOMKEYGEN($key_length): ".RandomKey::randomKeyGen()."<br>";
|
||||
$_array= new CoreLibs\Create\RandomKey();
|
||||
print "C->RANDOMKEYGEN(auto): ".$_array->randomKeyGen()."<br>";
|
||||
// DEPRECATED
|
||||
// print "D\RANDOMKEYGEN(auto): ".$basic->randomKeyGen()."<br>";
|
||||
|
||||
// error message
|
||||
print $basic->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
// __END__
|
||||
63
www/admin/class_test.runningtime.php
Normal file
63
www/admin/class_test.runningtime.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* @phan-file-suppress PhanTypeSuspiciousStringExpression
|
||||
*/
|
||||
|
||||
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$DEBUG_ALL = 1;
|
||||
$PRINT_ALL = 1;
|
||||
$DB_DEBUG = 1;
|
||||
|
||||
if ($DEBUG_ALL) {
|
||||
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
|
||||
if (!defined('SET_SESSION_NAME')) {
|
||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||
}
|
||||
// define log file id
|
||||
$LOG_FILE_ID = 'classTest-runningtime';
|
||||
ob_end_flush();
|
||||
|
||||
use CoreLibs\Debug\RunningTime;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
|
||||
print "<html><head><title>TEST CLASS: RUNNING IMTE</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
RunningTime::hrRunningTime();
|
||||
RunningTime::runningTime();
|
||||
echo "RANDOM KEY [50]: ".\CoreLibs\Create\RandomKey::randomKeyGen(50)."<br>";
|
||||
echo "TIMED [hr]: ".RunningTime::hrRunningTime()."<br>";
|
||||
echo "TIMED [def]: ".RunningTime::runningTime()."<br>";
|
||||
echo "TIMED [string]: ".RunningTime::runningTimeString()."<br>";
|
||||
RunningTime::hrRunningTime();
|
||||
echo "RANDOM KEY [default]: ".\CoreLibs\Create\RandomKey::randomKeyGen()."<br>";
|
||||
echo "TIMED [hr]: ".RunningTime::hrRunningTime()."<br>";
|
||||
|
||||
// DEPRECATED
|
||||
/* $basic->hrRunningTime();
|
||||
$basic->runningTime();
|
||||
echo "RANDOM KEY [50]: ".$basic->randomKeyGen(50)."<br>";
|
||||
echo "TIMED [hr]: ".$basic->hrRunningTime()."<br>";
|
||||
echo "TIMED [def]: ".$basic->runningTime()."<br>";
|
||||
echo "TIMED [string]: ".$basic->runningtime_string."<br>";
|
||||
$basic->hrRunningTime();
|
||||
echo "RANDOM KEY [default]: ".$basic->randomKeyGen()."<br>";
|
||||
echo "TIMED [hr]: ".$basic->hrRunningTime()."<br>"; */
|
||||
|
||||
// error message
|
||||
print $basic->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
|
||||
// __END__
|
||||
48
www/admin/class_test.system.php
Normal file
48
www/admin/class_test.system.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* @phan-file-suppress PhanTypeSuspiciousStringExpression
|
||||
*/
|
||||
|
||||
$DEBUG_ALL_OVERRIDE = 0; // set to 1 to debug on live/remote server locations
|
||||
$DEBUG_ALL = 1;
|
||||
$PRINT_ALL = 1;
|
||||
$DB_DEBUG = 1;
|
||||
|
||||
if ($DEBUG_ALL) {
|
||||
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
|
||||
if (!defined('SET_SESSION_NAME')) {
|
||||
define('SET_SESSION_NAME', EDIT_SESSION_NAME);
|
||||
}
|
||||
// define log file id
|
||||
$LOG_FILE_ID = 'classTest-system';
|
||||
ob_end_flush();
|
||||
|
||||
use CoreLibs\Get\System;
|
||||
|
||||
$basic = new CoreLibs\Basic();
|
||||
|
||||
print "<html><head><title>TEST CLASS: SYSTEM</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
print "GETHOSTNAME: ".$basic->printAr(System::getHostName())."<br>";
|
||||
print "GETPAGENAME(0): ".System::getPageName()."<br>";
|
||||
print "GETPAGENAME(1): ".System::getPageName(1)."<br>";
|
||||
print "GETPAGENAME(2): ".System::getPageName(2)."<br>";
|
||||
// seting errro codes file upload
|
||||
print "FILEUPLOADERRORMESSAGE(): ".System::fileUploadErrorMessage(-1)."<br>";
|
||||
print "FILEUPLOADERRORMESSAGE(UPLOAD_ERR_CANT_WRITE): ".System::fileUploadErrorMessage(UPLOAD_ERR_CANT_WRITE)."<br>";
|
||||
|
||||
// error message
|
||||
print $basic->printErrorMsg();
|
||||
|
||||
print "</body></html>";
|
||||
@@ -30,8 +30,6 @@ $basic = new CoreLibs\Basic();
|
||||
$_token = new CoreLibs\Output\Form\Token();
|
||||
$token_class = 'CoreLibs\Output\Form\Token';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
|
||||
print "<html><head><title>TEST CLASS: FORM TOKEN</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
@@ -30,8 +30,6 @@ $basic = new CoreLibs\Basic();
|
||||
$_uids = new CoreLibs\Create\Uids();
|
||||
$uids_class = 'CoreLibs\Create\Uids';
|
||||
|
||||
// define a list of from to color sets for conversion test
|
||||
|
||||
print "<html><head><title>TEST CLASS: UIDS</title><head>";
|
||||
print "<body>";
|
||||
print '<div><a href="class_test.php">Class Test Master</a></div>';
|
||||
|
||||
Reference in New Issue
Block a user