forked from mautic/mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an offline static page for when a runtime exception occurs or i…
…f the database connection is down.
- Loading branch information
1 parent
17a0217
commit 665263b
Showing
4 changed files
with
99 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/bundles/CoreBundle/Exception/DatabaseConnectionException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
/** | ||
* @package Mautic | ||
* @copyright 2014 Mautic Contributors. All rights reserved. | ||
* @author Mautic | ||
* @link http://mautic.org | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
*/ | ||
|
||
namespace Mautic\CoreBundle\Exception; | ||
|
||
|
||
class DatabaseConnectionException extends \Exception | ||
{ | ||
public function __construct($message = 'Unable to connect to the database.', $code = 0, \Exception $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
defined('MAUTIC_OFFLINE') or die('access denied'); | ||
|
||
// Get the URLs base path | ||
$base = str_replace('index.php', '', $_SERVER['SCRIPT_NAME']); | ||
|
||
// Determine if there is an asset prefix | ||
$root = __DIR__; | ||
include $root . '/app/config/paths.php'; | ||
$assetPrefix = $paths['asset_prefix']; | ||
if (!empty($assetPrefix)) { | ||
if (substr($assetPrefix, -1) == '/') { | ||
$assetPrefix = substr($assetPrefix, 0, -1); | ||
} | ||
} | ||
$assetBase = $assetPrefix . $base . $paths['assets']; | ||
?> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
|
||
<title><?php echo $_SERVER['HTTP_HOST']; ?></title> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="<?php echo $assetBase . '/images/favicon.ico'; ?>" /> | ||
<link rel="stylesheet" href="<?php echo $assetBase . '/css/libraries.css'; ?>" /> | ||
<link rel="stylesheet" href="<?php echo $assetBase . '/css/app.css'; ?>" /> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-sm-offset-3 col-sm-6"> | ||
<div class="bg-white pa-lg text-center" style="margin-top:100px;"> | ||
<i class="fa fa-warning fa-5x"></i> | ||
<h2><?php echo $message; ?></h2> | ||
<?php if (!empty($submessage)): ?> | ||
<h4 class="mt-15"><?php echo $submessage; ?></h4> | ||
<?php endif; ?> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |