title: How to set GOOGLE_APPLICATION_CREDENTIALS without using a path
body: <p>I'm developing a CMS module that needs to use Google OAUTH 2 for server to server applications. According to the <a href="https://developers.google.com/api-client-library/php/auth/service-accounts" rel="noreferrer">official manual</a> one needs to set an environment variable with the path to .json key like so:</p>
  
  <pre><code>putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json');
  </code></pre>
  
  <p>And here is the tricky part. If I'd use it in a stand-alone web application, then there wouldn't be any problem, but since I'm working on a CMS module, storing that file on a drive or creating any kind of hooks associated with the use of this file would pose a potential security threat since I already see how one could sneakily steal the content of the key through the use of another module.</p>
  
  <p>I want to store the content of this file in the DB and the question: is there a way I could somehow set the environment value of GOOGLE_APPLICATION_CREDENTIALS without using a path?</p>