/**
  * Replacing meta tag from the header.xml with header in the requests. See VBV-6361
  *
  */
 protected static function setHeaders()
 {
     header('X-UA-Compatible: IE=edge,chrome=1');
     // add no cache directive if it's set in options
     // redirect to install page if there's no database
     try {
         if (headers_sent()) {
             self::$needCharset = true;
         } else {
             header('Content-Type: text/html; charset=' . ($charset = vB5_String::getCharset()));
         }
         $api = Api_InterfaceAbstract::instance();
         $option = $api->callApi('options', 'fetchValues', array(array('nocacheheaders')));
         if (!empty($option['nocacheheaders'])) {
             header("Expires: Fri, 01 Jan 1990 00:00:00 GMT");
             header("Cache-Control: no-cache, no-store, max-age=0, must-revalidate");
             header("Pragma: no-cache");
         }
     } catch (Exception $e) {
         if ($e->getMessage() == 'no_vb5_database') {
             header('Location: ' . vB5_Template_Options::instance()->get('options.bburl') . '/install/index.php');
             exit;
         } else {
             vB5_ApplicationAbstract::handleException($e, true);
         }
     }
 }