Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
if (!function_exists('timebank_config')) {
/**
* Get platform-specific configuration value
*
* This function dynamically loads configuration from the file specified
* in the TIMEBANK_CONFIG environment variable (defaults to 'timebank-default').
*
* @param string $key Configuration key in dot notation (e.g., 'profiles.user.limit_max')
* @param mixed $default Default value if key is not found
* @return mixed
*
* @example
* // Get user profile limit_max from config/{TIMEBANK_CONFIG}.php
* $limitMax = timebank_config('profiles.user.limit_max');
*
* // With a default value
* $limitMax = timebank_config('profiles.user.limit_max', 6000);
*/
function timebank_config($key, $default = null)
{
static $configName = null;
// Cache the config name to avoid repeated env() calls
if ($configName === null) {
$configName = env('TIMEBANK_CONFIG', 'timebank-default');
}
// Build the full config key
$fullKey = $configName . '.' . $key;
return config($fullKey, $default);
}
}