summaryrefslogtreecommitdiffstats
path: root/lib/private/Settings/Admin/Overview.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Settings/Admin/Overview.php')
-rw-r--r--lib/private/Settings/Admin/Overview.php90
1 files changed, 1 insertions, 89 deletions
diff --git a/lib/private/Settings/Admin/Overview.php b/lib/private/Settings/Admin/Overview.php
index 6e186dc6f98..51e5808f487 100644
--- a/lib/private/Settings/Admin/Overview.php
+++ b/lib/private/Settings/Admin/Overview.php
@@ -23,112 +23,24 @@
namespace OC\Settings\Admin;
-use Doctrine\DBAL\Connection;
-use Doctrine\DBAL\DBALException;
-use Doctrine\DBAL\Platforms\SqlitePlatform;
-use OC\Lock\DBLockingProvider;
-use OC\Lock\NoopLockingProvider;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
-use OCP\IDBConnection;
-use OCP\IL10N;
-use OCP\IRequest;
-use OCP\Lock\ILockingProvider;
use OCP\Settings\ISettings;
class Overview implements ISettings {
- /** @var IDBConnection|Connection */
- private $db;
- /** @var IRequest */
- private $request;
/** @var IConfig */
private $config;
- /** @var ILockingProvider */
- private $lockingProvider;
- /** @var IL10N */
- private $l;
- /**
- * @param IDBConnection $db
- * @param IRequest $request
- * @param IConfig $config
- * @param ILockingProvider $lockingProvider
- * @param IL10N $l
- */
- public function __construct(IDBConnection $db,
- IRequest $request,
- IConfig $config,
- ILockingProvider $lockingProvider,
- IL10N $l) {
- $this->db = $db;
- $this->request = $request;
+ public function __construct(IConfig $config) {
$this->config = $config;
- $this->lockingProvider = $lockingProvider;
- $this->l = $l;
}
/**
* @return TemplateResponse
*/
public function getForm() {
- try {
- if ($this->db->getDatabasePlatform() instanceof SqlitePlatform) {
- $invalidTransactionIsolationLevel = false;
- } else {
- $invalidTransactionIsolationLevel = $this->db->getTransactionIsolation() !== Connection::TRANSACTION_READ_COMMITTED;
- }
- } catch (DBALException $e) {
- // ignore
- $invalidTransactionIsolationLevel = false;
- }
-
- $envPath = getenv('PATH');
-
- // warn if outdated version of a memcache module is used
- $caches = [
- 'apcu' => ['name' => $this->l->t('APCu'), 'version' => '4.0.6'],
- 'redis' => ['name' => $this->l->t('Redis'), 'version' => '2.2.5'],
- ];
- $outdatedCaches = [];
- foreach ($caches as $php_module => $data) {
- $isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<');
- if ($isOutdated) {
- $outdatedCaches[$php_module] = $data;
- }
- }
-
- if ($this->lockingProvider instanceof NoopLockingProvider) {
- $fileLockingType = 'none';
- } else if ($this->lockingProvider instanceof DBLockingProvider) {
- $fileLockingType = 'db';
- } else {
- $fileLockingType = 'cache';
- }
-
- $suggestedOverwriteCliUrl = '';
- if ($this->config->getSystemValue('overwrite.cli.url', '') === '') {
- $suggestedOverwriteCliUrl = $this->request->getServerProtocol() . '://' . $this->request->getInsecureServerHost() . \OC::$WEBROOT;
- if (!$this->config->getSystemValue('config_is_read_only', false)) {
- // Set the overwrite URL when it was not set yet.
- $this->config->setSystemValue('overwrite.cli.url', $suggestedOverwriteCliUrl);
- $suggestedOverwriteCliUrl = '';
- }
- }
-
$parameters = [
- // Diagnosis
- 'readOnlyConfigEnabled' => \OC_Helper::isReadOnlyConfigEnabled(),
- 'isLocaleWorking' => \OC_Util::isSetLocaleWorking(),
- 'isAnnotationsWorking' => \OC_Util::isAnnotationsWorking(),
'checkForWorkingWellKnownSetup' => $this->config->getSystemValue('check_for_working_wellknown_setup', true),
- 'has_fileinfo' => \OC_Util::fileInfoLoaded(),
- 'invalidTransactionIsolationLevel' => $invalidTransactionIsolationLevel,
- 'getenvServerNotWorking' => empty($envPath),
- 'OutdatedCacheWarning' => $outdatedCaches,
- 'fileLockingType' => $fileLockingType,
- 'suggestedOverwriteCliUrl' => $suggestedOverwriteCliUrl,
- 'lastcron' => $this->config->getAppValue('core', 'lastcron', false),
- 'cronErrors' => $this->config->getAppValue('core', 'cronErrors'),
];
return new TemplateResponse('settings', 'settings/admin/overview', $parameters, '');