/**
* @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);
}
}