Better debug log

This commit is contained in:
Laurent Destailleur 2024-09-12 01:33:58 +02:00
parent c8bae560f1
commit cbf3cbfa1f
2 changed files with 7 additions and 2 deletions

View file

@ -121,8 +121,10 @@ class DoliDBMysqli extends DoliDB
$disableforcecharset = 0; // Set to 1 to test without charset forcing
if (empty($disableforcecharset) && $this->db->character_set_name() != $clientmustbe) {
try {
//print "You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name();
dol_syslog(get_class($this)."::DoliDBMysqli You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name(), LOG_WARNING);
//print "You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database, so to ".$this->db->character_set_name();
dol_syslog(get_class($this)."::DoliDBMysqli You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database, so to ".$this->db->character_set_name(), LOG_WARNING);
//
$this->db->set_charset($clientmustbe); // This set charset, but with a bad collation
} catch (Exception $e) {
print 'Failed to force character_set_client to '.$clientmustbe." (according to setup) to match the one of the server database.<br>\n";

View file

@ -200,6 +200,9 @@ function dolDecrypt($chain, $key = '')
//var_dump('key='.$key);
$reg = array();
if (preg_match('/^dolcrypt:([^:]+):(.+)$/', $chain, $reg)) {
// Do not enable this log, except during debug
//dol_syslog("We try to decrypt the chain: ".$chain, LOG_DEBUG);
$ciphering = $reg[1];
if (function_exists('openssl_decrypt')) {
if (empty($key)) {