contao / managed-edition

Contao Managed Edition
17 stars 14 forks source link

add default config.yml & services.yml to skeleton #42

Closed fritzmg closed 4 years ago

fritzmg commented 5 years ago

I think it would make sense if the skeleton of the Contao Managed Edition also provides the following files:

# config/config.yml
imports:
    - { resource: services.yml }
# config/services.yml
services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: true

    App\:
        resource: '../src/*'
        exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Resources,Kernel.php}'

    App\Controller\:
        resource: '../src/Controller'
        tags: ['controller.service_arguments']

Since the Contao Managed edition already has the appropriate autoloading configuration in its composer.json for the App\ namespace, this would allow every user to quickly write hooks & callbacks, especially now that we have support for annotations, by simply creating one file, without having to do any additional configuration.

I am not sure if the config.yml is actually needed in Contao 4.8+ (in Symfony Flex, all the config files in /config are loaded automatically; may be we can even provide a default routes.yml for annotated routes?).

aschempp commented 5 years ago

Well that implies that someone using the contao/managed-edition is also a developer?

fritzmg commented 5 years ago

Anyone who creates a website is a web developer (no matter the skill level), isn't it? ;)

Also, if your point is, that not everyone using Contao has enough of a skill set to implement a hook for example: by that logic we would also need to remove

https://github.com/contao/managed-edition/blob/716155873a7e8240a7bcf8a7cb06cadc0d601135/composer.json#L42-L46

But why make everything harder for everyone, when we can make it easier for everyone? ;)

leofeyer commented 5 years ago

As discussed in Mumble on August 29th, we do not want to add the configuration to the managed edition but to the manager bundle (so it is updated automatically). Additionally, we need a flag to disable adding the configuration.

leofeyer commented 4 years ago

@fritzmg I think we can close this issue now that contao/contao#1165 has been merged, can't we?