Skip to content

[ticket/15790] Allow dynamic loading services files for extensions#5361

Open
rxu wants to merge 2 commits intophpbb:masterfrom
rxu:ticket/15790
Open

[ticket/15790] Allow dynamic loading services files for extensions#5361
rxu wants to merge 2 commits intophpbb:masterfrom
rxu:ticket/15790

Conversation

@rxu
Copy link
Contributor

@rxu rxu commented Sep 15, 2018

Checklist:

  • Correct branch: master for new features; 3.2.x for fixes
  • Tests pass
  • Code follows coding guidelines: master and 3.2.x
  • Commit follows commit message format

Tracker ticket (set the ticket ID to your ticket ID):

PHPBB3-15790.

@Derky
Copy link
Member

Derky commented Sep 16, 2018

With this change you can't inherit and overwrite settings from other files anymore right? And it doesn't seem to check if it already loaded the file?

@Elsensee
Copy link
Contributor

In general, I don't get this change. The services are cached in the Container and it will only be rebuilt if the cache folder is cleared or extensions are enabled/disabled.

@rxu
Copy link
Contributor Author

rxu commented Sep 16, 2018

This way you can't inherit and overwrite settings from other files right?

As far as the files loading queue is not ordered, then rather right. Also you still can use imports to achieve that if needed.

And it doesn't seem to check if it already tried to load the file right?

Didn't get the question. It actually loads services definitions from those files. Symfony handles them internally.

The services are cached in the Container and it will only be rebuilt if the cache folder is cleared or extensions are enabled/disabled.

Sure. You disable the extension, drop in files, then enable the extension. Voila.

@Elsensee
Copy link
Contributor

Sure. You disable the extension, drop in files, then enable the extension. Voila.

Yeah, but you could also make another extension that extends it, can't you?

@rxu
Copy link
Contributor Author

rxu commented Sep 16, 2018

With this change you don't need to create new extension every time you need to make an addition to another extension.

@rxu
Copy link
Contributor Author

rxu commented Nov 7, 2019

What I can say additionally is that with this change extension developer is free to decide if to use this feature or not.
That's easy: if you use services_ prefix for your .yml config file, it's gonna be autoloaded. And vice versa.
If anyone is wanting the old behavior, just name files without services_ prefix.

@rxu
Copy link
Contributor Author

rxu commented Mar 4, 2021

@marc1706 Can we probably make a decision on this PR?

@marc1706 marc1706 modified the milestones: 4.0.0-a1, 4.0.0-a2 Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants