From d5c93e12e975cd301bc1bfd773dde0d0643d0d45 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 14 Mar 2015 15:07:57 +1100 Subject: [PATCH] Don't try to log 404s without a DB --- modules/system/models/RequestLog.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/system/models/RequestLog.php b/modules/system/models/RequestLog.php index 00a95971e..d32278fcb 100644 --- a/modules/system/models/RequestLog.php +++ b/modules/system/models/RequestLog.php @@ -2,6 +2,7 @@ use Model; use Request; +use DbDongle; /** * Model for logging 404 errors @@ -32,6 +33,8 @@ class RequestLog extends Model */ public static function add($statusCode = 404) { + if (!DbDongle::hasDatabase()) return; + $record = static::firstOrNew([ 'url' => Request::fullUrl(), 'status_code' => $statusCode,