Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Fixed public directory when configured in composer.json#29533
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Fixed public directory when configured in composer.json#29533
Uh oh!
There was an error while loading.Please reload this page.
Conversation
f3effd2 to96c6e41Comparesrc/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
nicholasruunu commentedDec 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Instead of duplicating the public directory code, I feel like this could be put into a -- edit -- |
alexander-schranz commentedDec 8, 2018
@nicholasruunu but in which namespace without adding additional requirements to the compoments? |
chalasr commentedDec 8, 2018
I don't think it's worth adding a new class. |
nicholasruunu commentedDec 8, 2018
@alexander-schranz@chalasr, True, nevermind. |
ro0NL commentedDec 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
it could be |
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
(with one minor comment)
src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
3654c68 toa4ad090Compare…ed in composer.json
a4ad090 toc45062bComparealexander-schranz commentedDec 12, 2018
@nicolas-grekas tests green now :) |
| $composerConfig =json_decode(file_get_contents($composerFilePath),true); | ||
| if (isset($composerConfig['extra']['public-dir'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Shouldn't we also account forsymfony-web-dir which is still used for application based on the Symfony Standard Edition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
we discussed about it in#29533 (comment)
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I missed the discussion, but SensioDistributionBundle only handles the case when assets are installed using Composer scripts. IMO being able to run the command without having to specify the argument would be nice. On the other hand, anyone using 3.4 probably is already used to doing this. So maybe it's not worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
anyone using 3.4 probably is already used to doing this. So maybe it's not worth it.
same opinion here :)
| $composerConfig =json_decode(file_get_contents($composerFilePath),true); | ||
| if (isset($composerConfig['extra']['public-dir'])) { | ||
| $publicDir =$composerConfig['extra']['public-dir']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should we do altrim($publicDir, '/') here to be completely sure that we won't have double slashes later?
alexander-schranzDec 13, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
is ok for me what do you think@nicolas-grekas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
we never normalized this var previously:https://github.com/sensiolabs/SensioDistributionBundle/blob/06ec532536f9d6a6049da126c709119176615d45/Composer/ScriptHandler.php#L167-L180
not sure we care, neither we need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
why should we care?
nicolas-grekas commentedDec 17, 2018
Thank you@alexander-schranz. |
…lexander-schranz)This PR was merged into the 3.4 branch.Discussion----------Fixed public directory when configured in composer.json| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->| License | MITAs documented you should be able to change the public-dir by composer.json so the server:run and assets:install should also use that configuration when available:https://symfony.com/doc/3.4/configuration/override_dir_structure.html#override-the-web-directoryhttps://symfony.com/doc/current/configuration/override_dir_structure.html#override-the-public-directory#SymfonyConHackDay2018Commits-------c45062b fixed public directory of web server and assets install when configured in composer.json
Uh oh!
There was an error while loading.Please reload this page.
As documented you should be able to change the public-dir by composer.json so the server:run and assets:install should also use that configuration when available:
https://symfony.com/doc/3.4/configuration/override_dir_structure.html#override-the-web-directory
https://symfony.com/doc/current/configuration/override_dir_structure.html#override-the-public-directory
#SymfonyConHackDay2018