BASE . LOG,
'log_file_id' => $LOG_FILE_ID,
'log_per_date' => true,
]);
// db connection and attach logger
$db = new CoreLibs\DB\IO(DB_CONFIG, $log);
$db->log->debug('START', '=============================>');
$PAGE_NAME = 'TEST CLASS: DB QUERY PLACEHOLDERS';
print "";
print "
" . $PAGE_NAME . "";
print "";
print '';
print '' . $PAGE_NAME . '
';
print "LOGFILE NAME: " . $db->log->getLogFile() . "
";
print "LOGFILE ID: " . $db->log->getLogFileId() . "
";
print "DBINFO: " . $db->dbInfo() . "
";
// DB client encoding
print "DB client encoding: " . $db->dbGetEncoding() . "
";
print "DB search path: " . $db->dbGetSchema() . "
";
$to_db_version = '15.2';
print "VERSION DB: " . $db->dbVersion() . "
";
print "SERVER ENCODING: " . $db->dbVersionInfo('server_encoding') . "
";
if (($dbh = $db->dbGetDbh()) instanceof \PgSql\Connection) {
print "ALL OUTPUT [TEST]: " . print_r(pg_version($dbh), true) . "
";
} else {
print "NO DB HANDLER
";
}
/**
* Undocumented function
*
* @param \CoreLibs\DB\IO $dbc
* @return void
*/
function testDBS(\CoreLibs\DB\IO $dbc): void
{
echo "Int call
";
$dbc->dbReturnRow("SELECT test FROM test_foo LIMIT 1");
}
testDBS($db);
print "";
// __END__