Pimcore\Tool::exitWithError PHP Метод

exitWithError() публичный статический Метод

public static exitWithError ( $message )
$message
    public static function exitWithError($message)
    {
        while (@ob_end_flush()) {
        }
        if (php_sapi_name() != "cli") {
            header('HTTP/1.1 503 Service Temporarily Unavailable');
        }
        die($message);
    }

Usage Example

Пример #1
1
 /**
  * @static
  * @return mixed|\Zend_Db_Adapter_Abstract
  */
 public static function get()
 {
     try {
         if (\Zend_Registry::isRegistered("Pimcore_Resource_Mysql")) {
             $connection = \Zend_Registry::get("Pimcore_Resource_Mysql");
             if ($connection instanceof Wrapper) {
                 return $connection;
             }
         }
     } catch (\Exception $e) {
         \Logger::error($e);
     }
     // get new connection
     try {
         $db = self::getConnection();
         self::set($db);
         return $db;
     } catch (\Exception $e) {
         $errorMessage = "Unable to establish the database connection with the given configuration in /website/var/config/system.xml, for details see the debug.log. \nReason: " . $e->getMessage();
         \Logger::emergency($errorMessage);
         \Logger::emergency($e);
         \Pimcore\Tool::exitWithError($errorMessage);
     }
 }
All Usage Examples Of Pimcore\Tool::exitWithError