diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-04-19 13:05:38 +0200 |
---|---|---|
committer | Côme Chilliet (Rebase PR Action) <come-nc@users.noreply.github.com> | 2022-09-29 15:15:28 +0000 |
commit | 92a5a8f075fe5e6b72037cc4a668090d3a8cacf5 (patch) | |
tree | 198134dd6411f82a077a70b37bec735024437e1d /lib/private/legacy/OC_Util.php | |
parent | b4708fb9f003a306edcfe0346e25f9583c4c162a (diff) | |
download | nextcloud-server-92a5a8f075fe5e6b72037cc4a668090d3a8cacf5.tar.gz nextcloud-server-92a5a8f075fe5e6b72037cc4a668090d3a8cacf5.zip |
Cleanup tags and Share component
- Port to LoggerInterface
- Use IDBConnection and IQueryBuilder instead of raw SQL and OC_DB
- Use IEventListener instead of hooks
- Remove the now unused OC_DB and OC_DB_StatementWrapper legacy utils
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/private/legacy/OC_Util.php')
-rw-r--r-- | lib/private/legacy/OC_Util.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index bf9ed6e29ff..4778fe33097 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -69,6 +69,7 @@ use OC\AppFramework\Http\Request; use OC\Files\SetupManager; use OCP\Files\Template\ITemplateManager; use OCP\IConfig; +use OCP\IDBConnection; use OCP\IGroupManager; use OCP\IURLGenerator; use OCP\IUser; @@ -749,9 +750,13 @@ class OC_Util { $dbType = \OC::$server->getSystemConfig()->getValue('dbtype', 'sqlite'); if ($dbType === 'pgsql') { // check PostgreSQL version + // TODO latest postgresql 8 released was 8 years ago, maybe remove the + // check completely? try { - $result = \OC_DB::executeAudited('SHOW SERVER_VERSION'); - $data = $result->fetchRow(); + /** @var IDBConnection $connection */ + $connection = \OC::$server->get(IDBConnection::class); + $result = $connection->executeQuery('SHOW SERVER_VERSION'); + $data = $result->fetch(); $result->closeCursor(); if (isset($data['server_version'])) { $version = $data['server_version']; |