aboutsummaryrefslogtreecommitdiff
path: root/caches/SQLiteCache.php
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2022-07-08 14:17:25 +0200
committerGravatar GitHub <noreply@github.com> 2022-07-08 14:17:25 +0200
commitabfc6b4633bdf674002ccf346f54fd80c87f6f3d (patch)
treebf5b15b9083c1f6debdb5eeb2f9492858e3ff59b /caches/SQLiteCache.php
parent951092eef374db048b77bac85e75e3547bfac702 (diff)
downloadrss-bridge-abfc6b4633bdf674002ccf346f54fd80c87f6f3d.tar.gz
rss-bridge-abfc6b4633bdf674002ccf346f54fd80c87f6f3d.tar.zst
rss-bridge-abfc6b4633bdf674002ccf346f54fd80c87f6f3d.zip
feat: introduce template engine (#2899)
Diffstat (limited to 'caches/SQLiteCache.php')
-rw-r--r--caches/SQLiteCache.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/caches/SQLiteCache.php b/caches/SQLiteCache.php
index e8d020a5..6a2273e9 100644
--- a/caches/SQLiteCache.php
+++ b/caches/SQLiteCache.php
@@ -13,7 +13,8 @@ class SQLiteCache implements CacheInterface
public function __construct()
{
if (!extension_loaded('sqlite3')) {
- die('"sqlite3" extension not loaded. Please check "php.ini"');
+ print render('error.html.php', ['message' => '"sqlite3" extension not loaded. Please check "php.ini"']);
+ exit;
}
if (!is_writable(PATH_CACHE)) {
@@ -25,12 +26,16 @@ class SQLiteCache implements CacheInterface
$file = Configuration::getConfig(get_called_class(), 'file');
if (empty($file)) {
- die('Configuration for ' . get_called_class() . ' missing. Please check your ' . FILE_CONFIG);
+ $message = sprintf('Configuration for %s missing. Please check your %s', get_called_class(), FILE_CONFIG);
+ print render('error.html.php', ['message' => $message]);
+ exit;
}
if (dirname($file) == '.') {
$file = PATH_CACHE . $file;
} elseif (!is_dir(dirname($file))) {
- die('Invalid configuration for ' . get_called_class() . '. Please check your ' . FILE_CONFIG);
+ $message = sprintf('Invalid configuration for %s. Please check your %s', get_called_class(), FILE_CONFIG);
+ print render('error.html.php', ['message' => $message]);
+ exit;
}
if (!is_file($file)) {