Download core/Db/TransactionalDatabaseStaticTrait.php from Leon4gr45/matomo: direct link, hf CLI and curl.
- Browser
- Download file 898 Bytes
-
https://huggingface.co/spaces/Leon4gr45/matomo/resolve/main/core/Db/TransactionalDatabaseStaticTrait.php
- Command line
-
hf download hf://spaces/Leon4gr45/matomo/core/Db/TransactionalDatabaseStaticTrait.php
-
curl -L -o TransactionalDatabaseStaticTrait.php https://huggingface.co/spaces/Leon4gr45/matomo/resolve/main/core/Db/TransactionalDatabaseStaticTrait.php
898 Bytes
| namespace Piwik\Db; | |
| trait TransactionalDatabaseStaticTrait | |
| { | |
| private $supportsTransactionLevelForNonLockingReads; | |
| public function setTransactionIsolationLevel(string $level): void | |
| { | |
| static::query("SET SESSION TRANSACTION ISOLATION LEVEL $level"); | |
| } | |
| public function getCurrentTransactionIsolationLevelForSession(): string | |
| { | |
| try { | |
| return static::fetchOne('SELECT @@TX_ISOLATION'); | |
| } catch (\Exception $e) { | |
| return static::fetchOne('SELECT @@transaction_isolation'); | |
| } | |
| } | |
| public function setSupportsTransactionLevelForNonLockingReads(?bool $supports = null): void | |
| { | |
| $this->supportsTransactionLevelForNonLockingReads = $supports; | |
| } | |
| public function getSupportsTransactionLevelForNonLockingReads(): ?bool | |
| { | |
| return $this->supportsTransactionLevelForNonLockingReads; | |
| } | |
| } | |