fixed pgsql db issue;close #38

This commit is contained in:
huangjx
2022-03-20 16:39:50 +08:00
parent f6eb5eae52
commit 2ec569e2b5
3 changed files with 22 additions and 4 deletions

View File

@@ -124,4 +124,18 @@ class DbHelper
return $query->execute();
}
public function getDBType(): string
{
return \OC::$server->getConfig()->getSystemValue('dbtype', "mysql");
}
public function getExtra($data)
{
if ($this->getDBType() == "pgsql" && is_resource($data)) {
$extra = pg_unescape_bytea(stream_get_contents($data));
return unserialize($extra);
}
return unserialize($data);
}
}