Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically load the services.yml file if it exists #810

Open
wants to merge 1 commit into
base: master
from

Conversation

@leofeyer
Copy link
Member

commented Oct 1, 2019

In Symfony 4, the services.yml file will be loaded automatically, therefore we should do it, too.

@leofeyer leofeyer added the feature label Oct 1, 2019
@leofeyer leofeyer added this to the 4.9 milestone Oct 1, 2019
@leofeyer leofeyer self-assigned this Oct 1, 2019
@leofeyer leofeyer requested a review from aschempp Oct 1, 2019
@fritzmg

This comment has been minimized.

Copy link
Collaborator

commented Oct 2, 2019

Same goes for the routing.yml

@leofeyer

This comment has been minimized.

Copy link
Member Author

commented Oct 2, 2019

The routing file is already loaded automatically. 😉

// Load the routing.yml file if it exists
if ($configFile = $this->getConfigFile('routing.yml')) {
$routes = $this->loader->getResolver()->resolve($configFile)->load($configFile);
if ($routes instanceof RouteCollection) {
$collection->addCollection($routes);
}
}

@fritzmg

This comment has been minimized.

Copy link
Collaborator

commented Oct 2, 2019

Right, I forgot 🙃

@aschempp

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2019

I'm not sure I like this idea. We should discuss the whole file loading if we want to add this. In Symfony, all files are automatically loaded, not just the services.yml. If we want to add "auto load for everything", we should consider supporting env folders as well etc.

@leofeyer

This comment has been minimized.

Copy link
Member Author

commented Oct 14, 2019

Are you sure that Symfony autoloads everything?

Because services.yaml and routing.yaml need to be loaded in different contexts.

-- See https://symfony.com/doc/current/setup/flex.html

@aschempp

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2019

I'm pretty sure it loads everything in packages but I haven't checked how it works exactly.

@fritzmg

This comment has been minimized.

Copy link
Collaborator

commented Oct 14, 2019

Yes, it loads everything in /config/packages but not everything in /config. imho the Managed Edition should support the same.

@leofeyer

This comment has been minimized.

Copy link
Member Author

commented Oct 14, 2019

Yes, it loads everything in /config/packages but not everything in /config. imho the Managed Edition should support the same.

Full ACK. 👍

@aschempp

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2019

There is no config/packages in Contao Managed Edition, and I doubt that really makes sense…?

@aschempp

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2019

config/packages contains the (default) configuration for packages, they are contained in the manager plugin for Contao.

@fritzmg

This comment has been minimized.

Copy link
Collaborator

commented Oct 14, 2019

Yes but you could put your own bundle configurations there. Supporting the config/packages folder is just a nice to have, since you can do it also via the config.yml.

But loading the /config/services.yml is a must imho.

@leofeyer

This comment has been minimized.

Copy link
Member Author

commented Oct 14, 2019

My "Full ACK" meant "do not load everything in the root /config folder", because Symfony does not, either.

@aschempp

This comment has been minimized.

Copy link
Contributor

commented Oct 15, 2019

Maybe we should consider having a toggle somewhere.

  • "old" style to load app/Resources and support the config.yml (only)
  • "new" style to load root folders, have public and support config/packages.yml including environment dirs?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.