sql;if($reportMode===null&&str_contains($e->sql,'"gl_lines"')){$pdo=$e->connection->getPdo();$reportMode=['isolation'=>$pdo->query('SHOW transaction_isolation')->fetchColumn(),'read_only'=>$pdo->query('SHOW transaction_read_only')->fetchColumn()];}}); register_shutdown_function(function()use(&$reportSql,&$reportMode,$reportOutput){file_put_contents($reportOutput,json_encode(['transaction'=>$reportMode,'report_queries'=>count(array_filter($reportSql,fn($q)=>str_contains($q,'"gl_lines"')||str_contains($q,'"gl_journals"'))),'writer_locks'=>count(array_filter($reportSql,fn($q)=>str_contains(strtolower($q),'for update')))],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));}); }