Skip to content

Document #[RequiredBundle], ServicesBundle and ConsoleBundle#22225

Open
lacatoire wants to merge 3 commits into
symfony:8.1from
lacatoire:document-required-bundle
Open

Document #[RequiredBundle], ServicesBundle and ConsoleBundle#22225
lacatoire wants to merge 3 commits into
symfony:8.1from
lacatoire:document-required-bundle

Conversation

@lacatoire

@lacatoire lacatoire commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #22223

Document the new features introduced in symfony/symfony#63880:

- #[RequiredBundle] attribute: declare bundle dependencies that are
  automatically loaded, with examples for single/multiple dependencies
  and the ignoreOnInvalid option
- ServicesBundle and ConsoleBundle: standalone bundles providing core DI
  and console services without requiring FrameworkBundle
@carsonbot carsonbot added this to the 8.1 milestone Apr 8, 2026
@carsonbot carsonbot changed the title Document #[RequiredBundle], ServicesBundle and ConsoleBundle Document #[RequiredBundle], ServicesBundle and ConsoleBundle Apr 8, 2026
@GromNaN

GromNaN commented Apr 8, 2026

Copy link
Copy Markdown
Member

When using the ConsoleBundle alone, we should document the expected entrypoint:

use App\Kernel;
use Symfony\Component\Console\Application;

if (!is_dir(dirname(__DIR__).'/vendor')) {
    throw new LogicException('Dependencies are missing. Try running "composer install".');
}

if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
    throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
    $kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
    $kernel->boot();

    return new Application('Application Name', 'Version', $kernel->getContainer());
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants