Skip to content

Provide a way to setDefaultConfiguration programmatically #66

Open
@YetiCGN

Description

@YetiCGN

I've noticed in src/Configuration/DefaultConfiguration.php that the code assumes a lot of configuration defaults depending on the Symfony version used. So for 3.4 and up it already assumes the Symfony 4 directory structure. But it's entirely possible to run a project on Symfony 3.4 LTS and even 4.1 and still use the "old" layout.

Please provide an easy way to select either of the three configuration presets to save a couple of lines to set everything back to what's actually used.

The magic here made it a bit difficult to determine why our deployment was failing for a Symfony 3.4 project. You could also check your assumptions against the "extra" section in the composer.json, where some of the directories are configured.

Current code:

            ->configDir('app/config')
            ->logDir('var/logs')
            ->templatesDir('app/Resources/views')
            ->webDir('web')
            ->sharedFilesAndDirs(['app/config/parameters.yml', 'var/logs'])
            ->writableDirs(['var/cache/', 'var/logs/'])
            ->controllersToRemove(['web/app_*.php'])

Should be more like:

            ->directoryStructure(DefaultDeployer::SYMFONY_3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions