I started to use this module to export configuration across sites and environment, and it is a really good tool, thanks for who is working on it.
Now I noticed that I have to create folders "config/install" manually, I think, I could be really useful if the module could create them for us.

Please ping me if you have any question about what I am saying, also I really will be happy to help you up about development process, of course if you agree.



keboca created an issue. See original summary.

benjy’s picture

Status: Active » Needs review
960 bytes
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 16 pass(es). View

I've run into this as well, heres a patch that always tries to create the folder.

chx’s picture

well, perhaps on a dev site the permissions are set so this can happen (certainly wouldn't in my setup but w/e) but I think we need a try-catch or something to handle errors? What happens when this mkdir fails anyways?

benjy’s picture

Status: Needs review » Needs work

I believe mkdir currently returns FALSE when it fails, but it returns FALSE when the folder already exists as well. I'll have a go at improving the overall flow to give some more useful feedback.

gambry’s picture

Version: 8.x-1.x-dev » 8.x-1.0-beta16
Issue tags: +drush

Adding a try/catch block on mkdir() doesn't solve the problem as errors are raised on creating the files (and also for any other reason like write permission on the created folder, available space, etc.).

I would suggest to add the patch above as it is and extending the try/catch block on writeBackConfig().

Patch at #2 works on 1.0-beta16 but not on 1.x anymore.

benjy’s picture

Status: Needs work » Needs review
802 bytes

How about this, check for the directory first, then try create it. Un-tested because my drush was playing up but i'll get that sorted later and give it a whirl. Feedback welcome.

pfrenssen’s picture

Version: 8.x-1.0-beta16 » 8.x-1.x-dev
1.18 KB
1.22 KB

Works great, but there could be a small improvement: if the directories could not be created (e.g. due to a permissions problem) then a notice is logged but this is not shown to the end user. The command just exits silently without an error code, making it look like everything went fine, even though nothing was exported. Let's just change it to a drush_set_error() so that an error is shown to the user and an error code is returned.