Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[FrameworkBundle][Cache] The cache.[type] services are never created #52461

Copy link
Copy link
Closed
@HypeMC

Description

@HypeMC
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.