From 18368027ee0d4d3abe78a62a4a83e5b7eb170773 Mon Sep 17 00:00:00 2001 From: sorcier Date: Thu, 5 Nov 2026 00:57:11 +0100 Subject: [PATCH] feat(dev): add dev environment detection and visual indicators --- .gitignore | 5 +++++ public/index.php | 23 +++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2dbd9da..4c0f15d 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,8 @@ Thumbs.db .idea/ .vscode/ +# Environnement local de développement (exclu de Git) +/.dev +/.env +/.env.local + diff --git a/public/index.php b/public/index.php index af2f208..4dadb83 100644 --- a/public/index.php +++ b/public/index.php @@ -19,6 +19,10 @@ $hasBranding = !empty($companyName) || !empty($companyLogo); $appVerData = file_exists(__DIR__ . '/../version.json') ? json_decode((string)file_get_contents(__DIR__ . '/../version.json'), true) : []; $appVersion = $appVerData['version'] ?? '1.5.0'; + +// Détection de l'environnement de développement : présence de .dev local ou branche git dev +$isDevEnv = file_exists(__DIR__ . '/../.dev') + || (trim((string)@shell_exec('git -C ' . escapeshellarg(__DIR__) . ' rev-parse --abbrev-ref HEAD 2>/dev/null')) === 'dev'); ?> @@ -26,7 +30,7 @@ $appVersion = $appVerData['version'] ?? '1.5.0'; - NexusPBX — Supervision & Téléphonie IP • Powered by Asterisk + <?= $isDevEnv ? '🛠️ [DEV] ' : '' ?>NexusPBX — Supervision & Téléphonie IP • Powered by Asterisk @@ -162,7 +166,12 @@ $appVersion = $appVerData['version'] ?? '1.5.0';
NexusPBX Logo
-

NexusPBX

+

+ NexusPBX + + DEV + +

Supervision & Téléphonie IP • Powered by Asterisk

@@ -212,6 +221,9 @@ $appVersion = $appVerData['version'] ?? '1.5.0'; NexusPBX v + + DEV +
Powered by Asterisk
@@ -494,6 +506,13 @@ $appVersion = $appVerData['version'] ?? '1.5.0';
+ +
+ + DEV +
+ +