summaryrefslogtreecommitdiffstats
path: root/lib/Service/StatusService.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Service/StatusService.php')
-rw-r--r--lib/Service/StatusService.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/Service/StatusService.php b/lib/Service/StatusService.php
index 6233d8d62..066c63ff3 100644
--- a/lib/Service/StatusService.php
+++ b/lib/Service/StatusService.php
@@ -13,7 +13,10 @@
namespace OCA\News\Service;
+use Doctrine\DBAL\Platforms\MySqlPlatform;
+
use OCP\IConfig;
+use OCP\IDBConnection;
use OCA\News\Config\Config;
@@ -23,11 +26,17 @@ class StatusService {
private $settings;
private $config;
private $appName;
+ /**
+ * @var IDBConnection
+ */
+ private $connection;
- public function __construct(IConfig $settings, Config $config, $AppName) {
+ public function __construct(IConfig $settings, IDBConnection $connection,
+ Config $config, $AppName) {
$this->settings = $settings;
$this->config = $config;
$this->appName = $AppName;
+ $this->connection = $connection;
}
public function isProperlyConfigured() {
@@ -49,9 +58,16 @@ class StatusService {
return [
'version' => $version,
'warnings' => [
- 'improperlyConfiguredCron' => !$this->isProperlyConfigured()
+ 'improperlyConfiguredCron' => !$this->isProperlyConfigured(),
+ 'incorrectDbCharset' => $this->hasIncorrectCharset()
]
];
}
+ public function hasIncorrectCharset() {
+ $charset = $this->connection->getParams()['charset'];
+ $platform = $this->connection->getDatabasePlatform();
+ return $platform instanceof MySqlPlatform && $charset !== 'utf8mb4';
+ }
+
} \ No newline at end of file