Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
configuration system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2015 at 00:42 UTC
Updated:
9 Sep 2015 at 23:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hron84 commentedCould you please also add $_SERVER['SERVER_PORT'] to the filename if it is not equals to 80 or 443? It would be important since some development systems can look like run different Drupal instances on different ports and not everyone can/would like to edit hosts file just to make different hostnames.
Otherwise, I support this patch.
Comment #3
alexpottThis change makes tonnes of sense.
I think the host name should come the request using Request::getHost().
Comment #4
alexpottI think a test will break.
Comment #5
alexpottAlso I this is a task not a feature request.
Comment #6
dawehnerHaha, so does that mean we have no test coverage at all for this feature? Oh wait, actually we do have test coverage, we just get the raw content
and not care about the used filename, see
core/modules/config/src/Tests/ConfigExportUITest.php:53Comment #7
alexpottSo we need tests then.
Comment #8
mrf commentedHere is an update using getHttpHost() method and the request time to make this easier to test.
Next step is the actual tests but wanted to actually get this up since its been sitting lonely on my machine for two days.
Comment #9
mrf commentedOh and hron84 to address your concern that method is supposed to return the port number if its nonstandard according to the docs.
Comment #10
strykaizerTest attached + patch including test
I made one change to the original patch in #8, I added quotes around the filename
Comment #12
borisson_The test added in #10 looks sufficient (test only fails, as expected).
Comment #13
yoroy commentedSo, what's the proposed new file name, I can't tell from the patch :-)
Comment #14
borisson_@yoroy, the new filename will be
config-$hostname-$date.tar.gzwhere$hostnameis the host name of the server the installation is running on and$dateis the request-date formatted asY-m-d-H-i.An example is:
config-d8-dev-2015-08-26-15-28.tar.gz(my hostname is d8.dev).Comment #15
yoroy commentedExcellent, that makes a lot of sense. Thank you borisson_.
Comment #16
alexpottBeta evaluation: This is a really nice usability fix with no disruption.
Committed 3a0a28e and pushed to 8.0.x. Thanks!