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

Best way to override ServerRunCommand and ServerStartCommand? #20429

Copy link
Copy link
Closed
@pocky

Description

@pocky
Issue body actions

Hello,

I am using a non-standard folder structure and I just discovered a "problem" with server:run and server:start (for me it's a DX) :

        $documentRoot = $input->getOption('docroot');

        if (null === $documentRoot) {
            $documentRoot = $this->getContainer()->getParameter('kernel.root_dir').'/../web';
        }

For my distribution, the $documentRoot should be : $this->getContainer()->getParameter('kernel.root_dir').'/../../web'

I don't want to tell to each dev wich using my distribution to add the --docroot option (or using an alias via composer scripts/make) so I'm looking to the best way to change this.

Solutions :

1- ServerRunCommand and ServerStartCommand should be used as services to allow overriding
2- Add a getDocumentRoot option in Kernel and use the parameter instead of relative path (simpler)
3- Create a symfony/server-bundle with all related server commands as dependency of framework-bundle

What's your opinion?

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.