coc-phpls icon indicating copy to clipboard operation
coc-phpls copied to clipboard

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

Open Nemoden opened this issue 4 years ago • 2 comments

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 avatar Apr 14 '20 20:04 Nemoden

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.

Nemoden avatar Apr 15 '20 01:04 Nemoden

@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

yaegassy avatar Jul 20 '20 10:07 yaegassy