File tree Expand file tree Collapse file tree 4 files changed +39
-5
lines changed
Expand file tree Collapse file tree 4 files changed +39
-5
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## v1.1.0 (2025-11-07)
4+
5+ - Added support for multiple config filenames: ` .disco-devbar.yaml ` , ` .disco-devbar.yml `
6+
37## v1.0.0 (2025-qq-05)
48
59- Initial public release
Original file line number Diff line number Diff line change @@ -51,7 +51,13 @@ php bin/console assets:install --symlink
5151
5252## Configuration
5353
54- Create ` .debug-banner.yaml ` in your project root with widget configuration:
54+ Create a configuration file in your project root with widget configuration. The bundle will automatically
55+ detect and load the first file found (in order of preference):
56+
57+ - ` .disco-devbar.yaml ` (recommended)
58+ - ` .disco-devbar.yml `
59+
60+ Example configuration:
5561
5662``` yaml
5763widgets :
Original file line number Diff line number Diff line change 22 "name" : " marcin-orlowski/symfony-discodevbar" ,
33 "description" : " Development toolbar/banner for Symfony project" ,
44 "type" : " symfony-bundle" ,
5- "version" : " 1.0 .0" ,
5+ "version" : " 1.1 .0" ,
66 "license" : " MIT" ,
77 "keywords" : [
88 " symfony" ,
Original file line number Diff line number Diff line change 2626
2727class DiscoDevBarService
2828{
29- private const CONFIG_FILE = '.debug-banner.yaml ' ;
29+ /**
30+ * List of supported config filenames (in order of preference)
31+ */
32+ private const CONFIG_FILES = [
33+ '.disco-devbar.yaml ' ,
34+ '.disco-devbar.yml ' ,
35+ '.debug-banner.yaml ' , // Legacy, kept for backward compatibility
36+ ];
3037
3138 public function __construct (
3239 private readonly string $ projectDir
@@ -35,10 +42,10 @@ public function __construct(
3542
3643 public function getDiscoDevBarData (): DiscoDevBarData
3744 {
38- $ configPath = $ this ->projectDir . ' / ' . self :: CONFIG_FILE ;
45+ $ configPath = $ this ->findConfigFile () ;
3946
4047 // Default: empty widgets
41- if (! \file_exists ( $ configPath) ) {
48+ if ($ configPath === null ) {
4249 return new DiscoDevBarData (
4350 left: [],
4451 right: [],
@@ -73,6 +80,23 @@ public function getDiscoDevBarData(): DiscoDevBarData
7380 );
7481 }
7582
83+ /**
84+ * Find the first existing config file from the list of supported filenames
85+ *
86+ * @return string|null Full path to config file or null if none found
87+ */
88+ private function findConfigFile (): ?string
89+ {
90+ foreach (self ::CONFIG_FILES as $ filename ) {
91+ $ path = $ this ->projectDir . '/ ' . $ filename ;
92+ if (\file_exists ($ path )) {
93+ return $ path ;
94+ }
95+ }
96+
97+ return null ;
98+ }
99+
76100 /**
77101 * Check if any widget in the array has expand=true
78102 *
You can’t perform that action at this time.
0 commit comments