Page MenuHomePhabricator

D12098.diff
No OneTemporary

D12098.diff

diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php
--- a/src/infrastructure/storage/lisk/LiskDAO.php
+++ b/src/infrastructure/storage/lisk/LiskDAO.php
@@ -188,6 +188,7 @@
private static $transactionIsolationLevel = 0;
private $ephemeral = false;
+ private $forcedConnection;
private static $connections = array();
@@ -280,6 +281,21 @@
}
+ /**
+ * Force an object to use a specific connection.
+ *
+ * This overrides all connection management and forces the object to use
+ * a specific connection when interacting with the database.
+ *
+ * @param AphrontDatabaseConnection Connection to force this object to use.
+ * @task conn
+ */
+ public function setForcedConnection(AphrontDatabaseConnection $connection) {
+ $this->forcedConnection = $connection;
+ return $this;
+ }
+
+
/* -( Configuring Lisk )--------------------------------------------------- */
@@ -941,6 +957,10 @@
throw new Exception("Unknown mode '{$mode}', should be 'r' or 'w'.");
}
+ if ($this->forcedConnection) {
+ return $this->forcedConnection;
+ }
+
if (self::shouldIsolateAllLiskEffectsToCurrentProcess()) {
$mode = 'isolate-'.$mode;

File Metadata

Mime Type
text/plain
Expires
Oct 19 2024, 9:01 PM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717035
Default Alt Text
D12098.diff (1 KB)

Event Timeline