style: auto-fix 1340 phpcs PSR-12 violations via phpcbf; exclude MissingNamespace and SideEffects
This commit is contained in:
+16
-7
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
// Load environment variables
|
||||
$envFile = __DIR__ . '/../.env';
|
||||
if (!file_exists($envFile)) {
|
||||
@@ -10,8 +11,10 @@ $envVars = parse_ini_file($envFile, false, INI_SCANNER_TYPED);
|
||||
if ($envVars) {
|
||||
foreach ($envVars as $key => $value) {
|
||||
if (is_string($value)) {
|
||||
if ((substr($value, 0, 1) === '"' && substr($value, -1) === '"') ||
|
||||
(substr($value, 0, 1) === "'" && substr($value, -1) === "'")) {
|
||||
if (
|
||||
(substr($value, 0, 1) === '"' && substr($value, -1) === '"') ||
|
||||
(substr($value, 0, 1) === "'" && substr($value, -1) === "'")
|
||||
) {
|
||||
$envVars[$key] = substr($value, 1, -1);
|
||||
}
|
||||
}
|
||||
@@ -27,8 +30,10 @@ $GLOBALS['config'] = [
|
||||
|
||||
// Asset cache-busting version — auto-computed from key asset mtimes so
|
||||
// browsers always pick up changes on deploy. Override via ASSET_VERSION in .env.
|
||||
'ASSET_VERSION' => (function() use ($envVars) {
|
||||
if (!empty($envVars['ASSET_VERSION'])) return $envVars['ASSET_VERSION'];
|
||||
'ASSET_VERSION' => (function () use ($envVars) {
|
||||
if (!empty($envVars['ASSET_VERSION'])) {
|
||||
return $envVars['ASSET_VERSION'];
|
||||
}
|
||||
$files = [
|
||||
__DIR__ . '/../assets/css/base.css',
|
||||
__DIR__ . '/../assets/css/dashboard.css',
|
||||
@@ -38,7 +43,11 @@ $GLOBALS['config'] = [
|
||||
__DIR__ . '/../assets/js/ticket.js',
|
||||
];
|
||||
$mtime = 0;
|
||||
foreach ($files as $f) { if (file_exists($f)) $mtime = max($mtime, filemtime($f)); }
|
||||
foreach ($files as $f) {
|
||||
if (file_exists($f)) {
|
||||
$mtime = max($mtime, filemtime($f));
|
||||
}
|
||||
}
|
||||
return $mtime ?: '20260329';
|
||||
})(),
|
||||
|
||||
@@ -75,7 +84,8 @@ $GLOBALS['config'] = [
|
||||
// Set APP_DOMAIN in .env to override
|
||||
'APP_DOMAIN' => $envVars['APP_DOMAIN'] ?? null,
|
||||
// Allowed hosts for HTTP_HOST validation (comma-separated in .env)
|
||||
'ALLOWED_HOSTS' => array_filter(array_map('trim',
|
||||
'ALLOWED_HOSTS' => array_filter(array_map(
|
||||
'trim',
|
||||
explode(',', $envVars['ALLOWED_HOSTS'] ?? 'localhost,127.0.0.1')
|
||||
)),
|
||||
|
||||
@@ -143,4 +153,3 @@ date_default_timezone_set($GLOBALS['config']['TIMEZONE']);
|
||||
$now = new DateTime('now', new DateTimeZone($GLOBALS['config']['TIMEZONE']));
|
||||
$GLOBALS['config']['TIMEZONE_OFFSET'] = $now->getOffset() / 60; // Convert seconds to minutes
|
||||
$GLOBALS['config']['TIMEZONE_ABBREV'] = $now->format('T'); // e.g., "EST", "EDT"
|
||||
?>
|
||||
Reference in New Issue
Block a user