Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.23 KB

File metadata and controls

56 lines (40 loc) · 1.23 KB

Installation

Requirements

  • PHP >=8.1 (<8.6). Symfony 8.0 and 8.1 require PHP 8.4+.
  • Symfony 7.4, 8.0, or 8.1 (mandatory minimum minors). The bundle also supports Symfony 6.x and 7.0–7.3 when constraints resolve.
  • symfony/security-bundle (or equivalent) in your application for role-based gates.
  • twig/twig optional — required only for {{ cdbg() }} and {% cdbg %} Twig integration.

Composer

composer require nowo-tech/console-debug-bundle

Enable the bundle

With Symfony Flex

The recipe enables the bundle and adds config/packages/nowo_console_debug.yaml. Adjust roles and options as needed.

Without Flex

  1. Register the bundle in config/bundles.php:
return [
    // ...
    Nowo\ConsoleDebugBundle\NowoConsoleDebugBundle::class => ['all' => true],
];
  1. Create config/packages/nowo_console_debug.yaml:
nowo_console_debug:
    enabled: true
    roles:
        - ROLE_CONSOLE_DEBUG
    console_method: log
    label_prefix: '[cdbg]'
    shorten_paths: true
  1. Grant a debug role to trusted users:
security:
  role_hierarchy:
    ROLE_CONSOLE_DEBUG: ROLE_USER

Next steps