mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 12:11:19 +03:00
Take all Postgres platform classes into consideration
This commit is contained in:
parent
7310ecd886
commit
187c17319a
3 changed files with 10 additions and 8 deletions
|
@ -20,9 +20,9 @@
|
|||
"ext-pdo": "*",
|
||||
"akrabat/ip-address-middleware": "^2.1",
|
||||
"cakephp/chronos": "^3.0.2",
|
||||
"doctrine/dbal": "^4.0",
|
||||
"doctrine/dbal": "^4.1",
|
||||
"doctrine/migrations": "^3.6",
|
||||
"doctrine/orm": "^3.0",
|
||||
"doctrine/orm": "^3.2",
|
||||
"endroid/qr-code": "^5.0",
|
||||
"friendsofphp/proxy-manager-lts": "^1.0",
|
||||
"geoip2/geoip2": "^3.0",
|
||||
|
|
|
@ -58,9 +58,10 @@ final class OrphanVisitsCountTracker
|
|||
$conn = $em->getConnection();
|
||||
$platformClass = $conn->getDatabasePlatform();
|
||||
|
||||
match ($platformClass::class) {
|
||||
PostgreSQLPlatform::class => $this->incrementForPostgres($conn, $isBot),
|
||||
SQLitePlatform::class, SQLServerPlatform::class => $this->incrementForOthers($conn, $isBot),
|
||||
match (true) {
|
||||
$platformClass instanceof PostgreSQLPlatform => $this->incrementForPostgres($conn, $isBot),
|
||||
$platformClass instanceof SQLitePlatform || $platformClass instanceof SQLServerPlatform
|
||||
=> $this->incrementForOthers($conn, $isBot),
|
||||
default => $this->incrementForMySQL($conn, $isBot),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -64,9 +64,10 @@ final class ShortUrlVisitsCountTracker
|
|||
$conn = $em->getConnection();
|
||||
$platformClass = $conn->getDatabasePlatform();
|
||||
|
||||
match ($platformClass::class) {
|
||||
PostgreSQLPlatform::class => $this->incrementForPostgres($conn, $shortUrlId, $isBot),
|
||||
SQLitePlatform::class, SQLServerPlatform::class => $this->incrementForOthers($conn, $shortUrlId, $isBot),
|
||||
match (true) {
|
||||
$platformClass instanceof PostgreSQLPlatform => $this->incrementForPostgres($conn, $shortUrlId, $isBot),
|
||||
$platformClass instanceof SQLitePlatform || $platformClass instanceof SQLServerPlatform
|
||||
=> $this->incrementForOthers($conn, $shortUrlId, $isBot),
|
||||
default => $this->incrementForMySQL($conn, $shortUrlId, $isBot),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue