title: Zend framework: How to detect environment(dev/prod) in code
body: <p>I use <code>Zend_Mail</code> component in my application for sending mails via SMTP protocol.</p>
  
  <p>And I want to persist my messages to files when I'm in <code>development</code> environment(accordingly to application.ini).</p>
  
  <p>How can I detect in my controller action whether it is development or <code>production</code>/<code>staging</code> environment?</p>