8000 [FrameworkBundle][Cache] The `cache.[type]` services are never created · Issue #52461 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[FrameworkBundle][Cache] The cache.[type] services are never created #52461
Closed
@HypeMC

Description

@HypeMC

Symfony version(s) affected

>=5.4

Description

According to the docs:

Some of these adapters could be configured via shortcuts. Using these shortcuts will create pools with service IDs that follow the pattern cache.[type].

This is however not true, the services are not created and after checking the original PR I can confirm that this never worked as described. As a matter of fact, I not convinced this was ever meant to work as described. I believe this is a bug in the docs, but since I'm not 100% sure, I was hoping to get some feedback first.

How to reproduce

framework:
    cache:
        default_pdo_provider: 'pgsql:host=localhost;port=5432;dbname=postgres;user=postgres;password=pass'
#[AsCommand('app:test')]
class TestCommand extends Command
{
    public function __construct(
        #[Autowire(service: 'cache.pdo')] private CacheInterface $cache,
    ) {
        parent::__construct();
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        return Command::SUCCESS;
    }
}
  The service "App\Command\TestCommand" has a dependency on a non-existent service "cache.pdo".
  Did you mean this: "cache.app"?

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0