marlonfan / coc-phpls

🐭 php language server for coc.nvim
MIT License
212 stars 16 forks source link

[FEATURE REQUEST] being able to source intelephense.licenceKey from somewhere else (another file, env var, etc) #59

Open Nemoden opened 4 years ago

Nemoden commented 4 years ago

A quick naive search on github using a query “intelephense.licenceKey” reveals the problem very soon - people committing their keys into the version control. Would be nice to have intelephense.licenceKeyFile or intelephense.licenceKeyEnvVar to stop this from happening. While it’s not implemented, how do I safely store the key if I still want to commit my coc-settings.json?

Nemoden commented 4 years ago

Solved the issue with:

if filereadable(expand("~/.vim/coc-user-config.vim"))
  source ~/.vim/coc-user-config.vim
endif

added ~/.vim/coc-user-config.vim to .gitignore, contents:

let g:coc_user_config = {
            \ "intelephense.licenceKey": "REAL_LICENCE_KEY",
            \ }

But this method is not as good as if main page of coc-phpls might have suggested a more straightforward, and fool-proof approach. Right now, as I noticed, search on github "intelephense.licenceKey" and see how many people blindly copy-pasted and committed their actual keys to github.

yaegassy commented 4 years ago

@Nemoden Hi,

In the current version of intelephense, you can load the license key from a file. Please check for similar closed issues. https://github.com/marlonfan/coc-phpls/issues/51