Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.1.0 (2025-11-07)

- Added support for multiple config filenames: `.disco-devbar.yaml`, `.disco-devbar.yml`
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog doesn't mention that .debug-banner.yaml is still supported for backward compatibility. This is an important detail for existing users who may have this file already configured.

Suggested change
- Added support for multiple config filenames: `.disco-devbar.yaml`, `.disco-devbar.yml`
- Added support for multiple config filenames: `.disco-devbar.yaml`, `.disco-devbar.yml`
- `.debug-banner.yaml` is still supported for backward compatibility.

Copilot uses AI. Check for mistakes.

## v1.0.0 (2025-qq-05)
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The date format used here ("2025-qq-05") appears to be a placeholder that was never replaced with the actual date. This should be corrected to include the proper month abbreviation or numeric representation.

Suggested change
## v1.0.0 (2025-qq-05)
## v1.0.0 (2025-10-05)

Copilot uses AI. Check for mistakes.

- Initial public release
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ php bin/console assets:install --symlink

## Configuration

Create `.debug-banner.yaml` in your project root with widget configuration:
Create a configuration file in your project root with widget configuration. The bundle will automatically
detect and load the first file found (in order of preference):

- `.disco-devbar.yaml` (recommended)
- `.disco-devbar.yml`
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation doesn't mention that .debug-banner.yaml is still supported for backward compatibility. Users who have existing configurations using this filename should be informed that it will continue to work, or that they should migrate to the new naming convention.

Suggested change
- `.disco-devbar.yml`
- `.disco-devbar.yml`
- `.debug-banner.yaml` (supported for backward compatibility; consider migrating to `.disco-devbar.yaml`)

Copilot uses AI. Check for mistakes.

Example configuration:

```yaml
widgets:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "marcin-orlowski/symfony-discodevbar",
"description": "Development toolbar/banner for Symfony project",
"type": "symfony-bundle",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",
"keywords": [
"symfony",
Expand Down
30 changes: 27 additions & 3 deletions src/Service/DiscoDevBarService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@

class DiscoDevBarService
{
private const CONFIG_FILE = '.debug-banner.yaml';
/**
* List of supported config filenames (in order of preference)
*/
private const CONFIG_FILES = [
'.disco-devbar.yaml',
'.disco-devbar.yml',
'.debug-banner.yaml', // Legacy, kept for backward compatibility
];

public function __construct(
private readonly string $projectDir
Expand All @@ -35,10 +42,10 @@ public function __construct(

public function getDiscoDevBarData(): DiscoDevBarData
{
$configPath = $this->projectDir . '/' . self::CONFIG_FILE;
$configPath = $this->findConfigFile();

// Default: empty widgets
if (!\file_exists($configPath)) {
if ($configPath === null) {
return new DiscoDevBarData(
left: [],
right: [],
Expand Down Expand Up @@ -73,6 +80,23 @@ public function getDiscoDevBarData(): DiscoDevBarData
);
}

/**
* Find the first existing config file from the list of supported filenames
*
* @return string|null Full path to config file or null if none found
*/
private function findConfigFile(): ?string
{
foreach (self::CONFIG_FILES as $filename) {
$path = $this->projectDir . '/' . $filename;
if (\file_exists($path)) {
return $path;
}
}

return null;
}

/**
* Check if any widget in the array has expand=true
*
Expand Down