title: How to determine the environment in a cronjob
body: <p>I've got an issue on how to determine the application's environment during a cronjob.
  I have currently have 2 environments: a production and a testing environment. They both use their own database.</p>
  
  <p>I determine the current environment based on the URL. For example: dev.domain.com sets the environment to testing and domain.com sets it to production.</p>
  
  <p>This works perfectly. However, this does not work for cronjobs. Because a cronjob does not get a domain.</p>
  
  <p>How would I solve this and still keeping things dynamic?</p>
  
  <p>This is what the code currently looks like:</p>
  
  <pre><code>if($_SERVER['SERVER_NAME'] == 'dev.domain.com' || $_SERVER['SERVER_NAME'] == 'domain.local') {
      define('ENVIRONMENT', 'development');
  }else if ($_SERVER['SERVER_NAME'] == 'domain.com'){
      define('ENVIRONMENT', 'production');
  }
  </code></pre>
  
  <p>Thanks in advance.</p>