diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2017-05-24 20:52:23 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2017-05-24 20:52:23 +0200 |
commit | 42c57af9f883984429ae1c529855eeeed7013588 (patch) | |
tree | d6885234eaea8fc86a782d7cd44466a55e6d27a9 /lib | |
parent | 51095a9276fe24cdc2127d85ca461338e27e8ba3 (diff) |
better link11.0.3
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/PageController.php | 2 | ||||
-rw-r--r-- | lib/Service/StatusService.php | 20 |
2 files changed, 19 insertions, 3 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 3d1db0d57..22f79952a 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -68,7 +68,7 @@ class PageController extends Controller { public function index() { $status = $this->statusService->getStatus(); $response = new TemplateResponse($this->appName, 'index', [ - 'cronWarning' => $status['warnings']['improperlyConfiguredCron'], + 'warnings' => $status['warnings'], 'url_generator' => $this->urlGenerator ]); 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 |