/**
* Generates a nonce attribute for script tag.
*/
function csp_script_nonce(): string
{ $csp = Services::
csp();
if (!
$csp->
enabled()) { return '';
} return 'nonce="' .
$csp->
getScriptNonce() . '"';
}}if (!
function_exists('db_connect'
)) { /**
* Grabs a database connection and returns it to the user.
*
* This is a convenience wrapper for \Config\Database::connect()
* and supports the same parameters. Namely:
*
* When passing in $db, you may pass any of the following to connect:
* - group name
* - existing connection instance
* - array of database configuration values
*
* If $getShared === false then a new connection instance will be provided,
* otherwise it will all calls will return the same instance.
*
* @param array|ConnectionInterface|string|null $db
*
* @return BaseConnection
*/