jide / clamp

Command Line Apache MySQL PHP
http://jide.github.io/clamp
GNU General Public License v2.0
79 stars 9 forks source link

Rplace JSON with YAML #26

Open absszero opened 7 years ago

absszero commented 7 years ago

I tried to set up vhosts in clamp.json, but JSON does not support multiple-lines. and duplicate key is not allowed, for example, "<Directory".

So I replace JSON with YAML and build a temporary Apache configure file, then start Apache with the configure file.

rqelibari commented 7 years ago

Hello @absszero, Thank you for your efforts! I will inspect your commits today and will come back to you, if there is any question.

rqelibari commented 7 years ago

@absszero Your code looks good! If you answer my three questions, I can merge your code. Also: Did you take SpyC from github (mustangostang/spyc)?

Next step: I am currently building a contribution guideline and will create a development branch. Your code will be merged into that new branch, such that it can be part of the next release. Again, thank you for contributing!

jide commented 7 years ago

Hey folks,

Thanks for your contribution @absszero, it's cool to see other people contributing to the project !

Funnily, I think that if there are two entries, one being "<Directory" and the other being "<Directory " (with an extra space), it should work. Same with "<Directory "/a/b">": ""... So there's a hack to work around this.

I'm a little worried because YAML will break existing setups. So that would be a breaking change. Until now, nobody seemed to have the need of multiple <Directory/> directives, and although it sounds like a useful feature, the balance between usefulness VS keeping compatibility needs to be kept in mind. And we may also think about a migration path.

In an ideal world we would allow both JSON and YAML so that nothing breaks. But I know this would need some extra work, and I myself don't have the time to work on this.

@rqelibari What do you think ?

EDIT: That said, the YAML config looks much cleaner than JSON and seems much more natural.

jide commented 7 years ago

@rqelibari The contribution guideline and the dev branch sound like a good idea !

absszero commented 7 years ago

@rqelibari Yes, I took it from mustangostang/spyc.